From 696978a6320a9203c262113dae736dcf1e032dde Mon Sep 17 00:00:00 2001 From: NAHID HK <117029405+nahidhk@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:14:00 +0600 Subject: [PATCH 1/3] Create SECURITY.md --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..034e848 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From ef39aa0eced188959907a873808a4fa22f74e429 Mon Sep 17 00:00:00 2001 From: nahidhk Date: Tue, 6 Feb 2024 12:20:21 +0600 Subject: [PATCH 2/3] update --- node_modules/.bin/acorn | 16 - node_modules/.bin/acorn.cmd | 17 - node_modules/.bin/acorn.ps1 | 28 - node_modules/.bin/browserslist | 16 - node_modules/.bin/browserslist.cmd | 17 - node_modules/.bin/browserslist.ps1 | 28 - node_modules/.bin/envinfo | 16 - node_modules/.bin/envinfo.cmd | 17 - node_modules/.bin/envinfo.ps1 | 28 - node_modules/.bin/flat | 16 - node_modules/.bin/flat.cmd | 17 - node_modules/.bin/flat.ps1 | 28 - node_modules/.bin/import-local-fixture | 16 - node_modules/.bin/import-local-fixture.cmd | 17 - node_modules/.bin/import-local-fixture.ps1 | 28 - node_modules/.bin/json5 | 16 - node_modules/.bin/json5.cmd | 17 - node_modules/.bin/json5.ps1 | 28 - node_modules/.bin/node-which | 16 - node_modules/.bin/node-which.cmd | 17 - node_modules/.bin/node-which.ps1 | 28 - node_modules/.bin/resolve | 16 - node_modules/.bin/resolve.cmd | 17 - node_modules/.bin/resolve.ps1 | 28 - node_modules/.bin/terser | 16 - node_modules/.bin/terser.cmd | 17 - node_modules/.bin/terser.ps1 | 28 - node_modules/.bin/ts-node | 16 - node_modules/.bin/ts-node-cwd | 16 - node_modules/.bin/ts-node-cwd.cmd | 17 - node_modules/.bin/ts-node-cwd.ps1 | 28 - node_modules/.bin/ts-node-esm | 16 - node_modules/.bin/ts-node-esm.cmd | 17 - node_modules/.bin/ts-node-esm.ps1 | 28 - node_modules/.bin/ts-node-script | 16 - node_modules/.bin/ts-node-script.cmd | 17 - node_modules/.bin/ts-node-script.ps1 | 28 - node_modules/.bin/ts-node-transpile-only | 16 - node_modules/.bin/ts-node-transpile-only.cmd | 17 - node_modules/.bin/ts-node-transpile-only.ps1 | 28 - node_modules/.bin/ts-node.cmd | 17 - node_modules/.bin/ts-node.ps1 | 28 - node_modules/.bin/ts-script | 16 - node_modules/.bin/ts-script.cmd | 17 - node_modules/.bin/ts-script.ps1 | 28 - node_modules/.bin/tsc | 16 - node_modules/.bin/tsc.cmd | 17 - node_modules/.bin/tsc.ps1 | 28 - node_modules/.bin/tsserver | 16 - node_modules/.bin/tsserver.cmd | 17 - node_modules/.bin/tsserver.ps1 | 28 - node_modules/.bin/update-browserslist-db | 16 - node_modules/.bin/update-browserslist-db.cmd | 17 - node_modules/.bin/update-browserslist-db.ps1 | 28 - node_modules/.bin/webpack | 16 - node_modules/.bin/webpack-cli | 16 - node_modules/.bin/webpack-cli.cmd | 17 - node_modules/.bin/webpack-cli.ps1 | 28 - node_modules/.bin/webpack.cmd | 17 - node_modules/.bin/webpack.ps1 | 28 - node_modules/.package-lock.json | 1690 - .../@cspotcode/source-map-support/LICENSE.md | 21 - .../@cspotcode/source-map-support/README.md | 289 - .../browser-source-map-support.js | 114 - .../@jridgewell/trace-mapping/LICENSE | 19 - .../@jridgewell/trace-mapping/README.md | 193 - .../trace-mapping/dist/trace-mapping.mjs | 514 - .../trace-mapping/dist/trace-mapping.mjs.map | 1 - .../trace-mapping/dist/trace-mapping.umd.js | 528 - .../dist/trace-mapping.umd.js.map | 1 - .../trace-mapping/dist/types/any-map.d.ts | 8 - .../dist/types/binary-search.d.ts | 32 - .../trace-mapping/dist/types/by-source.d.ts | 7 - .../trace-mapping/dist/types/resolve.d.ts | 1 - .../trace-mapping/dist/types/sort.d.ts | 2 - .../dist/types/sourcemap-segment.d.ts | 16 - .../dist/types/strip-filename.d.ts | 4 - .../dist/types/trace-mapping.d.ts | 70 - .../trace-mapping/dist/types/types.d.ts | 85 - .../@jridgewell/trace-mapping/package.json | 70 - .../source-map-support/package.json | 50 - .../register-hook-require.d.ts | 7 - .../register-hook-require.js | 3 - .../source-map-support/register.d.ts | 7 - .../@cspotcode/source-map-support/register.js | 1 - .../source-map-support.d.ts | 76 - .../source-map-support/source-map-support.js | 938 - node_modules/@discoveryjs/json-ext/LICENSE | 21 - node_modules/@discoveryjs/json-ext/README.md | 256 - .../@discoveryjs/json-ext/dist/json-ext.js | 791 - .../json-ext/dist/json-ext.min.js | 1 - .../@discoveryjs/json-ext/dist/version.js | 1 - node_modules/@discoveryjs/json-ext/index.d.ts | 31 - .../@discoveryjs/json-ext/package.json | 56 - .../@discoveryjs/json-ext/src/index.js | 6 - .../json-ext/src/parse-chunked.js | 384 - .../json-ext/src/stringify-info.js | 231 - .../json-ext/src/stringify-stream-browser.js | 3 - .../json-ext/src/stringify-stream.js | 408 - .../json-ext/src/text-decoder-browser.js | 1 - .../@discoveryjs/json-ext/src/text-decoder.js | 1 - .../@discoveryjs/json-ext/src/utils.js | 149 - .../@discoveryjs/json-ext/src/version.js | 1 - node_modules/@jridgewell/gen-mapping/LICENSE | 19 - .../@jridgewell/gen-mapping/README.md | 227 - .../gen-mapping/dist/gen-mapping.mjs | 230 - .../gen-mapping/dist/gen-mapping.mjs.map | 1 - .../gen-mapping/dist/gen-mapping.umd.js | 236 - .../gen-mapping/dist/gen-mapping.umd.js.map | 1 - .../gen-mapping/dist/types/gen-mapping.d.ts | 90 - .../dist/types/sourcemap-segment.d.ts | 12 - .../gen-mapping/dist/types/types.d.ts | 35 - .../@jridgewell/gen-mapping/package.json | 77 - node_modules/@jridgewell/resolve-uri/LICENSE | 19 - .../@jridgewell/resolve-uri/README.md | 40 - .../resolve-uri/dist/resolve-uri.mjs | 242 - .../resolve-uri/dist/resolve-uri.mjs.map | 1 - .../resolve-uri/dist/resolve-uri.umd.js | 250 - .../resolve-uri/dist/resolve-uri.umd.js.map | 1 - .../resolve-uri/dist/types/resolve-uri.d.ts | 4 - .../@jridgewell/resolve-uri/package.json | 69 - node_modules/@jridgewell/set-array/LICENSE | 19 - node_modules/@jridgewell/set-array/README.md | 37 - .../@jridgewell/set-array/dist/set-array.mjs | 48 - .../set-array/dist/set-array.mjs.map | 1 - .../set-array/dist/set-array.umd.js | 58 - .../set-array/dist/set-array.umd.js.map | 1 - .../set-array/dist/types/set-array.d.ts | 26 - .../@jridgewell/set-array/package.json | 66 - .../@jridgewell/set-array/src/set-array.ts | 55 - node_modules/@jridgewell/source-map/LICENSE | 19 - node_modules/@jridgewell/source-map/README.md | 82 - .../source-map/dist/source-map.mjs | 928 - .../source-map/dist/source-map.mjs.map | 1 - .../source-map/dist/source-map.umd.js | 939 - .../source-map/dist/source-map.umd.js.map | 1 - .../source-map/dist/types/source-map.d.ts | 25 - .../@jridgewell/source-map/package.json | 71 - .../@jridgewell/sourcemap-codec/LICENSE | 21 - .../@jridgewell/sourcemap-codec/README.md | 200 - .../sourcemap-codec/dist/sourcemap-codec.mjs | 164 - .../dist/sourcemap-codec.mjs.map | 1 - .../dist/sourcemap-codec.umd.js | 175 - .../dist/sourcemap-codec.umd.js.map | 1 - .../dist/types/sourcemap-codec.d.ts | 6 - .../@jridgewell/sourcemap-codec/package.json | 74 - .../@jridgewell/trace-mapping/LICENSE | 19 - .../@jridgewell/trace-mapping/README.md | 252 - .../trace-mapping/dist/trace-mapping.mjs | 552 - .../trace-mapping/dist/trace-mapping.mjs.map | 1 - .../trace-mapping/dist/trace-mapping.umd.js | 560 - .../dist/trace-mapping.umd.js.map | 1 - .../trace-mapping/dist/types/any-map.d.ts | 8 - .../dist/types/binary-search.d.ts | 32 - .../trace-mapping/dist/types/by-source.d.ts | 7 - .../trace-mapping/dist/types/resolve.d.ts | 1 - .../trace-mapping/dist/types/sort.d.ts | 2 - .../dist/types/sourcemap-segment.d.ts | 16 - .../dist/types/strip-filename.d.ts | 4 - .../dist/types/trace-mapping.d.ts | 74 - .../trace-mapping/dist/types/types.d.ts | 92 - .../@jridgewell/trace-mapping/package.json | 75 - node_modules/@tsconfig/node10/LICENSE | 21 - node_modules/@tsconfig/node10/README.md | 40 - node_modules/@tsconfig/node10/package.json | 1 - node_modules/@tsconfig/node10/tsconfig.json | 16 - node_modules/@tsconfig/node12/LICENSE | 21 - node_modules/@tsconfig/node12/README.md | 40 - node_modules/@tsconfig/node12/package.json | 1 - node_modules/@tsconfig/node12/tsconfig.json | 16 - node_modules/@tsconfig/node14/LICENSE | 21 - node_modules/@tsconfig/node14/README.md | 40 - node_modules/@tsconfig/node14/package.json | 1 - node_modules/@tsconfig/node14/tsconfig.json | 16 - node_modules/@tsconfig/node16/LICENSE | 21 - node_modules/@tsconfig/node16/README.md | 40 - node_modules/@tsconfig/node16/package.json | 15 - node_modules/@tsconfig/node16/tsconfig.json | 16 - node_modules/@types/eslint-scope/LICENSE | 21 - node_modules/@types/eslint-scope/README.md | 90 - node_modules/@types/eslint-scope/index.d.ts | 71 - node_modules/@types/eslint-scope/package.json | 28 - node_modules/@types/eslint/LICENSE | 21 - node_modules/@types/eslint/README.md | 15 - node_modules/@types/eslint/helpers.d.ts | 3 - node_modules/@types/eslint/index.d.ts | 1491 - node_modules/@types/eslint/package.json | 65 - .../@types/eslint/rules/best-practices.d.ts | 931 - .../@types/eslint/rules/deprecated.d.ts | 267 - .../@types/eslint/rules/ecmascript-6.d.ts | 502 - node_modules/@types/eslint/rules/index.d.ts | 23 - .../@types/eslint/rules/node-commonjs.d.ts | 133 - .../@types/eslint/rules/possible-errors.d.ts | 499 - .../@types/eslint/rules/strict-mode.d.ts | 11 - .../@types/eslint/rules/stylistic-issues.d.ts | 1905 - .../@types/eslint/rules/variables.d.ts | 187 - .../@types/eslint/use-at-your-own-risk.d.ts | 19 - node_modules/@types/estree/LICENSE | 21 - node_modules/@types/estree/README.md | 15 - node_modules/@types/estree/flow.d.ts | 167 - node_modules/@types/estree/index.d.ts | 683 - node_modules/@types/estree/package.json | 26 - node_modules/@types/json-schema/LICENSE | 21 - node_modules/@types/json-schema/README.md | 15 - node_modules/@types/json-schema/index.d.ts | 749 - node_modules/@types/json-schema/package.json | 40 - node_modules/@types/node/LICENSE | 21 - node_modules/@types/node/README.md | 15 - node_modules/@types/node/assert.d.ts | 996 - node_modules/@types/node/assert/strict.d.ts | 8 - node_modules/@types/node/async_hooks.d.ts | 539 - node_modules/@types/node/buffer.d.ts | 2362 -- node_modules/@types/node/child_process.d.ts | 1540 - node_modules/@types/node/cluster.d.ts | 432 - node_modules/@types/node/console.d.ts | 415 - node_modules/@types/node/constants.d.ts | 19 - node_modules/@types/node/crypto.d.ts | 4487 --- node_modules/@types/node/dgram.d.ts | 596 - .../@types/node/diagnostics_channel.d.ts | 545 - node_modules/@types/node/dns.d.ts | 809 - node_modules/@types/node/dns/promises.d.ts | 425 - node_modules/@types/node/dom-events.d.ts | 122 - node_modules/@types/node/domain.d.ts | 170 - node_modules/@types/node/events.d.ts | 879 - node_modules/@types/node/fs.d.ts | 4311 --- node_modules/@types/node/fs/promises.d.ts | 1239 - node_modules/@types/node/globals.d.ts | 411 - node_modules/@types/node/globals.global.d.ts | 1 - node_modules/@types/node/http.d.ts | 1887 - node_modules/@types/node/http2.d.ts | 2382 -- node_modules/@types/node/https.d.ts | 550 - node_modules/@types/node/index.d.ts | 88 - node_modules/@types/node/inspector.d.ts | 2747 -- node_modules/@types/node/module.d.ts | 315 - node_modules/@types/node/net.d.ts | 949 - node_modules/@types/node/os.d.ts | 478 - node_modules/@types/node/package.json | 229 - node_modules/@types/node/path.d.ts | 191 - node_modules/@types/node/perf_hooks.d.ts | 645 - node_modules/@types/node/process.d.ts | 1561 - node_modules/@types/node/punycode.d.ts | 117 - node_modules/@types/node/querystring.d.ts | 141 - node_modules/@types/node/readline.d.ts | 539 - .../@types/node/readline/promises.d.ts | 150 - node_modules/@types/node/repl.d.ts | 430 - node_modules/@types/node/stream.d.ts | 1701 - .../@types/node/stream/consumers.d.ts | 12 - node_modules/@types/node/stream/promises.d.ts | 83 - node_modules/@types/node/stream/web.d.ts | 366 - node_modules/@types/node/string_decoder.d.ts | 67 - node_modules/@types/node/test.d.ts | 1465 - node_modules/@types/node/timers.d.ts | 240 - node_modules/@types/node/timers/promises.d.ts | 93 - node_modules/@types/node/tls.d.ts | 1210 - node_modules/@types/node/trace_events.d.ts | 182 - node_modules/@types/node/ts4.8/assert.d.ts | 996 - .../@types/node/ts4.8/assert/strict.d.ts | 8 - .../@types/node/ts4.8/async_hooks.d.ts | 539 - node_modules/@types/node/ts4.8/buffer.d.ts | 2362 -- .../@types/node/ts4.8/child_process.d.ts | 1540 - node_modules/@types/node/ts4.8/cluster.d.ts | 432 - node_modules/@types/node/ts4.8/console.d.ts | 415 - node_modules/@types/node/ts4.8/constants.d.ts | 19 - node_modules/@types/node/ts4.8/crypto.d.ts | 4487 --- node_modules/@types/node/ts4.8/dgram.d.ts | 596 - .../node/ts4.8/diagnostics_channel.d.ts | 545 - node_modules/@types/node/ts4.8/dns.d.ts | 809 - .../@types/node/ts4.8/dns/promises.d.ts | 425 - .../@types/node/ts4.8/dom-events.d.ts | 122 - node_modules/@types/node/ts4.8/domain.d.ts | 170 - node_modules/@types/node/ts4.8/events.d.ts | 879 - node_modules/@types/node/ts4.8/fs.d.ts | 4311 --- .../@types/node/ts4.8/fs/promises.d.ts | 1239 - node_modules/@types/node/ts4.8/globals.d.ts | 411 - .../@types/node/ts4.8/globals.global.d.ts | 1 - node_modules/@types/node/ts4.8/http.d.ts | 1887 - node_modules/@types/node/ts4.8/http2.d.ts | 2382 -- node_modules/@types/node/ts4.8/https.d.ts | 550 - node_modules/@types/node/ts4.8/index.d.ts | 88 - node_modules/@types/node/ts4.8/inspector.d.ts | 2747 -- node_modules/@types/node/ts4.8/module.d.ts | 315 - node_modules/@types/node/ts4.8/net.d.ts | 949 - node_modules/@types/node/ts4.8/os.d.ts | 478 - node_modules/@types/node/ts4.8/path.d.ts | 191 - .../@types/node/ts4.8/perf_hooks.d.ts | 645 - node_modules/@types/node/ts4.8/process.d.ts | 1561 - node_modules/@types/node/ts4.8/punycode.d.ts | 117 - .../@types/node/ts4.8/querystring.d.ts | 141 - node_modules/@types/node/ts4.8/readline.d.ts | 539 - .../@types/node/ts4.8/readline/promises.d.ts | 150 - node_modules/@types/node/ts4.8/repl.d.ts | 430 - node_modules/@types/node/ts4.8/stream.d.ts | 1701 - .../@types/node/ts4.8/stream/consumers.d.ts | 12 - .../@types/node/ts4.8/stream/promises.d.ts | 83 - .../@types/node/ts4.8/stream/web.d.ts | 366 - .../@types/node/ts4.8/string_decoder.d.ts | 67 - node_modules/@types/node/ts4.8/test.d.ts | 1465 - node_modules/@types/node/ts4.8/timers.d.ts | 240 - .../@types/node/ts4.8/timers/promises.d.ts | 93 - node_modules/@types/node/ts4.8/tls.d.ts | 1210 - .../@types/node/ts4.8/trace_events.d.ts | 182 - node_modules/@types/node/ts4.8/tty.d.ts | 208 - node_modules/@types/node/ts4.8/url.d.ts | 927 - node_modules/@types/node/ts4.8/util.d.ts | 2183 -- node_modules/@types/node/ts4.8/v8.d.ts | 635 - node_modules/@types/node/ts4.8/vm.d.ts | 903 - node_modules/@types/node/ts4.8/wasi.d.ts | 179 - .../@types/node/ts4.8/worker_threads.d.ts | 691 - node_modules/@types/node/ts4.8/zlib.d.ts | 517 - node_modules/@types/node/tty.d.ts | 208 - node_modules/@types/node/url.d.ts | 927 - node_modules/@types/node/util.d.ts | 2183 -- node_modules/@types/node/v8.d.ts | 635 - node_modules/@types/node/vm.d.ts | 903 - node_modules/@types/node/wasi.d.ts | 179 - node_modules/@types/node/worker_threads.d.ts | 691 - node_modules/@types/node/zlib.d.ts | 517 - node_modules/@types/webpack/LICENSE | 21 - node_modules/@types/webpack/README.md | 23 - node_modules/@types/webpack/index.d.ts | 4 - node_modules/@types/webpack/package.json | 134 - node_modules/@webassemblyjs/ast/README.md | 167 - node_modules/@webassemblyjs/ast/lib/clone.js | 11 - .../@webassemblyjs/ast/lib/definitions.js | 670 - node_modules/@webassemblyjs/ast/lib/index.js | 129 - .../@webassemblyjs/ast/lib/node-helpers.js | 107 - .../@webassemblyjs/ast/lib/node-path.js | 148 - node_modules/@webassemblyjs/ast/lib/nodes.js | 1144 - .../@webassemblyjs/ast/lib/signatures.js | 207 - .../ast-module-to-module-context/index.js | 389 - .../denormalize-type-references/index.js | 83 - .../wast-identifier-to-index/index.js | 238 - .../@webassemblyjs/ast/lib/traverse.js | 105 - .../@webassemblyjs/ast/lib/types/basic.js | 1 - .../@webassemblyjs/ast/lib/types/nodes.js | 1 - .../@webassemblyjs/ast/lib/types/traverse.js | 1 - node_modules/@webassemblyjs/ast/lib/utils.js | 315 - node_modules/@webassemblyjs/ast/package.json | 31 - .../ast/scripts/generateNodeUtils.js | 219 - .../ast/scripts/generateTypeDefinitions.js | 48 - .../@webassemblyjs/ast/scripts/util.js | 38 - .../floating-point-hex-parser/LICENSE | 21 - .../floating-point-hex-parser/README.md | 34 - .../floating-point-hex-parser/lib/index.js | 49 - .../floating-point-hex-parser/package.json | 23 - .../helper-api-error/lib/index.js | 78 - .../helper-api-error/package.json | 17 - .../helper-buffer/lib/compare.js | 73 - .../@webassemblyjs/helper-buffer/lib/index.js | 89 - .../@webassemblyjs/helper-buffer/package.json | 23 - .../helper-numbers/lib/index.js | 117 - .../helper-numbers/package.json | 24 - .../helper-numbers/src/index.js | 106 - .../helper-wasm-bytecode/lib/index.js | 406 - .../helper-wasm-bytecode/lib/section.js | 38 - .../helper-wasm-bytecode/package.json | 19 - .../helper-wasm-section/lib/create.js | 123 - .../helper-wasm-section/lib/index.js | 35 - .../helper-wasm-section/lib/remove.js | 45 - .../helper-wasm-section/lib/resize.js | 90 - .../helper-wasm-section/package.json | 28 - .../@webassemblyjs/ieee754/lib/index.js | 52 - .../@webassemblyjs/ieee754/package.json | 22 - .../@webassemblyjs/ieee754/src/index.js | 47 - .../@webassemblyjs/leb128/LICENSE.txt | 194 - .../@webassemblyjs/leb128/lib/bits.js | 156 - .../@webassemblyjs/leb128/lib/bufs.js | 236 - .../@webassemblyjs/leb128/lib/index.js | 59 - node_modules/@webassemblyjs/leb128/lib/leb.js | 343 - .../@webassemblyjs/leb128/package.json | 22 - .../@webassemblyjs/utf8/lib/decoder.js | 74 - .../@webassemblyjs/utf8/lib/encoder.js | 67 - node_modules/@webassemblyjs/utf8/lib/index.js | 21 - node_modules/@webassemblyjs/utf8/package.json | 19 - .../@webassemblyjs/utf8/src/decoder.js | 67 - .../@webassemblyjs/utf8/src/encoder.js | 44 - node_modules/@webassemblyjs/utf8/src/index.js | 4 - .../@webassemblyjs/utf8/test/index.js | 13 - .../@webassemblyjs/wasm-edit/README.md | 86 - .../@webassemblyjs/wasm-edit/lib/apply.js | 318 - .../@webassemblyjs/wasm-edit/lib/index.js | 134 - .../@webassemblyjs/wasm-edit/package.json | 32 - .../wasm-gen/lib/encoder/index.js | 372 - .../@webassemblyjs/wasm-gen/lib/index.js | 68 - .../@webassemblyjs/wasm-gen/package.json | 26 - .../@webassemblyjs/wasm-opt/lib/index.js | 66 - .../@webassemblyjs/wasm-opt/lib/leb128.js | 56 - .../@webassemblyjs/wasm-opt/package.json | 25 - .../@webassemblyjs/wasm-parser/README.md | 28 - .../@webassemblyjs/wasm-parser/lib/decoder.js | 1821 - .../@webassemblyjs/wasm-parser/lib/index.js | 262 - .../wasm-parser/lib/types/decoder.js | 1 - .../@webassemblyjs/wasm-parser/package.json | 43 - .../@webassemblyjs/wast-printer/README.md | 17 - .../@webassemblyjs/wast-printer/lib/index.js | 931 - .../@webassemblyjs/wast-printer/package.json | 35 - node_modules/@webpack-cli/configtest/LICENSE | 20 - .../@webpack-cli/configtest/README.md | 31 - .../@webpack-cli/configtest/lib/index.d.ts | 5 - .../@webpack-cli/configtest/lib/index.js | 53 - .../@webpack-cli/configtest/package.json | 27 - node_modules/@webpack-cli/info/LICENSE | 20 - node_modules/@webpack-cli/info/README.md | 54 - node_modules/@webpack-cli/info/lib/index.d.ts | 5 - node_modules/@webpack-cli/info/lib/index.js | 17 - node_modules/@webpack-cli/info/package.json | 27 - node_modules/@webpack-cli/serve/LICENSE | 20 - node_modules/@webpack-cli/serve/README.md | 32 - .../@webpack-cli/serve/lib/index.d.ts | 5 - node_modules/@webpack-cli/serve/lib/index.js | 174 - node_modules/@webpack-cli/serve/package.json | 33 - node_modules/@xtuc/ieee754/LICENSE | 28 - node_modules/@xtuc/ieee754/README.md | 51 - node_modules/@xtuc/ieee754/dist/.gitkeep | 0 node_modules/@xtuc/ieee754/dist/index.cjs.js | 96 - node_modules/@xtuc/ieee754/index.js | 84 - node_modules/@xtuc/ieee754/package.json | 42 - node_modules/@xtuc/long/LICENSE | 202 - node_modules/@xtuc/long/README.md | 257 - node_modules/@xtuc/long/dist/long.js | 2 - node_modules/@xtuc/long/dist/long.js.map | 1 - node_modules/@xtuc/long/index.d.ts | 429 - node_modules/@xtuc/long/index.js | 1 - node_modules/@xtuc/long/package.json | 36 - node_modules/@xtuc/long/src/long.js | 1405 - .../acorn-import-assertions/README.md | 15 - .../acorn-import-assertions/lib/index.js | 235 - .../acorn-import-assertions/lib/index.mjs | 242 - .../acorn-import-assertions/package.json | 49 - .../acorn-import-assertions/src/index.js | 242 - node_modules/acorn-walk/CHANGELOG.md | 181 - node_modules/acorn-walk/LICENSE | 21 - node_modules/acorn-walk/README.md | 124 - node_modules/acorn-walk/dist/walk.d.mts | 177 - node_modules/acorn-walk/dist/walk.d.ts | 177 - node_modules/acorn-walk/dist/walk.js | 461 - node_modules/acorn-walk/dist/walk.mjs | 443 - node_modules/acorn-walk/package.json | 47 - node_modules/acorn/CHANGELOG.md | 880 - node_modules/acorn/LICENSE | 21 - node_modules/acorn/README.md | 283 - node_modules/acorn/bin/acorn | 4 - node_modules/acorn/dist/acorn.d.mts | 857 - node_modules/acorn/dist/acorn.d.ts | 857 - node_modules/acorn/dist/acorn.js | 6002 --- node_modules/acorn/dist/acorn.mjs | 5973 --- node_modules/acorn/dist/bin.js | 90 - node_modules/acorn/package.json | 50 - node_modules/ajv-keywords/LICENSE | 21 - node_modules/ajv-keywords/README.md | 836 - node_modules/ajv-keywords/ajv-keywords.d.ts | 7 - node_modules/ajv-keywords/index.js | 35 - .../ajv-keywords/keywords/_formatLimit.js | 101 - node_modules/ajv-keywords/keywords/_util.js | 15 - .../ajv-keywords/keywords/allRequired.js | 18 - .../ajv-keywords/keywords/anyRequired.js | 24 - .../ajv-keywords/keywords/deepProperties.js | 54 - .../ajv-keywords/keywords/deepRequired.js | 57 - .../keywords/dot/_formatLimit.jst | 116 - .../keywords/dot/patternRequired.jst | 33 - .../ajv-keywords/keywords/dot/switch.jst | 71 - .../ajv-keywords/keywords/dotjs/README.md | 3 - .../keywords/dotjs/_formatLimit.js | 178 - .../keywords/dotjs/patternRequired.js | 58 - .../ajv-keywords/keywords/dotjs/switch.js | 129 - .../ajv-keywords/keywords/dynamicDefaults.js | 72 - .../ajv-keywords/keywords/formatMaximum.js | 3 - .../ajv-keywords/keywords/formatMinimum.js | 3 - node_modules/ajv-keywords/keywords/index.js | 22 - .../ajv-keywords/keywords/instanceof.js | 58 - .../ajv-keywords/keywords/oneRequired.js | 24 - .../ajv-keywords/keywords/patternRequired.js | 21 - .../ajv-keywords/keywords/prohibited.js | 24 - node_modules/ajv-keywords/keywords/range.js | 36 - node_modules/ajv-keywords/keywords/regexp.js | 36 - node_modules/ajv-keywords/keywords/select.js | 79 - node_modules/ajv-keywords/keywords/switch.js | 38 - .../ajv-keywords/keywords/transform.js | 80 - node_modules/ajv-keywords/keywords/typeof.js | 32 - .../keywords/uniqueItemProperties.js | 59 - node_modules/ajv-keywords/package.json | 53 - node_modules/ajv/.tonic_example.js | 20 - node_modules/ajv/LICENSE | 22 - node_modules/ajv/README.md | 1497 - node_modules/ajv/dist/ajv.bundle.js | 7189 ---- node_modules/ajv/dist/ajv.min.js | 3 - node_modules/ajv/dist/ajv.min.js.map | 1 - node_modules/ajv/lib/ajv.d.ts | 397 - node_modules/ajv/lib/ajv.js | 506 - node_modules/ajv/lib/cache.js | 26 - node_modules/ajv/lib/compile/async.js | 90 - node_modules/ajv/lib/compile/equal.js | 5 - node_modules/ajv/lib/compile/error_classes.js | 34 - node_modules/ajv/lib/compile/formats.js | 142 - node_modules/ajv/lib/compile/index.js | 387 - node_modules/ajv/lib/compile/resolve.js | 270 - node_modules/ajv/lib/compile/rules.js | 66 - node_modules/ajv/lib/compile/schema_obj.js | 9 - node_modules/ajv/lib/compile/ucs2length.js | 20 - node_modules/ajv/lib/compile/util.js | 239 - node_modules/ajv/lib/data.js | 49 - node_modules/ajv/lib/definition_schema.js | 37 - node_modules/ajv/lib/dot/_limit.jst | 113 - node_modules/ajv/lib/dot/_limitItems.jst | 12 - node_modules/ajv/lib/dot/_limitLength.jst | 12 - node_modules/ajv/lib/dot/_limitProperties.jst | 12 - node_modules/ajv/lib/dot/allOf.jst | 32 - node_modules/ajv/lib/dot/anyOf.jst | 46 - node_modules/ajv/lib/dot/coerce.def | 51 - node_modules/ajv/lib/dot/comment.jst | 9 - node_modules/ajv/lib/dot/const.jst | 11 - node_modules/ajv/lib/dot/contains.jst | 55 - node_modules/ajv/lib/dot/custom.jst | 191 - node_modules/ajv/lib/dot/defaults.def | 47 - node_modules/ajv/lib/dot/definitions.def | 203 - node_modules/ajv/lib/dot/dependencies.jst | 79 - node_modules/ajv/lib/dot/enum.jst | 30 - node_modules/ajv/lib/dot/errors.def | 194 - node_modules/ajv/lib/dot/format.jst | 106 - node_modules/ajv/lib/dot/if.jst | 73 - node_modules/ajv/lib/dot/items.jst | 98 - node_modules/ajv/lib/dot/missing.def | 39 - node_modules/ajv/lib/dot/multipleOf.jst | 22 - node_modules/ajv/lib/dot/not.jst | 43 - node_modules/ajv/lib/dot/oneOf.jst | 54 - node_modules/ajv/lib/dot/pattern.jst | 14 - node_modules/ajv/lib/dot/properties.jst | 245 - node_modules/ajv/lib/dot/propertyNames.jst | 52 - node_modules/ajv/lib/dot/ref.jst | 85 - node_modules/ajv/lib/dot/required.jst | 108 - node_modules/ajv/lib/dot/uniqueItems.jst | 62 - node_modules/ajv/lib/dot/validate.jst | 276 - node_modules/ajv/lib/dotjs/README.md | 3 - node_modules/ajv/lib/dotjs/_limit.js | 163 - node_modules/ajv/lib/dotjs/_limitItems.js | 80 - node_modules/ajv/lib/dotjs/_limitLength.js | 85 - .../ajv/lib/dotjs/_limitProperties.js | 80 - node_modules/ajv/lib/dotjs/allOf.js | 42 - node_modules/ajv/lib/dotjs/anyOf.js | 73 - node_modules/ajv/lib/dotjs/comment.js | 14 - node_modules/ajv/lib/dotjs/const.js | 56 - node_modules/ajv/lib/dotjs/contains.js | 81 - node_modules/ajv/lib/dotjs/custom.js | 228 - node_modules/ajv/lib/dotjs/dependencies.js | 168 - node_modules/ajv/lib/dotjs/enum.js | 66 - node_modules/ajv/lib/dotjs/format.js | 150 - node_modules/ajv/lib/dotjs/if.js | 103 - node_modules/ajv/lib/dotjs/index.js | 33 - node_modules/ajv/lib/dotjs/items.js | 140 - node_modules/ajv/lib/dotjs/multipleOf.js | 80 - node_modules/ajv/lib/dotjs/not.js | 84 - node_modules/ajv/lib/dotjs/oneOf.js | 73 - node_modules/ajv/lib/dotjs/pattern.js | 75 - node_modules/ajv/lib/dotjs/properties.js | 335 - node_modules/ajv/lib/dotjs/propertyNames.js | 81 - node_modules/ajv/lib/dotjs/ref.js | 124 - node_modules/ajv/lib/dotjs/required.js | 270 - node_modules/ajv/lib/dotjs/uniqueItems.js | 86 - node_modules/ajv/lib/dotjs/validate.js | 482 - node_modules/ajv/lib/keyword.js | 146 - node_modules/ajv/lib/refs/data.json | 17 - .../ajv/lib/refs/json-schema-draft-04.json | 149 - .../ajv/lib/refs/json-schema-draft-06.json | 154 - .../ajv/lib/refs/json-schema-draft-07.json | 168 - .../ajv/lib/refs/json-schema-secure.json | 94 - node_modules/ajv/package.json | 106 - node_modules/ajv/scripts/.eslintrc.yml | 3 - node_modules/ajv/scripts/bundle.js | 61 - node_modules/ajv/scripts/compile-dots.js | 73 - node_modules/ajv/scripts/info | 10 - node_modules/ajv/scripts/prepare-tests | 12 - .../ajv/scripts/publish-built-version | 32 - node_modules/ajv/scripts/travis-gh-pages | 23 - node_modules/animate.css/LICENSE | 21 - node_modules/animate.css/README.md | 48 - node_modules/animate.css/animate.compat.css | 7 - node_modules/animate.css/animate.css | 4072 -- node_modules/animate.css/animate.min.css | 7 - node_modules/animate.css/package.json | 75 - node_modules/animate.css/source/_base.css | 68 - node_modules/animate.css/source/_vars.css | 5 - node_modules/animate.css/source/animate.css | 131 - .../source/attention_seekers/bounce.css | 34 - .../source/attention_seekers/flash.css | 16 - .../source/attention_seekers/headShake.css | 30 - .../source/attention_seekers/heartBeat.css | 27 - .../source/attention_seekers/jello.css | 40 - .../source/attention_seekers/pulse.css | 20 - .../source/attention_seekers/rubberBand.css | 33 - .../source/attention_seekers/shake.css | 25 - .../source/attention_seekers/shakeX.css | 25 - .../source/attention_seekers/shakeY.css | 25 - .../source/attention_seekers/swing.css | 26 - .../source/attention_seekers/tada.css | 31 - .../source/attention_seekers/wobble.css | 35 - .../source/back_entrances/backInDown.css | 20 - .../source/back_entrances/backInLeft.css | 20 - .../source/back_entrances/backInRight.css | 20 - .../source/back_entrances/backInUp.css | 20 - .../source/back_exits/backOutDown.css | 20 - .../source/back_exits/backOutLeft.css | 20 - .../source/back_exits/backOutRight.css | 20 - .../source/back_exits/backOutUp.css | 20 - .../source/bouncing_entrances/bounceIn.css | 42 - .../bouncing_entrances/bounceInDown.css | 35 - .../bouncing_entrances/bounceInLeft.css | 35 - .../bouncing_entrances/bounceInRight.css | 35 - .../source/bouncing_entrances/bounceInUp.css | 35 - .../source/bouncing_exits/bounceOut.css | 21 - .../source/bouncing_exits/bounceOutDown.css | 20 - .../source/bouncing_exits/bounceOutLeft.css | 15 - .../source/bouncing_exits/bounceOutRight.css | 15 - .../source/bouncing_exits/bounceOutUp.css | 20 - .../source/fading_entrances/fadeIn.css | 13 - .../fading_entrances/fadeInBottomLeft.css | 14 - .../fading_entrances/fadeInBottomRight.css | 14 - .../source/fading_entrances/fadeInDown.css | 15 - .../source/fading_entrances/fadeInDownBig.css | 15 - .../source/fading_entrances/fadeInLeft.css | 15 - .../source/fading_entrances/fadeInLeftBig.css | 15 - .../source/fading_entrances/fadeInRight.css | 15 - .../fading_entrances/fadeInRightBig.css | 15 - .../source/fading_entrances/fadeInTopLeft.css | 14 - .../fading_entrances/fadeInTopRight.css | 14 - .../source/fading_entrances/fadeInUp.css | 15 - .../source/fading_entrances/fadeInUpBig.css | 15 - .../source/fading_exits/fadeOut.css | 13 - .../source/fading_exits/fadeOutBottomLeft.css | 14 - .../fading_exits/fadeOutBottomRight.css | 14 - .../source/fading_exits/fadeOutDown.css | 14 - .../source/fading_exits/fadeOutDownBig.css | 14 - .../source/fading_exits/fadeOutLeft.css | 14 - .../source/fading_exits/fadeOutLeftBig.css | 14 - .../source/fading_exits/fadeOutRight.css | 14 - .../source/fading_exits/fadeOutRightBig.css | 14 - .../source/fading_exits/fadeOutTopLeft.css | 14 - .../source/fading_exits/fadeOutTopRight.css | 14 - .../source/fading_exits/fadeOutUp.css | 14 - .../source/fading_exits/fadeOutUpBig.css | 14 - .../animate.css/source/flippers/flip.css | 34 - .../animate.css/source/flippers/flipInX.css | 30 - .../animate.css/source/flippers/flipInY.css | 30 - .../animate.css/source/flippers/flipOutX.css | 21 - .../animate.css/source/flippers/flipOutY.css | 21 - .../source/lightspeed/lightSpeedInLeft.css | 24 - .../source/lightspeed/lightSpeedInRight.css | 24 - .../source/lightspeed/lightSpeedOutLeft.css | 15 - .../source/lightspeed/lightSpeedOutRight.css | 15 - .../source/rotating_entrances/rotateIn.css | 16 - .../rotating_entrances/rotateInDownLeft.css | 16 - .../rotating_entrances/rotateInDownRight.css | 16 - .../rotating_entrances/rotateInUpLeft.css | 16 - .../rotating_entrances/rotateInUpRight.css | 16 - .../source/rotating_exits/rotateOut.css | 15 - .../rotating_exits/rotateOutDownLeft.css | 15 - .../rotating_exits/rotateOutDownRight.css | 15 - .../source/rotating_exits/rotateOutUpLeft.css | 15 - .../rotating_exits/rotateOutUpRight.css | 15 - .../source/sliding_entrances/slideInDown.css | 14 - .../source/sliding_entrances/slideInLeft.css | 14 - .../source/sliding_entrances/slideInRight.css | 14 - .../source/sliding_entrances/slideInUp.css | 14 - .../source/sliding_exits/slideOutDown.css | 14 - .../source/sliding_exits/slideOutLeft.css | 14 - .../source/sliding_exits/slideOutRight.css | 14 - .../source/sliding_exits/slideOutUp.css | 14 - .../animate.css/source/specials/hinge.css | 29 - .../source/specials/jackInTheBox.css | 24 - .../animate.css/source/specials/rollIn.css | 17 - .../animate.css/source/specials/rollOut.css | 16 - .../source/zooming_entrances/zoomIn.css | 14 - .../source/zooming_entrances/zoomInDown.css | 17 - .../source/zooming_entrances/zoomInLeft.css | 17 - .../source/zooming_entrances/zoomInRight.css | 17 - .../source/zooming_entrances/zoomInUp.css | 17 - .../source/zooming_exits/zoomOut.css | 18 - .../source/zooming_exits/zoomOutDown.css | 18 - .../source/zooming_exits/zoomOutLeft.css | 16 - .../source/zooming_exits/zoomOutRight.css | 16 - .../source/zooming_exits/zoomOutUp.css | 18 - node_modules/arg/LICENSE.md | 21 - node_modules/arg/README.md | 280 - node_modules/arg/index.d.ts | 31 - node_modules/arg/index.js | 144 - node_modules/arg/package.json | 30 - node_modules/bootstrap-icons/LICENSE | 21 - node_modules/bootstrap-icons/README.md | 100 - .../bootstrap-icons/bootstrap-icons.svg | 1 - .../bootstrap-icons/font/bootstrap-icons.css | 2078 - .../bootstrap-icons/font/bootstrap-icons.json | 2052 - .../font/bootstrap-icons.min.css | 5 - .../bootstrap-icons/font/bootstrap-icons.scss | 2090 - .../font/fonts/bootstrap-icons.woff | Bin 176032 -> 0 bytes .../font/fonts/bootstrap-icons.woff2 | Bin 130396 -> 0 bytes .../bootstrap-icons/icons/0-circle-fill.svg | 4 - .../bootstrap-icons/icons/0-circle.svg | 4 - .../bootstrap-icons/icons/0-square-fill.svg | 4 - .../bootstrap-icons/icons/0-square.svg | 4 - .../bootstrap-icons/icons/1-circle-fill.svg | 3 - .../bootstrap-icons/icons/1-circle.svg | 3 - .../bootstrap-icons/icons/1-square-fill.svg | 3 - .../bootstrap-icons/icons/1-square.svg | 4 - node_modules/bootstrap-icons/icons/123.svg | 3 - .../bootstrap-icons/icons/2-circle-fill.svg | 3 - .../bootstrap-icons/icons/2-circle.svg | 3 - .../bootstrap-icons/icons/2-square-fill.svg | 3 - .../bootstrap-icons/icons/2-square.svg | 4 - .../bootstrap-icons/icons/3-circle-fill.svg | 3 - .../bootstrap-icons/icons/3-circle.svg | 4 - .../bootstrap-icons/icons/3-square-fill.svg | 3 - .../bootstrap-icons/icons/3-square.svg | 4 - .../bootstrap-icons/icons/4-circle-fill.svg | 3 - .../bootstrap-icons/icons/4-circle.svg | 4 - .../bootstrap-icons/icons/4-square-fill.svg | 4 - .../bootstrap-icons/icons/4-square.svg | 4 - .../bootstrap-icons/icons/5-circle-fill.svg | 3 - .../bootstrap-icons/icons/5-circle.svg | 3 - .../bootstrap-icons/icons/5-square-fill.svg | 3 - .../bootstrap-icons/icons/5-square.svg | 4 - .../bootstrap-icons/icons/6-circle-fill.svg | 3 - .../bootstrap-icons/icons/6-circle.svg | 3 - .../bootstrap-icons/icons/6-square-fill.svg | 4 - .../bootstrap-icons/icons/6-square.svg | 4 - .../bootstrap-icons/icons/7-circle-fill.svg | 3 - .../bootstrap-icons/icons/7-circle.svg | 3 - .../bootstrap-icons/icons/7-square-fill.svg | 3 - .../bootstrap-icons/icons/7-square.svg | 4 - .../bootstrap-icons/icons/8-circle-fill.svg | 3 - .../bootstrap-icons/icons/8-circle.svg | 3 - .../bootstrap-icons/icons/8-square-fill.svg | 4 - .../bootstrap-icons/icons/8-square.svg | 4 - .../bootstrap-icons/icons/9-circle-fill.svg | 3 - .../bootstrap-icons/icons/9-circle.svg | 3 - .../bootstrap-icons/icons/9-square-fill.svg | 4 - .../bootstrap-icons/icons/9-square.svg | 4 - .../bootstrap-icons/icons/activity.svg | 3 - .../icons/airplane-engines-fill.svg | 3 - .../icons/airplane-engines.svg | 3 - .../bootstrap-icons/icons/airplane-fill.svg | 3 - .../bootstrap-icons/icons/airplane.svg | 3 - .../bootstrap-icons/icons/alarm-fill.svg | 3 - node_modules/bootstrap-icons/icons/alarm.svg | 4 - node_modules/bootstrap-icons/icons/alexa.svg | 3 - .../bootstrap-icons/icons/align-bottom.svg | 4 - .../bootstrap-icons/icons/align-center.svg | 3 - .../bootstrap-icons/icons/align-end.svg | 4 - .../bootstrap-icons/icons/align-middle.svg | 3 - .../bootstrap-icons/icons/align-start.svg | 4 - .../bootstrap-icons/icons/align-top.svg | 4 - node_modules/bootstrap-icons/icons/alipay.svg | 4 - .../icons/alphabet-uppercase.svg | 3 - .../bootstrap-icons/icons/alphabet.svg | 3 - node_modules/bootstrap-icons/icons/alt.svg | 3 - node_modules/bootstrap-icons/icons/amazon.svg | 4 - node_modules/bootstrap-icons/icons/amd.svg | 3 - .../bootstrap-icons/icons/android.svg | 3 - .../bootstrap-icons/icons/android2.svg | 3 - .../bootstrap-icons/icons/app-indicator.svg | 4 - node_modules/bootstrap-icons/icons/app.svg | 3 - node_modules/bootstrap-icons/icons/apple.svg | 4 - .../bootstrap-icons/icons/archive-fill.svg | 3 - .../bootstrap-icons/icons/archive.svg | 3 - .../icons/arrow-90deg-down.svg | 3 - .../icons/arrow-90deg-left.svg | 3 - .../icons/arrow-90deg-right.svg | 3 - .../bootstrap-icons/icons/arrow-90deg-up.svg | 3 - .../bootstrap-icons/icons/arrow-bar-down.svg | 3 - .../bootstrap-icons/icons/arrow-bar-left.svg | 3 - .../bootstrap-icons/icons/arrow-bar-right.svg | 3 - .../bootstrap-icons/icons/arrow-bar-up.svg | 3 - .../bootstrap-icons/icons/arrow-clockwise.svg | 4 - .../icons/arrow-counterclockwise.svg | 4 - .../icons/arrow-down-circle-fill.svg | 3 - .../icons/arrow-down-circle.svg | 3 - .../icons/arrow-down-left-circle-fill.svg | 3 - .../icons/arrow-down-left-circle.svg | 3 - .../icons/arrow-down-left-square-fill.svg | 3 - .../icons/arrow-down-left-square.svg | 3 - .../bootstrap-icons/icons/arrow-down-left.svg | 3 - .../icons/arrow-down-right-circle-fill.svg | 3 - .../icons/arrow-down-right-circle.svg | 3 - .../icons/arrow-down-right-square-fill.svg | 3 - .../icons/arrow-down-right-square.svg | 3 - .../icons/arrow-down-right.svg | 3 - .../icons/arrow-down-short.svg | 3 - .../icons/arrow-down-square-fill.svg | 3 - .../icons/arrow-down-square.svg | 3 - .../bootstrap-icons/icons/arrow-down-up.svg | 3 - .../bootstrap-icons/icons/arrow-down.svg | 3 - .../icons/arrow-left-circle-fill.svg | 3 - .../icons/arrow-left-circle.svg | 3 - .../icons/arrow-left-right.svg | 3 - .../icons/arrow-left-short.svg | 3 - .../icons/arrow-left-square-fill.svg | 3 - .../icons/arrow-left-square.svg | 3 - .../bootstrap-icons/icons/arrow-left.svg | 3 - .../bootstrap-icons/icons/arrow-repeat.svg | 4 - .../icons/arrow-return-left.svg | 3 - .../icons/arrow-return-right.svg | 3 - .../icons/arrow-right-circle-fill.svg | 3 - .../icons/arrow-right-circle.svg | 3 - .../icons/arrow-right-short.svg | 3 - .../icons/arrow-right-square-fill.svg | 3 - .../icons/arrow-right-square.svg | 3 - .../bootstrap-icons/icons/arrow-right.svg | 3 - .../icons/arrow-through-heart-fill.svg | 3 - .../icons/arrow-through-heart.svg | 3 - .../icons/arrow-up-circle-fill.svg | 3 - .../bootstrap-icons/icons/arrow-up-circle.svg | 3 - .../icons/arrow-up-left-circle-fill.svg | 3 - .../icons/arrow-up-left-circle.svg | 3 - .../icons/arrow-up-left-square-fill.svg | 3 - .../icons/arrow-up-left-square.svg | 3 - .../bootstrap-icons/icons/arrow-up-left.svg | 3 - .../icons/arrow-up-right-circle-fill.svg | 3 - .../icons/arrow-up-right-circle.svg | 3 - .../icons/arrow-up-right-square-fill.svg | 3 - .../icons/arrow-up-right-square.svg | 3 - .../bootstrap-icons/icons/arrow-up-right.svg | 3 - .../bootstrap-icons/icons/arrow-up-short.svg | 3 - .../icons/arrow-up-square-fill.svg | 3 - .../bootstrap-icons/icons/arrow-up-square.svg | 3 - .../bootstrap-icons/icons/arrow-up.svg | 3 - .../icons/arrows-angle-contract.svg | 3 - .../icons/arrows-angle-expand.svg | 3 - .../icons/arrows-collapse-vertical.svg | 3 - .../bootstrap-icons/icons/arrows-collapse.svg | 3 - .../icons/arrows-expand-vertical.svg | 3 - .../bootstrap-icons/icons/arrows-expand.svg | 3 - .../icons/arrows-fullscreen.svg | 3 - .../bootstrap-icons/icons/arrows-move.svg | 3 - .../bootstrap-icons/icons/arrows-vertical.svg | 3 - node_modules/bootstrap-icons/icons/arrows.svg | 3 - .../icons/aspect-ratio-fill.svg | 3 - .../bootstrap-icons/icons/aspect-ratio.svg | 4 - .../bootstrap-icons/icons/asterisk.svg | 3 - node_modules/bootstrap-icons/icons/at.svg | 3 - .../bootstrap-icons/icons/award-fill.svg | 4 - node_modules/bootstrap-icons/icons/award.svg | 4 - node_modules/bootstrap-icons/icons/back.svg | 3 - .../bootstrap-icons/icons/backpack-fill.svg | 4 - .../bootstrap-icons/icons/backpack.svg | 4 - .../bootstrap-icons/icons/backpack2-fill.svg | 4 - .../bootstrap-icons/icons/backpack2.svg | 5 - .../bootstrap-icons/icons/backpack3-fill.svg | 4 - .../bootstrap-icons/icons/backpack3.svg | 4 - .../bootstrap-icons/icons/backpack4-fill.svg | 4 - .../bootstrap-icons/icons/backpack4.svg | 4 - .../bootstrap-icons/icons/backspace-fill.svg | 3 - .../icons/backspace-reverse-fill.svg | 3 - .../icons/backspace-reverse.svg | 4 - .../bootstrap-icons/icons/backspace.svg | 4 - .../bootstrap-icons/icons/badge-3d-fill.svg | 4 - .../bootstrap-icons/icons/badge-3d.svg | 4 - .../bootstrap-icons/icons/badge-4k-fill.svg | 4 - .../bootstrap-icons/icons/badge-4k.svg | 4 - .../bootstrap-icons/icons/badge-8k-fill.svg | 4 - .../bootstrap-icons/icons/badge-8k.svg | 4 - .../bootstrap-icons/icons/badge-ad-fill.svg | 4 - .../bootstrap-icons/icons/badge-ad.svg | 4 - .../bootstrap-icons/icons/badge-ar-fill.svg | 4 - .../bootstrap-icons/icons/badge-ar.svg | 4 - .../bootstrap-icons/icons/badge-cc-fill.svg | 3 - .../bootstrap-icons/icons/badge-cc.svg | 4 - .../bootstrap-icons/icons/badge-hd-fill.svg | 4 - .../bootstrap-icons/icons/badge-hd.svg | 4 - .../bootstrap-icons/icons/badge-sd-fill.svg | 4 - .../bootstrap-icons/icons/badge-sd.svg | 3 - .../bootstrap-icons/icons/badge-tm-fill.svg | 3 - .../bootstrap-icons/icons/badge-tm.svg | 4 - .../bootstrap-icons/icons/badge-vo-fill.svg | 4 - .../bootstrap-icons/icons/badge-vo.svg | 4 - .../bootstrap-icons/icons/badge-vr-fill.svg | 4 - .../bootstrap-icons/icons/badge-vr.svg | 4 - .../bootstrap-icons/icons/badge-wc-fill.svg | 3 - .../bootstrap-icons/icons/badge-wc.svg | 4 - .../bootstrap-icons/icons/bag-check-fill.svg | 3 - .../bootstrap-icons/icons/bag-check.svg | 4 - .../bootstrap-icons/icons/bag-dash-fill.svg | 3 - .../bootstrap-icons/icons/bag-dash.svg | 4 - .../bootstrap-icons/icons/bag-fill.svg | 3 - .../bootstrap-icons/icons/bag-heart-fill.svg | 3 - .../bootstrap-icons/icons/bag-heart.svg | 3 - .../bootstrap-icons/icons/bag-plus-fill.svg | 3 - .../bootstrap-icons/icons/bag-plus.svg | 4 - .../bootstrap-icons/icons/bag-x-fill.svg | 3 - node_modules/bootstrap-icons/icons/bag-x.svg | 4 - node_modules/bootstrap-icons/icons/bag.svg | 3 - .../bootstrap-icons/icons/balloon-fill.svg | 3 - .../icons/balloon-heart-fill.svg | 3 - .../bootstrap-icons/icons/balloon-heart.svg | 3 - .../bootstrap-icons/icons/balloon.svg | 3 - .../bootstrap-icons/icons/ban-fill.svg | 3 - node_modules/bootstrap-icons/icons/ban.svg | 3 - .../bootstrap-icons/icons/bandaid-fill.svg | 3 - .../bootstrap-icons/icons/bandaid.svg | 4 - node_modules/bootstrap-icons/icons/bank.svg | 3 - node_modules/bootstrap-icons/icons/bank2.svg | 3 - .../bootstrap-icons/icons/bar-chart-fill.svg | 3 - .../icons/bar-chart-line-fill.svg | 3 - .../bootstrap-icons/icons/bar-chart-line.svg | 3 - .../bootstrap-icons/icons/bar-chart-steps.svg | 3 - .../bootstrap-icons/icons/bar-chart.svg | 3 - .../bootstrap-icons/icons/basket-fill.svg | 3 - node_modules/bootstrap-icons/icons/basket.svg | 3 - .../bootstrap-icons/icons/basket2-fill.svg | 3 - .../bootstrap-icons/icons/basket2.svg | 4 - .../bootstrap-icons/icons/basket3-fill.svg | 3 - .../bootstrap-icons/icons/basket3.svg | 3 - .../icons/battery-charging.svg | 6 - .../bootstrap-icons/icons/battery-full.svg | 4 - .../bootstrap-icons/icons/battery-half.svg | 4 - .../bootstrap-icons/icons/battery.svg | 3 - .../bootstrap-icons/icons/behance.svg | 3 - .../bootstrap-icons/icons/bell-fill.svg | 3 - .../bootstrap-icons/icons/bell-slash-fill.svg | 3 - .../bootstrap-icons/icons/bell-slash.svg | 3 - node_modules/bootstrap-icons/icons/bell.svg | 3 - node_modules/bootstrap-icons/icons/bezier.svg | 4 - .../bootstrap-icons/icons/bezier2.svg | 3 - .../bootstrap-icons/icons/bicycle.svg | 3 - node_modules/bootstrap-icons/icons/bing.svg | 5 - .../bootstrap-icons/icons/binoculars-fill.svg | 3 - .../bootstrap-icons/icons/binoculars.svg | 3 - .../bootstrap-icons/icons/blockquote-left.svg | 3 - .../icons/blockquote-right.svg | 3 - .../bootstrap-icons/icons/bluetooth.svg | 3 - .../bootstrap-icons/icons/body-text.svg | 3 - .../bootstrap-icons/icons/book-fill.svg | 3 - .../bootstrap-icons/icons/book-half.svg | 3 - node_modules/bootstrap-icons/icons/book.svg | 3 - .../icons/bookmark-check-fill.svg | 3 - .../bootstrap-icons/icons/bookmark-check.svg | 4 - .../icons/bookmark-dash-fill.svg | 3 - .../bootstrap-icons/icons/bookmark-dash.svg | 4 - .../bootstrap-icons/icons/bookmark-fill.svg | 3 - .../icons/bookmark-heart-fill.svg | 3 - .../bootstrap-icons/icons/bookmark-heart.svg | 4 - .../icons/bookmark-plus-fill.svg | 3 - .../bootstrap-icons/icons/bookmark-plus.svg | 4 - .../icons/bookmark-star-fill.svg | 3 - .../bootstrap-icons/icons/bookmark-star.svg | 4 - .../bootstrap-icons/icons/bookmark-x-fill.svg | 3 - .../bootstrap-icons/icons/bookmark-x.svg | 4 - .../bootstrap-icons/icons/bookmark.svg | 3 - .../bootstrap-icons/icons/bookmarks-fill.svg | 4 - .../bootstrap-icons/icons/bookmarks.svg | 4 - .../bootstrap-icons/icons/bookshelf.svg | 3 - .../bootstrap-icons/icons/boombox-fill.svg | 4 - .../bootstrap-icons/icons/boombox.svg | 6 - .../bootstrap-icons/icons/bootstrap-fill.svg | 4 - .../icons/bootstrap-reboot.svg | 4 - .../bootstrap-icons/icons/bootstrap.svg | 4 - .../bootstrap-icons/icons/border-all.svg | 3 - .../bootstrap-icons/icons/border-bottom.svg | 3 - .../bootstrap-icons/icons/border-center.svg | 3 - .../bootstrap-icons/icons/border-inner.svg | 5 - .../bootstrap-icons/icons/border-left.svg | 3 - .../bootstrap-icons/icons/border-middle.svg | 3 - .../bootstrap-icons/icons/border-outer.svg | 4 - .../bootstrap-icons/icons/border-right.svg | 3 - .../bootstrap-icons/icons/border-style.svg | 3 - .../bootstrap-icons/icons/border-top.svg | 3 - .../bootstrap-icons/icons/border-width.svg | 3 - node_modules/bootstrap-icons/icons/border.svg | 3 - .../icons/bounding-box-circles.svg | 3 - .../bootstrap-icons/icons/bounding-box.svg | 3 - .../icons/box-arrow-down-left.svg | 4 - .../icons/box-arrow-down-right.svg | 4 - .../bootstrap-icons/icons/box-arrow-down.svg | 4 - .../icons/box-arrow-in-down-left.svg | 4 - .../icons/box-arrow-in-down-right.svg | 4 - .../icons/box-arrow-in-down.svg | 4 - .../icons/box-arrow-in-left.svg | 4 - .../icons/box-arrow-in-right.svg | 4 - .../icons/box-arrow-in-up-left.svg | 4 - .../icons/box-arrow-in-up-right.svg | 4 - .../bootstrap-icons/icons/box-arrow-in-up.svg | 4 - .../bootstrap-icons/icons/box-arrow-left.svg | 4 - .../bootstrap-icons/icons/box-arrow-right.svg | 4 - .../icons/box-arrow-up-left.svg | 4 - .../icons/box-arrow-up-right.svg | 4 - .../bootstrap-icons/icons/box-arrow-up.svg | 4 - .../bootstrap-icons/icons/box-fill.svg | 3 - .../bootstrap-icons/icons/box-seam-fill.svg | 3 - .../bootstrap-icons/icons/box-seam.svg | 3 - node_modules/bootstrap-icons/icons/box.svg | 3 - .../bootstrap-icons/icons/box2-fill.svg | 3 - .../bootstrap-icons/icons/box2-heart-fill.svg | 3 - .../bootstrap-icons/icons/box2-heart.svg | 4 - node_modules/bootstrap-icons/icons/box2.svg | 3 - node_modules/bootstrap-icons/icons/boxes.svg | 3 - .../bootstrap-icons/icons/braces-asterisk.svg | 3 - node_modules/bootstrap-icons/icons/braces.svg | 3 - node_modules/bootstrap-icons/icons/bricks.svg | 3 - .../bootstrap-icons/icons/briefcase-fill.svg | 4 - .../bootstrap-icons/icons/briefcase.svg | 3 - .../icons/brightness-alt-high-fill.svg | 3 - .../icons/brightness-alt-high.svg | 3 - .../icons/brightness-alt-low-fill.svg | 3 - .../icons/brightness-alt-low.svg | 3 - .../icons/brightness-high-fill.svg | 3 - .../bootstrap-icons/icons/brightness-high.svg | 3 - .../icons/brightness-low-fill.svg | 3 - .../bootstrap-icons/icons/brightness-low.svg | 3 - .../bootstrap-icons/icons/brilliance.svg | 3 - .../bootstrap-icons/icons/broadcast-pin.svg | 3 - .../bootstrap-icons/icons/broadcast.svg | 3 - .../bootstrap-icons/icons/browser-chrome.svg | 3 - .../bootstrap-icons/icons/browser-edge.svg | 5 - .../bootstrap-icons/icons/browser-firefox.svg | 3 - .../bootstrap-icons/icons/browser-safari.svg | 3 - .../bootstrap-icons/icons/brush-fill.svg | 3 - node_modules/bootstrap-icons/icons/brush.svg | 3 - .../bootstrap-icons/icons/bucket-fill.svg | 3 - node_modules/bootstrap-icons/icons/bucket.svg | 3 - .../bootstrap-icons/icons/bug-fill.svg | 4 - node_modules/bootstrap-icons/icons/bug.svg | 3 - .../bootstrap-icons/icons/building-add.svg | 5 - .../bootstrap-icons/icons/building-check.svg | 5 - .../bootstrap-icons/icons/building-dash.svg | 5 - .../bootstrap-icons/icons/building-down.svg | 5 - .../icons/building-exclamation.svg | 4 - .../icons/building-fill-add.svg | 4 - .../icons/building-fill-check.svg | 4 - .../icons/building-fill-dash.svg | 4 - .../icons/building-fill-down.svg | 4 - .../icons/building-fill-exclamation.svg | 4 - .../icons/building-fill-gear.svg | 4 - .../icons/building-fill-lock.svg | 4 - .../icons/building-fill-slash.svg | 4 - .../icons/building-fill-up.svg | 4 - .../bootstrap-icons/icons/building-fill-x.svg | 4 - .../bootstrap-icons/icons/building-fill.svg | 3 - .../bootstrap-icons/icons/building-gear.svg | 4 - .../bootstrap-icons/icons/building-lock.svg | 4 - .../bootstrap-icons/icons/building-slash.svg | 5 - .../bootstrap-icons/icons/building-up.svg | 5 - .../bootstrap-icons/icons/building-x.svg | 4 - .../bootstrap-icons/icons/building.svg | 4 - .../bootstrap-icons/icons/buildings-fill.svg | 3 - .../bootstrap-icons/icons/buildings.svg | 4 - .../bootstrap-icons/icons/bullseye.svg | 6 - .../bootstrap-icons/icons/bus-front-fill.svg | 3 - .../bootstrap-icons/icons/bus-front.svg | 4 - .../bootstrap-icons/icons/c-circle-fill.svg | 3 - .../bootstrap-icons/icons/c-circle.svg | 3 - .../bootstrap-icons/icons/c-square-fill.svg | 3 - .../bootstrap-icons/icons/c-square.svg | 4 - .../bootstrap-icons/icons/cake-fill.svg | 3 - node_modules/bootstrap-icons/icons/cake.svg | 3 - .../bootstrap-icons/icons/cake2-fill.svg | 4 - node_modules/bootstrap-icons/icons/cake2.svg | 3 - .../bootstrap-icons/icons/calculator-fill.svg | 3 - .../bootstrap-icons/icons/calculator.svg | 4 - .../icons/calendar-check-fill.svg | 3 - .../bootstrap-icons/icons/calendar-check.svg | 4 - .../icons/calendar-date-fill.svg | 4 - .../bootstrap-icons/icons/calendar-date.svg | 4 - .../icons/calendar-day-fill.svg | 3 - .../bootstrap-icons/icons/calendar-day.svg | 4 - .../icons/calendar-event-fill.svg | 3 - .../bootstrap-icons/icons/calendar-event.svg | 4 - .../bootstrap-icons/icons/calendar-fill.svg | 3 - .../icons/calendar-heart-fill.svg | 3 - .../bootstrap-icons/icons/calendar-heart.svg | 3 - .../icons/calendar-minus-fill.svg | 3 - .../bootstrap-icons/icons/calendar-minus.svg | 4 - .../icons/calendar-month-fill.svg | 4 - .../bootstrap-icons/icons/calendar-month.svg | 4 - .../icons/calendar-plus-fill.svg | 3 - .../bootstrap-icons/icons/calendar-plus.svg | 4 - .../icons/calendar-range-fill.svg | 3 - .../bootstrap-icons/icons/calendar-range.svg | 4 - .../icons/calendar-week-fill.svg | 3 - .../bootstrap-icons/icons/calendar-week.svg | 4 - .../bootstrap-icons/icons/calendar-x-fill.svg | 3 - .../bootstrap-icons/icons/calendar-x.svg | 4 - .../bootstrap-icons/icons/calendar.svg | 3 - .../icons/calendar2-check-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-check.svg | 5 - .../icons/calendar2-date-fill.svg | 4 - .../bootstrap-icons/icons/calendar2-date.svg | 5 - .../icons/calendar2-day-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-day.svg | 5 - .../icons/calendar2-event-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-event.svg | 5 - .../bootstrap-icons/icons/calendar2-fill.svg | 3 - .../icons/calendar2-heart-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-heart.svg | 3 - .../icons/calendar2-minus-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-minus.svg | 5 - .../icons/calendar2-month-fill.svg | 4 - .../bootstrap-icons/icons/calendar2-month.svg | 5 - .../icons/calendar2-plus-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-plus.svg | 4 - .../icons/calendar2-range-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-range.svg | 4 - .../icons/calendar2-week-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-week.svg | 4 - .../icons/calendar2-x-fill.svg | 3 - .../bootstrap-icons/icons/calendar2-x.svg | 5 - .../bootstrap-icons/icons/calendar2.svg | 4 - .../icons/calendar3-event-fill.svg | 3 - .../bootstrap-icons/icons/calendar3-event.svg | 4 - .../bootstrap-icons/icons/calendar3-fill.svg | 3 - .../icons/calendar3-range-fill.svg | 3 - .../bootstrap-icons/icons/calendar3-range.svg | 4 - .../icons/calendar3-week-fill.svg | 3 - .../bootstrap-icons/icons/calendar3-week.svg | 4 - .../bootstrap-icons/icons/calendar3.svg | 4 - .../bootstrap-icons/icons/calendar4-event.svg | 4 - .../bootstrap-icons/icons/calendar4-range.svg | 4 - .../bootstrap-icons/icons/calendar4-week.svg | 4 - .../bootstrap-icons/icons/calendar4.svg | 3 - .../bootstrap-icons/icons/camera-fill.svg | 4 - .../icons/camera-reels-fill.svg | 5 - .../bootstrap-icons/icons/camera-reels.svg | 5 - .../icons/camera-video-fill.svg | 3 - .../icons/camera-video-off-fill.svg | 3 - .../icons/camera-video-off.svg | 3 - .../bootstrap-icons/icons/camera-video.svg | 3 - node_modules/bootstrap-icons/icons/camera.svg | 4 - .../bootstrap-icons/icons/camera2.svg | 4 - .../bootstrap-icons/icons/capslock-fill.svg | 3 - .../bootstrap-icons/icons/capslock.svg | 3 - .../bootstrap-icons/icons/capsule-pill.svg | 3 - .../bootstrap-icons/icons/capsule.svg | 3 - .../bootstrap-icons/icons/car-front-fill.svg | 3 - .../bootstrap-icons/icons/car-front.svg | 4 - .../bootstrap-icons/icons/card-checklist.svg | 4 - .../bootstrap-icons/icons/card-heading.svg | 4 - .../bootstrap-icons/icons/card-image.svg | 4 - .../bootstrap-icons/icons/card-list.svg | 4 - .../bootstrap-icons/icons/card-text.svg | 4 - .../bootstrap-icons/icons/caret-down-fill.svg | 3 - .../icons/caret-down-square-fill.svg | 3 - .../icons/caret-down-square.svg | 4 - .../bootstrap-icons/icons/caret-down.svg | 3 - .../bootstrap-icons/icons/caret-left-fill.svg | 3 - .../icons/caret-left-square-fill.svg | 3 - .../icons/caret-left-square.svg | 4 - .../bootstrap-icons/icons/caret-left.svg | 3 - .../icons/caret-right-fill.svg | 3 - .../icons/caret-right-square-fill.svg | 3 - .../icons/caret-right-square.svg | 4 - .../bootstrap-icons/icons/caret-right.svg | 3 - .../bootstrap-icons/icons/caret-up-fill.svg | 3 - .../icons/caret-up-square-fill.svg | 3 - .../bootstrap-icons/icons/caret-up-square.svg | 4 - .../bootstrap-icons/icons/caret-up.svg | 3 - .../bootstrap-icons/icons/cart-check-fill.svg | 3 - .../bootstrap-icons/icons/cart-check.svg | 4 - .../bootstrap-icons/icons/cart-dash-fill.svg | 3 - .../bootstrap-icons/icons/cart-dash.svg | 4 - .../bootstrap-icons/icons/cart-fill.svg | 3 - .../bootstrap-icons/icons/cart-plus-fill.svg | 3 - .../bootstrap-icons/icons/cart-plus.svg | 4 - .../bootstrap-icons/icons/cart-x-fill.svg | 3 - node_modules/bootstrap-icons/icons/cart-x.svg | 4 - node_modules/bootstrap-icons/icons/cart.svg | 3 - node_modules/bootstrap-icons/icons/cart2.svg | 3 - node_modules/bootstrap-icons/icons/cart3.svg | 3 - node_modules/bootstrap-icons/icons/cart4.svg | 3 - .../bootstrap-icons/icons/cash-coin.svg | 6 - .../bootstrap-icons/icons/cash-stack.svg | 4 - node_modules/bootstrap-icons/icons/cash.svg | 4 - .../bootstrap-icons/icons/cassette-fill.svg | 4 - .../bootstrap-icons/icons/cassette.svg | 4 - node_modules/bootstrap-icons/icons/cast.svg | 4 - .../bootstrap-icons/icons/cc-circle-fill.svg | 3 - .../bootstrap-icons/icons/cc-circle.svg | 3 - .../bootstrap-icons/icons/cc-square-fill.svg | 3 - .../bootstrap-icons/icons/cc-square.svg | 4 - .../bootstrap-icons/icons/chat-dots-fill.svg | 3 - .../bootstrap-icons/icons/chat-dots.svg | 4 - .../bootstrap-icons/icons/chat-fill.svg | 3 - .../bootstrap-icons/icons/chat-heart-fill.svg | 3 - .../bootstrap-icons/icons/chat-heart.svg | 3 - .../icons/chat-left-dots-fill.svg | 3 - .../bootstrap-icons/icons/chat-left-dots.svg | 4 - .../bootstrap-icons/icons/chat-left-fill.svg | 3 - .../icons/chat-left-heart-fill.svg | 3 - .../bootstrap-icons/icons/chat-left-heart.svg | 4 - .../icons/chat-left-quote-fill.svg | 3 - .../bootstrap-icons/icons/chat-left-quote.svg | 4 - .../icons/chat-left-text-fill.svg | 3 - .../bootstrap-icons/icons/chat-left-text.svg | 4 - .../bootstrap-icons/icons/chat-left.svg | 3 - .../bootstrap-icons/icons/chat-quote-fill.svg | 3 - .../bootstrap-icons/icons/chat-quote.svg | 4 - .../icons/chat-right-dots-fill.svg | 3 - .../bootstrap-icons/icons/chat-right-dots.svg | 4 - .../bootstrap-icons/icons/chat-right-fill.svg | 3 - .../icons/chat-right-heart-fill.svg | 3 - .../icons/chat-right-heart.svg | 4 - .../icons/chat-right-quote-fill.svg | 3 - .../icons/chat-right-quote.svg | 4 - .../icons/chat-right-text-fill.svg | 3 - .../bootstrap-icons/icons/chat-right-text.svg | 4 - .../bootstrap-icons/icons/chat-right.svg | 3 - .../icons/chat-square-dots-fill.svg | 3 - .../icons/chat-square-dots.svg | 4 - .../icons/chat-square-fill.svg | 3 - .../icons/chat-square-heart-fill.svg | 3 - .../icons/chat-square-heart.svg | 4 - .../icons/chat-square-quote-fill.svg | 3 - .../icons/chat-square-quote.svg | 4 - .../icons/chat-square-text-fill.svg | 3 - .../icons/chat-square-text.svg | 4 - .../bootstrap-icons/icons/chat-square.svg | 3 - .../bootstrap-icons/icons/chat-text-fill.svg | 3 - .../bootstrap-icons/icons/chat-text.svg | 4 - node_modules/bootstrap-icons/icons/chat.svg | 3 - .../bootstrap-icons/icons/check-all.svg | 3 - .../icons/check-circle-fill.svg | 3 - .../bootstrap-icons/icons/check-circle.svg | 4 - .../bootstrap-icons/icons/check-lg.svg | 3 - .../icons/check-square-fill.svg | 3 - .../bootstrap-icons/icons/check-square.svg | 4 - node_modules/bootstrap-icons/icons/check.svg | 3 - .../bootstrap-icons/icons/check2-all.svg | 4 - .../bootstrap-icons/icons/check2-circle.svg | 4 - .../bootstrap-icons/icons/check2-square.svg | 4 - node_modules/bootstrap-icons/icons/check2.svg | 3 - .../icons/chevron-bar-contract.svg | 3 - .../icons/chevron-bar-down.svg | 3 - .../icons/chevron-bar-expand.svg | 3 - .../icons/chevron-bar-left.svg | 3 - .../icons/chevron-bar-right.svg | 3 - .../bootstrap-icons/icons/chevron-bar-up.svg | 3 - .../icons/chevron-compact-down.svg | 3 - .../icons/chevron-compact-left.svg | 3 - .../icons/chevron-compact-right.svg | 3 - .../icons/chevron-compact-up.svg | 3 - .../icons/chevron-contract.svg | 3 - .../icons/chevron-double-down.svg | 4 - .../icons/chevron-double-left.svg | 4 - .../icons/chevron-double-right.svg | 4 - .../icons/chevron-double-up.svg | 4 - .../bootstrap-icons/icons/chevron-down.svg | 3 - .../bootstrap-icons/icons/chevron-expand.svg | 3 - .../bootstrap-icons/icons/chevron-left.svg | 3 - .../bootstrap-icons/icons/chevron-right.svg | 3 - .../bootstrap-icons/icons/chevron-up.svg | 3 - .../bootstrap-icons/icons/circle-fill.svg | 3 - .../bootstrap-icons/icons/circle-half.svg | 3 - .../bootstrap-icons/icons/circle-square.svg | 4 - node_modules/bootstrap-icons/icons/circle.svg | 3 - .../icons/clipboard-check-fill.svg | 4 - .../bootstrap-icons/icons/clipboard-check.svg | 5 - .../icons/clipboard-data-fill.svg | 4 - .../bootstrap-icons/icons/clipboard-data.svg | 5 - .../bootstrap-icons/icons/clipboard-fill.svg | 3 - .../icons/clipboard-heart-fill.svg | 4 - .../bootstrap-icons/icons/clipboard-heart.svg | 5 - .../icons/clipboard-minus-fill.svg | 4 - .../bootstrap-icons/icons/clipboard-minus.svg | 5 - .../icons/clipboard-plus-fill.svg | 4 - .../bootstrap-icons/icons/clipboard-plus.svg | 5 - .../bootstrap-icons/icons/clipboard-pulse.svg | 3 - .../icons/clipboard-x-fill.svg | 4 - .../bootstrap-icons/icons/clipboard-x.svg | 5 - .../bootstrap-icons/icons/clipboard.svg | 4 - .../icons/clipboard2-check-fill.svg | 4 - .../icons/clipboard2-check.svg | 5 - .../icons/clipboard2-data-fill.svg | 4 - .../bootstrap-icons/icons/clipboard2-data.svg | 5 - .../bootstrap-icons/icons/clipboard2-fill.svg | 4 - .../icons/clipboard2-heart-fill.svg | 4 - .../icons/clipboard2-heart.svg | 5 - .../icons/clipboard2-minus-fill.svg | 4 - .../icons/clipboard2-minus.svg | 5 - .../icons/clipboard2-plus-fill.svg | 4 - .../bootstrap-icons/icons/clipboard2-plus.svg | 5 - .../icons/clipboard2-pulse-fill.svg | 4 - .../icons/clipboard2-pulse.svg | 5 - .../icons/clipboard2-x-fill.svg | 4 - .../bootstrap-icons/icons/clipboard2-x.svg | 5 - .../bootstrap-icons/icons/clipboard2.svg | 4 - .../bootstrap-icons/icons/clock-fill.svg | 3 - .../bootstrap-icons/icons/clock-history.svg | 5 - node_modules/bootstrap-icons/icons/clock.svg | 4 - .../icons/cloud-arrow-down-fill.svg | 3 - .../icons/cloud-arrow-down.svg | 4 - .../icons/cloud-arrow-up-fill.svg | 3 - .../bootstrap-icons/icons/cloud-arrow-up.svg | 4 - .../icons/cloud-check-fill.svg | 3 - .../bootstrap-icons/icons/cloud-check.svg | 4 - .../icons/cloud-download-fill.svg | 3 - .../bootstrap-icons/icons/cloud-download.svg | 4 - .../icons/cloud-drizzle-fill.svg | 3 - .../bootstrap-icons/icons/cloud-drizzle.svg | 3 - .../bootstrap-icons/icons/cloud-fill.svg | 3 - .../bootstrap-icons/icons/cloud-fog-fill.svg | 3 - .../bootstrap-icons/icons/cloud-fog.svg | 3 - .../bootstrap-icons/icons/cloud-fog2-fill.svg | 3 - .../bootstrap-icons/icons/cloud-fog2.svg | 3 - .../bootstrap-icons/icons/cloud-hail-fill.svg | 3 - .../bootstrap-icons/icons/cloud-hail.svg | 3 - .../bootstrap-icons/icons/cloud-haze-fill.svg | 3 - .../bootstrap-icons/icons/cloud-haze.svg | 3 - .../icons/cloud-haze2-fill.svg | 3 - .../bootstrap-icons/icons/cloud-haze2.svg | 3 - .../icons/cloud-lightning-fill.svg | 3 - .../icons/cloud-lightning-rain-fill.svg | 3 - .../icons/cloud-lightning-rain.svg | 3 - .../bootstrap-icons/icons/cloud-lightning.svg | 3 - .../icons/cloud-minus-fill.svg | 3 - .../bootstrap-icons/icons/cloud-minus.svg | 4 - .../bootstrap-icons/icons/cloud-moon-fill.svg | 4 - .../bootstrap-icons/icons/cloud-moon.svg | 4 - .../bootstrap-icons/icons/cloud-plus-fill.svg | 3 - .../bootstrap-icons/icons/cloud-plus.svg | 4 - .../bootstrap-icons/icons/cloud-rain-fill.svg | 3 - .../icons/cloud-rain-heavy-fill.svg | 3 - .../icons/cloud-rain-heavy.svg | 3 - .../bootstrap-icons/icons/cloud-rain.svg | 3 - .../icons/cloud-slash-fill.svg | 3 - .../bootstrap-icons/icons/cloud-slash.svg | 4 - .../icons/cloud-sleet-fill.svg | 3 - .../bootstrap-icons/icons/cloud-sleet.svg | 3 - .../bootstrap-icons/icons/cloud-snow-fill.svg | 3 - .../bootstrap-icons/icons/cloud-snow.svg | 3 - .../bootstrap-icons/icons/cloud-sun-fill.svg | 4 - .../bootstrap-icons/icons/cloud-sun.svg | 4 - .../icons/cloud-upload-fill.svg | 3 - .../bootstrap-icons/icons/cloud-upload.svg | 4 - node_modules/bootstrap-icons/icons/cloud.svg | 3 - .../bootstrap-icons/icons/clouds-fill.svg | 4 - node_modules/bootstrap-icons/icons/clouds.svg | 4 - .../bootstrap-icons/icons/cloudy-fill.svg | 3 - node_modules/bootstrap-icons/icons/cloudy.svg | 3 - .../bootstrap-icons/icons/code-slash.svg | 3 - .../bootstrap-icons/icons/code-square.svg | 4 - node_modules/bootstrap-icons/icons/code.svg | 3 - node_modules/bootstrap-icons/icons/coin.svg | 5 - .../bootstrap-icons/icons/collection-fill.svg | 3 - .../icons/collection-play-fill.svg | 3 - .../bootstrap-icons/icons/collection-play.svg | 4 - .../bootstrap-icons/icons/collection.svg | 3 - .../bootstrap-icons/icons/columns-gap.svg | 3 - .../bootstrap-icons/icons/columns.svg | 3 - .../bootstrap-icons/icons/command.svg | 3 - .../bootstrap-icons/icons/compass-fill.svg | 3 - .../bootstrap-icons/icons/compass.svg | 4 - .../bootstrap-icons/icons/cone-striped.svg | 3 - node_modules/bootstrap-icons/icons/cone.svg | 3 - .../bootstrap-icons/icons/controller.svg | 4 - node_modules/bootstrap-icons/icons/cookie.svg | 4 - node_modules/bootstrap-icons/icons/copy.svg | 3 - .../bootstrap-icons/icons/cpu-fill.svg | 4 - node_modules/bootstrap-icons/icons/cpu.svg | 3 - .../icons/credit-card-2-back-fill.svg | 3 - .../icons/credit-card-2-back.svg | 4 - .../icons/credit-card-2-front-fill.svg | 3 - .../icons/credit-card-2-front.svg | 4 - .../icons/credit-card-fill.svg | 3 - .../bootstrap-icons/icons/credit-card.svg | 4 - node_modules/bootstrap-icons/icons/crop.svg | 3 - .../bootstrap-icons/icons/crosshair.svg | 3 - .../bootstrap-icons/icons/crosshair2.svg | 3 - .../bootstrap-icons/icons/cup-fill.svg | 3 - .../bootstrap-icons/icons/cup-hot-fill.svg | 4 - .../bootstrap-icons/icons/cup-hot.svg | 4 - .../bootstrap-icons/icons/cup-straw.svg | 3 - node_modules/bootstrap-icons/icons/cup.svg | 3 - .../icons/currency-bitcoin.svg | 3 - .../bootstrap-icons/icons/currency-dollar.svg | 3 - .../bootstrap-icons/icons/currency-euro.svg | 3 - .../icons/currency-exchange.svg | 3 - .../bootstrap-icons/icons/currency-pound.svg | 3 - .../bootstrap-icons/icons/currency-rupee.svg | 3 - .../bootstrap-icons/icons/currency-yen.svg | 3 - .../bootstrap-icons/icons/cursor-fill.svg | 3 - .../bootstrap-icons/icons/cursor-text.svg | 3 - node_modules/bootstrap-icons/icons/cursor.svg | 3 - .../icons/dash-circle-dotted.svg | 3 - .../icons/dash-circle-fill.svg | 3 - .../bootstrap-icons/icons/dash-circle.svg | 4 - .../bootstrap-icons/icons/dash-lg.svg | 3 - .../icons/dash-square-dotted.svg | 3 - .../icons/dash-square-fill.svg | 3 - .../bootstrap-icons/icons/dash-square.svg | 4 - node_modules/bootstrap-icons/icons/dash.svg | 3 - .../bootstrap-icons/icons/database-add.svg | 4 - .../bootstrap-icons/icons/database-check.svg | 4 - .../bootstrap-icons/icons/database-dash.svg | 4 - .../bootstrap-icons/icons/database-down.svg | 4 - .../icons/database-exclamation.svg | 4 - .../icons/database-fill-add.svg | 4 - .../icons/database-fill-check.svg | 4 - .../icons/database-fill-dash.svg | 4 - .../icons/database-fill-down.svg | 4 - .../icons/database-fill-exclamation.svg | 5 - .../icons/database-fill-gear.svg | 4 - .../icons/database-fill-lock.svg | 5 - .../icons/database-fill-slash.svg | 4 - .../icons/database-fill-up.svg | 4 - .../bootstrap-icons/icons/database-fill-x.svg | 5 - .../bootstrap-icons/icons/database-fill.svg | 6 - .../bootstrap-icons/icons/database-gear.svg | 4 - .../bootstrap-icons/icons/database-lock.svg | 4 - .../bootstrap-icons/icons/database-slash.svg | 4 - .../bootstrap-icons/icons/database-up.svg | 4 - .../bootstrap-icons/icons/database-x.svg | 4 - .../bootstrap-icons/icons/database.svg | 3 - .../bootstrap-icons/icons/device-hdd-fill.svg | 4 - .../bootstrap-icons/icons/device-hdd.svg | 5 - .../bootstrap-icons/icons/device-ssd-fill.svg | 4 - .../bootstrap-icons/icons/device-ssd.svg | 4 - .../bootstrap-icons/icons/diagram-2-fill.svg | 3 - .../bootstrap-icons/icons/diagram-2.svg | 3 - .../bootstrap-icons/icons/diagram-3-fill.svg | 3 - .../bootstrap-icons/icons/diagram-3.svg | 3 - .../bootstrap-icons/icons/diamond-fill.svg | 3 - .../bootstrap-icons/icons/diamond-half.svg | 3 - .../bootstrap-icons/icons/diamond.svg | 3 - .../bootstrap-icons/icons/dice-1-fill.svg | 3 - node_modules/bootstrap-icons/icons/dice-1.svg | 4 - .../bootstrap-icons/icons/dice-2-fill.svg | 3 - node_modules/bootstrap-icons/icons/dice-2.svg | 4 - .../bootstrap-icons/icons/dice-3-fill.svg | 3 - node_modules/bootstrap-icons/icons/dice-3.svg | 4 - .../bootstrap-icons/icons/dice-4-fill.svg | 3 - node_modules/bootstrap-icons/icons/dice-4.svg | 4 - .../bootstrap-icons/icons/dice-5-fill.svg | 3 - node_modules/bootstrap-icons/icons/dice-5.svg | 4 - .../bootstrap-icons/icons/dice-6-fill.svg | 3 - node_modules/bootstrap-icons/icons/dice-6.svg | 4 - .../bootstrap-icons/icons/disc-fill.svg | 3 - node_modules/bootstrap-icons/icons/disc.svg | 4 - .../bootstrap-icons/icons/discord.svg | 3 - .../bootstrap-icons/icons/display-fill.svg | 3 - .../bootstrap-icons/icons/display.svg | 3 - .../icons/displayport-fill.svg | 3 - .../bootstrap-icons/icons/displayport.svg | 4 - .../icons/distribute-horizontal.svg | 4 - .../icons/distribute-vertical.svg | 4 - .../icons/door-closed-fill.svg | 3 - .../bootstrap-icons/icons/door-closed.svg | 4 - .../bootstrap-icons/icons/door-open-fill.svg | 3 - .../bootstrap-icons/icons/door-open.svg | 4 - node_modules/bootstrap-icons/icons/dot.svg | 3 - .../bootstrap-icons/icons/download.svg | 4 - .../bootstrap-icons/icons/dpad-fill.svg | 3 - node_modules/bootstrap-icons/icons/dpad.svg | 4 - .../bootstrap-icons/icons/dribbble.svg | 3 - .../bootstrap-icons/icons/dropbox.svg | 3 - .../bootstrap-icons/icons/droplet-fill.svg | 3 - .../bootstrap-icons/icons/droplet-half.svg | 4 - .../bootstrap-icons/icons/droplet.svg | 4 - .../bootstrap-icons/icons/duffle-fill.svg | 3 - node_modules/bootstrap-icons/icons/duffle.svg | 4 - .../bootstrap-icons/icons/ear-fill.svg | 3 - node_modules/bootstrap-icons/icons/ear.svg | 3 - .../bootstrap-icons/icons/earbuds.svg | 3 - .../bootstrap-icons/icons/easel-fill.svg | 3 - node_modules/bootstrap-icons/icons/easel.svg | 3 - .../bootstrap-icons/icons/easel2-fill.svg | 4 - node_modules/bootstrap-icons/icons/easel2.svg | 3 - .../bootstrap-icons/icons/easel3-fill.svg | 3 - node_modules/bootstrap-icons/icons/easel3.svg | 3 - .../bootstrap-icons/icons/egg-fill.svg | 3 - .../bootstrap-icons/icons/egg-fried.svg | 4 - node_modules/bootstrap-icons/icons/egg.svg | 3 - .../bootstrap-icons/icons/eject-fill.svg | 3 - node_modules/bootstrap-icons/icons/eject.svg | 3 - .../icons/emoji-angry-fill.svg | 3 - .../bootstrap-icons/icons/emoji-angry.svg | 4 - .../icons/emoji-astonished-fill.svg | 3 - .../icons/emoji-astonished.svg | 4 - .../icons/emoji-dizzy-fill.svg | 3 - .../bootstrap-icons/icons/emoji-dizzy.svg | 4 - .../icons/emoji-expressionless-fill.svg | 3 - .../icons/emoji-expressionless.svg | 4 - .../icons/emoji-frown-fill.svg | 3 - .../bootstrap-icons/icons/emoji-frown.svg | 4 - .../icons/emoji-grimace-fill.svg | 3 - .../bootstrap-icons/icons/emoji-grimace.svg | 4 - .../bootstrap-icons/icons/emoji-grin-fill.svg | 3 - .../bootstrap-icons/icons/emoji-grin.svg | 4 - .../icons/emoji-heart-eyes-fill.svg | 3 - .../icons/emoji-heart-eyes.svg | 4 - .../bootstrap-icons/icons/emoji-kiss-fill.svg | 3 - .../bootstrap-icons/icons/emoji-kiss.svg | 3 - .../icons/emoji-laughing-fill.svg | 3 - .../bootstrap-icons/icons/emoji-laughing.svg | 4 - .../icons/emoji-neutral-fill.svg | 3 - .../bootstrap-icons/icons/emoji-neutral.svg | 4 - .../icons/emoji-smile-fill.svg | 3 - .../icons/emoji-smile-upside-down-fill.svg | 3 - .../icons/emoji-smile-upside-down.svg | 4 - .../bootstrap-icons/icons/emoji-smile.svg | 4 - .../icons/emoji-sunglasses-fill.svg | 3 - .../icons/emoji-sunglasses.svg | 4 - .../icons/emoji-surprise-fill.svg | 3 - .../bootstrap-icons/icons/emoji-surprise.svg | 4 - .../bootstrap-icons/icons/emoji-tear-fill.svg | 3 - .../bootstrap-icons/icons/emoji-tear.svg | 4 - .../bootstrap-icons/icons/emoji-wink-fill.svg | 3 - .../bootstrap-icons/icons/emoji-wink.svg | 4 - .../icons/envelope-arrow-down-fill.svg | 4 - .../icons/envelope-arrow-down.svg | 4 - .../icons/envelope-arrow-up-fill.svg | 4 - .../icons/envelope-arrow-up.svg | 4 - .../icons/envelope-at-fill.svg | 4 - .../bootstrap-icons/icons/envelope-at.svg | 4 - .../icons/envelope-check-fill.svg | 4 - .../bootstrap-icons/icons/envelope-check.svg | 4 - .../icons/envelope-dash-fill.svg | 4 - .../bootstrap-icons/icons/envelope-dash.svg | 4 - .../icons/envelope-exclamation-fill.svg | 4 - .../icons/envelope-exclamation.svg | 4 - .../bootstrap-icons/icons/envelope-fill.svg | 3 - .../icons/envelope-heart-fill.svg | 4 - .../bootstrap-icons/icons/envelope-heart.svg | 3 - .../icons/envelope-open-fill.svg | 3 - .../icons/envelope-open-heart-fill.svg | 4 - .../icons/envelope-open-heart.svg | 3 - .../bootstrap-icons/icons/envelope-open.svg | 3 - .../icons/envelope-paper-fill.svg | 3 - .../icons/envelope-paper-heart-fill.svg | 3 - .../icons/envelope-paper-heart.svg | 3 - .../bootstrap-icons/icons/envelope-paper.svg | 3 - .../icons/envelope-plus-fill.svg | 4 - .../bootstrap-icons/icons/envelope-plus.svg | 4 - .../icons/envelope-slash-fill.svg | 4 - .../bootstrap-icons/icons/envelope-slash.svg | 4 - .../bootstrap-icons/icons/envelope-x-fill.svg | 4 - .../bootstrap-icons/icons/envelope-x.svg | 4 - .../bootstrap-icons/icons/envelope.svg | 3 - .../bootstrap-icons/icons/eraser-fill.svg | 3 - node_modules/bootstrap-icons/icons/eraser.svg | 3 - node_modules/bootstrap-icons/icons/escape.svg | 4 - .../bootstrap-icons/icons/ethernet.svg | 4 - .../bootstrap-icons/icons/ev-front-fill.svg | 3 - .../bootstrap-icons/icons/ev-front.svg | 4 - .../bootstrap-icons/icons/ev-station-fill.svg | 3 - .../bootstrap-icons/icons/ev-station.svg | 4 - .../icons/exclamation-circle-fill.svg | 3 - .../icons/exclamation-circle.svg | 4 - .../icons/exclamation-diamond-fill.svg | 3 - .../icons/exclamation-diamond.svg | 4 - .../bootstrap-icons/icons/exclamation-lg.svg | 3 - .../icons/exclamation-octagon-fill.svg | 3 - .../icons/exclamation-octagon.svg | 4 - .../icons/exclamation-square-fill.svg | 3 - .../icons/exclamation-square.svg | 4 - .../icons/exclamation-triangle-fill.svg | 3 - .../icons/exclamation-triangle.svg | 4 - .../bootstrap-icons/icons/exclamation.svg | 3 - .../bootstrap-icons/icons/exclude.svg | 3 - .../bootstrap-icons/icons/explicit-fill.svg | 3 - .../bootstrap-icons/icons/explicit.svg | 4 - .../bootstrap-icons/icons/exposure.svg | 4 - .../bootstrap-icons/icons/eye-fill.svg | 4 - .../bootstrap-icons/icons/eye-slash-fill.svg | 4 - .../bootstrap-icons/icons/eye-slash.svg | 5 - node_modules/bootstrap-icons/icons/eye.svg | 4 - .../bootstrap-icons/icons/eyedropper.svg | 3 - .../bootstrap-icons/icons/eyeglasses.svg | 3 - .../bootstrap-icons/icons/facebook.svg | 3 - node_modules/bootstrap-icons/icons/fan.svg | 4 - .../icons/fast-forward-btn-fill.svg | 3 - .../icons/fast-forward-btn.svg | 4 - .../icons/fast-forward-circle-fill.svg | 3 - .../icons/fast-forward-circle.svg | 4 - .../icons/fast-forward-fill.svg | 4 - .../bootstrap-icons/icons/fast-forward.svg | 4 - .../bootstrap-icons/icons/feather.svg | 3 - .../bootstrap-icons/icons/feather2.svg | 3 - .../icons/file-arrow-down-fill.svg | 3 - .../bootstrap-icons/icons/file-arrow-down.svg | 4 - .../icons/file-arrow-up-fill.svg | 3 - .../bootstrap-icons/icons/file-arrow-up.svg | 4 - .../icons/file-bar-graph-fill.svg | 3 - .../bootstrap-icons/icons/file-bar-graph.svg | 4 - .../icons/file-binary-fill.svg | 4 - .../bootstrap-icons/icons/file-binary.svg | 4 - .../bootstrap-icons/icons/file-break-fill.svg | 3 - .../bootstrap-icons/icons/file-break.svg | 3 - .../bootstrap-icons/icons/file-check-fill.svg | 3 - .../bootstrap-icons/icons/file-check.svg | 4 - .../bootstrap-icons/icons/file-code-fill.svg | 3 - .../bootstrap-icons/icons/file-code.svg | 4 - .../bootstrap-icons/icons/file-diff-fill.svg | 3 - .../bootstrap-icons/icons/file-diff.svg | 4 - .../icons/file-earmark-arrow-down-fill.svg | 3 - .../icons/file-earmark-arrow-down.svg | 4 - .../icons/file-earmark-arrow-up-fill.svg | 3 - .../icons/file-earmark-arrow-up.svg | 4 - .../icons/file-earmark-bar-graph-fill.svg | 3 - .../icons/file-earmark-bar-graph.svg | 4 - .../icons/file-earmark-binary-fill.svg | 4 - .../icons/file-earmark-binary.svg | 4 - .../icons/file-earmark-break-fill.svg | 3 - .../icons/file-earmark-break.svg | 3 - .../icons/file-earmark-check-fill.svg | 3 - .../icons/file-earmark-check.svg | 4 - .../icons/file-earmark-code-fill.svg | 3 - .../icons/file-earmark-code.svg | 4 - .../icons/file-earmark-diff-fill.svg | 3 - .../icons/file-earmark-diff.svg | 4 - .../icons/file-earmark-easel-fill.svg | 4 - .../icons/file-earmark-easel.svg | 4 - .../icons/file-earmark-excel-fill.svg | 3 - .../icons/file-earmark-excel.svg | 4 - .../icons/file-earmark-fill.svg | 3 - .../icons/file-earmark-font-fill.svg | 3 - .../icons/file-earmark-font.svg | 4 - .../icons/file-earmark-image-fill.svg | 4 - .../icons/file-earmark-image.svg | 4 - .../icons/file-earmark-lock-fill.svg | 4 - .../icons/file-earmark-lock.svg | 4 - .../icons/file-earmark-lock2-fill.svg | 4 - .../icons/file-earmark-lock2.svg | 4 - .../icons/file-earmark-medical-fill.svg | 3 - .../icons/file-earmark-medical.svg | 4 - .../icons/file-earmark-minus-fill.svg | 3 - .../icons/file-earmark-minus.svg | 4 - .../icons/file-earmark-music-fill.svg | 3 - .../icons/file-earmark-music.svg | 4 - .../icons/file-earmark-pdf-fill.svg | 4 - .../icons/file-earmark-pdf.svg | 4 - .../icons/file-earmark-person-fill.svg | 3 - .../icons/file-earmark-person.svg | 4 - .../icons/file-earmark-play-fill.svg | 3 - .../icons/file-earmark-play.svg | 4 - .../icons/file-earmark-plus-fill.svg | 3 - .../icons/file-earmark-plus.svg | 4 - .../icons/file-earmark-post-fill.svg | 3 - .../icons/file-earmark-post.svg | 4 - .../icons/file-earmark-ppt-fill.svg | 4 - .../icons/file-earmark-ppt.svg | 4 - .../icons/file-earmark-richtext-fill.svg | 3 - .../icons/file-earmark-richtext.svg | 4 - .../icons/file-earmark-ruled-fill.svg | 3 - .../icons/file-earmark-ruled.svg | 3 - .../icons/file-earmark-slides-fill.svg | 4 - .../icons/file-earmark-slides.svg | 4 - .../icons/file-earmark-spreadsheet-fill.svg | 4 - .../icons/file-earmark-spreadsheet.svg | 3 - .../icons/file-earmark-text-fill.svg | 3 - .../icons/file-earmark-text.svg | 4 - .../icons/file-earmark-word-fill.svg | 3 - .../icons/file-earmark-word.svg | 4 - .../icons/file-earmark-x-fill.svg | 3 - .../bootstrap-icons/icons/file-earmark-x.svg | 4 - .../icons/file-earmark-zip-fill.svg | 4 - .../icons/file-earmark-zip.svg | 4 - .../bootstrap-icons/icons/file-earmark.svg | 3 - .../bootstrap-icons/icons/file-easel-fill.svg | 4 - .../bootstrap-icons/icons/file-easel.svg | 4 - .../bootstrap-icons/icons/file-excel-fill.svg | 3 - .../bootstrap-icons/icons/file-excel.svg | 4 - .../bootstrap-icons/icons/file-fill.svg | 3 - .../bootstrap-icons/icons/file-font-fill.svg | 3 - .../bootstrap-icons/icons/file-font.svg | 4 - .../bootstrap-icons/icons/file-image-fill.svg | 4 - .../bootstrap-icons/icons/file-image.svg | 4 - .../bootstrap-icons/icons/file-lock-fill.svg | 4 - .../bootstrap-icons/icons/file-lock.svg | 4 - .../bootstrap-icons/icons/file-lock2-fill.svg | 4 - .../bootstrap-icons/icons/file-lock2.svg | 4 - .../icons/file-medical-fill.svg | 3 - .../bootstrap-icons/icons/file-medical.svg | 4 - .../bootstrap-icons/icons/file-minus-fill.svg | 3 - .../bootstrap-icons/icons/file-minus.svg | 4 - .../bootstrap-icons/icons/file-music-fill.svg | 3 - .../bootstrap-icons/icons/file-music.svg | 4 - .../bootstrap-icons/icons/file-pdf-fill.svg | 4 - .../bootstrap-icons/icons/file-pdf.svg | 4 - .../icons/file-person-fill.svg | 3 - .../bootstrap-icons/icons/file-person.svg | 4 - .../bootstrap-icons/icons/file-play-fill.svg | 3 - .../bootstrap-icons/icons/file-play.svg | 4 - .../bootstrap-icons/icons/file-plus-fill.svg | 3 - .../bootstrap-icons/icons/file-plus.svg | 4 - .../bootstrap-icons/icons/file-post-fill.svg | 3 - .../bootstrap-icons/icons/file-post.svg | 4 - .../bootstrap-icons/icons/file-ppt-fill.svg | 4 - .../bootstrap-icons/icons/file-ppt.svg | 4 - .../icons/file-richtext-fill.svg | 3 - .../bootstrap-icons/icons/file-richtext.svg | 4 - .../bootstrap-icons/icons/file-ruled-fill.svg | 3 - .../bootstrap-icons/icons/file-ruled.svg | 3 - .../icons/file-slides-fill.svg | 4 - .../bootstrap-icons/icons/file-slides.svg | 4 - .../icons/file-spreadsheet-fill.svg | 3 - .../icons/file-spreadsheet.svg | 3 - .../bootstrap-icons/icons/file-text-fill.svg | 3 - .../bootstrap-icons/icons/file-text.svg | 4 - .../bootstrap-icons/icons/file-word-fill.svg | 3 - .../bootstrap-icons/icons/file-word.svg | 4 - .../bootstrap-icons/icons/file-x-fill.svg | 3 - node_modules/bootstrap-icons/icons/file-x.svg | 4 - .../bootstrap-icons/icons/file-zip-fill.svg | 4 - .../bootstrap-icons/icons/file-zip.svg | 4 - node_modules/bootstrap-icons/icons/file.svg | 3 - .../bootstrap-icons/icons/files-alt.svg | 3 - node_modules/bootstrap-icons/icons/files.svg | 3 - .../bootstrap-icons/icons/filetype-aac.svg | 3 - .../bootstrap-icons/icons/filetype-ai.svg | 3 - .../bootstrap-icons/icons/filetype-bmp.svg | 3 - .../bootstrap-icons/icons/filetype-cs.svg | 3 - .../bootstrap-icons/icons/filetype-css.svg | 3 - .../bootstrap-icons/icons/filetype-csv.svg | 3 - .../bootstrap-icons/icons/filetype-doc.svg | 3 - .../bootstrap-icons/icons/filetype-docx.svg | 3 - .../bootstrap-icons/icons/filetype-exe.svg | 3 - .../bootstrap-icons/icons/filetype-gif.svg | 3 - .../bootstrap-icons/icons/filetype-heic.svg | 3 - .../bootstrap-icons/icons/filetype-html.svg | 3 - .../bootstrap-icons/icons/filetype-java.svg | 3 - .../bootstrap-icons/icons/filetype-jpg.svg | 3 - .../bootstrap-icons/icons/filetype-js.svg | 3 - .../bootstrap-icons/icons/filetype-json.svg | 3 - .../bootstrap-icons/icons/filetype-jsx.svg | 3 - .../bootstrap-icons/icons/filetype-key.svg | 3 - .../bootstrap-icons/icons/filetype-m4p.svg | 3 - .../bootstrap-icons/icons/filetype-md.svg | 3 - .../bootstrap-icons/icons/filetype-mdx.svg | 3 - .../bootstrap-icons/icons/filetype-mov.svg | 3 - .../bootstrap-icons/icons/filetype-mp3.svg | 3 - .../bootstrap-icons/icons/filetype-mp4.svg | 3 - .../bootstrap-icons/icons/filetype-otf.svg | 3 - .../bootstrap-icons/icons/filetype-pdf.svg | 3 - .../bootstrap-icons/icons/filetype-php.svg | 3 - .../bootstrap-icons/icons/filetype-png.svg | 3 - .../bootstrap-icons/icons/filetype-ppt.svg | 3 - .../bootstrap-icons/icons/filetype-pptx.svg | 3 - .../bootstrap-icons/icons/filetype-psd.svg | 3 - .../bootstrap-icons/icons/filetype-py.svg | 3 - .../bootstrap-icons/icons/filetype-raw.svg | 3 - .../bootstrap-icons/icons/filetype-rb.svg | 3 - .../bootstrap-icons/icons/filetype-sass.svg | 3 - .../bootstrap-icons/icons/filetype-scss.svg | 3 - .../bootstrap-icons/icons/filetype-sh.svg | 3 - .../bootstrap-icons/icons/filetype-sql.svg | 3 - .../bootstrap-icons/icons/filetype-svg.svg | 3 - .../bootstrap-icons/icons/filetype-tiff.svg | 3 - .../bootstrap-icons/icons/filetype-tsx.svg | 3 - .../bootstrap-icons/icons/filetype-ttf.svg | 3 - .../bootstrap-icons/icons/filetype-txt.svg | 3 - .../bootstrap-icons/icons/filetype-wav.svg | 3 - .../bootstrap-icons/icons/filetype-woff.svg | 3 - .../bootstrap-icons/icons/filetype-xls.svg | 3 - .../bootstrap-icons/icons/filetype-xlsx.svg | 3 - .../bootstrap-icons/icons/filetype-xml.svg | 3 - .../bootstrap-icons/icons/filetype-yml.svg | 3 - node_modules/bootstrap-icons/icons/film.svg | 3 - .../icons/filter-circle-fill.svg | 3 - .../bootstrap-icons/icons/filter-circle.svg | 4 - .../bootstrap-icons/icons/filter-left.svg | 3 - .../bootstrap-icons/icons/filter-right.svg | 3 - .../icons/filter-square-fill.svg | 3 - .../bootstrap-icons/icons/filter-square.svg | 4 - node_modules/bootstrap-icons/icons/filter.svg | 3 - .../bootstrap-icons/icons/fingerprint.svg | 7 - node_modules/bootstrap-icons/icons/fire.svg | 3 - .../bootstrap-icons/icons/flag-fill.svg | 3 - node_modules/bootstrap-icons/icons/flag.svg | 3 - .../bootstrap-icons/icons/floppy-fill.svg | 4 - node_modules/bootstrap-icons/icons/floppy.svg | 4 - .../bootstrap-icons/icons/floppy2-fill.svg | 4 - .../bootstrap-icons/icons/floppy2.svg | 3 - .../bootstrap-icons/icons/flower1.svg | 3 - .../bootstrap-icons/icons/flower2.svg | 3 - .../bootstrap-icons/icons/flower3.svg | 3 - .../bootstrap-icons/icons/folder-check.svg | 4 - .../bootstrap-icons/icons/folder-fill.svg | 3 - .../bootstrap-icons/icons/folder-minus.svg | 4 - .../bootstrap-icons/icons/folder-plus.svg | 4 - .../icons/folder-symlink-fill.svg | 3 - .../bootstrap-icons/icons/folder-symlink.svg | 4 - .../bootstrap-icons/icons/folder-x.svg | 4 - node_modules/bootstrap-icons/icons/folder.svg | 3 - .../bootstrap-icons/icons/folder2-open.svg | 3 - .../bootstrap-icons/icons/folder2.svg | 3 - node_modules/bootstrap-icons/icons/fonts.svg | 3 - .../bootstrap-icons/icons/forward-fill.svg | 3 - .../bootstrap-icons/icons/forward.svg | 3 - node_modules/bootstrap-icons/icons/front.svg | 3 - .../icons/fuel-pump-diesel-fill.svg | 4 - .../icons/fuel-pump-diesel.svg | 4 - .../bootstrap-icons/icons/fuel-pump-fill.svg | 3 - .../bootstrap-icons/icons/fuel-pump.svg | 4 - .../bootstrap-icons/icons/fullscreen-exit.svg | 3 - .../bootstrap-icons/icons/fullscreen.svg | 3 - .../bootstrap-icons/icons/funnel-fill.svg | 3 - node_modules/bootstrap-icons/icons/funnel.svg | 3 - .../bootstrap-icons/icons/gear-fill.svg | 3 - .../icons/gear-wide-connected.svg | 3 - .../bootstrap-icons/icons/gear-wide.svg | 3 - node_modules/bootstrap-icons/icons/gear.svg | 4 - node_modules/bootstrap-icons/icons/gem.svg | 3 - .../icons/gender-ambiguous.svg | 3 - .../bootstrap-icons/icons/gender-female.svg | 3 - .../bootstrap-icons/icons/gender-male.svg | 3 - .../bootstrap-icons/icons/gender-neuter.svg | 3 - .../bootstrap-icons/icons/gender-trans.svg | 3 - .../bootstrap-icons/icons/geo-alt-fill.svg | 3 - .../bootstrap-icons/icons/geo-alt.svg | 4 - .../bootstrap-icons/icons/geo-fill.svg | 3 - node_modules/bootstrap-icons/icons/geo.svg | 3 - .../bootstrap-icons/icons/gift-fill.svg | 3 - node_modules/bootstrap-icons/icons/gift.svg | 3 - node_modules/bootstrap-icons/icons/git.svg | 3 - node_modules/bootstrap-icons/icons/github.svg | 3 - node_modules/bootstrap-icons/icons/gitlab.svg | 3 - .../bootstrap-icons/icons/globe-americas.svg | 3 - .../icons/globe-asia-australia.svg | 4 - .../icons/globe-central-south-asia.svg | 3 - .../icons/globe-europe-africa.svg | 3 - node_modules/bootstrap-icons/icons/globe.svg | 3 - node_modules/bootstrap-icons/icons/globe2.svg | 3 - .../bootstrap-icons/icons/google-play.svg | 3 - node_modules/bootstrap-icons/icons/google.svg | 3 - .../bootstrap-icons/icons/gpu-card.svg | 5 - .../icons/graph-down-arrow.svg | 3 - .../bootstrap-icons/icons/graph-down.svg | 3 - .../bootstrap-icons/icons/graph-up-arrow.svg | 3 - .../bootstrap-icons/icons/graph-up.svg | 3 - .../bootstrap-icons/icons/grid-1x2-fill.svg | 3 - .../bootstrap-icons/icons/grid-1x2.svg | 3 - .../icons/grid-3x2-gap-fill.svg | 3 - .../bootstrap-icons/icons/grid-3x2-gap.svg | 3 - .../bootstrap-icons/icons/grid-3x2.svg | 3 - .../icons/grid-3x3-gap-fill.svg | 3 - .../bootstrap-icons/icons/grid-3x3-gap.svg | 3 - .../bootstrap-icons/icons/grid-3x3.svg | 3 - .../bootstrap-icons/icons/grid-fill.svg | 3 - node_modules/bootstrap-icons/icons/grid.svg | 3 - .../bootstrap-icons/icons/grip-horizontal.svg | 3 - .../bootstrap-icons/icons/grip-vertical.svg | 3 - .../bootstrap-icons/icons/h-circle-fill.svg | 3 - .../bootstrap-icons/icons/h-circle.svg | 3 - .../bootstrap-icons/icons/h-square-fill.svg | 3 - .../bootstrap-icons/icons/h-square.svg | 4 - node_modules/bootstrap-icons/icons/hammer.svg | 3 - .../bootstrap-icons/icons/hand-index-fill.svg | 3 - .../icons/hand-index-thumb-fill.svg | 3 - .../icons/hand-index-thumb.svg | 3 - .../bootstrap-icons/icons/hand-index.svg | 3 - .../icons/hand-thumbs-down-fill.svg | 3 - .../icons/hand-thumbs-down.svg | 3 - .../icons/hand-thumbs-up-fill.svg | 3 - .../bootstrap-icons/icons/hand-thumbs-up.svg | 3 - .../bootstrap-icons/icons/handbag-fill.svg | 3 - .../bootstrap-icons/icons/handbag.svg | 3 - node_modules/bootstrap-icons/icons/hash.svg | 3 - .../bootstrap-icons/icons/hdd-fill.svg | 3 - .../icons/hdd-network-fill.svg | 3 - .../bootstrap-icons/icons/hdd-network.svg | 4 - .../bootstrap-icons/icons/hdd-rack-fill.svg | 3 - .../bootstrap-icons/icons/hdd-rack.svg | 4 - .../bootstrap-icons/icons/hdd-stack-fill.svg | 3 - .../bootstrap-icons/icons/hdd-stack.svg | 5 - node_modules/bootstrap-icons/icons/hdd.svg | 4 - .../bootstrap-icons/icons/hdmi-fill.svg | 3 - node_modules/bootstrap-icons/icons/hdmi.svg | 4 - .../bootstrap-icons/icons/headphones.svg | 3 - .../bootstrap-icons/icons/headset-vr.svg | 4 - .../bootstrap-icons/icons/headset.svg | 3 - .../bootstrap-icons/icons/heart-arrow.svg | 3 - .../bootstrap-icons/icons/heart-fill.svg | 3 - .../bootstrap-icons/icons/heart-half.svg | 3 - .../icons/heart-pulse-fill.svg | 4 - .../bootstrap-icons/icons/heart-pulse.svg | 4 - node_modules/bootstrap-icons/icons/heart.svg | 3 - .../bootstrap-icons/icons/heartbreak-fill.svg | 3 - .../bootstrap-icons/icons/heartbreak.svg | 3 - node_modules/bootstrap-icons/icons/hearts.svg | 3 - .../bootstrap-icons/icons/heptagon-fill.svg | 3 - .../bootstrap-icons/icons/heptagon-half.svg | 3 - .../bootstrap-icons/icons/heptagon.svg | 3 - .../bootstrap-icons/icons/hexagon-fill.svg | 3 - .../bootstrap-icons/icons/hexagon-half.svg | 3 - .../bootstrap-icons/icons/hexagon.svg | 3 - .../bootstrap-icons/icons/highlighter.svg | 3 - .../bootstrap-icons/icons/highlights.svg | 3 - .../bootstrap-icons/icons/hospital-fill.svg | 3 - .../bootstrap-icons/icons/hospital.svg | 4 - .../icons/hourglass-bottom.svg | 3 - .../bootstrap-icons/icons/hourglass-split.svg | 3 - .../bootstrap-icons/icons/hourglass-top.svg | 3 - .../bootstrap-icons/icons/hourglass.svg | 3 - .../bootstrap-icons/icons/house-add-fill.svg | 5 - .../bootstrap-icons/icons/house-add.svg | 4 - .../icons/house-check-fill.svg | 5 - .../bootstrap-icons/icons/house-check.svg | 4 - .../bootstrap-icons/icons/house-dash-fill.svg | 5 - .../bootstrap-icons/icons/house-dash.svg | 4 - .../bootstrap-icons/icons/house-door-fill.svg | 3 - .../bootstrap-icons/icons/house-door.svg | 3 - .../bootstrap-icons/icons/house-down-fill.svg | 5 - .../bootstrap-icons/icons/house-down.svg | 4 - .../icons/house-exclamation-fill.svg | 5 - .../icons/house-exclamation.svg | 4 - .../bootstrap-icons/icons/house-fill.svg | 4 - .../bootstrap-icons/icons/house-gear-fill.svg | 5 - .../bootstrap-icons/icons/house-gear.svg | 4 - .../icons/house-heart-fill.svg | 4 - .../bootstrap-icons/icons/house-heart.svg | 4 - .../bootstrap-icons/icons/house-lock-fill.svg | 5 - .../bootstrap-icons/icons/house-lock.svg | 4 - .../icons/house-slash-fill.svg | 5 - .../bootstrap-icons/icons/house-slash.svg | 4 - .../bootstrap-icons/icons/house-up-fill.svg | 5 - .../bootstrap-icons/icons/house-up.svg | 4 - .../bootstrap-icons/icons/house-x-fill.svg | 5 - .../bootstrap-icons/icons/house-x.svg | 4 - node_modules/bootstrap-icons/icons/house.svg | 3 - .../bootstrap-icons/icons/houses-fill.svg | 4 - node_modules/bootstrap-icons/icons/houses.svg | 3 - node_modules/bootstrap-icons/icons/hr.svg | 3 - .../bootstrap-icons/icons/hurricane.svg | 3 - .../bootstrap-icons/icons/hypnotize.svg | 4 - .../bootstrap-icons/icons/image-alt.svg | 3 - .../bootstrap-icons/icons/image-fill.svg | 3 - node_modules/bootstrap-icons/icons/image.svg | 4 - node_modules/bootstrap-icons/icons/images.svg | 4 - .../bootstrap-icons/icons/inbox-fill.svg | 3 - node_modules/bootstrap-icons/icons/inbox.svg | 3 - .../bootstrap-icons/icons/inboxes-fill.svg | 3 - .../bootstrap-icons/icons/inboxes.svg | 3 - .../bootstrap-icons/icons/incognito.svg | 3 - node_modules/bootstrap-icons/icons/indent.svg | 4 - .../bootstrap-icons/icons/infinity.svg | 3 - .../icons/info-circle-fill.svg | 3 - .../bootstrap-icons/icons/info-circle.svg | 4 - .../bootstrap-icons/icons/info-lg.svg | 3 - .../icons/info-square-fill.svg | 3 - .../bootstrap-icons/icons/info-square.svg | 4 - node_modules/bootstrap-icons/icons/info.svg | 3 - .../icons/input-cursor-text.svg | 4 - .../bootstrap-icons/icons/input-cursor.svg | 4 - .../bootstrap-icons/icons/instagram.svg | 3 - .../bootstrap-icons/icons/intersect.svg | 3 - .../bootstrap-icons/icons/journal-album.svg | 5 - .../icons/journal-arrow-down.svg | 5 - .../icons/journal-arrow-up.svg | 5 - .../icons/journal-bookmark-fill.svg | 5 - .../icons/journal-bookmark.svg | 5 - .../bootstrap-icons/icons/journal-check.svg | 5 - .../bootstrap-icons/icons/journal-code.svg | 5 - .../bootstrap-icons/icons/journal-medical.svg | 5 - .../bootstrap-icons/icons/journal-minus.svg | 5 - .../bootstrap-icons/icons/journal-plus.svg | 5 - .../icons/journal-richtext.svg | 5 - .../bootstrap-icons/icons/journal-text.svg | 5 - .../bootstrap-icons/icons/journal-x.svg | 5 - .../bootstrap-icons/icons/journal.svg | 4 - .../bootstrap-icons/icons/journals.svg | 4 - .../bootstrap-icons/icons/joystick.svg | 4 - .../bootstrap-icons/icons/justify-left.svg | 3 - .../bootstrap-icons/icons/justify-right.svg | 3 - .../bootstrap-icons/icons/justify.svg | 3 - .../bootstrap-icons/icons/kanban-fill.svg | 3 - node_modules/bootstrap-icons/icons/kanban.svg | 4 - .../bootstrap-icons/icons/key-fill.svg | 3 - node_modules/bootstrap-icons/icons/key.svg | 4 - .../bootstrap-icons/icons/keyboard-fill.svg | 3 - .../bootstrap-icons/icons/keyboard.svg | 4 - node_modules/bootstrap-icons/icons/ladder.svg | 3 - .../bootstrap-icons/icons/lamp-fill.svg | 4 - node_modules/bootstrap-icons/icons/lamp.svg | 4 - .../bootstrap-icons/icons/laptop-fill.svg | 3 - node_modules/bootstrap-icons/icons/laptop.svg | 3 - .../bootstrap-icons/icons/layer-backward.svg | 4 - .../bootstrap-icons/icons/layer-forward.svg | 4 - .../bootstrap-icons/icons/layers-fill.svg | 4 - .../bootstrap-icons/icons/layers-half.svg | 3 - node_modules/bootstrap-icons/icons/layers.svg | 3 - .../icons/layout-sidebar-inset-reverse.svg | 4 - .../icons/layout-sidebar-inset.svg | 4 - .../icons/layout-sidebar-reverse.svg | 3 - .../bootstrap-icons/icons/layout-sidebar.svg | 3 - .../bootstrap-icons/icons/layout-split.svg | 3 - .../icons/layout-text-sidebar-reverse.svg | 4 - .../icons/layout-text-sidebar.svg | 4 - .../icons/layout-text-window-reverse.svg | 4 - .../icons/layout-text-window.svg | 4 - .../icons/layout-three-columns.svg | 3 - .../bootstrap-icons/icons/layout-wtf.svg | 3 - .../bootstrap-icons/icons/life-preserver.svg | 3 - .../bootstrap-icons/icons/lightbulb-fill.svg | 3 - .../icons/lightbulb-off-fill.svg | 3 - .../bootstrap-icons/icons/lightbulb-off.svg | 3 - .../bootstrap-icons/icons/lightbulb.svg | 3 - .../icons/lightning-charge-fill.svg | 3 - .../icons/lightning-charge.svg | 3 - .../bootstrap-icons/icons/lightning-fill.svg | 3 - .../bootstrap-icons/icons/lightning.svg | 3 - node_modules/bootstrap-icons/icons/line.svg | 3 - .../bootstrap-icons/icons/link-45deg.svg | 4 - node_modules/bootstrap-icons/icons/link.svg | 4 - .../bootstrap-icons/icons/linkedin.svg | 3 - .../bootstrap-icons/icons/list-check.svg | 3 - .../icons/list-columns-reverse.svg | 3 - .../bootstrap-icons/icons/list-columns.svg | 3 - .../bootstrap-icons/icons/list-nested.svg | 3 - .../bootstrap-icons/icons/list-ol.svg | 4 - .../bootstrap-icons/icons/list-stars.svg | 4 - .../bootstrap-icons/icons/list-task.svg | 5 - .../bootstrap-icons/icons/list-ul.svg | 3 - node_modules/bootstrap-icons/icons/list.svg | 3 - .../bootstrap-icons/icons/lock-fill.svg | 3 - node_modules/bootstrap-icons/icons/lock.svg | 3 - .../bootstrap-icons/icons/luggage-fill.svg | 4 - .../bootstrap-icons/icons/luggage.svg | 4 - .../bootstrap-icons/icons/lungs-fill.svg | 3 - node_modules/bootstrap-icons/icons/lungs.svg | 3 - node_modules/bootstrap-icons/icons/magic.svg | 3 - .../bootstrap-icons/icons/magnet-fill.svg | 3 - node_modules/bootstrap-icons/icons/magnet.svg | 3 - .../bootstrap-icons/icons/mailbox-flag.svg | 4 - .../bootstrap-icons/icons/mailbox.svg | 4 - .../bootstrap-icons/icons/mailbox2-flag.svg | 4 - .../bootstrap-icons/icons/mailbox2.svg | 4 - .../bootstrap-icons/icons/map-fill.svg | 3 - node_modules/bootstrap-icons/icons/map.svg | 3 - .../bootstrap-icons/icons/markdown-fill.svg | 3 - .../bootstrap-icons/icons/markdown.svg | 6 - .../bootstrap-icons/icons/marker-tip.svg | 3 - node_modules/bootstrap-icons/icons/mask.svg | 3 - .../bootstrap-icons/icons/mastodon.svg | 3 - node_modules/bootstrap-icons/icons/medium.svg | 3 - .../bootstrap-icons/icons/megaphone-fill.svg | 3 - .../bootstrap-icons/icons/megaphone.svg | 3 - node_modules/bootstrap-icons/icons/memory.svg | 3 - .../bootstrap-icons/icons/menu-app-fill.svg | 3 - .../bootstrap-icons/icons/menu-app.svg | 3 - .../icons/menu-button-fill.svg | 3 - .../icons/menu-button-wide-fill.svg | 3 - .../icons/menu-button-wide.svg | 4 - .../bootstrap-icons/icons/menu-button.svg | 4 - .../bootstrap-icons/icons/menu-down.svg | 3 - .../bootstrap-icons/icons/menu-up.svg | 3 - .../bootstrap-icons/icons/messenger.svg | 3 - node_modules/bootstrap-icons/icons/meta.svg | 3 - .../bootstrap-icons/icons/mic-fill.svg | 4 - .../bootstrap-icons/icons/mic-mute-fill.svg | 4 - .../bootstrap-icons/icons/mic-mute.svg | 4 - node_modules/bootstrap-icons/icons/mic.svg | 4 - .../bootstrap-icons/icons/microsoft-teams.svg | 4 - .../bootstrap-icons/icons/microsoft.svg | 3 - .../bootstrap-icons/icons/minecart-loaded.svg | 4 - .../bootstrap-icons/icons/minecart.svg | 3 - .../bootstrap-icons/icons/modem-fill.svg | 3 - node_modules/bootstrap-icons/icons/modem.svg | 4 - .../bootstrap-icons/icons/moisture.svg | 3 - .../bootstrap-icons/icons/moon-fill.svg | 3 - .../bootstrap-icons/icons/moon-stars-fill.svg | 4 - .../bootstrap-icons/icons/moon-stars.svg | 4 - node_modules/bootstrap-icons/icons/moon.svg | 3 - .../icons/mortarboard-fill.svg | 4 - .../bootstrap-icons/icons/mortarboard.svg | 4 - .../icons/motherboard-fill.svg | 4 - .../bootstrap-icons/icons/motherboard.svg | 4 - .../bootstrap-icons/icons/mouse-fill.svg | 3 - node_modules/bootstrap-icons/icons/mouse.svg | 3 - .../bootstrap-icons/icons/mouse2-fill.svg | 3 - node_modules/bootstrap-icons/icons/mouse2.svg | 3 - .../bootstrap-icons/icons/mouse3-fill.svg | 3 - node_modules/bootstrap-icons/icons/mouse3.svg | 3 - .../icons/music-note-beamed.svg | 5 - .../bootstrap-icons/icons/music-note-list.svg | 6 - .../bootstrap-icons/icons/music-note.svg | 5 - .../icons/music-player-fill.svg | 4 - .../bootstrap-icons/icons/music-player.svg | 5 - .../bootstrap-icons/icons/newspaper.svg | 4 - .../bootstrap-icons/icons/nintendo-switch.svg | 4 - .../bootstrap-icons/icons/node-minus-fill.svg | 3 - .../bootstrap-icons/icons/node-minus.svg | 3 - .../bootstrap-icons/icons/node-plus-fill.svg | 3 - .../bootstrap-icons/icons/node-plus.svg | 3 - .../bootstrap-icons/icons/noise-reduction.svg | 4 - .../bootstrap-icons/icons/nut-fill.svg | 3 - node_modules/bootstrap-icons/icons/nut.svg | 4 - node_modules/bootstrap-icons/icons/nvidia.svg | 3 - .../bootstrap-icons/icons/nvme-fill.svg | 4 - node_modules/bootstrap-icons/icons/nvme.svg | 4 - .../bootstrap-icons/icons/octagon-fill.svg | 3 - .../bootstrap-icons/icons/octagon-half.svg | 3 - .../bootstrap-icons/icons/octagon.svg | 3 - .../bootstrap-icons/icons/opencollective.svg | 4 - .../icons/optical-audio-fill.svg | 4 - .../bootstrap-icons/icons/optical-audio.svg | 5 - node_modules/bootstrap-icons/icons/option.svg | 3 - node_modules/bootstrap-icons/icons/outlet.svg | 4 - .../bootstrap-icons/icons/p-circle-fill.svg | 3 - .../bootstrap-icons/icons/p-circle.svg | 3 - .../bootstrap-icons/icons/p-square-fill.svg | 4 - .../bootstrap-icons/icons/p-square.svg | 4 - .../bootstrap-icons/icons/paint-bucket.svg | 3 - .../bootstrap-icons/icons/palette-fill.svg | 3 - .../bootstrap-icons/icons/palette.svg | 4 - .../bootstrap-icons/icons/palette2.svg | 3 - .../bootstrap-icons/icons/paperclip.svg | 3 - .../bootstrap-icons/icons/paragraph.svg | 3 - .../bootstrap-icons/icons/pass-fill.svg | 3 - node_modules/bootstrap-icons/icons/pass.svg | 4 - .../bootstrap-icons/icons/passport-fill.svg | 4 - .../bootstrap-icons/icons/passport.svg | 4 - .../icons/patch-check-fill.svg | 3 - .../bootstrap-icons/icons/patch-check.svg | 4 - .../icons/patch-exclamation-fill.svg | 3 - .../icons/patch-exclamation.svg | 4 - .../icons/patch-minus-fill.svg | 3 - .../bootstrap-icons/icons/patch-minus.svg | 4 - .../bootstrap-icons/icons/patch-plus-fill.svg | 3 - .../bootstrap-icons/icons/patch-plus.svg | 4 - .../icons/patch-question-fill.svg | 3 - .../bootstrap-icons/icons/patch-question.svg | 5 - .../bootstrap-icons/icons/pause-btn-fill.svg | 3 - .../bootstrap-icons/icons/pause-btn.svg | 4 - .../icons/pause-circle-fill.svg | 3 - .../bootstrap-icons/icons/pause-circle.svg | 4 - .../bootstrap-icons/icons/pause-fill.svg | 3 - node_modules/bootstrap-icons/icons/pause.svg | 3 - node_modules/bootstrap-icons/icons/paypal.svg | 3 - .../icons/pc-display-horizontal.svg | 3 - .../bootstrap-icons/icons/pc-display.svg | 3 - .../bootstrap-icons/icons/pc-horizontal.svg | 3 - node_modules/bootstrap-icons/icons/pc.svg | 3 - .../icons/pci-card-network.svg | 5 - .../bootstrap-icons/icons/pci-card-sound.svg | 5 - .../bootstrap-icons/icons/pci-card.svg | 4 - .../bootstrap-icons/icons/peace-fill.svg | 3 - node_modules/bootstrap-icons/icons/peace.svg | 3 - .../bootstrap-icons/icons/pen-fill.svg | 3 - node_modules/bootstrap-icons/icons/pen.svg | 3 - .../bootstrap-icons/icons/pencil-fill.svg | 3 - .../bootstrap-icons/icons/pencil-square.svg | 4 - node_modules/bootstrap-icons/icons/pencil.svg | 3 - .../bootstrap-icons/icons/pentagon-fill.svg | 3 - .../bootstrap-icons/icons/pentagon-half.svg | 3 - .../bootstrap-icons/icons/pentagon.svg | 3 - .../bootstrap-icons/icons/people-fill.svg | 3 - node_modules/bootstrap-icons/icons/people.svg | 3 - .../bootstrap-icons/icons/percent.svg | 3 - .../bootstrap-icons/icons/person-add.svg | 4 - .../bootstrap-icons/icons/person-arms-up.svg | 4 - .../icons/person-badge-fill.svg | 3 - .../bootstrap-icons/icons/person-badge.svg | 4 - .../icons/person-bounding-box.svg | 4 - .../icons/person-check-fill.svg | 4 - .../bootstrap-icons/icons/person-check.svg | 4 - .../bootstrap-icons/icons/person-circle.svg | 4 - .../icons/person-dash-fill.svg | 4 - .../bootstrap-icons/icons/person-dash.svg | 4 - .../bootstrap-icons/icons/person-down.svg | 4 - .../icons/person-exclamation.svg | 4 - .../bootstrap-icons/icons/person-fill-add.svg | 4 - .../icons/person-fill-check.svg | 4 - .../icons/person-fill-dash.svg | 4 - .../icons/person-fill-down.svg | 4 - .../icons/person-fill-exclamation.svg | 4 - .../icons/person-fill-gear.svg | 3 - .../icons/person-fill-lock.svg | 3 - .../icons/person-fill-slash.svg | 3 - .../bootstrap-icons/icons/person-fill-up.svg | 4 - .../bootstrap-icons/icons/person-fill-x.svg | 4 - .../bootstrap-icons/icons/person-fill.svg | 3 - .../bootstrap-icons/icons/person-gear.svg | 3 - .../bootstrap-icons/icons/person-heart.svg | 3 - .../bootstrap-icons/icons/person-hearts.svg | 3 - .../icons/person-lines-fill.svg | 3 - .../bootstrap-icons/icons/person-lock.svg | 3 - .../icons/person-plus-fill.svg | 4 - .../bootstrap-icons/icons/person-plus.svg | 4 - .../icons/person-raised-hand.svg | 4 - .../bootstrap-icons/icons/person-rolodex.svg | 4 - .../bootstrap-icons/icons/person-slash.svg | 3 - .../bootstrap-icons/icons/person-square.svg | 4 - .../icons/person-standing-dress.svg | 3 - .../bootstrap-icons/icons/person-standing.svg | 3 - .../bootstrap-icons/icons/person-up.svg | 4 - .../icons/person-vcard-fill.svg | 3 - .../bootstrap-icons/icons/person-vcard.svg | 4 - .../bootstrap-icons/icons/person-video.svg | 4 - .../bootstrap-icons/icons/person-video2.svg | 4 - .../bootstrap-icons/icons/person-video3.svg | 4 - .../bootstrap-icons/icons/person-walking.svg | 4 - .../icons/person-wheelchair.svg | 3 - .../icons/person-workspace.svg | 4 - .../bootstrap-icons/icons/person-x-fill.svg | 3 - .../bootstrap-icons/icons/person-x.svg | 4 - node_modules/bootstrap-icons/icons/person.svg | 3 - .../bootstrap-icons/icons/phone-fill.svg | 3 - .../bootstrap-icons/icons/phone-flip.svg | 3 - .../icons/phone-landscape-fill.svg | 3 - .../bootstrap-icons/icons/phone-landscape.svg | 4 - .../icons/phone-vibrate-fill.svg | 3 - .../bootstrap-icons/icons/phone-vibrate.svg | 4 - node_modules/bootstrap-icons/icons/phone.svg | 4 - .../bootstrap-icons/icons/pie-chart-fill.svg | 3 - .../bootstrap-icons/icons/pie-chart.svg | 3 - .../bootstrap-icons/icons/piggy-bank-fill.svg | 3 - .../bootstrap-icons/icons/piggy-bank.svg | 4 - .../bootstrap-icons/icons/pin-angle-fill.svg | 3 - .../bootstrap-icons/icons/pin-angle.svg | 3 - .../bootstrap-icons/icons/pin-fill.svg | 3 - .../bootstrap-icons/icons/pin-map-fill.svg | 4 - .../bootstrap-icons/icons/pin-map.svg | 4 - node_modules/bootstrap-icons/icons/pin.svg | 3 - .../bootstrap-icons/icons/pinterest.svg | 3 - .../bootstrap-icons/icons/pip-fill.svg | 3 - node_modules/bootstrap-icons/icons/pip.svg | 4 - .../bootstrap-icons/icons/play-btn-fill.svg | 3 - .../bootstrap-icons/icons/play-btn.svg | 4 - .../icons/play-circle-fill.svg | 3 - .../bootstrap-icons/icons/play-circle.svg | 4 - .../bootstrap-icons/icons/play-fill.svg | 3 - node_modules/bootstrap-icons/icons/play.svg | 3 - .../bootstrap-icons/icons/playstation.svg | 3 - .../bootstrap-icons/icons/plug-fill.svg | 3 - node_modules/bootstrap-icons/icons/plug.svg | 3 - node_modules/bootstrap-icons/icons/plugin.svg | 3 - .../icons/plus-circle-dotted.svg | 3 - .../icons/plus-circle-fill.svg | 3 - .../bootstrap-icons/icons/plus-circle.svg | 4 - .../bootstrap-icons/icons/plus-lg.svg | 3 - .../icons/plus-slash-minus.svg | 3 - .../icons/plus-square-dotted.svg | 3 - .../icons/plus-square-fill.svg | 3 - .../bootstrap-icons/icons/plus-square.svg | 4 - node_modules/bootstrap-icons/icons/plus.svg | 3 - .../bootstrap-icons/icons/postage-fill.svg | 4 - .../icons/postage-heart-fill.svg | 4 - .../bootstrap-icons/icons/postage-heart.svg | 4 - .../bootstrap-icons/icons/postage.svg | 4 - .../bootstrap-icons/icons/postcard-fill.svg | 4 - .../icons/postcard-heart-fill.svg | 3 - .../bootstrap-icons/icons/postcard-heart.svg | 4 - .../bootstrap-icons/icons/postcard.svg | 3 - node_modules/bootstrap-icons/icons/power.svg | 4 - .../bootstrap-icons/icons/prescription.svg | 4 - .../bootstrap-icons/icons/prescription2.svg | 4 - .../bootstrap-icons/icons/printer-fill.svg | 4 - .../bootstrap-icons/icons/printer.svg | 4 - .../bootstrap-icons/icons/projector-fill.svg | 3 - .../bootstrap-icons/icons/projector.svg | 4 - .../bootstrap-icons/icons/puzzle-fill.svg | 3 - node_modules/bootstrap-icons/icons/puzzle.svg | 3 - .../bootstrap-icons/icons/qr-code-scan.svg | 7 - .../bootstrap-icons/icons/qr-code.svg | 7 - .../icons/question-circle-fill.svg | 3 - .../bootstrap-icons/icons/question-circle.svg | 4 - .../icons/question-diamond-fill.svg | 3 - .../icons/question-diamond.svg | 4 - .../bootstrap-icons/icons/question-lg.svg | 3 - .../icons/question-octagon-fill.svg | 3 - .../icons/question-octagon.svg | 4 - .../icons/question-square-fill.svg | 3 - .../bootstrap-icons/icons/question-square.svg | 4 - .../bootstrap-icons/icons/question.svg | 3 - node_modules/bootstrap-icons/icons/quora.svg | 3 - node_modules/bootstrap-icons/icons/quote.svg | 3 - .../bootstrap-icons/icons/r-circle-fill.svg | 3 - .../bootstrap-icons/icons/r-circle.svg | 3 - .../bootstrap-icons/icons/r-square-fill.svg | 4 - .../bootstrap-icons/icons/r-square.svg | 4 - node_modules/bootstrap-icons/icons/radar.svg | 3 - .../bootstrap-icons/icons/radioactive.svg | 4 - .../bootstrap-icons/icons/rainbow.svg | 3 - .../bootstrap-icons/icons/receipt-cutoff.svg | 4 - .../bootstrap-icons/icons/receipt.svg | 4 - .../bootstrap-icons/icons/reception-0.svg | 3 - .../bootstrap-icons/icons/reception-1.svg | 3 - .../bootstrap-icons/icons/reception-2.svg | 3 - .../bootstrap-icons/icons/reception-3.svg | 3 - .../bootstrap-icons/icons/reception-4.svg | 3 - .../bootstrap-icons/icons/record-btn-fill.svg | 3 - .../bootstrap-icons/icons/record-btn.svg | 4 - .../icons/record-circle-fill.svg | 3 - .../bootstrap-icons/icons/record-circle.svg | 4 - .../bootstrap-icons/icons/record-fill.svg | 3 - node_modules/bootstrap-icons/icons/record.svg | 3 - .../bootstrap-icons/icons/record2-fill.svg | 4 - .../bootstrap-icons/icons/record2.svg | 4 - .../bootstrap-icons/icons/recycle.svg | 3 - node_modules/bootstrap-icons/icons/reddit.svg | 4 - node_modules/bootstrap-icons/icons/regex.svg | 3 - .../bootstrap-icons/icons/repeat-1.svg | 4 - node_modules/bootstrap-icons/icons/repeat.svg | 3 - .../bootstrap-icons/icons/reply-all-fill.svg | 4 - .../bootstrap-icons/icons/reply-all.svg | 4 - .../bootstrap-icons/icons/reply-fill.svg | 3 - node_modules/bootstrap-icons/icons/reply.svg | 3 - .../bootstrap-icons/icons/rewind-btn-fill.svg | 3 - .../bootstrap-icons/icons/rewind-btn.svg | 4 - .../icons/rewind-circle-fill.svg | 3 - .../bootstrap-icons/icons/rewind-circle.svg | 4 - .../bootstrap-icons/icons/rewind-fill.svg | 4 - node_modules/bootstrap-icons/icons/rewind.svg | 4 - node_modules/bootstrap-icons/icons/robot.svg | 4 - .../bootstrap-icons/icons/rocket-fill.svg | 4 - .../icons/rocket-takeoff-fill.svg | 4 - .../bootstrap-icons/icons/rocket-takeoff.svg | 5 - node_modules/bootstrap-icons/icons/rocket.svg | 5 - .../bootstrap-icons/icons/router-fill.svg | 6 - node_modules/bootstrap-icons/icons/router.svg | 6 - .../bootstrap-icons/icons/rss-fill.svg | 3 - node_modules/bootstrap-icons/icons/rss.svg | 4 - node_modules/bootstrap-icons/icons/rulers.svg | 3 - .../bootstrap-icons/icons/safe-fill.svg | 4 - node_modules/bootstrap-icons/icons/safe.svg | 4 - .../bootstrap-icons/icons/safe2-fill.svg | 4 - node_modules/bootstrap-icons/icons/safe2.svg | 4 - .../bootstrap-icons/icons/save-fill.svg | 3 - node_modules/bootstrap-icons/icons/save.svg | 3 - .../bootstrap-icons/icons/save2-fill.svg | 3 - node_modules/bootstrap-icons/icons/save2.svg | 3 - .../bootstrap-icons/icons/scissors.svg | 3 - .../bootstrap-icons/icons/scooter.svg | 3 - .../bootstrap-icons/icons/screwdriver.svg | 3 - .../bootstrap-icons/icons/sd-card-fill.svg | 3 - .../bootstrap-icons/icons/sd-card.svg | 4 - .../icons/search-heart-fill.svg | 3 - .../bootstrap-icons/icons/search-heart.svg | 4 - node_modules/bootstrap-icons/icons/search.svg | 3 - .../bootstrap-icons/icons/segmented-nav.svg | 3 - .../icons/send-arrow-down-fill.svg | 4 - .../bootstrap-icons/icons/send-arrow-down.svg | 4 - .../icons/send-arrow-up-fill.svg | 4 - .../bootstrap-icons/icons/send-arrow-up.svg | 4 - .../bootstrap-icons/icons/send-check-fill.svg | 4 - .../bootstrap-icons/icons/send-check.svg | 4 - .../bootstrap-icons/icons/send-dash-fill.svg | 4 - .../bootstrap-icons/icons/send-dash.svg | 4 - .../icons/send-exclamation-fill.svg | 4 - .../icons/send-exclamation.svg | 4 - .../bootstrap-icons/icons/send-fill.svg | 3 - .../bootstrap-icons/icons/send-plus-fill.svg | 4 - .../bootstrap-icons/icons/send-plus.svg | 4 - .../bootstrap-icons/icons/send-slash-fill.svg | 4 - .../bootstrap-icons/icons/send-slash.svg | 4 - .../bootstrap-icons/icons/send-x-fill.svg | 4 - node_modules/bootstrap-icons/icons/send-x.svg | 4 - node_modules/bootstrap-icons/icons/send.svg | 3 - node_modules/bootstrap-icons/icons/server.svg | 5 - .../bootstrap-icons/icons/shadows.svg | 3 - .../bootstrap-icons/icons/share-fill.svg | 3 - node_modules/bootstrap-icons/icons/share.svg | 3 - .../bootstrap-icons/icons/shield-check.svg | 4 - .../icons/shield-exclamation.svg | 4 - .../icons/shield-fill-check.svg | 3 - .../icons/shield-fill-exclamation.svg | 3 - .../icons/shield-fill-minus.svg | 3 - .../icons/shield-fill-plus.svg | 3 - .../bootstrap-icons/icons/shield-fill-x.svg | 3 - .../bootstrap-icons/icons/shield-fill.svg | 3 - .../icons/shield-lock-fill.svg | 3 - .../bootstrap-icons/icons/shield-lock.svg | 4 - .../bootstrap-icons/icons/shield-minus.svg | 4 - .../bootstrap-icons/icons/shield-plus.svg | 4 - .../bootstrap-icons/icons/shield-shaded.svg | 3 - .../icons/shield-slash-fill.svg | 3 - .../bootstrap-icons/icons/shield-slash.svg | 3 - .../bootstrap-icons/icons/shield-x.svg | 4 - node_modules/bootstrap-icons/icons/shield.svg | 3 - .../bootstrap-icons/icons/shift-fill.svg | 3 - node_modules/bootstrap-icons/icons/shift.svg | 3 - .../bootstrap-icons/icons/shop-window.svg | 3 - node_modules/bootstrap-icons/icons/shop.svg | 3 - .../bootstrap-icons/icons/shuffle.svg | 4 - .../icons/sign-dead-end-fill.svg | 4 - .../bootstrap-icons/icons/sign-dead-end.svg | 4 - .../icons/sign-do-not-enter-fill.svg | 4 - .../icons/sign-do-not-enter.svg | 4 - .../icons/sign-intersection-fill.svg | 3 - .../icons/sign-intersection-side-fill.svg | 3 - .../icons/sign-intersection-side.svg | 4 - .../icons/sign-intersection-t-fill.svg | 3 - .../icons/sign-intersection-t.svg | 4 - .../icons/sign-intersection-y-fill.svg | 3 - .../icons/sign-intersection-y.svg | 4 - .../icons/sign-intersection.svg | 4 - .../icons/sign-merge-left-fill.svg | 3 - .../bootstrap-icons/icons/sign-merge-left.svg | 4 - .../icons/sign-merge-right-fill.svg | 3 - .../icons/sign-merge-right.svg | 4 - .../icons/sign-no-left-turn-fill.svg | 4 - .../icons/sign-no-left-turn.svg | 3 - .../icons/sign-no-parking-fill.svg | 4 - .../bootstrap-icons/icons/sign-no-parking.svg | 3 - .../icons/sign-no-right-turn-fill.svg | 4 - .../icons/sign-no-right-turn.svg | 3 - .../icons/sign-railroad-fill.svg | 5 - .../bootstrap-icons/icons/sign-railroad.svg | 4 - .../bootstrap-icons/icons/sign-stop-fill.svg | 4 - .../icons/sign-stop-lights-fill.svg | 4 - .../icons/sign-stop-lights.svg | 4 - .../bootstrap-icons/icons/sign-stop.svg | 5 - .../icons/sign-turn-left-fill.svg | 3 - .../bootstrap-icons/icons/sign-turn-left.svg | 4 - .../icons/sign-turn-right-fill.svg | 3 - .../bootstrap-icons/icons/sign-turn-right.svg | 4 - .../icons/sign-turn-slight-left-fill.svg | 3 - .../icons/sign-turn-slight-left.svg | 4 - .../icons/sign-turn-slight-right-fill.svg | 3 - .../icons/sign-turn-slight-right.svg | 4 - .../bootstrap-icons/icons/sign-yield-fill.svg | 4 - .../bootstrap-icons/icons/sign-yield.svg | 5 - node_modules/bootstrap-icons/icons/signal.svg | 3 - .../bootstrap-icons/icons/signpost-2-fill.svg | 3 - .../bootstrap-icons/icons/signpost-2.svg | 3 - .../bootstrap-icons/icons/signpost-fill.svg | 3 - .../icons/signpost-split-fill.svg | 3 - .../bootstrap-icons/icons/signpost-split.svg | 3 - .../bootstrap-icons/icons/signpost.svg | 3 - .../bootstrap-icons/icons/sim-fill.svg | 4 - .../bootstrap-icons/icons/sim-slash-fill.svg | 3 - .../bootstrap-icons/icons/sim-slash.svg | 3 - node_modules/bootstrap-icons/icons/sim.svg | 4 - .../bootstrap-icons/icons/sina-weibo.svg | 4 - .../icons/skip-backward-btn-fill.svg | 3 - .../icons/skip-backward-btn.svg | 4 - .../icons/skip-backward-circle-fill.svg | 3 - .../icons/skip-backward-circle.svg | 4 - .../icons/skip-backward-fill.svg | 3 - .../bootstrap-icons/icons/skip-backward.svg | 3 - .../icons/skip-end-btn-fill.svg | 3 - .../bootstrap-icons/icons/skip-end-btn.svg | 4 - .../icons/skip-end-circle-fill.svg | 3 - .../bootstrap-icons/icons/skip-end-circle.svg | 4 - .../bootstrap-icons/icons/skip-end-fill.svg | 3 - .../bootstrap-icons/icons/skip-end.svg | 3 - .../icons/skip-forward-btn-fill.svg | 3 - .../icons/skip-forward-btn.svg | 4 - .../icons/skip-forward-circle-fill.svg | 3 - .../icons/skip-forward-circle.svg | 4 - .../icons/skip-forward-fill.svg | 3 - .../bootstrap-icons/icons/skip-forward.svg | 3 - .../icons/skip-start-btn-fill.svg | 3 - .../bootstrap-icons/icons/skip-start-btn.svg | 4 - .../icons/skip-start-circle-fill.svg | 3 - .../icons/skip-start-circle.svg | 4 - .../bootstrap-icons/icons/skip-start-fill.svg | 3 - .../bootstrap-icons/icons/skip-start.svg | 3 - node_modules/bootstrap-icons/icons/skype.svg | 3 - node_modules/bootstrap-icons/icons/slack.svg | 3 - .../icons/slash-circle-fill.svg | 3 - .../bootstrap-icons/icons/slash-circle.svg | 4 - .../bootstrap-icons/icons/slash-lg.svg | 3 - .../icons/slash-square-fill.svg | 3 - .../bootstrap-icons/icons/slash-square.svg | 4 - node_modules/bootstrap-icons/icons/slash.svg | 3 - .../bootstrap-icons/icons/sliders.svg | 3 - .../icons/sliders2-vertical.svg | 3 - .../bootstrap-icons/icons/sliders2.svg | 3 - .../bootstrap-icons/icons/smartwatch.svg | 4 - .../bootstrap-icons/icons/snapchat.svg | 3 - node_modules/bootstrap-icons/icons/snow.svg | 3 - node_modules/bootstrap-icons/icons/snow2.svg | 3 - node_modules/bootstrap-icons/icons/snow3.svg | 4 - .../icons/sort-alpha-down-alt.svg | 5 - .../bootstrap-icons/icons/sort-alpha-down.svg | 4 - .../icons/sort-alpha-up-alt.svg | 5 - .../bootstrap-icons/icons/sort-alpha-up.svg | 4 - .../bootstrap-icons/icons/sort-down-alt.svg | 3 - .../bootstrap-icons/icons/sort-down.svg | 3 - .../icons/sort-numeric-down-alt.svg | 4 - .../icons/sort-numeric-down.svg | 5 - .../icons/sort-numeric-up-alt.svg | 4 - .../bootstrap-icons/icons/sort-numeric-up.svg | 5 - .../bootstrap-icons/icons/sort-up-alt.svg | 3 - .../bootstrap-icons/icons/sort-up.svg | 3 - .../bootstrap-icons/icons/soundwave.svg | 3 - .../bootstrap-icons/icons/sourceforge.svg | 4 - .../bootstrap-icons/icons/speaker-fill.svg | 4 - .../bootstrap-icons/icons/speaker.svg | 4 - .../bootstrap-icons/icons/speedometer.svg | 4 - .../bootstrap-icons/icons/speedometer2.svg | 4 - .../bootstrap-icons/icons/spellcheck.svg | 4 - .../bootstrap-icons/icons/spotify.svg | 3 - .../bootstrap-icons/icons/square-fill.svg | 3 - .../bootstrap-icons/icons/square-half.svg | 3 - node_modules/bootstrap-icons/icons/square.svg | 3 - .../bootstrap-icons/icons/stack-overflow.svg | 4 - node_modules/bootstrap-icons/icons/stack.svg | 4 - .../bootstrap-icons/icons/star-fill.svg | 3 - .../bootstrap-icons/icons/star-half.svg | 3 - node_modules/bootstrap-icons/icons/star.svg | 3 - node_modules/bootstrap-icons/icons/stars.svg | 3 - node_modules/bootstrap-icons/icons/steam.svg | 4 - .../bootstrap-icons/icons/stickies-fill.svg | 4 - .../bootstrap-icons/icons/stickies.svg | 4 - .../bootstrap-icons/icons/sticky-fill.svg | 3 - node_modules/bootstrap-icons/icons/sticky.svg | 3 - .../bootstrap-icons/icons/stop-btn-fill.svg | 3 - .../bootstrap-icons/icons/stop-btn.svg | 4 - .../icons/stop-circle-fill.svg | 3 - .../bootstrap-icons/icons/stop-circle.svg | 4 - .../bootstrap-icons/icons/stop-fill.svg | 3 - node_modules/bootstrap-icons/icons/stop.svg | 3 - .../bootstrap-icons/icons/stoplights-fill.svg | 3 - .../bootstrap-icons/icons/stoplights.svg | 4 - .../bootstrap-icons/icons/stopwatch-fill.svg | 3 - .../bootstrap-icons/icons/stopwatch.svg | 4 - node_modules/bootstrap-icons/icons/strava.svg | 3 - node_modules/bootstrap-icons/icons/stripe.svg | 3 - .../bootstrap-icons/icons/subscript.svg | 3 - .../bootstrap-icons/icons/substack.svg | 3 - .../bootstrap-icons/icons/subtract.svg | 3 - .../bootstrap-icons/icons/suit-club-fill.svg | 3 - .../bootstrap-icons/icons/suit-club.svg | 3 - .../icons/suit-diamond-fill.svg | 3 - .../bootstrap-icons/icons/suit-diamond.svg | 3 - .../bootstrap-icons/icons/suit-heart-fill.svg | 3 - .../bootstrap-icons/icons/suit-heart.svg | 3 - .../bootstrap-icons/icons/suit-spade-fill.svg | 3 - .../bootstrap-icons/icons/suit-spade.svg | 3 - .../bootstrap-icons/icons/suitcase-fill.svg | 3 - .../icons/suitcase-lg-fill.svg | 3 - .../bootstrap-icons/icons/suitcase-lg.svg | 3 - .../bootstrap-icons/icons/suitcase.svg | 4 - .../bootstrap-icons/icons/suitcase2-fill.svg | 3 - .../bootstrap-icons/icons/suitcase2.svg | 3 - .../bootstrap-icons/icons/sun-fill.svg | 3 - node_modules/bootstrap-icons/icons/sun.svg | 3 - .../bootstrap-icons/icons/sunglasses.svg | 3 - .../bootstrap-icons/icons/sunrise-fill.svg | 3 - .../bootstrap-icons/icons/sunrise.svg | 3 - .../bootstrap-icons/icons/sunset-fill.svg | 3 - node_modules/bootstrap-icons/icons/sunset.svg | 3 - .../bootstrap-icons/icons/superscript.svg | 3 - .../icons/symmetry-horizontal.svg | 3 - .../icons/symmetry-vertical.svg | 3 - node_modules/bootstrap-icons/icons/table.svg | 3 - .../bootstrap-icons/icons/tablet-fill.svg | 3 - .../icons/tablet-landscape-fill.svg | 3 - .../icons/tablet-landscape.svg | 4 - node_modules/bootstrap-icons/icons/tablet.svg | 4 - .../bootstrap-icons/icons/tag-fill.svg | 3 - node_modules/bootstrap-icons/icons/tag.svg | 4 - .../bootstrap-icons/icons/tags-fill.svg | 4 - node_modules/bootstrap-icons/icons/tags.svg | 4 - .../bootstrap-icons/icons/taxi-front-fill.svg | 3 - .../bootstrap-icons/icons/taxi-front.svg | 4 - .../bootstrap-icons/icons/telegram.svg | 3 - .../bootstrap-icons/icons/telephone-fill.svg | 3 - .../icons/telephone-forward-fill.svg | 3 - .../icons/telephone-forward.svg | 3 - .../icons/telephone-inbound-fill.svg | 3 - .../icons/telephone-inbound.svg | 3 - .../icons/telephone-minus-fill.svg | 3 - .../bootstrap-icons/icons/telephone-minus.svg | 4 - .../icons/telephone-outbound-fill.svg | 3 - .../icons/telephone-outbound.svg | 3 - .../icons/telephone-plus-fill.svg | 3 - .../bootstrap-icons/icons/telephone-plus.svg | 4 - .../icons/telephone-x-fill.svg | 3 - .../bootstrap-icons/icons/telephone-x.svg | 4 - .../bootstrap-icons/icons/telephone.svg | 3 - .../bootstrap-icons/icons/tencent-qq.svg | 4 - .../bootstrap-icons/icons/terminal-dash.svg | 4 - .../bootstrap-icons/icons/terminal-fill.svg | 3 - .../bootstrap-icons/icons/terminal-plus.svg | 4 - .../bootstrap-icons/icons/terminal-split.svg | 4 - .../bootstrap-icons/icons/terminal-x.svg | 4 - .../bootstrap-icons/icons/terminal.svg | 4 - .../bootstrap-icons/icons/text-center.svg | 3 - .../icons/text-indent-left.svg | 3 - .../icons/text-indent-right.svg | 3 - .../bootstrap-icons/icons/text-left.svg | 3 - .../bootstrap-icons/icons/text-paragraph.svg | 3 - .../bootstrap-icons/icons/text-right.svg | 3 - .../bootstrap-icons/icons/text-wrap.svg | 3 - .../bootstrap-icons/icons/textarea-resize.svg | 3 - .../bootstrap-icons/icons/textarea-t.svg | 4 - .../bootstrap-icons/icons/textarea.svg | 3 - .../icons/thermometer-half.svg | 4 - .../icons/thermometer-high.svg | 4 - .../bootstrap-icons/icons/thermometer-low.svg | 4 - .../icons/thermometer-snow.svg | 4 - .../bootstrap-icons/icons/thermometer-sun.svg | 4 - .../bootstrap-icons/icons/thermometer.svg | 4 - .../bootstrap-icons/icons/threads-fill.svg | 4 - .../bootstrap-icons/icons/threads.svg | 3 - .../icons/three-dots-vertical.svg | 3 - .../bootstrap-icons/icons/three-dots.svg | 3 - .../icons/thunderbolt-fill.svg | 3 - .../bootstrap-icons/icons/thunderbolt.svg | 4 - .../icons/ticket-detailed-fill.svg | 3 - .../bootstrap-icons/icons/ticket-detailed.svg | 4 - .../bootstrap-icons/icons/ticket-fill.svg | 3 - .../icons/ticket-perforated-fill.svg | 3 - .../icons/ticket-perforated.svg | 4 - node_modules/bootstrap-icons/icons/ticket.svg | 3 - node_modules/bootstrap-icons/icons/tiktok.svg | 3 - .../bootstrap-icons/icons/toggle-off.svg | 3 - .../bootstrap-icons/icons/toggle-on.svg | 3 - .../bootstrap-icons/icons/toggle2-off.svg | 4 - .../bootstrap-icons/icons/toggle2-on.svg | 4 - .../bootstrap-icons/icons/toggles.svg | 3 - .../bootstrap-icons/icons/toggles2.svg | 5 - node_modules/bootstrap-icons/icons/tools.svg | 3 - .../bootstrap-icons/icons/tornado.svg | 3 - .../icons/train-freight-front-fill.svg | 3 - .../icons/train-freight-front.svg | 3 - .../icons/train-front-fill.svg | 3 - .../bootstrap-icons/icons/train-front.svg | 3 - .../icons/train-lightrail-front-fill.svg | 3 - .../icons/train-lightrail-front.svg | 3 - .../bootstrap-icons/icons/translate.svg | 4 - .../bootstrap-icons/icons/transparency.svg | 3 - .../bootstrap-icons/icons/trash-fill.svg | 3 - node_modules/bootstrap-icons/icons/trash.svg | 4 - .../bootstrap-icons/icons/trash2-fill.svg | 3 - node_modules/bootstrap-icons/icons/trash2.svg | 3 - .../bootstrap-icons/icons/trash3-fill.svg | 3 - node_modules/bootstrap-icons/icons/trash3.svg | 3 - .../bootstrap-icons/icons/tree-fill.svg | 3 - node_modules/bootstrap-icons/icons/tree.svg | 3 - node_modules/bootstrap-icons/icons/trello.svg | 3 - .../bootstrap-icons/icons/triangle-fill.svg | 3 - .../bootstrap-icons/icons/triangle-half.svg | 3 - .../bootstrap-icons/icons/triangle.svg | 3 - .../bootstrap-icons/icons/trophy-fill.svg | 3 - node_modules/bootstrap-icons/icons/trophy.svg | 3 - .../bootstrap-icons/icons/tropical-storm.svg | 4 - .../bootstrap-icons/icons/truck-flatbed.svg | 3 - .../icons/truck-front-fill.svg | 3 - .../bootstrap-icons/icons/truck-front.svg | 4 - node_modules/bootstrap-icons/icons/truck.svg | 3 - .../bootstrap-icons/icons/tsunami.svg | 3 - .../bootstrap-icons/icons/tv-fill.svg | 3 - node_modules/bootstrap-icons/icons/tv.svg | 3 - node_modules/bootstrap-icons/icons/twitch.svg | 4 - .../bootstrap-icons/icons/twitter-x.svg | 3 - .../bootstrap-icons/icons/twitter.svg | 3 - .../bootstrap-icons/icons/type-bold.svg | 3 - .../bootstrap-icons/icons/type-h1.svg | 3 - .../bootstrap-icons/icons/type-h2.svg | 3 - .../bootstrap-icons/icons/type-h3.svg | 3 - .../bootstrap-icons/icons/type-h4.svg | 3 - .../bootstrap-icons/icons/type-h5.svg | 3 - .../bootstrap-icons/icons/type-h6.svg | 3 - .../bootstrap-icons/icons/type-italic.svg | 3 - .../icons/type-strikethrough.svg | 3 - .../bootstrap-icons/icons/type-underline.svg | 3 - node_modules/bootstrap-icons/icons/type.svg | 3 - node_modules/bootstrap-icons/icons/ubuntu.svg | 3 - .../bootstrap-icons/icons/ui-checks-grid.svg | 3 - .../bootstrap-icons/icons/ui-checks.svg | 3 - .../bootstrap-icons/icons/ui-radios-grid.svg | 3 - .../bootstrap-icons/icons/ui-radios.svg | 3 - .../bootstrap-icons/icons/umbrella-fill.svg | 3 - .../bootstrap-icons/icons/umbrella.svg | 3 - .../bootstrap-icons/icons/unindent.svg | 4 - node_modules/bootstrap-icons/icons/union.svg | 3 - node_modules/bootstrap-icons/icons/unity.svg | 3 - .../icons/universal-access-circle.svg | 4 - .../icons/universal-access.svg | 3 - .../bootstrap-icons/icons/unlock-fill.svg | 3 - node_modules/bootstrap-icons/icons/unlock.svg | 3 - .../bootstrap-icons/icons/upc-scan.svg | 3 - node_modules/bootstrap-icons/icons/upc.svg | 3 - node_modules/bootstrap-icons/icons/upload.svg | 4 - .../bootstrap-icons/icons/usb-c-fill.svg | 3 - node_modules/bootstrap-icons/icons/usb-c.svg | 4 - .../bootstrap-icons/icons/usb-drive-fill.svg | 3 - .../bootstrap-icons/icons/usb-drive.svg | 3 - .../bootstrap-icons/icons/usb-fill.svg | 3 - .../bootstrap-icons/icons/usb-micro-fill.svg | 3 - .../bootstrap-icons/icons/usb-micro.svg | 4 - .../bootstrap-icons/icons/usb-mini-fill.svg | 3 - .../bootstrap-icons/icons/usb-mini.svg | 4 - .../bootstrap-icons/icons/usb-plug-fill.svg | 3 - .../bootstrap-icons/icons/usb-plug.svg | 3 - .../bootstrap-icons/icons/usb-symbol.svg | 3 - node_modules/bootstrap-icons/icons/usb.svg | 4 - .../bootstrap-icons/icons/valentine.svg | 4 - .../bootstrap-icons/icons/valentine2.svg | 4 - .../bootstrap-icons/icons/vector-pen.svg | 4 - .../bootstrap-icons/icons/view-list.svg | 3 - .../bootstrap-icons/icons/view-stacked.svg | 3 - .../bootstrap-icons/icons/vignette.svg | 4 - node_modules/bootstrap-icons/icons/vimeo.svg | 3 - .../bootstrap-icons/icons/vinyl-fill.svg | 4 - node_modules/bootstrap-icons/icons/vinyl.svg | 5 - node_modules/bootstrap-icons/icons/virus.svg | 3 - node_modules/bootstrap-icons/icons/virus2.svg | 3 - .../bootstrap-icons/icons/voicemail.svg | 3 - .../icons/volume-down-fill.svg | 3 - .../bootstrap-icons/icons/volume-down.svg | 3 - .../icons/volume-mute-fill.svg | 3 - .../bootstrap-icons/icons/volume-mute.svg | 3 - .../bootstrap-icons/icons/volume-off-fill.svg | 3 - .../bootstrap-icons/icons/volume-off.svg | 3 - .../bootstrap-icons/icons/volume-up-fill.svg | 5 - .../bootstrap-icons/icons/volume-up.svg | 5 - node_modules/bootstrap-icons/icons/vr.svg | 3 - .../bootstrap-icons/icons/wallet-fill.svg | 4 - node_modules/bootstrap-icons/icons/wallet.svg | 3 - .../bootstrap-icons/icons/wallet2.svg | 3 - node_modules/bootstrap-icons/icons/watch.svg | 4 - node_modules/bootstrap-icons/icons/water.svg | 3 - .../bootstrap-icons/icons/webcam-fill.svg | 4 - node_modules/bootstrap-icons/icons/webcam.svg | 4 - node_modules/bootstrap-icons/icons/wechat.svg | 4 - .../bootstrap-icons/icons/whatsapp.svg | 3 - node_modules/bootstrap-icons/icons/wifi-1.svg | 3 - node_modules/bootstrap-icons/icons/wifi-2.svg | 3 - .../bootstrap-icons/icons/wifi-off.svg | 3 - node_modules/bootstrap-icons/icons/wifi.svg | 4 - .../bootstrap-icons/icons/wikipedia.svg | 3 - node_modules/bootstrap-icons/icons/wind.svg | 3 - .../bootstrap-icons/icons/window-dash.svg | 5 - .../bootstrap-icons/icons/window-desktop.svg | 4 - .../bootstrap-icons/icons/window-dock.svg | 4 - .../icons/window-fullscreen.svg | 4 - .../bootstrap-icons/icons/window-plus.svg | 5 - .../bootstrap-icons/icons/window-sidebar.svg | 4 - .../bootstrap-icons/icons/window-split.svg | 4 - .../bootstrap-icons/icons/window-stack.svg | 4 - .../bootstrap-icons/icons/window-x.svg | 5 - node_modules/bootstrap-icons/icons/window.svg | 4 - .../bootstrap-icons/icons/windows.svg | 3 - .../bootstrap-icons/icons/wordpress.svg | 5 - .../icons/wrench-adjustable-circle-fill.svg | 4 - .../icons/wrench-adjustable-circle.svg | 4 - .../icons/wrench-adjustable.svg | 4 - node_modules/bootstrap-icons/icons/wrench.svg | 3 - .../bootstrap-icons/icons/x-circle-fill.svg | 3 - .../bootstrap-icons/icons/x-circle.svg | 4 - .../bootstrap-icons/icons/x-diamond-fill.svg | 3 - .../bootstrap-icons/icons/x-diamond.svg | 3 - node_modules/bootstrap-icons/icons/x-lg.svg | 3 - .../bootstrap-icons/icons/x-octagon-fill.svg | 3 - .../bootstrap-icons/icons/x-octagon.svg | 4 - .../bootstrap-icons/icons/x-square-fill.svg | 3 - .../bootstrap-icons/icons/x-square.svg | 4 - node_modules/bootstrap-icons/icons/x.svg | 3 - node_modules/bootstrap-icons/icons/xbox.svg | 3 - node_modules/bootstrap-icons/icons/yelp.svg | 3 - .../bootstrap-icons/icons/yin-yang.svg | 4 - .../bootstrap-icons/icons/youtube.svg | 3 - .../bootstrap-icons/icons/zoom-in.svg | 5 - .../bootstrap-icons/icons/zoom-out.svg | 5 - node_modules/bootstrap-icons/package.json | 91 - node_modules/browserslist/LICENSE | 20 - node_modules/browserslist/README.md | 67 - node_modules/browserslist/browser.js | 52 - node_modules/browserslist/cli.js | 156 - node_modules/browserslist/error.d.ts | 7 - node_modules/browserslist/error.js | 12 - node_modules/browserslist/index.d.ts | 200 - node_modules/browserslist/index.js | 1206 - node_modules/browserslist/node.js | 410 - node_modules/browserslist/package.json | 44 - node_modules/browserslist/parse.js | 78 - node_modules/buffer-from/LICENSE | 21 - node_modules/buffer-from/index.js | 72 - node_modules/buffer-from/package.json | 19 - node_modules/buffer-from/readme.md | 69 - node_modules/caniuse-lite/LICENSE | 395 - node_modules/caniuse-lite/README.md | 6 - node_modules/caniuse-lite/data/agents.js | 1 - .../caniuse-lite/data/browserVersions.js | 1 - node_modules/caniuse-lite/data/browsers.js | 1 - node_modules/caniuse-lite/data/features.js | 1 - .../caniuse-lite/data/features/aac.js | 1 - .../data/features/abortcontroller.js | 1 - .../caniuse-lite/data/features/ac3-ec3.js | 1 - .../data/features/accelerometer.js | 1 - .../data/features/addeventlistener.js | 1 - .../data/features/alternate-stylesheet.js | 1 - .../data/features/ambient-light.js | 1 - .../caniuse-lite/data/features/apng.js | 1 - .../data/features/array-find-index.js | 1 - .../caniuse-lite/data/features/array-find.js | 1 - .../caniuse-lite/data/features/array-flat.js | 1 - .../data/features/array-includes.js | 1 - .../data/features/arrow-functions.js | 1 - .../caniuse-lite/data/features/asmjs.js | 1 - .../data/features/async-clipboard.js | 1 - .../data/features/async-functions.js | 1 - .../caniuse-lite/data/features/atob-btoa.js | 1 - .../caniuse-lite/data/features/audio-api.js | 1 - .../caniuse-lite/data/features/audio.js | 1 - .../caniuse-lite/data/features/audiotracks.js | 1 - .../caniuse-lite/data/features/autofocus.js | 1 - .../caniuse-lite/data/features/auxclick.js | 1 - .../caniuse-lite/data/features/av1.js | 1 - .../caniuse-lite/data/features/avif.js | 1 - .../data/features/background-attachment.js | 1 - .../data/features/background-clip-text.js | 1 - .../data/features/background-img-opts.js | 1 - .../data/features/background-position-x-y.js | 1 - .../features/background-repeat-round-space.js | 1 - .../data/features/background-sync.js | 1 - .../data/features/battery-status.js | 1 - .../caniuse-lite/data/features/beacon.js | 1 - .../data/features/beforeafterprint.js | 1 - .../caniuse-lite/data/features/bigint.js | 1 - .../caniuse-lite/data/features/blobbuilder.js | 1 - .../caniuse-lite/data/features/bloburls.js | 1 - .../data/features/border-image.js | 1 - .../data/features/border-radius.js | 1 - .../data/features/broadcastchannel.js | 1 - .../caniuse-lite/data/features/brotli.js | 1 - .../caniuse-lite/data/features/calc.js | 1 - .../data/features/canvas-blending.js | 1 - .../caniuse-lite/data/features/canvas-text.js | 1 - .../caniuse-lite/data/features/canvas.js | 1 - .../caniuse-lite/data/features/ch-unit.js | 1 - .../data/features/chacha20-poly1305.js | 1 - .../data/features/channel-messaging.js | 1 - .../data/features/childnode-remove.js | 1 - .../caniuse-lite/data/features/classlist.js | 1 - .../client-hints-dpr-width-viewport.js | 1 - .../caniuse-lite/data/features/clipboard.js | 1 - .../caniuse-lite/data/features/colr-v1.js | 1 - .../caniuse-lite/data/features/colr.js | 1 - .../data/features/comparedocumentposition.js | 1 - .../data/features/console-basic.js | 1 - .../data/features/console-time.js | 1 - .../caniuse-lite/data/features/const.js | 1 - .../data/features/constraint-validation.js | 1 - .../data/features/contenteditable.js | 1 - .../data/features/contentsecuritypolicy.js | 1 - .../data/features/contentsecuritypolicy2.js | 1 - .../data/features/cookie-store-api.js | 1 - .../caniuse-lite/data/features/cors.js | 1 - .../data/features/createimagebitmap.js | 1 - .../data/features/credential-management.js | 1 - .../data/features/cryptography.js | 1 - .../caniuse-lite/data/features/css-all.js | 1 - .../data/features/css-anchor-positioning.js | 1 - .../data/features/css-animation.js | 1 - .../data/features/css-any-link.js | 1 - .../data/features/css-appearance.js | 1 - .../data/features/css-at-counter-style.js | 1 - .../data/features/css-autofill.js | 1 - .../data/features/css-backdrop-filter.js | 1 - .../data/features/css-background-offsets.js | 1 - .../data/features/css-backgroundblendmode.js | 1 - .../data/features/css-boxdecorationbreak.js | 1 - .../data/features/css-boxshadow.js | 1 - .../caniuse-lite/data/features/css-canvas.js | 1 - .../data/features/css-caret-color.js | 1 - .../data/features/css-cascade-layers.js | 1 - .../data/features/css-cascade-scope.js | 1 - .../data/features/css-case-insensitive.js | 1 - .../data/features/css-clip-path.js | 1 - .../data/features/css-color-adjust.js | 1 - .../data/features/css-color-function.js | 1 - .../data/features/css-conic-gradients.js | 1 - .../features/css-container-queries-style.js | 1 - .../data/features/css-container-queries.js | 1 - .../features/css-container-query-units.js | 1 - .../data/features/css-containment.js | 1 - .../data/features/css-content-visibility.js | 1 - .../data/features/css-counters.js | 1 - .../data/features/css-crisp-edges.js | 1 - .../data/features/css-cross-fade.js | 1 - .../data/features/css-default-pseudo.js | 1 - .../data/features/css-descendant-gtgt.js | 1 - .../data/features/css-deviceadaptation.js | 1 - .../data/features/css-dir-pseudo.js | 1 - .../data/features/css-display-contents.js | 1 - .../data/features/css-element-function.js | 1 - .../data/features/css-env-function.js | 1 - .../data/features/css-exclusions.js | 1 - .../data/features/css-featurequeries.js | 1 - .../data/features/css-file-selector-button.js | 1 - .../data/features/css-filter-function.js | 1 - .../caniuse-lite/data/features/css-filters.js | 1 - .../data/features/css-first-letter.js | 1 - .../data/features/css-first-line.js | 1 - .../caniuse-lite/data/features/css-fixed.js | 1 - .../data/features/css-focus-visible.js | 1 - .../data/features/css-focus-within.js | 1 - .../data/features/css-font-palette.js | 1 - .../features/css-font-rendering-controls.js | 1 - .../data/features/css-font-stretch.js | 1 - .../data/features/css-gencontent.js | 1 - .../data/features/css-gradients.js | 1 - .../data/features/css-grid-animation.js | 1 - .../caniuse-lite/data/features/css-grid.js | 1 - .../data/features/css-hanging-punctuation.js | 1 - .../caniuse-lite/data/features/css-has.js | 1 - .../caniuse-lite/data/features/css-hyphens.js | 1 - .../data/features/css-image-orientation.js | 1 - .../data/features/css-image-set.js | 1 - .../data/features/css-in-out-of-range.js | 1 - .../data/features/css-indeterminate-pseudo.js | 1 - .../data/features/css-initial-letter.js | 1 - .../data/features/css-initial-value.js | 1 - .../caniuse-lite/data/features/css-lch-lab.js | 1 - .../data/features/css-letter-spacing.js | 1 - .../data/features/css-line-clamp.js | 1 - .../data/features/css-logical-props.js | 1 - .../data/features/css-marker-pseudo.js | 1 - .../caniuse-lite/data/features/css-masks.js | 1 - .../data/features/css-matches-pseudo.js | 1 - .../data/features/css-math-functions.js | 1 - .../data/features/css-media-interaction.js | 1 - .../data/features/css-media-range-syntax.js | 1 - .../data/features/css-media-resolution.js | 1 - .../data/features/css-media-scripting.js | 1 - .../data/features/css-mediaqueries.js | 1 - .../data/features/css-mixblendmode.js | 1 - .../data/features/css-motion-paths.js | 1 - .../data/features/css-namespaces.js | 1 - .../caniuse-lite/data/features/css-nesting.js | 1 - .../data/features/css-not-sel-list.js | 1 - .../data/features/css-nth-child-of.js | 1 - .../caniuse-lite/data/features/css-opacity.js | 1 - .../data/features/css-optional-pseudo.js | 1 - .../data/features/css-overflow-anchor.js | 1 - .../data/features/css-overflow-overlay.js | 1 - .../data/features/css-overflow.js | 1 - .../data/features/css-overscroll-behavior.js | 1 - .../data/features/css-page-break.js | 1 - .../data/features/css-paged-media.js | 1 - .../data/features/css-paint-api.js | 1 - .../data/features/css-placeholder-shown.js | 1 - .../data/features/css-placeholder.js | 1 - .../data/features/css-print-color-adjust.js | 1 - .../data/features/css-read-only-write.js | 1 - .../data/features/css-rebeccapurple.js | 1 - .../data/features/css-reflections.js | 1 - .../caniuse-lite/data/features/css-regions.js | 1 - .../data/features/css-relative-colors.js | 1 - .../data/features/css-repeating-gradients.js | 1 - .../caniuse-lite/data/features/css-resize.js | 1 - .../data/features/css-revert-value.js | 1 - .../data/features/css-rrggbbaa.js | 1 - .../data/features/css-scroll-behavior.js | 1 - .../data/features/css-scroll-timeline.js | 1 - .../data/features/css-scrollbar.js | 1 - .../caniuse-lite/data/features/css-sel2.js | 1 - .../caniuse-lite/data/features/css-sel3.js | 1 - .../data/features/css-selection.js | 1 - .../caniuse-lite/data/features/css-shapes.js | 1 - .../data/features/css-snappoints.js | 1 - .../caniuse-lite/data/features/css-sticky.js | 1 - .../caniuse-lite/data/features/css-subgrid.js | 1 - .../data/features/css-supports-api.js | 1 - .../caniuse-lite/data/features/css-table.js | 1 - .../data/features/css-text-align-last.js | 1 - .../data/features/css-text-box-trim.js | 1 - .../data/features/css-text-indent.js | 1 - .../data/features/css-text-justify.js | 1 - .../data/features/css-text-orientation.js | 1 - .../data/features/css-text-spacing.js | 1 - .../data/features/css-text-wrap-balance.js | 1 - .../data/features/css-textshadow.js | 1 - .../data/features/css-touch-action.js | 1 - .../data/features/css-transitions.js | 1 - .../data/features/css-unicode-bidi.js | 1 - .../data/features/css-unset-value.js | 1 - .../data/features/css-variables.js | 1 - .../data/features/css-when-else.js | 1 - .../data/features/css-widows-orphans.js | 1 - .../data/features/css-width-stretch.js | 1 - .../data/features/css-writing-mode.js | 1 - .../caniuse-lite/data/features/css-zoom.js | 1 - .../caniuse-lite/data/features/css3-attr.js | 1 - .../data/features/css3-boxsizing.js | 1 - .../caniuse-lite/data/features/css3-colors.js | 1 - .../data/features/css3-cursors-grab.js | 1 - .../data/features/css3-cursors-newer.js | 1 - .../data/features/css3-cursors.js | 1 - .../data/features/css3-tabsize.js | 1 - .../data/features/currentcolor.js | 1 - .../data/features/custom-elements.js | 1 - .../data/features/custom-elementsv1.js | 1 - .../caniuse-lite/data/features/customevent.js | 1 - .../caniuse-lite/data/features/datalist.js | 1 - .../caniuse-lite/data/features/dataset.js | 1 - .../caniuse-lite/data/features/datauri.js | 1 - .../data/features/date-tolocaledatestring.js | 1 - .../data/features/declarative-shadow-dom.js | 1 - .../caniuse-lite/data/features/decorators.js | 1 - .../caniuse-lite/data/features/details.js | 1 - .../data/features/deviceorientation.js | 1 - .../data/features/devicepixelratio.js | 1 - .../caniuse-lite/data/features/dialog.js | 1 - .../data/features/dispatchevent.js | 1 - .../caniuse-lite/data/features/dnssec.js | 1 - .../data/features/do-not-track.js | 1 - .../data/features/document-currentscript.js | 1 - .../data/features/document-evaluate-xpath.js | 1 - .../data/features/document-execcommand.js | 1 - .../data/features/document-policy.js | 1 - .../features/document-scrollingelement.js | 1 - .../data/features/documenthead.js | 1 - .../data/features/dom-manip-convenience.js | 1 - .../caniuse-lite/data/features/dom-range.js | 1 - .../data/features/domcontentloaded.js | 1 - .../caniuse-lite/data/features/dommatrix.js | 1 - .../caniuse-lite/data/features/download.js | 1 - .../caniuse-lite/data/features/dragndrop.js | 1 - .../data/features/element-closest.js | 1 - .../data/features/element-from-point.js | 1 - .../data/features/element-scroll-methods.js | 1 - .../caniuse-lite/data/features/eme.js | 1 - .../caniuse-lite/data/features/eot.js | 1 - .../caniuse-lite/data/features/es5.js | 1 - .../caniuse-lite/data/features/es6-class.js | 1 - .../data/features/es6-generators.js | 1 - .../features/es6-module-dynamic-import.js | 1 - .../caniuse-lite/data/features/es6-module.js | 1 - .../caniuse-lite/data/features/es6-number.js | 1 - .../data/features/es6-string-includes.js | 1 - .../caniuse-lite/data/features/es6.js | 1 - .../caniuse-lite/data/features/eventsource.js | 1 - .../data/features/extended-system-fonts.js | 1 - .../data/features/feature-policy.js | 1 - .../caniuse-lite/data/features/fetch.js | 1 - .../data/features/fieldset-disabled.js | 1 - .../caniuse-lite/data/features/fileapi.js | 1 - .../caniuse-lite/data/features/filereader.js | 1 - .../data/features/filereadersync.js | 1 - .../caniuse-lite/data/features/filesystem.js | 1 - .../caniuse-lite/data/features/flac.js | 1 - .../caniuse-lite/data/features/flexbox-gap.js | 1 - .../caniuse-lite/data/features/flexbox.js | 1 - .../caniuse-lite/data/features/flow-root.js | 1 - .../data/features/focusin-focusout-events.js | 1 - .../data/features/font-family-system-ui.js | 1 - .../data/features/font-feature.js | 1 - .../data/features/font-kerning.js | 1 - .../data/features/font-loading.js | 1 - .../data/features/font-size-adjust.js | 1 - .../caniuse-lite/data/features/font-smooth.js | 1 - .../data/features/font-unicode-range.js | 1 - .../data/features/font-variant-alternates.js | 1 - .../data/features/font-variant-numeric.js | 1 - .../caniuse-lite/data/features/fontface.js | 1 - .../data/features/form-attribute.js | 1 - .../data/features/form-submit-attributes.js | 1 - .../data/features/form-validation.js | 1 - .../caniuse-lite/data/features/forms.js | 1 - .../caniuse-lite/data/features/fullscreen.js | 1 - .../caniuse-lite/data/features/gamepad.js | 1 - .../caniuse-lite/data/features/geolocation.js | 1 - .../data/features/getboundingclientrect.js | 1 - .../data/features/getcomputedstyle.js | 1 - .../data/features/getelementsbyclassname.js | 1 - .../data/features/getrandomvalues.js | 1 - .../caniuse-lite/data/features/gyroscope.js | 1 - .../data/features/hardwareconcurrency.js | 1 - .../caniuse-lite/data/features/hashchange.js | 1 - .../caniuse-lite/data/features/heif.js | 1 - .../caniuse-lite/data/features/hevc.js | 1 - .../caniuse-lite/data/features/hidden.js | 1 - .../data/features/high-resolution-time.js | 1 - .../caniuse-lite/data/features/history.js | 1 - .../data/features/html-media-capture.js | 1 - .../data/features/html5semantic.js | 1 - .../data/features/http-live-streaming.js | 1 - .../caniuse-lite/data/features/http2.js | 1 - .../caniuse-lite/data/features/http3.js | 1 - .../data/features/iframe-sandbox.js | 1 - .../data/features/iframe-seamless.js | 1 - .../data/features/iframe-srcdoc.js | 1 - .../data/features/imagecapture.js | 1 - .../caniuse-lite/data/features/ime.js | 1 - .../img-naturalwidth-naturalheight.js | 1 - .../caniuse-lite/data/features/import-maps.js | 1 - .../caniuse-lite/data/features/imports.js | 1 - .../data/features/indeterminate-checkbox.js | 1 - .../caniuse-lite/data/features/indexeddb.js | 1 - .../caniuse-lite/data/features/indexeddb2.js | 1 - .../data/features/inline-block.js | 1 - .../caniuse-lite/data/features/innertext.js | 1 - .../data/features/input-autocomplete-onoff.js | 1 - .../caniuse-lite/data/features/input-color.js | 1 - .../data/features/input-datetime.js | 1 - .../data/features/input-email-tel-url.js | 1 - .../caniuse-lite/data/features/input-event.js | 1 - .../data/features/input-file-accept.js | 1 - .../data/features/input-file-directory.js | 1 - .../data/features/input-file-multiple.js | 1 - .../data/features/input-inputmode.js | 1 - .../data/features/input-minlength.js | 1 - .../data/features/input-number.js | 1 - .../data/features/input-pattern.js | 1 - .../data/features/input-placeholder.js | 1 - .../caniuse-lite/data/features/input-range.js | 1 - .../data/features/input-search.js | 1 - .../data/features/input-selection.js | 1 - .../data/features/insert-adjacent.js | 1 - .../data/features/insertadjacenthtml.js | 1 - .../data/features/internationalization.js | 1 - .../data/features/intersectionobserver-v2.js | 1 - .../data/features/intersectionobserver.js | 1 - .../data/features/intl-pluralrules.js | 1 - .../data/features/intrinsic-width.js | 1 - .../caniuse-lite/data/features/jpeg2000.js | 1 - .../caniuse-lite/data/features/jpegxl.js | 1 - .../caniuse-lite/data/features/jpegxr.js | 1 - .../data/features/js-regexp-lookbehind.js | 1 - .../caniuse-lite/data/features/json.js | 1 - .../features/justify-content-space-evenly.js | 1 - .../data/features/kerning-pairs-ligatures.js | 1 - .../data/features/keyboardevent-charcode.js | 1 - .../data/features/keyboardevent-code.js | 1 - .../keyboardevent-getmodifierstate.js | 1 - .../data/features/keyboardevent-key.js | 1 - .../data/features/keyboardevent-location.js | 1 - .../data/features/keyboardevent-which.js | 1 - .../caniuse-lite/data/features/lazyload.js | 1 - .../caniuse-lite/data/features/let.js | 1 - .../data/features/link-icon-png.js | 1 - .../data/features/link-icon-svg.js | 1 - .../data/features/link-rel-dns-prefetch.js | 1 - .../data/features/link-rel-modulepreload.js | 1 - .../data/features/link-rel-preconnect.js | 1 - .../data/features/link-rel-prefetch.js | 1 - .../data/features/link-rel-preload.js | 1 - .../data/features/link-rel-prerender.js | 1 - .../data/features/loading-lazy-attr.js | 1 - .../data/features/localecompare.js | 1 - .../data/features/magnetometer.js | 1 - .../data/features/matchesselector.js | 1 - .../caniuse-lite/data/features/matchmedia.js | 1 - .../caniuse-lite/data/features/mathml.js | 1 - .../caniuse-lite/data/features/maxlength.js | 1 - .../mdn-css-backdrop-pseudo-element.js | 1 - .../mdn-css-unicode-bidi-isolate-override.js | 1 - .../features/mdn-css-unicode-bidi-isolate.js | 1 - .../mdn-css-unicode-bidi-plaintext.js | 1 - .../features/mdn-text-decoration-color.js | 1 - .../data/features/mdn-text-decoration-line.js | 1 - .../features/mdn-text-decoration-shorthand.js | 1 - .../features/mdn-text-decoration-style.js | 1 - .../data/features/media-fragments.js | 1 - .../data/features/mediacapture-fromelement.js | 1 - .../data/features/mediarecorder.js | 1 - .../caniuse-lite/data/features/mediasource.js | 1 - .../caniuse-lite/data/features/menu.js | 1 - .../data/features/meta-theme-color.js | 1 - .../caniuse-lite/data/features/meter.js | 1 - .../caniuse-lite/data/features/midi.js | 1 - .../caniuse-lite/data/features/minmaxwh.js | 1 - .../caniuse-lite/data/features/mp3.js | 1 - .../caniuse-lite/data/features/mpeg-dash.js | 1 - .../caniuse-lite/data/features/mpeg4.js | 1 - .../data/features/multibackgrounds.js | 1 - .../caniuse-lite/data/features/multicolumn.js | 1 - .../data/features/mutation-events.js | 1 - .../data/features/mutationobserver.js | 1 - .../data/features/namevalue-storage.js | 1 - .../data/features/native-filesystem-api.js | 1 - .../caniuse-lite/data/features/nav-timing.js | 1 - .../caniuse-lite/data/features/netinfo.js | 1 - .../data/features/notifications.js | 1 - .../data/features/object-entries.js | 1 - .../caniuse-lite/data/features/object-fit.js | 1 - .../data/features/object-observe.js | 1 - .../data/features/object-values.js | 1 - .../caniuse-lite/data/features/objectrtc.js | 1 - .../data/features/offline-apps.js | 1 - .../data/features/offscreencanvas.js | 1 - .../caniuse-lite/data/features/ogg-vorbis.js | 1 - .../caniuse-lite/data/features/ogv.js | 1 - .../caniuse-lite/data/features/ol-reversed.js | 1 - .../data/features/once-event-listener.js | 1 - .../data/features/online-status.js | 1 - .../caniuse-lite/data/features/opus.js | 1 - .../data/features/orientation-sensor.js | 1 - .../caniuse-lite/data/features/outline.js | 1 - .../data/features/pad-start-end.js | 1 - .../data/features/page-transition-events.js | 1 - .../data/features/pagevisibility.js | 1 - .../data/features/passive-event-listener.js | 1 - .../caniuse-lite/data/features/passkeys.js | 1 - .../data/features/passwordrules.js | 1 - .../caniuse-lite/data/features/path2d.js | 1 - .../data/features/payment-request.js | 1 - .../caniuse-lite/data/features/pdf-viewer.js | 1 - .../data/features/permissions-api.js | 1 - .../data/features/permissions-policy.js | 1 - .../data/features/picture-in-picture.js | 1 - .../caniuse-lite/data/features/picture.js | 1 - .../caniuse-lite/data/features/ping.js | 1 - .../caniuse-lite/data/features/png-alpha.js | 1 - .../data/features/pointer-events.js | 1 - .../caniuse-lite/data/features/pointer.js | 1 - .../caniuse-lite/data/features/pointerlock.js | 1 - .../caniuse-lite/data/features/portals.js | 1 - .../data/features/prefers-color-scheme.js | 1 - .../data/features/prefers-reduced-motion.js | 1 - .../caniuse-lite/data/features/progress.js | 1 - .../data/features/promise-finally.js | 1 - .../caniuse-lite/data/features/promises.js | 1 - .../caniuse-lite/data/features/proximity.js | 1 - .../caniuse-lite/data/features/proxy.js | 1 - .../data/features/publickeypinning.js | 1 - .../caniuse-lite/data/features/push-api.js | 1 - .../data/features/queryselector.js | 1 - .../data/features/readonly-attr.js | 1 - .../data/features/referrer-policy.js | 1 - .../data/features/registerprotocolhandler.js | 1 - .../data/features/rel-noopener.js | 1 - .../data/features/rel-noreferrer.js | 1 - .../caniuse-lite/data/features/rellist.js | 1 - .../caniuse-lite/data/features/rem.js | 1 - .../data/features/requestanimationframe.js | 1 - .../data/features/requestidlecallback.js | 1 - .../data/features/resizeobserver.js | 1 - .../data/features/resource-timing.js | 1 - .../data/features/rest-parameters.js | 1 - .../data/features/rtcpeerconnection.js | 1 - .../caniuse-lite/data/features/ruby.js | 1 - .../caniuse-lite/data/features/run-in.js | 1 - .../features/same-site-cookie-attribute.js | 1 - .../data/features/screen-orientation.js | 1 - .../data/features/script-async.js | 1 - .../data/features/script-defer.js | 1 - .../data/features/scrollintoview.js | 1 - .../data/features/scrollintoviewifneeded.js | 1 - .../caniuse-lite/data/features/sdch.js | 1 - .../data/features/selection-api.js | 1 - .../caniuse-lite/data/features/selectlist.js | 1 - .../data/features/server-timing.js | 1 - .../data/features/serviceworkers.js | 1 - .../data/features/setimmediate.js | 1 - .../caniuse-lite/data/features/shadowdom.js | 1 - .../caniuse-lite/data/features/shadowdomv1.js | 1 - .../data/features/sharedarraybuffer.js | 1 - .../data/features/sharedworkers.js | 1 - .../caniuse-lite/data/features/sni.js | 1 - .../caniuse-lite/data/features/spdy.js | 1 - .../data/features/speech-recognition.js | 1 - .../data/features/speech-synthesis.js | 1 - .../data/features/spellcheck-attribute.js | 1 - .../caniuse-lite/data/features/sql-storage.js | 1 - .../caniuse-lite/data/features/srcset.js | 1 - .../caniuse-lite/data/features/stream.js | 1 - .../caniuse-lite/data/features/streams.js | 1 - .../data/features/stricttransportsecurity.js | 1 - .../data/features/style-scoped.js | 1 - .../data/features/subresource-bundling.js | 1 - .../data/features/subresource-integrity.js | 1 - .../caniuse-lite/data/features/svg-css.js | 1 - .../caniuse-lite/data/features/svg-filters.js | 1 - .../caniuse-lite/data/features/svg-fonts.js | 1 - .../data/features/svg-fragment.js | 1 - .../caniuse-lite/data/features/svg-html.js | 1 - .../caniuse-lite/data/features/svg-html5.js | 1 - .../caniuse-lite/data/features/svg-img.js | 1 - .../caniuse-lite/data/features/svg-smil.js | 1 - .../caniuse-lite/data/features/svg.js | 1 - .../caniuse-lite/data/features/sxg.js | 1 - .../data/features/tabindex-attr.js | 1 - .../data/features/template-literals.js | 1 - .../caniuse-lite/data/features/template.js | 1 - .../caniuse-lite/data/features/temporal.js | 1 - .../caniuse-lite/data/features/testfeat.js | 1 - .../data/features/text-decoration.js | 1 - .../data/features/text-emphasis.js | 1 - .../data/features/text-overflow.js | 1 - .../data/features/text-size-adjust.js | 1 - .../caniuse-lite/data/features/text-stroke.js | 1 - .../caniuse-lite/data/features/textcontent.js | 1 - .../caniuse-lite/data/features/textencoder.js | 1 - .../caniuse-lite/data/features/tls1-1.js | 1 - .../caniuse-lite/data/features/tls1-2.js | 1 - .../caniuse-lite/data/features/tls1-3.js | 1 - .../caniuse-lite/data/features/touch.js | 1 - .../data/features/transforms2d.js | 1 - .../data/features/transforms3d.js | 1 - .../data/features/trusted-types.js | 1 - .../caniuse-lite/data/features/ttf.js | 1 - .../caniuse-lite/data/features/typedarrays.js | 1 - .../caniuse-lite/data/features/u2f.js | 1 - .../data/features/unhandledrejection.js | 1 - .../data/features/upgradeinsecurerequests.js | 1 - .../features/url-scroll-to-text-fragment.js | 1 - .../caniuse-lite/data/features/url.js | 1 - .../data/features/urlsearchparams.js | 1 - .../caniuse-lite/data/features/use-strict.js | 1 - .../data/features/user-select-none.js | 1 - .../caniuse-lite/data/features/user-timing.js | 1 - .../data/features/variable-fonts.js | 1 - .../data/features/vector-effect.js | 1 - .../caniuse-lite/data/features/vibration.js | 1 - .../caniuse-lite/data/features/video.js | 1 - .../caniuse-lite/data/features/videotracks.js | 1 - .../data/features/view-transitions.js | 1 - .../data/features/viewport-unit-variants.js | 1 - .../data/features/viewport-units.js | 1 - .../caniuse-lite/data/features/wai-aria.js | 1 - .../caniuse-lite/data/features/wake-lock.js | 1 - .../caniuse-lite/data/features/wasm.js | 1 - .../caniuse-lite/data/features/wav.js | 1 - .../caniuse-lite/data/features/wbr-element.js | 1 - .../data/features/web-animation.js | 1 - .../data/features/web-app-manifest.js | 1 - .../data/features/web-bluetooth.js | 1 - .../caniuse-lite/data/features/web-serial.js | 1 - .../caniuse-lite/data/features/web-share.js | 1 - .../caniuse-lite/data/features/webauthn.js | 1 - .../caniuse-lite/data/features/webcodecs.js | 1 - .../caniuse-lite/data/features/webgl.js | 1 - .../caniuse-lite/data/features/webgl2.js | 1 - .../caniuse-lite/data/features/webgpu.js | 1 - .../caniuse-lite/data/features/webhid.js | 1 - .../data/features/webkit-user-drag.js | 1 - .../caniuse-lite/data/features/webm.js | 1 - .../caniuse-lite/data/features/webnfc.js | 1 - .../caniuse-lite/data/features/webp.js | 1 - .../caniuse-lite/data/features/websockets.js | 1 - .../data/features/webtransport.js | 1 - .../caniuse-lite/data/features/webusb.js | 1 - .../caniuse-lite/data/features/webvr.js | 1 - .../caniuse-lite/data/features/webvtt.js | 1 - .../caniuse-lite/data/features/webworkers.js | 1 - .../caniuse-lite/data/features/webxr.js | 1 - .../caniuse-lite/data/features/will-change.js | 1 - .../caniuse-lite/data/features/woff.js | 1 - .../caniuse-lite/data/features/woff2.js | 1 - .../caniuse-lite/data/features/word-break.js | 1 - .../caniuse-lite/data/features/wordwrap.js | 1 - .../data/features/x-doc-messaging.js | 1 - .../data/features/x-frame-options.js | 1 - .../caniuse-lite/data/features/xhr2.js | 1 - .../caniuse-lite/data/features/xhtml.js | 1 - .../caniuse-lite/data/features/xhtmlsmil.js | 1 - .../data/features/xml-serializer.js | 1 - .../caniuse-lite/data/features/zstd.js | 1 - node_modules/caniuse-lite/data/regions/AD.js | 1 - node_modules/caniuse-lite/data/regions/AE.js | 1 - node_modules/caniuse-lite/data/regions/AF.js | 1 - node_modules/caniuse-lite/data/regions/AG.js | 1 - node_modules/caniuse-lite/data/regions/AI.js | 1 - node_modules/caniuse-lite/data/regions/AL.js | 1 - node_modules/caniuse-lite/data/regions/AM.js | 1 - node_modules/caniuse-lite/data/regions/AO.js | 1 - node_modules/caniuse-lite/data/regions/AR.js | 1 - node_modules/caniuse-lite/data/regions/AS.js | 1 - node_modules/caniuse-lite/data/regions/AT.js | 1 - node_modules/caniuse-lite/data/regions/AU.js | 1 - node_modules/caniuse-lite/data/regions/AW.js | 1 - node_modules/caniuse-lite/data/regions/AX.js | 1 - node_modules/caniuse-lite/data/regions/AZ.js | 1 - node_modules/caniuse-lite/data/regions/BA.js | 1 - node_modules/caniuse-lite/data/regions/BB.js | 1 - node_modules/caniuse-lite/data/regions/BD.js | 1 - node_modules/caniuse-lite/data/regions/BE.js | 1 - node_modules/caniuse-lite/data/regions/BF.js | 1 - node_modules/caniuse-lite/data/regions/BG.js | 1 - node_modules/caniuse-lite/data/regions/BH.js | 1 - node_modules/caniuse-lite/data/regions/BI.js | 1 - node_modules/caniuse-lite/data/regions/BJ.js | 1 - node_modules/caniuse-lite/data/regions/BM.js | 1 - node_modules/caniuse-lite/data/regions/BN.js | 1 - node_modules/caniuse-lite/data/regions/BO.js | 1 - node_modules/caniuse-lite/data/regions/BR.js | 1 - node_modules/caniuse-lite/data/regions/BS.js | 1 - node_modules/caniuse-lite/data/regions/BT.js | 1 - node_modules/caniuse-lite/data/regions/BW.js | 1 - node_modules/caniuse-lite/data/regions/BY.js | 1 - node_modules/caniuse-lite/data/regions/BZ.js | 1 - node_modules/caniuse-lite/data/regions/CA.js | 1 - node_modules/caniuse-lite/data/regions/CD.js | 1 - node_modules/caniuse-lite/data/regions/CF.js | 1 - node_modules/caniuse-lite/data/regions/CG.js | 1 - node_modules/caniuse-lite/data/regions/CH.js | 1 - node_modules/caniuse-lite/data/regions/CI.js | 1 - node_modules/caniuse-lite/data/regions/CK.js | 1 - node_modules/caniuse-lite/data/regions/CL.js | 1 - node_modules/caniuse-lite/data/regions/CM.js | 1 - node_modules/caniuse-lite/data/regions/CN.js | 1 - node_modules/caniuse-lite/data/regions/CO.js | 1 - node_modules/caniuse-lite/data/regions/CR.js | 1 - node_modules/caniuse-lite/data/regions/CU.js | 1 - node_modules/caniuse-lite/data/regions/CV.js | 1 - node_modules/caniuse-lite/data/regions/CX.js | 1 - node_modules/caniuse-lite/data/regions/CY.js | 1 - node_modules/caniuse-lite/data/regions/CZ.js | 1 - node_modules/caniuse-lite/data/regions/DE.js | 1 - node_modules/caniuse-lite/data/regions/DJ.js | 1 - node_modules/caniuse-lite/data/regions/DK.js | 1 - node_modules/caniuse-lite/data/regions/DM.js | 1 - node_modules/caniuse-lite/data/regions/DO.js | 1 - node_modules/caniuse-lite/data/regions/DZ.js | 1 - node_modules/caniuse-lite/data/regions/EC.js | 1 - node_modules/caniuse-lite/data/regions/EE.js | 1 - node_modules/caniuse-lite/data/regions/EG.js | 1 - node_modules/caniuse-lite/data/regions/ER.js | 1 - node_modules/caniuse-lite/data/regions/ES.js | 1 - node_modules/caniuse-lite/data/regions/ET.js | 1 - node_modules/caniuse-lite/data/regions/FI.js | 1 - node_modules/caniuse-lite/data/regions/FJ.js | 1 - node_modules/caniuse-lite/data/regions/FK.js | 1 - node_modules/caniuse-lite/data/regions/FM.js | 1 - node_modules/caniuse-lite/data/regions/FO.js | 1 - node_modules/caniuse-lite/data/regions/FR.js | 1 - node_modules/caniuse-lite/data/regions/GA.js | 1 - node_modules/caniuse-lite/data/regions/GB.js | 1 - node_modules/caniuse-lite/data/regions/GD.js | 1 - node_modules/caniuse-lite/data/regions/GE.js | 1 - node_modules/caniuse-lite/data/regions/GF.js | 1 - node_modules/caniuse-lite/data/regions/GG.js | 1 - node_modules/caniuse-lite/data/regions/GH.js | 1 - node_modules/caniuse-lite/data/regions/GI.js | 1 - node_modules/caniuse-lite/data/regions/GL.js | 1 - node_modules/caniuse-lite/data/regions/GM.js | 1 - node_modules/caniuse-lite/data/regions/GN.js | 1 - node_modules/caniuse-lite/data/regions/GP.js | 1 - node_modules/caniuse-lite/data/regions/GQ.js | 1 - node_modules/caniuse-lite/data/regions/GR.js | 1 - node_modules/caniuse-lite/data/regions/GT.js | 1 - node_modules/caniuse-lite/data/regions/GU.js | 1 - node_modules/caniuse-lite/data/regions/GW.js | 1 - node_modules/caniuse-lite/data/regions/GY.js | 1 - node_modules/caniuse-lite/data/regions/HK.js | 1 - node_modules/caniuse-lite/data/regions/HN.js | 1 - node_modules/caniuse-lite/data/regions/HR.js | 1 - node_modules/caniuse-lite/data/regions/HT.js | 1 - node_modules/caniuse-lite/data/regions/HU.js | 1 - node_modules/caniuse-lite/data/regions/ID.js | 1 - node_modules/caniuse-lite/data/regions/IE.js | 1 - node_modules/caniuse-lite/data/regions/IL.js | 1 - node_modules/caniuse-lite/data/regions/IM.js | 1 - node_modules/caniuse-lite/data/regions/IN.js | 1 - node_modules/caniuse-lite/data/regions/IQ.js | 1 - node_modules/caniuse-lite/data/regions/IR.js | 1 - node_modules/caniuse-lite/data/regions/IS.js | 1 - node_modules/caniuse-lite/data/regions/IT.js | 1 - node_modules/caniuse-lite/data/regions/JE.js | 1 - node_modules/caniuse-lite/data/regions/JM.js | 1 - node_modules/caniuse-lite/data/regions/JO.js | 1 - node_modules/caniuse-lite/data/regions/JP.js | 1 - node_modules/caniuse-lite/data/regions/KE.js | 1 - node_modules/caniuse-lite/data/regions/KG.js | 1 - node_modules/caniuse-lite/data/regions/KH.js | 1 - node_modules/caniuse-lite/data/regions/KI.js | 1 - node_modules/caniuse-lite/data/regions/KM.js | 1 - node_modules/caniuse-lite/data/regions/KN.js | 1 - node_modules/caniuse-lite/data/regions/KP.js | 1 - node_modules/caniuse-lite/data/regions/KR.js | 1 - node_modules/caniuse-lite/data/regions/KW.js | 1 - node_modules/caniuse-lite/data/regions/KY.js | 1 - node_modules/caniuse-lite/data/regions/KZ.js | 1 - node_modules/caniuse-lite/data/regions/LA.js | 1 - node_modules/caniuse-lite/data/regions/LB.js | 1 - node_modules/caniuse-lite/data/regions/LC.js | 1 - node_modules/caniuse-lite/data/regions/LI.js | 1 - node_modules/caniuse-lite/data/regions/LK.js | 1 - node_modules/caniuse-lite/data/regions/LR.js | 1 - node_modules/caniuse-lite/data/regions/LS.js | 1 - node_modules/caniuse-lite/data/regions/LT.js | 1 - node_modules/caniuse-lite/data/regions/LU.js | 1 - node_modules/caniuse-lite/data/regions/LV.js | 1 - node_modules/caniuse-lite/data/regions/LY.js | 1 - node_modules/caniuse-lite/data/regions/MA.js | 1 - node_modules/caniuse-lite/data/regions/MC.js | 1 - node_modules/caniuse-lite/data/regions/MD.js | 1 - node_modules/caniuse-lite/data/regions/ME.js | 1 - node_modules/caniuse-lite/data/regions/MG.js | 1 - node_modules/caniuse-lite/data/regions/MH.js | 1 - node_modules/caniuse-lite/data/regions/MK.js | 1 - node_modules/caniuse-lite/data/regions/ML.js | 1 - node_modules/caniuse-lite/data/regions/MM.js | 1 - node_modules/caniuse-lite/data/regions/MN.js | 1 - node_modules/caniuse-lite/data/regions/MO.js | 1 - node_modules/caniuse-lite/data/regions/MP.js | 1 - node_modules/caniuse-lite/data/regions/MQ.js | 1 - node_modules/caniuse-lite/data/regions/MR.js | 1 - node_modules/caniuse-lite/data/regions/MS.js | 1 - node_modules/caniuse-lite/data/regions/MT.js | 1 - node_modules/caniuse-lite/data/regions/MU.js | 1 - node_modules/caniuse-lite/data/regions/MV.js | 1 - node_modules/caniuse-lite/data/regions/MW.js | 1 - node_modules/caniuse-lite/data/regions/MX.js | 1 - node_modules/caniuse-lite/data/regions/MY.js | 1 - node_modules/caniuse-lite/data/regions/MZ.js | 1 - node_modules/caniuse-lite/data/regions/NA.js | 1 - node_modules/caniuse-lite/data/regions/NC.js | 1 - node_modules/caniuse-lite/data/regions/NE.js | 1 - node_modules/caniuse-lite/data/regions/NF.js | 1 - node_modules/caniuse-lite/data/regions/NG.js | 1 - node_modules/caniuse-lite/data/regions/NI.js | 1 - node_modules/caniuse-lite/data/regions/NL.js | 1 - node_modules/caniuse-lite/data/regions/NO.js | 1 - node_modules/caniuse-lite/data/regions/NP.js | 1 - node_modules/caniuse-lite/data/regions/NR.js | 1 - node_modules/caniuse-lite/data/regions/NU.js | 1 - node_modules/caniuse-lite/data/regions/NZ.js | 1 - node_modules/caniuse-lite/data/regions/OM.js | 1 - node_modules/caniuse-lite/data/regions/PA.js | 1 - node_modules/caniuse-lite/data/regions/PE.js | 1 - node_modules/caniuse-lite/data/regions/PF.js | 1 - node_modules/caniuse-lite/data/regions/PG.js | 1 - node_modules/caniuse-lite/data/regions/PH.js | 1 - node_modules/caniuse-lite/data/regions/PK.js | 1 - node_modules/caniuse-lite/data/regions/PL.js | 1 - node_modules/caniuse-lite/data/regions/PM.js | 1 - node_modules/caniuse-lite/data/regions/PN.js | 1 - node_modules/caniuse-lite/data/regions/PR.js | 1 - node_modules/caniuse-lite/data/regions/PS.js | 1 - node_modules/caniuse-lite/data/regions/PT.js | 1 - node_modules/caniuse-lite/data/regions/PW.js | 1 - node_modules/caniuse-lite/data/regions/PY.js | 1 - node_modules/caniuse-lite/data/regions/QA.js | 1 - node_modules/caniuse-lite/data/regions/RE.js | 1 - node_modules/caniuse-lite/data/regions/RO.js | 1 - node_modules/caniuse-lite/data/regions/RS.js | 1 - node_modules/caniuse-lite/data/regions/RU.js | 1 - node_modules/caniuse-lite/data/regions/RW.js | 1 - node_modules/caniuse-lite/data/regions/SA.js | 1 - node_modules/caniuse-lite/data/regions/SB.js | 1 - node_modules/caniuse-lite/data/regions/SC.js | 1 - node_modules/caniuse-lite/data/regions/SD.js | 1 - node_modules/caniuse-lite/data/regions/SE.js | 1 - node_modules/caniuse-lite/data/regions/SG.js | 1 - node_modules/caniuse-lite/data/regions/SH.js | 1 - node_modules/caniuse-lite/data/regions/SI.js | 1 - node_modules/caniuse-lite/data/regions/SK.js | 1 - node_modules/caniuse-lite/data/regions/SL.js | 1 - node_modules/caniuse-lite/data/regions/SM.js | 1 - node_modules/caniuse-lite/data/regions/SN.js | 1 - node_modules/caniuse-lite/data/regions/SO.js | 1 - node_modules/caniuse-lite/data/regions/SR.js | 1 - node_modules/caniuse-lite/data/regions/ST.js | 1 - node_modules/caniuse-lite/data/regions/SV.js | 1 - node_modules/caniuse-lite/data/regions/SY.js | 1 - node_modules/caniuse-lite/data/regions/SZ.js | 1 - node_modules/caniuse-lite/data/regions/TC.js | 1 - node_modules/caniuse-lite/data/regions/TD.js | 1 - node_modules/caniuse-lite/data/regions/TG.js | 1 - node_modules/caniuse-lite/data/regions/TH.js | 1 - node_modules/caniuse-lite/data/regions/TJ.js | 1 - node_modules/caniuse-lite/data/regions/TK.js | 1 - node_modules/caniuse-lite/data/regions/TL.js | 1 - node_modules/caniuse-lite/data/regions/TM.js | 1 - node_modules/caniuse-lite/data/regions/TN.js | 1 - node_modules/caniuse-lite/data/regions/TO.js | 1 - node_modules/caniuse-lite/data/regions/TR.js | 1 - node_modules/caniuse-lite/data/regions/TT.js | 1 - node_modules/caniuse-lite/data/regions/TV.js | 1 - node_modules/caniuse-lite/data/regions/TW.js | 1 - node_modules/caniuse-lite/data/regions/TZ.js | 1 - node_modules/caniuse-lite/data/regions/UA.js | 1 - node_modules/caniuse-lite/data/regions/UG.js | 1 - node_modules/caniuse-lite/data/regions/US.js | 1 - node_modules/caniuse-lite/data/regions/UY.js | 1 - node_modules/caniuse-lite/data/regions/UZ.js | 1 - node_modules/caniuse-lite/data/regions/VA.js | 1 - node_modules/caniuse-lite/data/regions/VC.js | 1 - node_modules/caniuse-lite/data/regions/VE.js | 1 - node_modules/caniuse-lite/data/regions/VG.js | 1 - node_modules/caniuse-lite/data/regions/VI.js | 1 - node_modules/caniuse-lite/data/regions/VN.js | 1 - node_modules/caniuse-lite/data/regions/VU.js | 1 - node_modules/caniuse-lite/data/regions/WF.js | 1 - node_modules/caniuse-lite/data/regions/WS.js | 1 - node_modules/caniuse-lite/data/regions/YE.js | 1 - node_modules/caniuse-lite/data/regions/YT.js | 1 - node_modules/caniuse-lite/data/regions/ZA.js | 1 - node_modules/caniuse-lite/data/regions/ZM.js | 1 - node_modules/caniuse-lite/data/regions/ZW.js | 1 - .../caniuse-lite/data/regions/alt-af.js | 1 - .../caniuse-lite/data/regions/alt-an.js | 1 - .../caniuse-lite/data/regions/alt-as.js | 1 - .../caniuse-lite/data/regions/alt-eu.js | 1 - .../caniuse-lite/data/regions/alt-na.js | 1 - .../caniuse-lite/data/regions/alt-oc.js | 1 - .../caniuse-lite/data/regions/alt-sa.js | 1 - .../caniuse-lite/data/regions/alt-ww.js | 1 - .../caniuse-lite/dist/lib/statuses.js | 9 - .../caniuse-lite/dist/lib/supported.js | 9 - .../caniuse-lite/dist/unpacker/agents.js | 47 - .../dist/unpacker/browserVersions.js | 1 - .../caniuse-lite/dist/unpacker/browsers.js | 1 - .../caniuse-lite/dist/unpacker/feature.js | 52 - .../caniuse-lite/dist/unpacker/features.js | 6 - .../caniuse-lite/dist/unpacker/index.js | 4 - .../caniuse-lite/dist/unpacker/region.js | 22 - node_modules/caniuse-lite/package.json | 34 - node_modules/chrome-trace-event/CHANGES.md | 26 - node_modules/chrome-trace-event/LICENSE.txt | 23 - node_modules/chrome-trace-event/README.md | 31 - .../chrome-trace-event/dist/trace-event.d.ts | 52 - .../chrome-trace-event/dist/trace-event.js | 170 - .../dist/trace-event.js.map | 1 - node_modules/chrome-trace-event/package.json | 38 - node_modules/clone-deep/LICENSE | 21 - node_modules/clone-deep/README.md | 106 - node_modules/clone-deep/index.js | 49 - node_modules/clone-deep/package.json | 81 - node_modules/colorette/LICENSE.md | 7 - node_modules/colorette/README.md | 134 - node_modules/colorette/index.cjs | 218 - node_modules/colorette/index.d.ts | 93 - node_modules/colorette/index.js | 150 - node_modules/colorette/package.json | 40 - node_modules/commander/CHANGELOG.md | 419 - node_modules/commander/LICENSE | 22 - node_modules/commander/Readme.md | 428 - node_modules/commander/index.js | 1224 - node_modules/commander/package.json | 38 - node_modules/commander/typings/index.d.ts | 310 - node_modules/const-obj/.jshintrc | 52 - node_modules/const-obj/.npmignore | 41 - node_modules/const-obj/LICENSE | 20 - node_modules/const-obj/README.md | 85 - node_modules/const-obj/index.js | 48 - .../const-obj/node_modules/deep-is/.npmignore | 1 - .../node_modules/deep-is/.travis.yml | 6 - .../node_modules/deep-is/README.markdown | 63 - .../node_modules/deep-is/example/cmp.js | 11 - .../const-obj/node_modules/deep-is/index.js | 102 - .../node_modules/deep-is/package.json | 58 - .../node_modules/deep-is/test/NaN.js | 16 - .../node_modules/deep-is/test/cmp.js | 23 - .../node_modules/deep-is/test/neg-vs-pos-0.js | 15 - .../const-obj/node_modules/is2/.jshintrc | 51 - .../const-obj/node_modules/is2/.npmignore | 41 - .../const-obj/node_modules/is2/LICENSE | 20 - .../const-obj/node_modules/is2/README.md | 135 - .../const-obj/node_modules/is2/index.js | 799 - .../const-obj/node_modules/is2/package.json | 54 - .../const-obj/node_modules/is2/tests.js | 864 - node_modules/const-obj/package.json | 36 - node_modules/const-obj/test.js | 54 - node_modules/create-require/CHANGELOG.md | 33 - node_modules/create-require/LICENSE | 25 - node_modules/create-require/README.md | 46 - .../create-require/create-require.d.ts | 3 - node_modules/create-require/create-require.js | 49 - node_modules/create-require/package.json | 39 - node_modules/cross-spawn/CHANGELOG.md | 130 - node_modules/cross-spawn/LICENSE | 21 - node_modules/cross-spawn/README.md | 96 - node_modules/cross-spawn/index.js | 39 - node_modules/cross-spawn/lib/enoent.js | 59 - node_modules/cross-spawn/lib/parse.js | 91 - node_modules/cross-spawn/lib/util/escape.js | 45 - .../cross-spawn/lib/util/readShebang.js | 23 - .../cross-spawn/lib/util/resolveCommand.js | 52 - node_modules/cross-spawn/package.json | 73 - node_modules/debug/CHANGELOG.md | 395 - node_modules/debug/LICENSE | 19 - node_modules/debug/README.md | 455 - node_modules/debug/dist/debug.js | 912 - node_modules/debug/package.json | 63 - node_modules/debug/src/browser.js | 264 - node_modules/debug/src/common.js | 266 - node_modules/debug/src/index.js | 10 - node_modules/debug/src/node.js | 257 - node_modules/deep-is/.travis.yml | 5 - node_modules/deep-is/LICENSE | 22 - node_modules/deep-is/README.markdown | 70 - node_modules/deep-is/example/cmp.js | 11 - node_modules/deep-is/index.js | 102 - node_modules/deep-is/package.json | 58 - node_modules/deep-is/test/NaN.js | 16 - node_modules/deep-is/test/cmp.js | 23 - node_modules/deep-is/test/neg-vs-pos-0.js | 15 - node_modules/diff/CONTRIBUTING.md | 39 - node_modules/diff/LICENSE | 31 - node_modules/diff/README.md | 207 - node_modules/diff/dist/diff.js | 1585 - node_modules/diff/dist/diff.min.js | 38 - node_modules/diff/lib/convert/dmp.js | 32 - node_modules/diff/lib/convert/xml.js | 42 - node_modules/diff/lib/diff/array.js | 45 - node_modules/diff/lib/diff/base.js | 304 - node_modules/diff/lib/diff/character.js | 37 - node_modules/diff/lib/diff/css.js | 41 - node_modules/diff/lib/diff/json.js | 163 - node_modules/diff/lib/diff/line.js | 89 - node_modules/diff/lib/diff/sentence.js | 41 - node_modules/diff/lib/diff/word.js | 107 - node_modules/diff/lib/index.es6.js | 1519 - node_modules/diff/lib/index.js | 216 - node_modules/diff/lib/patch/apply.js | 243 - node_modules/diff/lib/patch/create.js | 247 - node_modules/diff/lib/patch/merge.js | 609 - node_modules/diff/lib/patch/parse.js | 156 - node_modules/diff/lib/util/array.js | 32 - .../diff/lib/util/distance-iterator.js | 57 - node_modules/diff/lib/util/params.js | 24 - node_modules/diff/package.json | 73 - node_modules/diff/release-notes.md | 261 - node_modules/diff/runtime.js | 3 - .../electron-to-chromium/CHANGELOG.md | 14 - node_modules/electron-to-chromium/LICENSE | 5 - node_modules/electron-to-chromium/README.md | 186 - .../electron-to-chromium/chromium-versions.js | 62 - .../chromium-versions.json | 1 - .../full-chromium-versions.js | 3072 -- .../full-chromium-versions.json | 1 - .../electron-to-chromium/full-versions.js | 2238 -- .../electron-to-chromium/full-versions.json | 1 - node_modules/electron-to-chromium/index.js | 36 - .../electron-to-chromium/package.json | 44 - node_modules/electron-to-chromium/versions.js | 149 - .../electron-to-chromium/versions.json | 1 - node_modules/enhanced-resolve/LICENSE | 20 - node_modules/enhanced-resolve/README.md | 183 - .../enhanced-resolve/lib/AliasFieldPlugin.js | 108 - .../enhanced-resolve/lib/AliasPlugin.js | 154 - .../enhanced-resolve/lib/AppendPlugin.js | 49 - .../lib/CachedInputFileSystem.js | 593 - .../lib/CloneBasenamePlugin.js | 53 - .../enhanced-resolve/lib/ConditionalPlugin.js | 59 - .../lib/DescriptionFilePlugin.js | 98 - .../lib/DescriptionFileUtils.js | 198 - .../lib/DirectoryExistsPlugin.js | 63 - .../lib/ExportsFieldPlugin.js | 166 - .../lib/ExtensionAliasPlugin.js | 101 - .../enhanced-resolve/lib/FileExistsPlugin.js | 58 - .../lib/ImportsFieldPlugin.js | 196 - .../lib/JoinRequestPartPlugin.js | 75 - .../enhanced-resolve/lib/JoinRequestPlugin.js | 45 - .../enhanced-resolve/lib/LogInfoPlugin.js | 54 - .../enhanced-resolve/lib/MainFieldPlugin.js | 90 - .../ModulesInHierachicDirectoriesPlugin.js | 9 - .../ModulesInHierarchicalDirectoriesPlugin.js | 87 - .../lib/ModulesInRootPlugin.js | 49 - .../enhanced-resolve/lib/NextPlugin.js | 33 - .../enhanced-resolve/lib/ParsePlugin.js | 76 - .../enhanced-resolve/lib/PnpPlugin.js | 111 - node_modules/enhanced-resolve/lib/Resolver.js | 601 - .../enhanced-resolve/lib/ResolverFactory.js | 695 - .../lib/RestrictionsPlugin.js | 70 - .../enhanced-resolve/lib/ResultPlugin.js | 42 - .../enhanced-resolve/lib/RootsPlugin.js | 69 - .../lib/SelfReferencePlugin.js | 82 - .../enhanced-resolve/lib/SymlinkPlugin.js | 100 - .../lib/SyncAsyncFileSystemDecorator.js | 104 - .../enhanced-resolve/lib/TryNextPlugin.js | 41 - .../enhanced-resolve/lib/UnsafeCachePlugin.js | 112 - .../enhanced-resolve/lib/UseFilePlugin.js | 55 - .../lib/createInnerContext.js | 46 - .../enhanced-resolve/lib/forEachBail.js | 50 - .../enhanced-resolve/lib/getInnerRequest.js | 36 - node_modules/enhanced-resolve/lib/getPaths.js | 45 - node_modules/enhanced-resolve/lib/index.js | 203 - .../enhanced-resolve/lib/util/entrypoints.js | 604 - .../enhanced-resolve/lib/util/identifier.js | 27 - .../enhanced-resolve/lib/util/path.js | 229 - .../lib/util/process-browser.js | 22 - node_modules/enhanced-resolve/package.json | 72 - node_modules/enhanced-resolve/types.d.ts | 712 - node_modules/envinfo/LICENSE | 21 - node_modules/envinfo/README.md | 286 - node_modules/envinfo/dist/cli.js | 2 - node_modules/envinfo/dist/envinfo.js | 1 - node_modules/envinfo/package.json | 96 - node_modules/es-module-lexer/LICENSE | 10 - node_modules/es-module-lexer/README.md | 323 - .../es-module-lexer/dist/lexer.asm.js | 2 - node_modules/es-module-lexer/dist/lexer.cjs | 1 - node_modules/es-module-lexer/dist/lexer.js | 2 - node_modules/es-module-lexer/lexer.js | 919 - node_modules/es-module-lexer/package.json | 54 - node_modules/es-module-lexer/types/lexer.d.ts | 153 - node_modules/escalade/dist/index.js | 22 - node_modules/escalade/dist/index.mjs | 22 - node_modules/escalade/index.d.ts | 3 - node_modules/escalade/license | 9 - node_modules/escalade/package.json | 63 - node_modules/escalade/readme.md | 211 - node_modules/escalade/sync/index.d.ts | 2 - node_modules/escalade/sync/index.js | 18 - node_modules/escalade/sync/index.mjs | 18 - node_modules/eslint-scope/CHANGELOG.md | 70 - node_modules/eslint-scope/LICENSE | 22 - node_modules/eslint-scope/README.md | 54 - node_modules/eslint-scope/lib/definition.js | 86 - node_modules/eslint-scope/lib/index.js | 165 - .../eslint-scope/lib/pattern-visitor.js | 152 - node_modules/eslint-scope/lib/reference.js | 167 - node_modules/eslint-scope/lib/referencer.js | 629 - .../eslint-scope/lib/scope-manager.js | 247 - node_modules/eslint-scope/lib/scope.js | 748 - node_modules/eslint-scope/lib/variable.js | 88 - node_modules/eslint-scope/package.json | 48 - node_modules/esrecurse/.babelrc | 3 - node_modules/esrecurse/README.md | 171 - node_modules/esrecurse/esrecurse.js | 117 - node_modules/esrecurse/gulpfile.babel.js | 92 - .../node_modules/estraverse/.jshintrc | 16 - .../node_modules/estraverse/LICENSE.BSD | 19 - .../node_modules/estraverse/README.md | 153 - .../node_modules/estraverse/estraverse.js | 805 - .../node_modules/estraverse/gulpfile.js | 70 - .../node_modules/estraverse/package.json | 40 - node_modules/esrecurse/package.json | 52 - node_modules/estraverse/.jshintrc | 16 - node_modules/estraverse/LICENSE.BSD | 19 - node_modules/estraverse/README.md | 153 - node_modules/estraverse/estraverse.js | 782 - node_modules/estraverse/gulpfile.js | 70 - node_modules/estraverse/package.json | 40 - node_modules/events/.airtap.yml | 15 - node_modules/events/.github/FUNDING.yml | 12 - node_modules/events/.travis.yml | 18 - node_modules/events/History.md | 118 - node_modules/events/LICENSE | 22 - node_modules/events/Readme.md | 50 - node_modules/events/events.js | 497 - node_modules/events/package.json | 37 - node_modules/events/security.md | 10 - node_modules/events/tests/add-listeners.js | 111 - .../events/tests/check-listener-leaks.js | 101 - node_modules/events/tests/common.js | 104 - node_modules/events/tests/errors.js | 13 - node_modules/events/tests/events-list.js | 28 - node_modules/events/tests/events-once.js | 234 - node_modules/events/tests/index.js | 64 - node_modules/events/tests/legacy-compat.js | 16 - node_modules/events/tests/listener-count.js | 37 - .../events/tests/listeners-side-effects.js | 56 - node_modules/events/tests/listeners.js | 168 - node_modules/events/tests/max-listeners.js | 47 - node_modules/events/tests/method-names.js | 35 - node_modules/events/tests/modify-in-emit.js | 90 - node_modules/events/tests/num-args.js | 60 - node_modules/events/tests/once.js | 83 - node_modules/events/tests/prepend.js | 31 - .../events/tests/remove-all-listeners.js | 133 - node_modules/events/tests/remove-listeners.js | 212 - .../tests/set-max-listeners-side-effects.js | 31 - .../events/tests/special-event-names.js | 45 - node_modules/events/tests/subclass.js | 66 - node_modules/events/tests/symbols.js | 25 - node_modules/fast-deep-equal/LICENSE | 21 - node_modules/fast-deep-equal/README.md | 96 - node_modules/fast-deep-equal/es6/index.d.ts | 2 - node_modules/fast-deep-equal/es6/index.js | 72 - node_modules/fast-deep-equal/es6/react.d.ts | 2 - node_modules/fast-deep-equal/es6/react.js | 79 - node_modules/fast-deep-equal/index.d.ts | 4 - node_modules/fast-deep-equal/index.js | 46 - node_modules/fast-deep-equal/package.json | 61 - node_modules/fast-deep-equal/react.d.ts | 2 - node_modules/fast-deep-equal/react.js | 53 - .../fast-json-stable-stringify/.eslintrc.yml | 26 - .../.github/FUNDING.yml | 1 - .../fast-json-stable-stringify/.travis.yml | 8 - .../fast-json-stable-stringify/LICENSE | 21 - .../fast-json-stable-stringify/README.md | 131 - .../benchmark/index.js | 31 - .../benchmark/test.json | 137 - .../example/key_cmp.js | 7 - .../example/nested.js | 3 - .../fast-json-stable-stringify/example/str.js | 3 - .../example/value_cmp.js | 7 - .../fast-json-stable-stringify/index.d.ts | 4 - .../fast-json-stable-stringify/index.js | 59 - .../fast-json-stable-stringify/package.json | 52 - .../fast-json-stable-stringify/test/cmp.js | 13 - .../fast-json-stable-stringify/test/nested.js | 44 - .../fast-json-stable-stringify/test/str.js | 46 - .../test/to-json.js | 22 - .../fastest-levenshtein/.eslintrc.json | 30 - node_modules/fastest-levenshtein/.prettierrc | 4 - node_modules/fastest-levenshtein/.travis.yml | 21 - node_modules/fastest-levenshtein/LICENSE.md | 21 - node_modules/fastest-levenshtein/README.md | 57 - node_modules/fastest-levenshtein/bench.js | 96 - node_modules/fastest-levenshtein/esm/mod.d.ts | 4 - .../fastest-levenshtein/esm/mod.d.ts.map | 1 - node_modules/fastest-levenshtein/esm/mod.js | 138 - node_modules/fastest-levenshtein/mod.d.ts | 3 - node_modules/fastest-levenshtein/mod.js | 142 - node_modules/fastest-levenshtein/package.json | 72 - node_modules/fastest-levenshtein/test.js | 55 - node_modules/fastest-levenshtein/test.ts | 67 - node_modules/find-up/index.d.ts | 137 - node_modules/find-up/index.js | 89 - node_modules/find-up/license | 9 - node_modules/find-up/package.json | 53 - node_modules/find-up/readme.md | 156 - node_modules/flat/.travis.yml | 8 - node_modules/flat/LICENSE | 12 - node_modules/flat/README.md | 236 - node_modules/flat/cli.js | 42 - node_modules/flat/index.js | 158 - node_modules/flat/package.json | 37 - node_modules/flat/test/test.js | 643 - node_modules/function-bind/.eslintrc | 21 - .../function-bind/.github/FUNDING.yml | 12 - .../function-bind/.github/SECURITY.md | 3 - node_modules/function-bind/.nycrc | 13 - node_modules/function-bind/CHANGELOG.md | 136 - node_modules/function-bind/LICENSE | 20 - node_modules/function-bind/README.md | 46 - node_modules/function-bind/implementation.js | 84 - node_modules/function-bind/index.js | 5 - node_modules/function-bind/package.json | 87 - node_modules/function-bind/test/.eslintrc | 9 - node_modules/function-bind/test/index.js | 252 - node_modules/glob-to-regexp/.travis.yml | 4 - node_modules/glob-to-regexp/README.md | 75 - node_modules/glob-to-regexp/index.js | 130 - node_modules/glob-to-regexp/package.json | 23 - node_modules/glob-to-regexp/test.js | 235 - node_modules/graceful-fs/LICENSE | 15 - node_modules/graceful-fs/README.md | 143 - node_modules/graceful-fs/clone.js | 23 - node_modules/graceful-fs/graceful-fs.js | 448 - node_modules/graceful-fs/legacy-streams.js | 118 - node_modules/graceful-fs/package.json | 53 - node_modules/graceful-fs/polyfills.js | 355 - node_modules/has-flag/index.d.ts | 39 - node_modules/has-flag/index.js | 8 - node_modules/has-flag/license | 9 - node_modules/has-flag/package.json | 46 - node_modules/has-flag/readme.md | 89 - node_modules/hasown/.eslintrc | 5 - node_modules/hasown/.github/FUNDING.yml | 12 - node_modules/hasown/.nycrc | 13 - node_modules/hasown/CHANGELOG.md | 20 - node_modules/hasown/LICENSE | 21 - node_modules/hasown/README.md | 40 - node_modules/hasown/index.d.ts | 3 - node_modules/hasown/index.d.ts.map | 1 - node_modules/hasown/index.js | 8 - node_modules/hasown/package.json | 91 - node_modules/hasown/tsconfig.json | 49 - node_modules/have/.npmignore | 13 - node_modules/have/.travis.yml | 4 - node_modules/have/Makefile | 36 - node_modules/have/README.md | 183 - node_modules/have/example-funcname.js | 24 - node_modules/have/example.js | 59 - node_modules/have/have-0.4.0.tgz | Bin 8298 -> 0 bytes node_modules/have/have.js | 188 - node_modules/have/package.json | 27 - node_modules/have/test.js | 481 - node_modules/import-local/fixtures/cli.js | 7 - node_modules/import-local/index.js | 24 - node_modules/import-local/license | 9 - node_modules/import-local/package.json | 52 - node_modules/import-local/readme.md | 37 - node_modules/interpret/LICENSE | 21 - node_modules/interpret/README.md | 244 - node_modules/interpret/cjs-stub.js | 1 - node_modules/interpret/index.js | 542 - node_modules/interpret/mjs-stub.js | 1 - node_modules/interpret/package.json | 73 - node_modules/ip-regex/index.d.ts | 70 - node_modules/ip-regex/index.js | 36 - node_modules/ip-regex/license | 9 - node_modules/ip-regex/package.json | 44 - node_modules/ip-regex/readme.md | 86 - node_modules/is-core-module/.eslintrc | 18 - node_modules/is-core-module/.nycrc | 9 - node_modules/is-core-module/CHANGELOG.md | 180 - node_modules/is-core-module/LICENSE | 20 - node_modules/is-core-module/README.md | 40 - node_modules/is-core-module/core.json | 158 - node_modules/is-core-module/index.js | 69 - node_modules/is-core-module/package.json | 73 - node_modules/is-core-module/test/index.js | 133 - node_modules/is-plain-object/LICENSE | 21 - node_modules/is-plain-object/README.md | 104 - node_modules/is-plain-object/index.d.ts | 5 - node_modules/is-plain-object/index.js | 37 - node_modules/is-plain-object/package.json | 79 - node_modules/is-url/.travis.yml | 3 - node_modules/is-url/History.md | 25 - node_modules/is-url/LICENSE-MIT | 19 - node_modules/is-url/Readme.md | 19 - node_modules/is-url/index.js | 47 - node_modules/is-url/package.json | 13 - node_modules/is-url/test/index.js | 149 - node_modules/is2/.jshintrc | 43 - node_modules/is2/LICENSE | 20 - node_modules/is2/README.md | 164 - node_modules/is2/index.js | 1310 - node_modules/is2/package.json | 56 - node_modules/is2/tests.js | 1572 - node_modules/isexe/.npmignore | 2 - node_modules/isexe/LICENSE | 15 - node_modules/isexe/README.md | 51 - node_modules/isexe/index.js | 57 - node_modules/isexe/mode.js | 41 - node_modules/isexe/package.json | 31 - node_modules/isexe/test/basic.js | 221 - node_modules/isexe/windows.js | 42 - node_modules/isobject/LICENSE | 21 - node_modules/isobject/README.md | 122 - node_modules/isobject/index.d.ts | 5 - node_modules/isobject/index.js | 12 - node_modules/isobject/package.json | 74 - node_modules/jest-worker/LICENSE | 21 - node_modules/jest-worker/README.md | 247 - node_modules/jest-worker/build/Farm.d.ts | 29 - node_modules/jest-worker/build/Farm.js | 206 - node_modules/jest-worker/build/FifoQueue.d.ts | 18 - node_modules/jest-worker/build/FifoQueue.js | 171 - .../jest-worker/build/PriorityQueue.d.ts | 41 - .../jest-worker/build/PriorityQueue.js | 188 - .../jest-worker/build/WorkerPool.d.ts | 13 - node_modules/jest-worker/build/WorkerPool.js | 49 - .../build/base/BaseWorkerPool.d.ts | 21 - .../jest-worker/build/base/BaseWorkerPool.js | 201 - node_modules/jest-worker/build/index.d.ts | 49 - node_modules/jest-worker/build/index.js | 223 - node_modules/jest-worker/build/types.d.ts | 143 - node_modules/jest-worker/build/types.js | 39 - .../build/workers/ChildProcessWorker.d.ts | 51 - .../build/workers/ChildProcessWorker.js | 333 - .../build/workers/NodeThreadsWorker.d.ts | 34 - .../build/workers/NodeThreadsWorker.js | 344 - .../build/workers/messageParent.d.ts | 8 - .../build/workers/messageParent.js | 38 - .../build/workers/processChild.d.ts | 7 - .../jest-worker/build/workers/processChild.js | 148 - .../build/workers/threadChild.d.ts | 7 - .../jest-worker/build/workers/threadChild.js | 159 - node_modules/jest-worker/package.json | 38 - .../CHANGELOG.md | 50 - .../json-parse-even-better-errors/LICENSE.md | 25 - .../json-parse-even-better-errors/README.md | 96 - .../json-parse-even-better-errors/index.js | 121 - .../package.json | 33 - .../json-schema-traverse/.eslintrc.yml | 27 - node_modules/json-schema-traverse/.travis.yml | 8 - node_modules/json-schema-traverse/LICENSE | 21 - node_modules/json-schema-traverse/README.md | 83 - node_modules/json-schema-traverse/index.js | 89 - .../json-schema-traverse/package.json | 43 - .../json-schema-traverse/spec/.eslintrc.yml | 6 - .../spec/fixtures/schema.js | 125 - .../json-schema-traverse/spec/index.spec.js | 171 - node_modules/json5/LICENSE.md | 23 - node_modules/json5/README.md | 282 - node_modules/json5/dist/index.js | 1737 - node_modules/json5/dist/index.min.js | 1 - node_modules/json5/dist/index.min.mjs | 1 - node_modules/json5/dist/index.mjs | 1426 - node_modules/json5/lib/cli.js | 152 - node_modules/json5/lib/index.d.ts | 4 - node_modules/json5/lib/index.js | 9 - node_modules/json5/lib/parse.d.ts | 15 - node_modules/json5/lib/parse.js | 1114 - node_modules/json5/lib/register.js | 13 - node_modules/json5/lib/require.js | 4 - node_modules/json5/lib/stringify.d.ts | 89 - node_modules/json5/lib/stringify.js | 261 - node_modules/json5/lib/unicode.d.ts | 3 - node_modules/json5/lib/unicode.js | 4 - node_modules/json5/lib/util.d.ts | 5 - node_modules/json5/lib/util.js | 35 - node_modules/json5/package.json | 72 - node_modules/kind-of/CHANGELOG.md | 160 - node_modules/kind-of/LICENSE | 21 - node_modules/kind-of/README.md | 367 - node_modules/kind-of/index.js | 129 - node_modules/kind-of/package.json | 88 - node_modules/loader-runner/LICENSE | 21 - node_modules/loader-runner/README.md | 53 - .../loader-runner/lib/LoaderLoadingError.js | 11 - .../loader-runner/lib/LoaderRunner.js | 416 - node_modules/loader-runner/lib/loadLoader.js | 54 - node_modules/loader-runner/package.json | 45 - node_modules/locate-path/index.d.ts | 83 - node_modules/locate-path/index.js | 65 - node_modules/locate-path/license | 9 - node_modules/locate-path/package.json | 45 - node_modules/locate-path/readme.md | 122 - node_modules/lodash.filter/LICENSE | 47 - node_modules/lodash.filter/README.md | 18 - node_modules/lodash.filter/index.js | 2366 -- node_modules/lodash.filter/package.json | 17 - node_modules/lodash.merge/LICENSE | 47 - node_modules/lodash.merge/README.md | 18 - node_modules/lodash.merge/index.js | 1977 - node_modules/lodash.merge/package.json | 16 - node_modules/make-error/LICENSE | 5 - node_modules/make-error/README.md | 112 - node_modules/make-error/dist/make-error.js | 1 - node_modules/make-error/index.d.ts | 47 - node_modules/make-error/index.js | 151 - node_modules/make-error/package.json | 62 - node_modules/merge-stream/LICENSE | 21 - node_modules/merge-stream/README.md | 78 - node_modules/merge-stream/index.js | 41 - node_modules/merge-stream/package.json | 19 - node_modules/mime-db/HISTORY.md | 507 - node_modules/mime-db/LICENSE | 23 - node_modules/mime-db/README.md | 100 - node_modules/mime-db/db.json | 8519 ----- node_modules/mime-db/index.js | 12 - node_modules/mime-db/package.json | 60 - node_modules/mime-types/HISTORY.md | 397 - node_modules/mime-types/LICENSE | 23 - node_modules/mime-types/README.md | 113 - node_modules/mime-types/index.js | 188 - node_modules/mime-types/package.json | 44 - node_modules/ms/index.js | 162 - node_modules/ms/license.md | 21 - node_modules/ms/package.json | 38 - node_modules/ms/readme.md | 59 - node_modules/neo-async/LICENSE | 22 - node_modules/neo-async/README.md | 273 - node_modules/neo-async/all.js | 3 - node_modules/neo-async/allLimit.js | 3 - node_modules/neo-async/allSeries.js | 3 - node_modules/neo-async/angelFall.js | 3 - node_modules/neo-async/any.js | 3 - node_modules/neo-async/anyLimit.js | 3 - node_modules/neo-async/anySeries.js | 3 - node_modules/neo-async/apply.js | 3 - node_modules/neo-async/applyEach.js | 3 - node_modules/neo-async/applyEachSeries.js | 3 - node_modules/neo-async/async.js | 9184 ----- node_modules/neo-async/async.min.js | 80 - node_modules/neo-async/asyncify.js | 3 - node_modules/neo-async/auto.js | 3 - node_modules/neo-async/autoInject.js | 3 - node_modules/neo-async/cargo.js | 3 - node_modules/neo-async/compose.js | 3 - node_modules/neo-async/concat.js | 3 - node_modules/neo-async/concatLimit.js | 3 - node_modules/neo-async/concatSeries.js | 3 - node_modules/neo-async/constant.js | 3 - node_modules/neo-async/createLogger.js | 3 - node_modules/neo-async/detect.js | 3 - node_modules/neo-async/detectLimit.js | 3 - node_modules/neo-async/detectSeries.js | 3 - node_modules/neo-async/dir.js | 3 - node_modules/neo-async/doDuring.js | 3 - node_modules/neo-async/doUntil.js | 3 - node_modules/neo-async/doWhilst.js | 3 - node_modules/neo-async/during.js | 3 - node_modules/neo-async/each.js | 3 - node_modules/neo-async/eachLimit.js | 3 - node_modules/neo-async/eachOf.js | 3 - node_modules/neo-async/eachOfLimit.js | 3 - node_modules/neo-async/eachOfSeries.js | 3 - node_modules/neo-async/eachSeries.js | 3 - node_modules/neo-async/ensureAsync.js | 3 - node_modules/neo-async/every.js | 3 - node_modules/neo-async/everyLimit.js | 3 - node_modules/neo-async/everySeries.js | 3 - node_modules/neo-async/fast.js | 3 - node_modules/neo-async/filter.js | 3 - node_modules/neo-async/filterLimit.js | 3 - node_modules/neo-async/filterSeries.js | 3 - node_modules/neo-async/find.js | 3 - node_modules/neo-async/findLimit.js | 3 - node_modules/neo-async/findSeries.js | 3 - node_modules/neo-async/foldl.js | 3 - node_modules/neo-async/foldr.js | 3 - node_modules/neo-async/forEach.js | 3 - node_modules/neo-async/forEachLimit.js | 3 - node_modules/neo-async/forEachOf.js | 3 - node_modules/neo-async/forEachOfLimit.js | 3 - node_modules/neo-async/forEachOfSeries.js | 3 - node_modules/neo-async/forEachSeries.js | 3 - node_modules/neo-async/forever.js | 3 - node_modules/neo-async/groupBy.js | 3 - node_modules/neo-async/groupByLimit.js | 3 - node_modules/neo-async/groupBySeries.js | 3 - node_modules/neo-async/inject.js | 3 - node_modules/neo-async/iterator.js | 3 - node_modules/neo-async/log.js | 3 - node_modules/neo-async/map.js | 3 - node_modules/neo-async/mapLimit.js | 3 - node_modules/neo-async/mapSeries.js | 3 - node_modules/neo-async/mapValues.js | 3 - node_modules/neo-async/mapValuesLimit.js | 3 - node_modules/neo-async/mapValuesSeries.js | 3 - node_modules/neo-async/memoize.js | 3 - node_modules/neo-async/nextTick.js | 3 - node_modules/neo-async/omit.js | 3 - node_modules/neo-async/omitLimit.js | 3 - node_modules/neo-async/omitSeries.js | 3 - node_modules/neo-async/package.json | 57 - node_modules/neo-async/parallel.js | 3 - node_modules/neo-async/parallelLimit.js | 3 - node_modules/neo-async/pick.js | 3 - node_modules/neo-async/pickLimit.js | 3 - node_modules/neo-async/pickSeries.js | 3 - node_modules/neo-async/priorityQueue.js | 3 - node_modules/neo-async/queue.js | 3 - node_modules/neo-async/race.js | 3 - node_modules/neo-async/reduce.js | 3 - node_modules/neo-async/reduceRight.js | 3 - node_modules/neo-async/reflect.js | 3 - node_modules/neo-async/reflectAll.js | 3 - node_modules/neo-async/reject.js | 3 - node_modules/neo-async/rejectLimit.js | 3 - node_modules/neo-async/rejectSeries.js | 3 - node_modules/neo-async/retry.js | 3 - node_modules/neo-async/retryable.js | 3 - node_modules/neo-async/safe.js | 3 - node_modules/neo-async/select.js | 3 - node_modules/neo-async/selectLimit.js | 3 - node_modules/neo-async/selectSeries.js | 3 - node_modules/neo-async/seq.js | 3 - node_modules/neo-async/series.js | 3 - node_modules/neo-async/setImmediate.js | 3 - node_modules/neo-async/some.js | 3 - node_modules/neo-async/someLimit.js | 3 - node_modules/neo-async/someSeries.js | 3 - node_modules/neo-async/sortBy.js | 3 - node_modules/neo-async/sortByLimit.js | 3 - node_modules/neo-async/sortBySeries.js | 3 - node_modules/neo-async/timeout.js | 3 - node_modules/neo-async/times.js | 3 - node_modules/neo-async/timesLimit.js | 3 - node_modules/neo-async/timesSeries.js | 3 - node_modules/neo-async/transform.js | 3 - node_modules/neo-async/transformLimit.js | 3 - node_modules/neo-async/transformSeries.js | 3 - node_modules/neo-async/tryEach.js | 3 - node_modules/neo-async/unmemoize.js | 3 - node_modules/neo-async/until.js | 3 - node_modules/neo-async/waterfall.js | 3 - node_modules/neo-async/whilst.js | 3 - node_modules/neo-async/wrapSync.js | 3 - node_modules/node-releases/LICENSE | 21 - node_modules/node-releases/README.md | 12 - .../node-releases/data/processed/envs.json | 1 - .../release-schedule/release-schedule.json | 1 - node_modules/node-releases/package.json | 19 - node_modules/p-limit/index.d.ts | 38 - node_modules/p-limit/index.js | 57 - node_modules/p-limit/license | 9 - node_modules/p-limit/package.json | 52 - node_modules/p-limit/readme.md | 101 - node_modules/p-locate/index.d.ts | 64 - node_modules/p-locate/index.js | 52 - node_modules/p-locate/license | 9 - node_modules/p-locate/package.json | 53 - node_modules/p-locate/readme.md | 90 - node_modules/p-try/index.d.ts | 39 - node_modules/p-try/index.js | 9 - node_modules/p-try/license | 9 - node_modules/p-try/package.json | 42 - node_modules/p-try/readme.md | 58 - node_modules/path-exists/index.d.ts | 28 - node_modules/path-exists/index.js | 23 - node_modules/path-exists/license | 9 - node_modules/path-exists/package.json | 39 - node_modules/path-exists/readme.md | 52 - node_modules/path-key/index.d.ts | 40 - node_modules/path-key/index.js | 16 - node_modules/path-key/license | 9 - node_modules/path-key/package.json | 39 - node_modules/path-key/readme.md | 61 - node_modules/path-parse/LICENSE | 21 - node_modules/path-parse/README.md | 42 - node_modules/path-parse/index.js | 75 - node_modules/path-parse/package.json | 33 - node_modules/picocolors/LICENSE | 15 - node_modules/picocolors/README.md | 21 - node_modules/picocolors/package.json | 25 - node_modules/picocolors/picocolors.browser.js | 4 - node_modules/picocolors/picocolors.d.ts | 5 - node_modules/picocolors/picocolors.js | 58 - node_modules/picocolors/types.ts | 30 - node_modules/pkg-dir/index.d.ts | 44 - node_modules/pkg-dir/index.js | 17 - node_modules/pkg-dir/license | 9 - node_modules/pkg-dir/package.json | 56 - node_modules/pkg-dir/readme.md | 66 - node_modules/property-path/.jshintrc | 44 - node_modules/property-path/LICENSE | 20 - node_modules/property-path/README.md | 118 - node_modules/property-path/index.js | 170 - .../node_modules/ip-regex/index.js | 24 - .../node_modules/ip-regex/license | 21 - .../node_modules/ip-regex/package.json | 45 - .../node_modules/ip-regex/readme.md | 63 - .../property-path/node_modules/is2/.jshintrc | 43 - .../property-path/node_modules/is2/LICENSE | 20 - .../property-path/node_modules/is2/README.md | 164 - .../property-path/node_modules/is2/index.js | 1310 - .../node_modules/is2/package.json | 57 - .../property-path/node_modules/is2/tests.js | 1570 - node_modules/property-path/package.json | 39 - node_modules/property-path/test.js | 119 - node_modules/punycode/LICENSE-MIT.txt | 20 - node_modules/punycode/README.md | 148 - node_modules/punycode/package.json | 58 - node_modules/punycode/punycode.es6.js | 444 - node_modules/punycode/punycode.js | 443 - node_modules/randombytes/.travis.yml | 15 - node_modules/randombytes/.zuul.yml | 1 - node_modules/randombytes/LICENSE | 21 - node_modules/randombytes/README.md | 14 - node_modules/randombytes/browser.js | 50 - node_modules/randombytes/index.js | 1 - node_modules/randombytes/package.json | 36 - node_modules/randombytes/test.js | 81 - node_modules/rechoir/CHANGELOG.md | 12 - node_modules/rechoir/LICENSE | 21 - node_modules/rechoir/README.md | 73 - node_modules/rechoir/index.js | 69 - node_modules/rechoir/lib/extension.js | 44 - node_modules/rechoir/lib/normalize.js | 13 - node_modules/rechoir/lib/register.js | 15 - node_modules/rechoir/package.json | 52 - node_modules/resolve-cwd/index.d.ts | 48 - node_modules/resolve-cwd/index.js | 5 - node_modules/resolve-cwd/license | 9 - node_modules/resolve-cwd/package.json | 43 - node_modules/resolve-cwd/readme.md | 58 - node_modules/resolve-from/index.d.ts | 31 - node_modules/resolve-from/index.js | 47 - node_modules/resolve-from/license | 9 - node_modules/resolve-from/package.json | 36 - node_modules/resolve-from/readme.md | 72 - node_modules/resolve/.editorconfig | 37 - node_modules/resolve/.eslintrc | 65 - node_modules/resolve/.github/FUNDING.yml | 12 - node_modules/resolve/LICENSE | 21 - node_modules/resolve/SECURITY.md | 3 - node_modules/resolve/async.js | 3 - node_modules/resolve/bin/resolve | 50 - node_modules/resolve/example/async.js | 5 - node_modules/resolve/example/sync.js | 3 - node_modules/resolve/index.js | 6 - node_modules/resolve/lib/async.js | 329 - node_modules/resolve/lib/caller.js | 8 - node_modules/resolve/lib/core.js | 12 - node_modules/resolve/lib/core.json | 158 - node_modules/resolve/lib/homedir.js | 24 - node_modules/resolve/lib/is-core.js | 5 - .../resolve/lib/node-modules-paths.js | 42 - node_modules/resolve/lib/normalize-options.js | 10 - node_modules/resolve/lib/sync.js | 208 - node_modules/resolve/package.json | 72 - node_modules/resolve/readme.markdown | 301 - node_modules/resolve/sync.js | 3 - node_modules/resolve/test/core.js | 88 - node_modules/resolve/test/dotdot.js | 29 - node_modules/resolve/test/dotdot/abc/index.js | 2 - node_modules/resolve/test/dotdot/index.js | 1 - node_modules/resolve/test/faulty_basedir.js | 29 - node_modules/resolve/test/filter.js | 34 - node_modules/resolve/test/filter_sync.js | 33 - node_modules/resolve/test/home_paths.js | 127 - node_modules/resolve/test/home_paths_sync.js | 114 - node_modules/resolve/test/mock.js | 315 - node_modules/resolve/test/mock_sync.js | 214 - node_modules/resolve/test/module_dir.js | 56 - .../test/module_dir/xmodules/aaa/index.js | 1 - .../test/module_dir/ymodules/aaa/index.js | 1 - .../test/module_dir/zmodules/bbb/main.js | 1 - .../test/module_dir/zmodules/bbb/package.json | 3 - .../resolve/test/node-modules-paths.js | 143 - node_modules/resolve/test/node_path.js | 70 - .../resolve/test/node_path/x/aaa/index.js | 1 - .../resolve/test/node_path/x/ccc/index.js | 1 - .../resolve/test/node_path/y/bbb/index.js | 1 - .../resolve/test/node_path/y/ccc/index.js | 1 - node_modules/resolve/test/nonstring.js | 9 - node_modules/resolve/test/pathfilter.js | 75 - .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 - node_modules/resolve/test/precedence/aaa.js | 1 - .../resolve/test/precedence/aaa/index.js | 1 - .../resolve/test/precedence/aaa/main.js | 1 - node_modules/resolve/test/precedence/bbb.js | 1 - .../resolve/test/precedence/bbb/main.js | 1 - node_modules/resolve/test/resolver.js | 597 - .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 - .../resolve/test/resolver/baz/quux.js | 1 - .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 - node_modules/resolve/test/resolver/cup.coffee | 1 - .../resolve/test/resolver/dot_main/index.js | 1 - .../test/resolver/dot_main/package.json | 3 - .../test/resolver/dot_slash_main/index.js | 1 - .../test/resolver/dot_slash_main/package.json | 3 - .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 - node_modules/resolve/test/resolver/foo.js | 1 - .../test/resolver/incorrect_main/index.js | 2 - .../test/resolver/incorrect_main/package.json | 3 - .../test/resolver/invalid_main/package.json | 7 - node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 - .../test/resolver/multirepo/package.json | 20 - .../multirepo/packages/package-a/index.js | 35 - .../multirepo/packages/package-a/package.json | 14 - .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 - .../resolver/nested_symlinks/mylib/async.js | 26 - .../nested_symlinks/mylib/package.json | 15 - .../resolver/nested_symlinks/mylib/sync.js | 12 - .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 - .../resolve/test/resolver/same_names/foo.js | 1 - .../test/resolver/same_names/foo/index.js | 1 - .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 - .../resolver/symlinked/package/package.json | 3 - .../test/resolver/without_basedir/main.js | 5 - node_modules/resolve/test/resolver_sync.js | 730 - node_modules/resolve/test/shadowed_core.js | 54 - .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 - node_modules/resolve/test/symlinks.js | 176 - node_modules/safe-buffer/LICENSE | 21 - node_modules/safe-buffer/README.md | 584 - node_modules/safe-buffer/index.d.ts | 187 - node_modules/safe-buffer/index.js | 65 - node_modules/safe-buffer/package.json | 51 - node_modules/schema-utils/CHANGELOG.md | 340 - node_modules/schema-utils/LICENSE | 20 - node_modules/schema-utils/README.md | 290 - .../declarations/ValidationError.d.ts | 74 - .../schema-utils/declarations/index.d.ts | 12 - .../declarations/keywords/absolutePath.d.ts | 10 - .../keywords/undefinedAsNull.d.ts | 8 - .../schema-utils/declarations/util/Range.d.ts | 79 - .../schema-utils/declarations/util/hints.d.ts | 3 - .../schema-utils/declarations/validate.d.ts | 42 - .../schema-utils/dist/ValidationError.js | 1277 - node_modules/schema-utils/dist/index.js | 17 - .../dist/keywords/absolutePath.js | 93 - .../dist/keywords/undefinedAsNull.js | 95 - node_modules/schema-utils/dist/util/Range.js | 163 - node_modules/schema-utils/dist/util/hints.js | 105 - node_modules/schema-utils/dist/validate.js | 258 - node_modules/schema-utils/package.json | 78 - node_modules/serialize-javascript/LICENSE | 27 - node_modules/serialize-javascript/README.md | 143 - node_modules/serialize-javascript/index.js | 268 - .../serialize-javascript/package.json | 36 - node_modules/shallow-clone/LICENSE | 21 - node_modules/shallow-clone/README.md | 153 - node_modules/shallow-clone/index.js | 83 - node_modules/shallow-clone/package.json | 64 - node_modules/shebang-command/index.js | 19 - node_modules/shebang-command/license | 9 - node_modules/shebang-command/package.json | 34 - node_modules/shebang-command/readme.md | 34 - node_modules/shebang-regex/index.d.ts | 22 - node_modules/shebang-regex/index.js | 2 - node_modules/shebang-regex/license | 9 - node_modules/shebang-regex/package.json | 35 - node_modules/shebang-regex/readme.md | 33 - node_modules/source-map-support/LICENSE.md | 21 - node_modules/source-map-support/README.md | 284 - .../browser-source-map-support.js | 114 - node_modules/source-map-support/package.json | 31 - .../register-hook-require.js | 1 - node_modules/source-map-support/register.js | 1 - .../source-map-support/source-map-support.js | 625 - node_modules/source-map/CHANGELOG.md | 301 - node_modules/source-map/LICENSE | 28 - node_modules/source-map/README.md | 742 - .../source-map/dist/source-map.debug.js | 3234 -- node_modules/source-map/dist/source-map.js | 3233 -- .../source-map/dist/source-map.min.js | 2 - .../source-map/dist/source-map.min.js.map | 1 - node_modules/source-map/lib/array-set.js | 121 - node_modules/source-map/lib/base64-vlq.js | 140 - node_modules/source-map/lib/base64.js | 67 - node_modules/source-map/lib/binary-search.js | 111 - node_modules/source-map/lib/mapping-list.js | 79 - node_modules/source-map/lib/quick-sort.js | 114 - .../source-map/lib/source-map-consumer.js | 1145 - .../source-map/lib/source-map-generator.js | 425 - node_modules/source-map/lib/source-node.js | 413 - node_modules/source-map/lib/util.js | 488 - node_modules/source-map/package.json | 73 - node_modules/source-map/source-map.d.ts | 98 - node_modules/source-map/source-map.js | 8 - node_modules/supports-color/browser.js | 24 - node_modules/supports-color/index.js | 152 - node_modules/supports-color/license | 9 - node_modules/supports-color/package.json | 58 - node_modules/supports-color/readme.md | 77 - .../supports-preserve-symlinks-flag/.eslintrc | 14 - .../.github/FUNDING.yml | 12 - .../supports-preserve-symlinks-flag/.nycrc | 9 - .../CHANGELOG.md | 22 - .../supports-preserve-symlinks-flag/LICENSE | 21 - .../supports-preserve-symlinks-flag/README.md | 42 - .../browser.js | 3 - .../supports-preserve-symlinks-flag/index.js | 9 - .../package.json | 70 - .../test/index.js | 29 - node_modules/tapable/LICENSE | 21 - node_modules/tapable/README.md | 296 - .../tapable/lib/AsyncParallelBailHook.js | 85 - node_modules/tapable/lib/AsyncParallelHook.js | 37 - .../tapable/lib/AsyncSeriesBailHook.js | 42 - node_modules/tapable/lib/AsyncSeriesHook.js | 37 - .../tapable/lib/AsyncSeriesLoopHook.js | 37 - .../tapable/lib/AsyncSeriesWaterfallHook.js | 47 - node_modules/tapable/lib/Hook.js | 175 - node_modules/tapable/lib/HookCodeFactory.js | 468 - node_modules/tapable/lib/HookMap.js | 61 - node_modules/tapable/lib/MultiHook.js | 54 - node_modules/tapable/lib/SyncBailHook.js | 51 - node_modules/tapable/lib/SyncHook.js | 46 - node_modules/tapable/lib/SyncLoopHook.js | 46 - node_modules/tapable/lib/SyncWaterfallHook.js | 57 - node_modules/tapable/lib/index.js | 19 - node_modules/tapable/lib/util-browser.js | 16 - node_modules/tapable/package.json | 44 - node_modules/tapable/tapable.d.ts | 116 - node_modules/terser-webpack-plugin/LICENSE | 20 - node_modules/terser-webpack-plugin/README.md | 934 - .../terser-webpack-plugin/dist/index.js | 692 - .../terser-webpack-plugin/dist/minify.js | 48 - .../terser-webpack-plugin/dist/options.json | 164 - .../terser-webpack-plugin/dist/utils.js | 637 - .../terser-webpack-plugin/package.json | 120 - .../terser-webpack-plugin/types/index.d.ts | 219 - .../terser-webpack-plugin/types/minify.d.ts | 17 - .../terser-webpack-plugin/types/utils.d.ts | 107 - node_modules/terser/CHANGELOG.md | 683 - node_modules/terser/LICENSE | 27 - node_modules/terser/PATRONS.md | 15 - node_modules/terser/README.md | 1421 - node_modules/terser/bin/package.json | 10 - node_modules/terser/bin/terser | 21 - node_modules/terser/bin/uglifyjs | 10 - node_modules/terser/dist/.gitkeep | 0 node_modules/terser/dist/bundle.min.js | 31368 ---------------- node_modules/terser/dist/package.json | 10 - node_modules/terser/lib/ast.js | 3339 -- node_modules/terser/lib/cli.js | 481 - node_modules/terser/lib/compress/common.js | 348 - .../terser/lib/compress/compressor-flags.js | 63 - .../lib/compress/drop-side-effect-free.js | 375 - .../terser/lib/compress/drop-unused.js | 482 - node_modules/terser/lib/compress/evaluate.js | 488 - .../terser/lib/compress/global-defs.js | 92 - node_modules/terser/lib/compress/index.js | 3795 -- node_modules/terser/lib/compress/inference.js | 934 - node_modules/terser/lib/compress/inline.js | 665 - .../terser/lib/compress/native-objects.js | 206 - .../terser/lib/compress/reduce-vars.js | 824 - .../terser/lib/compress/tighten-body.js | 1505 - node_modules/terser/lib/equivalent-to.js | 287 - node_modules/terser/lib/minify.js | 412 - node_modules/terser/lib/mozilla-ast.js | 1886 - node_modules/terser/lib/output.js | 2485 -- node_modules/terser/lib/parse.js | 3500 -- node_modules/terser/lib/propmangle.js | 432 - node_modules/terser/lib/scope.js | 1066 - node_modules/terser/lib/size.js | 495 - node_modules/terser/lib/sourcemap.js | 148 - node_modules/terser/lib/transform.js | 323 - .../terser/lib/utils/first_in_statement.js | 53 - node_modules/terser/lib/utils/index.js | 295 - node_modules/terser/main.js | 27 - node_modules/terser/package.json | 153 - node_modules/terser/tools/domprops.js | 8022 ---- node_modules/terser/tools/exit.cjs | 7 - node_modules/terser/tools/props.html | 55 - node_modules/terser/tools/terser.d.ts | 216 - node_modules/ts-node/LICENSE | 21 - node_modules/ts-node/README.md | 1442 - node_modules/ts-node/child-loader.mjs | 8 - node_modules/ts-node/dist-raw/NODE-LICENSE.md | 24 - node_modules/ts-node/dist-raw/README.md | 36 - .../dist-raw/node-internal-constants.js | 4 - .../ts-node/dist-raw/node-internal-errors.js | 82 - .../node-internal-modules-cjs-helpers.js | 89 - .../node-internal-modules-cjs-loader.js | 593 - .../node-internal-modules-esm-get_format.js | 106 - .../node-internal-modules-esm-resolve.js | 962 - ...de-internal-modules-package_json_reader.js | 44 - .../dist-raw/node-internal-repl-await.js | 254 - .../dist-raw/node-internalBinding-fs.js | 58 - .../ts-node/dist-raw/node-nativemodule.js | 9 - node_modules/ts-node/dist-raw/node-options.js | 103 - .../ts-node/dist-raw/node-primordials.js | 37 - node_modules/ts-node/dist-raw/runmain-hack.js | 9 - node_modules/ts-node/dist/bin-cwd.d.ts | 2 - node_modules/ts-node/dist/bin-cwd.js | 6 - node_modules/ts-node/dist/bin-cwd.js.map | 1 - node_modules/ts-node/dist/bin-esm.d.ts | 2 - node_modules/ts-node/dist/bin-esm.js | 6 - node_modules/ts-node/dist/bin-esm.js.map | 1 - .../ts-node/dist/bin-script-deprecated.d.ts | 2 - .../ts-node/dist/bin-script-deprecated.js | 7 - .../ts-node/dist/bin-script-deprecated.js.map | 1 - node_modules/ts-node/dist/bin-script.d.ts | 2 - node_modules/ts-node/dist/bin-script.js | 6 - node_modules/ts-node/dist/bin-script.js.map | 1 - node_modules/ts-node/dist/bin-transpile.d.ts | 2 - node_modules/ts-node/dist/bin-transpile.js | 6 - .../ts-node/dist/bin-transpile.js.map | 1 - node_modules/ts-node/dist/bin.d.ts | 11 - node_modules/ts-node/dist/bin.js | 581 - node_modules/ts-node/dist/bin.js.map | 1 - .../ts-node/dist/child/argv-payload.d.ts | 1 - .../ts-node/dist/child/argv-payload.js | 19 - .../ts-node/dist/child/argv-payload.js.map | 1 - .../ts-node/dist/child/child-entrypoint.d.ts | 1 - .../ts-node/dist/child/child-entrypoint.js | 24 - .../dist/child/child-entrypoint.js.map | 1 - .../ts-node/dist/child/child-loader.d.ts | 1 - .../ts-node/dist/child/child-loader.js | 32 - .../ts-node/dist/child/child-loader.js.map | 1 - .../ts-node/dist/child/child-require.d.ts | 7 - .../ts-node/dist/child/child-require.js | 22 - .../ts-node/dist/child/child-require.js.map | 1 - .../ts-node/dist/child/spawn-child.d.ts | 1 - .../ts-node/dist/child/spawn-child.js | 49 - .../ts-node/dist/child/spawn-child.js.map | 1 - .../ts-node/dist/cjs-resolve-hooks.d.ts | 1 - .../ts-node/dist/cjs-resolve-hooks.js | 29 - .../ts-node/dist/cjs-resolve-hooks.js.map | 1 - node_modules/ts-node/dist/configuration.d.ts | 1 - node_modules/ts-node/dist/configuration.js | 308 - .../ts-node/dist/configuration.js.map | 1 - node_modules/ts-node/dist/esm.d.ts | 53 - node_modules/ts-node/dist/esm.js | 228 - node_modules/ts-node/dist/esm.js.map | 1 - .../ts-node/dist/file-extensions.d.ts | 1 - node_modules/ts-node/dist/file-extensions.js | 133 - .../ts-node/dist/file-extensions.js.map | 1 - node_modules/ts-node/dist/index.d.ts | 332 - node_modules/ts-node/dist/index.js | 953 - node_modules/ts-node/dist/index.js.map | 1 - .../ts-node/dist/module-type-classifier.d.ts | 1 - .../ts-node/dist/module-type-classifier.js | 64 - .../dist/module-type-classifier.js.map | 1 - .../dist/node-module-type-classifier.d.ts | 1 - .../dist/node-module-type-classifier.js | 39 - .../dist/node-module-type-classifier.js.map | 1 - node_modules/ts-node/dist/repl.d.ts | 78 - node_modules/ts-node/dist/repl.js | 561 - node_modules/ts-node/dist/repl.js.map | 1 - .../ts-node/dist/resolver-functions.d.ts | 1 - .../ts-node/dist/resolver-functions.js | 143 - .../ts-node/dist/resolver-functions.js.map | 1 - .../ts-node/dist/transpilers/swc.d.ts | 11 - node_modules/ts-node/dist/transpilers/swc.js | 218 - .../ts-node/dist/transpilers/swc.js.map | 1 - .../ts-node/dist/transpilers/types.d.ts | 35 - .../ts-node/dist/transpilers/types.js | 3 - .../ts-node/dist/transpilers/types.js.map | 1 - .../ts-node/dist/ts-compiler-types.d.ts | 63 - .../ts-node/dist/ts-compiler-types.js | 3 - .../ts-node/dist/ts-compiler-types.js.map | 1 - node_modules/ts-node/dist/ts-internals.d.ts | 6 - node_modules/ts-node/dist/ts-internals.js | 321 - node_modules/ts-node/dist/ts-internals.js.map | 1 - .../ts-node/dist/ts-transpile-module.d.ts | 1 - .../ts-node/dist/ts-transpile-module.js | 100 - .../ts-node/dist/ts-transpile-module.js.map | 1 - .../ts-node/dist/tsconfig-schema.d.ts | 13 - node_modules/ts-node/dist/tsconfig-schema.js | 3 - .../ts-node/dist/tsconfig-schema.js.map | 1 - node_modules/ts-node/dist/tsconfigs.d.ts | 1 - node_modules/ts-node/dist/tsconfigs.js | 36 - node_modules/ts-node/dist/tsconfigs.js.map | 1 - node_modules/ts-node/dist/util.d.ts | 4 - node_modules/ts-node/dist/util.js | 175 - node_modules/ts-node/dist/util.js.map | 1 - node_modules/ts-node/esm.mjs | 8 - node_modules/ts-node/esm/transpile-only.mjs | 8 - node_modules/ts-node/node10/tsconfig.json | 3 - node_modules/ts-node/node12/tsconfig.json | 3 - node_modules/ts-node/node14/tsconfig.json | 3 - node_modules/ts-node/node16/tsconfig.json | 3 - node_modules/ts-node/package.json | 182 - node_modules/ts-node/register/files.js | 3 - node_modules/ts-node/register/index.js | 1 - .../ts-node/register/transpile-only.js | 3 - node_modules/ts-node/register/type-check.js | 3 - .../ts-node/transpilers/swc-experimental.js | 1 - node_modules/ts-node/transpilers/swc.js | 1 - node_modules/ts-node/tsconfig.schema.json | 183 - .../ts-node/tsconfig.schemastore-schema.json | 1326 - node_modules/undici-types/README.md | 6 - node_modules/undici-types/agent.d.ts | 31 - node_modules/undici-types/api.d.ts | 43 - node_modules/undici-types/balanced-pool.d.ts | 18 - node_modules/undici-types/cache.d.ts | 36 - node_modules/undici-types/client.d.ts | 97 - node_modules/undici-types/connector.d.ts | 34 - node_modules/undici-types/content-type.d.ts | 21 - node_modules/undici-types/cookies.d.ts | 28 - .../undici-types/diagnostics-channel.d.ts | 67 - node_modules/undici-types/dispatcher.d.ts | 241 - node_modules/undici-types/errors.d.ts | 128 - node_modules/undici-types/fetch.d.ts | 209 - node_modules/undici-types/file.d.ts | 39 - node_modules/undici-types/filereader.d.ts | 54 - node_modules/undici-types/formdata.d.ts | 108 - .../undici-types/global-dispatcher.d.ts | 9 - node_modules/undici-types/global-origin.d.ts | 7 - node_modules/undici-types/handlers.d.ts | 9 - node_modules/undici-types/header.d.ts | 4 - node_modules/undici-types/index.d.ts | 63 - node_modules/undici-types/interceptors.d.ts | 5 - node_modules/undici-types/mock-agent.d.ts | 50 - node_modules/undici-types/mock-client.d.ts | 25 - node_modules/undici-types/mock-errors.d.ts | 12 - .../undici-types/mock-interceptor.d.ts | 93 - node_modules/undici-types/mock-pool.d.ts | 25 - node_modules/undici-types/package.json | 55 - node_modules/undici-types/patch.d.ts | 71 - node_modules/undici-types/pool-stats.d.ts | 19 - node_modules/undici-types/pool.d.ts | 28 - node_modules/undici-types/proxy-agent.d.ts | 30 - node_modules/undici-types/readable.d.ts | 61 - node_modules/undici-types/webidl.d.ts | 220 - node_modules/undici-types/websocket.d.ts | 131 - node_modules/update-browserslist-db/LICENSE | 20 - node_modules/update-browserslist-db/README.md | 22 - .../check-npm-version.js | 16 - node_modules/update-browserslist-db/cli.js | 42 - .../update-browserslist-db/index.d.ts | 6 - node_modules/update-browserslist-db/index.js | 322 - .../update-browserslist-db/package.json | 40 - node_modules/update-browserslist-db/utils.js | 22 - node_modules/uri-js/LICENSE | 11 - node_modules/uri-js/README.md | 203 - node_modules/uri-js/dist/es5/uri.all.d.ts | 59 - node_modules/uri-js/dist/es5/uri.all.js | 1443 - node_modules/uri-js/dist/es5/uri.all.js.map | 1 - node_modules/uri-js/dist/es5/uri.all.min.d.ts | 59 - node_modules/uri-js/dist/es5/uri.all.min.js | 3 - .../uri-js/dist/es5/uri.all.min.js.map | 1 - node_modules/uri-js/dist/esnext/index.d.ts | 1 - node_modules/uri-js/dist/esnext/index.js | 17 - node_modules/uri-js/dist/esnext/index.js.map | 1 - .../uri-js/dist/esnext/regexps-iri.d.ts | 3 - .../uri-js/dist/esnext/regexps-iri.js | 3 - .../uri-js/dist/esnext/regexps-iri.js.map | 1 - .../uri-js/dist/esnext/regexps-uri.d.ts | 4 - .../uri-js/dist/esnext/regexps-uri.js | 42 - .../uri-js/dist/esnext/regexps-uri.js.map | 1 - .../uri-js/dist/esnext/schemes/http.d.ts | 3 - .../uri-js/dist/esnext/schemes/http.js | 28 - .../uri-js/dist/esnext/schemes/http.js.map | 1 - .../uri-js/dist/esnext/schemes/https.d.ts | 3 - .../uri-js/dist/esnext/schemes/https.js | 9 - .../uri-js/dist/esnext/schemes/https.js.map | 1 - .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 - .../uri-js/dist/esnext/schemes/mailto.js | 148 - .../uri-js/dist/esnext/schemes/mailto.js.map | 1 - .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 - .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 - .../dist/esnext/schemes/urn-uuid.js.map | 1 - .../uri-js/dist/esnext/schemes/urn.d.ts | 10 - .../uri-js/dist/esnext/schemes/urn.js | 49 - .../uri-js/dist/esnext/schemes/urn.js.map | 1 - .../uri-js/dist/esnext/schemes/ws.d.ts | 7 - node_modules/uri-js/dist/esnext/schemes/ws.js | 41 - .../uri-js/dist/esnext/schemes/ws.js.map | 1 - .../uri-js/dist/esnext/schemes/wss.d.ts | 3 - .../uri-js/dist/esnext/schemes/wss.js | 9 - .../uri-js/dist/esnext/schemes/wss.js.map | 1 - node_modules/uri-js/dist/esnext/uri.d.ts | 59 - node_modules/uri-js/dist/esnext/uri.js | 480 - node_modules/uri-js/dist/esnext/uri.js.map | 1 - node_modules/uri-js/dist/esnext/util.d.ts | 6 - node_modules/uri-js/dist/esnext/util.js | 36 - node_modules/uri-js/dist/esnext/util.js.map | 1 - node_modules/uri-js/package.json | 77 - node_modules/uri-js/yarn.lock | 2558 -- .../v8-compile-cache-lib/CHANGELOG.md | 53 - node_modules/v8-compile-cache-lib/LICENSE | 21 - node_modules/v8-compile-cache-lib/README.md | 60 - .../v8-compile-cache-lib/package.json | 35 - .../v8-compile-cache.d.ts | 7 - .../v8-compile-cache-lib/v8-compile-cache.js | 391 - node_modules/watchpack/LICENSE | 20 - node_modules/watchpack/README.md | 149 - .../watchpack/lib/DirectoryWatcher.js | 786 - node_modules/watchpack/lib/LinkResolver.js | 107 - .../watchpack/lib/getWatcherManager.js | 52 - node_modules/watchpack/lib/reducePlan.js | 138 - .../watchpack/lib/watchEventSource.js | 335 - node_modules/watchpack/lib/watchpack.js | 383 - node_modules/watchpack/package.json | 49 - node_modules/webpack-cli/LICENSE | 20 - node_modules/webpack-cli/README.md | 145 - node_modules/webpack-cli/bin/cli.js | 17 - node_modules/webpack-cli/lib/bootstrap.d.ts | 1 - node_modules/webpack-cli/lib/bootstrap.js | 16 - node_modules/webpack-cli/lib/index.d.ts | 1 - node_modules/webpack-cli/lib/index.js | 5 - .../webpack-cli/lib/plugins/cli-plugin.d.ts | 12 - .../webpack-cli/lib/plugins/cli-plugin.js | 108 - node_modules/webpack-cli/lib/types.d.ts | 230 - node_modules/webpack-cli/lib/types.js | 2 - .../lib/utils/dynamic-import-loader.d.ts | 1 - .../lib/utils/dynamic-import-loader.js | 13 - node_modules/webpack-cli/lib/webpack-cli.d.ts | 1 - node_modules/webpack-cli/lib/webpack-cli.js | 1892 - .../node_modules/commander/LICENSE | 22 - .../node_modules/commander/Readme.md | 1134 - .../node_modules/commander/esm.mjs | 16 - .../node_modules/commander/index.js | 27 - .../node_modules/commander/lib/argument.js | 147 - .../node_modules/commander/lib/command.js | 2179 -- .../node_modules/commander/lib/error.js | 45 - .../node_modules/commander/lib/help.js | 464 - .../node_modules/commander/lib/option.js | 331 - .../commander/lib/suggestSimilar.js | 100 - .../commander/package-support.json | 16 - .../node_modules/commander/package.json | 80 - .../node_modules/commander/typings/index.d.ts | 889 - node_modules/webpack-cli/package.json | 69 - node_modules/webpack-merge/LICENSE | 20 - node_modules/webpack-merge/README.md | 314 - node_modules/webpack-merge/dist/index.d.ts | 15 - node_modules/webpack-merge/dist/index.js | 252 - node_modules/webpack-merge/dist/index.js.map | 1 - .../webpack-merge/dist/join-arrays.d.ts | 6 - .../webpack-merge/dist/join-arrays.js | 70 - .../webpack-merge/dist/join-arrays.js.map | 1 - .../webpack-merge/dist/merge-with.d.ts | 2 - node_modules/webpack-merge/dist/merge-with.js | 38 - .../webpack-merge/dist/merge-with.js.map | 1 - node_modules/webpack-merge/dist/types.d.ts | 14 - node_modules/webpack-merge/dist/types.js | 12 - node_modules/webpack-merge/dist/types.js.map | 1 - node_modules/webpack-merge/dist/unique.d.ts | 2 - node_modules/webpack-merge/dist/unique.js | 41 - node_modules/webpack-merge/dist/unique.js.map | 1 - node_modules/webpack-merge/dist/utils.d.ts | 17 - node_modules/webpack-merge/dist/utils.js | 98 - node_modules/webpack-merge/dist/utils.js.map | 1 - node_modules/webpack-merge/package.json | 60 - node_modules/which/CHANGELOG.md | 166 - node_modules/which/LICENSE | 15 - node_modules/which/README.md | 54 - node_modules/which/bin/node-which | 52 - node_modules/which/package.json | 43 - node_modules/which/which.js | 125 - .../wildcard/.github/workflows/build.yml | 24 - node_modules/wildcard/LICENSE | 21 - node_modules/wildcard/README.md | 88 - node_modules/wildcard/docs.json | 9 - node_modules/wildcard/examples/arrays.js | 10 - node_modules/wildcard/examples/objects.js | 10 - node_modules/wildcard/examples/strings.js | 7 - node_modules/wildcard/index.js | 114 - node_modules/wildcard/package.json | 32 - node_modules/wildcard/test/all.js | 3 - node_modules/wildcard/test/arrays.js | 33 - node_modules/wildcard/test/objects.js | 106 - node_modules/wildcard/test/strings.js | 46 - node_modules/yn/index.d.ts | 65 - node_modules/yn/index.js | 33 - node_modules/yn/lenient.js | 105 - node_modules/yn/license | 9 - node_modules/yn/package.json | 42 - node_modules/yn/readme.md | 83 - 4862 files changed, 410086 deletions(-) delete mode 100644 node_modules/.bin/acorn delete mode 100644 node_modules/.bin/acorn.cmd delete mode 100644 node_modules/.bin/acorn.ps1 delete mode 100644 node_modules/.bin/browserslist delete mode 100644 node_modules/.bin/browserslist.cmd delete mode 100644 node_modules/.bin/browserslist.ps1 delete mode 100644 node_modules/.bin/envinfo delete mode 100644 node_modules/.bin/envinfo.cmd delete mode 100644 node_modules/.bin/envinfo.ps1 delete mode 100644 node_modules/.bin/flat delete mode 100644 node_modules/.bin/flat.cmd delete mode 100644 node_modules/.bin/flat.ps1 delete mode 100644 node_modules/.bin/import-local-fixture delete mode 100644 node_modules/.bin/import-local-fixture.cmd delete mode 100644 node_modules/.bin/import-local-fixture.ps1 delete mode 100644 node_modules/.bin/json5 delete mode 100644 node_modules/.bin/json5.cmd delete mode 100644 node_modules/.bin/json5.ps1 delete mode 100644 node_modules/.bin/node-which delete mode 100644 node_modules/.bin/node-which.cmd delete mode 100644 node_modules/.bin/node-which.ps1 delete mode 100644 node_modules/.bin/resolve delete mode 100644 node_modules/.bin/resolve.cmd delete mode 100644 node_modules/.bin/resolve.ps1 delete mode 100644 node_modules/.bin/terser delete mode 100644 node_modules/.bin/terser.cmd delete mode 100644 node_modules/.bin/terser.ps1 delete mode 100644 node_modules/.bin/ts-node delete mode 100644 node_modules/.bin/ts-node-cwd delete mode 100644 node_modules/.bin/ts-node-cwd.cmd delete mode 100644 node_modules/.bin/ts-node-cwd.ps1 delete mode 100644 node_modules/.bin/ts-node-esm delete mode 100644 node_modules/.bin/ts-node-esm.cmd delete mode 100644 node_modules/.bin/ts-node-esm.ps1 delete mode 100644 node_modules/.bin/ts-node-script delete mode 100644 node_modules/.bin/ts-node-script.cmd delete mode 100644 node_modules/.bin/ts-node-script.ps1 delete mode 100644 node_modules/.bin/ts-node-transpile-only delete mode 100644 node_modules/.bin/ts-node-transpile-only.cmd delete mode 100644 node_modules/.bin/ts-node-transpile-only.ps1 delete mode 100644 node_modules/.bin/ts-node.cmd delete mode 100644 node_modules/.bin/ts-node.ps1 delete mode 100644 node_modules/.bin/ts-script delete mode 100644 node_modules/.bin/ts-script.cmd delete mode 100644 node_modules/.bin/ts-script.ps1 delete mode 100644 node_modules/.bin/tsc delete mode 100644 node_modules/.bin/tsc.cmd delete mode 100644 node_modules/.bin/tsc.ps1 delete mode 100644 node_modules/.bin/tsserver delete mode 100644 node_modules/.bin/tsserver.cmd delete mode 100644 node_modules/.bin/tsserver.ps1 delete mode 100644 node_modules/.bin/update-browserslist-db delete mode 100644 node_modules/.bin/update-browserslist-db.cmd delete mode 100644 node_modules/.bin/update-browserslist-db.ps1 delete mode 100644 node_modules/.bin/webpack delete mode 100644 node_modules/.bin/webpack-cli delete mode 100644 node_modules/.bin/webpack-cli.cmd delete mode 100644 node_modules/.bin/webpack-cli.ps1 delete mode 100644 node_modules/.bin/webpack.cmd delete mode 100644 node_modules/.bin/webpack.ps1 delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/@cspotcode/source-map-support/LICENSE.md delete mode 100644 node_modules/@cspotcode/source-map-support/README.md delete mode 100644 node_modules/@cspotcode/source-map-support/browser-source-map-support.js delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/LICENSE delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/README.md delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/package.json delete mode 100644 node_modules/@cspotcode/source-map-support/package.json delete mode 100644 node_modules/@cspotcode/source-map-support/register-hook-require.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/register-hook-require.js delete mode 100644 node_modules/@cspotcode/source-map-support/register.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/register.js delete mode 100644 node_modules/@cspotcode/source-map-support/source-map-support.d.ts delete mode 100644 node_modules/@cspotcode/source-map-support/source-map-support.js delete mode 100644 node_modules/@discoveryjs/json-ext/LICENSE delete mode 100644 node_modules/@discoveryjs/json-ext/README.md delete mode 100644 node_modules/@discoveryjs/json-ext/dist/json-ext.js delete mode 100644 node_modules/@discoveryjs/json-ext/dist/json-ext.min.js delete mode 100644 node_modules/@discoveryjs/json-ext/dist/version.js delete mode 100644 node_modules/@discoveryjs/json-ext/index.d.ts delete mode 100644 node_modules/@discoveryjs/json-ext/package.json delete mode 100644 node_modules/@discoveryjs/json-ext/src/index.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/parse-chunked.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/stringify-info.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/stringify-stream-browser.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/stringify-stream.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/text-decoder-browser.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/text-decoder.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/utils.js delete mode 100644 node_modules/@discoveryjs/json-ext/src/version.js delete mode 100644 node_modules/@jridgewell/gen-mapping/LICENSE delete mode 100644 node_modules/@jridgewell/gen-mapping/README.md delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/package.json delete mode 100644 node_modules/@jridgewell/resolve-uri/LICENSE delete mode 100644 node_modules/@jridgewell/resolve-uri/README.md delete mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs delete mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map delete mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js delete mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map delete mode 100644 node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts delete mode 100644 node_modules/@jridgewell/resolve-uri/package.json delete mode 100644 node_modules/@jridgewell/set-array/LICENSE delete mode 100644 node_modules/@jridgewell/set-array/README.md delete mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs delete mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs.map delete mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js delete mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js.map delete mode 100644 node_modules/@jridgewell/set-array/dist/types/set-array.d.ts delete mode 100644 node_modules/@jridgewell/set-array/package.json delete mode 100644 node_modules/@jridgewell/set-array/src/set-array.ts delete mode 100644 node_modules/@jridgewell/source-map/LICENSE delete mode 100644 node_modules/@jridgewell/source-map/README.md delete mode 100644 node_modules/@jridgewell/source-map/dist/source-map.mjs delete mode 100644 node_modules/@jridgewell/source-map/dist/source-map.mjs.map delete mode 100644 node_modules/@jridgewell/source-map/dist/source-map.umd.js delete mode 100644 node_modules/@jridgewell/source-map/dist/source-map.umd.js.map delete mode 100644 node_modules/@jridgewell/source-map/dist/types/source-map.d.ts delete mode 100644 node_modules/@jridgewell/source-map/package.json delete mode 100644 node_modules/@jridgewell/sourcemap-codec/LICENSE delete mode 100644 node_modules/@jridgewell/sourcemap-codec/README.md delete mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs delete mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js delete mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/package.json delete mode 100644 node_modules/@jridgewell/trace-mapping/LICENSE delete mode 100644 node_modules/@jridgewell/trace-mapping/README.md delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/package.json delete mode 100644 node_modules/@tsconfig/node10/LICENSE delete mode 100644 node_modules/@tsconfig/node10/README.md delete mode 100644 node_modules/@tsconfig/node10/package.json delete mode 100644 node_modules/@tsconfig/node10/tsconfig.json delete mode 100644 node_modules/@tsconfig/node12/LICENSE delete mode 100644 node_modules/@tsconfig/node12/README.md delete mode 100644 node_modules/@tsconfig/node12/package.json delete mode 100644 node_modules/@tsconfig/node12/tsconfig.json delete mode 100644 node_modules/@tsconfig/node14/LICENSE delete mode 100644 node_modules/@tsconfig/node14/README.md delete mode 100644 node_modules/@tsconfig/node14/package.json delete mode 100644 node_modules/@tsconfig/node14/tsconfig.json delete mode 100644 node_modules/@tsconfig/node16/LICENSE delete mode 100644 node_modules/@tsconfig/node16/README.md delete mode 100644 node_modules/@tsconfig/node16/package.json delete mode 100644 node_modules/@tsconfig/node16/tsconfig.json delete mode 100644 node_modules/@types/eslint-scope/LICENSE delete mode 100644 node_modules/@types/eslint-scope/README.md delete mode 100644 node_modules/@types/eslint-scope/index.d.ts delete mode 100644 node_modules/@types/eslint-scope/package.json delete mode 100644 node_modules/@types/eslint/LICENSE delete mode 100644 node_modules/@types/eslint/README.md delete mode 100644 node_modules/@types/eslint/helpers.d.ts delete mode 100644 node_modules/@types/eslint/index.d.ts delete mode 100644 node_modules/@types/eslint/package.json delete mode 100644 node_modules/@types/eslint/rules/best-practices.d.ts delete mode 100644 node_modules/@types/eslint/rules/deprecated.d.ts delete mode 100644 node_modules/@types/eslint/rules/ecmascript-6.d.ts delete mode 100644 node_modules/@types/eslint/rules/index.d.ts delete mode 100644 node_modules/@types/eslint/rules/node-commonjs.d.ts delete mode 100644 node_modules/@types/eslint/rules/possible-errors.d.ts delete mode 100644 node_modules/@types/eslint/rules/strict-mode.d.ts delete mode 100644 node_modules/@types/eslint/rules/stylistic-issues.d.ts delete mode 100644 node_modules/@types/eslint/rules/variables.d.ts delete mode 100644 node_modules/@types/eslint/use-at-your-own-risk.d.ts delete mode 100644 node_modules/@types/estree/LICENSE delete mode 100644 node_modules/@types/estree/README.md delete mode 100644 node_modules/@types/estree/flow.d.ts delete mode 100644 node_modules/@types/estree/index.d.ts delete mode 100644 node_modules/@types/estree/package.json delete mode 100644 node_modules/@types/json-schema/LICENSE delete mode 100644 node_modules/@types/json-schema/README.md delete mode 100644 node_modules/@types/json-schema/index.d.ts delete mode 100644 node_modules/@types/json-schema/package.json delete mode 100644 node_modules/@types/node/LICENSE delete mode 100644 node_modules/@types/node/README.md delete mode 100644 node_modules/@types/node/assert.d.ts delete mode 100644 node_modules/@types/node/assert/strict.d.ts delete mode 100644 node_modules/@types/node/async_hooks.d.ts delete mode 100644 node_modules/@types/node/buffer.d.ts delete mode 100644 node_modules/@types/node/child_process.d.ts delete mode 100644 node_modules/@types/node/cluster.d.ts delete mode 100644 node_modules/@types/node/console.d.ts delete mode 100644 node_modules/@types/node/constants.d.ts delete mode 100644 node_modules/@types/node/crypto.d.ts delete mode 100644 node_modules/@types/node/dgram.d.ts delete mode 100644 node_modules/@types/node/diagnostics_channel.d.ts delete mode 100644 node_modules/@types/node/dns.d.ts delete mode 100644 node_modules/@types/node/dns/promises.d.ts delete mode 100644 node_modules/@types/node/dom-events.d.ts delete mode 100644 node_modules/@types/node/domain.d.ts delete mode 100644 node_modules/@types/node/events.d.ts delete mode 100644 node_modules/@types/node/fs.d.ts delete mode 100644 node_modules/@types/node/fs/promises.d.ts delete mode 100644 node_modules/@types/node/globals.d.ts delete mode 100644 node_modules/@types/node/globals.global.d.ts delete mode 100644 node_modules/@types/node/http.d.ts delete mode 100644 node_modules/@types/node/http2.d.ts delete mode 100644 node_modules/@types/node/https.d.ts delete mode 100644 node_modules/@types/node/index.d.ts delete mode 100644 node_modules/@types/node/inspector.d.ts delete mode 100644 node_modules/@types/node/module.d.ts delete mode 100644 node_modules/@types/node/net.d.ts delete mode 100644 node_modules/@types/node/os.d.ts delete mode 100644 node_modules/@types/node/package.json delete mode 100644 node_modules/@types/node/path.d.ts delete mode 100644 node_modules/@types/node/perf_hooks.d.ts delete mode 100644 node_modules/@types/node/process.d.ts delete mode 100644 node_modules/@types/node/punycode.d.ts delete mode 100644 node_modules/@types/node/querystring.d.ts delete mode 100644 node_modules/@types/node/readline.d.ts delete mode 100644 node_modules/@types/node/readline/promises.d.ts delete mode 100644 node_modules/@types/node/repl.d.ts delete mode 100644 node_modules/@types/node/stream.d.ts delete mode 100644 node_modules/@types/node/stream/consumers.d.ts delete mode 100644 node_modules/@types/node/stream/promises.d.ts delete mode 100644 node_modules/@types/node/stream/web.d.ts delete mode 100644 node_modules/@types/node/string_decoder.d.ts delete mode 100644 node_modules/@types/node/test.d.ts delete mode 100644 node_modules/@types/node/timers.d.ts delete mode 100644 node_modules/@types/node/timers/promises.d.ts delete mode 100644 node_modules/@types/node/tls.d.ts delete mode 100644 node_modules/@types/node/trace_events.d.ts delete mode 100644 node_modules/@types/node/ts4.8/assert.d.ts delete mode 100644 node_modules/@types/node/ts4.8/assert/strict.d.ts delete mode 100644 node_modules/@types/node/ts4.8/async_hooks.d.ts delete mode 100644 node_modules/@types/node/ts4.8/buffer.d.ts delete mode 100644 node_modules/@types/node/ts4.8/child_process.d.ts delete mode 100644 node_modules/@types/node/ts4.8/cluster.d.ts delete mode 100644 node_modules/@types/node/ts4.8/console.d.ts delete mode 100644 node_modules/@types/node/ts4.8/constants.d.ts delete mode 100644 node_modules/@types/node/ts4.8/crypto.d.ts delete mode 100644 node_modules/@types/node/ts4.8/dgram.d.ts delete mode 100644 node_modules/@types/node/ts4.8/diagnostics_channel.d.ts delete mode 100644 node_modules/@types/node/ts4.8/dns.d.ts delete mode 100644 node_modules/@types/node/ts4.8/dns/promises.d.ts delete mode 100644 node_modules/@types/node/ts4.8/dom-events.d.ts delete mode 100644 node_modules/@types/node/ts4.8/domain.d.ts delete mode 100644 node_modules/@types/node/ts4.8/events.d.ts delete mode 100644 node_modules/@types/node/ts4.8/fs.d.ts delete mode 100644 node_modules/@types/node/ts4.8/fs/promises.d.ts delete mode 100644 node_modules/@types/node/ts4.8/globals.d.ts delete mode 100644 node_modules/@types/node/ts4.8/globals.global.d.ts delete mode 100644 node_modules/@types/node/ts4.8/http.d.ts delete mode 100644 node_modules/@types/node/ts4.8/http2.d.ts delete mode 100644 node_modules/@types/node/ts4.8/https.d.ts delete mode 100644 node_modules/@types/node/ts4.8/index.d.ts delete mode 100644 node_modules/@types/node/ts4.8/inspector.d.ts delete mode 100644 node_modules/@types/node/ts4.8/module.d.ts delete mode 100644 node_modules/@types/node/ts4.8/net.d.ts delete mode 100644 node_modules/@types/node/ts4.8/os.d.ts delete mode 100644 node_modules/@types/node/ts4.8/path.d.ts delete mode 100644 node_modules/@types/node/ts4.8/perf_hooks.d.ts delete mode 100644 node_modules/@types/node/ts4.8/process.d.ts delete mode 100644 node_modules/@types/node/ts4.8/punycode.d.ts delete mode 100644 node_modules/@types/node/ts4.8/querystring.d.ts delete mode 100644 node_modules/@types/node/ts4.8/readline.d.ts delete mode 100644 node_modules/@types/node/ts4.8/readline/promises.d.ts delete mode 100644 node_modules/@types/node/ts4.8/repl.d.ts delete mode 100644 node_modules/@types/node/ts4.8/stream.d.ts delete mode 100644 node_modules/@types/node/ts4.8/stream/consumers.d.ts delete mode 100644 node_modules/@types/node/ts4.8/stream/promises.d.ts delete mode 100644 node_modules/@types/node/ts4.8/stream/web.d.ts delete mode 100644 node_modules/@types/node/ts4.8/string_decoder.d.ts delete mode 100644 node_modules/@types/node/ts4.8/test.d.ts delete mode 100644 node_modules/@types/node/ts4.8/timers.d.ts delete mode 100644 node_modules/@types/node/ts4.8/timers/promises.d.ts delete mode 100644 node_modules/@types/node/ts4.8/tls.d.ts delete mode 100644 node_modules/@types/node/ts4.8/trace_events.d.ts delete mode 100644 node_modules/@types/node/ts4.8/tty.d.ts delete mode 100644 node_modules/@types/node/ts4.8/url.d.ts delete mode 100644 node_modules/@types/node/ts4.8/util.d.ts delete mode 100644 node_modules/@types/node/ts4.8/v8.d.ts delete mode 100644 node_modules/@types/node/ts4.8/vm.d.ts delete mode 100644 node_modules/@types/node/ts4.8/wasi.d.ts delete mode 100644 node_modules/@types/node/ts4.8/worker_threads.d.ts delete mode 100644 node_modules/@types/node/ts4.8/zlib.d.ts delete mode 100644 node_modules/@types/node/tty.d.ts delete mode 100644 node_modules/@types/node/url.d.ts delete mode 100644 node_modules/@types/node/util.d.ts delete mode 100644 node_modules/@types/node/v8.d.ts delete mode 100644 node_modules/@types/node/vm.d.ts delete mode 100644 node_modules/@types/node/wasi.d.ts delete mode 100644 node_modules/@types/node/worker_threads.d.ts delete mode 100644 node_modules/@types/node/zlib.d.ts delete mode 100644 node_modules/@types/webpack/LICENSE delete mode 100644 node_modules/@types/webpack/README.md delete mode 100644 node_modules/@types/webpack/index.d.ts delete mode 100644 node_modules/@types/webpack/package.json delete mode 100644 node_modules/@webassemblyjs/ast/README.md delete mode 100644 node_modules/@webassemblyjs/ast/lib/clone.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/definitions.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/index.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/node-helpers.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/node-path.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/nodes.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/signatures.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/traverse.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/types/basic.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/types/nodes.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/types/traverse.js delete mode 100644 node_modules/@webassemblyjs/ast/lib/utils.js delete mode 100644 node_modules/@webassemblyjs/ast/package.json delete mode 100644 node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js delete mode 100644 node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js delete mode 100644 node_modules/@webassemblyjs/ast/scripts/util.js delete mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/LICENSE delete mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/README.md delete mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js delete mode 100644 node_modules/@webassemblyjs/floating-point-hex-parser/package.json delete mode 100644 node_modules/@webassemblyjs/helper-api-error/lib/index.js delete mode 100644 node_modules/@webassemblyjs/helper-api-error/package.json delete mode 100644 node_modules/@webassemblyjs/helper-buffer/lib/compare.js delete mode 100644 node_modules/@webassemblyjs/helper-buffer/lib/index.js delete mode 100644 node_modules/@webassemblyjs/helper-buffer/package.json delete mode 100644 node_modules/@webassemblyjs/helper-numbers/lib/index.js delete mode 100644 node_modules/@webassemblyjs/helper-numbers/package.json delete mode 100644 node_modules/@webassemblyjs/helper-numbers/src/index.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-bytecode/package.json delete mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/create.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/index.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js delete mode 100644 node_modules/@webassemblyjs/helper-wasm-section/package.json delete mode 100644 node_modules/@webassemblyjs/ieee754/lib/index.js delete mode 100644 node_modules/@webassemblyjs/ieee754/package.json delete mode 100644 node_modules/@webassemblyjs/ieee754/src/index.js delete mode 100644 node_modules/@webassemblyjs/leb128/LICENSE.txt delete mode 100644 node_modules/@webassemblyjs/leb128/lib/bits.js delete mode 100644 node_modules/@webassemblyjs/leb128/lib/bufs.js delete mode 100644 node_modules/@webassemblyjs/leb128/lib/index.js delete mode 100644 node_modules/@webassemblyjs/leb128/lib/leb.js delete mode 100644 node_modules/@webassemblyjs/leb128/package.json delete mode 100644 node_modules/@webassemblyjs/utf8/lib/decoder.js delete mode 100644 node_modules/@webassemblyjs/utf8/lib/encoder.js delete mode 100644 node_modules/@webassemblyjs/utf8/lib/index.js delete mode 100644 node_modules/@webassemblyjs/utf8/package.json delete mode 100644 node_modules/@webassemblyjs/utf8/src/decoder.js delete mode 100644 node_modules/@webassemblyjs/utf8/src/encoder.js delete mode 100644 node_modules/@webassemblyjs/utf8/src/index.js delete mode 100644 node_modules/@webassemblyjs/utf8/test/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-edit/README.md delete mode 100644 node_modules/@webassemblyjs/wasm-edit/lib/apply.js delete mode 100644 node_modules/@webassemblyjs/wasm-edit/lib/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-edit/package.json delete mode 100644 node_modules/@webassemblyjs/wasm-gen/lib/encoder/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-gen/lib/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-gen/package.json delete mode 100644 node_modules/@webassemblyjs/wasm-opt/lib/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-opt/lib/leb128.js delete mode 100644 node_modules/@webassemblyjs/wasm-opt/package.json delete mode 100644 node_modules/@webassemblyjs/wasm-parser/README.md delete mode 100644 node_modules/@webassemblyjs/wasm-parser/lib/decoder.js delete mode 100644 node_modules/@webassemblyjs/wasm-parser/lib/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-parser/lib/types/decoder.js delete mode 100644 node_modules/@webassemblyjs/wasm-parser/package.json delete mode 100644 node_modules/@webassemblyjs/wast-printer/README.md delete mode 100644 node_modules/@webassemblyjs/wast-printer/lib/index.js delete mode 100644 node_modules/@webassemblyjs/wast-printer/package.json delete mode 100644 node_modules/@webpack-cli/configtest/LICENSE delete mode 100644 node_modules/@webpack-cli/configtest/README.md delete mode 100644 node_modules/@webpack-cli/configtest/lib/index.d.ts delete mode 100644 node_modules/@webpack-cli/configtest/lib/index.js delete mode 100644 node_modules/@webpack-cli/configtest/package.json delete mode 100644 node_modules/@webpack-cli/info/LICENSE delete mode 100644 node_modules/@webpack-cli/info/README.md delete mode 100644 node_modules/@webpack-cli/info/lib/index.d.ts delete mode 100644 node_modules/@webpack-cli/info/lib/index.js delete mode 100644 node_modules/@webpack-cli/info/package.json delete mode 100644 node_modules/@webpack-cli/serve/LICENSE delete mode 100644 node_modules/@webpack-cli/serve/README.md delete mode 100644 node_modules/@webpack-cli/serve/lib/index.d.ts delete mode 100644 node_modules/@webpack-cli/serve/lib/index.js delete mode 100644 node_modules/@webpack-cli/serve/package.json delete mode 100644 node_modules/@xtuc/ieee754/LICENSE delete mode 100644 node_modules/@xtuc/ieee754/README.md delete mode 100644 node_modules/@xtuc/ieee754/dist/.gitkeep delete mode 100644 node_modules/@xtuc/ieee754/dist/index.cjs.js delete mode 100644 node_modules/@xtuc/ieee754/index.js delete mode 100644 node_modules/@xtuc/ieee754/package.json delete mode 100644 node_modules/@xtuc/long/LICENSE delete mode 100644 node_modules/@xtuc/long/README.md delete mode 100644 node_modules/@xtuc/long/dist/long.js delete mode 100644 node_modules/@xtuc/long/dist/long.js.map delete mode 100644 node_modules/@xtuc/long/index.d.ts delete mode 100644 node_modules/@xtuc/long/index.js delete mode 100644 node_modules/@xtuc/long/package.json delete mode 100644 node_modules/@xtuc/long/src/long.js delete mode 100644 node_modules/acorn-import-assertions/README.md delete mode 100644 node_modules/acorn-import-assertions/lib/index.js delete mode 100644 node_modules/acorn-import-assertions/lib/index.mjs delete mode 100644 node_modules/acorn-import-assertions/package.json delete mode 100644 node_modules/acorn-import-assertions/src/index.js delete mode 100644 node_modules/acorn-walk/CHANGELOG.md delete mode 100644 node_modules/acorn-walk/LICENSE delete mode 100644 node_modules/acorn-walk/README.md delete mode 100644 node_modules/acorn-walk/dist/walk.d.mts delete mode 100644 node_modules/acorn-walk/dist/walk.d.ts delete mode 100644 node_modules/acorn-walk/dist/walk.js delete mode 100644 node_modules/acorn-walk/dist/walk.mjs delete mode 100644 node_modules/acorn-walk/package.json delete mode 100644 node_modules/acorn/CHANGELOG.md delete mode 100644 node_modules/acorn/LICENSE delete mode 100644 node_modules/acorn/README.md delete mode 100644 node_modules/acorn/bin/acorn delete mode 100644 node_modules/acorn/dist/acorn.d.mts delete mode 100644 node_modules/acorn/dist/acorn.d.ts delete mode 100644 node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/acorn/dist/acorn.mjs delete mode 100644 node_modules/acorn/dist/bin.js delete mode 100644 node_modules/acorn/package.json delete mode 100644 node_modules/ajv-keywords/LICENSE delete mode 100644 node_modules/ajv-keywords/README.md delete mode 100644 node_modules/ajv-keywords/ajv-keywords.d.ts delete mode 100644 node_modules/ajv-keywords/index.js delete mode 100644 node_modules/ajv-keywords/keywords/_formatLimit.js delete mode 100644 node_modules/ajv-keywords/keywords/_util.js delete mode 100644 node_modules/ajv-keywords/keywords/allRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/anyRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/deepProperties.js delete mode 100644 node_modules/ajv-keywords/keywords/deepRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/dot/_formatLimit.jst delete mode 100644 node_modules/ajv-keywords/keywords/dot/patternRequired.jst delete mode 100644 node_modules/ajv-keywords/keywords/dot/switch.jst delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/README.md delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/patternRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/switch.js delete mode 100644 node_modules/ajv-keywords/keywords/dynamicDefaults.js delete mode 100644 node_modules/ajv-keywords/keywords/formatMaximum.js delete mode 100644 node_modules/ajv-keywords/keywords/formatMinimum.js delete mode 100644 node_modules/ajv-keywords/keywords/index.js delete mode 100644 node_modules/ajv-keywords/keywords/instanceof.js delete mode 100644 node_modules/ajv-keywords/keywords/oneRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/patternRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/prohibited.js delete mode 100644 node_modules/ajv-keywords/keywords/range.js delete mode 100644 node_modules/ajv-keywords/keywords/regexp.js delete mode 100644 node_modules/ajv-keywords/keywords/select.js delete mode 100644 node_modules/ajv-keywords/keywords/switch.js delete mode 100644 node_modules/ajv-keywords/keywords/transform.js delete mode 100644 node_modules/ajv-keywords/keywords/typeof.js delete mode 100644 node_modules/ajv-keywords/keywords/uniqueItemProperties.js delete mode 100644 node_modules/ajv-keywords/package.json delete mode 100644 node_modules/ajv/.tonic_example.js delete mode 100644 node_modules/ajv/LICENSE delete mode 100644 node_modules/ajv/README.md delete mode 100644 node_modules/ajv/dist/ajv.bundle.js delete mode 100644 node_modules/ajv/dist/ajv.min.js delete mode 100644 node_modules/ajv/dist/ajv.min.js.map delete mode 100644 node_modules/ajv/lib/ajv.d.ts delete mode 100644 node_modules/ajv/lib/ajv.js delete mode 100644 node_modules/ajv/lib/cache.js delete mode 100644 node_modules/ajv/lib/compile/async.js delete mode 100644 node_modules/ajv/lib/compile/equal.js delete mode 100644 node_modules/ajv/lib/compile/error_classes.js delete mode 100644 node_modules/ajv/lib/compile/formats.js delete mode 100644 node_modules/ajv/lib/compile/index.js delete mode 100644 node_modules/ajv/lib/compile/resolve.js delete mode 100644 node_modules/ajv/lib/compile/rules.js delete mode 100644 node_modules/ajv/lib/compile/schema_obj.js delete mode 100644 node_modules/ajv/lib/compile/ucs2length.js delete mode 100644 node_modules/ajv/lib/compile/util.js delete mode 100644 node_modules/ajv/lib/data.js delete mode 100644 node_modules/ajv/lib/definition_schema.js delete mode 100644 node_modules/ajv/lib/dot/_limit.jst delete mode 100644 node_modules/ajv/lib/dot/_limitItems.jst delete mode 100644 node_modules/ajv/lib/dot/_limitLength.jst delete mode 100644 node_modules/ajv/lib/dot/_limitProperties.jst delete mode 100644 node_modules/ajv/lib/dot/allOf.jst delete mode 100644 node_modules/ajv/lib/dot/anyOf.jst delete mode 100644 node_modules/ajv/lib/dot/coerce.def delete mode 100644 node_modules/ajv/lib/dot/comment.jst delete mode 100644 node_modules/ajv/lib/dot/const.jst delete mode 100644 node_modules/ajv/lib/dot/contains.jst delete mode 100644 node_modules/ajv/lib/dot/custom.jst delete mode 100644 node_modules/ajv/lib/dot/defaults.def delete mode 100644 node_modules/ajv/lib/dot/definitions.def delete mode 100644 node_modules/ajv/lib/dot/dependencies.jst delete mode 100644 node_modules/ajv/lib/dot/enum.jst delete mode 100644 node_modules/ajv/lib/dot/errors.def delete mode 100644 node_modules/ajv/lib/dot/format.jst delete mode 100644 node_modules/ajv/lib/dot/if.jst delete mode 100644 node_modules/ajv/lib/dot/items.jst delete mode 100644 node_modules/ajv/lib/dot/missing.def delete mode 100644 node_modules/ajv/lib/dot/multipleOf.jst delete mode 100644 node_modules/ajv/lib/dot/not.jst delete mode 100644 node_modules/ajv/lib/dot/oneOf.jst delete mode 100644 node_modules/ajv/lib/dot/pattern.jst delete mode 100644 node_modules/ajv/lib/dot/properties.jst delete mode 100644 node_modules/ajv/lib/dot/propertyNames.jst delete mode 100644 node_modules/ajv/lib/dot/ref.jst delete mode 100644 node_modules/ajv/lib/dot/required.jst delete mode 100644 node_modules/ajv/lib/dot/uniqueItems.jst delete mode 100644 node_modules/ajv/lib/dot/validate.jst delete mode 100644 node_modules/ajv/lib/dotjs/README.md delete mode 100644 node_modules/ajv/lib/dotjs/_limit.js delete mode 100644 node_modules/ajv/lib/dotjs/_limitItems.js delete mode 100644 node_modules/ajv/lib/dotjs/_limitLength.js delete mode 100644 node_modules/ajv/lib/dotjs/_limitProperties.js delete mode 100644 node_modules/ajv/lib/dotjs/allOf.js delete mode 100644 node_modules/ajv/lib/dotjs/anyOf.js delete mode 100644 node_modules/ajv/lib/dotjs/comment.js delete mode 100644 node_modules/ajv/lib/dotjs/const.js delete mode 100644 node_modules/ajv/lib/dotjs/contains.js delete mode 100644 node_modules/ajv/lib/dotjs/custom.js delete mode 100644 node_modules/ajv/lib/dotjs/dependencies.js delete mode 100644 node_modules/ajv/lib/dotjs/enum.js delete mode 100644 node_modules/ajv/lib/dotjs/format.js delete mode 100644 node_modules/ajv/lib/dotjs/if.js delete mode 100644 node_modules/ajv/lib/dotjs/index.js delete mode 100644 node_modules/ajv/lib/dotjs/items.js delete mode 100644 node_modules/ajv/lib/dotjs/multipleOf.js delete mode 100644 node_modules/ajv/lib/dotjs/not.js delete mode 100644 node_modules/ajv/lib/dotjs/oneOf.js delete mode 100644 node_modules/ajv/lib/dotjs/pattern.js delete mode 100644 node_modules/ajv/lib/dotjs/properties.js delete mode 100644 node_modules/ajv/lib/dotjs/propertyNames.js delete mode 100644 node_modules/ajv/lib/dotjs/ref.js delete mode 100644 node_modules/ajv/lib/dotjs/required.js delete mode 100644 node_modules/ajv/lib/dotjs/uniqueItems.js delete mode 100644 node_modules/ajv/lib/dotjs/validate.js delete mode 100644 node_modules/ajv/lib/keyword.js delete mode 100644 node_modules/ajv/lib/refs/data.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-draft-04.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-draft-06.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-draft-07.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-secure.json delete mode 100644 node_modules/ajv/package.json delete mode 100644 node_modules/ajv/scripts/.eslintrc.yml delete mode 100644 node_modules/ajv/scripts/bundle.js delete mode 100644 node_modules/ajv/scripts/compile-dots.js delete mode 100644 node_modules/ajv/scripts/info delete mode 100644 node_modules/ajv/scripts/prepare-tests delete mode 100644 node_modules/ajv/scripts/publish-built-version delete mode 100644 node_modules/ajv/scripts/travis-gh-pages delete mode 100644 node_modules/animate.css/LICENSE delete mode 100644 node_modules/animate.css/README.md delete mode 100644 node_modules/animate.css/animate.compat.css delete mode 100644 node_modules/animate.css/animate.css delete mode 100644 node_modules/animate.css/animate.min.css delete mode 100644 node_modules/animate.css/package.json delete mode 100644 node_modules/animate.css/source/_base.css delete mode 100644 node_modules/animate.css/source/_vars.css delete mode 100644 node_modules/animate.css/source/animate.css delete mode 100644 node_modules/animate.css/source/attention_seekers/bounce.css delete mode 100644 node_modules/animate.css/source/attention_seekers/flash.css delete mode 100644 node_modules/animate.css/source/attention_seekers/headShake.css delete mode 100644 node_modules/animate.css/source/attention_seekers/heartBeat.css delete mode 100644 node_modules/animate.css/source/attention_seekers/jello.css delete mode 100644 node_modules/animate.css/source/attention_seekers/pulse.css delete mode 100644 node_modules/animate.css/source/attention_seekers/rubberBand.css delete mode 100644 node_modules/animate.css/source/attention_seekers/shake.css delete mode 100644 node_modules/animate.css/source/attention_seekers/shakeX.css delete mode 100644 node_modules/animate.css/source/attention_seekers/shakeY.css delete mode 100644 node_modules/animate.css/source/attention_seekers/swing.css delete mode 100644 node_modules/animate.css/source/attention_seekers/tada.css delete mode 100644 node_modules/animate.css/source/attention_seekers/wobble.css delete mode 100644 node_modules/animate.css/source/back_entrances/backInDown.css delete mode 100644 node_modules/animate.css/source/back_entrances/backInLeft.css delete mode 100644 node_modules/animate.css/source/back_entrances/backInRight.css delete mode 100644 node_modules/animate.css/source/back_entrances/backInUp.css delete mode 100644 node_modules/animate.css/source/back_exits/backOutDown.css delete mode 100644 node_modules/animate.css/source/back_exits/backOutLeft.css delete mode 100644 node_modules/animate.css/source/back_exits/backOutRight.css delete mode 100644 node_modules/animate.css/source/back_exits/backOutUp.css delete mode 100644 node_modules/animate.css/source/bouncing_entrances/bounceIn.css delete mode 100644 node_modules/animate.css/source/bouncing_entrances/bounceInDown.css delete mode 100644 node_modules/animate.css/source/bouncing_entrances/bounceInLeft.css delete mode 100644 node_modules/animate.css/source/bouncing_entrances/bounceInRight.css delete mode 100644 node_modules/animate.css/source/bouncing_entrances/bounceInUp.css delete mode 100644 node_modules/animate.css/source/bouncing_exits/bounceOut.css delete mode 100644 node_modules/animate.css/source/bouncing_exits/bounceOutDown.css delete mode 100644 node_modules/animate.css/source/bouncing_exits/bounceOutLeft.css delete mode 100644 node_modules/animate.css/source/bouncing_exits/bounceOutRight.css delete mode 100644 node_modules/animate.css/source/bouncing_exits/bounceOutUp.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeIn.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInBottomLeft.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInBottomRight.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInDown.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInDownBig.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInLeft.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInLeftBig.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInRight.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInRightBig.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInTopLeft.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInTopRight.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInUp.css delete mode 100644 node_modules/animate.css/source/fading_entrances/fadeInUpBig.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOut.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutBottomLeft.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutBottomRight.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutDown.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutDownBig.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutLeft.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutLeftBig.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutRight.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutRightBig.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutTopLeft.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutTopRight.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutUp.css delete mode 100644 node_modules/animate.css/source/fading_exits/fadeOutUpBig.css delete mode 100644 node_modules/animate.css/source/flippers/flip.css delete mode 100644 node_modules/animate.css/source/flippers/flipInX.css delete mode 100644 node_modules/animate.css/source/flippers/flipInY.css delete mode 100644 node_modules/animate.css/source/flippers/flipOutX.css delete mode 100644 node_modules/animate.css/source/flippers/flipOutY.css delete mode 100644 node_modules/animate.css/source/lightspeed/lightSpeedInLeft.css delete mode 100644 node_modules/animate.css/source/lightspeed/lightSpeedInRight.css delete mode 100644 node_modules/animate.css/source/lightspeed/lightSpeedOutLeft.css delete mode 100644 node_modules/animate.css/source/lightspeed/lightSpeedOutRight.css delete mode 100644 node_modules/animate.css/source/rotating_entrances/rotateIn.css delete mode 100644 node_modules/animate.css/source/rotating_entrances/rotateInDownLeft.css delete mode 100644 node_modules/animate.css/source/rotating_entrances/rotateInDownRight.css delete mode 100644 node_modules/animate.css/source/rotating_entrances/rotateInUpLeft.css delete mode 100644 node_modules/animate.css/source/rotating_entrances/rotateInUpRight.css delete mode 100644 node_modules/animate.css/source/rotating_exits/rotateOut.css delete mode 100644 node_modules/animate.css/source/rotating_exits/rotateOutDownLeft.css delete mode 100644 node_modules/animate.css/source/rotating_exits/rotateOutDownRight.css delete mode 100644 node_modules/animate.css/source/rotating_exits/rotateOutUpLeft.css delete mode 100644 node_modules/animate.css/source/rotating_exits/rotateOutUpRight.css delete mode 100644 node_modules/animate.css/source/sliding_entrances/slideInDown.css delete mode 100644 node_modules/animate.css/source/sliding_entrances/slideInLeft.css delete mode 100644 node_modules/animate.css/source/sliding_entrances/slideInRight.css delete mode 100644 node_modules/animate.css/source/sliding_entrances/slideInUp.css delete mode 100644 node_modules/animate.css/source/sliding_exits/slideOutDown.css delete mode 100644 node_modules/animate.css/source/sliding_exits/slideOutLeft.css delete mode 100644 node_modules/animate.css/source/sliding_exits/slideOutRight.css delete mode 100644 node_modules/animate.css/source/sliding_exits/slideOutUp.css delete mode 100644 node_modules/animate.css/source/specials/hinge.css delete mode 100644 node_modules/animate.css/source/specials/jackInTheBox.css delete mode 100644 node_modules/animate.css/source/specials/rollIn.css delete mode 100644 node_modules/animate.css/source/specials/rollOut.css delete mode 100644 node_modules/animate.css/source/zooming_entrances/zoomIn.css delete mode 100644 node_modules/animate.css/source/zooming_entrances/zoomInDown.css delete mode 100644 node_modules/animate.css/source/zooming_entrances/zoomInLeft.css delete mode 100644 node_modules/animate.css/source/zooming_entrances/zoomInRight.css delete mode 100644 node_modules/animate.css/source/zooming_entrances/zoomInUp.css delete mode 100644 node_modules/animate.css/source/zooming_exits/zoomOut.css delete mode 100644 node_modules/animate.css/source/zooming_exits/zoomOutDown.css delete mode 100644 node_modules/animate.css/source/zooming_exits/zoomOutLeft.css delete mode 100644 node_modules/animate.css/source/zooming_exits/zoomOutRight.css delete mode 100644 node_modules/animate.css/source/zooming_exits/zoomOutUp.css delete mode 100644 node_modules/arg/LICENSE.md delete mode 100644 node_modules/arg/README.md delete mode 100644 node_modules/arg/index.d.ts delete mode 100644 node_modules/arg/index.js delete mode 100644 node_modules/arg/package.json delete mode 100644 node_modules/bootstrap-icons/LICENSE delete mode 100644 node_modules/bootstrap-icons/README.md delete mode 100644 node_modules/bootstrap-icons/bootstrap-icons.svg delete mode 100644 node_modules/bootstrap-icons/font/bootstrap-icons.css delete mode 100644 node_modules/bootstrap-icons/font/bootstrap-icons.json delete mode 100644 node_modules/bootstrap-icons/font/bootstrap-icons.min.css delete mode 100644 node_modules/bootstrap-icons/font/bootstrap-icons.scss delete mode 100644 node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff delete mode 100644 node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2 delete mode 100644 node_modules/bootstrap-icons/icons/0-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/0-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/0-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/0-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/1-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/1-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/1-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/1-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/123.svg delete mode 100644 node_modules/bootstrap-icons/icons/2-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/2-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/2-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/2-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/3-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/3-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/3-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/3-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/4-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/4-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/4-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/4-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/5-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/5-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/5-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/5-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/6-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/6-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/6-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/6-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/7-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/7-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/7-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/7-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/8-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/8-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/8-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/8-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/9-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/9-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/9-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/9-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/activity.svg delete mode 100644 node_modules/bootstrap-icons/icons/airplane-engines-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/airplane-engines.svg delete mode 100644 node_modules/bootstrap-icons/icons/airplane-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/airplane.svg delete mode 100644 node_modules/bootstrap-icons/icons/alarm-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/alarm.svg delete mode 100644 node_modules/bootstrap-icons/icons/alexa.svg delete mode 100644 node_modules/bootstrap-icons/icons/align-bottom.svg delete mode 100644 node_modules/bootstrap-icons/icons/align-center.svg delete mode 100644 node_modules/bootstrap-icons/icons/align-end.svg delete mode 100644 node_modules/bootstrap-icons/icons/align-middle.svg delete mode 100644 node_modules/bootstrap-icons/icons/align-start.svg delete mode 100644 node_modules/bootstrap-icons/icons/align-top.svg delete mode 100644 node_modules/bootstrap-icons/icons/alipay.svg delete mode 100644 node_modules/bootstrap-icons/icons/alphabet-uppercase.svg delete mode 100644 node_modules/bootstrap-icons/icons/alphabet.svg delete mode 100644 node_modules/bootstrap-icons/icons/alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/amazon.svg delete mode 100644 node_modules/bootstrap-icons/icons/amd.svg delete mode 100644 node_modules/bootstrap-icons/icons/android.svg delete mode 100644 node_modules/bootstrap-icons/icons/android2.svg delete mode 100644 node_modules/bootstrap-icons/icons/app-indicator.svg delete mode 100644 node_modules/bootstrap-icons/icons/app.svg delete mode 100644 node_modules/bootstrap-icons/icons/apple.svg delete mode 100644 node_modules/bootstrap-icons/icons/archive-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/archive.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-90deg-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-90deg-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-90deg-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-90deg-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-bar-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-bar-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-bar-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-bar-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-clockwise.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-counterclockwise.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-left-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-left-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-left-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-left-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-right-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-right-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-right-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-right-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-short.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left-short.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-repeat.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-return-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-return-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-right-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-right-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-right-short.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-right-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-right-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-through-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-through-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-left-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-left-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-left-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-left-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-right-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-right-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-right-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-right-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-short.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-angle-contract.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-angle-expand.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-collapse-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-collapse.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-expand-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-expand.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-fullscreen.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-move.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/arrows.svg delete mode 100644 node_modules/bootstrap-icons/icons/aspect-ratio-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/aspect-ratio.svg delete mode 100644 node_modules/bootstrap-icons/icons/asterisk.svg delete mode 100644 node_modules/bootstrap-icons/icons/at.svg delete mode 100644 node_modules/bootstrap-icons/icons/award-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/award.svg delete mode 100644 node_modules/bootstrap-icons/icons/back.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack2.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack3.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack4-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/backpack4.svg delete mode 100644 node_modules/bootstrap-icons/icons/backspace-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/backspace-reverse-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/backspace-reverse.svg delete mode 100644 node_modules/bootstrap-icons/icons/backspace.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-3d-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-3d.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-4k-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-4k.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-8k-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-8k.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-ad-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-ad.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-ar-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-ar.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-cc-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-cc.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-hd-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-hd.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-sd-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-sd.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-tm-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-tm.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-vo-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-vo.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-vr-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-vr.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-wc-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/badge-wc.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/bag.svg delete mode 100644 node_modules/bootstrap-icons/icons/balloon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/balloon-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/balloon-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/balloon.svg delete mode 100644 node_modules/bootstrap-icons/icons/ban-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ban.svg delete mode 100644 node_modules/bootstrap-icons/icons/bandaid-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bandaid.svg delete mode 100644 node_modules/bootstrap-icons/icons/bank.svg delete mode 100644 node_modules/bootstrap-icons/icons/bank2.svg delete mode 100644 node_modules/bootstrap-icons/icons/bar-chart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bar-chart-line-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bar-chart-line.svg delete mode 100644 node_modules/bootstrap-icons/icons/bar-chart-steps.svg delete mode 100644 node_modules/bootstrap-icons/icons/bar-chart.svg delete mode 100644 node_modules/bootstrap-icons/icons/basket-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/basket.svg delete mode 100644 node_modules/bootstrap-icons/icons/basket2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/basket2.svg delete mode 100644 node_modules/bootstrap-icons/icons/basket3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/basket3.svg delete mode 100644 node_modules/bootstrap-icons/icons/battery-charging.svg delete mode 100644 node_modules/bootstrap-icons/icons/battery-full.svg delete mode 100644 node_modules/bootstrap-icons/icons/battery-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/battery.svg delete mode 100644 node_modules/bootstrap-icons/icons/behance.svg delete mode 100644 node_modules/bootstrap-icons/icons/bell-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bell-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bell-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/bell.svg delete mode 100644 node_modules/bootstrap-icons/icons/bezier.svg delete mode 100644 node_modules/bootstrap-icons/icons/bezier2.svg delete mode 100644 node_modules/bootstrap-icons/icons/bicycle.svg delete mode 100644 node_modules/bootstrap-icons/icons/bing.svg delete mode 100644 node_modules/bootstrap-icons/icons/binoculars-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/binoculars.svg delete mode 100644 node_modules/bootstrap-icons/icons/blockquote-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/blockquote-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/bluetooth.svg delete mode 100644 node_modules/bootstrap-icons/icons/body-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/book-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/book-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/book.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-star-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-star.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmark.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmarks-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookmarks.svg delete mode 100644 node_modules/bootstrap-icons/icons/bookshelf.svg delete mode 100644 node_modules/bootstrap-icons/icons/boombox-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/boombox.svg delete mode 100644 node_modules/bootstrap-icons/icons/bootstrap-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bootstrap-reboot.svg delete mode 100644 node_modules/bootstrap-icons/icons/bootstrap.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-all.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-bottom.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-center.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-inner.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-middle.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-outer.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-style.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-top.svg delete mode 100644 node_modules/bootstrap-icons/icons/border-width.svg delete mode 100644 node_modules/bootstrap-icons/icons/border.svg delete mode 100644 node_modules/bootstrap-icons/icons/bounding-box-circles.svg delete mode 100644 node_modules/bootstrap-icons/icons/bounding-box.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-down-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-down-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-down-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-down-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-up-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-up-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-in-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-up-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-up-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-seam-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/box-seam.svg delete mode 100644 node_modules/bootstrap-icons/icons/box.svg delete mode 100644 node_modules/bootstrap-icons/icons/box2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/box2-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/box2-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/box2.svg delete mode 100644 node_modules/bootstrap-icons/icons/boxes.svg delete mode 100644 node_modules/bootstrap-icons/icons/braces-asterisk.svg delete mode 100644 node_modules/bootstrap-icons/icons/braces.svg delete mode 100644 node_modules/bootstrap-icons/icons/bricks.svg delete mode 100644 node_modules/bootstrap-icons/icons/briefcase-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/briefcase.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-alt-high-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-alt-high.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-alt-low-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-alt-low.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-high-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-high.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-low-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/brightness-low.svg delete mode 100644 node_modules/bootstrap-icons/icons/brilliance.svg delete mode 100644 node_modules/bootstrap-icons/icons/broadcast-pin.svg delete mode 100644 node_modules/bootstrap-icons/icons/broadcast.svg delete mode 100644 node_modules/bootstrap-icons/icons/browser-chrome.svg delete mode 100644 node_modules/bootstrap-icons/icons/browser-edge.svg delete mode 100644 node_modules/bootstrap-icons/icons/browser-firefox.svg delete mode 100644 node_modules/bootstrap-icons/icons/browser-safari.svg delete mode 100644 node_modules/bootstrap-icons/icons/brush-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/brush.svg delete mode 100644 node_modules/bootstrap-icons/icons/bucket-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bucket.svg delete mode 100644 node_modules/bootstrap-icons/icons/bug-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bug.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/building-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/building.svg delete mode 100644 node_modules/bootstrap-icons/icons/buildings-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/buildings.svg delete mode 100644 node_modules/bootstrap-icons/icons/bullseye.svg delete mode 100644 node_modules/bootstrap-icons/icons/bus-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/bus-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/c-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/c-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/c-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/c-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/cake-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cake.svg delete mode 100644 node_modules/bootstrap-icons/icons/cake2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cake2.svg delete mode 100644 node_modules/bootstrap-icons/icons/calculator-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calculator.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-date-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-date.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-day-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-day.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-event-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-event.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-month-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-month.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-range-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-range.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-week-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-week.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-date-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-date.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-day-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-day.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-event-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-event.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-month-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-month.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-range-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-range.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-week-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-week.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar2.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-event-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-event.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-range-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-range.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-week-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3-week.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar3.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar4-event.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar4-range.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar4-week.svg delete mode 100644 node_modules/bootstrap-icons/icons/calendar4.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-reels-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-reels.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-video-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-video-off-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-video-off.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera-video.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera.svg delete mode 100644 node_modules/bootstrap-icons/icons/camera2.svg delete mode 100644 node_modules/bootstrap-icons/icons/capslock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/capslock.svg delete mode 100644 node_modules/bootstrap-icons/icons/capsule-pill.svg delete mode 100644 node_modules/bootstrap-icons/icons/capsule.svg delete mode 100644 node_modules/bootstrap-icons/icons/car-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/car-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/card-checklist.svg delete mode 100644 node_modules/bootstrap-icons/icons/card-heading.svg delete mode 100644 node_modules/bootstrap-icons/icons/card-image.svg delete mode 100644 node_modules/bootstrap-icons/icons/card-list.svg delete mode 100644 node_modules/bootstrap-icons/icons/card-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-down-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-down-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-left-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-left-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-left-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-right-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-right-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-right-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-up-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-up-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/caret-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart2.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart3.svg delete mode 100644 node_modules/bootstrap-icons/icons/cart4.svg delete mode 100644 node_modules/bootstrap-icons/icons/cash-coin.svg delete mode 100644 node_modules/bootstrap-icons/icons/cash-stack.svg delete mode 100644 node_modules/bootstrap-icons/icons/cash.svg delete mode 100644 node_modules/bootstrap-icons/icons/cassette-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cassette.svg delete mode 100644 node_modules/bootstrap-icons/icons/cast.svg delete mode 100644 node_modules/bootstrap-icons/icons/cc-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cc-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/cc-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cc-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-dots-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-dots.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-dots-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-dots.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-quote-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-quote.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-text-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-quote-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-quote.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-dots-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-dots.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-quote-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-quote.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-text-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-dots-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-dots.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-quote-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-quote.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-text-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-text-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/chat.svg delete mode 100644 node_modules/bootstrap-icons/icons/check-all.svg delete mode 100644 node_modules/bootstrap-icons/icons/check-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/check-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/check-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/check-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/check-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/check.svg delete mode 100644 node_modules/bootstrap-icons/icons/check2-all.svg delete mode 100644 node_modules/bootstrap-icons/icons/check2-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/check2-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/check2.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-bar-contract.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-bar-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-bar-expand.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-bar-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-bar-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-bar-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-compact-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-compact-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-compact-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-compact-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-contract.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-double-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-double-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-double-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-double-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-expand.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/chevron-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/circle-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/circle-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-data-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-data.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-pulse.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-data-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-data.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-pulse-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-pulse.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/clipboard2.svg delete mode 100644 node_modules/bootstrap-icons/icons/clock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clock-history.svg delete mode 100644 node_modules/bootstrap-icons/icons/clock.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-arrow-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-arrow-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-download-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-download.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-drizzle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-drizzle.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-fog-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-fog.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-fog2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-fog2.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-hail-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-hail.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-haze-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-haze.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-haze2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-haze2.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-lightning-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-lightning-rain-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-lightning-rain.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-lightning.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-moon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-moon.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-rain-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-rain-heavy-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-rain-heavy.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-rain.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-sleet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-sleet.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-snow-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-snow.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-sun-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-sun.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-upload-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud-upload.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloud.svg delete mode 100644 node_modules/bootstrap-icons/icons/clouds-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/clouds.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloudy-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cloudy.svg delete mode 100644 node_modules/bootstrap-icons/icons/code-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/code-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/code.svg delete mode 100644 node_modules/bootstrap-icons/icons/coin.svg delete mode 100644 node_modules/bootstrap-icons/icons/collection-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/collection-play-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/collection-play.svg delete mode 100644 node_modules/bootstrap-icons/icons/collection.svg delete mode 100644 node_modules/bootstrap-icons/icons/columns-gap.svg delete mode 100644 node_modules/bootstrap-icons/icons/columns.svg delete mode 100644 node_modules/bootstrap-icons/icons/command.svg delete mode 100644 node_modules/bootstrap-icons/icons/compass-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/compass.svg delete mode 100644 node_modules/bootstrap-icons/icons/cone-striped.svg delete mode 100644 node_modules/bootstrap-icons/icons/cone.svg delete mode 100644 node_modules/bootstrap-icons/icons/controller.svg delete mode 100644 node_modules/bootstrap-icons/icons/cookie.svg delete mode 100644 node_modules/bootstrap-icons/icons/copy.svg delete mode 100644 node_modules/bootstrap-icons/icons/cpu-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cpu.svg delete mode 100644 node_modules/bootstrap-icons/icons/credit-card-2-back-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/credit-card-2-back.svg delete mode 100644 node_modules/bootstrap-icons/icons/credit-card-2-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/credit-card-2-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/credit-card-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/credit-card.svg delete mode 100644 node_modules/bootstrap-icons/icons/crop.svg delete mode 100644 node_modules/bootstrap-icons/icons/crosshair.svg delete mode 100644 node_modules/bootstrap-icons/icons/crosshair2.svg delete mode 100644 node_modules/bootstrap-icons/icons/cup-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cup-hot-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cup-hot.svg delete mode 100644 node_modules/bootstrap-icons/icons/cup-straw.svg delete mode 100644 node_modules/bootstrap-icons/icons/cup.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-bitcoin.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-dollar.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-euro.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-exchange.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-pound.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-rupee.svg delete mode 100644 node_modules/bootstrap-icons/icons/currency-yen.svg delete mode 100644 node_modules/bootstrap-icons/icons/cursor-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/cursor-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/cursor.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-circle-dotted.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-square-dotted.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/database-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/database.svg delete mode 100644 node_modules/bootstrap-icons/icons/device-hdd-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/device-hdd.svg delete mode 100644 node_modules/bootstrap-icons/icons/device-ssd-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/device-ssd.svg delete mode 100644 node_modules/bootstrap-icons/icons/diagram-2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/diagram-2.svg delete mode 100644 node_modules/bootstrap-icons/icons/diagram-3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/diagram-3.svg delete mode 100644 node_modules/bootstrap-icons/icons/diamond-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/diamond-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/diamond.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-1-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-1.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-2.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-3.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-4-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-4.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-5-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-5.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-6-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dice-6.svg delete mode 100644 node_modules/bootstrap-icons/icons/disc-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/disc.svg delete mode 100644 node_modules/bootstrap-icons/icons/discord.svg delete mode 100644 node_modules/bootstrap-icons/icons/display-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/display.svg delete mode 100644 node_modules/bootstrap-icons/icons/displayport-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/displayport.svg delete mode 100644 node_modules/bootstrap-icons/icons/distribute-horizontal.svg delete mode 100644 node_modules/bootstrap-icons/icons/distribute-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/door-closed-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/door-closed.svg delete mode 100644 node_modules/bootstrap-icons/icons/door-open-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/door-open.svg delete mode 100644 node_modules/bootstrap-icons/icons/dot.svg delete mode 100644 node_modules/bootstrap-icons/icons/download.svg delete mode 100644 node_modules/bootstrap-icons/icons/dpad-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/dpad.svg delete mode 100644 node_modules/bootstrap-icons/icons/dribbble.svg delete mode 100644 node_modules/bootstrap-icons/icons/dropbox.svg delete mode 100644 node_modules/bootstrap-icons/icons/droplet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/droplet-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/droplet.svg delete mode 100644 node_modules/bootstrap-icons/icons/duffle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/duffle.svg delete mode 100644 node_modules/bootstrap-icons/icons/ear-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ear.svg delete mode 100644 node_modules/bootstrap-icons/icons/earbuds.svg delete mode 100644 node_modules/bootstrap-icons/icons/easel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/easel.svg delete mode 100644 node_modules/bootstrap-icons/icons/easel2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/easel2.svg delete mode 100644 node_modules/bootstrap-icons/icons/easel3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/easel3.svg delete mode 100644 node_modules/bootstrap-icons/icons/egg-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/egg-fried.svg delete mode 100644 node_modules/bootstrap-icons/icons/egg.svg delete mode 100644 node_modules/bootstrap-icons/icons/eject-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/eject.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-angry-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-angry.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-astonished-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-astonished.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-dizzy-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-dizzy.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-expressionless-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-expressionless.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-frown-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-frown.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-grimace-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-grimace.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-grin-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-grin.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-heart-eyes-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-heart-eyes.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-kiss-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-kiss.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-laughing-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-laughing.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-neutral-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-neutral.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-smile-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-smile-upside-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-smile-upside-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-smile.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-sunglasses-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-sunglasses.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-surprise-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-surprise.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-tear-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-tear.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-wink-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/emoji-wink.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-arrow-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-arrow-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-at-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-at.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-exclamation-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-open-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-open-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-open-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-open.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-paper-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-paper-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-paper-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-paper.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/envelope.svg delete mode 100644 node_modules/bootstrap-icons/icons/eraser-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/eraser.svg delete mode 100644 node_modules/bootstrap-icons/icons/escape.svg delete mode 100644 node_modules/bootstrap-icons/icons/ethernet.svg delete mode 100644 node_modules/bootstrap-icons/icons/ev-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ev-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/ev-station-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ev-station.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-diamond-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-diamond.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-octagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-octagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-triangle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation-triangle.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/exclude.svg delete mode 100644 node_modules/bootstrap-icons/icons/explicit-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/explicit.svg delete mode 100644 node_modules/bootstrap-icons/icons/exposure.svg delete mode 100644 node_modules/bootstrap-icons/icons/eye-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/eye-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/eye-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/eye.svg delete mode 100644 node_modules/bootstrap-icons/icons/eyedropper.svg delete mode 100644 node_modules/bootstrap-icons/icons/eyeglasses.svg delete mode 100644 node_modules/bootstrap-icons/icons/facebook.svg delete mode 100644 node_modules/bootstrap-icons/icons/fan.svg delete mode 100644 node_modules/bootstrap-icons/icons/fast-forward-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/fast-forward-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/fast-forward-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/fast-forward-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/fast-forward-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/fast-forward.svg delete mode 100644 node_modules/bootstrap-icons/icons/feather.svg delete mode 100644 node_modules/bootstrap-icons/icons/feather2.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-arrow-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-arrow-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-bar-graph-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-bar-graph.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-binary-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-binary.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-break-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-break.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-code-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-code.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-diff-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-diff.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-arrow-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-arrow-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-bar-graph-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-bar-graph.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-binary-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-binary.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-break-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-break.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-code-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-code.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-diff-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-diff.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-easel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-easel.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-excel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-excel.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-font-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-font.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-image-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-image.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-lock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-lock2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-lock2.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-medical-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-medical.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-music-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-music.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-pdf-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-pdf.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-person-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-person.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-play-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-play.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-post-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-post.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-ppt-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-ppt.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-richtext-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-richtext.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-ruled-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-ruled.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-slides-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-slides.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-spreadsheet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-spreadsheet.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-text-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-word-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-word.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-zip-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark-zip.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-earmark.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-easel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-easel.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-excel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-excel.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-font-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-font.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-image-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-image.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-lock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-lock2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-lock2.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-medical-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-medical.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-music-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-music.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-pdf-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-pdf.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-person-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-person.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-play-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-play.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-post-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-post.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-ppt-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-ppt.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-richtext-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-richtext.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-ruled-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-ruled.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-slides-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-slides.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-spreadsheet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-spreadsheet.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-text-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-word-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-word.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-zip-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/file-zip.svg delete mode 100644 node_modules/bootstrap-icons/icons/file.svg delete mode 100644 node_modules/bootstrap-icons/icons/files-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/files.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-aac.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-ai.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-bmp.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-cs.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-css.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-csv.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-doc.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-docx.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-exe.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-gif.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-heic.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-html.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-java.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-jpg.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-js.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-json.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-jsx.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-key.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-m4p.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-md.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-mdx.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-mov.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-mp3.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-mp4.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-otf.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-pdf.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-php.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-png.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-ppt.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-pptx.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-psd.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-py.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-raw.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-rb.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-sass.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-scss.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-sh.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-sql.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-svg.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-tiff.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-tsx.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-ttf.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-txt.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-wav.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-woff.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-xls.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-xlsx.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-xml.svg delete mode 100644 node_modules/bootstrap-icons/icons/filetype-yml.svg delete mode 100644 node_modules/bootstrap-icons/icons/film.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/filter.svg delete mode 100644 node_modules/bootstrap-icons/icons/fingerprint.svg delete mode 100644 node_modules/bootstrap-icons/icons/fire.svg delete mode 100644 node_modules/bootstrap-icons/icons/flag-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/flag.svg delete mode 100644 node_modules/bootstrap-icons/icons/floppy-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/floppy.svg delete mode 100644 node_modules/bootstrap-icons/icons/floppy2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/floppy2.svg delete mode 100644 node_modules/bootstrap-icons/icons/flower1.svg delete mode 100644 node_modules/bootstrap-icons/icons/flower2.svg delete mode 100644 node_modules/bootstrap-icons/icons/flower3.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-symlink-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-symlink.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder2-open.svg delete mode 100644 node_modules/bootstrap-icons/icons/folder2.svg delete mode 100644 node_modules/bootstrap-icons/icons/fonts.svg delete mode 100644 node_modules/bootstrap-icons/icons/forward-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/forward.svg delete mode 100644 node_modules/bootstrap-icons/icons/front.svg delete mode 100644 node_modules/bootstrap-icons/icons/fuel-pump-diesel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/fuel-pump-diesel.svg delete mode 100644 node_modules/bootstrap-icons/icons/fuel-pump-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/fuel-pump.svg delete mode 100644 node_modules/bootstrap-icons/icons/fullscreen-exit.svg delete mode 100644 node_modules/bootstrap-icons/icons/fullscreen.svg delete mode 100644 node_modules/bootstrap-icons/icons/funnel-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/funnel.svg delete mode 100644 node_modules/bootstrap-icons/icons/gear-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/gear-wide-connected.svg delete mode 100644 node_modules/bootstrap-icons/icons/gear-wide.svg delete mode 100644 node_modules/bootstrap-icons/icons/gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/gem.svg delete mode 100644 node_modules/bootstrap-icons/icons/gender-ambiguous.svg delete mode 100644 node_modules/bootstrap-icons/icons/gender-female.svg delete mode 100644 node_modules/bootstrap-icons/icons/gender-male.svg delete mode 100644 node_modules/bootstrap-icons/icons/gender-neuter.svg delete mode 100644 node_modules/bootstrap-icons/icons/gender-trans.svg delete mode 100644 node_modules/bootstrap-icons/icons/geo-alt-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/geo-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/geo-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/geo.svg delete mode 100644 node_modules/bootstrap-icons/icons/gift-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/gift.svg delete mode 100644 node_modules/bootstrap-icons/icons/git.svg delete mode 100644 node_modules/bootstrap-icons/icons/github.svg delete mode 100644 node_modules/bootstrap-icons/icons/gitlab.svg delete mode 100644 node_modules/bootstrap-icons/icons/globe-americas.svg delete mode 100644 node_modules/bootstrap-icons/icons/globe-asia-australia.svg delete mode 100644 node_modules/bootstrap-icons/icons/globe-central-south-asia.svg delete mode 100644 node_modules/bootstrap-icons/icons/globe-europe-africa.svg delete mode 100644 node_modules/bootstrap-icons/icons/globe.svg delete mode 100644 node_modules/bootstrap-icons/icons/globe2.svg delete mode 100644 node_modules/bootstrap-icons/icons/google-play.svg delete mode 100644 node_modules/bootstrap-icons/icons/google.svg delete mode 100644 node_modules/bootstrap-icons/icons/gpu-card.svg delete mode 100644 node_modules/bootstrap-icons/icons/graph-down-arrow.svg delete mode 100644 node_modules/bootstrap-icons/icons/graph-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/graph-up-arrow.svg delete mode 100644 node_modules/bootstrap-icons/icons/graph-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-1x2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-1x2.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-3x2-gap-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-3x2-gap.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-3x2.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-3x3-gap-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-3x3-gap.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-3x3.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/grid.svg delete mode 100644 node_modules/bootstrap-icons/icons/grip-horizontal.svg delete mode 100644 node_modules/bootstrap-icons/icons/grip-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/h-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/h-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/h-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/h-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/hammer.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-index-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-index-thumb-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-index-thumb.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-index.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-thumbs-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-thumbs-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-thumbs-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hand-thumbs-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/handbag-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/handbag.svg delete mode 100644 node_modules/bootstrap-icons/icons/hash.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-network-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-network.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-rack-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-rack.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-stack-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd-stack.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdd.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdmi-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hdmi.svg delete mode 100644 node_modules/bootstrap-icons/icons/headphones.svg delete mode 100644 node_modules/bootstrap-icons/icons/headset-vr.svg delete mode 100644 node_modules/bootstrap-icons/icons/headset.svg delete mode 100644 node_modules/bootstrap-icons/icons/heart-arrow.svg delete mode 100644 node_modules/bootstrap-icons/icons/heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/heart-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/heart-pulse-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/heart-pulse.svg delete mode 100644 node_modules/bootstrap-icons/icons/heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/heartbreak-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/heartbreak.svg delete mode 100644 node_modules/bootstrap-icons/icons/hearts.svg delete mode 100644 node_modules/bootstrap-icons/icons/heptagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/heptagon-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/heptagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/hexagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hexagon-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/hexagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/highlighter.svg delete mode 100644 node_modules/bootstrap-icons/icons/highlights.svg delete mode 100644 node_modules/bootstrap-icons/icons/hospital-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/hospital.svg delete mode 100644 node_modules/bootstrap-icons/icons/hourglass-bottom.svg delete mode 100644 node_modules/bootstrap-icons/icons/hourglass-split.svg delete mode 100644 node_modules/bootstrap-icons/icons/hourglass-top.svg delete mode 100644 node_modules/bootstrap-icons/icons/hourglass.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-add-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-door-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-door.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-exclamation-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-gear-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-lock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/house-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/house.svg delete mode 100644 node_modules/bootstrap-icons/icons/houses-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/houses.svg delete mode 100644 node_modules/bootstrap-icons/icons/hr.svg delete mode 100644 node_modules/bootstrap-icons/icons/hurricane.svg delete mode 100644 node_modules/bootstrap-icons/icons/hypnotize.svg delete mode 100644 node_modules/bootstrap-icons/icons/image-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/image-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/image.svg delete mode 100644 node_modules/bootstrap-icons/icons/images.svg delete mode 100644 node_modules/bootstrap-icons/icons/inbox-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/inbox.svg delete mode 100644 node_modules/bootstrap-icons/icons/inboxes-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/inboxes.svg delete mode 100644 node_modules/bootstrap-icons/icons/incognito.svg delete mode 100644 node_modules/bootstrap-icons/icons/indent.svg delete mode 100644 node_modules/bootstrap-icons/icons/infinity.svg delete mode 100644 node_modules/bootstrap-icons/icons/info-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/info-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/info-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/info-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/info-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/info.svg delete mode 100644 node_modules/bootstrap-icons/icons/input-cursor-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/input-cursor.svg delete mode 100644 node_modules/bootstrap-icons/icons/instagram.svg delete mode 100644 node_modules/bootstrap-icons/icons/intersect.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-album.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-bookmark-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-bookmark.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-code.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-medical.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-richtext.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-text.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/journal.svg delete mode 100644 node_modules/bootstrap-icons/icons/journals.svg delete mode 100644 node_modules/bootstrap-icons/icons/joystick.svg delete mode 100644 node_modules/bootstrap-icons/icons/justify-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/justify-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/justify.svg delete mode 100644 node_modules/bootstrap-icons/icons/kanban-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/kanban.svg delete mode 100644 node_modules/bootstrap-icons/icons/key-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/key.svg delete mode 100644 node_modules/bootstrap-icons/icons/keyboard-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/keyboard.svg delete mode 100644 node_modules/bootstrap-icons/icons/ladder.svg delete mode 100644 node_modules/bootstrap-icons/icons/lamp-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lamp.svg delete mode 100644 node_modules/bootstrap-icons/icons/laptop-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/laptop.svg delete mode 100644 node_modules/bootstrap-icons/icons/layer-backward.svg delete mode 100644 node_modules/bootstrap-icons/icons/layer-forward.svg delete mode 100644 node_modules/bootstrap-icons/icons/layers-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/layers-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/layers.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-sidebar-inset-reverse.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-sidebar-inset.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-sidebar-reverse.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-sidebar.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-split.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-text-sidebar-reverse.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-text-sidebar.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-text-window-reverse.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-text-window.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-three-columns.svg delete mode 100644 node_modules/bootstrap-icons/icons/layout-wtf.svg delete mode 100644 node_modules/bootstrap-icons/icons/life-preserver.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightbulb-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightbulb-off-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightbulb-off.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightbulb.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightning-charge-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightning-charge.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightning-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lightning.svg delete mode 100644 node_modules/bootstrap-icons/icons/line.svg delete mode 100644 node_modules/bootstrap-icons/icons/link-45deg.svg delete mode 100644 node_modules/bootstrap-icons/icons/link.svg delete mode 100644 node_modules/bootstrap-icons/icons/linkedin.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-columns-reverse.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-columns.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-nested.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-ol.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-stars.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-task.svg delete mode 100644 node_modules/bootstrap-icons/icons/list-ul.svg delete mode 100644 node_modules/bootstrap-icons/icons/list.svg delete mode 100644 node_modules/bootstrap-icons/icons/lock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/luggage-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/luggage.svg delete mode 100644 node_modules/bootstrap-icons/icons/lungs-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/lungs.svg delete mode 100644 node_modules/bootstrap-icons/icons/magic.svg delete mode 100644 node_modules/bootstrap-icons/icons/magnet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/magnet.svg delete mode 100644 node_modules/bootstrap-icons/icons/mailbox-flag.svg delete mode 100644 node_modules/bootstrap-icons/icons/mailbox.svg delete mode 100644 node_modules/bootstrap-icons/icons/mailbox2-flag.svg delete mode 100644 node_modules/bootstrap-icons/icons/mailbox2.svg delete mode 100644 node_modules/bootstrap-icons/icons/map-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/map.svg delete mode 100644 node_modules/bootstrap-icons/icons/markdown-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/markdown.svg delete mode 100644 node_modules/bootstrap-icons/icons/marker-tip.svg delete mode 100644 node_modules/bootstrap-icons/icons/mask.svg delete mode 100644 node_modules/bootstrap-icons/icons/mastodon.svg delete mode 100644 node_modules/bootstrap-icons/icons/medium.svg delete mode 100644 node_modules/bootstrap-icons/icons/megaphone-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/megaphone.svg delete mode 100644 node_modules/bootstrap-icons/icons/memory.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-app-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-app.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-button-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-button-wide-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-button-wide.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-button.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/menu-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/messenger.svg delete mode 100644 node_modules/bootstrap-icons/icons/meta.svg delete mode 100644 node_modules/bootstrap-icons/icons/mic-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/mic-mute-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/mic-mute.svg delete mode 100644 node_modules/bootstrap-icons/icons/mic.svg delete mode 100644 node_modules/bootstrap-icons/icons/microsoft-teams.svg delete mode 100644 node_modules/bootstrap-icons/icons/microsoft.svg delete mode 100644 node_modules/bootstrap-icons/icons/minecart-loaded.svg delete mode 100644 node_modules/bootstrap-icons/icons/minecart.svg delete mode 100644 node_modules/bootstrap-icons/icons/modem-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/modem.svg delete mode 100644 node_modules/bootstrap-icons/icons/moisture.svg delete mode 100644 node_modules/bootstrap-icons/icons/moon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/moon-stars-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/moon-stars.svg delete mode 100644 node_modules/bootstrap-icons/icons/moon.svg delete mode 100644 node_modules/bootstrap-icons/icons/mortarboard-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/mortarboard.svg delete mode 100644 node_modules/bootstrap-icons/icons/motherboard-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/motherboard.svg delete mode 100644 node_modules/bootstrap-icons/icons/mouse-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/mouse.svg delete mode 100644 node_modules/bootstrap-icons/icons/mouse2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/mouse2.svg delete mode 100644 node_modules/bootstrap-icons/icons/mouse3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/mouse3.svg delete mode 100644 node_modules/bootstrap-icons/icons/music-note-beamed.svg delete mode 100644 node_modules/bootstrap-icons/icons/music-note-list.svg delete mode 100644 node_modules/bootstrap-icons/icons/music-note.svg delete mode 100644 node_modules/bootstrap-icons/icons/music-player-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/music-player.svg delete mode 100644 node_modules/bootstrap-icons/icons/newspaper.svg delete mode 100644 node_modules/bootstrap-icons/icons/nintendo-switch.svg delete mode 100644 node_modules/bootstrap-icons/icons/node-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/node-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/node-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/node-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/noise-reduction.svg delete mode 100644 node_modules/bootstrap-icons/icons/nut-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/nut.svg delete mode 100644 node_modules/bootstrap-icons/icons/nvidia.svg delete mode 100644 node_modules/bootstrap-icons/icons/nvme-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/nvme.svg delete mode 100644 node_modules/bootstrap-icons/icons/octagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/octagon-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/octagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/opencollective.svg delete mode 100644 node_modules/bootstrap-icons/icons/optical-audio-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/optical-audio.svg delete mode 100644 node_modules/bootstrap-icons/icons/option.svg delete mode 100644 node_modules/bootstrap-icons/icons/outlet.svg delete mode 100644 node_modules/bootstrap-icons/icons/p-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/p-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/p-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/p-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/paint-bucket.svg delete mode 100644 node_modules/bootstrap-icons/icons/palette-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/palette.svg delete mode 100644 node_modules/bootstrap-icons/icons/palette2.svg delete mode 100644 node_modules/bootstrap-icons/icons/paperclip.svg delete mode 100644 node_modules/bootstrap-icons/icons/paragraph.svg delete mode 100644 node_modules/bootstrap-icons/icons/pass-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pass.svg delete mode 100644 node_modules/bootstrap-icons/icons/passport-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/passport.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-exclamation-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-question-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/patch-question.svg delete mode 100644 node_modules/bootstrap-icons/icons/pause-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pause-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/pause-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pause-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/pause-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pause.svg delete mode 100644 node_modules/bootstrap-icons/icons/paypal.svg delete mode 100644 node_modules/bootstrap-icons/icons/pc-display-horizontal.svg delete mode 100644 node_modules/bootstrap-icons/icons/pc-display.svg delete mode 100644 node_modules/bootstrap-icons/icons/pc-horizontal.svg delete mode 100644 node_modules/bootstrap-icons/icons/pc.svg delete mode 100644 node_modules/bootstrap-icons/icons/pci-card-network.svg delete mode 100644 node_modules/bootstrap-icons/icons/pci-card-sound.svg delete mode 100644 node_modules/bootstrap-icons/icons/pci-card.svg delete mode 100644 node_modules/bootstrap-icons/icons/peace-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/peace.svg delete mode 100644 node_modules/bootstrap-icons/icons/pen-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pen.svg delete mode 100644 node_modules/bootstrap-icons/icons/pencil-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pencil-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/pencil.svg delete mode 100644 node_modules/bootstrap-icons/icons/pentagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pentagon-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/pentagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/people-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/people.svg delete mode 100644 node_modules/bootstrap-icons/icons/percent.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-arms-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-badge-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-badge.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-bounding-box.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-add.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-gear.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-hearts.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-lines-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-raised-hand.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-rolodex.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-standing-dress.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-standing.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-vcard-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-vcard.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-video.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-video2.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-video3.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-walking.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-wheelchair.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-workspace.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/person-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/person.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone-flip.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone-landscape-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone-landscape.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone-vibrate-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone-vibrate.svg delete mode 100644 node_modules/bootstrap-icons/icons/phone.svg delete mode 100644 node_modules/bootstrap-icons/icons/pie-chart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pie-chart.svg delete mode 100644 node_modules/bootstrap-icons/icons/piggy-bank-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/piggy-bank.svg delete mode 100644 node_modules/bootstrap-icons/icons/pin-angle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pin-angle.svg delete mode 100644 node_modules/bootstrap-icons/icons/pin-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pin-map-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pin-map.svg delete mode 100644 node_modules/bootstrap-icons/icons/pin.svg delete mode 100644 node_modules/bootstrap-icons/icons/pinterest.svg delete mode 100644 node_modules/bootstrap-icons/icons/pip-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/pip.svg delete mode 100644 node_modules/bootstrap-icons/icons/play-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/play-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/play-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/play-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/play-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/play.svg delete mode 100644 node_modules/bootstrap-icons/icons/playstation.svg delete mode 100644 node_modules/bootstrap-icons/icons/plug-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/plug.svg delete mode 100644 node_modules/bootstrap-icons/icons/plugin.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-circle-dotted.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-slash-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-square-dotted.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/postage-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/postage-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/postage-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/postage.svg delete mode 100644 node_modules/bootstrap-icons/icons/postcard-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/postcard-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/postcard-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/postcard.svg delete mode 100644 node_modules/bootstrap-icons/icons/power.svg delete mode 100644 node_modules/bootstrap-icons/icons/prescription.svg delete mode 100644 node_modules/bootstrap-icons/icons/prescription2.svg delete mode 100644 node_modules/bootstrap-icons/icons/printer-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/printer.svg delete mode 100644 node_modules/bootstrap-icons/icons/projector-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/projector.svg delete mode 100644 node_modules/bootstrap-icons/icons/puzzle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/puzzle.svg delete mode 100644 node_modules/bootstrap-icons/icons/qr-code-scan.svg delete mode 100644 node_modules/bootstrap-icons/icons/qr-code.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-diamond-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-diamond.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-octagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-octagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/question-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/question.svg delete mode 100644 node_modules/bootstrap-icons/icons/quora.svg delete mode 100644 node_modules/bootstrap-icons/icons/quote.svg delete mode 100644 node_modules/bootstrap-icons/icons/r-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/r-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/r-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/r-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/radar.svg delete mode 100644 node_modules/bootstrap-icons/icons/radioactive.svg delete mode 100644 node_modules/bootstrap-icons/icons/rainbow.svg delete mode 100644 node_modules/bootstrap-icons/icons/receipt-cutoff.svg delete mode 100644 node_modules/bootstrap-icons/icons/receipt.svg delete mode 100644 node_modules/bootstrap-icons/icons/reception-0.svg delete mode 100644 node_modules/bootstrap-icons/icons/reception-1.svg delete mode 100644 node_modules/bootstrap-icons/icons/reception-2.svg delete mode 100644 node_modules/bootstrap-icons/icons/reception-3.svg delete mode 100644 node_modules/bootstrap-icons/icons/reception-4.svg delete mode 100644 node_modules/bootstrap-icons/icons/record-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/record-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/record-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/record-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/record-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/record.svg delete mode 100644 node_modules/bootstrap-icons/icons/record2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/record2.svg delete mode 100644 node_modules/bootstrap-icons/icons/recycle.svg delete mode 100644 node_modules/bootstrap-icons/icons/reddit.svg delete mode 100644 node_modules/bootstrap-icons/icons/regex.svg delete mode 100644 node_modules/bootstrap-icons/icons/repeat-1.svg delete mode 100644 node_modules/bootstrap-icons/icons/repeat.svg delete mode 100644 node_modules/bootstrap-icons/icons/reply-all-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/reply-all.svg delete mode 100644 node_modules/bootstrap-icons/icons/reply-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/reply.svg delete mode 100644 node_modules/bootstrap-icons/icons/rewind-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/rewind-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/rewind-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/rewind-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/rewind-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/rewind.svg delete mode 100644 node_modules/bootstrap-icons/icons/robot.svg delete mode 100644 node_modules/bootstrap-icons/icons/rocket-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/rocket-takeoff-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/rocket-takeoff.svg delete mode 100644 node_modules/bootstrap-icons/icons/rocket.svg delete mode 100644 node_modules/bootstrap-icons/icons/router-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/router.svg delete mode 100644 node_modules/bootstrap-icons/icons/rss-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/rss.svg delete mode 100644 node_modules/bootstrap-icons/icons/rulers.svg delete mode 100644 node_modules/bootstrap-icons/icons/safe-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/safe.svg delete mode 100644 node_modules/bootstrap-icons/icons/safe2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/safe2.svg delete mode 100644 node_modules/bootstrap-icons/icons/save-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/save.svg delete mode 100644 node_modules/bootstrap-icons/icons/save2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/save2.svg delete mode 100644 node_modules/bootstrap-icons/icons/scissors.svg delete mode 100644 node_modules/bootstrap-icons/icons/scooter.svg delete mode 100644 node_modules/bootstrap-icons/icons/screwdriver.svg delete mode 100644 node_modules/bootstrap-icons/icons/sd-card-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sd-card.svg delete mode 100644 node_modules/bootstrap-icons/icons/search-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/search-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/search.svg delete mode 100644 node_modules/bootstrap-icons/icons/segmented-nav.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-arrow-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-arrow-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-arrow-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-arrow-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-check-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-dash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-exclamation-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/send-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/send.svg delete mode 100644 node_modules/bootstrap-icons/icons/server.svg delete mode 100644 node_modules/bootstrap-icons/icons/shadows.svg delete mode 100644 node_modules/bootstrap-icons/icons/share-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/share.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-fill-check.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-fill-exclamation.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-fill-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-fill-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-fill-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-lock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-lock.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-shaded.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/shield.svg delete mode 100644 node_modules/bootstrap-icons/icons/shift-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/shift.svg delete mode 100644 node_modules/bootstrap-icons/icons/shop-window.svg delete mode 100644 node_modules/bootstrap-icons/icons/shop.svg delete mode 100644 node_modules/bootstrap-icons/icons/shuffle.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-dead-end-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-dead-end.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-do-not-enter-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-do-not-enter.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-side-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-side.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-t-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-t.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-y-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection-y.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-intersection.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-merge-left-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-merge-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-merge-right-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-merge-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-no-left-turn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-no-left-turn.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-no-parking-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-no-parking.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-no-right-turn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-no-right-turn.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-railroad-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-railroad.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-stop-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-stop-lights-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-stop-lights.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-stop.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-left-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-right-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-slight-left-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-slight-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-slight-right-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-turn-slight-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-yield-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sign-yield.svg delete mode 100644 node_modules/bootstrap-icons/icons/signal.svg delete mode 100644 node_modules/bootstrap-icons/icons/signpost-2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/signpost-2.svg delete mode 100644 node_modules/bootstrap-icons/icons/signpost-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/signpost-split-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/signpost-split.svg delete mode 100644 node_modules/bootstrap-icons/icons/signpost.svg delete mode 100644 node_modules/bootstrap-icons/icons/sim-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sim-slash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sim-slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/sim.svg delete mode 100644 node_modules/bootstrap-icons/icons/sina-weibo.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-backward-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-backward-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-backward-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-backward-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-backward-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-backward.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-end-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-end-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-end-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-end-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-end-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-end.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-forward-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-forward-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-forward-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-forward-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-forward-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-forward.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-start-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-start-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-start-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-start-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-start-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/skip-start.svg delete mode 100644 node_modules/bootstrap-icons/icons/skype.svg delete mode 100644 node_modules/bootstrap-icons/icons/slack.svg delete mode 100644 node_modules/bootstrap-icons/icons/slash-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/slash-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/slash-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/slash-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/slash-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/slash.svg delete mode 100644 node_modules/bootstrap-icons/icons/sliders.svg delete mode 100644 node_modules/bootstrap-icons/icons/sliders2-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/sliders2.svg delete mode 100644 node_modules/bootstrap-icons/icons/smartwatch.svg delete mode 100644 node_modules/bootstrap-icons/icons/snapchat.svg delete mode 100644 node_modules/bootstrap-icons/icons/snow.svg delete mode 100644 node_modules/bootstrap-icons/icons/snow2.svg delete mode 100644 node_modules/bootstrap-icons/icons/snow3.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-alpha-down-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-alpha-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-alpha-up-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-alpha-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-down-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-numeric-down-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-numeric-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-numeric-up-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-numeric-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-up-alt.svg delete mode 100644 node_modules/bootstrap-icons/icons/sort-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/soundwave.svg delete mode 100644 node_modules/bootstrap-icons/icons/sourceforge.svg delete mode 100644 node_modules/bootstrap-icons/icons/speaker-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/speaker.svg delete mode 100644 node_modules/bootstrap-icons/icons/speedometer.svg delete mode 100644 node_modules/bootstrap-icons/icons/speedometer2.svg delete mode 100644 node_modules/bootstrap-icons/icons/spellcheck.svg delete mode 100644 node_modules/bootstrap-icons/icons/spotify.svg delete mode 100644 node_modules/bootstrap-icons/icons/square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/square-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/square.svg delete mode 100644 node_modules/bootstrap-icons/icons/stack-overflow.svg delete mode 100644 node_modules/bootstrap-icons/icons/stack.svg delete mode 100644 node_modules/bootstrap-icons/icons/star-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/star-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/star.svg delete mode 100644 node_modules/bootstrap-icons/icons/stars.svg delete mode 100644 node_modules/bootstrap-icons/icons/steam.svg delete mode 100644 node_modules/bootstrap-icons/icons/stickies-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/stickies.svg delete mode 100644 node_modules/bootstrap-icons/icons/sticky-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sticky.svg delete mode 100644 node_modules/bootstrap-icons/icons/stop-btn-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/stop-btn.svg delete mode 100644 node_modules/bootstrap-icons/icons/stop-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/stop-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/stop-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/stop.svg delete mode 100644 node_modules/bootstrap-icons/icons/stoplights-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/stoplights.svg delete mode 100644 node_modules/bootstrap-icons/icons/stopwatch-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/stopwatch.svg delete mode 100644 node_modules/bootstrap-icons/icons/strava.svg delete mode 100644 node_modules/bootstrap-icons/icons/stripe.svg delete mode 100644 node_modules/bootstrap-icons/icons/subscript.svg delete mode 100644 node_modules/bootstrap-icons/icons/substack.svg delete mode 100644 node_modules/bootstrap-icons/icons/subtract.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-club-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-club.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-diamond-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-diamond.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-heart-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-heart.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-spade-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suit-spade.svg delete mode 100644 node_modules/bootstrap-icons/icons/suitcase-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suitcase-lg-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suitcase-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/suitcase.svg delete mode 100644 node_modules/bootstrap-icons/icons/suitcase2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/suitcase2.svg delete mode 100644 node_modules/bootstrap-icons/icons/sun-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sun.svg delete mode 100644 node_modules/bootstrap-icons/icons/sunglasses.svg delete mode 100644 node_modules/bootstrap-icons/icons/sunrise-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sunrise.svg delete mode 100644 node_modules/bootstrap-icons/icons/sunset-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/sunset.svg delete mode 100644 node_modules/bootstrap-icons/icons/superscript.svg delete mode 100644 node_modules/bootstrap-icons/icons/symmetry-horizontal.svg delete mode 100644 node_modules/bootstrap-icons/icons/symmetry-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/table.svg delete mode 100644 node_modules/bootstrap-icons/icons/tablet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/tablet-landscape-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/tablet-landscape.svg delete mode 100644 node_modules/bootstrap-icons/icons/tablet.svg delete mode 100644 node_modules/bootstrap-icons/icons/tag-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/tag.svg delete mode 100644 node_modules/bootstrap-icons/icons/tags-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/tags.svg delete mode 100644 node_modules/bootstrap-icons/icons/taxi-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/taxi-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/telegram.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-forward-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-forward.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-inbound-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-inbound.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-minus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-minus.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-outbound-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-outbound.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-plus-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-x-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/telephone.svg delete mode 100644 node_modules/bootstrap-icons/icons/tencent-qq.svg delete mode 100644 node_modules/bootstrap-icons/icons/terminal-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/terminal-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/terminal-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/terminal-split.svg delete mode 100644 node_modules/bootstrap-icons/icons/terminal-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/terminal.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-center.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-indent-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-indent-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-left.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-paragraph.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-right.svg delete mode 100644 node_modules/bootstrap-icons/icons/text-wrap.svg delete mode 100644 node_modules/bootstrap-icons/icons/textarea-resize.svg delete mode 100644 node_modules/bootstrap-icons/icons/textarea-t.svg delete mode 100644 node_modules/bootstrap-icons/icons/textarea.svg delete mode 100644 node_modules/bootstrap-icons/icons/thermometer-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/thermometer-high.svg delete mode 100644 node_modules/bootstrap-icons/icons/thermometer-low.svg delete mode 100644 node_modules/bootstrap-icons/icons/thermometer-snow.svg delete mode 100644 node_modules/bootstrap-icons/icons/thermometer-sun.svg delete mode 100644 node_modules/bootstrap-icons/icons/thermometer.svg delete mode 100644 node_modules/bootstrap-icons/icons/threads-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/threads.svg delete mode 100644 node_modules/bootstrap-icons/icons/three-dots-vertical.svg delete mode 100644 node_modules/bootstrap-icons/icons/three-dots.svg delete mode 100644 node_modules/bootstrap-icons/icons/thunderbolt-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/thunderbolt.svg delete mode 100644 node_modules/bootstrap-icons/icons/ticket-detailed-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ticket-detailed.svg delete mode 100644 node_modules/bootstrap-icons/icons/ticket-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ticket-perforated-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/ticket-perforated.svg delete mode 100644 node_modules/bootstrap-icons/icons/ticket.svg delete mode 100644 node_modules/bootstrap-icons/icons/tiktok.svg delete mode 100644 node_modules/bootstrap-icons/icons/toggle-off.svg delete mode 100644 node_modules/bootstrap-icons/icons/toggle-on.svg delete mode 100644 node_modules/bootstrap-icons/icons/toggle2-off.svg delete mode 100644 node_modules/bootstrap-icons/icons/toggle2-on.svg delete mode 100644 node_modules/bootstrap-icons/icons/toggles.svg delete mode 100644 node_modules/bootstrap-icons/icons/toggles2.svg delete mode 100644 node_modules/bootstrap-icons/icons/tools.svg delete mode 100644 node_modules/bootstrap-icons/icons/tornado.svg delete mode 100644 node_modules/bootstrap-icons/icons/train-freight-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/train-freight-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/train-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/train-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/train-lightrail-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/train-lightrail-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/translate.svg delete mode 100644 node_modules/bootstrap-icons/icons/transparency.svg delete mode 100644 node_modules/bootstrap-icons/icons/trash-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/trash.svg delete mode 100644 node_modules/bootstrap-icons/icons/trash2-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/trash2.svg delete mode 100644 node_modules/bootstrap-icons/icons/trash3-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/trash3.svg delete mode 100644 node_modules/bootstrap-icons/icons/tree-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/tree.svg delete mode 100644 node_modules/bootstrap-icons/icons/trello.svg delete mode 100644 node_modules/bootstrap-icons/icons/triangle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/triangle-half.svg delete mode 100644 node_modules/bootstrap-icons/icons/triangle.svg delete mode 100644 node_modules/bootstrap-icons/icons/trophy-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/trophy.svg delete mode 100644 node_modules/bootstrap-icons/icons/tropical-storm.svg delete mode 100644 node_modules/bootstrap-icons/icons/truck-flatbed.svg delete mode 100644 node_modules/bootstrap-icons/icons/truck-front-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/truck-front.svg delete mode 100644 node_modules/bootstrap-icons/icons/truck.svg delete mode 100644 node_modules/bootstrap-icons/icons/tsunami.svg delete mode 100644 node_modules/bootstrap-icons/icons/tv-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/tv.svg delete mode 100644 node_modules/bootstrap-icons/icons/twitch.svg delete mode 100644 node_modules/bootstrap-icons/icons/twitter-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/twitter.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-bold.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-h1.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-h2.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-h3.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-h4.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-h5.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-h6.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-italic.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-strikethrough.svg delete mode 100644 node_modules/bootstrap-icons/icons/type-underline.svg delete mode 100644 node_modules/bootstrap-icons/icons/type.svg delete mode 100644 node_modules/bootstrap-icons/icons/ubuntu.svg delete mode 100644 node_modules/bootstrap-icons/icons/ui-checks-grid.svg delete mode 100644 node_modules/bootstrap-icons/icons/ui-checks.svg delete mode 100644 node_modules/bootstrap-icons/icons/ui-radios-grid.svg delete mode 100644 node_modules/bootstrap-icons/icons/ui-radios.svg delete mode 100644 node_modules/bootstrap-icons/icons/umbrella-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/umbrella.svg delete mode 100644 node_modules/bootstrap-icons/icons/unindent.svg delete mode 100644 node_modules/bootstrap-icons/icons/union.svg delete mode 100644 node_modules/bootstrap-icons/icons/unity.svg delete mode 100644 node_modules/bootstrap-icons/icons/universal-access-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/universal-access.svg delete mode 100644 node_modules/bootstrap-icons/icons/unlock-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/unlock.svg delete mode 100644 node_modules/bootstrap-icons/icons/upc-scan.svg delete mode 100644 node_modules/bootstrap-icons/icons/upc.svg delete mode 100644 node_modules/bootstrap-icons/icons/upload.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-c-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-c.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-drive-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-drive.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-micro-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-micro.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-mini-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-mini.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-plug-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-plug.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb-symbol.svg delete mode 100644 node_modules/bootstrap-icons/icons/usb.svg delete mode 100644 node_modules/bootstrap-icons/icons/valentine.svg delete mode 100644 node_modules/bootstrap-icons/icons/valentine2.svg delete mode 100644 node_modules/bootstrap-icons/icons/vector-pen.svg delete mode 100644 node_modules/bootstrap-icons/icons/view-list.svg delete mode 100644 node_modules/bootstrap-icons/icons/view-stacked.svg delete mode 100644 node_modules/bootstrap-icons/icons/vignette.svg delete mode 100644 node_modules/bootstrap-icons/icons/vimeo.svg delete mode 100644 node_modules/bootstrap-icons/icons/vinyl-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/vinyl.svg delete mode 100644 node_modules/bootstrap-icons/icons/virus.svg delete mode 100644 node_modules/bootstrap-icons/icons/virus2.svg delete mode 100644 node_modules/bootstrap-icons/icons/voicemail.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-down-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-down.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-mute-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-mute.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-off-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-off.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-up-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/volume-up.svg delete mode 100644 node_modules/bootstrap-icons/icons/vr.svg delete mode 100644 node_modules/bootstrap-icons/icons/wallet-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/wallet.svg delete mode 100644 node_modules/bootstrap-icons/icons/wallet2.svg delete mode 100644 node_modules/bootstrap-icons/icons/watch.svg delete mode 100644 node_modules/bootstrap-icons/icons/water.svg delete mode 100644 node_modules/bootstrap-icons/icons/webcam-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/webcam.svg delete mode 100644 node_modules/bootstrap-icons/icons/wechat.svg delete mode 100644 node_modules/bootstrap-icons/icons/whatsapp.svg delete mode 100644 node_modules/bootstrap-icons/icons/wifi-1.svg delete mode 100644 node_modules/bootstrap-icons/icons/wifi-2.svg delete mode 100644 node_modules/bootstrap-icons/icons/wifi-off.svg delete mode 100644 node_modules/bootstrap-icons/icons/wifi.svg delete mode 100644 node_modules/bootstrap-icons/icons/wikipedia.svg delete mode 100644 node_modules/bootstrap-icons/icons/wind.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-dash.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-desktop.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-dock.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-fullscreen.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-plus.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-sidebar.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-split.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-stack.svg delete mode 100644 node_modules/bootstrap-icons/icons/window-x.svg delete mode 100644 node_modules/bootstrap-icons/icons/window.svg delete mode 100644 node_modules/bootstrap-icons/icons/windows.svg delete mode 100644 node_modules/bootstrap-icons/icons/wordpress.svg delete mode 100644 node_modules/bootstrap-icons/icons/wrench-adjustable-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/wrench-adjustable-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/wrench-adjustable.svg delete mode 100644 node_modules/bootstrap-icons/icons/wrench.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-circle-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-circle.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-diamond-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-diamond.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-lg.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-octagon-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-octagon.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-square-fill.svg delete mode 100644 node_modules/bootstrap-icons/icons/x-square.svg delete mode 100644 node_modules/bootstrap-icons/icons/x.svg delete mode 100644 node_modules/bootstrap-icons/icons/xbox.svg delete mode 100644 node_modules/bootstrap-icons/icons/yelp.svg delete mode 100644 node_modules/bootstrap-icons/icons/yin-yang.svg delete mode 100644 node_modules/bootstrap-icons/icons/youtube.svg delete mode 100644 node_modules/bootstrap-icons/icons/zoom-in.svg delete mode 100644 node_modules/bootstrap-icons/icons/zoom-out.svg delete mode 100644 node_modules/bootstrap-icons/package.json delete mode 100644 node_modules/browserslist/LICENSE delete mode 100644 node_modules/browserslist/README.md delete mode 100644 node_modules/browserslist/browser.js delete mode 100644 node_modules/browserslist/cli.js delete mode 100644 node_modules/browserslist/error.d.ts delete mode 100644 node_modules/browserslist/error.js delete mode 100644 node_modules/browserslist/index.d.ts delete mode 100644 node_modules/browserslist/index.js delete mode 100644 node_modules/browserslist/node.js delete mode 100644 node_modules/browserslist/package.json delete mode 100644 node_modules/browserslist/parse.js delete mode 100644 node_modules/buffer-from/LICENSE delete mode 100644 node_modules/buffer-from/index.js delete mode 100644 node_modules/buffer-from/package.json delete mode 100644 node_modules/buffer-from/readme.md delete mode 100644 node_modules/caniuse-lite/LICENSE delete mode 100644 node_modules/caniuse-lite/README.md delete mode 100644 node_modules/caniuse-lite/data/agents.js delete mode 100644 node_modules/caniuse-lite/data/browserVersions.js delete mode 100644 node_modules/caniuse-lite/data/browsers.js delete mode 100644 node_modules/caniuse-lite/data/features.js delete mode 100644 node_modules/caniuse-lite/data/features/aac.js delete mode 100644 node_modules/caniuse-lite/data/features/abortcontroller.js delete mode 100644 node_modules/caniuse-lite/data/features/ac3-ec3.js delete mode 100644 node_modules/caniuse-lite/data/features/accelerometer.js delete mode 100644 node_modules/caniuse-lite/data/features/addeventlistener.js delete mode 100644 node_modules/caniuse-lite/data/features/alternate-stylesheet.js delete mode 100644 node_modules/caniuse-lite/data/features/ambient-light.js delete mode 100644 node_modules/caniuse-lite/data/features/apng.js delete mode 100644 node_modules/caniuse-lite/data/features/array-find-index.js delete mode 100644 node_modules/caniuse-lite/data/features/array-find.js delete mode 100644 node_modules/caniuse-lite/data/features/array-flat.js delete mode 100644 node_modules/caniuse-lite/data/features/array-includes.js delete mode 100644 node_modules/caniuse-lite/data/features/arrow-functions.js delete mode 100644 node_modules/caniuse-lite/data/features/asmjs.js delete mode 100644 node_modules/caniuse-lite/data/features/async-clipboard.js delete mode 100644 node_modules/caniuse-lite/data/features/async-functions.js delete mode 100644 node_modules/caniuse-lite/data/features/atob-btoa.js delete mode 100644 node_modules/caniuse-lite/data/features/audio-api.js delete mode 100644 node_modules/caniuse-lite/data/features/audio.js delete mode 100644 node_modules/caniuse-lite/data/features/audiotracks.js delete mode 100644 node_modules/caniuse-lite/data/features/autofocus.js delete mode 100644 node_modules/caniuse-lite/data/features/auxclick.js delete mode 100644 node_modules/caniuse-lite/data/features/av1.js delete mode 100644 node_modules/caniuse-lite/data/features/avif.js delete mode 100644 node_modules/caniuse-lite/data/features/background-attachment.js delete mode 100644 node_modules/caniuse-lite/data/features/background-clip-text.js delete mode 100644 node_modules/caniuse-lite/data/features/background-img-opts.js delete mode 100644 node_modules/caniuse-lite/data/features/background-position-x-y.js delete mode 100644 node_modules/caniuse-lite/data/features/background-repeat-round-space.js delete mode 100644 node_modules/caniuse-lite/data/features/background-sync.js delete mode 100644 node_modules/caniuse-lite/data/features/battery-status.js delete mode 100644 node_modules/caniuse-lite/data/features/beacon.js delete mode 100644 node_modules/caniuse-lite/data/features/beforeafterprint.js delete mode 100644 node_modules/caniuse-lite/data/features/bigint.js delete mode 100644 node_modules/caniuse-lite/data/features/blobbuilder.js delete mode 100644 node_modules/caniuse-lite/data/features/bloburls.js delete mode 100644 node_modules/caniuse-lite/data/features/border-image.js delete mode 100644 node_modules/caniuse-lite/data/features/border-radius.js delete mode 100644 node_modules/caniuse-lite/data/features/broadcastchannel.js delete mode 100644 node_modules/caniuse-lite/data/features/brotli.js delete mode 100644 node_modules/caniuse-lite/data/features/calc.js delete mode 100644 node_modules/caniuse-lite/data/features/canvas-blending.js delete mode 100644 node_modules/caniuse-lite/data/features/canvas-text.js delete mode 100644 node_modules/caniuse-lite/data/features/canvas.js delete mode 100644 node_modules/caniuse-lite/data/features/ch-unit.js delete mode 100644 node_modules/caniuse-lite/data/features/chacha20-poly1305.js delete mode 100644 node_modules/caniuse-lite/data/features/channel-messaging.js delete mode 100644 node_modules/caniuse-lite/data/features/childnode-remove.js delete mode 100644 node_modules/caniuse-lite/data/features/classlist.js delete mode 100644 node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js delete mode 100644 node_modules/caniuse-lite/data/features/clipboard.js delete mode 100644 node_modules/caniuse-lite/data/features/colr-v1.js delete mode 100644 node_modules/caniuse-lite/data/features/colr.js delete mode 100644 node_modules/caniuse-lite/data/features/comparedocumentposition.js delete mode 100644 node_modules/caniuse-lite/data/features/console-basic.js delete mode 100644 node_modules/caniuse-lite/data/features/console-time.js delete mode 100644 node_modules/caniuse-lite/data/features/const.js delete mode 100644 node_modules/caniuse-lite/data/features/constraint-validation.js delete mode 100644 node_modules/caniuse-lite/data/features/contenteditable.js delete mode 100644 node_modules/caniuse-lite/data/features/contentsecuritypolicy.js delete mode 100644 node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js delete mode 100644 node_modules/caniuse-lite/data/features/cookie-store-api.js delete mode 100644 node_modules/caniuse-lite/data/features/cors.js delete mode 100644 node_modules/caniuse-lite/data/features/createimagebitmap.js delete mode 100644 node_modules/caniuse-lite/data/features/credential-management.js delete mode 100644 node_modules/caniuse-lite/data/features/cryptography.js delete mode 100644 node_modules/caniuse-lite/data/features/css-all.js delete mode 100644 node_modules/caniuse-lite/data/features/css-anchor-positioning.js delete mode 100644 node_modules/caniuse-lite/data/features/css-animation.js delete mode 100644 node_modules/caniuse-lite/data/features/css-any-link.js delete mode 100644 node_modules/caniuse-lite/data/features/css-appearance.js delete mode 100644 node_modules/caniuse-lite/data/features/css-at-counter-style.js delete mode 100644 node_modules/caniuse-lite/data/features/css-autofill.js delete mode 100644 node_modules/caniuse-lite/data/features/css-backdrop-filter.js delete mode 100644 node_modules/caniuse-lite/data/features/css-background-offsets.js delete mode 100644 node_modules/caniuse-lite/data/features/css-backgroundblendmode.js delete mode 100644 node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js delete mode 100644 node_modules/caniuse-lite/data/features/css-boxshadow.js delete mode 100644 node_modules/caniuse-lite/data/features/css-canvas.js delete mode 100644 node_modules/caniuse-lite/data/features/css-caret-color.js delete mode 100644 node_modules/caniuse-lite/data/features/css-cascade-layers.js delete mode 100644 node_modules/caniuse-lite/data/features/css-cascade-scope.js delete mode 100644 node_modules/caniuse-lite/data/features/css-case-insensitive.js delete mode 100644 node_modules/caniuse-lite/data/features/css-clip-path.js delete mode 100644 node_modules/caniuse-lite/data/features/css-color-adjust.js delete mode 100644 node_modules/caniuse-lite/data/features/css-color-function.js delete mode 100644 node_modules/caniuse-lite/data/features/css-conic-gradients.js delete mode 100644 node_modules/caniuse-lite/data/features/css-container-queries-style.js delete mode 100644 node_modules/caniuse-lite/data/features/css-container-queries.js delete mode 100644 node_modules/caniuse-lite/data/features/css-container-query-units.js delete mode 100644 node_modules/caniuse-lite/data/features/css-containment.js delete mode 100644 node_modules/caniuse-lite/data/features/css-content-visibility.js delete mode 100644 node_modules/caniuse-lite/data/features/css-counters.js delete mode 100644 node_modules/caniuse-lite/data/features/css-crisp-edges.js delete mode 100644 node_modules/caniuse-lite/data/features/css-cross-fade.js delete mode 100644 node_modules/caniuse-lite/data/features/css-default-pseudo.js delete mode 100644 node_modules/caniuse-lite/data/features/css-descendant-gtgt.js delete mode 100644 node_modules/caniuse-lite/data/features/css-deviceadaptation.js delete mode 100644 node_modules/caniuse-lite/data/features/css-dir-pseudo.js delete mode 100644 node_modules/caniuse-lite/data/features/css-display-contents.js delete mode 100644 node_modules/caniuse-lite/data/features/css-element-function.js delete mode 100644 node_modules/caniuse-lite/data/features/css-env-function.js delete mode 100644 node_modules/caniuse-lite/data/features/css-exclusions.js delete mode 100644 node_modules/caniuse-lite/data/features/css-featurequeries.js delete mode 100644 node_modules/caniuse-lite/data/features/css-file-selector-button.js delete mode 100644 node_modules/caniuse-lite/data/features/css-filter-function.js delete mode 100644 node_modules/caniuse-lite/data/features/css-filters.js delete mode 100644 node_modules/caniuse-lite/data/features/css-first-letter.js delete mode 100644 node_modules/caniuse-lite/data/features/css-first-line.js delete mode 100644 node_modules/caniuse-lite/data/features/css-fixed.js delete mode 100644 node_modules/caniuse-lite/data/features/css-focus-visible.js delete mode 100644 node_modules/caniuse-lite/data/features/css-focus-within.js delete mode 100644 node_modules/caniuse-lite/data/features/css-font-palette.js delete mode 100644 node_modules/caniuse-lite/data/features/css-font-rendering-controls.js delete mode 100644 node_modules/caniuse-lite/data/features/css-font-stretch.js delete mode 100644 node_modules/caniuse-lite/data/features/css-gencontent.js delete mode 100644 node_modules/caniuse-lite/data/features/css-gradients.js delete mode 100644 node_modules/caniuse-lite/data/features/css-grid-animation.js delete mode 100644 node_modules/caniuse-lite/data/features/css-grid.js delete mode 100644 node_modules/caniuse-lite/data/features/css-hanging-punctuation.js delete mode 100644 node_modules/caniuse-lite/data/features/css-has.js delete mode 100644 node_modules/caniuse-lite/data/features/css-hyphens.js delete mode 100644 node_modules/caniuse-lite/data/features/css-image-orientation.js delete mode 100644 node_modules/caniuse-lite/data/features/css-image-set.js delete mode 100644 node_modules/caniuse-lite/data/features/css-in-out-of-range.js delete mode 100644 node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js delete mode 100644 node_modules/caniuse-lite/data/features/css-initial-letter.js delete mode 100644 node_modules/caniuse-lite/data/features/css-initial-value.js delete mode 100644 node_modules/caniuse-lite/data/features/css-lch-lab.js delete mode 100644 node_modules/caniuse-lite/data/features/css-letter-spacing.js delete mode 100644 node_modules/caniuse-lite/data/features/css-line-clamp.js delete mode 100644 node_modules/caniuse-lite/data/features/css-logical-props.js delete mode 100644 node_modules/caniuse-lite/data/features/css-marker-pseudo.js delete mode 100644 node_modules/caniuse-lite/data/features/css-masks.js delete mode 100644 node_modules/caniuse-lite/data/features/css-matches-pseudo.js delete mode 100644 node_modules/caniuse-lite/data/features/css-math-functions.js delete mode 100644 node_modules/caniuse-lite/data/features/css-media-interaction.js delete mode 100644 node_modules/caniuse-lite/data/features/css-media-range-syntax.js delete mode 100644 node_modules/caniuse-lite/data/features/css-media-resolution.js delete mode 100644 node_modules/caniuse-lite/data/features/css-media-scripting.js delete mode 100644 node_modules/caniuse-lite/data/features/css-mediaqueries.js delete mode 100644 node_modules/caniuse-lite/data/features/css-mixblendmode.js delete mode 100644 node_modules/caniuse-lite/data/features/css-motion-paths.js delete mode 100644 node_modules/caniuse-lite/data/features/css-namespaces.js delete mode 100644 node_modules/caniuse-lite/data/features/css-nesting.js delete mode 100644 node_modules/caniuse-lite/data/features/css-not-sel-list.js delete mode 100644 node_modules/caniuse-lite/data/features/css-nth-child-of.js delete mode 100644 node_modules/caniuse-lite/data/features/css-opacity.js delete mode 100644 node_modules/caniuse-lite/data/features/css-optional-pseudo.js delete mode 100644 node_modules/caniuse-lite/data/features/css-overflow-anchor.js delete mode 100644 node_modules/caniuse-lite/data/features/css-overflow-overlay.js delete mode 100644 node_modules/caniuse-lite/data/features/css-overflow.js delete mode 100644 node_modules/caniuse-lite/data/features/css-overscroll-behavior.js delete mode 100644 node_modules/caniuse-lite/data/features/css-page-break.js delete mode 100644 node_modules/caniuse-lite/data/features/css-paged-media.js delete mode 100644 node_modules/caniuse-lite/data/features/css-paint-api.js delete mode 100644 node_modules/caniuse-lite/data/features/css-placeholder-shown.js delete mode 100644 node_modules/caniuse-lite/data/features/css-placeholder.js delete mode 100644 node_modules/caniuse-lite/data/features/css-print-color-adjust.js delete mode 100644 node_modules/caniuse-lite/data/features/css-read-only-write.js delete mode 100644 node_modules/caniuse-lite/data/features/css-rebeccapurple.js delete mode 100644 node_modules/caniuse-lite/data/features/css-reflections.js delete mode 100644 node_modules/caniuse-lite/data/features/css-regions.js delete mode 100644 node_modules/caniuse-lite/data/features/css-relative-colors.js delete mode 100644 node_modules/caniuse-lite/data/features/css-repeating-gradients.js delete mode 100644 node_modules/caniuse-lite/data/features/css-resize.js delete mode 100644 node_modules/caniuse-lite/data/features/css-revert-value.js delete mode 100644 node_modules/caniuse-lite/data/features/css-rrggbbaa.js delete mode 100644 node_modules/caniuse-lite/data/features/css-scroll-behavior.js delete mode 100644 node_modules/caniuse-lite/data/features/css-scroll-timeline.js delete mode 100644 node_modules/caniuse-lite/data/features/css-scrollbar.js delete mode 100644 node_modules/caniuse-lite/data/features/css-sel2.js delete mode 100644 node_modules/caniuse-lite/data/features/css-sel3.js delete mode 100644 node_modules/caniuse-lite/data/features/css-selection.js delete mode 100644 node_modules/caniuse-lite/data/features/css-shapes.js delete mode 100644 node_modules/caniuse-lite/data/features/css-snappoints.js delete mode 100644 node_modules/caniuse-lite/data/features/css-sticky.js delete mode 100644 node_modules/caniuse-lite/data/features/css-subgrid.js delete mode 100644 node_modules/caniuse-lite/data/features/css-supports-api.js delete mode 100644 node_modules/caniuse-lite/data/features/css-table.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-align-last.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-box-trim.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-indent.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-justify.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-orientation.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-spacing.js delete mode 100644 node_modules/caniuse-lite/data/features/css-text-wrap-balance.js delete mode 100644 node_modules/caniuse-lite/data/features/css-textshadow.js delete mode 100644 node_modules/caniuse-lite/data/features/css-touch-action.js delete mode 100644 node_modules/caniuse-lite/data/features/css-transitions.js delete mode 100644 node_modules/caniuse-lite/data/features/css-unicode-bidi.js delete mode 100644 node_modules/caniuse-lite/data/features/css-unset-value.js delete mode 100644 node_modules/caniuse-lite/data/features/css-variables.js delete mode 100644 node_modules/caniuse-lite/data/features/css-when-else.js delete mode 100644 node_modules/caniuse-lite/data/features/css-widows-orphans.js delete mode 100644 node_modules/caniuse-lite/data/features/css-width-stretch.js delete mode 100644 node_modules/caniuse-lite/data/features/css-writing-mode.js delete mode 100644 node_modules/caniuse-lite/data/features/css-zoom.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-attr.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-boxsizing.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-colors.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-cursors-grab.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-cursors-newer.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-cursors.js delete mode 100644 node_modules/caniuse-lite/data/features/css3-tabsize.js delete mode 100644 node_modules/caniuse-lite/data/features/currentcolor.js delete mode 100644 node_modules/caniuse-lite/data/features/custom-elements.js delete mode 100644 node_modules/caniuse-lite/data/features/custom-elementsv1.js delete mode 100644 node_modules/caniuse-lite/data/features/customevent.js delete mode 100644 node_modules/caniuse-lite/data/features/datalist.js delete mode 100644 node_modules/caniuse-lite/data/features/dataset.js delete mode 100644 node_modules/caniuse-lite/data/features/datauri.js delete mode 100644 node_modules/caniuse-lite/data/features/date-tolocaledatestring.js delete mode 100644 node_modules/caniuse-lite/data/features/declarative-shadow-dom.js delete mode 100644 node_modules/caniuse-lite/data/features/decorators.js delete mode 100644 node_modules/caniuse-lite/data/features/details.js delete mode 100644 node_modules/caniuse-lite/data/features/deviceorientation.js delete mode 100644 node_modules/caniuse-lite/data/features/devicepixelratio.js delete mode 100644 node_modules/caniuse-lite/data/features/dialog.js delete mode 100644 node_modules/caniuse-lite/data/features/dispatchevent.js delete mode 100644 node_modules/caniuse-lite/data/features/dnssec.js delete mode 100644 node_modules/caniuse-lite/data/features/do-not-track.js delete mode 100644 node_modules/caniuse-lite/data/features/document-currentscript.js delete mode 100644 node_modules/caniuse-lite/data/features/document-evaluate-xpath.js delete mode 100644 node_modules/caniuse-lite/data/features/document-execcommand.js delete mode 100644 node_modules/caniuse-lite/data/features/document-policy.js delete mode 100644 node_modules/caniuse-lite/data/features/document-scrollingelement.js delete mode 100644 node_modules/caniuse-lite/data/features/documenthead.js delete mode 100644 node_modules/caniuse-lite/data/features/dom-manip-convenience.js delete mode 100644 node_modules/caniuse-lite/data/features/dom-range.js delete mode 100644 node_modules/caniuse-lite/data/features/domcontentloaded.js delete mode 100644 node_modules/caniuse-lite/data/features/dommatrix.js delete mode 100644 node_modules/caniuse-lite/data/features/download.js delete mode 100644 node_modules/caniuse-lite/data/features/dragndrop.js delete mode 100644 node_modules/caniuse-lite/data/features/element-closest.js delete mode 100644 node_modules/caniuse-lite/data/features/element-from-point.js delete mode 100644 node_modules/caniuse-lite/data/features/element-scroll-methods.js delete mode 100644 node_modules/caniuse-lite/data/features/eme.js delete mode 100644 node_modules/caniuse-lite/data/features/eot.js delete mode 100644 node_modules/caniuse-lite/data/features/es5.js delete mode 100644 node_modules/caniuse-lite/data/features/es6-class.js delete mode 100644 node_modules/caniuse-lite/data/features/es6-generators.js delete mode 100644 node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js delete mode 100644 node_modules/caniuse-lite/data/features/es6-module.js delete mode 100644 node_modules/caniuse-lite/data/features/es6-number.js delete mode 100644 node_modules/caniuse-lite/data/features/es6-string-includes.js delete mode 100644 node_modules/caniuse-lite/data/features/es6.js delete mode 100644 node_modules/caniuse-lite/data/features/eventsource.js delete mode 100644 node_modules/caniuse-lite/data/features/extended-system-fonts.js delete mode 100644 node_modules/caniuse-lite/data/features/feature-policy.js delete mode 100644 node_modules/caniuse-lite/data/features/fetch.js delete mode 100644 node_modules/caniuse-lite/data/features/fieldset-disabled.js delete mode 100644 node_modules/caniuse-lite/data/features/fileapi.js delete mode 100644 node_modules/caniuse-lite/data/features/filereader.js delete mode 100644 node_modules/caniuse-lite/data/features/filereadersync.js delete mode 100644 node_modules/caniuse-lite/data/features/filesystem.js delete mode 100644 node_modules/caniuse-lite/data/features/flac.js delete mode 100644 node_modules/caniuse-lite/data/features/flexbox-gap.js delete mode 100644 node_modules/caniuse-lite/data/features/flexbox.js delete mode 100644 node_modules/caniuse-lite/data/features/flow-root.js delete mode 100644 node_modules/caniuse-lite/data/features/focusin-focusout-events.js delete mode 100644 node_modules/caniuse-lite/data/features/font-family-system-ui.js delete mode 100644 node_modules/caniuse-lite/data/features/font-feature.js delete mode 100644 node_modules/caniuse-lite/data/features/font-kerning.js delete mode 100644 node_modules/caniuse-lite/data/features/font-loading.js delete mode 100644 node_modules/caniuse-lite/data/features/font-size-adjust.js delete mode 100644 node_modules/caniuse-lite/data/features/font-smooth.js delete mode 100644 node_modules/caniuse-lite/data/features/font-unicode-range.js delete mode 100644 node_modules/caniuse-lite/data/features/font-variant-alternates.js delete mode 100644 node_modules/caniuse-lite/data/features/font-variant-numeric.js delete mode 100644 node_modules/caniuse-lite/data/features/fontface.js delete mode 100644 node_modules/caniuse-lite/data/features/form-attribute.js delete mode 100644 node_modules/caniuse-lite/data/features/form-submit-attributes.js delete mode 100644 node_modules/caniuse-lite/data/features/form-validation.js delete mode 100644 node_modules/caniuse-lite/data/features/forms.js delete mode 100644 node_modules/caniuse-lite/data/features/fullscreen.js delete mode 100644 node_modules/caniuse-lite/data/features/gamepad.js delete mode 100644 node_modules/caniuse-lite/data/features/geolocation.js delete mode 100644 node_modules/caniuse-lite/data/features/getboundingclientrect.js delete mode 100644 node_modules/caniuse-lite/data/features/getcomputedstyle.js delete mode 100644 node_modules/caniuse-lite/data/features/getelementsbyclassname.js delete mode 100644 node_modules/caniuse-lite/data/features/getrandomvalues.js delete mode 100644 node_modules/caniuse-lite/data/features/gyroscope.js delete mode 100644 node_modules/caniuse-lite/data/features/hardwareconcurrency.js delete mode 100644 node_modules/caniuse-lite/data/features/hashchange.js delete mode 100644 node_modules/caniuse-lite/data/features/heif.js delete mode 100644 node_modules/caniuse-lite/data/features/hevc.js delete mode 100644 node_modules/caniuse-lite/data/features/hidden.js delete mode 100644 node_modules/caniuse-lite/data/features/high-resolution-time.js delete mode 100644 node_modules/caniuse-lite/data/features/history.js delete mode 100644 node_modules/caniuse-lite/data/features/html-media-capture.js delete mode 100644 node_modules/caniuse-lite/data/features/html5semantic.js delete mode 100644 node_modules/caniuse-lite/data/features/http-live-streaming.js delete mode 100644 node_modules/caniuse-lite/data/features/http2.js delete mode 100644 node_modules/caniuse-lite/data/features/http3.js delete mode 100644 node_modules/caniuse-lite/data/features/iframe-sandbox.js delete mode 100644 node_modules/caniuse-lite/data/features/iframe-seamless.js delete mode 100644 node_modules/caniuse-lite/data/features/iframe-srcdoc.js delete mode 100644 node_modules/caniuse-lite/data/features/imagecapture.js delete mode 100644 node_modules/caniuse-lite/data/features/ime.js delete mode 100644 node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js delete mode 100644 node_modules/caniuse-lite/data/features/import-maps.js delete mode 100644 node_modules/caniuse-lite/data/features/imports.js delete mode 100644 node_modules/caniuse-lite/data/features/indeterminate-checkbox.js delete mode 100644 node_modules/caniuse-lite/data/features/indexeddb.js delete mode 100644 node_modules/caniuse-lite/data/features/indexeddb2.js delete mode 100644 node_modules/caniuse-lite/data/features/inline-block.js delete mode 100644 node_modules/caniuse-lite/data/features/innertext.js delete mode 100644 node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js delete mode 100644 node_modules/caniuse-lite/data/features/input-color.js delete mode 100644 node_modules/caniuse-lite/data/features/input-datetime.js delete mode 100644 node_modules/caniuse-lite/data/features/input-email-tel-url.js delete mode 100644 node_modules/caniuse-lite/data/features/input-event.js delete mode 100644 node_modules/caniuse-lite/data/features/input-file-accept.js delete mode 100644 node_modules/caniuse-lite/data/features/input-file-directory.js delete mode 100644 node_modules/caniuse-lite/data/features/input-file-multiple.js delete mode 100644 node_modules/caniuse-lite/data/features/input-inputmode.js delete mode 100644 node_modules/caniuse-lite/data/features/input-minlength.js delete mode 100644 node_modules/caniuse-lite/data/features/input-number.js delete mode 100644 node_modules/caniuse-lite/data/features/input-pattern.js delete mode 100644 node_modules/caniuse-lite/data/features/input-placeholder.js delete mode 100644 node_modules/caniuse-lite/data/features/input-range.js delete mode 100644 node_modules/caniuse-lite/data/features/input-search.js delete mode 100644 node_modules/caniuse-lite/data/features/input-selection.js delete mode 100644 node_modules/caniuse-lite/data/features/insert-adjacent.js delete mode 100644 node_modules/caniuse-lite/data/features/insertadjacenthtml.js delete mode 100644 node_modules/caniuse-lite/data/features/internationalization.js delete mode 100644 node_modules/caniuse-lite/data/features/intersectionobserver-v2.js delete mode 100644 node_modules/caniuse-lite/data/features/intersectionobserver.js delete mode 100644 node_modules/caniuse-lite/data/features/intl-pluralrules.js delete mode 100644 node_modules/caniuse-lite/data/features/intrinsic-width.js delete mode 100644 node_modules/caniuse-lite/data/features/jpeg2000.js delete mode 100644 node_modules/caniuse-lite/data/features/jpegxl.js delete mode 100644 node_modules/caniuse-lite/data/features/jpegxr.js delete mode 100644 node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js delete mode 100644 node_modules/caniuse-lite/data/features/json.js delete mode 100644 node_modules/caniuse-lite/data/features/justify-content-space-evenly.js delete mode 100644 node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js delete mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-charcode.js delete mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-code.js delete mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js delete mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-key.js delete mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-location.js delete mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-which.js delete mode 100644 node_modules/caniuse-lite/data/features/lazyload.js delete mode 100644 node_modules/caniuse-lite/data/features/let.js delete mode 100644 node_modules/caniuse-lite/data/features/link-icon-png.js delete mode 100644 node_modules/caniuse-lite/data/features/link-icon-svg.js delete mode 100644 node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js delete mode 100644 node_modules/caniuse-lite/data/features/link-rel-modulepreload.js delete mode 100644 node_modules/caniuse-lite/data/features/link-rel-preconnect.js delete mode 100644 node_modules/caniuse-lite/data/features/link-rel-prefetch.js delete mode 100644 node_modules/caniuse-lite/data/features/link-rel-preload.js delete mode 100644 node_modules/caniuse-lite/data/features/link-rel-prerender.js delete mode 100644 node_modules/caniuse-lite/data/features/loading-lazy-attr.js delete mode 100644 node_modules/caniuse-lite/data/features/localecompare.js delete mode 100644 node_modules/caniuse-lite/data/features/magnetometer.js delete mode 100644 node_modules/caniuse-lite/data/features/matchesselector.js delete mode 100644 node_modules/caniuse-lite/data/features/matchmedia.js delete mode 100644 node_modules/caniuse-lite/data/features/mathml.js delete mode 100644 node_modules/caniuse-lite/data/features/maxlength.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js delete mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js delete mode 100644 node_modules/caniuse-lite/data/features/media-fragments.js delete mode 100644 node_modules/caniuse-lite/data/features/mediacapture-fromelement.js delete mode 100644 node_modules/caniuse-lite/data/features/mediarecorder.js delete mode 100644 node_modules/caniuse-lite/data/features/mediasource.js delete mode 100644 node_modules/caniuse-lite/data/features/menu.js delete mode 100644 node_modules/caniuse-lite/data/features/meta-theme-color.js delete mode 100644 node_modules/caniuse-lite/data/features/meter.js delete mode 100644 node_modules/caniuse-lite/data/features/midi.js delete mode 100644 node_modules/caniuse-lite/data/features/minmaxwh.js delete mode 100644 node_modules/caniuse-lite/data/features/mp3.js delete mode 100644 node_modules/caniuse-lite/data/features/mpeg-dash.js delete mode 100644 node_modules/caniuse-lite/data/features/mpeg4.js delete mode 100644 node_modules/caniuse-lite/data/features/multibackgrounds.js delete mode 100644 node_modules/caniuse-lite/data/features/multicolumn.js delete mode 100644 node_modules/caniuse-lite/data/features/mutation-events.js delete mode 100644 node_modules/caniuse-lite/data/features/mutationobserver.js delete mode 100644 node_modules/caniuse-lite/data/features/namevalue-storage.js delete mode 100644 node_modules/caniuse-lite/data/features/native-filesystem-api.js delete mode 100644 node_modules/caniuse-lite/data/features/nav-timing.js delete mode 100644 node_modules/caniuse-lite/data/features/netinfo.js delete mode 100644 node_modules/caniuse-lite/data/features/notifications.js delete mode 100644 node_modules/caniuse-lite/data/features/object-entries.js delete mode 100644 node_modules/caniuse-lite/data/features/object-fit.js delete mode 100644 node_modules/caniuse-lite/data/features/object-observe.js delete mode 100644 node_modules/caniuse-lite/data/features/object-values.js delete mode 100644 node_modules/caniuse-lite/data/features/objectrtc.js delete mode 100644 node_modules/caniuse-lite/data/features/offline-apps.js delete mode 100644 node_modules/caniuse-lite/data/features/offscreencanvas.js delete mode 100644 node_modules/caniuse-lite/data/features/ogg-vorbis.js delete mode 100644 node_modules/caniuse-lite/data/features/ogv.js delete mode 100644 node_modules/caniuse-lite/data/features/ol-reversed.js delete mode 100644 node_modules/caniuse-lite/data/features/once-event-listener.js delete mode 100644 node_modules/caniuse-lite/data/features/online-status.js delete mode 100644 node_modules/caniuse-lite/data/features/opus.js delete mode 100644 node_modules/caniuse-lite/data/features/orientation-sensor.js delete mode 100644 node_modules/caniuse-lite/data/features/outline.js delete mode 100644 node_modules/caniuse-lite/data/features/pad-start-end.js delete mode 100644 node_modules/caniuse-lite/data/features/page-transition-events.js delete mode 100644 node_modules/caniuse-lite/data/features/pagevisibility.js delete mode 100644 node_modules/caniuse-lite/data/features/passive-event-listener.js delete mode 100644 node_modules/caniuse-lite/data/features/passkeys.js delete mode 100644 node_modules/caniuse-lite/data/features/passwordrules.js delete mode 100644 node_modules/caniuse-lite/data/features/path2d.js delete mode 100644 node_modules/caniuse-lite/data/features/payment-request.js delete mode 100644 node_modules/caniuse-lite/data/features/pdf-viewer.js delete mode 100644 node_modules/caniuse-lite/data/features/permissions-api.js delete mode 100644 node_modules/caniuse-lite/data/features/permissions-policy.js delete mode 100644 node_modules/caniuse-lite/data/features/picture-in-picture.js delete mode 100644 node_modules/caniuse-lite/data/features/picture.js delete mode 100644 node_modules/caniuse-lite/data/features/ping.js delete mode 100644 node_modules/caniuse-lite/data/features/png-alpha.js delete mode 100644 node_modules/caniuse-lite/data/features/pointer-events.js delete mode 100644 node_modules/caniuse-lite/data/features/pointer.js delete mode 100644 node_modules/caniuse-lite/data/features/pointerlock.js delete mode 100644 node_modules/caniuse-lite/data/features/portals.js delete mode 100644 node_modules/caniuse-lite/data/features/prefers-color-scheme.js delete mode 100644 node_modules/caniuse-lite/data/features/prefers-reduced-motion.js delete mode 100644 node_modules/caniuse-lite/data/features/progress.js delete mode 100644 node_modules/caniuse-lite/data/features/promise-finally.js delete mode 100644 node_modules/caniuse-lite/data/features/promises.js delete mode 100644 node_modules/caniuse-lite/data/features/proximity.js delete mode 100644 node_modules/caniuse-lite/data/features/proxy.js delete mode 100644 node_modules/caniuse-lite/data/features/publickeypinning.js delete mode 100644 node_modules/caniuse-lite/data/features/push-api.js delete mode 100644 node_modules/caniuse-lite/data/features/queryselector.js delete mode 100644 node_modules/caniuse-lite/data/features/readonly-attr.js delete mode 100644 node_modules/caniuse-lite/data/features/referrer-policy.js delete mode 100644 node_modules/caniuse-lite/data/features/registerprotocolhandler.js delete mode 100644 node_modules/caniuse-lite/data/features/rel-noopener.js delete mode 100644 node_modules/caniuse-lite/data/features/rel-noreferrer.js delete mode 100644 node_modules/caniuse-lite/data/features/rellist.js delete mode 100644 node_modules/caniuse-lite/data/features/rem.js delete mode 100644 node_modules/caniuse-lite/data/features/requestanimationframe.js delete mode 100644 node_modules/caniuse-lite/data/features/requestidlecallback.js delete mode 100644 node_modules/caniuse-lite/data/features/resizeobserver.js delete mode 100644 node_modules/caniuse-lite/data/features/resource-timing.js delete mode 100644 node_modules/caniuse-lite/data/features/rest-parameters.js delete mode 100644 node_modules/caniuse-lite/data/features/rtcpeerconnection.js delete mode 100644 node_modules/caniuse-lite/data/features/ruby.js delete mode 100644 node_modules/caniuse-lite/data/features/run-in.js delete mode 100644 node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js delete mode 100644 node_modules/caniuse-lite/data/features/screen-orientation.js delete mode 100644 node_modules/caniuse-lite/data/features/script-async.js delete mode 100644 node_modules/caniuse-lite/data/features/script-defer.js delete mode 100644 node_modules/caniuse-lite/data/features/scrollintoview.js delete mode 100644 node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js delete mode 100644 node_modules/caniuse-lite/data/features/sdch.js delete mode 100644 node_modules/caniuse-lite/data/features/selection-api.js delete mode 100644 node_modules/caniuse-lite/data/features/selectlist.js delete mode 100644 node_modules/caniuse-lite/data/features/server-timing.js delete mode 100644 node_modules/caniuse-lite/data/features/serviceworkers.js delete mode 100644 node_modules/caniuse-lite/data/features/setimmediate.js delete mode 100644 node_modules/caniuse-lite/data/features/shadowdom.js delete mode 100644 node_modules/caniuse-lite/data/features/shadowdomv1.js delete mode 100644 node_modules/caniuse-lite/data/features/sharedarraybuffer.js delete mode 100644 node_modules/caniuse-lite/data/features/sharedworkers.js delete mode 100644 node_modules/caniuse-lite/data/features/sni.js delete mode 100644 node_modules/caniuse-lite/data/features/spdy.js delete mode 100644 node_modules/caniuse-lite/data/features/speech-recognition.js delete mode 100644 node_modules/caniuse-lite/data/features/speech-synthesis.js delete mode 100644 node_modules/caniuse-lite/data/features/spellcheck-attribute.js delete mode 100644 node_modules/caniuse-lite/data/features/sql-storage.js delete mode 100644 node_modules/caniuse-lite/data/features/srcset.js delete mode 100644 node_modules/caniuse-lite/data/features/stream.js delete mode 100644 node_modules/caniuse-lite/data/features/streams.js delete mode 100644 node_modules/caniuse-lite/data/features/stricttransportsecurity.js delete mode 100644 node_modules/caniuse-lite/data/features/style-scoped.js delete mode 100644 node_modules/caniuse-lite/data/features/subresource-bundling.js delete mode 100644 node_modules/caniuse-lite/data/features/subresource-integrity.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-css.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-filters.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-fonts.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-fragment.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-html.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-html5.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-img.js delete mode 100644 node_modules/caniuse-lite/data/features/svg-smil.js delete mode 100644 node_modules/caniuse-lite/data/features/svg.js delete mode 100644 node_modules/caniuse-lite/data/features/sxg.js delete mode 100644 node_modules/caniuse-lite/data/features/tabindex-attr.js delete mode 100644 node_modules/caniuse-lite/data/features/template-literals.js delete mode 100644 node_modules/caniuse-lite/data/features/template.js delete mode 100644 node_modules/caniuse-lite/data/features/temporal.js delete mode 100644 node_modules/caniuse-lite/data/features/testfeat.js delete mode 100644 node_modules/caniuse-lite/data/features/text-decoration.js delete mode 100644 node_modules/caniuse-lite/data/features/text-emphasis.js delete mode 100644 node_modules/caniuse-lite/data/features/text-overflow.js delete mode 100644 node_modules/caniuse-lite/data/features/text-size-adjust.js delete mode 100644 node_modules/caniuse-lite/data/features/text-stroke.js delete mode 100644 node_modules/caniuse-lite/data/features/textcontent.js delete mode 100644 node_modules/caniuse-lite/data/features/textencoder.js delete mode 100644 node_modules/caniuse-lite/data/features/tls1-1.js delete mode 100644 node_modules/caniuse-lite/data/features/tls1-2.js delete mode 100644 node_modules/caniuse-lite/data/features/tls1-3.js delete mode 100644 node_modules/caniuse-lite/data/features/touch.js delete mode 100644 node_modules/caniuse-lite/data/features/transforms2d.js delete mode 100644 node_modules/caniuse-lite/data/features/transforms3d.js delete mode 100644 node_modules/caniuse-lite/data/features/trusted-types.js delete mode 100644 node_modules/caniuse-lite/data/features/ttf.js delete mode 100644 node_modules/caniuse-lite/data/features/typedarrays.js delete mode 100644 node_modules/caniuse-lite/data/features/u2f.js delete mode 100644 node_modules/caniuse-lite/data/features/unhandledrejection.js delete mode 100644 node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js delete mode 100644 node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js delete mode 100644 node_modules/caniuse-lite/data/features/url.js delete mode 100644 node_modules/caniuse-lite/data/features/urlsearchparams.js delete mode 100644 node_modules/caniuse-lite/data/features/use-strict.js delete mode 100644 node_modules/caniuse-lite/data/features/user-select-none.js delete mode 100644 node_modules/caniuse-lite/data/features/user-timing.js delete mode 100644 node_modules/caniuse-lite/data/features/variable-fonts.js delete mode 100644 node_modules/caniuse-lite/data/features/vector-effect.js delete mode 100644 node_modules/caniuse-lite/data/features/vibration.js delete mode 100644 node_modules/caniuse-lite/data/features/video.js delete mode 100644 node_modules/caniuse-lite/data/features/videotracks.js delete mode 100644 node_modules/caniuse-lite/data/features/view-transitions.js delete mode 100644 node_modules/caniuse-lite/data/features/viewport-unit-variants.js delete mode 100644 node_modules/caniuse-lite/data/features/viewport-units.js delete mode 100644 node_modules/caniuse-lite/data/features/wai-aria.js delete mode 100644 node_modules/caniuse-lite/data/features/wake-lock.js delete mode 100644 node_modules/caniuse-lite/data/features/wasm.js delete mode 100644 node_modules/caniuse-lite/data/features/wav.js delete mode 100644 node_modules/caniuse-lite/data/features/wbr-element.js delete mode 100644 node_modules/caniuse-lite/data/features/web-animation.js delete mode 100644 node_modules/caniuse-lite/data/features/web-app-manifest.js delete mode 100644 node_modules/caniuse-lite/data/features/web-bluetooth.js delete mode 100644 node_modules/caniuse-lite/data/features/web-serial.js delete mode 100644 node_modules/caniuse-lite/data/features/web-share.js delete mode 100644 node_modules/caniuse-lite/data/features/webauthn.js delete mode 100644 node_modules/caniuse-lite/data/features/webcodecs.js delete mode 100644 node_modules/caniuse-lite/data/features/webgl.js delete mode 100644 node_modules/caniuse-lite/data/features/webgl2.js delete mode 100644 node_modules/caniuse-lite/data/features/webgpu.js delete mode 100644 node_modules/caniuse-lite/data/features/webhid.js delete mode 100644 node_modules/caniuse-lite/data/features/webkit-user-drag.js delete mode 100644 node_modules/caniuse-lite/data/features/webm.js delete mode 100644 node_modules/caniuse-lite/data/features/webnfc.js delete mode 100644 node_modules/caniuse-lite/data/features/webp.js delete mode 100644 node_modules/caniuse-lite/data/features/websockets.js delete mode 100644 node_modules/caniuse-lite/data/features/webtransport.js delete mode 100644 node_modules/caniuse-lite/data/features/webusb.js delete mode 100644 node_modules/caniuse-lite/data/features/webvr.js delete mode 100644 node_modules/caniuse-lite/data/features/webvtt.js delete mode 100644 node_modules/caniuse-lite/data/features/webworkers.js delete mode 100644 node_modules/caniuse-lite/data/features/webxr.js delete mode 100644 node_modules/caniuse-lite/data/features/will-change.js delete mode 100644 node_modules/caniuse-lite/data/features/woff.js delete mode 100644 node_modules/caniuse-lite/data/features/woff2.js delete mode 100644 node_modules/caniuse-lite/data/features/word-break.js delete mode 100644 node_modules/caniuse-lite/data/features/wordwrap.js delete mode 100644 node_modules/caniuse-lite/data/features/x-doc-messaging.js delete mode 100644 node_modules/caniuse-lite/data/features/x-frame-options.js delete mode 100644 node_modules/caniuse-lite/data/features/xhr2.js delete mode 100644 node_modules/caniuse-lite/data/features/xhtml.js delete mode 100644 node_modules/caniuse-lite/data/features/xhtmlsmil.js delete mode 100644 node_modules/caniuse-lite/data/features/xml-serializer.js delete mode 100644 node_modules/caniuse-lite/data/features/zstd.js delete mode 100644 node_modules/caniuse-lite/data/regions/AD.js delete mode 100644 node_modules/caniuse-lite/data/regions/AE.js delete mode 100644 node_modules/caniuse-lite/data/regions/AF.js delete mode 100644 node_modules/caniuse-lite/data/regions/AG.js delete mode 100644 node_modules/caniuse-lite/data/regions/AI.js delete mode 100644 node_modules/caniuse-lite/data/regions/AL.js delete mode 100644 node_modules/caniuse-lite/data/regions/AM.js delete mode 100644 node_modules/caniuse-lite/data/regions/AO.js delete mode 100644 node_modules/caniuse-lite/data/regions/AR.js delete mode 100644 node_modules/caniuse-lite/data/regions/AS.js delete mode 100644 node_modules/caniuse-lite/data/regions/AT.js delete mode 100644 node_modules/caniuse-lite/data/regions/AU.js delete mode 100644 node_modules/caniuse-lite/data/regions/AW.js delete mode 100644 node_modules/caniuse-lite/data/regions/AX.js delete mode 100644 node_modules/caniuse-lite/data/regions/AZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/BA.js delete mode 100644 node_modules/caniuse-lite/data/regions/BB.js delete mode 100644 node_modules/caniuse-lite/data/regions/BD.js delete mode 100644 node_modules/caniuse-lite/data/regions/BE.js delete mode 100644 node_modules/caniuse-lite/data/regions/BF.js delete mode 100644 node_modules/caniuse-lite/data/regions/BG.js delete mode 100644 node_modules/caniuse-lite/data/regions/BH.js delete mode 100644 node_modules/caniuse-lite/data/regions/BI.js delete mode 100644 node_modules/caniuse-lite/data/regions/BJ.js delete mode 100644 node_modules/caniuse-lite/data/regions/BM.js delete mode 100644 node_modules/caniuse-lite/data/regions/BN.js delete mode 100644 node_modules/caniuse-lite/data/regions/BO.js delete mode 100644 node_modules/caniuse-lite/data/regions/BR.js delete mode 100644 node_modules/caniuse-lite/data/regions/BS.js delete mode 100644 node_modules/caniuse-lite/data/regions/BT.js delete mode 100644 node_modules/caniuse-lite/data/regions/BW.js delete mode 100644 node_modules/caniuse-lite/data/regions/BY.js delete mode 100644 node_modules/caniuse-lite/data/regions/BZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/CA.js delete mode 100644 node_modules/caniuse-lite/data/regions/CD.js delete mode 100644 node_modules/caniuse-lite/data/regions/CF.js delete mode 100644 node_modules/caniuse-lite/data/regions/CG.js delete mode 100644 node_modules/caniuse-lite/data/regions/CH.js delete mode 100644 node_modules/caniuse-lite/data/regions/CI.js delete mode 100644 node_modules/caniuse-lite/data/regions/CK.js delete mode 100644 node_modules/caniuse-lite/data/regions/CL.js delete mode 100644 node_modules/caniuse-lite/data/regions/CM.js delete mode 100644 node_modules/caniuse-lite/data/regions/CN.js delete mode 100644 node_modules/caniuse-lite/data/regions/CO.js delete mode 100644 node_modules/caniuse-lite/data/regions/CR.js delete mode 100644 node_modules/caniuse-lite/data/regions/CU.js delete mode 100644 node_modules/caniuse-lite/data/regions/CV.js delete mode 100644 node_modules/caniuse-lite/data/regions/CX.js delete mode 100644 node_modules/caniuse-lite/data/regions/CY.js delete mode 100644 node_modules/caniuse-lite/data/regions/CZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/DE.js delete mode 100644 node_modules/caniuse-lite/data/regions/DJ.js delete mode 100644 node_modules/caniuse-lite/data/regions/DK.js delete mode 100644 node_modules/caniuse-lite/data/regions/DM.js delete mode 100644 node_modules/caniuse-lite/data/regions/DO.js delete mode 100644 node_modules/caniuse-lite/data/regions/DZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/EC.js delete mode 100644 node_modules/caniuse-lite/data/regions/EE.js delete mode 100644 node_modules/caniuse-lite/data/regions/EG.js delete mode 100644 node_modules/caniuse-lite/data/regions/ER.js delete mode 100644 node_modules/caniuse-lite/data/regions/ES.js delete mode 100644 node_modules/caniuse-lite/data/regions/ET.js delete mode 100644 node_modules/caniuse-lite/data/regions/FI.js delete mode 100644 node_modules/caniuse-lite/data/regions/FJ.js delete mode 100644 node_modules/caniuse-lite/data/regions/FK.js delete mode 100644 node_modules/caniuse-lite/data/regions/FM.js delete mode 100644 node_modules/caniuse-lite/data/regions/FO.js delete mode 100644 node_modules/caniuse-lite/data/regions/FR.js delete mode 100644 node_modules/caniuse-lite/data/regions/GA.js delete mode 100644 node_modules/caniuse-lite/data/regions/GB.js delete mode 100644 node_modules/caniuse-lite/data/regions/GD.js delete mode 100644 node_modules/caniuse-lite/data/regions/GE.js delete mode 100644 node_modules/caniuse-lite/data/regions/GF.js delete mode 100644 node_modules/caniuse-lite/data/regions/GG.js delete mode 100644 node_modules/caniuse-lite/data/regions/GH.js delete mode 100644 node_modules/caniuse-lite/data/regions/GI.js delete mode 100644 node_modules/caniuse-lite/data/regions/GL.js delete mode 100644 node_modules/caniuse-lite/data/regions/GM.js delete mode 100644 node_modules/caniuse-lite/data/regions/GN.js delete mode 100644 node_modules/caniuse-lite/data/regions/GP.js delete mode 100644 node_modules/caniuse-lite/data/regions/GQ.js delete mode 100644 node_modules/caniuse-lite/data/regions/GR.js delete mode 100644 node_modules/caniuse-lite/data/regions/GT.js delete mode 100644 node_modules/caniuse-lite/data/regions/GU.js delete mode 100644 node_modules/caniuse-lite/data/regions/GW.js delete mode 100644 node_modules/caniuse-lite/data/regions/GY.js delete mode 100644 node_modules/caniuse-lite/data/regions/HK.js delete mode 100644 node_modules/caniuse-lite/data/regions/HN.js delete mode 100644 node_modules/caniuse-lite/data/regions/HR.js delete mode 100644 node_modules/caniuse-lite/data/regions/HT.js delete mode 100644 node_modules/caniuse-lite/data/regions/HU.js delete mode 100644 node_modules/caniuse-lite/data/regions/ID.js delete mode 100644 node_modules/caniuse-lite/data/regions/IE.js delete mode 100644 node_modules/caniuse-lite/data/regions/IL.js delete mode 100644 node_modules/caniuse-lite/data/regions/IM.js delete mode 100644 node_modules/caniuse-lite/data/regions/IN.js delete mode 100644 node_modules/caniuse-lite/data/regions/IQ.js delete mode 100644 node_modules/caniuse-lite/data/regions/IR.js delete mode 100644 node_modules/caniuse-lite/data/regions/IS.js delete mode 100644 node_modules/caniuse-lite/data/regions/IT.js delete mode 100644 node_modules/caniuse-lite/data/regions/JE.js delete mode 100644 node_modules/caniuse-lite/data/regions/JM.js delete mode 100644 node_modules/caniuse-lite/data/regions/JO.js delete mode 100644 node_modules/caniuse-lite/data/regions/JP.js delete mode 100644 node_modules/caniuse-lite/data/regions/KE.js delete mode 100644 node_modules/caniuse-lite/data/regions/KG.js delete mode 100644 node_modules/caniuse-lite/data/regions/KH.js delete mode 100644 node_modules/caniuse-lite/data/regions/KI.js delete mode 100644 node_modules/caniuse-lite/data/regions/KM.js delete mode 100644 node_modules/caniuse-lite/data/regions/KN.js delete mode 100644 node_modules/caniuse-lite/data/regions/KP.js delete mode 100644 node_modules/caniuse-lite/data/regions/KR.js delete mode 100644 node_modules/caniuse-lite/data/regions/KW.js delete mode 100644 node_modules/caniuse-lite/data/regions/KY.js delete mode 100644 node_modules/caniuse-lite/data/regions/KZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/LA.js delete mode 100644 node_modules/caniuse-lite/data/regions/LB.js delete mode 100644 node_modules/caniuse-lite/data/regions/LC.js delete mode 100644 node_modules/caniuse-lite/data/regions/LI.js delete mode 100644 node_modules/caniuse-lite/data/regions/LK.js delete mode 100644 node_modules/caniuse-lite/data/regions/LR.js delete mode 100644 node_modules/caniuse-lite/data/regions/LS.js delete mode 100644 node_modules/caniuse-lite/data/regions/LT.js delete mode 100644 node_modules/caniuse-lite/data/regions/LU.js delete mode 100644 node_modules/caniuse-lite/data/regions/LV.js delete mode 100644 node_modules/caniuse-lite/data/regions/LY.js delete mode 100644 node_modules/caniuse-lite/data/regions/MA.js delete mode 100644 node_modules/caniuse-lite/data/regions/MC.js delete mode 100644 node_modules/caniuse-lite/data/regions/MD.js delete mode 100644 node_modules/caniuse-lite/data/regions/ME.js delete mode 100644 node_modules/caniuse-lite/data/regions/MG.js delete mode 100644 node_modules/caniuse-lite/data/regions/MH.js delete mode 100644 node_modules/caniuse-lite/data/regions/MK.js delete mode 100644 node_modules/caniuse-lite/data/regions/ML.js delete mode 100644 node_modules/caniuse-lite/data/regions/MM.js delete mode 100644 node_modules/caniuse-lite/data/regions/MN.js delete mode 100644 node_modules/caniuse-lite/data/regions/MO.js delete mode 100644 node_modules/caniuse-lite/data/regions/MP.js delete mode 100644 node_modules/caniuse-lite/data/regions/MQ.js delete mode 100644 node_modules/caniuse-lite/data/regions/MR.js delete mode 100644 node_modules/caniuse-lite/data/regions/MS.js delete mode 100644 node_modules/caniuse-lite/data/regions/MT.js delete mode 100644 node_modules/caniuse-lite/data/regions/MU.js delete mode 100644 node_modules/caniuse-lite/data/regions/MV.js delete mode 100644 node_modules/caniuse-lite/data/regions/MW.js delete mode 100644 node_modules/caniuse-lite/data/regions/MX.js delete mode 100644 node_modules/caniuse-lite/data/regions/MY.js delete mode 100644 node_modules/caniuse-lite/data/regions/MZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/NA.js delete mode 100644 node_modules/caniuse-lite/data/regions/NC.js delete mode 100644 node_modules/caniuse-lite/data/regions/NE.js delete mode 100644 node_modules/caniuse-lite/data/regions/NF.js delete mode 100644 node_modules/caniuse-lite/data/regions/NG.js delete mode 100644 node_modules/caniuse-lite/data/regions/NI.js delete mode 100644 node_modules/caniuse-lite/data/regions/NL.js delete mode 100644 node_modules/caniuse-lite/data/regions/NO.js delete mode 100644 node_modules/caniuse-lite/data/regions/NP.js delete mode 100644 node_modules/caniuse-lite/data/regions/NR.js delete mode 100644 node_modules/caniuse-lite/data/regions/NU.js delete mode 100644 node_modules/caniuse-lite/data/regions/NZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/OM.js delete mode 100644 node_modules/caniuse-lite/data/regions/PA.js delete mode 100644 node_modules/caniuse-lite/data/regions/PE.js delete mode 100644 node_modules/caniuse-lite/data/regions/PF.js delete mode 100644 node_modules/caniuse-lite/data/regions/PG.js delete mode 100644 node_modules/caniuse-lite/data/regions/PH.js delete mode 100644 node_modules/caniuse-lite/data/regions/PK.js delete mode 100644 node_modules/caniuse-lite/data/regions/PL.js delete mode 100644 node_modules/caniuse-lite/data/regions/PM.js delete mode 100644 node_modules/caniuse-lite/data/regions/PN.js delete mode 100644 node_modules/caniuse-lite/data/regions/PR.js delete mode 100644 node_modules/caniuse-lite/data/regions/PS.js delete mode 100644 node_modules/caniuse-lite/data/regions/PT.js delete mode 100644 node_modules/caniuse-lite/data/regions/PW.js delete mode 100644 node_modules/caniuse-lite/data/regions/PY.js delete mode 100644 node_modules/caniuse-lite/data/regions/QA.js delete mode 100644 node_modules/caniuse-lite/data/regions/RE.js delete mode 100644 node_modules/caniuse-lite/data/regions/RO.js delete mode 100644 node_modules/caniuse-lite/data/regions/RS.js delete mode 100644 node_modules/caniuse-lite/data/regions/RU.js delete mode 100644 node_modules/caniuse-lite/data/regions/RW.js delete mode 100644 node_modules/caniuse-lite/data/regions/SA.js delete mode 100644 node_modules/caniuse-lite/data/regions/SB.js delete mode 100644 node_modules/caniuse-lite/data/regions/SC.js delete mode 100644 node_modules/caniuse-lite/data/regions/SD.js delete mode 100644 node_modules/caniuse-lite/data/regions/SE.js delete mode 100644 node_modules/caniuse-lite/data/regions/SG.js delete mode 100644 node_modules/caniuse-lite/data/regions/SH.js delete mode 100644 node_modules/caniuse-lite/data/regions/SI.js delete mode 100644 node_modules/caniuse-lite/data/regions/SK.js delete mode 100644 node_modules/caniuse-lite/data/regions/SL.js delete mode 100644 node_modules/caniuse-lite/data/regions/SM.js delete mode 100644 node_modules/caniuse-lite/data/regions/SN.js delete mode 100644 node_modules/caniuse-lite/data/regions/SO.js delete mode 100644 node_modules/caniuse-lite/data/regions/SR.js delete mode 100644 node_modules/caniuse-lite/data/regions/ST.js delete mode 100644 node_modules/caniuse-lite/data/regions/SV.js delete mode 100644 node_modules/caniuse-lite/data/regions/SY.js delete mode 100644 node_modules/caniuse-lite/data/regions/SZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/TC.js delete mode 100644 node_modules/caniuse-lite/data/regions/TD.js delete mode 100644 node_modules/caniuse-lite/data/regions/TG.js delete mode 100644 node_modules/caniuse-lite/data/regions/TH.js delete mode 100644 node_modules/caniuse-lite/data/regions/TJ.js delete mode 100644 node_modules/caniuse-lite/data/regions/TK.js delete mode 100644 node_modules/caniuse-lite/data/regions/TL.js delete mode 100644 node_modules/caniuse-lite/data/regions/TM.js delete mode 100644 node_modules/caniuse-lite/data/regions/TN.js delete mode 100644 node_modules/caniuse-lite/data/regions/TO.js delete mode 100644 node_modules/caniuse-lite/data/regions/TR.js delete mode 100644 node_modules/caniuse-lite/data/regions/TT.js delete mode 100644 node_modules/caniuse-lite/data/regions/TV.js delete mode 100644 node_modules/caniuse-lite/data/regions/TW.js delete mode 100644 node_modules/caniuse-lite/data/regions/TZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/UA.js delete mode 100644 node_modules/caniuse-lite/data/regions/UG.js delete mode 100644 node_modules/caniuse-lite/data/regions/US.js delete mode 100644 node_modules/caniuse-lite/data/regions/UY.js delete mode 100644 node_modules/caniuse-lite/data/regions/UZ.js delete mode 100644 node_modules/caniuse-lite/data/regions/VA.js delete mode 100644 node_modules/caniuse-lite/data/regions/VC.js delete mode 100644 node_modules/caniuse-lite/data/regions/VE.js delete mode 100644 node_modules/caniuse-lite/data/regions/VG.js delete mode 100644 node_modules/caniuse-lite/data/regions/VI.js delete mode 100644 node_modules/caniuse-lite/data/regions/VN.js delete mode 100644 node_modules/caniuse-lite/data/regions/VU.js delete mode 100644 node_modules/caniuse-lite/data/regions/WF.js delete mode 100644 node_modules/caniuse-lite/data/regions/WS.js delete mode 100644 node_modules/caniuse-lite/data/regions/YE.js delete mode 100644 node_modules/caniuse-lite/data/regions/YT.js delete mode 100644 node_modules/caniuse-lite/data/regions/ZA.js delete mode 100644 node_modules/caniuse-lite/data/regions/ZM.js delete mode 100644 node_modules/caniuse-lite/data/regions/ZW.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-af.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-an.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-as.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-eu.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-na.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-oc.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-sa.js delete mode 100644 node_modules/caniuse-lite/data/regions/alt-ww.js delete mode 100644 node_modules/caniuse-lite/dist/lib/statuses.js delete mode 100644 node_modules/caniuse-lite/dist/lib/supported.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/agents.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/browserVersions.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/browsers.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/feature.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/features.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/index.js delete mode 100644 node_modules/caniuse-lite/dist/unpacker/region.js delete mode 100644 node_modules/caniuse-lite/package.json delete mode 100644 node_modules/chrome-trace-event/CHANGES.md delete mode 100644 node_modules/chrome-trace-event/LICENSE.txt delete mode 100644 node_modules/chrome-trace-event/README.md delete mode 100644 node_modules/chrome-trace-event/dist/trace-event.d.ts delete mode 100644 node_modules/chrome-trace-event/dist/trace-event.js delete mode 100644 node_modules/chrome-trace-event/dist/trace-event.js.map delete mode 100644 node_modules/chrome-trace-event/package.json delete mode 100644 node_modules/clone-deep/LICENSE delete mode 100644 node_modules/clone-deep/README.md delete mode 100644 node_modules/clone-deep/index.js delete mode 100644 node_modules/clone-deep/package.json delete mode 100644 node_modules/colorette/LICENSE.md delete mode 100644 node_modules/colorette/README.md delete mode 100644 node_modules/colorette/index.cjs delete mode 100644 node_modules/colorette/index.d.ts delete mode 100644 node_modules/colorette/index.js delete mode 100644 node_modules/colorette/package.json delete mode 100644 node_modules/commander/CHANGELOG.md delete mode 100644 node_modules/commander/LICENSE delete mode 100644 node_modules/commander/Readme.md delete mode 100644 node_modules/commander/index.js delete mode 100644 node_modules/commander/package.json delete mode 100644 node_modules/commander/typings/index.d.ts delete mode 100644 node_modules/const-obj/.jshintrc delete mode 100644 node_modules/const-obj/.npmignore delete mode 100644 node_modules/const-obj/LICENSE delete mode 100644 node_modules/const-obj/README.md delete mode 100644 node_modules/const-obj/index.js delete mode 100644 node_modules/const-obj/node_modules/deep-is/.npmignore delete mode 100644 node_modules/const-obj/node_modules/deep-is/.travis.yml delete mode 100644 node_modules/const-obj/node_modules/deep-is/README.markdown delete mode 100644 node_modules/const-obj/node_modules/deep-is/example/cmp.js delete mode 100644 node_modules/const-obj/node_modules/deep-is/index.js delete mode 100644 node_modules/const-obj/node_modules/deep-is/package.json delete mode 100644 node_modules/const-obj/node_modules/deep-is/test/NaN.js delete mode 100644 node_modules/const-obj/node_modules/deep-is/test/cmp.js delete mode 100644 node_modules/const-obj/node_modules/deep-is/test/neg-vs-pos-0.js delete mode 100644 node_modules/const-obj/node_modules/is2/.jshintrc delete mode 100644 node_modules/const-obj/node_modules/is2/.npmignore delete mode 100644 node_modules/const-obj/node_modules/is2/LICENSE delete mode 100644 node_modules/const-obj/node_modules/is2/README.md delete mode 100644 node_modules/const-obj/node_modules/is2/index.js delete mode 100644 node_modules/const-obj/node_modules/is2/package.json delete mode 100644 node_modules/const-obj/node_modules/is2/tests.js delete mode 100644 node_modules/const-obj/package.json delete mode 100644 node_modules/const-obj/test.js delete mode 100644 node_modules/create-require/CHANGELOG.md delete mode 100644 node_modules/create-require/LICENSE delete mode 100644 node_modules/create-require/README.md delete mode 100644 node_modules/create-require/create-require.d.ts delete mode 100644 node_modules/create-require/create-require.js delete mode 100644 node_modules/create-require/package.json delete mode 100644 node_modules/cross-spawn/CHANGELOG.md delete mode 100644 node_modules/cross-spawn/LICENSE delete mode 100644 node_modules/cross-spawn/README.md delete mode 100644 node_modules/cross-spawn/index.js delete mode 100644 node_modules/cross-spawn/lib/enoent.js delete mode 100644 node_modules/cross-spawn/lib/parse.js delete mode 100644 node_modules/cross-spawn/lib/util/escape.js delete mode 100644 node_modules/cross-spawn/lib/util/readShebang.js delete mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js delete mode 100644 node_modules/cross-spawn/package.json delete mode 100644 node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/debug/LICENSE delete mode 100644 node_modules/debug/README.md delete mode 100644 node_modules/debug/dist/debug.js delete mode 100644 node_modules/debug/package.json delete mode 100644 node_modules/debug/src/browser.js delete mode 100644 node_modules/debug/src/common.js delete mode 100644 node_modules/debug/src/index.js delete mode 100644 node_modules/debug/src/node.js delete mode 100644 node_modules/deep-is/.travis.yml delete mode 100644 node_modules/deep-is/LICENSE delete mode 100644 node_modules/deep-is/README.markdown delete mode 100644 node_modules/deep-is/example/cmp.js delete mode 100644 node_modules/deep-is/index.js delete mode 100644 node_modules/deep-is/package.json delete mode 100644 node_modules/deep-is/test/NaN.js delete mode 100644 node_modules/deep-is/test/cmp.js delete mode 100644 node_modules/deep-is/test/neg-vs-pos-0.js delete mode 100644 node_modules/diff/CONTRIBUTING.md delete mode 100644 node_modules/diff/LICENSE delete mode 100644 node_modules/diff/README.md delete mode 100644 node_modules/diff/dist/diff.js delete mode 100644 node_modules/diff/dist/diff.min.js delete mode 100644 node_modules/diff/lib/convert/dmp.js delete mode 100644 node_modules/diff/lib/convert/xml.js delete mode 100644 node_modules/diff/lib/diff/array.js delete mode 100644 node_modules/diff/lib/diff/base.js delete mode 100644 node_modules/diff/lib/diff/character.js delete mode 100644 node_modules/diff/lib/diff/css.js delete mode 100644 node_modules/diff/lib/diff/json.js delete mode 100644 node_modules/diff/lib/diff/line.js delete mode 100644 node_modules/diff/lib/diff/sentence.js delete mode 100644 node_modules/diff/lib/diff/word.js delete mode 100644 node_modules/diff/lib/index.es6.js delete mode 100644 node_modules/diff/lib/index.js delete mode 100644 node_modules/diff/lib/patch/apply.js delete mode 100644 node_modules/diff/lib/patch/create.js delete mode 100644 node_modules/diff/lib/patch/merge.js delete mode 100644 node_modules/diff/lib/patch/parse.js delete mode 100644 node_modules/diff/lib/util/array.js delete mode 100644 node_modules/diff/lib/util/distance-iterator.js delete mode 100644 node_modules/diff/lib/util/params.js delete mode 100644 node_modules/diff/package.json delete mode 100644 node_modules/diff/release-notes.md delete mode 100644 node_modules/diff/runtime.js delete mode 100644 node_modules/electron-to-chromium/CHANGELOG.md delete mode 100644 node_modules/electron-to-chromium/LICENSE delete mode 100644 node_modules/electron-to-chromium/README.md delete mode 100644 node_modules/electron-to-chromium/chromium-versions.js delete mode 100644 node_modules/electron-to-chromium/chromium-versions.json delete mode 100644 node_modules/electron-to-chromium/full-chromium-versions.js delete mode 100644 node_modules/electron-to-chromium/full-chromium-versions.json delete mode 100644 node_modules/electron-to-chromium/full-versions.js delete mode 100644 node_modules/electron-to-chromium/full-versions.json delete mode 100644 node_modules/electron-to-chromium/index.js delete mode 100644 node_modules/electron-to-chromium/package.json delete mode 100644 node_modules/electron-to-chromium/versions.js delete mode 100644 node_modules/electron-to-chromium/versions.json delete mode 100644 node_modules/enhanced-resolve/LICENSE delete mode 100644 node_modules/enhanced-resolve/README.md delete mode 100644 node_modules/enhanced-resolve/lib/AliasFieldPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/AliasPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/AppendPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/CachedInputFileSystem.js delete mode 100644 node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ConditionalPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/DescriptionFileUtils.js delete mode 100644 node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/FileExistsPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/JoinRequestPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/LogInfoPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/MainFieldPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/NextPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ParsePlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/PnpPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/Resolver.js delete mode 100644 node_modules/enhanced-resolve/lib/ResolverFactory.js delete mode 100644 node_modules/enhanced-resolve/lib/RestrictionsPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/ResultPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/RootsPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/SelfReferencePlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/SymlinkPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js delete mode 100644 node_modules/enhanced-resolve/lib/TryNextPlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/UseFilePlugin.js delete mode 100644 node_modules/enhanced-resolve/lib/createInnerContext.js delete mode 100644 node_modules/enhanced-resolve/lib/forEachBail.js delete mode 100644 node_modules/enhanced-resolve/lib/getInnerRequest.js delete mode 100644 node_modules/enhanced-resolve/lib/getPaths.js delete mode 100644 node_modules/enhanced-resolve/lib/index.js delete mode 100644 node_modules/enhanced-resolve/lib/util/entrypoints.js delete mode 100644 node_modules/enhanced-resolve/lib/util/identifier.js delete mode 100644 node_modules/enhanced-resolve/lib/util/path.js delete mode 100644 node_modules/enhanced-resolve/lib/util/process-browser.js delete mode 100644 node_modules/enhanced-resolve/package.json delete mode 100644 node_modules/enhanced-resolve/types.d.ts delete mode 100644 node_modules/envinfo/LICENSE delete mode 100644 node_modules/envinfo/README.md delete mode 100644 node_modules/envinfo/dist/cli.js delete mode 100644 node_modules/envinfo/dist/envinfo.js delete mode 100644 node_modules/envinfo/package.json delete mode 100644 node_modules/es-module-lexer/LICENSE delete mode 100644 node_modules/es-module-lexer/README.md delete mode 100644 node_modules/es-module-lexer/dist/lexer.asm.js delete mode 100644 node_modules/es-module-lexer/dist/lexer.cjs delete mode 100644 node_modules/es-module-lexer/dist/lexer.js delete mode 100644 node_modules/es-module-lexer/lexer.js delete mode 100644 node_modules/es-module-lexer/package.json delete mode 100644 node_modules/es-module-lexer/types/lexer.d.ts delete mode 100644 node_modules/escalade/dist/index.js delete mode 100644 node_modules/escalade/dist/index.mjs delete mode 100644 node_modules/escalade/index.d.ts delete mode 100644 node_modules/escalade/license delete mode 100644 node_modules/escalade/package.json delete mode 100644 node_modules/escalade/readme.md delete mode 100644 node_modules/escalade/sync/index.d.ts delete mode 100644 node_modules/escalade/sync/index.js delete mode 100644 node_modules/escalade/sync/index.mjs delete mode 100644 node_modules/eslint-scope/CHANGELOG.md delete mode 100644 node_modules/eslint-scope/LICENSE delete mode 100644 node_modules/eslint-scope/README.md delete mode 100644 node_modules/eslint-scope/lib/definition.js delete mode 100644 node_modules/eslint-scope/lib/index.js delete mode 100644 node_modules/eslint-scope/lib/pattern-visitor.js delete mode 100644 node_modules/eslint-scope/lib/reference.js delete mode 100644 node_modules/eslint-scope/lib/referencer.js delete mode 100644 node_modules/eslint-scope/lib/scope-manager.js delete mode 100644 node_modules/eslint-scope/lib/scope.js delete mode 100644 node_modules/eslint-scope/lib/variable.js delete mode 100644 node_modules/eslint-scope/package.json delete mode 100644 node_modules/esrecurse/.babelrc delete mode 100644 node_modules/esrecurse/README.md delete mode 100644 node_modules/esrecurse/esrecurse.js delete mode 100644 node_modules/esrecurse/gulpfile.babel.js delete mode 100644 node_modules/esrecurse/node_modules/estraverse/.jshintrc delete mode 100644 node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD delete mode 100644 node_modules/esrecurse/node_modules/estraverse/README.md delete mode 100644 node_modules/esrecurse/node_modules/estraverse/estraverse.js delete mode 100644 node_modules/esrecurse/node_modules/estraverse/gulpfile.js delete mode 100644 node_modules/esrecurse/node_modules/estraverse/package.json delete mode 100644 node_modules/esrecurse/package.json delete mode 100644 node_modules/estraverse/.jshintrc delete mode 100644 node_modules/estraverse/LICENSE.BSD delete mode 100644 node_modules/estraverse/README.md delete mode 100644 node_modules/estraverse/estraverse.js delete mode 100644 node_modules/estraverse/gulpfile.js delete mode 100644 node_modules/estraverse/package.json delete mode 100644 node_modules/events/.airtap.yml delete mode 100644 node_modules/events/.github/FUNDING.yml delete mode 100644 node_modules/events/.travis.yml delete mode 100644 node_modules/events/History.md delete mode 100644 node_modules/events/LICENSE delete mode 100644 node_modules/events/Readme.md delete mode 100644 node_modules/events/events.js delete mode 100644 node_modules/events/package.json delete mode 100644 node_modules/events/security.md delete mode 100644 node_modules/events/tests/add-listeners.js delete mode 100644 node_modules/events/tests/check-listener-leaks.js delete mode 100644 node_modules/events/tests/common.js delete mode 100644 node_modules/events/tests/errors.js delete mode 100644 node_modules/events/tests/events-list.js delete mode 100644 node_modules/events/tests/events-once.js delete mode 100644 node_modules/events/tests/index.js delete mode 100644 node_modules/events/tests/legacy-compat.js delete mode 100644 node_modules/events/tests/listener-count.js delete mode 100644 node_modules/events/tests/listeners-side-effects.js delete mode 100644 node_modules/events/tests/listeners.js delete mode 100644 node_modules/events/tests/max-listeners.js delete mode 100644 node_modules/events/tests/method-names.js delete mode 100644 node_modules/events/tests/modify-in-emit.js delete mode 100644 node_modules/events/tests/num-args.js delete mode 100644 node_modules/events/tests/once.js delete mode 100644 node_modules/events/tests/prepend.js delete mode 100644 node_modules/events/tests/remove-all-listeners.js delete mode 100644 node_modules/events/tests/remove-listeners.js delete mode 100644 node_modules/events/tests/set-max-listeners-side-effects.js delete mode 100644 node_modules/events/tests/special-event-names.js delete mode 100644 node_modules/events/tests/subclass.js delete mode 100644 node_modules/events/tests/symbols.js delete mode 100644 node_modules/fast-deep-equal/LICENSE delete mode 100644 node_modules/fast-deep-equal/README.md delete mode 100644 node_modules/fast-deep-equal/es6/index.d.ts delete mode 100644 node_modules/fast-deep-equal/es6/index.js delete mode 100644 node_modules/fast-deep-equal/es6/react.d.ts delete mode 100644 node_modules/fast-deep-equal/es6/react.js delete mode 100644 node_modules/fast-deep-equal/index.d.ts delete mode 100644 node_modules/fast-deep-equal/index.js delete mode 100644 node_modules/fast-deep-equal/package.json delete mode 100644 node_modules/fast-deep-equal/react.d.ts delete mode 100644 node_modules/fast-deep-equal/react.js delete mode 100644 node_modules/fast-json-stable-stringify/.eslintrc.yml delete mode 100644 node_modules/fast-json-stable-stringify/.github/FUNDING.yml delete mode 100644 node_modules/fast-json-stable-stringify/.travis.yml delete mode 100644 node_modules/fast-json-stable-stringify/LICENSE delete mode 100644 node_modules/fast-json-stable-stringify/README.md delete mode 100644 node_modules/fast-json-stable-stringify/benchmark/index.js delete mode 100644 node_modules/fast-json-stable-stringify/benchmark/test.json delete mode 100644 node_modules/fast-json-stable-stringify/example/key_cmp.js delete mode 100644 node_modules/fast-json-stable-stringify/example/nested.js delete mode 100644 node_modules/fast-json-stable-stringify/example/str.js delete mode 100644 node_modules/fast-json-stable-stringify/example/value_cmp.js delete mode 100644 node_modules/fast-json-stable-stringify/index.d.ts delete mode 100644 node_modules/fast-json-stable-stringify/index.js delete mode 100644 node_modules/fast-json-stable-stringify/package.json delete mode 100644 node_modules/fast-json-stable-stringify/test/cmp.js delete mode 100644 node_modules/fast-json-stable-stringify/test/nested.js delete mode 100644 node_modules/fast-json-stable-stringify/test/str.js delete mode 100644 node_modules/fast-json-stable-stringify/test/to-json.js delete mode 100644 node_modules/fastest-levenshtein/.eslintrc.json delete mode 100644 node_modules/fastest-levenshtein/.prettierrc delete mode 100644 node_modules/fastest-levenshtein/.travis.yml delete mode 100644 node_modules/fastest-levenshtein/LICENSE.md delete mode 100644 node_modules/fastest-levenshtein/README.md delete mode 100644 node_modules/fastest-levenshtein/bench.js delete mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts delete mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts.map delete mode 100644 node_modules/fastest-levenshtein/esm/mod.js delete mode 100644 node_modules/fastest-levenshtein/mod.d.ts delete mode 100644 node_modules/fastest-levenshtein/mod.js delete mode 100644 node_modules/fastest-levenshtein/package.json delete mode 100644 node_modules/fastest-levenshtein/test.js delete mode 100644 node_modules/fastest-levenshtein/test.ts delete mode 100644 node_modules/find-up/index.d.ts delete mode 100644 node_modules/find-up/index.js delete mode 100644 node_modules/find-up/license delete mode 100644 node_modules/find-up/package.json delete mode 100644 node_modules/find-up/readme.md delete mode 100644 node_modules/flat/.travis.yml delete mode 100644 node_modules/flat/LICENSE delete mode 100644 node_modules/flat/README.md delete mode 100644 node_modules/flat/cli.js delete mode 100644 node_modules/flat/index.js delete mode 100644 node_modules/flat/package.json delete mode 100644 node_modules/flat/test/test.js delete mode 100644 node_modules/function-bind/.eslintrc delete mode 100644 node_modules/function-bind/.github/FUNDING.yml delete mode 100644 node_modules/function-bind/.github/SECURITY.md delete mode 100644 node_modules/function-bind/.nycrc delete mode 100644 node_modules/function-bind/CHANGELOG.md delete mode 100644 node_modules/function-bind/LICENSE delete mode 100644 node_modules/function-bind/README.md delete mode 100644 node_modules/function-bind/implementation.js delete mode 100644 node_modules/function-bind/index.js delete mode 100644 node_modules/function-bind/package.json delete mode 100644 node_modules/function-bind/test/.eslintrc delete mode 100644 node_modules/function-bind/test/index.js delete mode 100644 node_modules/glob-to-regexp/.travis.yml delete mode 100644 node_modules/glob-to-regexp/README.md delete mode 100644 node_modules/glob-to-regexp/index.js delete mode 100644 node_modules/glob-to-regexp/package.json delete mode 100644 node_modules/glob-to-regexp/test.js delete mode 100644 node_modules/graceful-fs/LICENSE delete mode 100644 node_modules/graceful-fs/README.md delete mode 100644 node_modules/graceful-fs/clone.js delete mode 100644 node_modules/graceful-fs/graceful-fs.js delete mode 100644 node_modules/graceful-fs/legacy-streams.js delete mode 100644 node_modules/graceful-fs/package.json delete mode 100644 node_modules/graceful-fs/polyfills.js delete mode 100644 node_modules/has-flag/index.d.ts delete mode 100644 node_modules/has-flag/index.js delete mode 100644 node_modules/has-flag/license delete mode 100644 node_modules/has-flag/package.json delete mode 100644 node_modules/has-flag/readme.md delete mode 100644 node_modules/hasown/.eslintrc delete mode 100644 node_modules/hasown/.github/FUNDING.yml delete mode 100644 node_modules/hasown/.nycrc delete mode 100644 node_modules/hasown/CHANGELOG.md delete mode 100644 node_modules/hasown/LICENSE delete mode 100644 node_modules/hasown/README.md delete mode 100644 node_modules/hasown/index.d.ts delete mode 100644 node_modules/hasown/index.d.ts.map delete mode 100644 node_modules/hasown/index.js delete mode 100644 node_modules/hasown/package.json delete mode 100644 node_modules/hasown/tsconfig.json delete mode 100644 node_modules/have/.npmignore delete mode 100644 node_modules/have/.travis.yml delete mode 100644 node_modules/have/Makefile delete mode 100644 node_modules/have/README.md delete mode 100644 node_modules/have/example-funcname.js delete mode 100644 node_modules/have/example.js delete mode 100644 node_modules/have/have-0.4.0.tgz delete mode 100644 node_modules/have/have.js delete mode 100644 node_modules/have/package.json delete mode 100644 node_modules/have/test.js delete mode 100644 node_modules/import-local/fixtures/cli.js delete mode 100644 node_modules/import-local/index.js delete mode 100644 node_modules/import-local/license delete mode 100644 node_modules/import-local/package.json delete mode 100644 node_modules/import-local/readme.md delete mode 100644 node_modules/interpret/LICENSE delete mode 100644 node_modules/interpret/README.md delete mode 100644 node_modules/interpret/cjs-stub.js delete mode 100644 node_modules/interpret/index.js delete mode 100644 node_modules/interpret/mjs-stub.js delete mode 100644 node_modules/interpret/package.json delete mode 100644 node_modules/ip-regex/index.d.ts delete mode 100644 node_modules/ip-regex/index.js delete mode 100644 node_modules/ip-regex/license delete mode 100644 node_modules/ip-regex/package.json delete mode 100644 node_modules/ip-regex/readme.md delete mode 100644 node_modules/is-core-module/.eslintrc delete mode 100644 node_modules/is-core-module/.nycrc delete mode 100644 node_modules/is-core-module/CHANGELOG.md delete mode 100644 node_modules/is-core-module/LICENSE delete mode 100644 node_modules/is-core-module/README.md delete mode 100644 node_modules/is-core-module/core.json delete mode 100644 node_modules/is-core-module/index.js delete mode 100644 node_modules/is-core-module/package.json delete mode 100644 node_modules/is-core-module/test/index.js delete mode 100644 node_modules/is-plain-object/LICENSE delete mode 100644 node_modules/is-plain-object/README.md delete mode 100644 node_modules/is-plain-object/index.d.ts delete mode 100644 node_modules/is-plain-object/index.js delete mode 100644 node_modules/is-plain-object/package.json delete mode 100644 node_modules/is-url/.travis.yml delete mode 100644 node_modules/is-url/History.md delete mode 100644 node_modules/is-url/LICENSE-MIT delete mode 100644 node_modules/is-url/Readme.md delete mode 100644 node_modules/is-url/index.js delete mode 100644 node_modules/is-url/package.json delete mode 100644 node_modules/is-url/test/index.js delete mode 100644 node_modules/is2/.jshintrc delete mode 100644 node_modules/is2/LICENSE delete mode 100644 node_modules/is2/README.md delete mode 100644 node_modules/is2/index.js delete mode 100644 node_modules/is2/package.json delete mode 100644 node_modules/is2/tests.js delete mode 100644 node_modules/isexe/.npmignore delete mode 100644 node_modules/isexe/LICENSE delete mode 100644 node_modules/isexe/README.md delete mode 100644 node_modules/isexe/index.js delete mode 100644 node_modules/isexe/mode.js delete mode 100644 node_modules/isexe/package.json delete mode 100644 node_modules/isexe/test/basic.js delete mode 100644 node_modules/isexe/windows.js delete mode 100644 node_modules/isobject/LICENSE delete mode 100644 node_modules/isobject/README.md delete mode 100644 node_modules/isobject/index.d.ts delete mode 100644 node_modules/isobject/index.js delete mode 100644 node_modules/isobject/package.json delete mode 100644 node_modules/jest-worker/LICENSE delete mode 100644 node_modules/jest-worker/README.md delete mode 100644 node_modules/jest-worker/build/Farm.d.ts delete mode 100644 node_modules/jest-worker/build/Farm.js delete mode 100644 node_modules/jest-worker/build/FifoQueue.d.ts delete mode 100644 node_modules/jest-worker/build/FifoQueue.js delete mode 100644 node_modules/jest-worker/build/PriorityQueue.d.ts delete mode 100644 node_modules/jest-worker/build/PriorityQueue.js delete mode 100644 node_modules/jest-worker/build/WorkerPool.d.ts delete mode 100644 node_modules/jest-worker/build/WorkerPool.js delete mode 100644 node_modules/jest-worker/build/base/BaseWorkerPool.d.ts delete mode 100644 node_modules/jest-worker/build/base/BaseWorkerPool.js delete mode 100644 node_modules/jest-worker/build/index.d.ts delete mode 100644 node_modules/jest-worker/build/index.js delete mode 100644 node_modules/jest-worker/build/types.d.ts delete mode 100644 node_modules/jest-worker/build/types.js delete mode 100644 node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts delete mode 100644 node_modules/jest-worker/build/workers/ChildProcessWorker.js delete mode 100644 node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts delete mode 100644 node_modules/jest-worker/build/workers/NodeThreadsWorker.js delete mode 100644 node_modules/jest-worker/build/workers/messageParent.d.ts delete mode 100644 node_modules/jest-worker/build/workers/messageParent.js delete mode 100644 node_modules/jest-worker/build/workers/processChild.d.ts delete mode 100644 node_modules/jest-worker/build/workers/processChild.js delete mode 100644 node_modules/jest-worker/build/workers/threadChild.d.ts delete mode 100644 node_modules/jest-worker/build/workers/threadChild.js delete mode 100644 node_modules/jest-worker/package.json delete mode 100644 node_modules/json-parse-even-better-errors/CHANGELOG.md delete mode 100644 node_modules/json-parse-even-better-errors/LICENSE.md delete mode 100644 node_modules/json-parse-even-better-errors/README.md delete mode 100644 node_modules/json-parse-even-better-errors/index.js delete mode 100644 node_modules/json-parse-even-better-errors/package.json delete mode 100644 node_modules/json-schema-traverse/.eslintrc.yml delete mode 100644 node_modules/json-schema-traverse/.travis.yml delete mode 100644 node_modules/json-schema-traverse/LICENSE delete mode 100644 node_modules/json-schema-traverse/README.md delete mode 100644 node_modules/json-schema-traverse/index.js delete mode 100644 node_modules/json-schema-traverse/package.json delete mode 100644 node_modules/json-schema-traverse/spec/.eslintrc.yml delete mode 100644 node_modules/json-schema-traverse/spec/fixtures/schema.js delete mode 100644 node_modules/json-schema-traverse/spec/index.spec.js delete mode 100644 node_modules/json5/LICENSE.md delete mode 100644 node_modules/json5/README.md delete mode 100644 node_modules/json5/dist/index.js delete mode 100644 node_modules/json5/dist/index.min.js delete mode 100644 node_modules/json5/dist/index.min.mjs delete mode 100644 node_modules/json5/dist/index.mjs delete mode 100644 node_modules/json5/lib/cli.js delete mode 100644 node_modules/json5/lib/index.d.ts delete mode 100644 node_modules/json5/lib/index.js delete mode 100644 node_modules/json5/lib/parse.d.ts delete mode 100644 node_modules/json5/lib/parse.js delete mode 100644 node_modules/json5/lib/register.js delete mode 100644 node_modules/json5/lib/require.js delete mode 100644 node_modules/json5/lib/stringify.d.ts delete mode 100644 node_modules/json5/lib/stringify.js delete mode 100644 node_modules/json5/lib/unicode.d.ts delete mode 100644 node_modules/json5/lib/unicode.js delete mode 100644 node_modules/json5/lib/util.d.ts delete mode 100644 node_modules/json5/lib/util.js delete mode 100644 node_modules/json5/package.json delete mode 100644 node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/kind-of/LICENSE delete mode 100644 node_modules/kind-of/README.md delete mode 100644 node_modules/kind-of/index.js delete mode 100644 node_modules/kind-of/package.json delete mode 100644 node_modules/loader-runner/LICENSE delete mode 100644 node_modules/loader-runner/README.md delete mode 100644 node_modules/loader-runner/lib/LoaderLoadingError.js delete mode 100644 node_modules/loader-runner/lib/LoaderRunner.js delete mode 100644 node_modules/loader-runner/lib/loadLoader.js delete mode 100644 node_modules/loader-runner/package.json delete mode 100644 node_modules/locate-path/index.d.ts delete mode 100644 node_modules/locate-path/index.js delete mode 100644 node_modules/locate-path/license delete mode 100644 node_modules/locate-path/package.json delete mode 100644 node_modules/locate-path/readme.md delete mode 100644 node_modules/lodash.filter/LICENSE delete mode 100644 node_modules/lodash.filter/README.md delete mode 100644 node_modules/lodash.filter/index.js delete mode 100644 node_modules/lodash.filter/package.json delete mode 100644 node_modules/lodash.merge/LICENSE delete mode 100644 node_modules/lodash.merge/README.md delete mode 100644 node_modules/lodash.merge/index.js delete mode 100644 node_modules/lodash.merge/package.json delete mode 100644 node_modules/make-error/LICENSE delete mode 100644 node_modules/make-error/README.md delete mode 100644 node_modules/make-error/dist/make-error.js delete mode 100644 node_modules/make-error/index.d.ts delete mode 100644 node_modules/make-error/index.js delete mode 100644 node_modules/make-error/package.json delete mode 100644 node_modules/merge-stream/LICENSE delete mode 100644 node_modules/merge-stream/README.md delete mode 100644 node_modules/merge-stream/index.js delete mode 100644 node_modules/merge-stream/package.json delete mode 100644 node_modules/mime-db/HISTORY.md delete mode 100644 node_modules/mime-db/LICENSE delete mode 100644 node_modules/mime-db/README.md delete mode 100644 node_modules/mime-db/db.json delete mode 100644 node_modules/mime-db/index.js delete mode 100644 node_modules/mime-db/package.json delete mode 100644 node_modules/mime-types/HISTORY.md delete mode 100644 node_modules/mime-types/LICENSE delete mode 100644 node_modules/mime-types/README.md delete mode 100644 node_modules/mime-types/index.js delete mode 100644 node_modules/mime-types/package.json delete mode 100644 node_modules/ms/index.js delete mode 100644 node_modules/ms/license.md delete mode 100644 node_modules/ms/package.json delete mode 100644 node_modules/ms/readme.md delete mode 100644 node_modules/neo-async/LICENSE delete mode 100644 node_modules/neo-async/README.md delete mode 100644 node_modules/neo-async/all.js delete mode 100644 node_modules/neo-async/allLimit.js delete mode 100644 node_modules/neo-async/allSeries.js delete mode 100644 node_modules/neo-async/angelFall.js delete mode 100644 node_modules/neo-async/any.js delete mode 100644 node_modules/neo-async/anyLimit.js delete mode 100644 node_modules/neo-async/anySeries.js delete mode 100644 node_modules/neo-async/apply.js delete mode 100644 node_modules/neo-async/applyEach.js delete mode 100644 node_modules/neo-async/applyEachSeries.js delete mode 100644 node_modules/neo-async/async.js delete mode 100644 node_modules/neo-async/async.min.js delete mode 100644 node_modules/neo-async/asyncify.js delete mode 100644 node_modules/neo-async/auto.js delete mode 100644 node_modules/neo-async/autoInject.js delete mode 100644 node_modules/neo-async/cargo.js delete mode 100644 node_modules/neo-async/compose.js delete mode 100644 node_modules/neo-async/concat.js delete mode 100644 node_modules/neo-async/concatLimit.js delete mode 100644 node_modules/neo-async/concatSeries.js delete mode 100644 node_modules/neo-async/constant.js delete mode 100644 node_modules/neo-async/createLogger.js delete mode 100644 node_modules/neo-async/detect.js delete mode 100644 node_modules/neo-async/detectLimit.js delete mode 100644 node_modules/neo-async/detectSeries.js delete mode 100644 node_modules/neo-async/dir.js delete mode 100644 node_modules/neo-async/doDuring.js delete mode 100644 node_modules/neo-async/doUntil.js delete mode 100644 node_modules/neo-async/doWhilst.js delete mode 100644 node_modules/neo-async/during.js delete mode 100644 node_modules/neo-async/each.js delete mode 100644 node_modules/neo-async/eachLimit.js delete mode 100644 node_modules/neo-async/eachOf.js delete mode 100644 node_modules/neo-async/eachOfLimit.js delete mode 100644 node_modules/neo-async/eachOfSeries.js delete mode 100644 node_modules/neo-async/eachSeries.js delete mode 100644 node_modules/neo-async/ensureAsync.js delete mode 100644 node_modules/neo-async/every.js delete mode 100644 node_modules/neo-async/everyLimit.js delete mode 100644 node_modules/neo-async/everySeries.js delete mode 100644 node_modules/neo-async/fast.js delete mode 100644 node_modules/neo-async/filter.js delete mode 100644 node_modules/neo-async/filterLimit.js delete mode 100644 node_modules/neo-async/filterSeries.js delete mode 100644 node_modules/neo-async/find.js delete mode 100644 node_modules/neo-async/findLimit.js delete mode 100644 node_modules/neo-async/findSeries.js delete mode 100644 node_modules/neo-async/foldl.js delete mode 100644 node_modules/neo-async/foldr.js delete mode 100644 node_modules/neo-async/forEach.js delete mode 100644 node_modules/neo-async/forEachLimit.js delete mode 100644 node_modules/neo-async/forEachOf.js delete mode 100644 node_modules/neo-async/forEachOfLimit.js delete mode 100644 node_modules/neo-async/forEachOfSeries.js delete mode 100644 node_modules/neo-async/forEachSeries.js delete mode 100644 node_modules/neo-async/forever.js delete mode 100644 node_modules/neo-async/groupBy.js delete mode 100644 node_modules/neo-async/groupByLimit.js delete mode 100644 node_modules/neo-async/groupBySeries.js delete mode 100644 node_modules/neo-async/inject.js delete mode 100644 node_modules/neo-async/iterator.js delete mode 100644 node_modules/neo-async/log.js delete mode 100644 node_modules/neo-async/map.js delete mode 100644 node_modules/neo-async/mapLimit.js delete mode 100644 node_modules/neo-async/mapSeries.js delete mode 100644 node_modules/neo-async/mapValues.js delete mode 100644 node_modules/neo-async/mapValuesLimit.js delete mode 100644 node_modules/neo-async/mapValuesSeries.js delete mode 100644 node_modules/neo-async/memoize.js delete mode 100644 node_modules/neo-async/nextTick.js delete mode 100644 node_modules/neo-async/omit.js delete mode 100644 node_modules/neo-async/omitLimit.js delete mode 100644 node_modules/neo-async/omitSeries.js delete mode 100644 node_modules/neo-async/package.json delete mode 100644 node_modules/neo-async/parallel.js delete mode 100644 node_modules/neo-async/parallelLimit.js delete mode 100644 node_modules/neo-async/pick.js delete mode 100644 node_modules/neo-async/pickLimit.js delete mode 100644 node_modules/neo-async/pickSeries.js delete mode 100644 node_modules/neo-async/priorityQueue.js delete mode 100644 node_modules/neo-async/queue.js delete mode 100644 node_modules/neo-async/race.js delete mode 100644 node_modules/neo-async/reduce.js delete mode 100644 node_modules/neo-async/reduceRight.js delete mode 100644 node_modules/neo-async/reflect.js delete mode 100644 node_modules/neo-async/reflectAll.js delete mode 100644 node_modules/neo-async/reject.js delete mode 100644 node_modules/neo-async/rejectLimit.js delete mode 100644 node_modules/neo-async/rejectSeries.js delete mode 100644 node_modules/neo-async/retry.js delete mode 100644 node_modules/neo-async/retryable.js delete mode 100644 node_modules/neo-async/safe.js delete mode 100644 node_modules/neo-async/select.js delete mode 100644 node_modules/neo-async/selectLimit.js delete mode 100644 node_modules/neo-async/selectSeries.js delete mode 100644 node_modules/neo-async/seq.js delete mode 100644 node_modules/neo-async/series.js delete mode 100644 node_modules/neo-async/setImmediate.js delete mode 100644 node_modules/neo-async/some.js delete mode 100644 node_modules/neo-async/someLimit.js delete mode 100644 node_modules/neo-async/someSeries.js delete mode 100644 node_modules/neo-async/sortBy.js delete mode 100644 node_modules/neo-async/sortByLimit.js delete mode 100644 node_modules/neo-async/sortBySeries.js delete mode 100644 node_modules/neo-async/timeout.js delete mode 100644 node_modules/neo-async/times.js delete mode 100644 node_modules/neo-async/timesLimit.js delete mode 100644 node_modules/neo-async/timesSeries.js delete mode 100644 node_modules/neo-async/transform.js delete mode 100644 node_modules/neo-async/transformLimit.js delete mode 100644 node_modules/neo-async/transformSeries.js delete mode 100644 node_modules/neo-async/tryEach.js delete mode 100644 node_modules/neo-async/unmemoize.js delete mode 100644 node_modules/neo-async/until.js delete mode 100644 node_modules/neo-async/waterfall.js delete mode 100644 node_modules/neo-async/whilst.js delete mode 100644 node_modules/neo-async/wrapSync.js delete mode 100644 node_modules/node-releases/LICENSE delete mode 100644 node_modules/node-releases/README.md delete mode 100644 node_modules/node-releases/data/processed/envs.json delete mode 100644 node_modules/node-releases/data/release-schedule/release-schedule.json delete mode 100644 node_modules/node-releases/package.json delete mode 100644 node_modules/p-limit/index.d.ts delete mode 100644 node_modules/p-limit/index.js delete mode 100644 node_modules/p-limit/license delete mode 100644 node_modules/p-limit/package.json delete mode 100644 node_modules/p-limit/readme.md delete mode 100644 node_modules/p-locate/index.d.ts delete mode 100644 node_modules/p-locate/index.js delete mode 100644 node_modules/p-locate/license delete mode 100644 node_modules/p-locate/package.json delete mode 100644 node_modules/p-locate/readme.md delete mode 100644 node_modules/p-try/index.d.ts delete mode 100644 node_modules/p-try/index.js delete mode 100644 node_modules/p-try/license delete mode 100644 node_modules/p-try/package.json delete mode 100644 node_modules/p-try/readme.md delete mode 100644 node_modules/path-exists/index.d.ts delete mode 100644 node_modules/path-exists/index.js delete mode 100644 node_modules/path-exists/license delete mode 100644 node_modules/path-exists/package.json delete mode 100644 node_modules/path-exists/readme.md delete mode 100644 node_modules/path-key/index.d.ts delete mode 100644 node_modules/path-key/index.js delete mode 100644 node_modules/path-key/license delete mode 100644 node_modules/path-key/package.json delete mode 100644 node_modules/path-key/readme.md delete mode 100644 node_modules/path-parse/LICENSE delete mode 100644 node_modules/path-parse/README.md delete mode 100644 node_modules/path-parse/index.js delete mode 100644 node_modules/path-parse/package.json delete mode 100644 node_modules/picocolors/LICENSE delete mode 100644 node_modules/picocolors/README.md delete mode 100644 node_modules/picocolors/package.json delete mode 100644 node_modules/picocolors/picocolors.browser.js delete mode 100644 node_modules/picocolors/picocolors.d.ts delete mode 100644 node_modules/picocolors/picocolors.js delete mode 100644 node_modules/picocolors/types.ts delete mode 100644 node_modules/pkg-dir/index.d.ts delete mode 100644 node_modules/pkg-dir/index.js delete mode 100644 node_modules/pkg-dir/license delete mode 100644 node_modules/pkg-dir/package.json delete mode 100644 node_modules/pkg-dir/readme.md delete mode 100644 node_modules/property-path/.jshintrc delete mode 100644 node_modules/property-path/LICENSE delete mode 100644 node_modules/property-path/README.md delete mode 100644 node_modules/property-path/index.js delete mode 100644 node_modules/property-path/node_modules/ip-regex/index.js delete mode 100644 node_modules/property-path/node_modules/ip-regex/license delete mode 100644 node_modules/property-path/node_modules/ip-regex/package.json delete mode 100644 node_modules/property-path/node_modules/ip-regex/readme.md delete mode 100644 node_modules/property-path/node_modules/is2/.jshintrc delete mode 100644 node_modules/property-path/node_modules/is2/LICENSE delete mode 100644 node_modules/property-path/node_modules/is2/README.md delete mode 100644 node_modules/property-path/node_modules/is2/index.js delete mode 100644 node_modules/property-path/node_modules/is2/package.json delete mode 100644 node_modules/property-path/node_modules/is2/tests.js delete mode 100644 node_modules/property-path/package.json delete mode 100644 node_modules/property-path/test.js delete mode 100644 node_modules/punycode/LICENSE-MIT.txt delete mode 100644 node_modules/punycode/README.md delete mode 100644 node_modules/punycode/package.json delete mode 100644 node_modules/punycode/punycode.es6.js delete mode 100644 node_modules/punycode/punycode.js delete mode 100644 node_modules/randombytes/.travis.yml delete mode 100644 node_modules/randombytes/.zuul.yml delete mode 100644 node_modules/randombytes/LICENSE delete mode 100644 node_modules/randombytes/README.md delete mode 100644 node_modules/randombytes/browser.js delete mode 100644 node_modules/randombytes/index.js delete mode 100644 node_modules/randombytes/package.json delete mode 100644 node_modules/randombytes/test.js delete mode 100644 node_modules/rechoir/CHANGELOG.md delete mode 100644 node_modules/rechoir/LICENSE delete mode 100644 node_modules/rechoir/README.md delete mode 100644 node_modules/rechoir/index.js delete mode 100644 node_modules/rechoir/lib/extension.js delete mode 100644 node_modules/rechoir/lib/normalize.js delete mode 100644 node_modules/rechoir/lib/register.js delete mode 100644 node_modules/rechoir/package.json delete mode 100644 node_modules/resolve-cwd/index.d.ts delete mode 100644 node_modules/resolve-cwd/index.js delete mode 100644 node_modules/resolve-cwd/license delete mode 100644 node_modules/resolve-cwd/package.json delete mode 100644 node_modules/resolve-cwd/readme.md delete mode 100644 node_modules/resolve-from/index.d.ts delete mode 100644 node_modules/resolve-from/index.js delete mode 100644 node_modules/resolve-from/license delete mode 100644 node_modules/resolve-from/package.json delete mode 100644 node_modules/resolve-from/readme.md delete mode 100644 node_modules/resolve/.editorconfig delete mode 100644 node_modules/resolve/.eslintrc delete mode 100644 node_modules/resolve/.github/FUNDING.yml delete mode 100644 node_modules/resolve/LICENSE delete mode 100644 node_modules/resolve/SECURITY.md delete mode 100644 node_modules/resolve/async.js delete mode 100644 node_modules/resolve/bin/resolve delete mode 100644 node_modules/resolve/example/async.js delete mode 100644 node_modules/resolve/example/sync.js delete mode 100644 node_modules/resolve/index.js delete mode 100644 node_modules/resolve/lib/async.js delete mode 100644 node_modules/resolve/lib/caller.js delete mode 100644 node_modules/resolve/lib/core.js delete mode 100644 node_modules/resolve/lib/core.json delete mode 100644 node_modules/resolve/lib/homedir.js delete mode 100644 node_modules/resolve/lib/is-core.js delete mode 100644 node_modules/resolve/lib/node-modules-paths.js delete mode 100644 node_modules/resolve/lib/normalize-options.js delete mode 100644 node_modules/resolve/lib/sync.js delete mode 100644 node_modules/resolve/package.json delete mode 100644 node_modules/resolve/readme.markdown delete mode 100644 node_modules/resolve/sync.js delete mode 100644 node_modules/resolve/test/core.js delete mode 100644 node_modules/resolve/test/dotdot.js delete mode 100644 node_modules/resolve/test/dotdot/abc/index.js delete mode 100644 node_modules/resolve/test/dotdot/index.js delete mode 100644 node_modules/resolve/test/faulty_basedir.js delete mode 100644 node_modules/resolve/test/filter.js delete mode 100644 node_modules/resolve/test/filter_sync.js delete mode 100644 node_modules/resolve/test/home_paths.js delete mode 100644 node_modules/resolve/test/home_paths_sync.js delete mode 100644 node_modules/resolve/test/mock.js delete mode 100644 node_modules/resolve/test/mock_sync.js delete mode 100644 node_modules/resolve/test/module_dir.js delete mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json delete mode 100644 node_modules/resolve/test/node-modules-paths.js delete mode 100644 node_modules/resolve/test/node_path.js delete mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js delete mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js delete mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js delete mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js delete mode 100644 node_modules/resolve/test/nonstring.js delete mode 100644 node_modules/resolve/test/pathfilter.js delete mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js delete mode 100644 node_modules/resolve/test/precedence.js delete mode 100644 node_modules/resolve/test/precedence/aaa.js delete mode 100644 node_modules/resolve/test/precedence/aaa/index.js delete mode 100644 node_modules/resolve/test/precedence/aaa/main.js delete mode 100644 node_modules/resolve/test/precedence/bbb.js delete mode 100644 node_modules/resolve/test/precedence/bbb/main.js delete mode 100644 node_modules/resolve/test/resolver.js delete mode 100644 node_modules/resolve/test/resolver/baz/doom.js delete mode 100644 node_modules/resolve/test/resolver/baz/package.json delete mode 100644 node_modules/resolve/test/resolver/baz/quux.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/a.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/b.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/package.json delete mode 100644 node_modules/resolve/test/resolver/cup.coffee delete mode 100644 node_modules/resolve/test/resolver/dot_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_main/package.json delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json delete mode 100644 node_modules/resolve/test/resolver/false_main/index.js delete mode 100644 node_modules/resolve/test/resolver/false_main/package.json delete mode 100644 node_modules/resolve/test/resolver/foo.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json delete mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json delete mode 100644 node_modules/resolve/test/resolver/mug.coffee delete mode 100644 node_modules/resolve/test/resolver/mug.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/package.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js delete mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json delete mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js delete mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js delete mode 100644 node_modules/resolve/test/resolver/other_path/root.js delete mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep delete mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json delete mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js delete mode 100644 node_modules/resolve/test/resolver_sync.js delete mode 100644 node_modules/resolve/test/shadowed_core.js delete mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js delete mode 100644 node_modules/resolve/test/subdirs.js delete mode 100644 node_modules/resolve/test/symlinks.js delete mode 100644 node_modules/safe-buffer/LICENSE delete mode 100644 node_modules/safe-buffer/README.md delete mode 100644 node_modules/safe-buffer/index.d.ts delete mode 100644 node_modules/safe-buffer/index.js delete mode 100644 node_modules/safe-buffer/package.json delete mode 100644 node_modules/schema-utils/CHANGELOG.md delete mode 100644 node_modules/schema-utils/LICENSE delete mode 100644 node_modules/schema-utils/README.md delete mode 100644 node_modules/schema-utils/declarations/ValidationError.d.ts delete mode 100644 node_modules/schema-utils/declarations/index.d.ts delete mode 100644 node_modules/schema-utils/declarations/keywords/absolutePath.d.ts delete mode 100644 node_modules/schema-utils/declarations/keywords/undefinedAsNull.d.ts delete mode 100644 node_modules/schema-utils/declarations/util/Range.d.ts delete mode 100644 node_modules/schema-utils/declarations/util/hints.d.ts delete mode 100644 node_modules/schema-utils/declarations/validate.d.ts delete mode 100644 node_modules/schema-utils/dist/ValidationError.js delete mode 100644 node_modules/schema-utils/dist/index.js delete mode 100644 node_modules/schema-utils/dist/keywords/absolutePath.js delete mode 100644 node_modules/schema-utils/dist/keywords/undefinedAsNull.js delete mode 100644 node_modules/schema-utils/dist/util/Range.js delete mode 100644 node_modules/schema-utils/dist/util/hints.js delete mode 100644 node_modules/schema-utils/dist/validate.js delete mode 100644 node_modules/schema-utils/package.json delete mode 100644 node_modules/serialize-javascript/LICENSE delete mode 100644 node_modules/serialize-javascript/README.md delete mode 100644 node_modules/serialize-javascript/index.js delete mode 100644 node_modules/serialize-javascript/package.json delete mode 100644 node_modules/shallow-clone/LICENSE delete mode 100644 node_modules/shallow-clone/README.md delete mode 100644 node_modules/shallow-clone/index.js delete mode 100644 node_modules/shallow-clone/package.json delete mode 100644 node_modules/shebang-command/index.js delete mode 100644 node_modules/shebang-command/license delete mode 100644 node_modules/shebang-command/package.json delete mode 100644 node_modules/shebang-command/readme.md delete mode 100644 node_modules/shebang-regex/index.d.ts delete mode 100644 node_modules/shebang-regex/index.js delete mode 100644 node_modules/shebang-regex/license delete mode 100644 node_modules/shebang-regex/package.json delete mode 100644 node_modules/shebang-regex/readme.md delete mode 100644 node_modules/source-map-support/LICENSE.md delete mode 100644 node_modules/source-map-support/README.md delete mode 100644 node_modules/source-map-support/browser-source-map-support.js delete mode 100644 node_modules/source-map-support/package.json delete mode 100644 node_modules/source-map-support/register-hook-require.js delete mode 100644 node_modules/source-map-support/register.js delete mode 100644 node_modules/source-map-support/source-map-support.js delete mode 100644 node_modules/source-map/CHANGELOG.md delete mode 100644 node_modules/source-map/LICENSE delete mode 100644 node_modules/source-map/README.md delete mode 100644 node_modules/source-map/dist/source-map.debug.js delete mode 100644 node_modules/source-map/dist/source-map.js delete mode 100644 node_modules/source-map/dist/source-map.min.js delete mode 100644 node_modules/source-map/dist/source-map.min.js.map delete mode 100644 node_modules/source-map/lib/array-set.js delete mode 100644 node_modules/source-map/lib/base64-vlq.js delete mode 100644 node_modules/source-map/lib/base64.js delete mode 100644 node_modules/source-map/lib/binary-search.js delete mode 100644 node_modules/source-map/lib/mapping-list.js delete mode 100644 node_modules/source-map/lib/quick-sort.js delete mode 100644 node_modules/source-map/lib/source-map-consumer.js delete mode 100644 node_modules/source-map/lib/source-map-generator.js delete mode 100644 node_modules/source-map/lib/source-node.js delete mode 100644 node_modules/source-map/lib/util.js delete mode 100644 node_modules/source-map/package.json delete mode 100644 node_modules/source-map/source-map.d.ts delete mode 100644 node_modules/source-map/source-map.js delete mode 100644 node_modules/supports-color/browser.js delete mode 100644 node_modules/supports-color/index.js delete mode 100644 node_modules/supports-color/license delete mode 100644 node_modules/supports-color/package.json delete mode 100644 node_modules/supports-color/readme.md delete mode 100644 node_modules/supports-preserve-symlinks-flag/.eslintrc delete mode 100644 node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml delete mode 100644 node_modules/supports-preserve-symlinks-flag/.nycrc delete mode 100644 node_modules/supports-preserve-symlinks-flag/CHANGELOG.md delete mode 100644 node_modules/supports-preserve-symlinks-flag/LICENSE delete mode 100644 node_modules/supports-preserve-symlinks-flag/README.md delete mode 100644 node_modules/supports-preserve-symlinks-flag/browser.js delete mode 100644 node_modules/supports-preserve-symlinks-flag/index.js delete mode 100644 node_modules/supports-preserve-symlinks-flag/package.json delete mode 100644 node_modules/supports-preserve-symlinks-flag/test/index.js delete mode 100644 node_modules/tapable/LICENSE delete mode 100644 node_modules/tapable/README.md delete mode 100644 node_modules/tapable/lib/AsyncParallelBailHook.js delete mode 100644 node_modules/tapable/lib/AsyncParallelHook.js delete mode 100644 node_modules/tapable/lib/AsyncSeriesBailHook.js delete mode 100644 node_modules/tapable/lib/AsyncSeriesHook.js delete mode 100644 node_modules/tapable/lib/AsyncSeriesLoopHook.js delete mode 100644 node_modules/tapable/lib/AsyncSeriesWaterfallHook.js delete mode 100644 node_modules/tapable/lib/Hook.js delete mode 100644 node_modules/tapable/lib/HookCodeFactory.js delete mode 100644 node_modules/tapable/lib/HookMap.js delete mode 100644 node_modules/tapable/lib/MultiHook.js delete mode 100644 node_modules/tapable/lib/SyncBailHook.js delete mode 100644 node_modules/tapable/lib/SyncHook.js delete mode 100644 node_modules/tapable/lib/SyncLoopHook.js delete mode 100644 node_modules/tapable/lib/SyncWaterfallHook.js delete mode 100644 node_modules/tapable/lib/index.js delete mode 100644 node_modules/tapable/lib/util-browser.js delete mode 100644 node_modules/tapable/package.json delete mode 100644 node_modules/tapable/tapable.d.ts delete mode 100644 node_modules/terser-webpack-plugin/LICENSE delete mode 100644 node_modules/terser-webpack-plugin/README.md delete mode 100644 node_modules/terser-webpack-plugin/dist/index.js delete mode 100644 node_modules/terser-webpack-plugin/dist/minify.js delete mode 100644 node_modules/terser-webpack-plugin/dist/options.json delete mode 100644 node_modules/terser-webpack-plugin/dist/utils.js delete mode 100644 node_modules/terser-webpack-plugin/package.json delete mode 100644 node_modules/terser-webpack-plugin/types/index.d.ts delete mode 100644 node_modules/terser-webpack-plugin/types/minify.d.ts delete mode 100644 node_modules/terser-webpack-plugin/types/utils.d.ts delete mode 100644 node_modules/terser/CHANGELOG.md delete mode 100644 node_modules/terser/LICENSE delete mode 100644 node_modules/terser/PATRONS.md delete mode 100644 node_modules/terser/README.md delete mode 100644 node_modules/terser/bin/package.json delete mode 100644 node_modules/terser/bin/terser delete mode 100644 node_modules/terser/bin/uglifyjs delete mode 100644 node_modules/terser/dist/.gitkeep delete mode 100644 node_modules/terser/dist/bundle.min.js delete mode 100644 node_modules/terser/dist/package.json delete mode 100644 node_modules/terser/lib/ast.js delete mode 100644 node_modules/terser/lib/cli.js delete mode 100644 node_modules/terser/lib/compress/common.js delete mode 100644 node_modules/terser/lib/compress/compressor-flags.js delete mode 100644 node_modules/terser/lib/compress/drop-side-effect-free.js delete mode 100644 node_modules/terser/lib/compress/drop-unused.js delete mode 100644 node_modules/terser/lib/compress/evaluate.js delete mode 100644 node_modules/terser/lib/compress/global-defs.js delete mode 100644 node_modules/terser/lib/compress/index.js delete mode 100644 node_modules/terser/lib/compress/inference.js delete mode 100644 node_modules/terser/lib/compress/inline.js delete mode 100644 node_modules/terser/lib/compress/native-objects.js delete mode 100644 node_modules/terser/lib/compress/reduce-vars.js delete mode 100644 node_modules/terser/lib/compress/tighten-body.js delete mode 100644 node_modules/terser/lib/equivalent-to.js delete mode 100644 node_modules/terser/lib/minify.js delete mode 100644 node_modules/terser/lib/mozilla-ast.js delete mode 100644 node_modules/terser/lib/output.js delete mode 100644 node_modules/terser/lib/parse.js delete mode 100644 node_modules/terser/lib/propmangle.js delete mode 100644 node_modules/terser/lib/scope.js delete mode 100644 node_modules/terser/lib/size.js delete mode 100644 node_modules/terser/lib/sourcemap.js delete mode 100644 node_modules/terser/lib/transform.js delete mode 100644 node_modules/terser/lib/utils/first_in_statement.js delete mode 100644 node_modules/terser/lib/utils/index.js delete mode 100644 node_modules/terser/main.js delete mode 100644 node_modules/terser/package.json delete mode 100644 node_modules/terser/tools/domprops.js delete mode 100644 node_modules/terser/tools/exit.cjs delete mode 100644 node_modules/terser/tools/props.html delete mode 100644 node_modules/terser/tools/terser.d.ts delete mode 100644 node_modules/ts-node/LICENSE delete mode 100644 node_modules/ts-node/README.md delete mode 100644 node_modules/ts-node/child-loader.mjs delete mode 100644 node_modules/ts-node/dist-raw/NODE-LICENSE.md delete mode 100644 node_modules/ts-node/dist-raw/README.md delete mode 100644 node_modules/ts-node/dist-raw/node-internal-constants.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-errors.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js delete mode 100644 node_modules/ts-node/dist-raw/node-internal-repl-await.js delete mode 100644 node_modules/ts-node/dist-raw/node-internalBinding-fs.js delete mode 100644 node_modules/ts-node/dist-raw/node-nativemodule.js delete mode 100644 node_modules/ts-node/dist-raw/node-options.js delete mode 100644 node_modules/ts-node/dist-raw/node-primordials.js delete mode 100644 node_modules/ts-node/dist-raw/runmain-hack.js delete mode 100644 node_modules/ts-node/dist/bin-cwd.d.ts delete mode 100644 node_modules/ts-node/dist/bin-cwd.js delete mode 100644 node_modules/ts-node/dist/bin-cwd.js.map delete mode 100644 node_modules/ts-node/dist/bin-esm.d.ts delete mode 100644 node_modules/ts-node/dist/bin-esm.js delete mode 100644 node_modules/ts-node/dist/bin-esm.js.map delete mode 100644 node_modules/ts-node/dist/bin-script-deprecated.d.ts delete mode 100644 node_modules/ts-node/dist/bin-script-deprecated.js delete mode 100644 node_modules/ts-node/dist/bin-script-deprecated.js.map delete mode 100644 node_modules/ts-node/dist/bin-script.d.ts delete mode 100644 node_modules/ts-node/dist/bin-script.js delete mode 100644 node_modules/ts-node/dist/bin-script.js.map delete mode 100644 node_modules/ts-node/dist/bin-transpile.d.ts delete mode 100644 node_modules/ts-node/dist/bin-transpile.js delete mode 100644 node_modules/ts-node/dist/bin-transpile.js.map delete mode 100644 node_modules/ts-node/dist/bin.d.ts delete mode 100644 node_modules/ts-node/dist/bin.js delete mode 100644 node_modules/ts-node/dist/bin.js.map delete mode 100644 node_modules/ts-node/dist/child/argv-payload.d.ts delete mode 100644 node_modules/ts-node/dist/child/argv-payload.js delete mode 100644 node_modules/ts-node/dist/child/argv-payload.js.map delete mode 100644 node_modules/ts-node/dist/child/child-entrypoint.d.ts delete mode 100644 node_modules/ts-node/dist/child/child-entrypoint.js delete mode 100644 node_modules/ts-node/dist/child/child-entrypoint.js.map delete mode 100644 node_modules/ts-node/dist/child/child-loader.d.ts delete mode 100644 node_modules/ts-node/dist/child/child-loader.js delete mode 100644 node_modules/ts-node/dist/child/child-loader.js.map delete mode 100644 node_modules/ts-node/dist/child/child-require.d.ts delete mode 100644 node_modules/ts-node/dist/child/child-require.js delete mode 100644 node_modules/ts-node/dist/child/child-require.js.map delete mode 100644 node_modules/ts-node/dist/child/spawn-child.d.ts delete mode 100644 node_modules/ts-node/dist/child/spawn-child.js delete mode 100644 node_modules/ts-node/dist/child/spawn-child.js.map delete mode 100644 node_modules/ts-node/dist/cjs-resolve-hooks.d.ts delete mode 100644 node_modules/ts-node/dist/cjs-resolve-hooks.js delete mode 100644 node_modules/ts-node/dist/cjs-resolve-hooks.js.map delete mode 100644 node_modules/ts-node/dist/configuration.d.ts delete mode 100644 node_modules/ts-node/dist/configuration.js delete mode 100644 node_modules/ts-node/dist/configuration.js.map delete mode 100644 node_modules/ts-node/dist/esm.d.ts delete mode 100644 node_modules/ts-node/dist/esm.js delete mode 100644 node_modules/ts-node/dist/esm.js.map delete mode 100644 node_modules/ts-node/dist/file-extensions.d.ts delete mode 100644 node_modules/ts-node/dist/file-extensions.js delete mode 100644 node_modules/ts-node/dist/file-extensions.js.map delete mode 100644 node_modules/ts-node/dist/index.d.ts delete mode 100644 node_modules/ts-node/dist/index.js delete mode 100644 node_modules/ts-node/dist/index.js.map delete mode 100644 node_modules/ts-node/dist/module-type-classifier.d.ts delete mode 100644 node_modules/ts-node/dist/module-type-classifier.js delete mode 100644 node_modules/ts-node/dist/module-type-classifier.js.map delete mode 100644 node_modules/ts-node/dist/node-module-type-classifier.d.ts delete mode 100644 node_modules/ts-node/dist/node-module-type-classifier.js delete mode 100644 node_modules/ts-node/dist/node-module-type-classifier.js.map delete mode 100644 node_modules/ts-node/dist/repl.d.ts delete mode 100644 node_modules/ts-node/dist/repl.js delete mode 100644 node_modules/ts-node/dist/repl.js.map delete mode 100644 node_modules/ts-node/dist/resolver-functions.d.ts delete mode 100644 node_modules/ts-node/dist/resolver-functions.js delete mode 100644 node_modules/ts-node/dist/resolver-functions.js.map delete mode 100644 node_modules/ts-node/dist/transpilers/swc.d.ts delete mode 100644 node_modules/ts-node/dist/transpilers/swc.js delete mode 100644 node_modules/ts-node/dist/transpilers/swc.js.map delete mode 100644 node_modules/ts-node/dist/transpilers/types.d.ts delete mode 100644 node_modules/ts-node/dist/transpilers/types.js delete mode 100644 node_modules/ts-node/dist/transpilers/types.js.map delete mode 100644 node_modules/ts-node/dist/ts-compiler-types.d.ts delete mode 100644 node_modules/ts-node/dist/ts-compiler-types.js delete mode 100644 node_modules/ts-node/dist/ts-compiler-types.js.map delete mode 100644 node_modules/ts-node/dist/ts-internals.d.ts delete mode 100644 node_modules/ts-node/dist/ts-internals.js delete mode 100644 node_modules/ts-node/dist/ts-internals.js.map delete mode 100644 node_modules/ts-node/dist/ts-transpile-module.d.ts delete mode 100644 node_modules/ts-node/dist/ts-transpile-module.js delete mode 100644 node_modules/ts-node/dist/ts-transpile-module.js.map delete mode 100644 node_modules/ts-node/dist/tsconfig-schema.d.ts delete mode 100644 node_modules/ts-node/dist/tsconfig-schema.js delete mode 100644 node_modules/ts-node/dist/tsconfig-schema.js.map delete mode 100644 node_modules/ts-node/dist/tsconfigs.d.ts delete mode 100644 node_modules/ts-node/dist/tsconfigs.js delete mode 100644 node_modules/ts-node/dist/tsconfigs.js.map delete mode 100644 node_modules/ts-node/dist/util.d.ts delete mode 100644 node_modules/ts-node/dist/util.js delete mode 100644 node_modules/ts-node/dist/util.js.map delete mode 100644 node_modules/ts-node/esm.mjs delete mode 100644 node_modules/ts-node/esm/transpile-only.mjs delete mode 100644 node_modules/ts-node/node10/tsconfig.json delete mode 100644 node_modules/ts-node/node12/tsconfig.json delete mode 100644 node_modules/ts-node/node14/tsconfig.json delete mode 100644 node_modules/ts-node/node16/tsconfig.json delete mode 100644 node_modules/ts-node/package.json delete mode 100644 node_modules/ts-node/register/files.js delete mode 100644 node_modules/ts-node/register/index.js delete mode 100644 node_modules/ts-node/register/transpile-only.js delete mode 100644 node_modules/ts-node/register/type-check.js delete mode 100644 node_modules/ts-node/transpilers/swc-experimental.js delete mode 100644 node_modules/ts-node/transpilers/swc.js delete mode 100644 node_modules/ts-node/tsconfig.schema.json delete mode 100644 node_modules/ts-node/tsconfig.schemastore-schema.json delete mode 100644 node_modules/undici-types/README.md delete mode 100644 node_modules/undici-types/agent.d.ts delete mode 100644 node_modules/undici-types/api.d.ts delete mode 100644 node_modules/undici-types/balanced-pool.d.ts delete mode 100644 node_modules/undici-types/cache.d.ts delete mode 100644 node_modules/undici-types/client.d.ts delete mode 100644 node_modules/undici-types/connector.d.ts delete mode 100644 node_modules/undici-types/content-type.d.ts delete mode 100644 node_modules/undici-types/cookies.d.ts delete mode 100644 node_modules/undici-types/diagnostics-channel.d.ts delete mode 100644 node_modules/undici-types/dispatcher.d.ts delete mode 100644 node_modules/undici-types/errors.d.ts delete mode 100644 node_modules/undici-types/fetch.d.ts delete mode 100644 node_modules/undici-types/file.d.ts delete mode 100644 node_modules/undici-types/filereader.d.ts delete mode 100644 node_modules/undici-types/formdata.d.ts delete mode 100644 node_modules/undici-types/global-dispatcher.d.ts delete mode 100644 node_modules/undici-types/global-origin.d.ts delete mode 100644 node_modules/undici-types/handlers.d.ts delete mode 100644 node_modules/undici-types/header.d.ts delete mode 100644 node_modules/undici-types/index.d.ts delete mode 100644 node_modules/undici-types/interceptors.d.ts delete mode 100644 node_modules/undici-types/mock-agent.d.ts delete mode 100644 node_modules/undici-types/mock-client.d.ts delete mode 100644 node_modules/undici-types/mock-errors.d.ts delete mode 100644 node_modules/undici-types/mock-interceptor.d.ts delete mode 100644 node_modules/undici-types/mock-pool.d.ts delete mode 100644 node_modules/undici-types/package.json delete mode 100644 node_modules/undici-types/patch.d.ts delete mode 100644 node_modules/undici-types/pool-stats.d.ts delete mode 100644 node_modules/undici-types/pool.d.ts delete mode 100644 node_modules/undici-types/proxy-agent.d.ts delete mode 100644 node_modules/undici-types/readable.d.ts delete mode 100644 node_modules/undici-types/webidl.d.ts delete mode 100644 node_modules/undici-types/websocket.d.ts delete mode 100644 node_modules/update-browserslist-db/LICENSE delete mode 100644 node_modules/update-browserslist-db/README.md delete mode 100644 node_modules/update-browserslist-db/check-npm-version.js delete mode 100644 node_modules/update-browserslist-db/cli.js delete mode 100644 node_modules/update-browserslist-db/index.d.ts delete mode 100644 node_modules/update-browserslist-db/index.js delete mode 100644 node_modules/update-browserslist-db/package.json delete mode 100644 node_modules/update-browserslist-db/utils.js delete mode 100644 node_modules/uri-js/LICENSE delete mode 100644 node_modules/uri-js/README.md delete mode 100644 node_modules/uri-js/dist/es5/uri.all.d.ts delete mode 100644 node_modules/uri-js/dist/es5/uri.all.js delete mode 100644 node_modules/uri-js/dist/es5/uri.all.js.map delete mode 100644 node_modules/uri-js/dist/es5/uri.all.min.d.ts delete mode 100644 node_modules/uri-js/dist/es5/uri.all.min.js delete mode 100644 node_modules/uri-js/dist/es5/uri.all.min.js.map delete mode 100644 node_modules/uri-js/dist/esnext/index.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/index.js delete mode 100644 node_modules/uri-js/dist/esnext/index.js.map delete mode 100644 node_modules/uri-js/dist/esnext/regexps-iri.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/regexps-iri.js delete mode 100644 node_modules/uri-js/dist/esnext/regexps-iri.js.map delete mode 100644 node_modules/uri-js/dist/esnext/regexps-uri.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/regexps-uri.js delete mode 100644 node_modules/uri-js/dist/esnext/regexps-uri.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/http.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/http.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/http.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/https.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/https.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/https.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/mailto.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/mailto.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/urn.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/urn.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/urn.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/ws.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/ws.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/ws.js.map delete mode 100644 node_modules/uri-js/dist/esnext/schemes/wss.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/schemes/wss.js delete mode 100644 node_modules/uri-js/dist/esnext/schemes/wss.js.map delete mode 100644 node_modules/uri-js/dist/esnext/uri.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/uri.js delete mode 100644 node_modules/uri-js/dist/esnext/uri.js.map delete mode 100644 node_modules/uri-js/dist/esnext/util.d.ts delete mode 100644 node_modules/uri-js/dist/esnext/util.js delete mode 100644 node_modules/uri-js/dist/esnext/util.js.map delete mode 100644 node_modules/uri-js/package.json delete mode 100644 node_modules/uri-js/yarn.lock delete mode 100644 node_modules/v8-compile-cache-lib/CHANGELOG.md delete mode 100644 node_modules/v8-compile-cache-lib/LICENSE delete mode 100644 node_modules/v8-compile-cache-lib/README.md delete mode 100644 node_modules/v8-compile-cache-lib/package.json delete mode 100644 node_modules/v8-compile-cache-lib/v8-compile-cache.d.ts delete mode 100644 node_modules/v8-compile-cache-lib/v8-compile-cache.js delete mode 100644 node_modules/watchpack/LICENSE delete mode 100644 node_modules/watchpack/README.md delete mode 100644 node_modules/watchpack/lib/DirectoryWatcher.js delete mode 100644 node_modules/watchpack/lib/LinkResolver.js delete mode 100644 node_modules/watchpack/lib/getWatcherManager.js delete mode 100644 node_modules/watchpack/lib/reducePlan.js delete mode 100644 node_modules/watchpack/lib/watchEventSource.js delete mode 100644 node_modules/watchpack/lib/watchpack.js delete mode 100644 node_modules/watchpack/package.json delete mode 100644 node_modules/webpack-cli/LICENSE delete mode 100644 node_modules/webpack-cli/README.md delete mode 100644 node_modules/webpack-cli/bin/cli.js delete mode 100644 node_modules/webpack-cli/lib/bootstrap.d.ts delete mode 100644 node_modules/webpack-cli/lib/bootstrap.js delete mode 100644 node_modules/webpack-cli/lib/index.d.ts delete mode 100644 node_modules/webpack-cli/lib/index.js delete mode 100644 node_modules/webpack-cli/lib/plugins/cli-plugin.d.ts delete mode 100644 node_modules/webpack-cli/lib/plugins/cli-plugin.js delete mode 100644 node_modules/webpack-cli/lib/types.d.ts delete mode 100644 node_modules/webpack-cli/lib/types.js delete mode 100644 node_modules/webpack-cli/lib/utils/dynamic-import-loader.d.ts delete mode 100644 node_modules/webpack-cli/lib/utils/dynamic-import-loader.js delete mode 100644 node_modules/webpack-cli/lib/webpack-cli.d.ts delete mode 100644 node_modules/webpack-cli/lib/webpack-cli.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/LICENSE delete mode 100644 node_modules/webpack-cli/node_modules/commander/Readme.md delete mode 100644 node_modules/webpack-cli/node_modules/commander/esm.mjs delete mode 100644 node_modules/webpack-cli/node_modules/commander/index.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/lib/argument.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/lib/command.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/lib/error.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/lib/help.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/lib/option.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/lib/suggestSimilar.js delete mode 100644 node_modules/webpack-cli/node_modules/commander/package-support.json delete mode 100644 node_modules/webpack-cli/node_modules/commander/package.json delete mode 100644 node_modules/webpack-cli/node_modules/commander/typings/index.d.ts delete mode 100644 node_modules/webpack-cli/package.json delete mode 100644 node_modules/webpack-merge/LICENSE delete mode 100644 node_modules/webpack-merge/README.md delete mode 100644 node_modules/webpack-merge/dist/index.d.ts delete mode 100644 node_modules/webpack-merge/dist/index.js delete mode 100644 node_modules/webpack-merge/dist/index.js.map delete mode 100644 node_modules/webpack-merge/dist/join-arrays.d.ts delete mode 100644 node_modules/webpack-merge/dist/join-arrays.js delete mode 100644 node_modules/webpack-merge/dist/join-arrays.js.map delete mode 100644 node_modules/webpack-merge/dist/merge-with.d.ts delete mode 100644 node_modules/webpack-merge/dist/merge-with.js delete mode 100644 node_modules/webpack-merge/dist/merge-with.js.map delete mode 100644 node_modules/webpack-merge/dist/types.d.ts delete mode 100644 node_modules/webpack-merge/dist/types.js delete mode 100644 node_modules/webpack-merge/dist/types.js.map delete mode 100644 node_modules/webpack-merge/dist/unique.d.ts delete mode 100644 node_modules/webpack-merge/dist/unique.js delete mode 100644 node_modules/webpack-merge/dist/unique.js.map delete mode 100644 node_modules/webpack-merge/dist/utils.d.ts delete mode 100644 node_modules/webpack-merge/dist/utils.js delete mode 100644 node_modules/webpack-merge/dist/utils.js.map delete mode 100644 node_modules/webpack-merge/package.json delete mode 100644 node_modules/which/CHANGELOG.md delete mode 100644 node_modules/which/LICENSE delete mode 100644 node_modules/which/README.md delete mode 100644 node_modules/which/bin/node-which delete mode 100644 node_modules/which/package.json delete mode 100644 node_modules/which/which.js delete mode 100644 node_modules/wildcard/.github/workflows/build.yml delete mode 100644 node_modules/wildcard/LICENSE delete mode 100644 node_modules/wildcard/README.md delete mode 100644 node_modules/wildcard/docs.json delete mode 100644 node_modules/wildcard/examples/arrays.js delete mode 100644 node_modules/wildcard/examples/objects.js delete mode 100644 node_modules/wildcard/examples/strings.js delete mode 100644 node_modules/wildcard/index.js delete mode 100644 node_modules/wildcard/package.json delete mode 100644 node_modules/wildcard/test/all.js delete mode 100644 node_modules/wildcard/test/arrays.js delete mode 100644 node_modules/wildcard/test/objects.js delete mode 100644 node_modules/wildcard/test/strings.js delete mode 100644 node_modules/yn/index.d.ts delete mode 100644 node_modules/yn/index.js delete mode 100644 node_modules/yn/lenient.js delete mode 100644 node_modules/yn/license delete mode 100644 node_modules/yn/package.json delete mode 100644 node_modules/yn/readme.md diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 100644 index 679bd16..0000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" -else - exec node "$basedir/../acorn/bin/acorn" "$@" -fi diff --git a/node_modules/.bin/acorn.cmd b/node_modules/.bin/acorn.cmd deleted file mode 100644 index a9324df..0000000 --- a/node_modules/.bin/acorn.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %* diff --git a/node_modules/.bin/acorn.ps1 b/node_modules/.bin/acorn.ps1 deleted file mode 100644 index 6f6dcdd..0000000 --- a/node_modules/.bin/acorn.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args - } else { - & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../acorn/bin/acorn" $args - } else { - & "node$exe" "$basedir/../acorn/bin/acorn" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist deleted file mode 100644 index 60e71ad..0000000 --- a/node_modules/.bin/browserslist +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@" -else - exec node "$basedir/../browserslist/cli.js" "$@" -fi diff --git a/node_modules/.bin/browserslist.cmd b/node_modules/.bin/browserslist.cmd deleted file mode 100644 index f93c251..0000000 --- a/node_modules/.bin/browserslist.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %* diff --git a/node_modules/.bin/browserslist.ps1 b/node_modules/.bin/browserslist.ps1 deleted file mode 100644 index 01e10a0..0000000 --- a/node_modules/.bin/browserslist.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../browserslist/cli.js" $args - } else { - & "node$exe" "$basedir/../browserslist/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/envinfo b/node_modules/.bin/envinfo deleted file mode 100644 index 76d5d37..0000000 --- a/node_modules/.bin/envinfo +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../envinfo/dist/cli.js" "$@" -else - exec node "$basedir/../envinfo/dist/cli.js" "$@" -fi diff --git a/node_modules/.bin/envinfo.cmd b/node_modules/.bin/envinfo.cmd deleted file mode 100644 index a0f47be..0000000 --- a/node_modules/.bin/envinfo.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\envinfo\dist\cli.js" %* diff --git a/node_modules/.bin/envinfo.ps1 b/node_modules/.bin/envinfo.ps1 deleted file mode 100644 index f9e36e5..0000000 --- a/node_modules/.bin/envinfo.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../envinfo/dist/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../envinfo/dist/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../envinfo/dist/cli.js" $args - } else { - & "node$exe" "$basedir/../envinfo/dist/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/flat b/node_modules/.bin/flat deleted file mode 100644 index 8aee6fd..0000000 --- a/node_modules/.bin/flat +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../flat/cli.js" "$@" -else - exec node "$basedir/../flat/cli.js" "$@" -fi diff --git a/node_modules/.bin/flat.cmd b/node_modules/.bin/flat.cmd deleted file mode 100644 index bae8d2c..0000000 --- a/node_modules/.bin/flat.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\flat\cli.js" %* diff --git a/node_modules/.bin/flat.ps1 b/node_modules/.bin/flat.ps1 deleted file mode 100644 index 92a76a9..0000000 --- a/node_modules/.bin/flat.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../flat/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../flat/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../flat/cli.js" $args - } else { - & "node$exe" "$basedir/../flat/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/import-local-fixture b/node_modules/.bin/import-local-fixture deleted file mode 100644 index 3a65441..0000000 --- a/node_modules/.bin/import-local-fixture +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../import-local/fixtures/cli.js" "$@" -else - exec node "$basedir/../import-local/fixtures/cli.js" "$@" -fi diff --git a/node_modules/.bin/import-local-fixture.cmd b/node_modules/.bin/import-local-fixture.cmd deleted file mode 100644 index 5a3f685..0000000 --- a/node_modules/.bin/import-local-fixture.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\import-local\fixtures\cli.js" %* diff --git a/node_modules/.bin/import-local-fixture.ps1 b/node_modules/.bin/import-local-fixture.ps1 deleted file mode 100644 index 01ef784..0000000 --- a/node_modules/.bin/import-local-fixture.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } else { - & "node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 deleted file mode 100644 index abf72a4..0000000 --- a/node_modules/.bin/json5 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" -else - exec node "$basedir/../json5/lib/cli.js" "$@" -fi diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd deleted file mode 100644 index 95c137f..0000000 --- a/node_modules/.bin/json5.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 deleted file mode 100644 index 8700ddb..0000000 --- a/node_modules/.bin/json5.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args - } else { - & "node$exe" "$basedir/../json5/lib/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which deleted file mode 100644 index b49b03f..0000000 --- a/node_modules/.bin/node-which +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../which/bin/node-which" "$@" -else - exec node "$basedir/../which/bin/node-which" "$@" -fi diff --git a/node_modules/.bin/node-which.cmd b/node_modules/.bin/node-which.cmd deleted file mode 100644 index 8738aed..0000000 --- a/node_modules/.bin/node-which.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %* diff --git a/node_modules/.bin/node-which.ps1 b/node_modules/.bin/node-which.ps1 deleted file mode 100644 index cfb09e8..0000000 --- a/node_modules/.bin/node-which.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args - } else { - & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../which/bin/node-which" $args - } else { - & "node$exe" "$basedir/../which/bin/node-which" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve deleted file mode 100644 index c043cba..0000000 --- a/node_modules/.bin/resolve +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" -else - exec node "$basedir/../resolve/bin/resolve" "$@" -fi diff --git a/node_modules/.bin/resolve.cmd b/node_modules/.bin/resolve.cmd deleted file mode 100644 index 1a017c4..0000000 --- a/node_modules/.bin/resolve.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %* diff --git a/node_modules/.bin/resolve.ps1 b/node_modules/.bin/resolve.ps1 deleted file mode 100644 index f22b2d3..0000000 --- a/node_modules/.bin/resolve.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args - } else { - & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../resolve/bin/resolve" $args - } else { - & "node$exe" "$basedir/../resolve/bin/resolve" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/terser b/node_modules/.bin/terser deleted file mode 100644 index 8456546..0000000 --- a/node_modules/.bin/terser +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../terser/bin/terser" "$@" -else - exec node "$basedir/../terser/bin/terser" "$@" -fi diff --git a/node_modules/.bin/terser.cmd b/node_modules/.bin/terser.cmd deleted file mode 100644 index abf66a8..0000000 --- a/node_modules/.bin/terser.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\terser\bin\terser" %* diff --git a/node_modules/.bin/terser.ps1 b/node_modules/.bin/terser.ps1 deleted file mode 100644 index 0bbfff6..0000000 --- a/node_modules/.bin/terser.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args - } else { - & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../terser/bin/terser" $args - } else { - & "node$exe" "$basedir/../terser/bin/terser" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node b/node_modules/.bin/ts-node deleted file mode 100644 index f3d4fab..0000000 --- a/node_modules/.bin/ts-node +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-cwd b/node_modules/.bin/ts-node-cwd deleted file mode 100644 index ae68e85..0000000 --- a/node_modules/.bin/ts-node-cwd +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-cwd.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-cwd.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-cwd.cmd b/node_modules/.bin/ts-node-cwd.cmd deleted file mode 100644 index 50c1bbc..0000000 --- a/node_modules/.bin/ts-node-cwd.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-cwd.js" %* diff --git a/node_modules/.bin/ts-node-cwd.ps1 b/node_modules/.bin/ts-node-cwd.ps1 deleted file mode 100644 index b12acfa..0000000 --- a/node_modules/.bin/ts-node-cwd.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node-esm b/node_modules/.bin/ts-node-esm deleted file mode 100644 index 19ea759..0000000 --- a/node_modules/.bin/ts-node-esm +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-esm.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-esm.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-esm.cmd b/node_modules/.bin/ts-node-esm.cmd deleted file mode 100644 index ba439a0..0000000 --- a/node_modules/.bin/ts-node-esm.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-esm.js" %* diff --git a/node_modules/.bin/ts-node-esm.ps1 b/node_modules/.bin/ts-node-esm.ps1 deleted file mode 100644 index d9806c0..0000000 --- a/node_modules/.bin/ts-node-esm.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node-script b/node_modules/.bin/ts-node-script deleted file mode 100644 index 14c2f67..0000000 --- a/node_modules/.bin/ts-node-script +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-script.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-script.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-script.cmd b/node_modules/.bin/ts-node-script.cmd deleted file mode 100644 index 146251b..0000000 --- a/node_modules/.bin/ts-node-script.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-script.js" %* diff --git a/node_modules/.bin/ts-node-script.ps1 b/node_modules/.bin/ts-node-script.ps1 deleted file mode 100644 index 3061e81..0000000 --- a/node_modules/.bin/ts-node-script.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node-transpile-only b/node_modules/.bin/ts-node-transpile-only deleted file mode 100644 index d3d4c0c..0000000 --- a/node_modules/.bin/ts-node-transpile-only +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-transpile.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-transpile.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-transpile-only.cmd b/node_modules/.bin/ts-node-transpile-only.cmd deleted file mode 100644 index 60b2af3..0000000 --- a/node_modules/.bin/ts-node-transpile-only.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-transpile.js" %* diff --git a/node_modules/.bin/ts-node-transpile-only.ps1 b/node_modules/.bin/ts-node-transpile-only.ps1 deleted file mode 100644 index 9503db4..0000000 --- a/node_modules/.bin/ts-node-transpile-only.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node.cmd b/node_modules/.bin/ts-node.cmd deleted file mode 100644 index a2a9c92..0000000 --- a/node_modules/.bin/ts-node.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin.js" %* diff --git a/node_modules/.bin/ts-node.ps1 b/node_modules/.bin/ts-node.ps1 deleted file mode 100644 index 90517a4..0000000 --- a/node_modules/.bin/ts-node.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-script b/node_modules/.bin/ts-script deleted file mode 100644 index 8f65f36..0000000 --- a/node_modules/.bin/ts-script +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@" -fi diff --git a/node_modules/.bin/ts-script.cmd b/node_modules/.bin/ts-script.cmd deleted file mode 100644 index e3b0e81..0000000 --- a/node_modules/.bin/ts-script.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-script-deprecated.js" %* diff --git a/node_modules/.bin/ts-script.ps1 b/node_modules/.bin/ts-script.ps1 deleted file mode 100644 index 1b348af..0000000 --- a/node_modules/.bin/ts-script.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc deleted file mode 100644 index c4864b9..0000000 --- a/node_modules/.bin/tsc +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@" -else - exec node "$basedir/../typescript/bin/tsc" "$@" -fi diff --git a/node_modules/.bin/tsc.cmd b/node_modules/.bin/tsc.cmd deleted file mode 100644 index 40bf128..0000000 --- a/node_modules/.bin/tsc.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsc" %* diff --git a/node_modules/.bin/tsc.ps1 b/node_modules/.bin/tsc.ps1 deleted file mode 100644 index 112413b..0000000 --- a/node_modules/.bin/tsc.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args - } else { - & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../typescript/bin/tsc" $args - } else { - & "node$exe" "$basedir/../typescript/bin/tsc" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/tsserver b/node_modules/.bin/tsserver deleted file mode 100644 index 6c19ce3..0000000 --- a/node_modules/.bin/tsserver +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@" -else - exec node "$basedir/../typescript/bin/tsserver" "$@" -fi diff --git a/node_modules/.bin/tsserver.cmd b/node_modules/.bin/tsserver.cmd deleted file mode 100644 index 57f851f..0000000 --- a/node_modules/.bin/tsserver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsserver" %* diff --git a/node_modules/.bin/tsserver.ps1 b/node_modules/.bin/tsserver.ps1 deleted file mode 100644 index 249f417..0000000 --- a/node_modules/.bin/tsserver.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args - } else { - & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../typescript/bin/tsserver" $args - } else { - & "node$exe" "$basedir/../typescript/bin/tsserver" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db deleted file mode 100644 index cced63c..0000000 --- a/node_modules/.bin/update-browserslist-db +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@" -else - exec node "$basedir/../update-browserslist-db/cli.js" "$@" -fi diff --git a/node_modules/.bin/update-browserslist-db.cmd b/node_modules/.bin/update-browserslist-db.cmd deleted file mode 100644 index 2e14905..0000000 --- a/node_modules/.bin/update-browserslist-db.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\update-browserslist-db\cli.js" %* diff --git a/node_modules/.bin/update-browserslist-db.ps1 b/node_modules/.bin/update-browserslist-db.ps1 deleted file mode 100644 index 7abdf26..0000000 --- a/node_modules/.bin/update-browserslist-db.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } else { - & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/webpack b/node_modules/.bin/webpack deleted file mode 100644 index 8442160..0000000 --- a/node_modules/.bin/webpack +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../webpack/bin/webpack.js" "$@" -else - exec node "$basedir/../webpack/bin/webpack.js" "$@" -fi diff --git a/node_modules/.bin/webpack-cli b/node_modules/.bin/webpack-cli deleted file mode 100644 index 12b862d..0000000 --- a/node_modules/.bin/webpack-cli +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../webpack-cli/bin/cli.js" "$@" -else - exec node "$basedir/../webpack-cli/bin/cli.js" "$@" -fi diff --git a/node_modules/.bin/webpack-cli.cmd b/node_modules/.bin/webpack-cli.cmd deleted file mode 100644 index bd930c5..0000000 --- a/node_modules/.bin/webpack-cli.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\webpack-cli\bin\cli.js" %* diff --git a/node_modules/.bin/webpack-cli.ps1 b/node_modules/.bin/webpack-cli.ps1 deleted file mode 100644 index 9400edb..0000000 --- a/node_modules/.bin/webpack-cli.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../webpack-cli/bin/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../webpack-cli/bin/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../webpack-cli/bin/cli.js" $args - } else { - & "node$exe" "$basedir/../webpack-cli/bin/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/webpack.cmd b/node_modules/.bin/webpack.cmd deleted file mode 100644 index 5b1e07b..0000000 --- a/node_modules/.bin/webpack.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\webpack\bin\webpack.js" %* diff --git a/node_modules/.bin/webpack.ps1 b/node_modules/.bin/webpack.ps1 deleted file mode 100644 index 57bb525..0000000 --- a/node_modules/.bin/webpack.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../webpack/bin/webpack.js" $args - } else { - & "$basedir/node$exe" "$basedir/../webpack/bin/webpack.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../webpack/bin/webpack.js" $args - } else { - & "node$exe" "$basedir/../webpack/bin/webpack.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index c34426d..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,1690 +0,0 @@ -{ - "name": "landingCode", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true - }, - "node_modules/@types/eslint": { - "version": "8.56.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.2.tgz", - "integrity": "sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "20.11.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", - "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/webpack": { - "version": "5.28.5", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.5.tgz", - "integrity": "sha512-wR87cgvxj3p6D0Crt1r5avwqffqPXUkNlnQ1mjU93G7gCuFjufZR4I6j8cz5g1F1tTYpfOOFvly+cmIQwL9wvw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "tapable": "^2.2.0", - "webpack": "^5" - } - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", - "dev": true, - "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" - } - }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", - "dev": true, - "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" - } - }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", - "dev": true, - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", - "dev": true, - "dependencies": { - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webpack-cli/configtest": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", - "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - } - }, - "node_modules/@webpack-cli/info": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", - "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - } - }, - "node_modules/@webpack-cli/serve": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", - "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", - "dev": true, - "peerDependencies": { - "acorn": "^8" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/animate.css": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/animate.css/-/animate.css-4.1.1.tgz", - "integrity": "sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ==" - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/bootstrap-icons": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.11.3.tgz", - "integrity": "sha512-+3lpHrCw/it2/7lBL15VR0HEumaBss0+f/Lb6ZvHISn1mlK83jjFpooTLsMWbIjJMDjDjOExMsTxnXSIT4k4ww==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/twbs" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - } - ] - }, - "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001584", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz", - "integrity": "sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ] - }, - "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/config": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/config/-/config-3.3.11.tgz", - "integrity": "sha512-Dhn63ZoWCW5EMg4P0Sl/XNsj/7RLiUIA1x1npCy+m2cRwRHzLnt3UtYtxRDMZW/6oOMdWhCzaGYkOcajGgrAOA==", - "dependencies": { - "json5": "^2.2.3" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/config-js": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/config-js/-/config-js-1.1.15.tgz", - "integrity": "sha512-wbVYp24x7rKrtJq0FSp5nXFKIS0ye0tPeIDb58/w7qP4u/f6jh+4tSmQcQKaQn0TB2D6sgREReUJhIZLrJyi1w==", - "dependencies": { - "const-obj": "^0.0.4", - "debug": "4.1.1", - "have": "0.4.0", - "is2": "2.0.4", - "lodash.merge": "4.6.2", - "property-path": "1.0.0" - }, - "engines": { - "node": ">=v0.8.0" - } - }, - "node_modules/const-obj": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/const-obj/-/const-obj-0.0.4.tgz", - "integrity": "sha512-zQFTlWNK92t4Is7yppjqIvl/GxDFPFKfcjddwbx0SN+0ftkK2lGswspoZZVsWOGwV1IJ3GQwUEky1ukH9tphCA==", - "dependencies": { - "is2": "0.0.12" - }, - "engines": { - "node": ">=v0.8.0" - } - }, - "node_modules/const-obj/node_modules/deep-is": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.2.tgz", - "integrity": "sha512-+ykBpFL44/E8TlSBn0kDHZ1+IseXxUu/Om3bS2nqNscaeYWzxx54R9CewU6pLrsXLmEeTRZsGMTQIHfSUEEcUw==" - }, - "node_modules/const-obj/node_modules/is2": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/is2/-/is2-0.0.12.tgz", - "integrity": "sha512-EpP+MTMWc8zbo/5GKbP6ZeQKawul5cbapHmi3W9r/lheZ1TeShKxcw2Y9JQUJ8mNS4kKmr29sUrg8Y+xjurRXA==", - "dependencies": { - "deep-is": "0.1.2" - }, - "engines": { - "node": ">=v0.6.0" - } - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.4.657", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.657.tgz", - "integrity": "sha512-On2ymeleg6QbRuDk7wNgDdXtNqlJLM2w4Agx1D/RiTmItiL+a9oq5p7HUa2ZtkAtGBe/kil2dq/7rPfkbe0r5w==", - "dev": true - }, - "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/envinfo": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.11.1.tgz", - "integrity": "sha512-8PiZgZNIB4q/Lw4AhOvAfB/ityHAd2bli3lESSWmWSzSsl5dKpy5N1d1Rfkd2teq/g9xN90lc6o98DOjMeYHpg==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/have": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/have/-/have-0.4.0.tgz", - "integrity": "sha512-DJd76CG7HnRSFt3HLnrp8M7SLYoxs4FHsmkwzqcCQDWTu1wwqMVSzKgL5JbPXAWGM9edR7f4HG7SxZT41m7A0Q==" - }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/interpret": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/ip-regex": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==" - }, - "node_modules/is2": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is2/-/is2-2.0.4.tgz", - "integrity": "sha512-7BQdwRMJRIMvcIltrz3VElmppIV7dL/s2nnZbhzcgyOBdZJcLYuEUG7H0icNvuCyjupXznJwjkDM30pgsNLwtg==", - "dependencies": { - "deep-is": "^0.1.3", - "ip-regex": "^4.1.0", - "is-url": "^1.2.4" - }, - "engines": { - "node": ">=v0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, - "engines": { - "node": ">=6.11.5" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lodash.filter": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", - "integrity": "sha512-pXYUy7PR8BCLwX5mgJ/aNtyOvuJTdZAo9EQFUvMIYugqmJxnrYaANvTbgndOzHSCSR0wnlBBfRXJL5SbWxo3FQ==" - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "dev": true - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/property-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/property-path/-/property-path-1.0.0.tgz", - "integrity": "sha512-q6XmVvqBc/4rY3NvZMK9z66ctkxY9SDekgMksKiHTgxELPdCrnB/J1loX95ei9cnPtyLwWNpEMXRvUiTjy77tQ==", - "dependencies": { - "is2": "2.0.1", - "lodash.filter": "4.6.0" - } - }, - "node_modules/property-path/node_modules/ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/property-path/node_modules/is2": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is2/-/is2-2.0.1.tgz", - "integrity": "sha512-+WaJvnaA7aJySz2q/8sLjMb2Mw14KTplHmSwcSpZ/fWJPkUmqw3YTzSWbPJ7OAwRvdYTWF2Wg+yYJ1AdP5Z8CA==", - "dependencies": { - "deep-is": "^0.1.3", - "ip-regex": "^2.1.0", - "is-url": "^1.2.2" - }, - "engines": { - "node": ">=v0.10.0" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/rechoir": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", - "dev": true, - "dependencies": { - "resolve": "^1.20.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", - "dev": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.20", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "uglify-js": { - "optional": true - } - } - }, - "node_modules/ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - }, - "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dev": true, - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/webpack": { - "version": "5.90.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.1.tgz", - "integrity": "sha512-SstPdlAC5IvgFnhiRok8hqJo/+ArAbNv7rhU4fnWGHNVfN59HSQFaxZDSAL3IFG2YmqxuRs+IU33milSxbPlog==", - "dev": true, - "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.5", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", - "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.21.10", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.0", - "webpack-sources": "^3.2.3" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-cli": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", - "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", - "dev": true, - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^2.1.1", - "@webpack-cli/info": "^2.0.2", - "@webpack-cli/serve": "^2.0.5", - "colorette": "^2.0.14", - "commander": "^10.0.1", - "cross-spawn": "^7.0.3", - "envinfo": "^7.7.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^3.1.1", - "rechoir": "^0.8.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/webpack-cli/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/webpack-merge": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", - "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "flat": "^5.0.2", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wildcard": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", - "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", - "dev": true - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - } - } -} diff --git a/node_modules/@cspotcode/source-map-support/LICENSE.md b/node_modules/@cspotcode/source-map-support/LICENSE.md deleted file mode 100644 index 6247ca9..0000000 --- a/node_modules/@cspotcode/source-map-support/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Evan Wallace - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@cspotcode/source-map-support/README.md b/node_modules/@cspotcode/source-map-support/README.md deleted file mode 100644 index f739070..0000000 --- a/node_modules/@cspotcode/source-map-support/README.md +++ /dev/null @@ -1,289 +0,0 @@ -# Source Map Support - -[![NPM version](https://img.shields.io/npm/v/@cspotcode/source-map-support.svg?style=flat)](https://npmjs.org/package/@cspotcode/source-map-support) -[![NPM downloads](https://img.shields.io/npm/dm/@cspotcode/source-map-support.svg?style=flat)](https://npmjs.org/package/@cspotcode/source-map-support) -[![Build status](https://img.shields.io/github/workflow/status/cspotcode/node-source-map-support/Continuous%20Integration)](https://github.com/cspotcode/node-source-map-support/actions?query=workflow%3A%22Continuous+Integration%22) - -This module provides source map support for stack traces in node via the [V8 stack trace API](https://github.com/v8/v8/wiki/Stack-Trace-API). It uses the [source-map](https://github.com/mozilla/source-map) module to replace the paths and line numbers of source-mapped files with their original paths and line numbers. The output mimics node's stack trace format with the goal of making every compile-to-JS language more of a first-class citizen. Source maps are completely general (not specific to any one language) so you can use source maps with multiple compile-to-JS languages in the same node process. - -## Installation and Usage - -#### Node support - -``` -$ npm install @cspotcode/source-map-support -``` - -Source maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, place a source mapping comment somewhere in the file (usually done automatically or with an option by your transpiler): - -``` -//# sourceMappingURL=path/to/source.map -``` - -If multiple sourceMappingURL comments exist in one file, the last sourceMappingURL comment will be -respected (e.g. if a file mentions the comment in code, or went through multiple transpilers). -The path should either be absolute or relative to the compiled file. - -From here you have two options. - -##### CLI Usage - -```bash -node -r @cspotcode/source-map-support/register compiled.js -# Or to enable hookRequire -node -r @cspotcode/source-map-support/register-hook-require compiled.js -``` - -##### Programmatic Usage - -Put the following line at the top of the compiled file. - -```js -require('@cspotcode/source-map-support').install(); -``` - -It is also possible to install the source map support directly by -requiring the `register` module which can be handy with ES6: - -```js -import '@cspotcode/source-map-support/register' - -// Instead of: -import sourceMapSupport from '@cspotcode/source-map-support' -sourceMapSupport.install() -``` -Note: if you're using babel-register, it includes source-map-support already. - -It is also very useful with Mocha: - -``` -$ mocha --require @cspotcode/source-map-support/register tests/ -``` - -#### Browser support - -This library also works in Chrome. While the DevTools console already supports source maps, the V8 engine doesn't and `Error.prototype.stack` will be incorrect without this library. Everything will just work if you deploy your source files using [browserify](http://browserify.org/). Just make sure to pass the `--debug` flag to the browserify command so your source maps are included in the bundled code. - -This library also works if you use another build process or just include the source files directly. In this case, include the file `browser-source-map-support.js` in your page and call `sourceMapSupport.install()`. It contains the whole library already bundled for the browser using browserify. - -```html - - -``` - -This library also works if you use AMD (Asynchronous Module Definition), which is used in tools like [RequireJS](http://requirejs.org/). Just list `browser-source-map-support` as a dependency: - -```html - -``` - -## Options - -This module installs two things: a change to the `stack` property on `Error` objects and a handler for uncaught exceptions that mimics node's default exception handler (the handler can be seen in the demos below). You may want to disable the handler if you have your own uncaught exception handler. This can be done by passing an argument to the installer: - -```js -require('@cspotcode/source-map-support').install({ - handleUncaughtExceptions: false -}); -``` - -This module loads source maps from the filesystem by default. You can provide alternate loading behavior through a callback as shown below. For example, [Meteor](https://github.com/meteor) keeps all source maps cached in memory to avoid disk access. - -```js -require('@cspotcode/source-map-support').install({ - retrieveSourceMap: function(source) { - if (source === 'compiled.js') { - return { - url: 'original.js', - map: fs.readFileSync('compiled.js.map', 'utf8') - }; - } - return null; - } -}); -``` - -The module will by default assume a browser environment if XMLHttpRequest and window are defined. If either of these do not exist it will instead assume a node environment. -In some rare cases, e.g. when running a browser emulation and where both variables are also set, you can explictly specify the environment to be either 'browser' or 'node'. - -```js -require('@cspotcode/source-map-support').install({ - environment: 'node' -}); -``` - -To support files with inline source maps, the `hookRequire` options can be specified, which will monitor all source files for inline source maps. - - -```js -require('@cspotcode/source-map-support').install({ - hookRequire: true -}); -``` - -This monkey patches the `require` module loading chain, so is not enabled by default and is not recommended for any sort of production usage. - -## Demos - -#### Basic Demo - -original.js: - -```js -throw new Error('test'); // This is the original code -``` - -compiled.js: - -```js -require('@cspotcode/source-map-support').install(); - -throw new Error('test'); // This is the compiled code -// The next line defines the sourceMapping. -//# sourceMappingURL=compiled.js.map -``` - -compiled.js.map: - -```json -{ - "version": 3, - "file": "compiled.js", - "sources": ["original.js"], - "names": [], - "mappings": ";;AAAA,MAAM,IAAI" -} -``` - -Run compiled.js using node (notice how the stack trace uses original.js instead of compiled.js): - -``` -$ node compiled.js - -original.js:1 -throw new Error('test'); // This is the original code - ^ -Error: test - at Object. (original.js:1:7) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### TypeScript Demo - -demo.ts: - -```typescript -declare function require(name: string); -require('@cspotcode/source-map-support').install(); -class Foo { - constructor() { this.bar(); } - bar() { throw new Error('this is a demo'); } -} -new Foo(); -``` - -Compile and run the file using the TypeScript compiler from the terminal: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -There is also the option to use `-r source-map-support/register` with typescript, without the need add the `require('@cspotcode/source-map-support').install()` in the code base: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node -r source-map-support/register demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### CoffeeScript Demo - -demo.coffee: - -```coffee -require('@cspotcode/source-map-support').install() -foo = -> - bar = -> throw new Error 'this is a demo' - bar() -foo() -``` - -Compile and run the file using the CoffeeScript compiler from the terminal: - -```sh -$ npm install @cspotcode/source-map-support coffeescript -$ node_modules/.bin/coffee --map --compile demo.coffee -$ node demo.js - -demo.coffee:3 - bar = -> throw new Error 'this is a demo' - ^ -Error: this is a demo - at bar (demo.coffee:3:22) - at foo (demo.coffee:4:3) - at Object. (demo.coffee:5:1) - at Object. (demo.coffee:1:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) -``` - -## Tests - -This repo contains both automated tests for node and manual tests for the browser. The automated tests can be run using mocha (type `mocha` in the root directory). To run the manual tests: - -* Build the tests using `build.js` -* Launch the HTTP server (`npm run serve-tests`) and visit - * http://127.0.0.1:1336/amd-test - * http://127.0.0.1:1336/browser-test - * http://127.0.0.1:1336/browserify-test - **Currently not working** due to a bug with browserify (see [pull request #66](https://github.com/evanw/node-source-map-support/pull/66) for details). -* For `header-test`, run `server.js` inside that directory and visit http://127.0.0.1:1337/ - -## License - -This code is available under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/node_modules/@cspotcode/source-map-support/browser-source-map-support.js b/node_modules/@cspotcode/source-map-support/browser-source-map-support.js deleted file mode 100644 index 782da50..0000000 --- a/node_modules/@cspotcode/source-map-support/browser-source-map-support.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Support for source maps in V8 stack traces - * https://github.com/evanw/node-source-map-support - */ -/* - The buffer module from node.js, for the browser. - - @author Feross Aboukhadijeh - license MIT -*/ -(this.define||function(R,U){this.sourceMapSupport=U()})("browser-source-map-support",function(R){(function e(C,J,A){function p(f,c){if(!J[f]){if(!C[f]){var l="function"==typeof require&&require;if(!c&&l)return l(f,!0);if(t)return t(f,!0);throw Error("Cannot find module '"+f+"'");}l=J[f]={exports:{}};C[f][0].call(l.exports,function(q){var r=C[f][1][q];return p(r?r:q)},l,l.exports,e,C,J,A)}return J[f].exports}for(var t="function"==typeof require&&require,m=0;mm)return-1;if(58>m)return m-48+52;if(91>m)return m-65;if(123>m)return m-97+26}var t="undefined"!==typeof Uint8Array?Uint8Array:Array;e.toByteArray=function(m){function f(d){q[k++]=d}if(0>16);f((u&65280)>>8);f(u&255)}2===l?(u=p(m.charAt(c))<<2|p(m.charAt(c+1))>>4,f(u&255)):1===l&&(u=p(m.charAt(c))<<10|p(m.charAt(c+1))<<4|p(m.charAt(c+2))>>2,f(u>>8&255),f(u&255));return q};e.fromByteArray=function(m){var f=m.length%3,c="",l;var q=0;for(l=m.length-f;q> -18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r&63);c+=r}switch(f){case 1:r=m[m.length-1];c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r<<4&63);c+="==";break;case 2:r=(m[m.length-2]<<8)+ -m[m.length-1],c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>10),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>4&63),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r<<2&63),c+="="}return c}})("undefined"===typeof A?this.base64js={}:A)},{}],3:[function(C,J,A){},{}],4:[function(C,J,A){(function(e){var p=Object.prototype.toString,t="function"===typeof e.alloc&&"function"===typeof e.allocUnsafe&&"function"=== -typeof e.from;J.exports=function(m,f,c){if("number"===typeof m)throw new TypeError('"value" argument must not be a number');if("ArrayBuffer"===p.call(m).slice(8,-1)){f>>>=0;var l=m.byteLength-f;if(0>l)throw new RangeError("'offset' is out of bounds");if(void 0===c)c=l;else if(c>>>=0,c>l)throw new RangeError("'length' is out of bounds");return t?e.from(m.slice(f,f+c)):new e(new Uint8Array(m.slice(f,f+c)))}if("string"===typeof m){c=f;if("string"!==typeof c||""===c)c="utf8";if(!e.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding'); -return t?e.from(m,c):new e(m,c)}return t?e.from(m):new e(m)}}).call(this,C("buffer").Buffer)},{buffer:5}],5:[function(C,J,A){function e(a,b,h){if(!(this instanceof e))return new e(a,b,h);var w=typeof a;if("number"===w)var y=0>>0:0;else if("string"===w){if("base64"===b)for(a=(a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")).replace(L,"");0!==a.length%4;)a+="=";y=e.byteLength(a,b)}else if("object"===w&&null!==a)"Buffer"===a.type&&z(a.data)&&(a=a.data),y=0<+a.length?Math.floor(+a.length):0;else throw new TypeError("must start with number, buffer, array or string"); -if(this.length>G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");if(e.TYPED_ARRAY_SUPPORT)var I=e._augment(new Uint8Array(y));else I=this,I.length=y,I._isBuffer=!0;if(e.TYPED_ARRAY_SUPPORT&&"number"===typeof a.byteLength)I._set(a);else{var K=a;if(z(K)||e.isBuffer(K)||K&&"object"===typeof K&&"number"===typeof K.length)if(e.isBuffer(a))for(b=0;ba)throw new RangeError("offset is not uint");if(a+b>h)throw new RangeError("Trying to access beyond buffer length");}function m(a,b,h,w,y,I){if(!e.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>y||ba.length)throw new TypeError("index out of range"); -}function f(a,b,h,w){0>b&&(b=65535+b+1);for(var y=0,I=Math.min(a.length-h,2);y>>8*(w?y:1-y)}function c(a,b,h,w){0>b&&(b=4294967295+b+1);for(var y=0,I=Math.min(a.length-h,4);y>>8*(w?y:3-y)&255}function l(a,b,h,w,y,I){if(b>y||ba.length)throw new TypeError("index out of range");}function q(a,b,h,w,y){y||l(a,b,h,4,3.4028234663852886E38,-3.4028234663852886E38);v.write(a,b,h,w,23,4);return h+4}function r(a, -b,h,w,y){y||l(a,b,h,8,1.7976931348623157E308,-1.7976931348623157E308);v.write(a,b,h,w,52,8);return h+8}function k(a){for(var b=[],h=0;h=w)b.push(w);else{var y=h;55296<=w&&57343>=w&&h++;w=encodeURIComponent(a.slice(y,h+1)).substr(1).split("%");for(y=0;y=b.length||y>=a.length);y++)b[y+ -h]=a[y];return y}function g(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}var n=C("base64-js"),v=C("ieee754"),z=C("is-array");A.Buffer=e;A.SlowBuffer=e;A.INSPECT_MAX_BYTES=50;e.poolSize=8192;var G=1073741823;e.TYPED_ARRAY_SUPPORT=function(){try{var a=new ArrayBuffer(0),b=new Uint8Array(a);b.foo=function(){return 42};return 42===b.foo()&&"function"===typeof b.subarray&&0===(new Uint8Array(1)).subarray(1,1).byteLength}catch(h){return!1}}();e.isBuffer=function(a){return!(null== -a||!a._isBuffer)};e.compare=function(a,b){if(!e.isBuffer(a)||!e.isBuffer(b))throw new TypeError("Arguments must be Buffers");for(var h=a.length,w=b.length,y=0,I=Math.min(h,w);y>>1;break;case "utf8":case "utf-8":h=k(a).length;break;case "base64":h=n.toByteArray(a).length; -break;default:h=a.length}return h};e.prototype.length=void 0;e.prototype.parent=void 0;e.prototype.toString=function(a,b,h){var w=!1;b>>>=0;h=void 0===h||Infinity===h?this.length:h>>>0;a||(a="utf8");0>b&&(b=0);h>this.length&&(h=this.length);if(h<=b)return"";for(;;)switch(a){case "hex":a=b;b=h;h=this.length;if(!a||0>a)a=0;if(!b||0>b||b>h)b=h;w="";for(h=a;hw?"0"+w.toString(16):w.toString(16),w=a+w;return w;case "utf8":case "utf-8":w=a="";for(h=Math.min(this.length,h);b= -this[b]?(a+=g(w)+String.fromCharCode(this[b]),w=""):w+="%"+this[b].toString(16);return a+g(w);case "ascii":return p(this,b,h);case "binary":return p(this,b,h);case "base64":return b=0===b&&h===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(b,h)),b;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":b=this.slice(b,h);h="";for(a=0;ab&&(a+=" ... "));return""};e.prototype.compare=function(a){if(!e.isBuffer(a))throw new TypeError("Argument must be a Buffer");return e.compare(this,a)};e.prototype.get=function(a){console.log(".get() is deprecated. Access using array indexes instead."); -return this.readUInt8(a)};e.prototype.set=function(a,b){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(a,b)};e.prototype.write=function(a,b,h,w){if(isFinite(b))isFinite(h)||(w=h,h=void 0);else{var y=w;w=b;b=h;h=y}b=Number(b)||0;y=this.length-b;h?(h=Number(h),h>y&&(h=y)):h=y;w=String(w||"utf8").toLowerCase();switch(w){case "hex":b=Number(b)||0;w=this.length-b;h?(h=Number(h),h>w&&(h=w)):h=w;w=a.length;if(0!==w%2)throw Error("Invalid hex string");h>w/ -2&&(h=w/2);for(w=0;w>8;K%=256;y.push(K);y.push(w)}a=d(y,this,b,h,2);break;default:throw new TypeError("Unknown encoding: "+ -w);}return a};e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};e.prototype.slice=function(a,b){var h=this.length;a=~~a;b=void 0===b?h:~~b;0>a?(a+=h,0>a&&(a=0)):a>h&&(a=h);0>b?(b+=h,0>b&&(b=0)):b>h&&(b=h);b>>=0;h||m(this,a,b,1,255,0);e.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a;return b+1};e.prototype.writeUInt16LE=function(a, -b,h){a=+a;b>>>=0;h||m(this,a,b,2,65535,0);e.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):f(this,a,b,!0);return b+2};e.prototype.writeUInt16BE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,2,65535,0);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):f(this,a,b,!1);return b+2};e.prototype.writeUInt32LE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,4,4294967295,0);e.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a):c(this,a,b,!0);return b+4};e.prototype.writeUInt32BE=function(a, -b,h){a=+a;b>>>=0;h||m(this,a,b,4,4294967295,0);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a):c(this,a,b,!1);return b+4};e.prototype.writeInt8=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,1,127,-128);e.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a;return b+1};e.prototype.writeInt16LE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,2,32767,-32768);e.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):f(this,a,b,!0);return b+2};e.prototype.writeInt16BE=function(a, -b,h){a=+a;b>>>=0;h||m(this,a,b,2,32767,-32768);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):f(this,a,b,!1);return b+2};e.prototype.writeInt32LE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,4,2147483647,-2147483648);e.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):c(this,a,b,!0);return b+4};e.prototype.writeInt32BE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+ -2]=a>>>8,this[b+3]=a):c(this,a,b,!1);return b+4};e.prototype.writeFloatLE=function(a,b,h){return q(this,a,b,!0,h)};e.prototype.writeFloatBE=function(a,b,h){return q(this,a,b,!1,h)};e.prototype.writeDoubleLE=function(a,b,h){return r(this,a,b,!0,h)};e.prototype.writeDoubleBE=function(a,b,h){return r(this,a,b,!1,h)};e.prototype.copy=function(a,b,h,w){h||(h=0);w||0===w||(w=this.length);b||(b=0);if(w!==h&&0!==a.length&&0!==this.length){if(wb||b>=a.length)throw new TypeError("targetStart out of bounds"); -if(0>h||h>=this.length)throw new TypeError("sourceStart out of bounds");if(0>w||w>this.length)throw new TypeError("sourceEnd out of bounds");w>this.length&&(w=this.length);a.length-bw||!e.TYPED_ARRAY_SUPPORT)for(var y=0;yb||b>=this.length)throw new TypeError("start out of bounds"); -if(0>h||h>this.length)throw new TypeError("end out of bounds");if("number"===typeof a)for(;b>1,r=-7;f=t?f-1:0;var k=t?-1:1,u=e[p+f];f+=k;t=u&(1<<-r)-1;u>>=-r;for(r+=c;0>=-r;for(r+=m;0>1,u=23===f?Math.pow(2,-24)-Math.pow(2,-77):0;c=m?0:c-1;var d=m?1:-1,g=0>p||0===p&&0>1/p?1:0;p=Math.abs(p);isNaN(p)||Infinity===p?(p=isNaN(p)?1:0,m=r):(m=Math.floor(Math.log(p)/Math.LN2),1>p*(l=Math.pow(2,-m))&&(m--,l*=2),p=1<=m+k?p+u/l:p+u*Math.pow(2,1-k),2<=p*l&&(m++,l/=2),m+k>=r?(p=0,m=r):1<=m+k?(p=(p*l-1)*Math.pow(2,f),m+=k):(p=p*Math.pow(2,k-1)*Math.pow(2,f),m=0));for(;8<=f;e[t+c]=p&255,c+= -d,p/=256,f-=8);m=m<z?[]:n.slice(v,z-v+1)}c=A.resolve(c).substr(1);l=A.resolve(l).substr(1); -for(var r=q(c.split("/")),k=q(l.split("/")),u=Math.min(r.length,k.length),d=u,g=0;gl&&(l=c.length+l);return c.substr(l,q)}}).call(this,C("g5I+bs"))},{"g5I+bs":9}],9:[function(C,J,A){function e(){}C=J.exports={};C.nextTick=function(){if("undefined"!==typeof window&&window.setImmediate)return function(t){return window.setImmediate(t)};if("undefined"!==typeof window&&window.postMessage&&window.addEventListener){var p=[];window.addEventListener("message",function(t){var m=t.source;m!==window&&null!== -m||"process-tick"!==t.data||(t.stopPropagation(),0p?(-p<<1)+1:p<<1;do p=m&31,m>>>=5,0=f)throw Error("Expected more digits in base 64 VLQ value.");var q=e.decode(p.charCodeAt(t++));if(-1===q)throw Error("Invalid base64 digit: "+p.charAt(t-1));var r=!!(q&32);q&=31;c+=q<>1;m.value=1===(c&1)?-p:p;m.rest=t}},{"./base64":12}],12:[function(C, -J,A){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");A.encode=function(p){if(0<=p&&p=p?p-65:97<=p&&122>=p?p-97+26:48<=p&&57>=p?p-48+52:43==p?62:47==p?63:-1}},{}],13:[function(C,J,A){function e(p,t,m,f,c,l){var q=Math.floor((t-p)/2)+p,r=c(m,f[q],!0);return 0===r?q:0p?-1:p}A.GREATEST_LOWER_BOUND=1;A.LEAST_UPPER_BOUND=2;A.search=function(p,t,m,f){if(0===t.length)return-1;p=e(-1,t.length,p,t,m,f||A.GREATEST_LOWER_BOUND);if(0>p)return-1;for(;0<=p-1&&0===m(t[p],t[p-1],!0);)--p;return p}},{}],14:[function(C,J,A){function e(){this._array=[];this._sorted=!0;this._last={generatedLine:-1,generatedColumn:0}}var p=C("./util");e.prototype.unsortedForEach=function(t,m){this._array.forEach(t,m)};e.prototype.add=function(t){var m=this._last,f=m.generatedLine, -c=t.generatedLine,l=m.generatedColumn,q=t.generatedColumn;c>f||c==f&&q>=l||0>=p.compareByGeneratedPositionsInflated(m,t)?this._last=t:this._sorted=!1;this._array.push(t)};e.prototype.toArray=function(){this._sorted||(this._array.sort(p.compareByGeneratedPositionsInflated),this._sorted=!0);return this._array};A.MappingList=e},{"./util":19}],15:[function(C,J,A){function e(t,m,f){var c=t[m];t[m]=t[f];t[f]=c}function p(t,m,f,c){if(f=m(t[r],q)&&(l+=1,e(t,l,r));e(t,l+1,r);l+=1;p(t,m,f,l-1);p(t,m,l+1,c)}}A.quickSort=function(t,m){p(t,m,0,t.length-1)}},{}],16:[function(C,J,A){function e(k,u){var d=k;"string"===typeof k&&(d=f.parseSourceMapInput(k));return null!=d.sections?new m(d,u):new p(d,u)}function p(k,u){var d=k;"string"===typeof k&&(d=f.parseSourceMapInput(k));var g=f.getArg(d,"version"),n=f.getArg(d,"sources"),v=f.getArg(d,"names",[]),z=f.getArg(d,"sourceRoot",null),G=f.getArg(d,"sourcesContent",null),D=f.getArg(d, -"mappings");d=f.getArg(d,"file",null);if(g!=this._version)throw Error("Unsupported version: "+g);z&&(z=f.normalize(z));n=n.map(String).map(f.normalize).map(function(L){return z&&f.isAbsolute(z)&&f.isAbsolute(L)?f.relative(z,L):L});this._names=l.fromArray(v.map(String),!0);this._sources=l.fromArray(n,!0);this.sourceRoot=z;this.sourcesContent=G;this._mappings=D;this._sourceMapURL=u;this.file=d}function t(){this.generatedColumn=this.generatedLine=0;this.name=this.originalColumn=this.originalLine=this.source= -null}function m(k,u){var d=k;"string"===typeof k&&(d=f.parseSourceMapInput(k));var g=f.getArg(d,"version");d=f.getArg(d,"sections");if(g!=this._version)throw Error("Unsupported version: "+g);this._sources=new l;this._names=new l;var n={line:-1,column:0};this._sections=d.map(function(v){if(v.url)throw Error("Support for url field in sections not implemented.");var z=f.getArg(v,"offset"),G=f.getArg(z,"line"),D=f.getArg(z,"column");if(G=k[d])throw new TypeError("Line must be greater than or equal to 1, got "+ -k[d]);if(0>k[g])throw new TypeError("Column must be greater than or equal to 0, got "+k[g]);return c.search(k,u,n,v)};p.prototype.computeColumnSpans=function(){for(var k=0;k=this._sources.size()&&!this.sourcesContent.some(function(k){return null==k}):!1};p.prototype.sourceContentFor=function(k,u){if(!this.sourcesContent)return null;var d=k;null!=this.sourceRoot&&(d=f.relative(this.sourceRoot,d));if(this._sources.has(d))return this.sourcesContent[this._sources.indexOf(d)]; -var g=this.sources,n;for(n=0;n -g||95!==d.charCodeAt(g-1)||95!==d.charCodeAt(g-2)||111!==d.charCodeAt(g-3)||116!==d.charCodeAt(g-4)||111!==d.charCodeAt(g-5)||114!==d.charCodeAt(g-6)||112!==d.charCodeAt(g-7)||95!==d.charCodeAt(g-8)||95!==d.charCodeAt(g-9))return!1;for(g-=10;0<=g;g--)if(36!==d.charCodeAt(g))return!1;return!0}function r(d,g){return d===g?0:null===d?1:null===g?-1:d>g?1:-1}A.getArg=function(d,g,n){if(g in d)return d[g];if(3===arguments.length)return n;throw Error('"'+g+'" is a required argument.');};var k=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/, -u=/^data:.+,.+$/;A.urlParse=e;A.urlGenerate=p;A.normalize=t;A.join=m;A.isAbsolute=function(d){return"/"===d.charAt(0)||k.test(d)};A.relative=function(d,g){""===d&&(d=".");d=d.replace(/\/$/,"");for(var n=0;0!==g.indexOf(d+"/");){var v=d.lastIndexOf("/");if(0>v)return g;d=d.slice(0,v);if(d.match(/^([^\/]+:\/)?\/*$/))return g;++n}return Array(n+1).join("../")+g.substr(d.length+1)};C=!("__proto__"in Object.create(null));A.toSetString=C?f:c;A.fromSetString=C?f:l;A.compareByOriginalPositions=function(d, -g,n){var v=r(d.source,g.source);if(0!==v)return v;v=d.originalLine-g.originalLine;if(0!==v)return v;v=d.originalColumn-g.originalColumn;if(0!==v||n)return v;v=d.generatedColumn-g.generatedColumn;if(0!==v)return v;v=d.generatedLine-g.generatedLine;return 0!==v?v:r(d.name,g.name)};A.compareByGeneratedPositionsDeflated=function(d,g,n){var v=d.generatedLine-g.generatedLine;if(0!==v)return v;v=d.generatedColumn-g.generatedColumn;if(0!==v||n)return v;v=r(d.source,g.source);if(0!==v)return v;v=d.originalLine- -g.originalLine;if(0!==v)return v;v=d.originalColumn-g.originalColumn;return 0!==v?v:r(d.name,g.name)};A.compareByGeneratedPositionsInflated=function(d,g){var n=d.generatedLine-g.generatedLine;if(0!==n)return n;n=d.generatedColumn-g.generatedColumn;if(0!==n)return n;n=r(d.source,g.source);if(0!==n)return n;n=d.originalLine-g.originalLine;if(0!==n)return n;n=d.originalColumn-g.originalColumn;return 0!==n?n:r(d.name,g.name)};A.parseSourceMapInput=function(d){return JSON.parse(d.replace(/^\)]}'[^\n]*\n/, -""))};A.computeSourceURL=function(d,g,n){g=g||"";d&&("/"!==d[d.length-1]&&"/"!==g[0]&&(d+="/"),g=d+g);if(n){d=e(n);if(!d)throw Error("sourceMapURL could not be parsed");d.path&&(n=d.path.lastIndexOf("/"),0<=n&&(d.path=d.path.substring(0,n+1)));g=m(p(d),g)}return t(g)}},{}],20:[function(C,J,A){A.SourceMapGenerator=C("./lib/source-map-generator").SourceMapGenerator;A.SourceMapConsumer=C("./lib/source-map-consumer").SourceMapConsumer;A.SourceNode=C("./lib/source-node").SourceNode},{"./lib/source-map-consumer":16, -"./lib/source-map-generator":17,"./lib/source-node":18}],21:[function(C,J,A){(function(e){function p(){return"browser"===a?!0:"node"===a?!1:"undefined"!==typeof window&&"function"===typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function t(x){return function(B){for(var F=0;F";B=this.getLineNumber();null!=B&&(x+=":"+B,(B= -this.getColumnNumber())&&(x+=":"+B))}B="";var F=this.getFunctionName(),E=!0,H=this.isConstructor();if(this.isToplevel()||H)H?B+="new "+(F||""):F?B+=F:(B+=x,E=!1);else{H=this.getTypeName();"[object Object]"===H&&(H="null");var M=this.getMethodName();F?(H&&0!=F.indexOf(H)&&(B+=H+"."),B+=F,M&&F.indexOf("."+M)!=F.length-M.length-1&&(B+=" [as "+M+"]")):B+=H+"."+(M||"")}E&&(B+=" ("+x+")");return B}function q(x){var B={};Object.getOwnPropertyNames(Object.getPrototypeOf(x)).forEach(function(F){B[F]= -/^(?:is|get)/.test(F)?function(){return x[F].call(x)}:x[F]});B.toString=l;return B}function r(x,B){void 0===B&&(B={nextPosition:null,curPosition:null});if(x.isNative())return B.curPosition=null,x;var F=x.getFileName()||x.getScriptNameOrSourceURL();if(F){var E=x.getLineNumber(),H=x.getColumnNumber()-1,M=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,S=M.test;var V="object"===typeof e&&null!==e?e.version:"";M=S.call(M,V)?0:62;1===E&&H>M&&!p()&&!x.isEval()&&(H-=M);var O= -f({source:F,line:E,column:H});B.curPosition=O;x=q(x);var T=x.getFunctionName;x.getFunctionName=function(){return null==B.nextPosition?T():B.nextPosition.name||T()};x.getFileName=function(){return O.source};x.getLineNumber=function(){return O.line};x.getColumnNumber=function(){return O.column+1};x.getScriptNameOrSourceURL=function(){return O.source};return x}var Q=x.isEval()&&x.getEvalOrigin();Q&&(Q=c(Q),x=q(x),x.getEvalOrigin=function(){return Q});return x}function k(x,B){L&&(b={},h={});for(var F= -(x.name||"Error")+": "+(x.message||""),E={nextPosition:null,curPosition:null},H=[],M=B.length-1;0<=M;M--)H.push("\n at "+r(B[M],E)),E.nextPosition=E.curPosition;E.curPosition=E.nextPosition=null;return F+H.reverse().join("")}function u(x){var B=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(x.stack);if(B){x=B[1];var F=+B[2];B=+B[3];var E=b[x];if(!E&&v&&v.existsSync(x))try{E=v.readFileSync(x,"utf8")}catch(H){E=""}if(E&&(E=E.split(/(?:\r\n|\r|\n)/)[F-1]))return x+":"+F+"\n"+E+"\n"+Array(B).join(" ")+ -"^"}return null}function d(){var x=e.emit;e.emit=function(B){if("uncaughtException"===B){var F=arguments[1]&&arguments[1].stack,E=0 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/README.md b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/README.md deleted file mode 100644 index 8286cee..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# @jridgewell/trace-mapping - -> Trace the original position through a source map - -`trace-mapping` allows you to take the line and column of an output file and trace it to the -original location in the source file through a source map. - -You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This -provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. - -## Installation - -```sh -npm install @jridgewell/trace-mapping -``` - -## Usage - -```typescript -import { TraceMap, originalPositionFor, generatedPositionFor } from '@jridgewell/trace-mapping'; - -const tracer = new TraceMap({ - version: 3, - sources: ['input.js'], - names: ['foo'], - mappings: 'KAyCIA', -}); - -// Lines start at line 1, columns at column 0. -const traced = originalPositionFor(tracer, { line: 1, column: 5 }); -assert.deepEqual(traced, { - source: 'input.js', - line: 42, - column: 4, - name: 'foo', -}); - -const generated = generatedPositionFor(tracer, { - source: 'input.js', - line: 42, - column: 4, -}); -assert.deepEqual(generated, { - line: 1, - column: 5, -}); -``` - -We also provide a lower level API to get the actual segment that matches our line and column. Unlike -`originalPositionFor`, `traceSegment` uses a 0-base for `line`: - -```typescript -import { traceSegment } from '@jridgewell/trace-mapping'; - -// line is 0-base. -const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); - -// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] -// Again, line is 0-base and so is sourceLine -assert.deepEqual(traced, [5, 0, 41, 4, 0]); -``` - -### SectionedSourceMaps - -The sourcemap spec defines a special `sections` field that's designed to handle concatenation of -output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool -produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` -helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a -`TraceMap` instance: - -```typescript -import { AnyMap } from '@jridgewell/trace-mapping'; -const fooOutput = 'foo'; -const barOutput = 'bar'; -const output = [fooOutput, barOutput].join('\n'); - -const sectioned = new AnyMap({ - version: 3, - sections: [ - { - // 0-base line and column - offset: { line: 0, column: 0 }, - // fooOutput's sourcemap - map: { - version: 3, - sources: ['foo.js'], - names: ['foo'], - mappings: 'AAAAA', - }, - }, - { - // barOutput's sourcemap will not affect the first line, only the second - offset: { line: 1, column: 0 }, - map: { - version: 3, - sources: ['bar.js'], - names: ['bar'], - mappings: 'AAAAA', - }, - }, - ], -}); - -const traced = originalPositionFor(sectioned, { - line: 2, - column: 0, -}); - -assert.deepEqual(traced, { - source: 'bar.js', - line: 1, - column: 0, - name: 'bar', -}); -``` - -## Benchmarks - -``` -node v18.0.0 - -amp.js.map -trace-mapping: decoded JSON input x 183 ops/sec ±0.41% (87 runs sampled) -trace-mapping: encoded JSON input x 384 ops/sec ±0.89% (89 runs sampled) -trace-mapping: decoded Object input x 3,085 ops/sec ±0.24% (100 runs sampled) -trace-mapping: encoded Object input x 452 ops/sec ±0.80% (84 runs sampled) -source-map-js: encoded Object input x 88.82 ops/sec ±0.45% (77 runs sampled) -source-map-0.6.1: encoded Object input x 38.39 ops/sec ±1.88% (52 runs sampled) -Fastest is trace-mapping: decoded Object input - -trace-mapping: decoded originalPositionFor x 4,025,347 ops/sec ±0.15% (97 runs sampled) -trace-mapping: encoded originalPositionFor x 3,333,136 ops/sec ±1.26% (90 runs sampled) -source-map-js: encoded originalPositionFor x 824,978 ops/sec ±1.06% (94 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 741,300 ops/sec ±0.93% (92 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 2,587,603 ops/sec ±0.75% (97 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -*** - -babel.min.js.map -trace-mapping: decoded JSON input x 17.43 ops/sec ±8.81% (33 runs sampled) -trace-mapping: encoded JSON input x 34.18 ops/sec ±4.67% (50 runs sampled) -trace-mapping: decoded Object input x 1,010 ops/sec ±0.41% (98 runs sampled) -trace-mapping: encoded Object input x 39.45 ops/sec ±4.01% (52 runs sampled) -source-map-js: encoded Object input x 6.57 ops/sec ±3.04% (21 runs sampled) -source-map-0.6.1: encoded Object input x 4.23 ops/sec ±2.93% (15 runs sampled) -Fastest is trace-mapping: decoded Object input - -trace-mapping: decoded originalPositionFor x 7,576,265 ops/sec ±0.74% (96 runs sampled) -trace-mapping: encoded originalPositionFor x 5,019,743 ops/sec ±0.74% (94 runs sampled) -source-map-js: encoded originalPositionFor x 3,396,137 ops/sec ±42.32% (95 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 3,753,176 ops/sec ±0.72% (95 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 6,423,633 ops/sec ±0.74% (95 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -*** - -preact.js.map -trace-mapping: decoded JSON input x 3,499 ops/sec ±0.18% (98 runs sampled) -trace-mapping: encoded JSON input x 6,078 ops/sec ±0.25% (99 runs sampled) -trace-mapping: decoded Object input x 254,788 ops/sec ±0.13% (100 runs sampled) -trace-mapping: encoded Object input x 14,063 ops/sec ±0.27% (94 runs sampled) -source-map-js: encoded Object input x 2,465 ops/sec ±0.25% (98 runs sampled) -source-map-0.6.1: encoded Object input x 1,174 ops/sec ±1.90% (95 runs sampled) -Fastest is trace-mapping: decoded Object input - -trace-mapping: decoded originalPositionFor x 7,720,171 ops/sec ±0.14% (97 runs sampled) -trace-mapping: encoded originalPositionFor x 6,864,485 ops/sec ±0.16% (101 runs sampled) -source-map-js: encoded originalPositionFor x 2,387,219 ops/sec ±0.28% (98 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 1,565,339 ops/sec ±0.32% (101 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 3,819,732 ops/sec ±0.38% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -*** - -react.js.map -trace-mapping: decoded JSON input x 1,719 ops/sec ±0.19% (99 runs sampled) -trace-mapping: encoded JSON input x 4,284 ops/sec ±0.51% (99 runs sampled) -trace-mapping: decoded Object input x 94,668 ops/sec ±0.08% (99 runs sampled) -trace-mapping: encoded Object input x 5,287 ops/sec ±0.24% (99 runs sampled) -source-map-js: encoded Object input x 814 ops/sec ±0.20% (98 runs sampled) -source-map-0.6.1: encoded Object input x 429 ops/sec ±0.24% (94 runs sampled) -Fastest is trace-mapping: decoded Object input - -trace-mapping: decoded originalPositionFor x 28,927,989 ops/sec ±0.61% (94 runs sampled) -trace-mapping: encoded originalPositionFor x 27,394,475 ops/sec ±0.55% (97 runs sampled) -source-map-js: encoded originalPositionFor x 16,856,730 ops/sec ±0.45% (96 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 12,258,950 ops/sec ±0.41% (97 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 22,272,990 ops/sec ±0.58% (95 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor -``` - -[source-map]: https://www.npmjs.com/package/source-map diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs deleted file mode 100644 index 8fce400..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +++ /dev/null @@ -1,514 +0,0 @@ -import { encode, decode } from '@jridgewell/sourcemap-codec'; -import resolveUri from '@jridgewell/resolve-uri'; - -function resolve(input, base) { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) - base += '/'; - return resolveUri(input, base); -} - -/** - * Removes everything after the last "/", but leaves the slash. - */ -function stripFilename(path) { - if (!path) - return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} - -const COLUMN = 0; -const SOURCES_INDEX = 1; -const SOURCE_LINE = 2; -const SOURCE_COLUMN = 3; -const NAMES_INDEX = 4; -const REV_GENERATED_LINE = 1; -const REV_GENERATED_COLUMN = 2; - -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) - return mappings; - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) - mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} -function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) - return i; - } - return mappings.length; -} -function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} -function sortSegments(line, owned) { - if (!owned) - line = line.slice(); - return line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; -} - -let found = false; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } - else { - high = mid - 1; - } - } - found = false; - return low - 1; -} -function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; i++, index++) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; -} -function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; i--, index--) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; -} -function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; -} -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } - else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return (state.lastIndex = binarySearch(haystack, needle, low, high)); -} - -// Rebuilds the original source files, with mappings that are ordered by source line/column instead -// of generated line/column. -function buildBySources(decoded, memos) { - const sources = memos.map(buildNullArray); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) - continue; - const sourceIndex = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const originalSource = sources[sourceIndex]; - const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); - const memo = memos[sourceIndex]; - // The binary search either found a match, or it found the left-index just before where the - // segment should go. Either way, we want to insert after that. And there may be multiple - // generated segments associated with an original location, so there may need to move several - // indexes before we find where we need to insert. - const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); - insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); - } - } - return sources; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like -// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. -// Numeric properties on objects are magically sorted in ascending order by the engine regardless of -// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending -// order when iterating with for-in. -function buildNullArray() { - return { __proto__: null }; -} - -const AnyMap = function (map, mapUrl) { - const parsed = typeof map === 'string' ? JSON.parse(map) : map; - if (!('sections' in parsed)) - return new TraceMap(parsed, mapUrl); - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const { sections } = parsed; - let i = 0; - for (; i < sections.length - 1; i++) { - const no = sections[i + 1].offset; - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); - } - if (sections.length > 0) { - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); - } - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - }; - return presortedDecodedMap(joined); -}; -function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { - const map = AnyMap(section.map, mapUrl); - const { line: lineOffset, column: columnOffset } = section.offset; - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources } = map; - append(sources, resolvedSources); - append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); - append(names, map.names); - // If this section jumps forwards several lines, we need to add lines to the output mappings catch up. - for (let i = mappings.length; i <= lineOffset; i++) - mappings.push([]); - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. - const stopI = stopLine - lineOffset; - const len = Math.min(decoded.length, stopI + 1); - for (let i = 0; i < len; i++) { - const line = decoded[i]; - // On the 0th loop, the line will already exist due to a previous section, or the line catch up - // loop above. - const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (i === stopI && column >= stopColumn) - break; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - if (seg.length === 4) { - out.push([column, sourcesIndex, sourceLine, sourceColumn]); - continue; - } - out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); - } - } -} -function append(arr, other) { - for (let i = 0; i < other.length; i++) - arr.push(other[i]); -} -// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of -// equal length to the sources. This is because the sources and sourcesContent are paired arrays, -// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined -// sourcemap would desynchronize the sources/contents. -function fillSourcesContent(len) { - const sourcesContent = []; - for (let i = 0; i < len; i++) - sourcesContent[i] = null; - return sourcesContent; -} - -const INVALID_ORIGINAL_MAPPING = Object.freeze({ - source: null, - line: null, - column: null, - name: null, -}); -const INVALID_GENERATED_MAPPING = Object.freeze({ - line: null, - column: null, -}); -const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; -const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; -const LEAST_UPPER_BOUND = -1; -const GREATEST_LOWER_BOUND = 1; -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -let encodedMappings; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -let decodedMappings; -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -let traceSegment; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -let originalPositionFor; -/** - * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided - * the found mapping is from the same source and line as the originalPositionFor mapping. - * - * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1` - * using the same needle that would return `id` when calling `originalPositionFor`. - */ -let generatedPositionFor; -/** - * Iterates each mapping in generated position order. - */ -let eachMapping; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -let presortedDecodedMap; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let decodedMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let encodedMap; -class TraceMap { - constructor(map, mapUrl) { - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - const isString = typeof map === 'string'; - if (!isString && map.constructor === TraceMap) - return map; - const parsed = (isString ? JSON.parse(map) : map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - if (sourceRoot || mapUrl) { - const from = resolve(sourceRoot || '', stripFilename(mapUrl)); - this.resolvedSources = sources.map((s) => resolve(s || '', from)); - } - else { - this.resolvedSources = sources.map((s) => s || ''); - } - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } - else { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } - } -} -(() => { - encodedMappings = (map) => { - var _a; - return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded))); - }; - decodedMappings = (map) => { - return (map._decoded || (map._decoded = decode(map._encoded))); - }; - traceSegment = (map, line, column) => { - const decoded = decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return null; - return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND); - }; - originalPositionFor = (map, { line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return INVALID_ORIGINAL_MAPPING; - const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); - if (segment == null) - return INVALID_ORIGINAL_MAPPING; - if (segment.length == 1) - return INVALID_ORIGINAL_MAPPING; - const { names, resolvedSources } = map; - return { - source: resolvedSources[segment[SOURCES_INDEX]], - line: segment[SOURCE_LINE] + 1, - column: segment[SOURCE_COLUMN], - name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null, - }; - }; - generatedPositionFor = (map, { source, line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex = sources.indexOf(source); - if (sourceIndex === -1) - sourceIndex = resolvedSources.indexOf(source); - if (sourceIndex === -1) - return INVALID_GENERATED_MAPPING; - const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); - const memos = map._bySourceMemos; - const segments = generated[sourceIndex][line]; - if (segments == null) - return INVALID_GENERATED_MAPPING; - const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND); - if (segment == null) - return INVALID_GENERATED_MAPPING; - return { - line: segment[REV_GENERATED_LINE] + 1, - column: segment[REV_GENERATED_COLUMN], - }; - }; - eachMapping = (map, cb) => { - const decoded = decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) - name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name, - }); - } - } - }; - presortedDecodedMap = (map, mapUrl) => { - const clone = Object.assign({}, map); - clone.mappings = []; - const tracer = new TraceMap(clone, mapUrl); - tracer._decoded = map.mappings; - return tracer; - }; - decodedMap = (map) => { - return { - version: 3, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings: decodedMappings(map), - }; - }; - encodedMap = (map) => { - return { - version: 3, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings: encodedMappings(map), - }; - }; -})(); -function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } - else if (bias === LEAST_UPPER_BOUND) - index++; - if (index === -1 || index === segments.length) - return null; - return segments[index]; -} - -export { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, traceSegment }; -//# sourceMappingURL=trace-mapping.mjs.map diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map deleted file mode 100644 index fec7769..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.mjs","sources":["../../src/resolve.ts","../../src/strip-filename.ts","../../src/sourcemap-segment.ts","../../src/sort.ts","../../src/binary-search.ts","../../src/by-source.ts","../../src/any-map.ts","../../src/trace-mapping.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["bsFound"],"mappings":";;;SAEwB,OAAO,CAAC,KAAa,EAAE,IAAwB;;;;IAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,IAAI,IAAI,GAAG,CAAC;IAE7C,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC;;ACTA;;;SAGwB,aAAa,CAAC,IAA+B;IACnE,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAClC;;ACQO,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,oBAAoB,GAAG,CAAC;;SClBb,SAAS,CAC/B,QAA8B,EAC9B,KAAc;IAEd,MAAM,aAAa,GAAG,uBAAuB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3D,IAAI,aAAa,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;;;IAIvD,IAAI,CAAC,KAAK;QAAE,QAAQ,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;IAExC,KAAK,I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AQ,EAAE,eAAe,CAAC,GAAG,CAAC;SAC/B,CAAC;KACH,CAAC;AACJ,CAAC,GAAA,CAAA;AAiBH,SAAS,oBAAoB,CAC3B,QAA+C,EAC/C,IAAe,EACf,IAAY,EACZ,MAAc,EACd,IAA4D;IAE5D,IAAI,KAAK,GAAG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/D,IAAIA,KAAO,EAAE;QACX,KAAK,GAAG,CAAC,IAAI,KAAK,iBAAiB,GAAG,UAAU,GAAG,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;KACzF;SAAM,IAAI,IAAI,KAAK,iBAAiB;QAAE,KAAK,EAAE,CAAC;IAE/C,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAC3D,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB;;;;"} \ No newline at end of file diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js deleted file mode 100644 index 8b755bd..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +++ /dev/null @@ -1,528 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/sourcemap-codec'), require('@jridgewell/resolve-uri')) : - typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/sourcemap-codec', '@jridgewell/resolve-uri'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.traceMapping = {}, global.sourcemapCodec, global.resolveURI)); -})(this, (function (exports, sourcemapCodec, resolveUri) { 'use strict'; - - function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - - var resolveUri__default = /*#__PURE__*/_interopDefaultLegacy(resolveUri); - - function resolve(input, base) { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) - base += '/'; - return resolveUri__default["default"](input, base); - } - - /** - * Removes everything after the last "/", but leaves the slash. - */ - function stripFilename(path) { - if (!path) - return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - - const COLUMN = 0; - const SOURCES_INDEX = 1; - const SOURCE_LINE = 2; - const SOURCE_COLUMN = 3; - const NAMES_INDEX = 4; - const REV_GENERATED_LINE = 1; - const REV_GENERATED_COLUMN = 2; - - function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) - return mappings; - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) - mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; - } - function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) - return i; - } - return mappings.length; - } - function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; - } - function sortSegments(line, owned) { - if (!owned) - line = line.slice(); - return line.sort(sortComparator); - } - function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; - } - - let found = false; - /** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ - function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } - else { - high = mid - 1; - } - } - found = false; - return low - 1; - } - function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; i++, index++) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; - } - function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; i--, index--) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; - } - function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; - } - /** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ - function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } - else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return (state.lastIndex = binarySearch(haystack, needle, low, high)); - } - - // Rebuilds the original source files, with mappings that are ordered by source line/column instead - // of generated line/column. - function buildBySources(decoded, memos) { - const sources = memos.map(buildNullArray); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) - continue; - const sourceIndex = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const originalSource = sources[sourceIndex]; - const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); - const memo = memos[sourceIndex]; - // The binary search either found a match, or it found the left-index just before where the - // segment should go. Either way, we want to insert after that. And there may be multiple - // generated segments associated with an original location, so there may need to move several - // indexes before we find where we need to insert. - const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); - insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); - } - } - return sources; - } - function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; - } - // Null arrays allow us to use ordered index keys without actually allocating contiguous memory like - // a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. - // Numeric properties on objects are magically sorted in ascending order by the engine regardless of - // the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending - // order when iterating with for-in. - function buildNullArray() { - return { __proto__: null }; - } - - const AnyMap = function (map, mapUrl) { - const parsed = typeof map === 'string' ? JSON.parse(map) : map; - if (!('sections' in parsed)) - return new TraceMap(parsed, mapUrl); - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const { sections } = parsed; - let i = 0; - for (; i < sections.length - 1; i++) { - const no = sections[i + 1].offset; - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); - } - if (sections.length > 0) { - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); - } - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - }; - return exports.presortedDecodedMap(joined); - }; - function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { - const map = AnyMap(section.map, mapUrl); - const { line: lineOffset, column: columnOffset } = section.offset; - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = exports.decodedMappings(map); - const { resolvedSources } = map; - append(sources, resolvedSources); - append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); - append(names, map.names); - // If this section jumps forwards several lines, we need to add lines to the output mappings catch up. - for (let i = mappings.length; i <= lineOffset; i++) - mappings.push([]); - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. - const stopI = stopLine - lineOffset; - const len = Math.min(decoded.length, stopI + 1); - for (let i = 0; i < len; i++) { - const line = decoded[i]; - // On the 0th loop, the line will already exist due to a previous section, or the line catch up - // loop above. - const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (i === stopI && column >= stopColumn) - break; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - if (seg.length === 4) { - out.push([column, sourcesIndex, sourceLine, sourceColumn]); - continue; - } - out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); - } - } - } - function append(arr, other) { - for (let i = 0; i < other.length; i++) - arr.push(other[i]); - } - // Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of - // equal length to the sources. This is because the sources and sourcesContent are paired arrays, - // where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined - // sourcemap would desynchronize the sources/contents. - function fillSourcesContent(len) { - const sourcesContent = []; - for (let i = 0; i < len; i++) - sourcesContent[i] = null; - return sourcesContent; - } - - const INVALID_ORIGINAL_MAPPING = Object.freeze({ - source: null, - line: null, - column: null, - name: null, - }); - const INVALID_GENERATED_MAPPING = Object.freeze({ - line: null, - column: null, - }); - const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; - const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; - const LEAST_UPPER_BOUND = -1; - const GREATEST_LOWER_BOUND = 1; - /** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ - exports.encodedMappings = void 0; - /** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ - exports.decodedMappings = void 0; - /** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ - exports.traceSegment = void 0; - /** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ - exports.originalPositionFor = void 0; - /** - * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided - * the found mapping is from the same source and line as the originalPositionFor mapping. - * - * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1` - * using the same needle that would return `id` when calling `originalPositionFor`. - */ - exports.generatedPositionFor = void 0; - /** - * Iterates each mapping in generated position order. - */ - exports.eachMapping = void 0; - /** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ - exports.presortedDecodedMap = void 0; - /** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - exports.decodedMap = void 0; - /** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - exports.encodedMap = void 0; - class TraceMap { - constructor(map, mapUrl) { - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - const isString = typeof map === 'string'; - if (!isString && map.constructor === TraceMap) - return map; - const parsed = (isString ? JSON.parse(map) : map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - if (sourceRoot || mapUrl) { - const from = resolve(sourceRoot || '', stripFilename(mapUrl)); - this.resolvedSources = sources.map((s) => resolve(s || '', from)); - } - else { - this.resolvedSources = sources.map((s) => s || ''); - } - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } - else { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } - } - } - (() => { - exports.encodedMappings = (map) => { - var _a; - return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = sourcemapCodec.encode(map._decoded))); - }; - exports.decodedMappings = (map) => { - return (map._decoded || (map._decoded = sourcemapCodec.decode(map._encoded))); - }; - exports.traceSegment = (map, line, column) => { - const decoded = exports.decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return null; - return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND); - }; - exports.originalPositionFor = (map, { line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const decoded = exports.decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return INVALID_ORIGINAL_MAPPING; - const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); - if (segment == null) - return INVALID_ORIGINAL_MAPPING; - if (segment.length == 1) - return INVALID_ORIGINAL_MAPPING; - const { names, resolvedSources } = map; - return { - source: resolvedSources[segment[SOURCES_INDEX]], - line: segment[SOURCE_LINE] + 1, - column: segment[SOURCE_COLUMN], - name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null, - }; - }; - exports.generatedPositionFor = (map, { source, line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex = sources.indexOf(source); - if (sourceIndex === -1) - sourceIndex = resolvedSources.indexOf(source); - if (sourceIndex === -1) - return INVALID_GENERATED_MAPPING; - const generated = (map._bySources || (map._bySources = buildBySources(exports.decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); - const memos = map._bySourceMemos; - const segments = generated[sourceIndex][line]; - if (segments == null) - return INVALID_GENERATED_MAPPING; - const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND); - if (segment == null) - return INVALID_GENERATED_MAPPING; - return { - line: segment[REV_GENERATED_LINE] + 1, - column: segment[REV_GENERATED_COLUMN], - }; - }; - exports.eachMapping = (map, cb) => { - const decoded = exports.decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) - name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name, - }); - } - } - }; - exports.presortedDecodedMap = (map, mapUrl) => { - const clone = Object.assign({}, map); - clone.mappings = []; - const tracer = new TraceMap(clone, mapUrl); - tracer._decoded = map.mappings; - return tracer; - }; - exports.decodedMap = (map) => { - return { - version: 3, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings: exports.decodedMappings(map), - }; - }; - exports.encodedMap = (map) => { - return { - version: 3, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings: exports.encodedMappings(map), - }; - }; - })(); - function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } - else if (bias === LEAST_UPPER_BOUND) - index++; - if (index === -1 || index === segments.length) - return null; - return segments[index]; - } - - exports.AnyMap = AnyMap; - exports.GREATEST_LOWER_BOUND = GREATEST_LOWER_BOUND; - exports.LEAST_UPPER_BOUND = LEAST_UPPER_BOUND; - exports.TraceMap = TraceMap; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map deleted file mode 100644 index 4ef72e7..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.umd.js","sources":["../../src/resolve.ts","../../src/strip-filename.ts","../../src/sourcemap-segment.ts","../../src/sort.ts","../../src/binary-search.ts","../../src/by-source.ts","../../src/any-map.ts","../../src/trace-mapping.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["resolveUri","presortedDecodedMap","decodedMappings","encodedMappings","traceSegment","originalPositionFor","generatedPositionFor","eachMapping","decodedMap","encodedMap","encode","decode","bsFound"],"mappings":";;;;;;;;;;aAEwB,OAAO,CAAC,KAAa,EAAE,IAAwB;;;;QAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,IAAI,IAAI,GAAG,CAAC;QAE7C,OAAOA,8BAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjC;;ICTA;;;aAGwB,aAAa,CAAC,IAA+B;QACnE,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC;;ICQO,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC,CAAC;IACtB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MA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map.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts deleted file mode 100644 index 08bca6b..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { TraceMap } from './trace-mapping'; -import type { SectionedSourceMapInput } from './types'; -declare type AnyMap = { - new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; - (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; -}; -export declare const AnyMap: AnyMap; -export {}; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts deleted file mode 100644 index 88820e5..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; -export declare type MemoState = { - lastKey: number; - lastNeedle: number; - lastIndex: number; -}; -export declare let found: boolean; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; -export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function memoizedState(): MemoState; -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts deleted file mode 100644 index 8d1e538..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; -import type { MemoState } from './binary-search'; -export declare type Source = { - __proto__: null; - [line: number]: Exclude[]; -}; -export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: MemoState[]): Source[]; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts deleted file mode 100644 index cf7d4f8..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts deleted file mode 100644 index 2bfb5dc..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts deleted file mode 100644 index 6d70924..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare type GeneratedColumn = number; -declare type SourcesIndex = number; -declare type SourceLine = number; -declare type SourceColumn = number; -declare type NamesIndex = number; -declare type GeneratedLine = number; -export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export declare type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export declare const REV_GENERATED_LINE = 1; -export declare const REV_GENERATED_COLUMN = 2; -export {}; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts deleted file mode 100644 index bead5c1..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export default function stripFilename(path: string | undefined | null): string; diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts deleted file mode 100644 index 8cd4574..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping } from './types'; -export type { SourceMapSegment } from './sourcemap-segment'; -export type { SourceMapInput, SectionedSourceMapInput, DecodedSourceMap, EncodedSourceMap, SectionedSourceMap, InvalidOriginalMapping, OriginalMapping as Mapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, EachMapping, } from './types'; -export declare const LEAST_UPPER_BOUND = -1; -export declare const GREATEST_LOWER_BOUND = 1; -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export declare let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings']; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export declare let decodedMappings: (map: TraceMap) => Readonly; -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -export declare let traceSegment: (map: TraceMap, line: number, column: number) => Readonly | null; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -export declare let originalPositionFor: (map: TraceMap, needle: Needle) => OriginalMapping | InvalidOriginalMapping; -/** - * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided - * the found mapping is from the same source and line as the originalPositionFor mapping. - * - * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1` - * using the same needle that would return `id` when calling `originalPositionFor`. - */ -export declare let generatedPositionFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping | InvalidGeneratedMapping; -/** - * Iterates each mapping in generated position order. - */ -export declare let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export declare let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare let decodedMap: (map: TraceMap) => Omit & { - mappings: readonly SourceMapSegment[][]; -}; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare let encodedMap: (map: TraceMap) => EncodedSourceMap; -export { AnyMap } from './any-map'; -export declare class TraceMap implements SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - resolvedSources: string[]; - private _encoded; - private _decoded; - private _decodedMemo; - private _bySources; - private _bySourceMemos; - constructor(map: SourceMapInput, mapUrl?: string | null); -} diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts deleted file mode 100644 index 2cc90c0..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -import type { TraceMap } from './trace-mapping'; -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: SourceMapSegment[][]; -} -export interface Section { - offset: { - line: number; - column: number; - }; - map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; -} -export interface SectionedSourceMap { - file?: string | null; - sections: Section[]; - version: 3; -} -export declare type OriginalMapping = { - source: string | null; - line: number; - column: number; - name: string | null; -}; -export declare type InvalidOriginalMapping = { - source: null; - line: null; - column: null; - name: null; -}; -export declare type GeneratedMapping = { - line: number; - column: number; -}; -export declare type InvalidGeneratedMapping = { - line: null; - column: null; -}; -export declare type SourceMapInput = string | EncodedSourceMap | DecodedSourceMap | TraceMap; -export declare type SectionedSourceMapInput = SourceMapInput | SectionedSourceMap; -export declare type Needle = { - line: number; - column: number; - bias?: 1 | -1; -}; -export declare type SourceNeedle = { - source: string; - line: number; - column: number; - bias?: 1 | -1; -}; -export declare type EachMapping = { - generatedLine: number; - generatedColumn: number; - source: null; - originalLine: null; - originalColumn: null; - name: null; -} | { - generatedLine: number; - generatedColumn: number; - source: string | null; - originalLine: number; - originalColumn: number; - name: string | null; -}; -export declare abstract class SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - resolvedSources: SourceMapV3['sources']; -} diff --git a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/package.json deleted file mode 100644 index a957780..0000000 --- a/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@jridgewell/trace-mapping", - "version": "0.3.9", - "description": "Trace the original position through a source map", - "keywords": [ - "source", - "map" - ], - "main": "dist/trace-mapping.umd.js", - "module": "dist/trace-mapping.mjs", - "typings": "dist/types/trace-mapping.d.ts", - "files": [ - "dist" - ], - "exports": { - ".": { - "browser": "./dist/trace-mapping.umd.js", - "require": "./dist/trace-mapping.umd.js", - "import": "./dist/trace-mapping.mjs" - }, - "./package.json": "./package.json" - }, - "author": "Justin Ridgewell ", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/trace-mapping.git" - }, - "license": "MIT", - "scripts": { - "benchmark": "run-s build:rollup benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node benchmark/index.mjs", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "prebuild": "rm -rf dist", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build", - "test": "run-s -n test:lint test:only", - "test:debug": "ava debug", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts' '**/*.md'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "c8 ava", - "test:watch": "ava --watch" - }, - "devDependencies": { - "@rollup/plugin-typescript": "8.3.0", - "@typescript-eslint/eslint-plugin": "5.10.0", - "@typescript-eslint/parser": "5.10.0", - "ava": "4.0.1", - "benchmark": "2.1.4", - "c8": "7.11.0", - "esbuild": "0.14.14", - "esbuild-node-loader": "0.6.4", - "eslint": "8.7.0", - "eslint-config-prettier": "8.3.0", - "npm-run-all": "4.1.5", - "prettier": "2.5.1", - "rollup": "2.64.0", - "typescript": "4.5.4" - }, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } -} diff --git a/node_modules/@cspotcode/source-map-support/package.json b/node_modules/@cspotcode/source-map-support/package.json deleted file mode 100644 index a3ef65c..0000000 --- a/node_modules/@cspotcode/source-map-support/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@cspotcode/source-map-support", - "description": "Fixes stack traces for files with source maps", - "version": "0.8.1", - "main": "./source-map-support.js", - "types": "./source-map-support.d.ts", - "scripts": { - "build": "node build.js", - "serve-tests": "http-server -p 1336", - "test": "mocha" - }, - "files": [ - "/register.d.ts", - "/register.js", - "/register-hook-require.d.ts", - "/register-hook-require.js", - "/source-map-support.d.ts", - "/source-map-support.js", - "/browser-source-map-support.js" - ], - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "devDependencies": { - "@types/lodash": "^4.14.182", - "browserify": "^4.2.3", - "coffeescript": "^1.12.7", - "http-server": "^0.11.1", - "lodash": "^4.17.21", - "mocha": "^3.5.3", - "semver": "^7.3.7", - "source-map": "0.6.1", - "webpack": "^1.15.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/cspotcode/node-source-map-support" - }, - "bugs": { - "url": "https://github.com/cspotcode/node-source-map-support/issues" - }, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "volta": { - "node": "16.11.0", - "npm": "7.24.2" - } -} diff --git a/node_modules/@cspotcode/source-map-support/register-hook-require.d.ts b/node_modules/@cspotcode/source-map-support/register-hook-require.d.ts deleted file mode 100644 index a787e69..0000000 --- a/node_modules/@cspotcode/source-map-support/register-hook-require.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// tslint:disable:no-useless-files - -// For following usage: -// import '@cspotcode/source-map-support/register-hook-require' -// Instead of: -// import sourceMapSupport from '@cspotcode/source-map-support' -// sourceMapSupport.install({hookRequire: true}) diff --git a/node_modules/@cspotcode/source-map-support/register-hook-require.js b/node_modules/@cspotcode/source-map-support/register-hook-require.js deleted file mode 100644 index 6bc12ab..0000000 --- a/node_modules/@cspotcode/source-map-support/register-hook-require.js +++ /dev/null @@ -1,3 +0,0 @@ -require('./').install({ - hookRequire: true -}); diff --git a/node_modules/@cspotcode/source-map-support/register.d.ts b/node_modules/@cspotcode/source-map-support/register.d.ts deleted file mode 100644 index 063cd7c..0000000 --- a/node_modules/@cspotcode/source-map-support/register.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// tslint:disable:no-useless-files - -// For following usage: -// import '@cspotcode/source-map-support/register' -// Instead of: -// import sourceMapSupport from '@cspotcode/source-map-support' -// sourceMapSupport.install() diff --git a/node_modules/@cspotcode/source-map-support/register.js b/node_modules/@cspotcode/source-map-support/register.js deleted file mode 100644 index 4f68e67..0000000 --- a/node_modules/@cspotcode/source-map-support/register.js +++ /dev/null @@ -1 +0,0 @@ -require('./').install(); diff --git a/node_modules/@cspotcode/source-map-support/source-map-support.d.ts b/node_modules/@cspotcode/source-map-support/source-map-support.d.ts deleted file mode 100644 index d8cb9d8..0000000 --- a/node_modules/@cspotcode/source-map-support/source-map-support.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Type definitions for source-map-support 0.5 -// Project: https://github.com/evanw/node-source-map-support -// Definitions by: Bart van der Schoor -// Jason Cheatham -// Alcedo Nathaniel De Guzman Jr -// Griffin Yourick -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export interface RawSourceMap { - version: 3; - sources: string[]; - names: string[]; - sourceRoot?: string; - sourcesContent?: string[]; - mappings: string; - file: string; -} - -/** - * Output of retrieveSourceMap(). - * From source-map-support: - * The map field may be either a string or the parsed JSON object (i.e., - * it must be a valid argument to the SourceMapConsumer constructor). - */ -export interface UrlAndMap { - url: string; - map: string | RawSourceMap; -} - -/** - * Options to install(). - */ -export interface Options { - handleUncaughtExceptions?: boolean | undefined; - hookRequire?: boolean | undefined; - emptyCacheBetweenOperations?: boolean | undefined; - environment?: 'auto' | 'browser' | 'node' | undefined; - overrideRetrieveFile?: boolean | undefined; - overrideRetrieveSourceMap?: boolean | undefined; - retrieveFile?(path: string): string; - retrieveSourceMap?(source: string): UrlAndMap | null; - /** - * Set false to disable redirection of require / import `source-map-support` to `@cspotcode/source-map-support` - */ - redirectConflictingLibrary?: boolean; - /** - * Callback will be called every time we redirect due to `redirectConflictingLibrary` - * This allows consumers to log helpful warnings if they choose. - * @param parent NodeJS.Module which made the require() or require.resolve() call - * @param options options object internally passed to node's `_resolveFilename` hook - */ - onConflictingLibraryRedirect?: (request: string, parent: any, isMain: boolean, options: any, redirectedRequest: string) => void; -} - -export interface Position { - source: string; - line: number; - column: number; -} - -export function wrapCallSite(frame: any /* StackFrame */): any /* StackFrame */; -export function getErrorSource(error: Error): string | null; -export function mapSourcePosition(position: Position): Position; -export function retrieveSourceMap(source: string): UrlAndMap | null; -export function resetRetrieveHandlers(): void; - -/** - * Install SourceMap support. - * @param options Can be used to e.g. disable uncaughtException handler. - */ -export function install(options?: Options): void; - -/** - * Uninstall SourceMap support. - */ -export function uninstall(): void; diff --git a/node_modules/@cspotcode/source-map-support/source-map-support.js b/node_modules/@cspotcode/source-map-support/source-map-support.js deleted file mode 100644 index ad830b6..0000000 --- a/node_modules/@cspotcode/source-map-support/source-map-support.js +++ /dev/null @@ -1,938 +0,0 @@ -const { TraceMap, originalPositionFor, AnyMap } = require('@jridgewell/trace-mapping'); -var path = require('path'); -const { fileURLToPath, pathToFileURL } = require('url'); -var util = require('util'); - -var fs; -try { - fs = require('fs'); - if (!fs.existsSync || !fs.readFileSync) { - // fs doesn't have all methods we need - fs = null; - } -} catch (err) { - /* nop */ -} - -/** - * Requires a module which is protected against bundler minification. - * - * @param {NodeModule} mod - * @param {string} request - */ -function dynamicRequire(mod, request) { - return mod.require(request); -} - -/** - * @typedef {{ - * enabled: boolean; - * originalValue: any; - * installedValue: any; - * }} HookState - * Used for installing and uninstalling hooks - */ - -// Increment this if the format of sharedData changes in a breaking way. -var sharedDataVersion = 1; - -/** - * @template T - * @param {T} defaults - * @returns {T} - */ -function initializeSharedData(defaults) { - var sharedDataKey = 'source-map-support/sharedData'; - if (typeof Symbol !== 'undefined') { - sharedDataKey = Symbol.for(sharedDataKey); - } - var sharedData = this[sharedDataKey]; - if (!sharedData) { - sharedData = { version: sharedDataVersion }; - if (Object.defineProperty) { - Object.defineProperty(this, sharedDataKey, { value: sharedData }); - } else { - this[sharedDataKey] = sharedData; - } - } - if (sharedDataVersion !== sharedData.version) { - throw new Error("Multiple incompatible instances of source-map-support were loaded"); - } - for (var key in defaults) { - if (!(key in sharedData)) { - sharedData[key] = defaults[key]; - } - } - return sharedData; -} - -// If multiple instances of source-map-support are loaded into the same -// context, they shouldn't overwrite each other. By storing handlers, caches, -// and other state on a shared object, different instances of -// source-map-support can work together in a limited way. This does require -// that future versions of source-map-support continue to support the fields on -// this object. If this internal contract ever needs to be broken, increment -// sharedDataVersion. (This version number is not the same as any of the -// package's version numbers, which should reflect the *external* API of -// source-map-support.) -var sharedData = initializeSharedData({ - - // Only install once if called multiple times - // Remember how the environment looked before installation so we can restore if able - /** @type {HookState} */ - errorPrepareStackTraceHook: undefined, - /** @type {HookState} */ - processEmitHook: undefined, - /** @type {HookState} */ - moduleResolveFilenameHook: undefined, - - /** @type {Array<(request: string, parent: any, isMain: boolean, options: any, redirectedRequest: string) => void>} */ - onConflictingLibraryRedirectArr: [], - - // If true, the caches are reset before a stack trace formatting operation - emptyCacheBetweenOperations: false, - - // Maps a file path to a string containing the file contents - fileContentsCache: Object.create(null), - - // Maps a file path to a source map for that file - /** @type {Record C:/dir/file - '/'; // file:///root-dir/file -> /root-dir/file - }); - } - const key = getCacheKey(path); - if(hasFileContentsCacheFromKey(key)) { - return getFileContentsCacheFromKey(key); - } - - var contents = ''; - try { - if (!fs) { - // Use SJAX if we are in the browser - var xhr = new XMLHttpRequest(); - xhr.open('GET', path, /** async */ false); - xhr.send(null); - if (xhr.readyState === 4 && xhr.status === 200) { - contents = xhr.responseText; - } - } else if (fs.existsSync(path)) { - // Otherwise, use the filesystem - contents = fs.readFileSync(path, 'utf8'); - } - } catch (er) { - /* ignore any errors */ - } - - return setFileContentsCache(path, contents); -}); - -// Support URLs relative to a directory, but be careful about a protocol prefix -// in case we are in the browser (i.e. directories may start with "http://" or "file:///") -function supportRelativeURL(file, url) { - if(!file) return url; - // given that this happens within error formatting codepath, probably best to - // fallback instead of throwing if anything goes wrong - try { - // if should output a URL - if(isAbsoluteUrl(file) || isSchemeRelativeUrl(file)) { - if(isAbsoluteUrl(url) || isSchemeRelativeUrl(url)) { - return new URL(url, file).toString(); - } - if(path.isAbsolute(url)) { - return new URL(pathToFileURL(url), file).toString(); - } - // url is relative path or URL - return new URL(url.replace(/\\/g, '/'), file).toString(); - } - // if should output a path (unless URL is something like https://) - if(path.isAbsolute(file)) { - if(isFileUrl(url)) { - return fileURLToPath(url); - } - if(isSchemeRelativeUrl(url)) { - return fileURLToPath(new URL(url, 'file://')); - } - if(isAbsoluteUrl(url)) { - // url is a non-file URL - // Go with the URL - return url; - } - if(path.isAbsolute(url)) { - // Normalize at all? decodeURI or normalize slashes? - return path.normalize(url); - } - // url is relative path or URL - return path.join(file, '..', decodeURI(url)); - } - // If we get here, file is relative. - // Shouldn't happen since node identifies modules with absolute paths or URLs. - // But we can take a stab at returning something meaningful anyway. - if(isAbsoluteUrl(url) || isSchemeRelativeUrl(url)) { - return url; - } - return path.join(file, '..', url); - } catch(e) { - return url; - } -} - -// Return pathOrUrl in the same style as matchStyleOf: either a file URL or a native path -function matchStyleOfPathOrUrl(matchStyleOf, pathOrUrl) { - try { - if(isAbsoluteUrl(matchStyleOf) || isSchemeRelativeUrl(matchStyleOf)) { - if(isAbsoluteUrl(pathOrUrl) || isSchemeRelativeUrl(pathOrUrl)) return pathOrUrl; - if(path.isAbsolute(pathOrUrl)) return pathToFileURL(pathOrUrl).toString(); - } else if(path.isAbsolute(matchStyleOf)) { - if(isAbsoluteUrl(pathOrUrl) || isSchemeRelativeUrl(pathOrUrl)) { - return fileURLToPath(new URL(pathOrUrl, 'file://')); - } - } - return pathOrUrl; - } catch(e) { - return pathOrUrl; - } -} - -function retrieveSourceMapURL(source) { - var fileData; - - if (isInBrowser()) { - try { - var xhr = new XMLHttpRequest(); - xhr.open('GET', source, false); - xhr.send(null); - fileData = xhr.readyState === 4 ? xhr.responseText : null; - - // Support providing a sourceMappingURL via the SourceMap header - var sourceMapHeader = xhr.getResponseHeader("SourceMap") || - xhr.getResponseHeader("X-SourceMap"); - if (sourceMapHeader) { - return sourceMapHeader; - } - } catch (e) { - } - } - - // Get the URL of the source map - fileData = retrieveFile(tryFileURLToPath(source)); - var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg; - // Keep executing the search to find the *last* sourceMappingURL to avoid - // picking up sourceMappingURLs from comments, strings, etc. - var lastMatch, match; - while (match = re.exec(fileData)) lastMatch = match; - if (!lastMatch) return null; - return lastMatch[1]; -}; - -// Can be overridden by the retrieveSourceMap option to install. Takes a -// generated source filename; returns a {map, optional url} object, or null if -// there is no source map. The map field may be either a string or the parsed -// JSON object (ie, it must be a valid argument to the SourceMapConsumer -// constructor). -/** @type {(source: string) => import('./source-map-support').UrlAndMap | null} */ -var retrieveSourceMap = handlerExec(sharedData.retrieveMapHandlers, sharedData.internalRetrieveMapHandlers); -sharedData.internalRetrieveMapHandlers.push(function(source) { - var sourceMappingURL = retrieveSourceMapURL(source); - if (!sourceMappingURL) return null; - - // Read the contents of the source map - var sourceMapData; - if (reSourceMap.test(sourceMappingURL)) { - // Support source map URL as a data url - var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1); - sourceMapData = Buffer.from(rawData, "base64").toString(); - sourceMappingURL = source; - } else { - // Support source map URLs relative to the source URL - sourceMappingURL = supportRelativeURL(source, sourceMappingURL); - sourceMapData = retrieveFile(tryFileURLToPath(sourceMappingURL)); - } - - if (!sourceMapData) { - return null; - } - - return { - url: sourceMappingURL, - map: sourceMapData - }; -}); - -function mapSourcePosition(position) { - var sourceMap = getSourceMapCache(position.source); - if (!sourceMap) { - // Call the (overrideable) retrieveSourceMap function to get the source map. - var urlAndMap = retrieveSourceMap(position.source); - if (urlAndMap) { - sourceMap = setSourceMapCache(position.source, { - url: urlAndMap.url, - map: new AnyMap(urlAndMap.map, urlAndMap.url) - }); - - // Overwrite trace-mapping's resolutions, because they do not handle - // Windows paths the way we want. - // TODO Remove now that windows path support was added to resolve-uri and thus trace-mapping? - sourceMap.map.resolvedSources = sourceMap.map.sources.map(s => supportRelativeURL(sourceMap.url, s)); - - // Load all sources stored inline with the source map into the file cache - // to pretend like they are already loaded. They may not exist on disk. - if (sourceMap.map.sourcesContent) { - sourceMap.map.resolvedSources.forEach(function(resolvedSource, i) { - var contents = sourceMap.map.sourcesContent[i]; - if (contents) { - setFileContentsCache(resolvedSource, contents); - } - }); - } - } else { - sourceMap = setSourceMapCache(position.source, { - url: null, - map: null - }); - } - } - - // Resolve the source URL relative to the URL of the source map - if (sourceMap && sourceMap.map) { - var originalPosition = originalPositionFor(sourceMap.map, position); - - // Only return the original position if a matching line was found. If no - // matching line is found then we return position instead, which will cause - // the stack trace to print the path and line for the compiled file. It is - // better to give a precise location in the compiled file than a vague - // location in the original file. - if (originalPosition.source !== null) { - // originalPosition.source has *already* been resolved against sourceMap.url - // so is *already* as absolute as possible. - // However, we want to ensure we output in same format as input: URL or native path - originalPosition.source = matchStyleOfPathOrUrl( - position.source, originalPosition.source); - return originalPosition; - } - } - - return position; -} - -// Parses code generated by FormatEvalOrigin(), a function inside V8: -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js -function mapEvalOrigin(origin) { - // Most eval() calls are in this format - var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin); - if (match) { - var position = mapSourcePosition({ - source: match[2], - line: +match[3], - column: match[4] - 1 - }); - return 'eval at ' + match[1] + ' (' + position.source + ':' + - position.line + ':' + (position.column + 1) + ')'; - } - - // Parse nested eval() calls using recursion - match = /^eval at ([^(]+) \((.+)\)$/.exec(origin); - if (match) { - return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')'; - } - - // Make sure we still return useful information if we didn't find anything - return origin; -} - -// This is copied almost verbatim from the V8 source code at -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js -// Update 2022-04-29: -// https://github.com/v8/v8/blob/98f6f100c5ab8e390e51422747c4ef644d5ac6f2/src/builtins/builtins-callsite.cc#L175-L179 -// https://github.com/v8/v8/blob/98f6f100c5ab8e390e51422747c4ef644d5ac6f2/src/objects/call-site-info.cc#L795-L804 -// https://github.com/v8/v8/blob/98f6f100c5ab8e390e51422747c4ef644d5ac6f2/src/objects/call-site-info.cc#L717-L750 -// The implementation of wrapCallSite() used to just forward to the actual source -// code of CallSite.prototype.toString but unfortunately a new release of V8 -// did something to the prototype chain and broke the shim. The only fix I -// could find was copy/paste. -function CallSiteToString() { - var fileName; - var fileLocation = ""; - if (this.isNative()) { - fileLocation = "native"; - } else { - fileName = this.getScriptNameOrSourceURL(); - if (!fileName && this.isEval()) { - fileLocation = this.getEvalOrigin(); - fileLocation += ", "; // Expecting source position to follow. - } - - if (fileName) { - fileLocation += fileName; - } else { - // Source code does not originate from a file and is not native, but we - // can still get the source position inside the source string, e.g. in - // an eval string. - fileLocation += ""; - } - var lineNumber = this.getLineNumber(); - if (lineNumber != null) { - fileLocation += ":" + lineNumber; - var columnNumber = this.getColumnNumber(); - if (columnNumber) { - fileLocation += ":" + columnNumber; - } - } - } - - var line = ""; - var isAsync = this.isAsync ? this.isAsync() : false; - if(isAsync) { - line += 'async '; - var isPromiseAll = this.isPromiseAll ? this.isPromiseAll() : false; - var isPromiseAny = this.isPromiseAny ? this.isPromiseAny() : false; - if(isPromiseAny || isPromiseAll) { - line += isPromiseAll ? 'Promise.all (index ' : 'Promise.any (index '; - var promiseIndex = this.getPromiseIndex(); - line += promiseIndex + ')'; - } - } - var functionName = this.getFunctionName(); - var addSuffix = true; - var isConstructor = this.isConstructor(); - var isMethodCall = !(this.isToplevel() || isConstructor); - if (isMethodCall) { - var typeName = this.getTypeName(); - // Fixes shim to be backward compatable with Node v0 to v4 - if (typeName === "[object Object]") { - typeName = "null"; - } - var methodName = this.getMethodName(); - if (functionName) { - if (typeName && functionName.indexOf(typeName) != 0) { - line += typeName + "."; - } - line += functionName; - if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) { - line += " [as " + methodName + "]"; - } - } else { - line += typeName + "." + (methodName || ""); - } - } else if (isConstructor) { - line += "new " + (functionName || ""); - } else if (functionName) { - line += functionName; - } else { - line += fileLocation; - addSuffix = false; - } - if (addSuffix) { - line += " (" + fileLocation + ")"; - } - return line; -} - -function cloneCallSite(frame) { - var object = {}; - Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) { - object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name]; - }); - object.toString = CallSiteToString; - return object; -} - -function wrapCallSite(frame, state) { - // provides interface backward compatibility - if (state === undefined) { - state = { nextPosition: null, curPosition: null } - } - if(frame.isNative()) { - state.curPosition = null; - return frame; - } - - // Most call sites will return the source file from getFileName(), but code - // passed to eval() ending in "//# sourceURL=..." will return the source file - // from getScriptNameOrSourceURL() instead - var source = frame.getFileName() || frame.getScriptNameOrSourceURL(); - if (source) { - // v8 does not expose its internal isWasm, etc methods, so we do this instead. - if(source.startsWith('wasm://')) { - state.curPosition = null; - return frame; - } - - var line = frame.getLineNumber(); - var column = frame.getColumnNumber() - 1; - - // Fix position in Node where some (internal) code is prepended. - // See https://github.com/evanw/node-source-map-support/issues/36 - // Header removed in node at ^10.16 || >=11.11.0 - // v11 is not an LTS candidate, we can just test the one version with it. - // Test node versions for: 10.16-19, 10.20+, 12-19, 20-99, 100+, or 11.11 - var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/; - var headerLength = noHeader.test(process.version) ? 0 : 62; - if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { - column -= headerLength; - } - - var position = mapSourcePosition({ - source: source, - line: line, - column: column - }); - state.curPosition = position; - frame = cloneCallSite(frame); - var originalFunctionName = frame.getFunctionName; - frame.getFunctionName = function() { - if (state.nextPosition == null) { - return originalFunctionName(); - } - return state.nextPosition.name || originalFunctionName(); - }; - frame.getFileName = function() { return position.source; }; - frame.getLineNumber = function() { return position.line; }; - frame.getColumnNumber = function() { return position.column + 1; }; - frame.getScriptNameOrSourceURL = function() { return position.source; }; - return frame; - } - - // Code called using eval() needs special handling - var origin = frame.isEval() && frame.getEvalOrigin(); - if (origin) { - origin = mapEvalOrigin(origin); - frame = cloneCallSite(frame); - frame.getEvalOrigin = function() { return origin; }; - return frame; - } - - // If we get here then we were unable to change the source position - return frame; -} - -var kIsNodeError = undefined; -try { - // Get a deliberate ERR_INVALID_ARG_TYPE - // TODO is there a better way to reliably get an instance of NodeError? - path.resolve(123); -} catch(e) { - const symbols = Object.getOwnPropertySymbols(e); - const symbol = symbols.find(function (s) {return s.toString().indexOf('kIsNodeError') >= 0}); - if(symbol) kIsNodeError = symbol; -} - -const ErrorPrototypeToString = (err) =>Error.prototype.toString.call(err); - -/** @param {HookState} hookState */ -function createPrepareStackTrace(hookState) { - return prepareStackTrace; - - // This function is part of the V8 stack trace API, for more info see: - // https://v8.dev/docs/stack-trace-api - function prepareStackTrace(error, stack) { - if(!hookState.enabled) return hookState.originalValue.apply(this, arguments); - - if (sharedData.emptyCacheBetweenOperations) { - clearCaches(); - } - - // node gives its own errors special treatment. Mimic that behavior - // https://github.com/nodejs/node/blob/3cbaabc4622df1b4009b9d026a1a970bdbae6e89/lib/internal/errors.js#L118-L128 - // https://github.com/nodejs/node/pull/39182 - var errorString; - if (kIsNodeError) { - if(kIsNodeError in error) { - errorString = `${error.name} [${error.code}]: ${error.message}`; - } else { - errorString = ErrorPrototypeToString(error); - } - } else { - var name = error.name || 'Error'; - var message = error.message || ''; - errorString = message ? name + ": " + message : name; - } - - var state = { nextPosition: null, curPosition: null }; - var processedStack = []; - for (var i = stack.length - 1; i >= 0; i--) { - processedStack.push('\n at ' + wrapCallSite(stack[i], state)); - state.nextPosition = state.curPosition; - } - state.curPosition = state.nextPosition = null; - return errorString + processedStack.reverse().join(''); - } -} - -// Generate position and snippet of original source with pointer -function getErrorSource(error) { - var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack); - if (match) { - var source = match[1]; - var line = +match[2]; - var column = +match[3]; - - // Support the inline sourceContents inside the source map - var contents = getFileContentsCache(source); - - const sourceAsPath = tryFileURLToPath(source); - - // Support files on disk - if (!contents && fs && fs.existsSync(sourceAsPath)) { - try { - contents = fs.readFileSync(sourceAsPath, 'utf8'); - } catch (er) { - contents = ''; - } - } - - // Format the line from the original source code like node does - if (contents) { - var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; - if (code) { - return source + ':' + line + '\n' + code + '\n' + - new Array(column).join(' ') + '^'; - } - } - } - return null; -} - -function printFatalErrorUponExit (error) { - var source = getErrorSource(error); - - // Ensure error is printed synchronously and not truncated - if (process.stderr._handle && process.stderr._handle.setBlocking) { - process.stderr._handle.setBlocking(true); - } - - if (source) { - console.error(source); - } - - // Matches node's behavior for colorized output - console.error( - util.inspect(error, { - customInspect: false, - colors: process.stderr.isTTY - }) - ); -} - -function shimEmitUncaughtException () { - const originalValue = process.emit; - var hook = sharedData.processEmitHook = { - enabled: true, - originalValue, - installedValue: undefined - }; - var isTerminatingDueToFatalException = false; - var fatalException; - - process.emit = sharedData.processEmitHook.installedValue = function (type) { - const hadListeners = originalValue.apply(this, arguments); - if(hook.enabled) { - if (type === 'uncaughtException' && !hadListeners) { - isTerminatingDueToFatalException = true; - fatalException = arguments[1]; - process.exit(1); - } - if (type === 'exit' && isTerminatingDueToFatalException) { - printFatalErrorUponExit(fatalException); - } - } - return hadListeners; - }; -} - -var originalRetrieveFileHandlers = sharedData.retrieveFileHandlers.slice(0); -var originalRetrieveMapHandlers = sharedData.retrieveMapHandlers.slice(0); - -exports.wrapCallSite = wrapCallSite; -exports.getErrorSource = getErrorSource; -exports.mapSourcePosition = mapSourcePosition; -exports.retrieveSourceMap = retrieveSourceMap; - -exports.install = function(options) { - options = options || {}; - - if (options.environment) { - environment = options.environment; - if (["node", "browser", "auto"].indexOf(environment) === -1) { - throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}") - } - } - - // Use dynamicRequire to avoid including in browser bundles - var Module = dynamicRequire(module, 'module'); - - // Redirect subsequent imports of "source-map-support" - // to this package - const {redirectConflictingLibrary = true, onConflictingLibraryRedirect} = options; - if(redirectConflictingLibrary) { - if (!sharedData.moduleResolveFilenameHook) { - const originalValue = Module._resolveFilename; - const moduleResolveFilenameHook = sharedData.moduleResolveFilenameHook = { - enabled: true, - originalValue, - installedValue: undefined, - } - Module._resolveFilename = sharedData.moduleResolveFilenameHook.installedValue = function (request, parent, isMain, options) { - if (moduleResolveFilenameHook.enabled) { - // Match all source-map-support entrypoints: source-map-support, source-map-support/register - let requestRedirect; - if (request === 'source-map-support') { - requestRedirect = './'; - } else if (request === 'source-map-support/register') { - requestRedirect = './register'; - } - - if (requestRedirect !== undefined) { - const newRequest = require.resolve(requestRedirect); - for (const cb of sharedData.onConflictingLibraryRedirectArr) { - cb(request, parent, isMain, options, newRequest); - } - request = newRequest; - } - } - - return originalValue.call(this, request, parent, isMain, options); - } - } - if (onConflictingLibraryRedirect) { - sharedData.onConflictingLibraryRedirectArr.push(onConflictingLibraryRedirect); - } - } - - // Allow sources to be found by methods other than reading the files - // directly from disk. - if (options.retrieveFile) { - if (options.overrideRetrieveFile) { - sharedData.retrieveFileHandlers.length = 0; - } - - sharedData.retrieveFileHandlers.unshift(options.retrieveFile); - } - - // Allow source maps to be found by methods other than reading the files - // directly from disk. - if (options.retrieveSourceMap) { - if (options.overrideRetrieveSourceMap) { - sharedData.retrieveMapHandlers.length = 0; - } - - sharedData.retrieveMapHandlers.unshift(options.retrieveSourceMap); - } - - // Support runtime transpilers that include inline source maps - if (options.hookRequire && !isInBrowser()) { - var $compile = Module.prototype._compile; - - if (!$compile.__sourceMapSupport) { - Module.prototype._compile = function(content, filename) { - setFileContentsCache(filename, content); - setSourceMapCache(filename, undefined); - return $compile.call(this, content, filename); - }; - - Module.prototype._compile.__sourceMapSupport = true; - } - } - - // Configure options - if (!sharedData.emptyCacheBetweenOperations) { - sharedData.emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ? - options.emptyCacheBetweenOperations : false; - } - - - // Install the error reformatter - if (!sharedData.errorPrepareStackTraceHook) { - const originalValue = Error.prepareStackTrace; - sharedData.errorPrepareStackTraceHook = { - enabled: true, - originalValue, - installedValue: undefined - }; - Error.prepareStackTrace = sharedData.errorPrepareStackTraceHook.installedValue = createPrepareStackTrace(sharedData.errorPrepareStackTraceHook); - } - - if (!sharedData.processEmitHook) { - var installHandler = 'handleUncaughtExceptions' in options ? - options.handleUncaughtExceptions : true; - - // Do not override 'uncaughtException' with our own handler in Node.js - // Worker threads. Workers pass the error to the main thread as an event, - // rather than printing something to stderr and exiting. - try { - // We need to use `dynamicRequire` because `require` on it's own will be optimized by WebPack/Browserify. - var worker_threads = dynamicRequire(module, 'worker_threads'); - if (worker_threads.isMainThread === false) { - installHandler = false; - } - } catch(e) {} - - // Provide the option to not install the uncaught exception handler. This is - // to support other uncaught exception handlers (in test frameworks, for - // example). If this handler is not installed and there are no other uncaught - // exception handlers, uncaught exceptions will be caught by node's built-in - // exception handler and the process will still be terminated. However, the - // generated JavaScript code will be shown above the stack trace instead of - // the original source code. - if (installHandler && hasGlobalProcessEventEmitter()) { - shimEmitUncaughtException(); - } - } -}; - -exports.uninstall = function() { - if(sharedData.processEmitHook) { - // Disable behavior - sharedData.processEmitHook.enabled = false; - // If possible, remove our hook function. May not be possible if subsequent third-party hooks have wrapped around us. - if(process.emit === sharedData.processEmitHook.installedValue) { - process.emit = sharedData.processEmitHook.originalValue; - } - sharedData.processEmitHook = undefined; - } - if(sharedData.errorPrepareStackTraceHook) { - // Disable behavior - sharedData.errorPrepareStackTraceHook.enabled = false; - // If possible or necessary, remove our hook function. - // In vanilla environments, prepareStackTrace is `undefined`. - // We cannot delegate to `undefined` the way we can to a function w/`.apply()`; our only option is to remove the function. - // If we are the *first* hook installed, and another was installed on top of us, we have no choice but to remove both. - if(Error.prepareStackTrace === sharedData.errorPrepareStackTraceHook.installedValue || typeof sharedData.errorPrepareStackTraceHook.originalValue !== 'function') { - Error.prepareStackTrace = sharedData.errorPrepareStackTraceHook.originalValue; - } - sharedData.errorPrepareStackTraceHook = undefined; - } - if (sharedData.moduleResolveFilenameHook) { - // Disable behavior - sharedData.moduleResolveFilenameHook.enabled = false; - // If possible, remove our hook function. May not be possible if subsequent third-party hooks have wrapped around us. - var Module = dynamicRequire(module, 'module'); - if(Module._resolveFilename === sharedData.moduleResolveFilenameHook.installedValue) { - Module._resolveFilename = sharedData.moduleResolveFilenameHook.originalValue; - } - sharedData.moduleResolveFilenameHook = undefined; - } - sharedData.onConflictingLibraryRedirectArr.length = 0; -} - -exports.resetRetrieveHandlers = function() { - sharedData.retrieveFileHandlers.length = 0; - sharedData.retrieveMapHandlers.length = 0; -} diff --git a/node_modules/@discoveryjs/json-ext/LICENSE b/node_modules/@discoveryjs/json-ext/LICENSE deleted file mode 100644 index 44f551a..0000000 --- a/node_modules/@discoveryjs/json-ext/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Roman Dvornov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@discoveryjs/json-ext/README.md b/node_modules/@discoveryjs/json-ext/README.md deleted file mode 100644 index f155a9d..0000000 --- a/node_modules/@discoveryjs/json-ext/README.md +++ /dev/null @@ -1,256 +0,0 @@ -# json-ext - -[![NPM version](https://img.shields.io/npm/v/@discoveryjs/json-ext.svg)](https://www.npmjs.com/package/@discoveryjs/json-ext) -[![Build Status](https://github.com/discoveryjs/json-ext/actions/workflows/ci.yml/badge.svg)](https://github.com/discoveryjs/json-ext/actions/workflows/ci.yml) -[![Coverage Status](https://coveralls.io/repos/github/discoveryjs/json-ext/badge.svg?branch=master)](https://coveralls.io/github/discoveryjs/json-ext?) -[![NPM Downloads](https://img.shields.io/npm/dm/@discoveryjs/json-ext.svg)](https://www.npmjs.com/package/@discoveryjs/json-ext) - -A set of utilities that extend the use of JSON. Designed to be fast and memory efficient - -Features: - -- [x] `parseChunked()` – Parse JSON that comes by chunks (e.g. FS readable stream or fetch response stream) -- [x] `stringifyStream()` – Stringify stream (Node.js) -- [x] `stringifyInfo()` – Get estimated size and other facts of JSON.stringify() without converting a value to string -- [ ] **TBD** Support for circular references -- [ ] **TBD** Binary representation [branch](https://github.com/discoveryjs/json-ext/tree/binary) -- [ ] **TBD** WHATWG [Streams](https://streams.spec.whatwg.org/) support - -## Install - -```bash -npm install @discoveryjs/json-ext -``` - -## API - -- [parseChunked(chunkEmitter)](#parsechunkedchunkemitter) -- [stringifyStream(value[, replacer[, space]])](#stringifystreamvalue-replacer-space) -- [stringifyInfo(value[, replacer[, space[, options]]])](#stringifyinfovalue-replacer-space-options) - - [Options](#options) - - [async](#async) - - [continueOnCircular](#continueoncircular) -- [version](#version) - -### parseChunked(chunkEmitter) - -Works the same as [`JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) but takes `chunkEmitter` instead of string and returns [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - -> NOTE: `reviver` parameter is not supported yet, but will be added in next releases. -> NOTE: WHATWG streams aren't supported yet - -When to use: -- It's required to avoid freezing the main thread during big JSON parsing, since this process can be distributed in time -- Huge JSON needs to be parsed (e.g. >500MB on Node.js) -- Needed to reduce memory pressure. `JSON.parse()` needs to receive the entire JSON before parsing it. With `parseChunked()` you may parse JSON as first bytes of it comes. This approach helps to avoid storing a huge string in the memory at a single time point and following GC. - -[Benchmark](https://github.com/discoveryjs/json-ext/tree/master/benchmarks#parse-chunked) - -Usage: - -```js -const { parseChunked } = require('@discoveryjs/json-ext'); - -// as a regular Promise -parseChunked(chunkEmitter) - .then(data => { - /* data is parsed JSON */ - }); - -// using await (keep in mind that not every runtime has a support for top level await) -const data = await parseChunked(chunkEmitter); -``` - -Parameter `chunkEmitter` can be: -- [`ReadableStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_readable_streams) (Node.js only) -```js -const fs = require('fs'); -const { parseChunked } = require('@discoveryjs/json-ext'); - -parseChunked(fs.createReadStream('path/to/file.json')) -``` -- Generator, async generator or function that returns iterable (chunks). Chunk might be a `string`, `Uint8Array` or `Buffer` (Node.js only): -```js -const { parseChunked } = require('@discoveryjs/json-ext'); -const encoder = new TextEncoder(); - -// generator -parseChunked(function*() { - yield '{ "hello":'; - yield Buffer.from(' "wor'); // Node.js only - yield encoder.encode('ld" }'); // returns Uint8Array(5) [ 108, 100, 34, 32, 125 ] -}); - -// async generator -parseChunked(async function*() { - for await (const chunk of someAsyncSource) { - yield chunk; - } -}); - -// function that returns iterable -parseChunked(() => ['{ "hello":', ' "world"}']) -``` - -Using with [fetch()](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API): - -```js -async function loadData(url) { - const response = await fetch(url); - const reader = response.body.getReader(); - - return parseChunked(async function*() { - while (true) { - const { done, value } = await reader.read(); - - if (done) { - break; - } - - yield value; - } - }); -} - -loadData('https://example.com/data.json') - .then(data => { - /* data is parsed JSON */ - }) -``` - -### stringifyStream(value[, replacer[, space]]) - -Works the same as [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify), but returns an instance of [`ReadableStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_readable_streams) instead of string. - -> NOTE: WHATWG Streams aren't supported yet, so function available for Node.js only for now - -Departs from JSON.stringify(): -- Outputs `null` when `JSON.stringify()` returns `undefined` (since streams may not emit `undefined`) -- A promise is resolving and the resulting value is stringifying as a regular one -- A stream in non-object mode is piping to output as is -- A stream in object mode is piping to output as an array of objects - -When to use: -- Huge JSON needs to be generated (e.g. >500MB on Node.js) -- Needed to reduce memory pressure. `JSON.stringify()` needs to generate the entire JSON before send or write it to somewhere. With `stringifyStream()` you may send a result to somewhere as first bytes of the result appears. This approach helps to avoid storing a huge string in the memory at a single time point. -- The object being serialized contains Promises or Streams (see Usage for examples) - -[Benchmark](https://github.com/discoveryjs/json-ext/tree/master/benchmarks#stream-stringifying) - -Usage: - -```js -const { stringifyStream } = require('@discoveryjs/json-ext'); - -// handle events -stringifyStream(data) - .on('data', chunk => console.log(chunk)) - .on('error', error => consold.error(error)) - .on('finish', () => console.log('DONE!')); - -// pipe into a stream -stringifyStream(data) - .pipe(writableStream); -``` - -Using Promise or ReadableStream in serializing object: - -```js -const fs = require('fs'); -const { stringifyStream } = require('@discoveryjs/json-ext'); - -// output will be -// {"name":"example","willSerializeResolvedValue":42,"fromFile":[1, 2, 3],"at":{"any":{"level":"promise!"}}} -stringifyStream({ - name: 'example', - willSerializeResolvedValue: Promise.resolve(42), - fromFile: fs.createReadStream('path/to/file.json'), // support file content is "[1, 2, 3]", it'll be inserted as it - at: { - any: { - level: new Promise(resolve => setTimeout(() => resolve('promise!'), 100)) - } - } -}) - -// in case several async requests are used in object, it's prefered -// to put fastest requests first, because in this case -stringifyStream({ - foo: fetch('http://example.com/request_takes_2s').then(req => req.json()), - bar: fetch('http://example.com/request_takes_5s').then(req => req.json()) -}); -``` - -Using with [`WritableStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_writable_streams) (Node.js only): - -```js -const fs = require('fs'); -const { stringifyStream } = require('@discoveryjs/json-ext'); - -// pipe into a console -stringifyStream(data) - .pipe(process.stdout); - -// pipe into a file -stringifyStream(data) - .pipe(fs.createWriteStream('path/to/file.json')); - -// wrapping into a Promise -new Promise((resolve, reject) => { - stringifyStream(data) - .on('error', reject) - .pipe(stream) - .on('error', reject) - .on('finish', resolve); -}); -``` - -### stringifyInfo(value[, replacer[, space[, options]]]) - -`value`, `replacer` and `space` arguments are the same as for `JSON.stringify()`. - -Result is an object: - -```js -{ - minLength: Number, // minimal bytes when values is stringified - circular: [...], // list of circular references - duplicate: [...], // list of objects that occur more than once - async: [...] // list of async values, i.e. promises and streams -} -``` - -Example: - -```js -const { stringifyInfo } = require('@discoveryjs/json-ext'); - -console.log( - stringifyInfo({ test: true }).minLength -); -// > 13 -// that equals '{"test":true}'.length -``` - -#### Options - -##### async - -Type: `Boolean` -Default: `false` - -Collect async values (promises and streams) or not. - -##### continueOnCircular - -Type: `Boolean` -Default: `false` - -Stop collecting info for a value or not whenever circular reference is found. Setting option to `true` allows to find all circular references. - -### version - -The version of library, e.g. `"0.3.1"`. - -## License - -MIT diff --git a/node_modules/@discoveryjs/json-ext/dist/json-ext.js b/node_modules/@discoveryjs/json-ext/dist/json-ext.js deleted file mode 100644 index 298fbd4..0000000 --- a/node_modules/@discoveryjs/json-ext/dist/json-ext.js +++ /dev/null @@ -1,791 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.jsonExt = factory()); -})(this, (function () { 'use strict'; - - var version = "0.5.7"; - - const PrimitiveType = 1; - const ObjectType = 2; - const ArrayType = 3; - const PromiseType = 4; - const ReadableStringType = 5; - const ReadableObjectType = 6; - // https://tc39.es/ecma262/#table-json-single-character-escapes - const escapableCharCodeSubstitution$1 = { // JSON Single Character Escape Sequences - 0x08: '\\b', - 0x09: '\\t', - 0x0a: '\\n', - 0x0c: '\\f', - 0x0d: '\\r', - 0x22: '\\\"', - 0x5c: '\\\\' - }; - - function isLeadingSurrogate$1(code) { - return code >= 0xD800 && code <= 0xDBFF; - } - - function isTrailingSurrogate$1(code) { - return code >= 0xDC00 && code <= 0xDFFF; - } - - function isReadableStream$1(value) { - return ( - typeof value.pipe === 'function' && - typeof value._read === 'function' && - typeof value._readableState === 'object' && value._readableState !== null - ); - } - - function replaceValue$1(holder, key, value, replacer) { - if (value && typeof value.toJSON === 'function') { - value = value.toJSON(); - } - - if (replacer !== null) { - value = replacer.call(holder, String(key), value); - } - - switch (typeof value) { - case 'function': - case 'symbol': - value = undefined; - break; - - case 'object': - if (value !== null) { - const cls = value.constructor; - if (cls === String || cls === Number || cls === Boolean) { - value = value.valueOf(); - } - } - break; - } - - return value; - } - - function getTypeNative$1(value) { - if (value === null || typeof value !== 'object') { - return PrimitiveType; - } - - if (Array.isArray(value)) { - return ArrayType; - } - - return ObjectType; - } - - function getTypeAsync$1(value) { - if (value === null || typeof value !== 'object') { - return PrimitiveType; - } - - if (typeof value.then === 'function') { - return PromiseType; - } - - if (isReadableStream$1(value)) { - return value._readableState.objectMode ? ReadableObjectType : ReadableStringType; - } - - if (Array.isArray(value)) { - return ArrayType; - } - - return ObjectType; - } - - function normalizeReplacer$1(replacer) { - if (typeof replacer === 'function') { - return replacer; - } - - if (Array.isArray(replacer)) { - const allowlist = new Set(replacer - .map(item => { - const cls = item && item.constructor; - return cls === String || cls === Number ? String(item) : null; - }) - .filter(item => typeof item === 'string') - ); - - return [...allowlist]; - } - - return null; - } - - function normalizeSpace$1(space) { - if (typeof space === 'number') { - if (!Number.isFinite(space) || space < 1) { - return false; - } - - return ' '.repeat(Math.min(space, 10)); - } - - if (typeof space === 'string') { - return space.slice(0, 10) || false; - } - - return false; - } - - var utils = { - escapableCharCodeSubstitution: escapableCharCodeSubstitution$1, - isLeadingSurrogate: isLeadingSurrogate$1, - isTrailingSurrogate: isTrailingSurrogate$1, - type: { - PRIMITIVE: PrimitiveType, - PROMISE: PromiseType, - ARRAY: ArrayType, - OBJECT: ObjectType, - STRING_STREAM: ReadableStringType, - OBJECT_STREAM: ReadableObjectType - }, - - isReadableStream: isReadableStream$1, - replaceValue: replaceValue$1, - getTypeNative: getTypeNative$1, - getTypeAsync: getTypeAsync$1, - normalizeReplacer: normalizeReplacer$1, - normalizeSpace: normalizeSpace$1 - }; - - const { - normalizeReplacer, - normalizeSpace, - replaceValue, - getTypeNative, - getTypeAsync, - isLeadingSurrogate, - isTrailingSurrogate, - escapableCharCodeSubstitution, - type: { - PRIMITIVE, - OBJECT, - ARRAY, - PROMISE, - STRING_STREAM, - OBJECT_STREAM - } - } = utils; - const charLength2048 = Array.from({ length: 2048 }).map((_, code) => { - if (escapableCharCodeSubstitution.hasOwnProperty(code)) { - return 2; // \X - } - - if (code < 0x20) { - return 6; // \uXXXX - } - - return code < 128 ? 1 : 2; // UTF8 bytes - }); - - function stringLength(str) { - let len = 0; - let prevLeadingSurrogate = false; - - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - - if (code < 2048) { - len += charLength2048[code]; - } else if (isLeadingSurrogate(code)) { - len += 6; // \uXXXX since no pair with trailing surrogate yet - prevLeadingSurrogate = true; - continue; - } else if (isTrailingSurrogate(code)) { - len = prevLeadingSurrogate - ? len - 2 // surrogate pair (4 bytes), since we calculate prev leading surrogate as 6 bytes, substruct 2 bytes - : len + 6; // \uXXXX - } else { - len += 3; // code >= 2048 is 3 bytes length for UTF8 - } - - prevLeadingSurrogate = false; - } - - return len + 2; // +2 for quotes - } - - function primitiveLength(value) { - switch (typeof value) { - case 'string': - return stringLength(value); - - case 'number': - return Number.isFinite(value) ? String(value).length : 4 /* null */; - - case 'boolean': - return value ? 4 /* true */ : 5 /* false */; - - case 'undefined': - case 'object': - return 4; /* null */ - - default: - return 0; - } - } - - function spaceLength(space) { - space = normalizeSpace(space); - return typeof space === 'string' ? space.length : 0; - } - - var stringifyInfo = function jsonStringifyInfo(value, replacer, space, options) { - function walk(holder, key, value) { - if (stop) { - return; - } - - value = replaceValue(holder, key, value, replacer); - - let type = getType(value); - - // check for circular structure - if (type !== PRIMITIVE && stack.has(value)) { - circular.add(value); - length += 4; // treat as null - - if (!options.continueOnCircular) { - stop = true; - } - - return; - } - - switch (type) { - case PRIMITIVE: - if (value !== undefined || Array.isArray(holder)) { - length += primitiveLength(value); - } else if (holder === root) { - length += 9; // FIXME: that's the length of undefined, should we normalize behaviour to convert it to null? - } - break; - - case OBJECT: { - if (visited.has(value)) { - duplicate.add(value); - length += visited.get(value); - break; - } - - const valueLength = length; - let entries = 0; - - length += 2; // {} - - stack.add(value); - - for (const key in value) { - if (hasOwnProperty.call(value, key) && (allowlist === null || allowlist.has(key))) { - const prevLength = length; - walk(value, key, value[key]); - - if (prevLength !== length) { - // value is printed - length += stringLength(key) + 1; // "key": - entries++; - } - } - } - - if (entries > 1) { - length += entries - 1; // commas - } - - stack.delete(value); - - if (space > 0 && entries > 0) { - length += (1 + (stack.size + 1) * space + 1) * entries; // for each key-value: \n{space} - length += 1 + stack.size * space; // for } - } - - visited.set(value, length - valueLength); - - break; - } - - case ARRAY: { - if (visited.has(value)) { - duplicate.add(value); - length += visited.get(value); - break; - } - - const valueLength = length; - - length += 2; // [] - - stack.add(value); - - for (let i = 0; i < value.length; i++) { - walk(value, i, value[i]); - } - - if (value.length > 1) { - length += value.length - 1; // commas - } - - stack.delete(value); - - if (space > 0 && value.length > 0) { - length += (1 + (stack.size + 1) * space) * value.length; // for each element: \n{space} - length += 1 + stack.size * space; // for ] - } - - visited.set(value, length - valueLength); - - break; - } - - case PROMISE: - case STRING_STREAM: - async.add(value); - break; - - case OBJECT_STREAM: - length += 2; // [] - async.add(value); - break; - } - } - - let allowlist = null; - replacer = normalizeReplacer(replacer); - - if (Array.isArray(replacer)) { - allowlist = new Set(replacer); - replacer = null; - } - - space = spaceLength(space); - options = options || {}; - - const visited = new Map(); - const stack = new Set(); - const duplicate = new Set(); - const circular = new Set(); - const async = new Set(); - const getType = options.async ? getTypeAsync : getTypeNative; - const root = { '': value }; - let stop = false; - let length = 0; - - walk(root, '', value); - - return { - minLength: isNaN(length) ? Infinity : length, - circular: [...circular], - duplicate: [...duplicate], - async: [...async] - }; - }; - - var stringifyStreamBrowser = () => { - throw new Error('Method is not supported'); - }; - - var textDecoderBrowser = TextDecoder; - - const { isReadableStream } = utils; - - - const STACK_OBJECT = 1; - const STACK_ARRAY = 2; - const decoder = new textDecoderBrowser(); - - function isObject(value) { - return value !== null && typeof value === 'object'; - } - - function adjustPosition(error, parser) { - if (error.name === 'SyntaxError' && parser.jsonParseOffset) { - error.message = error.message.replace(/at position (\d+)/, (_, pos) => - 'at position ' + (Number(pos) + parser.jsonParseOffset) - ); - } - - return error; - } - - function append(array, elements) { - // Note: Avoid to use array.push(...elements) since it may lead to - // "RangeError: Maximum call stack size exceeded" for a long arrays - const initialLength = array.length; - array.length += elements.length; - - for (let i = 0; i < elements.length; i++) { - array[initialLength + i] = elements[i]; - } - } - - var parseChunked = function(chunkEmitter) { - let parser = new ChunkParser(); - - if (isObject(chunkEmitter) && isReadableStream(chunkEmitter)) { - return new Promise((resolve, reject) => { - chunkEmitter - .on('data', chunk => { - try { - parser.push(chunk); - } catch (e) { - reject(adjustPosition(e, parser)); - parser = null; - } - }) - .on('error', (e) => { - parser = null; - reject(e); - }) - .on('end', () => { - try { - resolve(parser.finish()); - } catch (e) { - reject(adjustPosition(e, parser)); - } finally { - parser = null; - } - }); - }); - } - - if (typeof chunkEmitter === 'function') { - const iterator = chunkEmitter(); - - if (isObject(iterator) && (Symbol.iterator in iterator || Symbol.asyncIterator in iterator)) { - return new Promise(async (resolve, reject) => { - try { - for await (const chunk of iterator) { - parser.push(chunk); - } - - resolve(parser.finish()); - } catch (e) { - reject(adjustPosition(e, parser)); - } finally { - parser = null; - } - }); - } - } - - throw new Error( - 'Chunk emitter should be readable stream, generator, ' + - 'async generator or function returning an iterable object' - ); - }; - - class ChunkParser { - constructor() { - this.value = undefined; - this.valueStack = null; - - this.stack = new Array(100); - this.lastFlushDepth = 0; - this.flushDepth = 0; - this.stateString = false; - this.stateStringEscape = false; - this.pendingByteSeq = null; - this.pendingChunk = null; - this.chunkOffset = 0; - this.jsonParseOffset = 0; - } - - parseAndAppend(fragment, wrap) { - // Append new entries or elements - if (this.stack[this.lastFlushDepth - 1] === STACK_OBJECT) { - if (wrap) { - this.jsonParseOffset--; - fragment = '{' + fragment + '}'; - } - - Object.assign(this.valueStack.value, JSON.parse(fragment)); - } else { - if (wrap) { - this.jsonParseOffset--; - fragment = '[' + fragment + ']'; - } - - append(this.valueStack.value, JSON.parse(fragment)); - } - } - - prepareAddition(fragment) { - const { value } = this.valueStack; - const expectComma = Array.isArray(value) - ? value.length !== 0 - : Object.keys(value).length !== 0; - - if (expectComma) { - // Skip a comma at the beginning of fragment, otherwise it would - // fail to parse - if (fragment[0] === ',') { - this.jsonParseOffset++; - return fragment.slice(1); - } - - // When value (an object or array) is not empty and a fragment - // doesn't start with a comma, a single valid fragment starting - // is a closing bracket. If it's not, a prefix is adding to fail - // parsing. Otherwise, the sequence of chunks can be successfully - // parsed, although it should not, e.g. ["[{}", "{}]"] - if (fragment[0] !== '}' && fragment[0] !== ']') { - this.jsonParseOffset -= 3; - return '[[]' + fragment; - } - } - - return fragment; - } - - flush(chunk, start, end) { - let fragment = chunk.slice(start, end); - - // Save position correction an error in JSON.parse() if any - this.jsonParseOffset = this.chunkOffset + start; - - // Prepend pending chunk if any - if (this.pendingChunk !== null) { - fragment = this.pendingChunk + fragment; - this.jsonParseOffset -= this.pendingChunk.length; - this.pendingChunk = null; - } - - if (this.flushDepth === this.lastFlushDepth) { - // Depth didn't changed, so it's a root value or entry/element set - if (this.flushDepth > 0) { - this.parseAndAppend(this.prepareAddition(fragment), true); - } else { - // That's an entire value on a top level - this.value = JSON.parse(fragment); - this.valueStack = { - value: this.value, - prev: null - }; - } - } else if (this.flushDepth > this.lastFlushDepth) { - // Add missed closing brackets/parentheses - for (let i = this.flushDepth - 1; i >= this.lastFlushDepth; i--) { - fragment += this.stack[i] === STACK_OBJECT ? '}' : ']'; - } - - if (this.lastFlushDepth === 0) { - // That's a root value - this.value = JSON.parse(fragment); - this.valueStack = { - value: this.value, - prev: null - }; - } else { - this.parseAndAppend(this.prepareAddition(fragment), true); - } - - // Move down to the depths to the last object/array, which is current now - for (let i = this.lastFlushDepth || 1; i < this.flushDepth; i++) { - let value = this.valueStack.value; - - if (this.stack[i - 1] === STACK_OBJECT) { - // find last entry - let key; - // eslint-disable-next-line curly - for (key in value); - value = value[key]; - } else { - // last element - value = value[value.length - 1]; - } - - this.valueStack = { - value, - prev: this.valueStack - }; - } - } else /* this.flushDepth < this.lastFlushDepth */ { - fragment = this.prepareAddition(fragment); - - // Add missed opening brackets/parentheses - for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) { - this.jsonParseOffset--; - fragment = (this.stack[i] === STACK_OBJECT ? '{' : '[') + fragment; - } - - this.parseAndAppend(fragment, false); - - for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) { - this.valueStack = this.valueStack.prev; - } - } - - this.lastFlushDepth = this.flushDepth; - } - - push(chunk) { - if (typeof chunk !== 'string') { - // Suppose chunk is Buffer or Uint8Array - - // Prepend uncompleted byte sequence if any - if (this.pendingByteSeq !== null) { - const origRawChunk = chunk; - chunk = new Uint8Array(this.pendingByteSeq.length + origRawChunk.length); - chunk.set(this.pendingByteSeq); - chunk.set(origRawChunk, this.pendingByteSeq.length); - this.pendingByteSeq = null; - } - - // In case Buffer/Uint8Array, an input is encoded in UTF8 - // Seek for parts of uncompleted UTF8 symbol on the ending - // This makes sense only if we expect more chunks and last char is not multi-bytes - if (chunk[chunk.length - 1] > 127) { - for (let seqLength = 0; seqLength < chunk.length; seqLength++) { - const byte = chunk[chunk.length - 1 - seqLength]; - - // 10xxxxxx - 2nd, 3rd or 4th byte - // 110xxxxx – first byte of 2-byte sequence - // 1110xxxx - first byte of 3-byte sequence - // 11110xxx - first byte of 4-byte sequence - if (byte >> 6 === 3) { - seqLength++; - - // If the sequence is really incomplete, then preserve it - // for the future chunk and cut off it from the current chunk - if ((seqLength !== 4 && byte >> 3 === 0b11110) || - (seqLength !== 3 && byte >> 4 === 0b1110) || - (seqLength !== 2 && byte >> 5 === 0b110)) { - this.pendingByteSeq = chunk.slice(chunk.length - seqLength); - chunk = chunk.slice(0, -seqLength); - } - - break; - } - } - } - - // Convert chunk to a string, since single decode per chunk - // is much effective than decode multiple small substrings - chunk = decoder.decode(chunk); - } - - const chunkLength = chunk.length; - let lastFlushPoint = 0; - let flushPoint = 0; - - // Main scan loop - scan: for (let i = 0; i < chunkLength; i++) { - if (this.stateString) { - for (; i < chunkLength; i++) { - if (this.stateStringEscape) { - this.stateStringEscape = false; - } else { - switch (chunk.charCodeAt(i)) { - case 0x22: /* " */ - this.stateString = false; - continue scan; - - case 0x5C: /* \ */ - this.stateStringEscape = true; - } - } - } - - break; - } - - switch (chunk.charCodeAt(i)) { - case 0x22: /* " */ - this.stateString = true; - this.stateStringEscape = false; - break; - - case 0x2C: /* , */ - flushPoint = i; - break; - - case 0x7B: /* { */ - // Open an object - flushPoint = i + 1; - this.stack[this.flushDepth++] = STACK_OBJECT; - break; - - case 0x5B: /* [ */ - // Open an array - flushPoint = i + 1; - this.stack[this.flushDepth++] = STACK_ARRAY; - break; - - case 0x5D: /* ] */ - case 0x7D: /* } */ - // Close an object or array - flushPoint = i + 1; - this.flushDepth--; - - if (this.flushDepth < this.lastFlushDepth) { - this.flush(chunk, lastFlushPoint, flushPoint); - lastFlushPoint = flushPoint; - } - - break; - - case 0x09: /* \t */ - case 0x0A: /* \n */ - case 0x0D: /* \r */ - case 0x20: /* space */ - // Move points forward when they points on current position and it's a whitespace - if (lastFlushPoint === i) { - lastFlushPoint++; - } - - if (flushPoint === i) { - flushPoint++; - } - - break; - } - } - - if (flushPoint > lastFlushPoint) { - this.flush(chunk, lastFlushPoint, flushPoint); - } - - // Produce pendingChunk if something left - if (flushPoint < chunkLength) { - if (this.pendingChunk !== null) { - // When there is already a pending chunk then no flush happened, - // appending entire chunk to pending one - this.pendingChunk += chunk; - } else { - // Create a pending chunk, it will start with non-whitespace since - // flushPoint was moved forward away from whitespaces on scan - this.pendingChunk = chunk.slice(flushPoint, chunkLength); - } - } - - this.chunkOffset += chunkLength; - } - - finish() { - if (this.pendingChunk !== null) { - this.flush('', 0, 0); - this.pendingChunk = null; - } - - return this.value; - } - } - - var src = { - version: version, - stringifyInfo: stringifyInfo, - stringifyStream: stringifyStreamBrowser, - parseChunked: parseChunked - }; - - return src; - -})); diff --git a/node_modules/@discoveryjs/json-ext/dist/json-ext.min.js b/node_modules/@discoveryjs/json-ext/dist/json-ext.min.js deleted file mode 100644 index e7e66b7..0000000 --- a/node_modules/@discoveryjs/json-ext/dist/json-ext.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).jsonExt=t()}(this,(function(){"use strict";function e(e){return"function"==typeof e.pipe&&"function"==typeof e._read&&"object"==typeof e._readableState&&null!==e._readableState}var t={escapableCharCodeSubstitution:{8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"},isLeadingSurrogate:function(e){return e>=55296&&e<=56319},isTrailingSurrogate:function(e){return e>=56320&&e<=57343},type:{PRIMITIVE:1,PROMISE:4,ARRAY:3,OBJECT:2,STRING_STREAM:5,OBJECT_STREAM:6},isReadableStream:e,replaceValue:function(e,t,s,n){switch(s&&"function"==typeof s.toJSON&&(s=s.toJSON()),null!==n&&(s=n.call(e,String(t),s)),typeof s){case"function":case"symbol":s=void 0;break;case"object":if(null!==s){const e=s.constructor;e!==String&&e!==Number&&e!==Boolean||(s=s.valueOf())}}return s},getTypeNative:function(e){return null===e||"object"!=typeof e?1:Array.isArray(e)?3:2},getTypeAsync:function(t){return null===t||"object"!=typeof t?1:"function"==typeof t.then?4:e(t)?t._readableState.objectMode?6:5:Array.isArray(t)?3:2},normalizeReplacer:function(e){return"function"==typeof e?e:Array.isArray(e)?[...new Set(e.map((e=>{const t=e&&e.constructor;return t===String||t===Number?String(e):null})).filter((e=>"string"==typeof e)))]:null},normalizeSpace:function(e){return"number"==typeof e?!(!Number.isFinite(e)||e<1)&&" ".repeat(Math.min(e,10)):"string"==typeof e&&e.slice(0,10)||!1}};const{normalizeReplacer:s,normalizeSpace:n,replaceValue:i,getTypeNative:r,getTypeAsync:a,isLeadingSurrogate:l,isTrailingSurrogate:h,escapableCharCodeSubstitution:u,type:{PRIMITIVE:o,OBJECT:c,ARRAY:f,PROMISE:p,STRING_STREAM:d,OBJECT_STREAM:g}}=t,y=Array.from({length:2048}).map(((e,t)=>u.hasOwnProperty(t)?2:t<32?6:t<128?1:2));function S(e){let t=0,s=!1;for(let n=0;n"at position "+(Number(s)+t.jsonParseOffset)))),e}class O{constructor(){this.value=void 0,this.valueStack=null,this.stack=new Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}parseAndAppend(e,t){1===this.stack[this.lastFlushDepth-1]?(t&&(this.jsonParseOffset--,e="{"+e+"}"),Object.assign(this.valueStack.value,JSON.parse(e))):(t&&(this.jsonParseOffset--,e="["+e+"]"),function(e,t){const s=e.length;e.length+=t.length;for(let n=0;n0?this.parseAndAppend(this.prepareAddition(n),!0):(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let e=this.flushDepth-1;e>=this.lastFlushDepth;e--)n+=1===this.stack[e]?"}":"]";0===this.lastFlushDepth?(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(n),!0);for(let e=this.lastFlushDepth||1;e=this.flushDepth;e--)this.jsonParseOffset--,n=(1===this.stack[e]?"{":"[")+n;this.parseAndAppend(n,!1);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}push(e){if("string"!=typeof e){if(null!==this.pendingByteSeq){const t=e;(e=new Uint8Array(this.pendingByteSeq.length+t.length)).set(this.pendingByteSeq),e.set(t,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let t=0;t>6==3){t++,(4!==t&&s>>3==30||3!==t&&s>>4==14||2!==t&&s>>5==6)&&(this.pendingByteSeq=e.slice(e.length-t),e=e.slice(0,-t));break}}e=A.decode(e)}const t=e.length;let s=0,n=0;e:for(let i=0;is&&this.flush(e,s,n),n1&&(D+=s-1),b.delete(r),l>0&&s>0&&(D+=(1+(b.size+1)*l+1)*s,D+=1+b.size*l),y.set(r,D-t);break}case f:{if(y.has(r)){k.add(r),D+=y.get(r);break}const t=D;D+=2,b.add(r);for(let t=0;t1&&(D+=r.length-1),b.delete(r),l>0&&r.length>0&&(D+=(1+(b.size+1)*l)*r.length,D+=1+b.size*l),y.set(r,D-t);break}case p:case d:v.add(r);break;case g:D+=2,v.add(r)}}(O,"",e),{minLength:isNaN(D)?1/0:D,circular:[...A],duplicate:[...k],async:[...v]}},stringifyStream:()=>{throw new Error("Method is not supported")},parseChunked:function(e){let t=new O;if(v(e)&&k(e))return new Promise(((s,n)=>{e.on("data",(e=>{try{t.push(e)}catch(e){n(m(e,t)),t=null}})).on("error",(e=>{t=null,n(e)})).on("end",(()=>{try{s(t.finish())}catch(e){n(m(e,t))}finally{t=null}}))}));if("function"==typeof e){const s=e();if(v(s)&&(Symbol.iterator in s||Symbol.asyncIterator in s))return new Promise((async(e,n)=>{try{for await(const e of s)t.push(e);e(t.finish())}catch(e){n(m(e,t))}finally{t=null}}))}throw new Error("Chunk emitter should be readable stream, generator, async generator or function returning an iterable object")}}})); diff --git a/node_modules/@discoveryjs/json-ext/dist/version.js b/node_modules/@discoveryjs/json-ext/dist/version.js deleted file mode 100644 index 3d0dce2..0000000 --- a/node_modules/@discoveryjs/json-ext/dist/version.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "0.5.7"; \ No newline at end of file diff --git a/node_modules/@discoveryjs/json-ext/index.d.ts b/node_modules/@discoveryjs/json-ext/index.d.ts deleted file mode 100644 index 8b1d7c9..0000000 --- a/node_modules/@discoveryjs/json-ext/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare module '@discoveryjs/json-ext' { - import { Readable } from 'stream'; - - type TReplacer = - | ((this: any, key: string, value: any) => any) - | string[] - | number[] - | null; - type TSpace = string | number | null; - type TChunk = string | Buffer | Uint8Array; - - export function parseChunked(input: Readable): Promise; - export function parseChunked(input: () => (Iterable | AsyncIterable)): Promise; - - export function stringifyStream(value: any, replacer?: TReplacer, space?: TSpace): Readable; - - export function stringifyInfo( - value: any, - replacer?: TReplacer, - space?: TSpace, - options?: { - async?: boolean; - continueOnCircular?: boolean; - } - ): { - minLength: number; - circular: any[]; - duplicate: any[]; - async: any[]; - }; -} diff --git a/node_modules/@discoveryjs/json-ext/package.json b/node_modules/@discoveryjs/json-ext/package.json deleted file mode 100644 index f6ccde5..0000000 --- a/node_modules/@discoveryjs/json-ext/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "@discoveryjs/json-ext", - "version": "0.5.7", - "description": "A set of utilities that extend the use of JSON", - "keywords": [ - "json", - "utils", - "stream", - "async", - "promise", - "stringify", - "info" - ], - "author": "Roman Dvornov (https://github.com/lahmatiy)", - "license": "MIT", - "repository": "discoveryjs/json-ext", - "main": "./src/index", - "browser": { - "./src/stringify-stream.js": "./src/stringify-stream-browser.js", - "./src/text-decoder.js": "./src/text-decoder-browser.js", - "./src/version.js": "./dist/version.js" - }, - "types": "./index.d.ts", - "scripts": { - "test": "mocha --reporter progress", - "lint": "eslint src test", - "lint-and-test": "npm run lint && npm test", - "build": "rollup --config", - "test:all": "npm run test:src && npm run test:dist", - "test:src": "npm test", - "test:dist": "cross-env MODE=dist npm test && cross-env MODE=dist-min npm test", - "build-and-test": "npm run build && npm run test:dist", - "coverage": "c8 --reporter=lcovonly npm test", - "prepublishOnly": "npm run lint && npm test && npm run build-and-test" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^15.1.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^9.0.0", - "c8": "^7.10.0", - "chalk": "^4.1.0", - "cross-env": "^7.0.3", - "eslint": "^8.10.0", - "mocha": "^8.4.0", - "rollup": "^2.28.2", - "rollup-plugin-terser": "^7.0.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "files": [ - "dist", - "src", - "index.d.ts" - ] -} diff --git a/node_modules/@discoveryjs/json-ext/src/index.js b/node_modules/@discoveryjs/json-ext/src/index.js deleted file mode 100644 index ae05057..0000000 --- a/node_modules/@discoveryjs/json-ext/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - version: require('./version'), - stringifyInfo: require('./stringify-info'), - stringifyStream: require('./stringify-stream'), - parseChunked: require('./parse-chunked') -}; diff --git a/node_modules/@discoveryjs/json-ext/src/parse-chunked.js b/node_modules/@discoveryjs/json-ext/src/parse-chunked.js deleted file mode 100644 index 87f7209..0000000 --- a/node_modules/@discoveryjs/json-ext/src/parse-chunked.js +++ /dev/null @@ -1,384 +0,0 @@ -const { isReadableStream } = require('./utils'); -const TextDecoder = require('./text-decoder'); - -const STACK_OBJECT = 1; -const STACK_ARRAY = 2; -const decoder = new TextDecoder(); - -function isObject(value) { - return value !== null && typeof value === 'object'; -} - -function adjustPosition(error, parser) { - if (error.name === 'SyntaxError' && parser.jsonParseOffset) { - error.message = error.message.replace(/at position (\d+)/, (_, pos) => - 'at position ' + (Number(pos) + parser.jsonParseOffset) - ); - } - - return error; -} - -function append(array, elements) { - // Note: Avoid to use array.push(...elements) since it may lead to - // "RangeError: Maximum call stack size exceeded" for a long arrays - const initialLength = array.length; - array.length += elements.length; - - for (let i = 0; i < elements.length; i++) { - array[initialLength + i] = elements[i]; - } -} - -module.exports = function(chunkEmitter) { - let parser = new ChunkParser(); - - if (isObject(chunkEmitter) && isReadableStream(chunkEmitter)) { - return new Promise((resolve, reject) => { - chunkEmitter - .on('data', chunk => { - try { - parser.push(chunk); - } catch (e) { - reject(adjustPosition(e, parser)); - parser = null; - } - }) - .on('error', (e) => { - parser = null; - reject(e); - }) - .on('end', () => { - try { - resolve(parser.finish()); - } catch (e) { - reject(adjustPosition(e, parser)); - } finally { - parser = null; - } - }); - }); - } - - if (typeof chunkEmitter === 'function') { - const iterator = chunkEmitter(); - - if (isObject(iterator) && (Symbol.iterator in iterator || Symbol.asyncIterator in iterator)) { - return new Promise(async (resolve, reject) => { - try { - for await (const chunk of iterator) { - parser.push(chunk); - } - - resolve(parser.finish()); - } catch (e) { - reject(adjustPosition(e, parser)); - } finally { - parser = null; - } - }); - } - } - - throw new Error( - 'Chunk emitter should be readable stream, generator, ' + - 'async generator or function returning an iterable object' - ); -}; - -class ChunkParser { - constructor() { - this.value = undefined; - this.valueStack = null; - - this.stack = new Array(100); - this.lastFlushDepth = 0; - this.flushDepth = 0; - this.stateString = false; - this.stateStringEscape = false; - this.pendingByteSeq = null; - this.pendingChunk = null; - this.chunkOffset = 0; - this.jsonParseOffset = 0; - } - - parseAndAppend(fragment, wrap) { - // Append new entries or elements - if (this.stack[this.lastFlushDepth - 1] === STACK_OBJECT) { - if (wrap) { - this.jsonParseOffset--; - fragment = '{' + fragment + '}'; - } - - Object.assign(this.valueStack.value, JSON.parse(fragment)); - } else { - if (wrap) { - this.jsonParseOffset--; - fragment = '[' + fragment + ']'; - } - - append(this.valueStack.value, JSON.parse(fragment)); - } - } - - prepareAddition(fragment) { - const { value } = this.valueStack; - const expectComma = Array.isArray(value) - ? value.length !== 0 - : Object.keys(value).length !== 0; - - if (expectComma) { - // Skip a comma at the beginning of fragment, otherwise it would - // fail to parse - if (fragment[0] === ',') { - this.jsonParseOffset++; - return fragment.slice(1); - } - - // When value (an object or array) is not empty and a fragment - // doesn't start with a comma, a single valid fragment starting - // is a closing bracket. If it's not, a prefix is adding to fail - // parsing. Otherwise, the sequence of chunks can be successfully - // parsed, although it should not, e.g. ["[{}", "{}]"] - if (fragment[0] !== '}' && fragment[0] !== ']') { - this.jsonParseOffset -= 3; - return '[[]' + fragment; - } - } - - return fragment; - } - - flush(chunk, start, end) { - let fragment = chunk.slice(start, end); - - // Save position correction an error in JSON.parse() if any - this.jsonParseOffset = this.chunkOffset + start; - - // Prepend pending chunk if any - if (this.pendingChunk !== null) { - fragment = this.pendingChunk + fragment; - this.jsonParseOffset -= this.pendingChunk.length; - this.pendingChunk = null; - } - - if (this.flushDepth === this.lastFlushDepth) { - // Depth didn't changed, so it's a root value or entry/element set - if (this.flushDepth > 0) { - this.parseAndAppend(this.prepareAddition(fragment), true); - } else { - // That's an entire value on a top level - this.value = JSON.parse(fragment); - this.valueStack = { - value: this.value, - prev: null - }; - } - } else if (this.flushDepth > this.lastFlushDepth) { - // Add missed closing brackets/parentheses - for (let i = this.flushDepth - 1; i >= this.lastFlushDepth; i--) { - fragment += this.stack[i] === STACK_OBJECT ? '}' : ']'; - } - - if (this.lastFlushDepth === 0) { - // That's a root value - this.value = JSON.parse(fragment); - this.valueStack = { - value: this.value, - prev: null - }; - } else { - this.parseAndAppend(this.prepareAddition(fragment), true); - } - - // Move down to the depths to the last object/array, which is current now - for (let i = this.lastFlushDepth || 1; i < this.flushDepth; i++) { - let value = this.valueStack.value; - - if (this.stack[i - 1] === STACK_OBJECT) { - // find last entry - let key; - // eslint-disable-next-line curly - for (key in value); - value = value[key]; - } else { - // last element - value = value[value.length - 1]; - } - - this.valueStack = { - value, - prev: this.valueStack - }; - } - } else /* this.flushDepth < this.lastFlushDepth */ { - fragment = this.prepareAddition(fragment); - - // Add missed opening brackets/parentheses - for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) { - this.jsonParseOffset--; - fragment = (this.stack[i] === STACK_OBJECT ? '{' : '[') + fragment; - } - - this.parseAndAppend(fragment, false); - - for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) { - this.valueStack = this.valueStack.prev; - } - } - - this.lastFlushDepth = this.flushDepth; - } - - push(chunk) { - if (typeof chunk !== 'string') { - // Suppose chunk is Buffer or Uint8Array - - // Prepend uncompleted byte sequence if any - if (this.pendingByteSeq !== null) { - const origRawChunk = chunk; - chunk = new Uint8Array(this.pendingByteSeq.length + origRawChunk.length); - chunk.set(this.pendingByteSeq); - chunk.set(origRawChunk, this.pendingByteSeq.length); - this.pendingByteSeq = null; - } - - // In case Buffer/Uint8Array, an input is encoded in UTF8 - // Seek for parts of uncompleted UTF8 symbol on the ending - // This makes sense only if we expect more chunks and last char is not multi-bytes - if (chunk[chunk.length - 1] > 127) { - for (let seqLength = 0; seqLength < chunk.length; seqLength++) { - const byte = chunk[chunk.length - 1 - seqLength]; - - // 10xxxxxx - 2nd, 3rd or 4th byte - // 110xxxxx – first byte of 2-byte sequence - // 1110xxxx - first byte of 3-byte sequence - // 11110xxx - first byte of 4-byte sequence - if (byte >> 6 === 3) { - seqLength++; - - // If the sequence is really incomplete, then preserve it - // for the future chunk and cut off it from the current chunk - if ((seqLength !== 4 && byte >> 3 === 0b11110) || - (seqLength !== 3 && byte >> 4 === 0b1110) || - (seqLength !== 2 && byte >> 5 === 0b110)) { - this.pendingByteSeq = chunk.slice(chunk.length - seqLength); - chunk = chunk.slice(0, -seqLength); - } - - break; - } - } - } - - // Convert chunk to a string, since single decode per chunk - // is much effective than decode multiple small substrings - chunk = decoder.decode(chunk); - } - - const chunkLength = chunk.length; - let lastFlushPoint = 0; - let flushPoint = 0; - - // Main scan loop - scan: for (let i = 0; i < chunkLength; i++) { - if (this.stateString) { - for (; i < chunkLength; i++) { - if (this.stateStringEscape) { - this.stateStringEscape = false; - } else { - switch (chunk.charCodeAt(i)) { - case 0x22: /* " */ - this.stateString = false; - continue scan; - - case 0x5C: /* \ */ - this.stateStringEscape = true; - } - } - } - - break; - } - - switch (chunk.charCodeAt(i)) { - case 0x22: /* " */ - this.stateString = true; - this.stateStringEscape = false; - break; - - case 0x2C: /* , */ - flushPoint = i; - break; - - case 0x7B: /* { */ - // Open an object - flushPoint = i + 1; - this.stack[this.flushDepth++] = STACK_OBJECT; - break; - - case 0x5B: /* [ */ - // Open an array - flushPoint = i + 1; - this.stack[this.flushDepth++] = STACK_ARRAY; - break; - - case 0x5D: /* ] */ - case 0x7D: /* } */ - // Close an object or array - flushPoint = i + 1; - this.flushDepth--; - - if (this.flushDepth < this.lastFlushDepth) { - this.flush(chunk, lastFlushPoint, flushPoint); - lastFlushPoint = flushPoint; - } - - break; - - case 0x09: /* \t */ - case 0x0A: /* \n */ - case 0x0D: /* \r */ - case 0x20: /* space */ - // Move points forward when they points on current position and it's a whitespace - if (lastFlushPoint === i) { - lastFlushPoint++; - } - - if (flushPoint === i) { - flushPoint++; - } - - break; - } - } - - if (flushPoint > lastFlushPoint) { - this.flush(chunk, lastFlushPoint, flushPoint); - } - - // Produce pendingChunk if something left - if (flushPoint < chunkLength) { - if (this.pendingChunk !== null) { - // When there is already a pending chunk then no flush happened, - // appending entire chunk to pending one - this.pendingChunk += chunk; - } else { - // Create a pending chunk, it will start with non-whitespace since - // flushPoint was moved forward away from whitespaces on scan - this.pendingChunk = chunk.slice(flushPoint, chunkLength); - } - } - - this.chunkOffset += chunkLength; - } - - finish() { - if (this.pendingChunk !== null) { - this.flush('', 0, 0); - this.pendingChunk = null; - } - - return this.value; - } -}; diff --git a/node_modules/@discoveryjs/json-ext/src/stringify-info.js b/node_modules/@discoveryjs/json-ext/src/stringify-info.js deleted file mode 100644 index 2678f11..0000000 --- a/node_modules/@discoveryjs/json-ext/src/stringify-info.js +++ /dev/null @@ -1,231 +0,0 @@ -const { - normalizeReplacer, - normalizeSpace, - replaceValue, - getTypeNative, - getTypeAsync, - isLeadingSurrogate, - isTrailingSurrogate, - escapableCharCodeSubstitution, - type: { - PRIMITIVE, - OBJECT, - ARRAY, - PROMISE, - STRING_STREAM, - OBJECT_STREAM - } -} = require('./utils'); -const charLength2048 = Array.from({ length: 2048 }).map((_, code) => { - if (escapableCharCodeSubstitution.hasOwnProperty(code)) { - return 2; // \X - } - - if (code < 0x20) { - return 6; // \uXXXX - } - - return code < 128 ? 1 : 2; // UTF8 bytes -}); - -function stringLength(str) { - let len = 0; - let prevLeadingSurrogate = false; - - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - - if (code < 2048) { - len += charLength2048[code]; - } else if (isLeadingSurrogate(code)) { - len += 6; // \uXXXX since no pair with trailing surrogate yet - prevLeadingSurrogate = true; - continue; - } else if (isTrailingSurrogate(code)) { - len = prevLeadingSurrogate - ? len - 2 // surrogate pair (4 bytes), since we calculate prev leading surrogate as 6 bytes, substruct 2 bytes - : len + 6; // \uXXXX - } else { - len += 3; // code >= 2048 is 3 bytes length for UTF8 - } - - prevLeadingSurrogate = false; - } - - return len + 2; // +2 for quotes -} - -function primitiveLength(value) { - switch (typeof value) { - case 'string': - return stringLength(value); - - case 'number': - return Number.isFinite(value) ? String(value).length : 4 /* null */; - - case 'boolean': - return value ? 4 /* true */ : 5 /* false */; - - case 'undefined': - case 'object': - return 4; /* null */ - - default: - return 0; - } -} - -function spaceLength(space) { - space = normalizeSpace(space); - return typeof space === 'string' ? space.length : 0; -} - -module.exports = function jsonStringifyInfo(value, replacer, space, options) { - function walk(holder, key, value) { - if (stop) { - return; - } - - value = replaceValue(holder, key, value, replacer); - - let type = getType(value); - - // check for circular structure - if (type !== PRIMITIVE && stack.has(value)) { - circular.add(value); - length += 4; // treat as null - - if (!options.continueOnCircular) { - stop = true; - } - - return; - } - - switch (type) { - case PRIMITIVE: - if (value !== undefined || Array.isArray(holder)) { - length += primitiveLength(value); - } else if (holder === root) { - length += 9; // FIXME: that's the length of undefined, should we normalize behaviour to convert it to null? - } - break; - - case OBJECT: { - if (visited.has(value)) { - duplicate.add(value); - length += visited.get(value); - break; - } - - const valueLength = length; - let entries = 0; - - length += 2; // {} - - stack.add(value); - - for (const key in value) { - if (hasOwnProperty.call(value, key) && (allowlist === null || allowlist.has(key))) { - const prevLength = length; - walk(value, key, value[key]); - - if (prevLength !== length) { - // value is printed - length += stringLength(key) + 1; // "key": - entries++; - } - } - } - - if (entries > 1) { - length += entries - 1; // commas - } - - stack.delete(value); - - if (space > 0 && entries > 0) { - length += (1 + (stack.size + 1) * space + 1) * entries; // for each key-value: \n{space} - length += 1 + stack.size * space; // for } - } - - visited.set(value, length - valueLength); - - break; - } - - case ARRAY: { - if (visited.has(value)) { - duplicate.add(value); - length += visited.get(value); - break; - } - - const valueLength = length; - - length += 2; // [] - - stack.add(value); - - for (let i = 0; i < value.length; i++) { - walk(value, i, value[i]); - } - - if (value.length > 1) { - length += value.length - 1; // commas - } - - stack.delete(value); - - if (space > 0 && value.length > 0) { - length += (1 + (stack.size + 1) * space) * value.length; // for each element: \n{space} - length += 1 + stack.size * space; // for ] - } - - visited.set(value, length - valueLength); - - break; - } - - case PROMISE: - case STRING_STREAM: - async.add(value); - break; - - case OBJECT_STREAM: - length += 2; // [] - async.add(value); - break; - } - } - - let allowlist = null; - replacer = normalizeReplacer(replacer); - - if (Array.isArray(replacer)) { - allowlist = new Set(replacer); - replacer = null; - } - - space = spaceLength(space); - options = options || {}; - - const visited = new Map(); - const stack = new Set(); - const duplicate = new Set(); - const circular = new Set(); - const async = new Set(); - const getType = options.async ? getTypeAsync : getTypeNative; - const root = { '': value }; - let stop = false; - let length = 0; - - walk(root, '', value); - - return { - minLength: isNaN(length) ? Infinity : length, - circular: [...circular], - duplicate: [...duplicate], - async: [...async] - }; -}; diff --git a/node_modules/@discoveryjs/json-ext/src/stringify-stream-browser.js b/node_modules/@discoveryjs/json-ext/src/stringify-stream-browser.js deleted file mode 100644 index e11ccb6..0000000 --- a/node_modules/@discoveryjs/json-ext/src/stringify-stream-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = () => { - throw new Error('Method is not supported'); -}; diff --git a/node_modules/@discoveryjs/json-ext/src/stringify-stream.js b/node_modules/@discoveryjs/json-ext/src/stringify-stream.js deleted file mode 100644 index 4f983a7..0000000 --- a/node_modules/@discoveryjs/json-ext/src/stringify-stream.js +++ /dev/null @@ -1,408 +0,0 @@ -const { Readable } = require('stream'); -const { - normalizeReplacer, - normalizeSpace, - replaceValue, - getTypeAsync, - type: { - PRIMITIVE, - OBJECT, - ARRAY, - PROMISE, - STRING_STREAM, - OBJECT_STREAM - } -} = require('./utils'); -const noop = () => {}; -const hasOwnProperty = Object.prototype.hasOwnProperty; - -// TODO: Remove when drop support for Node.js 10 -// Node.js 10 has no well-formed JSON.stringify() -// https://github.com/tc39/proposal-well-formed-stringify -// Adopted code from https://bugs.chromium.org/p/v8/issues/detail?id=7782#c12 -const wellformedStringStringify = JSON.stringify('\ud800') === '"\\ud800"' - ? JSON.stringify - : s => JSON.stringify(s).replace( - /\p{Surrogate}/gu, - m => `\\u${m.charCodeAt(0).toString(16)}` - ); - -function push() { - this.push(this._stack.value); - this.popStack(); -} - -function pushPrimitive(value) { - switch (typeof value) { - case 'string': - this.push(this.encodeString(value)); - break; - - case 'number': - this.push(Number.isFinite(value) ? this.encodeNumber(value) : 'null'); - break; - - case 'boolean': - this.push(value ? 'true' : 'false'); - break; - - case 'undefined': - case 'object': // typeof null === 'object' - this.push('null'); - break; - - default: - this.destroy(new TypeError(`Do not know how to serialize a ${value.constructor && value.constructor.name || typeof value}`)); - } -} - -function processObjectEntry(key) { - const current = this._stack; - - if (!current.first) { - current.first = true; - } else { - this.push(','); - } - - if (this.space) { - this.push(`\n${this.space.repeat(this._depth)}${this.encodeString(key)}: `); - } else { - this.push(this.encodeString(key) + ':'); - } -} - -function processObject() { - const current = this._stack; - - // when no keys left, remove obj from stack - if (current.index === current.keys.length) { - if (this.space && current.first) { - this.push(`\n${this.space.repeat(this._depth - 1)}}`); - } else { - this.push('}'); - } - - this.popStack(); - return; - } - - const key = current.keys[current.index]; - - this.processValue(current.value, key, current.value[key], processObjectEntry); - current.index++; -} - -function processArrayItem(index) { - if (index !== 0) { - this.push(','); - } - - if (this.space) { - this.push(`\n${this.space.repeat(this._depth)}`); - } -} - -function processArray() { - const current = this._stack; - - if (current.index === current.value.length) { - if (this.space && current.index > 0) { - this.push(`\n${this.space.repeat(this._depth - 1)}]`); - } else { - this.push(']'); - } - - this.popStack(); - return; - } - - this.processValue(current.value, current.index, current.value[current.index], processArrayItem); - current.index++; -} - -function createStreamReader(fn) { - return function() { - const current = this._stack; - const data = current.value.read(this._readSize); - - if (data !== null) { - current.first = false; - fn.call(this, data, current); - } else { - if ((current.first && !current.value._readableState.reading) || current.ended) { - this.popStack(); - } else { - current.first = true; - current.awaiting = true; - } - } - }; -} - -const processReadableObject = createStreamReader(function(data, current) { - this.processValue(current.value, current.index, data, processArrayItem); - current.index++; -}); - -const processReadableString = createStreamReader(function(data) { - this.push(data); -}); - -class JsonStringifyStream extends Readable { - constructor(value, replacer, space) { - super({ - autoDestroy: true - }); - - this.getKeys = Object.keys; - this.replacer = normalizeReplacer(replacer); - - if (Array.isArray(this.replacer)) { - const allowlist = this.replacer; - - this.getKeys = (value) => allowlist.filter(key => hasOwnProperty.call(value, key)); - this.replacer = null; - } - - this.space = normalizeSpace(space); - this._depth = 0; - - this.error = null; - this._processing = false; - this._ended = false; - - this._readSize = 0; - this._buffer = ''; - - this._stack = null; - this._visited = new WeakSet(); - - this.pushStack({ - handler: () => { - this.popStack(); - this.processValue({ '': value }, '', value, noop); - } - }); - } - - encodeString(value) { - if (/[^\x20-\uD799]|[\x22\x5c]/.test(value)) { - return wellformedStringStringify(value); - } - - return '"' + value + '"'; - } - - encodeNumber(value) { - return value; - } - - processValue(holder, key, value, callback) { - value = replaceValue(holder, key, value, this.replacer); - - let type = getTypeAsync(value); - - switch (type) { - case PRIMITIVE: - if (callback !== processObjectEntry || value !== undefined) { - callback.call(this, key); - pushPrimitive.call(this, value); - } - break; - - case OBJECT: - callback.call(this, key); - - // check for circular structure - if (this._visited.has(value)) { - return this.destroy(new TypeError('Converting circular structure to JSON')); - } - - this._visited.add(value); - this._depth++; - this.push('{'); - this.pushStack({ - handler: processObject, - value, - index: 0, - first: false, - keys: this.getKeys(value) - }); - break; - - case ARRAY: - callback.call(this, key); - - // check for circular structure - if (this._visited.has(value)) { - return this.destroy(new TypeError('Converting circular structure to JSON')); - } - - this._visited.add(value); - - this.push('['); - this.pushStack({ - handler: processArray, - value, - index: 0 - }); - this._depth++; - break; - - case PROMISE: - this.pushStack({ - handler: noop, - awaiting: true - }); - - Promise.resolve(value) - .then(resolved => { - this.popStack(); - this.processValue(holder, key, resolved, callback); - this.processStack(); - }) - .catch(error => { - this.destroy(error); - }); - break; - - case STRING_STREAM: - case OBJECT_STREAM: - callback.call(this, key); - - // TODO: Remove when drop support for Node.js 10 - // Used `_readableState.endEmitted` as fallback, since Node.js 10 has no `readableEnded` getter - if (value.readableEnded || value._readableState.endEmitted) { - return this.destroy(new Error('Readable Stream has ended before it was serialized. All stream data have been lost')); - } - - if (value.readableFlowing) { - return this.destroy(new Error('Readable Stream is in flowing mode, data may have been lost. Trying to pause stream.')); - } - - if (type === OBJECT_STREAM) { - this.push('['); - this.pushStack({ - handler: push, - value: this.space ? '\n' + this.space.repeat(this._depth) + ']' : ']' - }); - this._depth++; - } - - const self = this.pushStack({ - handler: type === OBJECT_STREAM ? processReadableObject : processReadableString, - value, - index: 0, - first: false, - ended: false, - awaiting: !value.readable || value.readableLength === 0 - }); - const continueProcessing = () => { - if (self.awaiting) { - self.awaiting = false; - this.processStack(); - } - }; - - value.once('error', error => this.destroy(error)); - value.once('end', () => { - self.ended = true; - continueProcessing(); - }); - value.on('readable', continueProcessing); - break; - } - } - - pushStack(node) { - node.prev = this._stack; - return this._stack = node; - } - - popStack() { - const { handler, value } = this._stack; - - if (handler === processObject || handler === processArray || handler === processReadableObject) { - this._visited.delete(value); - this._depth--; - } - - this._stack = this._stack.prev; - } - - processStack() { - if (this._processing || this._ended) { - return; - } - - try { - this._processing = true; - - while (this._stack !== null && !this._stack.awaiting) { - this._stack.handler.call(this); - - if (!this._processing) { - return; - } - } - - this._processing = false; - } catch (error) { - this.destroy(error); - return; - } - - if (this._stack === null && !this._ended) { - this._finish(); - this.push(null); - } - } - - push(data) { - if (data !== null) { - this._buffer += data; - - // check buffer overflow - if (this._buffer.length < this._readSize) { - return; - } - - // flush buffer - data = this._buffer; - this._buffer = ''; - this._processing = false; - } - - super.push(data); - } - - _read(size) { - // start processing - this._readSize = size || this.readableHighWaterMark; - this.processStack(); - } - - _finish() { - this._ended = true; - this._processing = false; - this._stack = null; - this._visited = null; - - if (this._buffer && this._buffer.length) { - super.push(this._buffer); // flush buffer - } - - this._buffer = ''; - } - - _destroy(error, cb) { - this.error = this.error || error; - this._finish(); - cb(error); - } -} - -module.exports = function createJsonStringifyStream(value, replacer, space) { - return new JsonStringifyStream(value, replacer, space); -}; diff --git a/node_modules/@discoveryjs/json-ext/src/text-decoder-browser.js b/node_modules/@discoveryjs/json-ext/src/text-decoder-browser.js deleted file mode 100644 index 11befa2..0000000 --- a/node_modules/@discoveryjs/json-ext/src/text-decoder-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = TextDecoder; diff --git a/node_modules/@discoveryjs/json-ext/src/text-decoder.js b/node_modules/@discoveryjs/json-ext/src/text-decoder.js deleted file mode 100644 index 99fa6d5..0000000 --- a/node_modules/@discoveryjs/json-ext/src/text-decoder.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').TextDecoder; diff --git a/node_modules/@discoveryjs/json-ext/src/utils.js b/node_modules/@discoveryjs/json-ext/src/utils.js deleted file mode 100644 index b79bc72..0000000 --- a/node_modules/@discoveryjs/json-ext/src/utils.js +++ /dev/null @@ -1,149 +0,0 @@ -const PrimitiveType = 1; -const ObjectType = 2; -const ArrayType = 3; -const PromiseType = 4; -const ReadableStringType = 5; -const ReadableObjectType = 6; -// https://tc39.es/ecma262/#table-json-single-character-escapes -const escapableCharCodeSubstitution = { // JSON Single Character Escape Sequences - 0x08: '\\b', - 0x09: '\\t', - 0x0a: '\\n', - 0x0c: '\\f', - 0x0d: '\\r', - 0x22: '\\\"', - 0x5c: '\\\\' -}; - -function isLeadingSurrogate(code) { - return code >= 0xD800 && code <= 0xDBFF; -} - -function isTrailingSurrogate(code) { - return code >= 0xDC00 && code <= 0xDFFF; -} - -function isReadableStream(value) { - return ( - typeof value.pipe === 'function' && - typeof value._read === 'function' && - typeof value._readableState === 'object' && value._readableState !== null - ); -} - -function replaceValue(holder, key, value, replacer) { - if (value && typeof value.toJSON === 'function') { - value = value.toJSON(); - } - - if (replacer !== null) { - value = replacer.call(holder, String(key), value); - } - - switch (typeof value) { - case 'function': - case 'symbol': - value = undefined; - break; - - case 'object': - if (value !== null) { - const cls = value.constructor; - if (cls === String || cls === Number || cls === Boolean) { - value = value.valueOf(); - } - } - break; - } - - return value; -} - -function getTypeNative(value) { - if (value === null || typeof value !== 'object') { - return PrimitiveType; - } - - if (Array.isArray(value)) { - return ArrayType; - } - - return ObjectType; -} - -function getTypeAsync(value) { - if (value === null || typeof value !== 'object') { - return PrimitiveType; - } - - if (typeof value.then === 'function') { - return PromiseType; - } - - if (isReadableStream(value)) { - return value._readableState.objectMode ? ReadableObjectType : ReadableStringType; - } - - if (Array.isArray(value)) { - return ArrayType; - } - - return ObjectType; -} - -function normalizeReplacer(replacer) { - if (typeof replacer === 'function') { - return replacer; - } - - if (Array.isArray(replacer)) { - const allowlist = new Set(replacer - .map(item => { - const cls = item && item.constructor; - return cls === String || cls === Number ? String(item) : null; - }) - .filter(item => typeof item === 'string') - ); - - return [...allowlist]; - } - - return null; -} - -function normalizeSpace(space) { - if (typeof space === 'number') { - if (!Number.isFinite(space) || space < 1) { - return false; - } - - return ' '.repeat(Math.min(space, 10)); - } - - if (typeof space === 'string') { - return space.slice(0, 10) || false; - } - - return false; -} - -module.exports = { - escapableCharCodeSubstitution, - isLeadingSurrogate, - isTrailingSurrogate, - type: { - PRIMITIVE: PrimitiveType, - PROMISE: PromiseType, - ARRAY: ArrayType, - OBJECT: ObjectType, - STRING_STREAM: ReadableStringType, - OBJECT_STREAM: ReadableObjectType - }, - - isReadableStream, - replaceValue, - getTypeNative, - getTypeAsync, - normalizeReplacer, - normalizeSpace -}; diff --git a/node_modules/@discoveryjs/json-ext/src/version.js b/node_modules/@discoveryjs/json-ext/src/version.js deleted file mode 100644 index 81f6e78..0000000 --- a/node_modules/@discoveryjs/json-ext/src/version.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../package.json').version; diff --git a/node_modules/@jridgewell/gen-mapping/LICENSE b/node_modules/@jridgewell/gen-mapping/LICENSE deleted file mode 100644 index 352f071..0000000 --- a/node_modules/@jridgewell/gen-mapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2022 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@jridgewell/gen-mapping/README.md b/node_modules/@jridgewell/gen-mapping/README.md deleted file mode 100644 index 4066cdb..0000000 --- a/node_modules/@jridgewell/gen-mapping/README.md +++ /dev/null @@ -1,227 +0,0 @@ -# @jridgewell/gen-mapping - -> Generate source maps - -`gen-mapping` allows you to generate a source map during transpilation or minification. -With a source map, you're able to trace the original location in the source file, either in Chrome's -DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. - -You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This -provides the same `addMapping` and `setSourceContent` API. - -## Installation - -```sh -npm install @jridgewell/gen-mapping -``` - -## Usage - -```typescript -import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; - -const map = new GenMapping({ - file: 'output.js', - sourceRoot: 'https://example.com/', -}); - -setSourceContent(map, 'input.js', `function foo() {}`); - -addMapping(map, { - // Lines start at line 1, columns at column 0. - generated: { line: 1, column: 0 }, - source: 'input.js', - original: { line: 1, column: 0 }, -}); - -addMapping(map, { - generated: { line: 1, column: 9 }, - source: 'input.js', - original: { line: 1, column: 9 }, - name: 'foo', -}); - -assert.deepEqual(toDecodedMap(map), { - version: 3, - file: 'output.js', - names: ['foo'], - sourceRoot: 'https://example.com/', - sources: ['input.js'], - sourcesContent: ['function foo() {}'], - mappings: [ - [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] - ], -}); - -assert.deepEqual(toEncodedMap(map), { - version: 3, - file: 'output.js', - names: ['foo'], - sourceRoot: 'https://example.com/', - sources: ['input.js'], - sourcesContent: ['function foo() {}'], - mappings: 'AAAA,SAASA', -}); -``` - -### Smaller Sourcemaps - -Not everything needs to be added to a sourcemap, and needless markings can cause signficantly -larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will -intelligently determine if this marking adds useful information. If not, the marking will be -skipped. - -```typescript -import { maybeAddMapping } from '@jridgewell/gen-mapping'; - -const map = new GenMapping(); - -// Adding a sourceless marking at the beginning of a line isn't useful. -maybeAddMapping(map, { - generated: { line: 1, column: 0 }, -}); - -// Adding a new source marking is useful. -maybeAddMapping(map, { - generated: { line: 1, column: 0 }, - source: 'input.js', - original: { line: 1, column: 0 }, -}); - -// But adding another marking pointing to the exact same original location isn't, even if the -// generated column changed. -maybeAddMapping(map, { - generated: { line: 1, column: 9 }, - source: 'input.js', - original: { line: 1, column: 0 }, -}); - -assert.deepEqual(toEncodedMap(map), { - version: 3, - names: [], - sources: ['input.js'], - sourcesContent: [null], - mappings: 'AAAA', -}); -``` - -## Benchmarks - -``` -node v18.0.0 - -amp.js.map -Memory Usage: -gen-mapping: addSegment 5852872 bytes -gen-mapping: addMapping 7716042 bytes -source-map-js 6143250 bytes -source-map-0.6.1 6124102 bytes -source-map-0.8.0 6121173 bytes -Smallest memory usage is gen-mapping: addSegment - -Adding speed: -gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) -gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) -source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) -source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) -source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) -gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) -source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) -source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) -source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) -Fastest is gen-mapping: decoded output - - -*** - - -babel.min.js.map -Memory Usage: -gen-mapping: addSegment 37578063 bytes -gen-mapping: addMapping 37212897 bytes -source-map-js 47638527 bytes -source-map-0.6.1 47690503 bytes -source-map-0.8.0 47470188 bytes -Smallest memory usage is gen-mapping: addMapping - -Adding speed: -gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) -gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) -source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) -source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) -source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) -gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) -source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) -source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) -source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) -Fastest is gen-mapping: decoded output - - -*** - - -preact.js.map -Memory Usage: -gen-mapping: addSegment 416247 bytes -gen-mapping: addMapping 419824 bytes -source-map-js 1024619 bytes -source-map-0.6.1 1146004 bytes -source-map-0.8.0 1113250 bytes -Smallest memory usage is gen-mapping: addSegment - -Adding speed: -gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) -gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) -source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) -source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) -source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) -gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) -source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) -source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) -source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) -Fastest is gen-mapping: decoded output - - -*** - - -react.js.map -Memory Usage: -gen-mapping: addSegment 975096 bytes -gen-mapping: addMapping 1102981 bytes -source-map-js 2918836 bytes -source-map-0.6.1 2885435 bytes -source-map-0.8.0 2874336 bytes -Smallest memory usage is gen-mapping: addSegment - -Adding speed: -gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) -gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) -source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) -source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) -source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) -gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) -source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) -source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) -source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) -Fastest is gen-mapping: decoded output -``` - -[source-map]: https://www.npmjs.com/package/source-map -[trace-mapping]: https://github.com/jridgewell/trace-mapping diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs deleted file mode 100644 index 5aeb5cc..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +++ /dev/null @@ -1,230 +0,0 @@ -import { SetArray, put } from '@jridgewell/set-array'; -import { encode } from '@jridgewell/sourcemap-codec'; -import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; - -const COLUMN = 0; -const SOURCES_INDEX = 1; -const SOURCE_LINE = 2; -const SOURCE_COLUMN = 3; -const NAMES_INDEX = 4; - -const NO_NAME = -1; -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -let addSegment; -/** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ -let addMapping; -/** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ -let maybeAddSegment; -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -let maybeAddMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -let setSourceContent; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let toDecodedMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let toEncodedMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -let fromMap; -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -let allMappings; -// This split declaration is only so that terser can elminiate the static initialization block. -let addSegmentInternal; -/** - * Provides the state to generate a sourcemap. - */ -class GenMapping { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - } -} -(() => { - addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); - }; - maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); - }; - addMapping = (map, mapping) => { - return addMappingInternal(false, map, mapping); - }; - maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); - }; - setSourceContent = (map, source, content) => { - const { _sources: sources, _sourcesContent: sourcesContent } = map; - sourcesContent[put(sources, source)] = content; - }; - toDecodedMap = (map) => { - const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - removeEmptyFinalLines(mappings); - return { - version: 3, - file: file || undefined, - names: names.array, - sourceRoot: sourceRoot || undefined, - sources: sources.array, - sourcesContent, - mappings, - }; - }; - toEncodedMap = (map) => { - const decoded = toDecodedMap(map); - return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); - }; - allMappings = (map) => { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = map; - for (let i = 0; i < mappings.length; i++) { - const line = mappings[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generated = { line: i + 1, column: seg[COLUMN] }; - let source = undefined; - let original = undefined; - let name = undefined; - if (seg.length !== 1) { - source = sources.array[seg[SOURCES_INDEX]]; - original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; - if (seg.length === 5) - name = names.array[seg[NAMES_INDEX]]; - } - out.push({ generated, source, original, name }); - } - } - return out; - }; - fromMap = (input) => { - const map = new TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(gen._names, map.names); - putAll(gen._sources, map.sources); - gen._sourcesContent = map.sourcesContent || map.sources.map(() => null); - gen._mappings = decodedMappings(map); - return gen; - }; - // Internal helpers - addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - const line = getLine(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) - return; - return insert(line, index, [genColumn]); - } - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) - sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert(line, index, name - ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] - : [genColumn, sourcesIndex, sourceLine, sourceColumn]); - }; -})(); -function getLine(mappings, index) { - for (let i = mappings.length; i <= index; i++) { - mappings[i] = []; - } - return mappings[index]; -} -function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) - break; - } - return index; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) - break; - } - if (len < length) - mappings.length = len; -} -function putAll(strarr, array) { - for (let i = 0; i < array.length; i++) - put(strarr, array[i]); -} -function skipSourceless(line, index) { - // The start of a line is already sourceless, so adding a sourceless segment to the beginning - // doesn't generate any useful information. - if (index === 0) - return true; - const prev = line[index - 1]; - // If the previous segment is also sourceless, then adding another sourceless segment doesn't - // genrate any new information. Else, this segment will end the source/named segment and point to - // a sourceless position, which is useful. - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - // A source/named segment at the start of a line gives position at that genColumn - if (index === 0) - return false; - const prev = line[index - 1]; - // If the previous segment is sourceless, then we're transitioning to a source. - if (prev.length === 1) - return false; - // If the previous segment maps to the exact same source position, then this segment doesn't - // provide any new position information. - return (sourcesIndex === prev[SOURCES_INDEX] && - sourceLine === prev[SOURCE_LINE] && - sourceColumn === prev[SOURCE_COLUMN] && - namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); -} -function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null); - } - const s = source; - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content); -} - -export { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap }; -//# sourceMappingURL=gen-mapping.mjs.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map deleted file mode 100644 index 2fee0cd..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gen-mapping.mjs","sources":["../src/sourcemap-segment.ts","../src/gen-mapping.ts"],"sourcesContent":["type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,\n original.column,\n name,\n content,\n );\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,a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,CACzB,QAAiB,EACjB,GAAe,EACf,OAMC,EAAA;AAED,IAAA,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC/D,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;AACH,KAAA;IACD,MAAM,CAAC,GAAW,MAAM,CAAC;AAEzB,IAAA,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,QAAQ,CAAC,IAAI,GAAG,CAAC,EACjB,QAAQ,CAAC,MAAM,EACf,IAAI,EACJ,OAAO,CACR,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js deleted file mode 100644 index d9fcf5c..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js +++ /dev/null @@ -1,236 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/set-array'), require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')) : - typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/set-array', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.genMapping = {}, global.setArray, global.sourcemapCodec, global.traceMapping)); -})(this, (function (exports, setArray, sourcemapCodec, traceMapping) { 'use strict'; - - const COLUMN = 0; - const SOURCES_INDEX = 1; - const SOURCE_LINE = 2; - const SOURCE_COLUMN = 3; - const NAMES_INDEX = 4; - - const NO_NAME = -1; - /** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ - exports.addSegment = void 0; - /** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ - exports.addMapping = void 0; - /** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ - exports.maybeAddSegment = void 0; - /** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ - exports.maybeAddMapping = void 0; - /** - * Adds/removes the content of the source file to the source map. - */ - exports.setSourceContent = void 0; - /** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - exports.toDecodedMap = void 0; - /** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - exports.toEncodedMap = void 0; - /** - * Constructs a new GenMapping, using the already present mappings of the input. - */ - exports.fromMap = void 0; - /** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ - exports.allMappings = void 0; - // This split declaration is only so that terser can elminiate the static initialization block. - let addSegmentInternal; - /** - * Provides the state to generate a sourcemap. - */ - class GenMapping { - constructor({ file, sourceRoot } = {}) { - this._names = new setArray.SetArray(); - this._sources = new setArray.SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - } - } - (() => { - exports.addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); - }; - exports.maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); - }; - exports.addMapping = (map, mapping) => { - return addMappingInternal(false, map, mapping); - }; - exports.maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); - }; - exports.setSourceContent = (map, source, content) => { - const { _sources: sources, _sourcesContent: sourcesContent } = map; - sourcesContent[setArray.put(sources, source)] = content; - }; - exports.toDecodedMap = (map) => { - const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - removeEmptyFinalLines(mappings); - return { - version: 3, - file: file || undefined, - names: names.array, - sourceRoot: sourceRoot || undefined, - sources: sources.array, - sourcesContent, - mappings, - }; - }; - exports.toEncodedMap = (map) => { - const decoded = exports.toDecodedMap(map); - return Object.assign(Object.assign({}, decoded), { mappings: sourcemapCodec.encode(decoded.mappings) }); - }; - exports.allMappings = (map) => { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = map; - for (let i = 0; i < mappings.length; i++) { - const line = mappings[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generated = { line: i + 1, column: seg[COLUMN] }; - let source = undefined; - let original = undefined; - let name = undefined; - if (seg.length !== 1) { - source = sources.array[seg[SOURCES_INDEX]]; - original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; - if (seg.length === 5) - name = names.array[seg[NAMES_INDEX]]; - } - out.push({ generated, source, original, name }); - } - } - return out; - }; - exports.fromMap = (input) => { - const map = new traceMapping.TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(gen._names, map.names); - putAll(gen._sources, map.sources); - gen._sourcesContent = map.sourcesContent || map.sources.map(() => null); - gen._mappings = traceMapping.decodedMappings(map); - return gen; - }; - // Internal helpers - addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - const line = getLine(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) - return; - return insert(line, index, [genColumn]); - } - const sourcesIndex = setArray.put(sources, source); - const namesIndex = name ? setArray.put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) - sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert(line, index, name - ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] - : [genColumn, sourcesIndex, sourceLine, sourceColumn]); - }; - })(); - function getLine(mappings, index) { - for (let i = mappings.length; i <= index; i++) { - mappings[i] = []; - } - return mappings[index]; - } - function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) - break; - } - return index; - } - function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; - } - function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) - break; - } - if (len < length) - mappings.length = len; - } - function putAll(strarr, array) { - for (let i = 0; i < array.length; i++) - setArray.put(strarr, array[i]); - } - function skipSourceless(line, index) { - // The start of a line is already sourceless, so adding a sourceless segment to the beginning - // doesn't generate any useful information. - if (index === 0) - return true; - const prev = line[index - 1]; - // If the previous segment is also sourceless, then adding another sourceless segment doesn't - // genrate any new information. Else, this segment will end the source/named segment and point to - // a sourceless position, which is useful. - return prev.length === 1; - } - function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - // A source/named segment at the start of a line gives position at that genColumn - if (index === 0) - return false; - const prev = line[index - 1]; - // If the previous segment is sourceless, then we're transitioning to a source. - if (prev.length === 1) - return false; - // If the previous segment maps to the exact same source position, then this segment doesn't - // provide any new position information. - return (sourcesIndex === prev[SOURCES_INDEX] && - sourceLine === prev[SOURCE_LINE] && - sourceColumn === prev[SOURCE_COLUMN] && - namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); - } - function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null); - } - const s = source; - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content); - } - - exports.GenMapping = GenMapping; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=gen-mapping.umd.js.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map deleted file mode 100644 index 7cc8d14..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gen-mapping.umd.js","sources":["../src/sourcemap-segment.ts","../src/gen-mapping.ts"],"sourcesContent":["type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,\n original.column,\n name,\n content,\n );\n}\n"],"names":["addSegment","addMapping","maybeAddSegment","maybeAddMapping","setSourceContent","toDecodedMap","toEncodedMap","fromMap","allMappings","SetArray","put","encode","TraceMap","decodedMappings"],"mappings":";;;;;;IAWO,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC,CAAC;IACtB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC;;ICQ5B,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC;IAEnB;;;IAGG;AACQA,gCA+BT;IAEF;;;IAGG;AACQC,gCA+BT;IAEF;;;;IAIG;AACQC,qCAAmC;IAE9C;;;;IAIG;AACQC,qCAAmC;IAE9C;;IAEG;AACQC,sCAAoF;IAE/F;;;IAGG;AACQ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IAAI,CACL,CAAC;IACH,KAAA;QACD,MAAM,CAAC,GAAW,MAAM,CAAC;IAEzB,IAAA,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,QAAQ,CAAC,IAAI,GAAG,CAAC,EACjB,QAAQ,CAAC,MAAM,EACf,IAAI,EACJ,OAAO,CACR,CAAC;IACJ;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts deleted file mode 100644 index d510d74..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export declare type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -export declare let addSegment: { - (map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; - (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; - (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; -}; -/** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ -export declare let addMapping: { - (map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; - }): void; - (map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; - }): void; - (map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name: string; - content?: string | null; - }): void; -}; -/** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ -export declare let maybeAddSegment: typeof addSegment; -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -export declare let maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare let setSourceContent: (map: GenMapping, source: string, content: string | null) => void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare let toDecodedMap: (map: GenMapping) => DecodedSourceMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare let toEncodedMap: (map: GenMapping) => EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare let fromMap: (input: SourceMapInput) => GenMapping; -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -export declare let allMappings: (map: GenMapping) => Mapping[]; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts deleted file mode 100644 index e187ba9..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare type GeneratedColumn = number; -declare type SourcesIndex = number; -declare type SourceLine = number; -declare type SourceColumn = number; -declare type NamesIndex = number; -export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export {}; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts deleted file mode 100644 index b309c81..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export declare type Mapping = { - generated: Pos; - source: undefined; - original: undefined; - name: undefined; -} | { - generated: Pos; - source: string; - original: Pos; - name: string; -} | { - generated: Pos; - source: string; - original: Pos; - name: undefined; -}; diff --git a/node_modules/@jridgewell/gen-mapping/package.json b/node_modules/@jridgewell/gen-mapping/package.json deleted file mode 100644 index 69e0ac8..0000000 --- a/node_modules/@jridgewell/gen-mapping/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "@jridgewell/gen-mapping", - "version": "0.3.3", - "description": "Generate source maps", - "keywords": [ - "source", - "map" - ], - "author": "Justin Ridgewell ", - "license": "MIT", - "repository": "https://github.com/jridgewell/gen-mapping", - "main": "dist/gen-mapping.umd.js", - "module": "dist/gen-mapping.mjs", - "types": "dist/types/gen-mapping.d.ts", - "exports": { - ".": [ - { - "types": "./dist/types/gen-mapping.d.ts", - "browser": "./dist/gen-mapping.umd.js", - "require": "./dist/gen-mapping.umd.js", - "import": "./dist/gen-mapping.mjs" - }, - "./dist/gen-mapping.umd.js" - ], - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "engines": { - "node": ">=6.0.0" - }, - "scripts": { - "benchmark": "run-s build:rollup benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node benchmark/index.mjs", - "prebuild": "rm -rf dist", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "pretest": "run-s build:rollup", - "test": "run-s -n test:lint test:coverage", - "test:debug": "mocha --inspect-brk", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:coverage": "c8 mocha", - "test:watch": "run-p 'build:rollup -- --watch' 'test:only -- --watch'", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build" - }, - "devDependencies": { - "@rollup/plugin-typescript": "8.3.2", - "@types/mocha": "9.1.1", - "@types/node": "17.0.29", - "@typescript-eslint/eslint-plugin": "5.21.0", - "@typescript-eslint/parser": "5.21.0", - "benchmark": "2.1.4", - "c8": "7.11.2", - "eslint": "8.14.0", - "eslint-config-prettier": "8.5.0", - "mocha": "9.2.2", - "npm-run-all": "4.1.5", - "prettier": "2.6.2", - "rollup": "2.70.2", - "typescript": "4.6.3" - }, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } -} diff --git a/node_modules/@jridgewell/resolve-uri/LICENSE b/node_modules/@jridgewell/resolve-uri/LICENSE deleted file mode 100644 index 0a81b2a..0000000 --- a/node_modules/@jridgewell/resolve-uri/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2019 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/README.md b/node_modules/@jridgewell/resolve-uri/README.md deleted file mode 100644 index 2fe70df..0000000 --- a/node_modules/@jridgewell/resolve-uri/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# @jridgewell/resolve-uri - -> Resolve a URI relative to an optional base URI - -Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. - -## Installation - -```sh -npm install @jridgewell/resolve-uri -``` - -## Usage - -```typescript -function resolve(input: string, base?: string): string; -``` - -```js -import resolve from '@jridgewell/resolve-uri'; - -resolve('foo', 'https://example.com'); // => 'https://example.com/foo' -``` - -| Input | Base | Resolution | Explanation | -|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| -| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | -| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | -| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | -| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | -| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | -| `/example` | _rest_ | `/example` | Input is normalized only | -| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | -| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | -| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | -| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | -| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | -| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | -| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | -| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs deleted file mode 100644 index 94d8dce..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +++ /dev/null @@ -1,242 +0,0 @@ -// Matches the scheme of a URL, eg "http://" -const schemeRegex = /^[\w+.-]+:\/\//; -/** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - * 6. Query, including "?", optional. - * 7. Hash, including "#", optional. - */ -const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; -/** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may include "/", guaranteed. - * 3. Query, including "?", optional. - * 4. Hash, including "#", optional. - */ -const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; -var UrlType; -(function (UrlType) { - UrlType[UrlType["Empty"] = 1] = "Empty"; - UrlType[UrlType["Hash"] = 2] = "Hash"; - UrlType[UrlType["Query"] = 3] = "Query"; - UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; - UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; - UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; - UrlType[UrlType["Absolute"] = 7] = "Absolute"; -})(UrlType || (UrlType = {})); -function isAbsoluteUrl(input) { - return schemeRegex.test(input); -} -function isSchemeRelativeUrl(input) { - return input.startsWith('//'); -} -function isAbsolutePath(input) { - return input.startsWith('/'); -} -function isFileUrl(input) { - return input.startsWith('file:'); -} -function isRelative(input) { - return /^[.?#]/.test(input); -} -function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); -} -function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); -} -function makeUrl(scheme, user, host, port, path, query, hash) { - return { - scheme, - user, - host, - port, - path, - query, - hash, - type: UrlType.Absolute, - }; -} -function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = UrlType.SchemeRelative; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = UrlType.AbsolutePath; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.type = input - ? input.startsWith('?') - ? UrlType.Query - : input.startsWith('#') - ? UrlType.Hash - : UrlType.RelativePath - : UrlType.Empty; - return url; -} -function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} -function mergePaths(url, base) { - normalizePath(base, base.type); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } -} -/** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ -function normalizePath(url, type) { - const rel = type <= UrlType.RelativePath; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (rel) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; -} -/** - * Attempts to resolve `input` URL/path relative to `base`. - */ -function resolve(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - let inputType = url.type; - if (base && inputType !== UrlType.Absolute) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case UrlType.Empty: - url.hash = baseUrl.hash; - // fall through - case UrlType.Hash: - url.query = baseUrl.query; - // fall through - case UrlType.Query: - case UrlType.RelativePath: - mergePaths(url, baseUrl); - // fall through - case UrlType.AbsolutePath: - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - // fall through - case UrlType.SchemeRelative: - // The input doesn't have a schema at least, so we need to copy at least that over. - url.scheme = baseUrl.scheme; - } - if (baseType > inputType) - inputType = baseType; - } - normalizePath(url, inputType); - const queryHash = url.query + url.hash; - switch (inputType) { - // This is impossible, because of the empty checks at the start of the function. - // case UrlType.Empty: - case UrlType.Hash: - case UrlType.Query: - return queryHash; - case UrlType.RelativePath: { - // The first char is always a "/", and we need it to be relative. - const path = url.path.slice(1); - if (!path) - return queryHash || '.'; - if (isRelative(base || input) && !isRelative(path)) { - // If base started with a leading ".", or there is no base and input started with a ".", - // then we need to ensure that the relative path starts with a ".". We don't know if - // relative starts with a "..", though, so check before prepending. - return './' + path + queryHash; - } - return path + queryHash; - } - case UrlType.AbsolutePath: - return url.path + queryHash; - default: - return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; - } -} - -export { resolve as default }; -//# sourceMappingURL=resolve-uri.mjs.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map deleted file mode 100644 index 009d043..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":"AAAA;AACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F;;;;;;;;;AASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;AAapF,IAAK,OAQJ;AARD,WAAK,OAAO;IACV,uCAAS,CAAA;IACT,qCAAQ,CAAA;IACR,uCAAS,CAAA;IACT,qDAAgB,CAAA;IAChB,qDAAgB,CAAA;IAChB,yDAAkB,CAAA;IAClB,6CAAY,CAAA;AACd,CAAC,EARI,OAAO,KAAP,OAAO,QAQX;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO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G,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;KACpF;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js deleted file mode 100644 index 0700a2d..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +++ /dev/null @@ -1,250 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory()); -})(this, (function () { 'use strict'; - - // Matches the scheme of a URL, eg "http://" - const schemeRegex = /^[\w+.-]+:\/\//; - /** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - * 6. Query, including "?", optional. - * 7. Hash, including "#", optional. - */ - const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; - /** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may include "/", guaranteed. - * 3. Query, including "?", optional. - * 4. Hash, including "#", optional. - */ - const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; - var UrlType; - (function (UrlType) { - UrlType[UrlType["Empty"] = 1] = "Empty"; - UrlType[UrlType["Hash"] = 2] = "Hash"; - UrlType[UrlType["Query"] = 3] = "Query"; - UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; - UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; - UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; - UrlType[UrlType["Absolute"] = 7] = "Absolute"; - })(UrlType || (UrlType = {})); - function isAbsoluteUrl(input) { - return schemeRegex.test(input); - } - function isSchemeRelativeUrl(input) { - return input.startsWith('//'); - } - function isAbsolutePath(input) { - return input.startsWith('/'); - } - function isFileUrl(input) { - return input.startsWith('file:'); - } - function isRelative(input) { - return /^[.?#]/.test(input); - } - function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); - } - function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); - } - function makeUrl(scheme, user, host, port, path, query, hash) { - return { - scheme, - user, - host, - port, - path, - query, - hash, - type: UrlType.Absolute, - }; - } - function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = UrlType.SchemeRelative; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = UrlType.AbsolutePath; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.type = input - ? input.startsWith('?') - ? UrlType.Query - : input.startsWith('#') - ? UrlType.Hash - : UrlType.RelativePath - : UrlType.Empty; - return url; - } - function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - function mergePaths(url, base) { - normalizePath(base, base.type); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } - } - /** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ - function normalizePath(url, type) { - const rel = type <= UrlType.RelativePath; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (rel) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; - } - /** - * Attempts to resolve `input` URL/path relative to `base`. - */ - function resolve(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - let inputType = url.type; - if (base && inputType !== UrlType.Absolute) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case UrlType.Empty: - url.hash = baseUrl.hash; - // fall through - case UrlType.Hash: - url.query = baseUrl.query; - // fall through - case UrlType.Query: - case UrlType.RelativePath: - mergePaths(url, baseUrl); - // fall through - case UrlType.AbsolutePath: - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - // fall through - case UrlType.SchemeRelative: - // The input doesn't have a schema at least, so we need to copy at least that over. - url.scheme = baseUrl.scheme; - } - if (baseType > inputType) - inputType = baseType; - } - normalizePath(url, inputType); - const queryHash = url.query + url.hash; - switch (inputType) { - // This is impossible, because of the empty checks at the start of the function. - // case UrlType.Empty: - case UrlType.Hash: - case UrlType.Query: - return queryHash; - case UrlType.RelativePath: { - // The first char is always a "/", and we need it to be relative. - const path = url.path.slice(1); - if (!path) - return queryHash || '.'; - if (isRelative(base || input) && !isRelative(path)) { - // If base started with a leading ".", or there is no base and input started with a ".", - // then we need to ensure that the relative path starts with a ".". We don't know if - // relative starts with a "..", though, so check before prepending. - return './' + path + queryHash; - } - return path + queryHash; - } - case UrlType.AbsolutePath: - return url.path + queryHash; - default: - return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; - } - } - - return resolve; - -})); -//# sourceMappingURL=resolve-uri.umd.js.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map deleted file mode 100644 index a3e39eb..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAErC;;;;;;;;;;IAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;IAE5F;;;;;;;;;IASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;IAapF,IAAK,OAQJ;IARD,WAAK,OAAO;QACV,uCAAS,CAAA;QACT,qCAAQ,CAAA;QACR,uCAAS,CAAA;QACT,qDAAgB,CAAA;QAChB,qDAAgB,CAAA;QAChB,yDAAkB,CAAA;QAClB,6CAAY,CAAA;IACd,CAAC,EARI,OAAO,KAAP,OAAO,QAQX;IAED,SAAS,aAAa,CAAC,KAAa;QAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,mBAAmB,CAAC,KAAa;QACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,SAAS,cAAc,CAAC,KAAa;QACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,SAAS,CAAC,KAAa;QAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;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SAAS,CAAC;SACpF;IACH;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts deleted file mode 100644 index b7f0b3b..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Attempts to resolve `input` URL/path relative to `base`. - */ -export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/resolve-uri/package.json b/node_modules/@jridgewell/resolve-uri/package.json deleted file mode 100644 index 6bffa7b..0000000 --- a/node_modules/@jridgewell/resolve-uri/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@jridgewell/resolve-uri", - "version": "3.1.1", - "description": "Resolve a URI relative to an optional base URI", - "keywords": [ - "resolve", - "uri", - "url", - "path" - ], - "author": "Justin Ridgewell ", - "license": "MIT", - "repository": "https://github.com/jridgewell/resolve-uri", - "main": "dist/resolve-uri.umd.js", - "module": "dist/resolve-uri.mjs", - "types": "dist/types/resolve-uri.d.ts", - "exports": { - ".": [ - { - "types": "./dist/types/resolve-uri.d.ts", - "browser": "./dist/resolve-uri.umd.js", - "require": "./dist/resolve-uri.umd.js", - "import": "./dist/resolve-uri.mjs" - }, - "./dist/resolve-uri.umd.js" - ], - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "engines": { - "node": ">=6.0.0" - }, - "scripts": { - "prebuild": "rm -rf dist", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "pretest": "run-s build:rollup", - "test": "run-s -n test:lint test:only", - "test:debug": "mocha --inspect-brk", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:coverage": "c8 mocha", - "test:watch": "mocha --watch", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build" - }, - "devDependencies": { - "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*", - "@rollup/plugin-typescript": "8.3.0", - "@typescript-eslint/eslint-plugin": "5.10.0", - "@typescript-eslint/parser": "5.10.0", - "c8": "7.11.0", - "eslint": "8.7.0", - "eslint-config-prettier": "8.3.0", - "mocha": "9.2.0", - "npm-run-all": "4.1.5", - "prettier": "2.5.1", - "rollup": "2.66.0", - "typescript": "4.5.5" - } -} diff --git a/node_modules/@jridgewell/set-array/LICENSE b/node_modules/@jridgewell/set-array/LICENSE deleted file mode 100644 index 352f071..0000000 --- a/node_modules/@jridgewell/set-array/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2022 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@jridgewell/set-array/README.md b/node_modules/@jridgewell/set-array/README.md deleted file mode 100644 index 2ed155f..0000000 --- a/node_modules/@jridgewell/set-array/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# @jridgewell/set-array - -> Like a Set, but provides the index of the `key` in the backing array - -This is designed to allow synchronizing a second array with the contents of the backing array, like -how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, and there -are never duplicates. - -## Installation - -```sh -npm install @jridgewell/set-array -``` - -## Usage - -```js -import { SetArray, get, put, pop } from '@jridgewell/set-array'; - -const sa = new SetArray(); - -let index = put(sa, 'first'); -assert.strictEqual(index, 0); - -index = put(sa, 'second'); -assert.strictEqual(index, 1); - -assert.deepEqual(sa.array, [ 'first', 'second' ]); - -index = get(sa, 'first'); -assert.strictEqual(index, 0); - -pop(sa); -index = get(sa, 'second'); -assert.strictEqual(index, undefined); -assert.deepEqual(sa.array, [ 'first' ]); -``` diff --git a/node_modules/@jridgewell/set-array/dist/set-array.mjs b/node_modules/@jridgewell/set-array/dist/set-array.mjs deleted file mode 100644 index b7f1a9c..0000000 --- a/node_modules/@jridgewell/set-array/dist/set-array.mjs +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -let get; -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -let put; -/** - * Pops the last added item out of the SetArray. - */ -let pop; -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -class SetArray { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -} -(() => { - get = (strarr, key) => strarr._indexes[key]; - put = (strarr, key) => { - // The key may or may not be present. If it is present, it's a number. - const index = get(strarr, key); - if (index !== undefined) - return index; - const { array, _indexes: indexes } = strarr; - return (indexes[key] = array.push(key) - 1); - }; - pop = (strarr) => { - const { array, _indexes: indexes } = strarr; - if (array.length === 0) - return; - const last = array.pop(); - indexes[last] = undefined; - }; -})(); - -export { SetArray, get, pop, put }; -//# sourceMappingURL=set-array.mjs.map diff --git a/node_modules/@jridgewell/set-array/dist/set-array.mjs.map b/node_modules/@jridgewell/set-array/dist/set-array.mjs.map deleted file mode 100644 index ead5643..0000000 --- a/node_modules/@jridgewell/set-array/dist/set-array.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-array.mjs","sources":["../src/set-array.ts"],"sourcesContent":["/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n"],"names":[],"mappings":"AAAA;;;IAGW,IAA2D;AAEtE;;;;IAIW,IAA+C;AAE1D;;;IAGW,IAAgC;AAE3C;;;;;;;;MAQa,QAAQ;IAInB;QACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACjB;CAuBF;AArBC;IACE,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE5C,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG;;QAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;KAC3D,CAAC;IAEF,GAAG,GAAG,CAAC,MAAM;QACX,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE/B,MAAM,IAAI,GAAI,KAAkB,CAAC,GAAG,EAAG,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;KAC3B,CAAC;AACJ,CAAC,GAAA;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/set-array/dist/set-array.umd.js b/node_modules/@jridgewell/set-array/dist/set-array.umd.js deleted file mode 100644 index a1c200a..0000000 --- a/node_modules/@jridgewell/set-array/dist/set-array.umd.js +++ /dev/null @@ -1,58 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.setArray = {})); -})(this, (function (exports) { 'use strict'; - - /** - * Gets the index associated with `key` in the backing array, if it is already present. - */ - exports.get = void 0; - /** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ - exports.put = void 0; - /** - * Pops the last added item out of the SetArray. - */ - exports.pop = void 0; - /** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ - class SetArray { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } - } - (() => { - exports.get = (strarr, key) => strarr._indexes[key]; - exports.put = (strarr, key) => { - // The key may or may not be present. If it is present, it's a number. - const index = exports.get(strarr, key); - if (index !== undefined) - return index; - const { array, _indexes: indexes } = strarr; - return (indexes[key] = array.push(key) - 1); - }; - exports.pop = (strarr) => { - const { array, _indexes: indexes } = strarr; - if (array.length === 0) - return; - const last = array.pop(); - indexes[last] = undefined; - }; - })(); - - exports.SetArray = SetArray; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=set-array.umd.js.map diff --git a/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map b/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map deleted file mode 100644 index 10005af..0000000 --- a/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-array.umd.js","sources":["../src/set-array.ts"],"sourcesContent":["/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n"],"names":["get","put","pop"],"mappings":";;;;;;IAAA;;;AAGWA,yBAA2D;IAEtE;;;;AAIWC,yBAA+C;IAE1D;;;AAGWC,yBAAgC;IAE3C;;;;;;;;UAQa,QAAQ;QAInB;YACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;YAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;SACjB;KAuBF;IArBC;QACEF,WAAG,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAE5CC,WAAG,GAAG,CAAC,MAAM,EAAE,GAAG;;YAEhB,MAAM,KAAK,GAAGD,WAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;YAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;SAC3D,CAAC;QAEFE,WAAG,GAAG,CAAC,MAAM;YACX,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YAE/B,MAAM,IAAI,GAAI,KAAkB,CAAC,GAAG,EAAG,CAAC;YACxC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;SAC3B,CAAC;IACJ,CAAC,GAAA;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts b/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts deleted file mode 100644 index 7ed59b9..0000000 --- a/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare let get: (strarr: SetArray, key: string) => number | undefined; -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export declare let put: (strarr: SetArray, key: string) => number; -/** - * Pops the last added item out of the SetArray. - */ -export declare let pop: (strarr: SetArray) => void; -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -export declare class SetArray { - private _indexes; - array: readonly string[]; - constructor(); -} diff --git a/node_modules/@jridgewell/set-array/package.json b/node_modules/@jridgewell/set-array/package.json deleted file mode 100644 index aec4ee0..0000000 --- a/node_modules/@jridgewell/set-array/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "@jridgewell/set-array", - "version": "1.1.2", - "description": "Like a Set, but provides the index of the `key` in the backing array", - "keywords": [], - "author": "Justin Ridgewell ", - "license": "MIT", - "repository": "https://github.com/jridgewell/set-array", - "main": "dist/set-array.umd.js", - "module": "dist/set-array.mjs", - "typings": "dist/types/set-array.d.ts", - "exports": { - ".": [ - { - "types": "./dist/types/set-array.d.ts", - "browser": "./dist/set-array.umd.js", - "require": "./dist/set-array.umd.js", - "import": "./dist/set-array.mjs" - }, - "./dist/set-array.umd.js" - ], - "./package.json": "./package.json" - }, - "files": [ - "dist", - "src" - ], - "engines": { - "node": ">=6.0.0" - }, - "scripts": { - "prebuild": "rm -rf dist", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "pretest": "run-s build:rollup", - "test": "run-s -n test:lint test:only", - "test:debug": "mocha --inspect-brk", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:coverage": "c8 mocha", - "test:watch": "mocha --watch", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build" - }, - "devDependencies": { - "@rollup/plugin-typescript": "8.3.0", - "@types/mocha": "9.1.1", - "@types/node": "17.0.29", - "@typescript-eslint/eslint-plugin": "5.10.0", - "@typescript-eslint/parser": "5.10.0", - "c8": "7.11.0", - "eslint": "8.7.0", - "eslint-config-prettier": "8.3.0", - "mocha": "9.2.0", - "npm-run-all": "4.1.5", - "prettier": "2.5.1", - "rollup": "2.66.0", - "typescript": "4.5.5" - } -} diff --git a/node_modules/@jridgewell/set-array/src/set-array.ts b/node_modules/@jridgewell/set-array/src/set-array.ts deleted file mode 100644 index f9ff604..0000000 --- a/node_modules/@jridgewell/set-array/src/set-array.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export let get: (strarr: SetArray, key: string) => number | undefined; - -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export let put: (strarr: SetArray, key: string) => number; - -/** - * Pops the last added item out of the SetArray. - */ -export let pop: (strarr: SetArray) => void; - -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -export class SetArray { - private declare _indexes: { [key: string]: number | undefined }; - declare array: readonly string[]; - - constructor() { - this._indexes = { __proto__: null } as any; - this.array = []; - } - - static { - get = (strarr, key) => strarr._indexes[key]; - - put = (strarr, key) => { - // The key may or may not be present. If it is present, it's a number. - const index = get(strarr, key); - if (index !== undefined) return index; - - const { array, _indexes: indexes } = strarr; - - return (indexes[key] = (array as string[]).push(key) - 1); - }; - - pop = (strarr) => { - const { array, _indexes: indexes } = strarr; - if (array.length === 0) return; - - const last = (array as string[]).pop()!; - indexes[last] = undefined; - }; - } -} diff --git a/node_modules/@jridgewell/source-map/LICENSE b/node_modules/@jridgewell/source-map/LICENSE deleted file mode 100644 index 0a81b2a..0000000 --- a/node_modules/@jridgewell/source-map/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2019 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/node_modules/@jridgewell/source-map/README.md b/node_modules/@jridgewell/source-map/README.md deleted file mode 100644 index cb58e33..0000000 --- a/node_modules/@jridgewell/source-map/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# @jridgewell/source-map - -> Packages `@jridgewell/trace-mapping` and `@jridgewell/gen-mapping` into the familiar source-map API - -This isn't the full API, but it's the core functionality. This wraps -[@jridgewell/trace-mapping][trace-mapping] and [@jridgewell/gen-mapping][gen-mapping] -implementations. - -## Installation - -```sh -npm install @jridgewell/source-map -``` - -## Usage - -TODO - -### SourceMapConsumer - -```typescript -import { SourceMapConsumer } from '@jridgewell/source-map'; -const smc = new SourceMapConsumer({ - version: 3, - names: ['foo'], - sources: ['input.js'], - mappings: 'AAAAA', -}); -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -```typescript -const smc = new SourceMapConsumer(map); -smc.originalPositionFor({ line: 1, column: 0 }); -``` - -### SourceMapGenerator - -```typescript -import { SourceMapGenerator } from '@jridgewell/source-map'; -const smg = new SourceMapGenerator({ - file: 'output.js', - sourceRoot: 'https://example.com/', -}); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -```typescript -const smg = new SourceMapGenerator(); -smg.addMapping({ - generated: { line: 1, column: 0 }, - source: 'input.js', - original: { line: 1, column: 0 }, - name: 'foo', -}); -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -```typescript -const smg = new SourceMapGenerator(); -smg.setSourceContent('input.js', 'foobar'); -``` - -#### SourceMapGenerator.prototype.toJSON() - -```typescript -const smg = new SourceMapGenerator(); -smg.toJSON(); // { version: 3, names: [], sources: [], mappings: '' } -``` - -#### SourceMapGenerator.prototype.toDecodedMap() - -```typescript -const smg = new SourceMapGenerator(); -smg.toDecodedMap(); // { version: 3, names: [], sources: [], mappings: [] } -``` - -[trace-mapping]: https://github.com/jridgewell/trace-mapping/ -[gen-mapping]: https://github.com/jridgewell/gen-mapping/ diff --git a/node_modules/@jridgewell/source-map/dist/source-map.mjs b/node_modules/@jridgewell/source-map/dist/source-map.mjs deleted file mode 100644 index aa1bc2c..0000000 --- a/node_modules/@jridgewell/source-map/dist/source-map.mjs +++ /dev/null @@ -1,928 +0,0 @@ -const comma = ','.charCodeAt(0); -const semicolon = ';'.charCodeAt(0); -const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -const intToChar = new Uint8Array(64); // 64 possible chars. -const charToInteger = new Uint8Array(128); // z is 122 in ASCII -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - charToInteger[c] = i; - intToChar[i] = c; -} -// Provide a fallback for older environments. -const td = typeof TextDecoder !== 'undefined' - ? new TextDecoder() - : typeof Buffer !== 'undefined' - ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - }, - } - : { - decode(buf) { - let out = ''; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - }, - }; -function decode(mappings) { - const state = new Int32Array(5); - const decoded = []; - let line = []; - let sorted = true; - let lastCol = 0; - for (let i = 0; i < mappings.length;) { - const c = mappings.charCodeAt(i); - if (c === comma) { - i++; - } - else if (c === semicolon) { - state[0] = lastCol = 0; - if (!sorted) - sort(line); - sorted = true; - decoded.push(line); - line = []; - i++; - } - else { - i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn - const col = state[0]; - if (col < lastCol) - sorted = false; - lastCol = col; - if (!hasMoreSegments(mappings, i)) { - line.push([col]); - continue; - } - i = decodeInteger(mappings, i, state, 1); // sourceFileIndex - i = decodeInteger(mappings, i, state, 2); // sourceCodeLine - i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn - if (!hasMoreSegments(mappings, i)) { - line.push([col, state[1], state[2], state[3]]); - continue; - } - i = decodeInteger(mappings, i, state, 4); // nameIndex - line.push([col, state[1], state[2], state[3], state[4]]); - } - } - if (!sorted) - sort(line); - decoded.push(line); - return decoded; -} -function decodeInteger(mappings, pos, state, j) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = mappings.charCodeAt(pos++); - integer = charToInteger[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -0x80000000 | -value; - } - state[j] += value; - return pos; -} -function hasMoreSegments(mappings, i) { - if (i >= mappings.length) - return false; - const c = mappings.charCodeAt(i); - if (c === comma || c === semicolon) - return false; - return true; -} -function sort(line) { - line.sort(sortComparator$1); -} -function sortComparator$1(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const state = new Int32Array(5); - let buf = new Uint8Array(1024); - let pos = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) { - buf = reserve(buf, pos, 1); - buf[pos++] = semicolon; - } - if (line.length === 0) - continue; - state[0] = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - // We can push up to 5 ints, each int can take at most 7 chars, and we - // may push a comma. - buf = reserve(buf, pos, 36); - if (j > 0) - buf[pos++] = comma; - pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn - if (segment.length === 1) - continue; - pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex - pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine - pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn - if (segment.length === 4) - continue; - pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex - } - } - return td.decode(buf.subarray(0, pos)); -} -function reserve(buf, pos, count) { - if (buf.length > pos + count) - return buf; - const swap = new Uint8Array(buf.length * 2); - swap.set(buf); - return swap; -} -function encodeInteger(buf, pos, state, segment, j) { - const next = segment[j]; - let num = next - state[j]; - state[j] = next; - num = num < 0 ? (-num << 1) | 1 : num << 1; - do { - let clamped = num & 0b011111; - num >>>= 5; - if (num > 0) - clamped |= 0b100000; - buf[pos++] = intToChar[clamped]; - } while (num > 0); - return pos; -} - -// Matches the scheme of a URL, eg "http://" -const schemeRegex = /^[\w+.-]+:\/\//; -/** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - */ -const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/; -/** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may inclue "/", guaranteed. - */ -const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i; -function isAbsoluteUrl(input) { - return schemeRegex.test(input); -} -function isSchemeRelativeUrl(input) { - return input.startsWith('//'); -} -function isAbsolutePath(input) { - return input.startsWith('/'); -} -function isFileUrl(input) { - return input.startsWith('file:'); -} -function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/'); -} -function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path); -} -function makeUrl(scheme, user, host, port, path) { - return { - scheme, - user, - host, - port, - path, - relativePath: false, - }; -} -function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.relativePath = true; - return url; -} -function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} -function mergePaths(url, base) { - // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is. - if (!url.relativePath) - return; - normalizePath(base); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } - // If the base path is absolute, then our path is now absolute too. - url.relativePath = base.relativePath; -} -/** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ -function normalizePath(url) { - const { relativePath } = url; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (relativePath) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; -} -/** - * Attempts to resolve `input` URL/path relative to `base`. - */ -function resolve$1(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - // If we have a base, and the input isn't already an absolute URL, then we need to merge. - if (base && !url.scheme) { - const baseUrl = parseUrl(base); - url.scheme = baseUrl.scheme; - // If there's no host, then we were just a path. - if (!url.host) { - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - } - mergePaths(url, baseUrl); - } - normalizePath(url); - // If the input (and base, if there was one) are both relative, then we need to output a relative. - if (url.relativePath) { - // The first char is always a "/". - const path = url.path.slice(1); - if (!path) - return '.'; - // If base started with a leading ".", or there is no base and input started with a ".", then we - // need to ensure that the relative path starts with a ".". We don't know if relative starts - // with a "..", though, so check before prepending. - const keepRelative = (base || input).startsWith('.'); - return !keepRelative || path.startsWith('.') ? path : './' + path; - } - // If there's no host (and no scheme/user/port), then we need to output an absolute path. - if (!url.scheme && !url.host) - return url.path; - // We're outputting either an absolute URL, or a protocol relative one. - return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`; -} - -function resolve(input, base) { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) - base += '/'; - return resolve$1(input, base); -} - -/** - * Removes everything after the last "/", but leaves the slash. - */ -function stripFilename(path) { - if (!path) - return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} - -const COLUMN$1 = 0; -const SOURCES_INDEX$1 = 1; -const SOURCE_LINE$1 = 2; -const SOURCE_COLUMN$1 = 3; -const NAMES_INDEX$1 = 4; - -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) - return mappings; - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) - mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} -function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) - return i; - } - return mappings.length; -} -function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { - return false; - } - } - return true; -} -function sortSegments(line, owned) { - if (!owned) - line = line.slice(); - return line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[COLUMN$1] - b[COLUMN$1]; -} - -let found = false; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN$1] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } - else { - high = mid - 1; - } - } - found = false; - return low - 1; -} -function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; i++, index++) { - if (haystack[i][COLUMN$1] !== needle) - break; - } - return index; -} -function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; i--, index--) { - if (haystack[i][COLUMN$1] !== needle) - break; - } - return index; -} -function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; -} -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } - else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return (state.lastIndex = binarySearch(haystack, needle, low, high)); -} - -const AnyMap = function (map, mapUrl) { - const parsed = typeof map === 'string' ? JSON.parse(map) : map; - if (!('sections' in parsed)) - return new TraceMap(parsed, mapUrl); - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const { sections } = parsed; - let i = 0; - for (; i < sections.length - 1; i++) { - const no = sections[i + 1].offset; - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); - } - if (sections.length > 0) { - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); - } - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - }; - return presortedDecodedMap(joined); -}; -function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { - const map = AnyMap(section.map, mapUrl); - const { line: lineOffset, column: columnOffset } = section.offset; - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources } = map; - append(sources, resolvedSources); - append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); - append(names, map.names); - // If this section jumps forwards several lines, we need to add lines to the output mappings catch up. - for (let i = mappings.length; i <= lineOffset; i++) - mappings.push([]); - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. - const stopI = stopLine - lineOffset; - const len = Math.min(decoded.length, stopI + 1); - for (let i = 0; i < len; i++) { - const line = decoded[i]; - // On the 0th loop, the line will already exist due to a previous section, or the line catch up - // loop above. - const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN$1]; - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (i === stopI && column >= stopColumn) - break; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX$1]; - const sourceLine = seg[SOURCE_LINE$1]; - const sourceColumn = seg[SOURCE_COLUMN$1]; - if (seg.length === 4) { - out.push([column, sourcesIndex, sourceLine, sourceColumn]); - continue; - } - out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX$1]]); - } - } -} -function append(arr, other) { - for (let i = 0; i < other.length; i++) - arr.push(other[i]); -} -// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of -// equal length to the sources. This is because the sources and sourcesContent are paired arrays, -// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined -// sourcemap would desynchronize the sources/contents. -function fillSourcesContent(len) { - const sourcesContent = []; - for (let i = 0; i < len; i++) - sourcesContent[i] = null; - return sourcesContent; -} - -const INVALID_ORIGINAL_MAPPING = Object.freeze({ - source: null, - line: null, - column: null, - name: null, -}); -Object.freeze({ - line: null, - column: null, -}); -const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; -const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; -const LEAST_UPPER_BOUND = -1; -const GREATEST_LOWER_BOUND = 1; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -let decodedMappings; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -let originalPositionFor; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -let presortedDecodedMap; -class TraceMap { - constructor(map, mapUrl) { - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - const isString = typeof map === 'string'; - if (!isString && map.constructor === TraceMap) - return map; - const parsed = (isString ? JSON.parse(map) : map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - if (sourceRoot || mapUrl) { - const from = resolve(sourceRoot || '', stripFilename(mapUrl)); - this.resolvedSources = sources.map((s) => resolve(s || '', from)); - } - else { - this.resolvedSources = sources.map((s) => s || ''); - } - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } - else { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } - } -} -(() => { - decodedMappings = (map) => { - return (map._decoded || (map._decoded = decode(map._encoded))); - }; - originalPositionFor = (map, { line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return INVALID_ORIGINAL_MAPPING; - const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); - if (segment == null) - return INVALID_ORIGINAL_MAPPING; - if (segment.length == 1) - return INVALID_ORIGINAL_MAPPING; - const { names, resolvedSources } = map; - return { - source: resolvedSources[segment[SOURCES_INDEX$1]], - line: segment[SOURCE_LINE$1] + 1, - column: segment[SOURCE_COLUMN$1], - name: segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null, - }; - }; - presortedDecodedMap = (map, mapUrl) => { - const clone = Object.assign({}, map); - clone.mappings = []; - const tracer = new TraceMap(clone, mapUrl); - tracer._decoded = map.mappings; - return tracer; - }; -})(); -function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } - else if (bias === LEAST_UPPER_BOUND) - index++; - if (index === -1 || index === segments.length) - return null; - return segments[index]; -} - -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -let get; -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -let put; -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -class SetArray { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -} -(() => { - get = (strarr, key) => strarr._indexes[key]; - put = (strarr, key) => { - // The key may or may not be present. If it is present, it's a number. - const index = get(strarr, key); - if (index !== undefined) - return index; - const { array, _indexes: indexes } = strarr; - return (indexes[key] = array.push(key) - 1); - }; -})(); - -const COLUMN = 0; -const SOURCES_INDEX = 1; -const SOURCE_LINE = 2; -const SOURCE_COLUMN = 3; -const NAMES_INDEX = 4; - -const NO_NAME = -1; -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -let maybeAddMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -let setSourceContent; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let toDecodedMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let toEncodedMap; -// This split declaration is only so that terser can elminiate the static initialization block. -let addSegmentInternal; -/** - * Provides the state to generate a sourcemap. - */ -class GenMapping { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - } -} -(() => { - maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); - }; - setSourceContent = (map, source, content) => { - const { _sources: sources, _sourcesContent: sourcesContent } = map; - sourcesContent[put(sources, source)] = content; - }; - toDecodedMap = (map) => { - const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - removeEmptyFinalLines(mappings); - return { - version: 3, - file: file || undefined, - names: names.array, - sourceRoot: sourceRoot || undefined, - sources: sources.array, - sourcesContent, - mappings, - }; - }; - toEncodedMap = (map) => { - const decoded = toDecodedMap(map); - return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); - }; - // Internal helpers - addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { - const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - const line = getLine(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) - return; - return insert(line, index, [genColumn]); - } - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) - sourcesContent[sourcesIndex] = null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert(line, index, name - ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] - : [genColumn, sourcesIndex, sourceLine, sourceColumn]); - }; -})(); -function getLine(mappings, index) { - for (let i = mappings.length; i <= index; i++) { - mappings[i] = []; - } - return mappings[index]; -} -function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) - break; - } - return index; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) - break; - } - if (len < length) - mappings.length = len; -} -function skipSourceless(line, index) { - // The start of a line is already sourceless, so adding a sourceless segment to the beginning - // doesn't generate any useful information. - if (index === 0) - return true; - const prev = line[index - 1]; - // If the previous segment is also sourceless, then adding another sourceless segment doesn't - // genrate any new information. Else, this segment will end the source/named segment and point to - // a sourceless position, which is useful. - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - // A source/named segment at the start of a line gives position at that genColumn - if (index === 0) - return false; - const prev = line[index - 1]; - // If the previous segment is sourceless, then we're transitioning to a source. - if (prev.length === 1) - return false; - // If the previous segment maps to the exact same source position, then this segment doesn't - // provide any new position information. - return (sourcesIndex === prev[SOURCES_INDEX] && - sourceLine === prev[SOURCE_LINE] && - sourceColumn === prev[SOURCE_COLUMN] && - namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); -} -function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name } = mapping; - if (!source) { - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null); - } - const s = source; - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name); -} - -class SourceMapConsumer { - constructor(map, mapUrl) { - const trace = (this._map = new AnyMap(map, mapUrl)); - this.file = trace.file; - this.names = trace.names; - this.sourceRoot = trace.sourceRoot; - this.sources = trace.resolvedSources; - this.sourcesContent = trace.sourcesContent; - } - originalPositionFor(needle) { - return originalPositionFor(this._map, needle); - } - destroy() { - // noop. - } -} -class SourceMapGenerator { - constructor(opts) { - this._map = new GenMapping(opts); - } - addMapping(mapping) { - maybeAddMapping(this._map, mapping); - } - setSourceContent(source, content) { - setSourceContent(this._map, source, content); - } - toJSON() { - return toEncodedMap(this._map); - } - toDecodedMap() { - return toDecodedMap(this._map); - } -} - -export { SourceMapConsumer, SourceMapGenerator }; -//# sourceMappingURL=source-map.mjs.map diff --git a/node_modules/@jridgewell/source-map/dist/source-map.mjs.map b/node_modules/@jridgewell/source-map/dist/source-map.mjs.map deleted file mode 100644 index 82b6484..0000000 --- a/node_modules/@jridgewell/source-map/dist/source-map.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source-map.mjs","sources":["../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../node_modules/@jridgewell/set-array/dist/set-array.mjs","../node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs","../../src/source-map.ts"],"sourcesContent":["const comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInteger = new Uint8Array(128); // z is 122 in ASCII\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n charToInteger[c] = i;\n intToChar[i] = c;\n}\n// Provide a fallback for older environments.\nconst td = typeof TextDecoder !== 'undefined'\n ? new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\nfunction decode(mappings) {\n const state = new Int32Array(5);\n const decoded = [];\n let line = [];\n let sorted = true;\n let lastCol = 0;\n for (let i = 0; i < mappings.length;) {\n const c = mappings.charCodeAt(i);\n if (c === comma) {\n i++;\n }\n else if (c === semicolon) {\n state[0] = lastCol = 0;\n if (!sorted)\n sort(line);\n sorted = true;\n decoded.push(line);\n line = [];\n i++;\n }\n else {\n i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn\n const col = state[0];\n if (col < lastCol)\n sorted = false;\n lastCol = col;\n if (!hasMoreSegments(mappings, i)) {\n line.push([col]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 1); // sourceFileIndex\n i = decodeInteger(mappings, i, state, 2); // sourceCodeLine\n i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn\n if (!hasMoreSegments(mappings, i)) {\n line.push([col, state[1], state[2], state[3]]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 4); // nameIndex\n line.push([col, state[1], state[2], state[3], state[4]]);\n }\n }\n if (!sorted)\n sort(line);\n decoded.push(line);\n return decoded;\n}\nfunction decodeInteger(mappings, pos, state, j) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInteger[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n state[j] += value;\n return pos;\n}\nfunction hasMoreSegments(mappings, i) {\n if (i >= mappings.length)\n return false;\n const c = mappings.charCodeAt(i);\n if (c === comma || c === semicolon)\n return false;\n return true;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const state = new Int32Array(5);\n let buf = new Uint8Array(1024);\n let pos = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n buf = reserve(buf, pos, 1);\n buf[pos++] = semicolon;\n }\n if (line.length === 0)\n continue;\n state[0] = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n buf = reserve(buf, pos, 36);\n if (j > 0)\n buf[pos++] = comma;\n pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn\n if (segment.length === 1)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn\n if (segment.length === 4)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex\n }\n }\n return td.decode(buf.subarray(0, pos));\n}\nfunction reserve(buf, pos, count) {\n if (buf.length > pos + count)\n return buf;\n const swap = new Uint8Array(buf.length * 2);\n swap.set(buf);\n return swap;\n}\nfunction encodeInteger(buf, pos, state, segment, j) {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0)\n clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n return pos;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?/;\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may inclue \"/\", guaranteed.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/]*)?)?(\\/?.*)/i;\nfunction isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n}\nfunction isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n}\nfunction isAbsolutePath(input) {\n return input.startsWith('/');\n}\nfunction isFileUrl(input) {\n return input.startsWith('file:');\n}\nfunction parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/');\n}\nfunction parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path);\n}\nfunction makeUrl(scheme, user, host, port, path) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n relativePath: false,\n };\n}\nfunction parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.relativePath = true;\n return url;\n}\nfunction stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\nfunction mergePaths(url, base) {\n // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is.\n if (!url.relativePath)\n return;\n normalizePath(base);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n // If the base path is absolute, then our path is now absolute too.\n url.relativePath = base.relativePath;\n}\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url) {\n const { relativePath } = url;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (relativePath) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nfunction resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n // If we have a base, and the input isn't already an absolute URL, then we need to merge.\n if (base && !url.scheme) {\n const baseUrl = parseUrl(base);\n url.scheme = baseUrl.scheme;\n // If there's no host, then we were just a path.\n if (!url.host) {\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n }\n mergePaths(url, baseUrl);\n }\n normalizePath(url);\n // If the input (and base, if there was one) are both relative, then we need to output a relative.\n if (url.relativePath) {\n // The first char is always a \"/\".\n const path = url.path.slice(1);\n if (!path)\n return '.';\n // If base started with a leading \".\", or there is no base and input started with a \".\", then we\n // need to ensure that the relative path starts with a \".\". We don't know if relative starts\n // with a \"..\", though, so check before prepending.\n const keepRelative = (base || input).startsWith('.');\n return !keepRelative || path.startsWith('.') ? path : './' + path;\n }\n // If there's no host (and no scheme/user/port), then we need to output an absolute path.\n if (!url.scheme && !url.host)\n return url.path;\n // We're outputting either an absolute URL, or a protocol relative one.\n return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`;\n}\n\nexport { resolve as default };\n//# sourceMappingURL=resolve-uri.mjs.map\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\nimport resolveUri from '@jridgewell/resolve-uri';\n\nfunction resolve(input, base) {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/'))\n base += '/';\n return resolveUri(input, base);\n}\n\n/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nfunction stripFilename(path) {\n if (!path)\n return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\nconst REV_GENERATED_LINE = 1;\nconst REV_GENERATED_COLUMN = 2;\n\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length)\n return mappings;\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned)\n mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i]))\n return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned)\n line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\nlet found = false;\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n }\n else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; i++, index++) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; i--, index--) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n }\n else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(buildNullArray);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1)\n continue;\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = []));\n const memo = memos[sourceIndex];\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine));\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n return sources;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray() {\n return { __proto__: null };\n}\n\nconst AnyMap = function (map, mapUrl) {\n const parsed = typeof map === 'string' ? JSON.parse(map) : map;\n if (!('sections' in parsed))\n return new TraceMap(parsed, mapUrl);\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const { sections } = parsed;\n let i = 0;\n for (; i < sections.length - 1; i++) {\n const no = sections[i + 1].offset;\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column);\n }\n if (sections.length > 0) {\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity);\n }\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n return presortedDecodedMap(joined);\n};\nfunction addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) {\n const map = AnyMap(section.map, mapUrl);\n const { line: lineOffset, column: columnOffset } = section.offset;\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources } = map;\n append(sources, resolvedSources);\n append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length));\n append(names, map.names);\n // If this section jumps forwards several lines, we need to add lines to the output mappings catch up.\n for (let i = mappings.length; i <= lineOffset; i++)\n mappings.push([]);\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range.\n const stopI = stopLine - lineOffset;\n const len = Math.min(decoded.length, stopI + 1);\n for (let i = 0; i < len; i++) {\n const line = decoded[i];\n // On the 0th loop, the line will already exist due to a previous section, or the line catch up\n // loop above.\n const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (i === stopI && column >= stopColumn)\n break;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n if (seg.length === 4) {\n out.push([column, sourcesIndex, sourceLine, sourceColumn]);\n continue;\n }\n out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]);\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++)\n arr.push(other[i]);\n}\n// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of\n// equal length to the sources. This is because the sources and sourcesContent are paired arrays,\n// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined\n// sourcemap would desynchronize the sources/contents.\nfunction fillSourcesContent(len) {\n const sourcesContent = [];\n for (let i = 0; i < len; i++)\n sourcesContent[i] = null;\n return sourcesContent;\n}\n\nconst INVALID_ORIGINAL_MAPPING = Object.freeze({\n source: null,\n line: null,\n column: null,\n name: null,\n});\nconst INVALID_GENERATED_MAPPING = Object.freeze({\n line: null,\n column: null,\n});\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\nconst LEAST_UPPER_BOUND = -1;\nconst GREATEST_LOWER_BOUND = 1;\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nlet encodedMappings;\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nlet decodedMappings;\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nlet traceSegment;\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nlet originalPositionFor;\n/**\n * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided\n * the found mapping is from the same source and line as the originalPositionFor mapping.\n *\n * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1`\n * using the same needle that would return `id` when calling `originalPositionFor`.\n */\nlet generatedPositionFor;\n/**\n * Iterates each mapping in generated position order.\n */\nlet eachMapping;\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nlet presortedDecodedMap;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet decodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet encodedMap;\nclass TraceMap {\n constructor(map, mapUrl) {\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n const isString = typeof map === 'string';\n if (!isString && map.constructor === TraceMap)\n return map;\n const parsed = (isString ? JSON.parse(map) : map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n if (sourceRoot || mapUrl) {\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n }\n else {\n this.resolvedSources = sources.map((s) => s || '');\n }\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n }\n else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n }\n}\n(() => {\n encodedMappings = (map) => {\n var _a;\n return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded)));\n };\n decodedMappings = (map) => {\n return (map._decoded || (map._decoded = decode(map._encoded)));\n };\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return null;\n return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND);\n };\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return INVALID_ORIGINAL_MAPPING;\n const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_ORIGINAL_MAPPING;\n if (segment.length == 1)\n return INVALID_ORIGINAL_MAPPING;\n const { names, resolvedSources } = map;\n return {\n source: resolvedSources[segment[SOURCES_INDEX]],\n line: segment[SOURCE_LINE] + 1,\n column: segment[SOURCE_COLUMN],\n name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n };\n };\n generatedPositionFor = (map, { source, line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1)\n sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1)\n return INVALID_GENERATED_MAPPING;\n const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState)))));\n const memos = map._bySourceMemos;\n const segments = generated[sourceIndex][line];\n if (segments == null)\n return INVALID_GENERATED_MAPPING;\n const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_GENERATED_MAPPING;\n return {\n line: segment[REV_GENERATED_LINE] + 1,\n column: segment[REV_GENERATED_COLUMN],\n };\n };\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5)\n name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n });\n }\n }\n };\n presortedDecodedMap = (map, mapUrl) => {\n const clone = Object.assign({}, map);\n clone.mappings = [];\n const tracer = new TraceMap(clone, mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n decodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: decodedMappings(map),\n };\n };\n encodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: encodedMappings(map),\n };\n };\n})();\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n }\n else if (bias === LEAST_UPPER_BOUND)\n index++;\n if (index === -1 || index === segments.length)\n return null;\n return segments[index];\n}\n\nexport { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, traceSegment };\n//# sourceMappingURL=trace-mapping.mjs.map\n","/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nlet get;\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nlet put;\n/**\n * Pops the last added item out of the SetArray.\n */\nlet pop;\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nclass SetArray {\n constructor() {\n this._indexes = { __proto__: null };\n this.array = [];\n }\n}\n(() => {\n get = (strarr, key) => strarr._indexes[key];\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined)\n return index;\n const { array, _indexes: indexes } = strarr;\n return (indexes[key] = array.push(key) - 1);\n };\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0)\n return;\n const last = array.pop();\n indexes[last] = undefined;\n };\n})();\n\nexport { SetArray, get, pop, put };\n//# sourceMappingURL=set-array.mjs.map\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\n\nconst NO_NAME = -1;\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nlet addSegment;\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nlet addMapping;\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nlet maybeAddSegment;\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nlet maybeAddMapping;\n/**\n * Adds/removes the content of the source file to the source map.\n */\nlet setSourceContent;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toDecodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toEncodedMap;\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nlet fromMap;\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nlet allMappings;\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal;\n/**\n * Provides the state to generate a sourcemap.\n */\nclass GenMapping {\n constructor({ file, sourceRoot } = {}) {\n this._names = new SetArray();\n this._sources = new SetArray();\n this._sourcesContent = [];\n this._mappings = [];\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n}\n(() => {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping);\n };\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping);\n };\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n toDecodedMap = (map) => {\n const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n removeEmptyFinalLines(mappings);\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });\n };\n allMappings = (map) => {\n const out = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source = undefined;\n let original = undefined;\n let name = undefined;\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n if (seg.length === 5)\n name = names.array[seg[NAMES_INDEX]];\n }\n out.push({ generated, source, original, name });\n }\n }\n return out;\n };\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map);\n return gen;\n };\n // Internal helpers\n addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n if (!source) {\n if (skipable && skipSourceless(line, index))\n return;\n return insert(line, index, [genColumn]);\n }\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length)\n sourcesContent[sourcesIndex] = null;\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n return insert(line, index, name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn]);\n };\n})();\nfunction getLine(mappings, index) {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\nfunction getColumnIndex(line, genColumn) {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN])\n break;\n }\n return index;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\nfunction removeEmptyFinalLines(mappings) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0)\n break;\n }\n if (len < length)\n mappings.length = len;\n}\nfunction putAll(strarr, array) {\n for (let i = 0; i < array.length; i++)\n put(strarr, array[i]);\n}\nfunction skipSourceless(line, index) {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0)\n return true;\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\nfunction skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0)\n return false;\n const prev = line[index - 1];\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1)\n return false;\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));\n}\nfunction addMappingInternal(skipable, map, mapping) {\n const { generated, source, original, name } = mapping;\n if (!source) {\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null);\n }\n const s = source;\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name);\n}\n\nexport { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap };\n//# sourceMappingURL=gen-mapping.mjs.map\n","import { AnyMap, originalPositionFor } from '@jridgewell/trace-mapping';\nimport {\n GenMapping,\n maybeAddMapping,\n toDecodedMap,\n toEncodedMap,\n setSourceContent,\n} from '@jridgewell/gen-mapping';\n\nimport type { TraceMap, SectionedSourceMapInput } from '@jridgewell/trace-mapping';\nexport type { TraceMap, SectionedSourceMapInput };\n\nimport type { Mapping, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/gen-mapping';\nexport type { Mapping, EncodedSourceMap, DecodedSourceMap };\n\nexport class SourceMapConsumer {\n private declare _map: TraceMap;\n declare file: TraceMap['file'];\n declare names: TraceMap['names'];\n declare sourceRoot: TraceMap['sourceRoot'];\n declare sources: TraceMap['sources'];\n declare sourcesContent: TraceMap['sourcesContent'];\n\n constructor(map: ConstructorParameters[0], mapUrl: Parameters[1]) {\n const trace = (this._map = new AnyMap(map, mapUrl));\n\n this.file = trace.file;\n this.names = trace.names;\n this.sourceRoot = trace.sourceRoot;\n this.sources = trace.resolvedSources;\n this.sourcesContent = trace.sourcesContent;\n }\n\n originalPositionFor(\n needle: Parameters[1],\n ): ReturnType {\n return originalPositionFor(this._map, needle);\n }\n\n destroy() {\n // noop.\n }\n}\n\nexport class SourceMapGenerator {\n private declare _map: GenMapping;\n\n constructor(opts: ConstructorParameters[0]) {\n this._map = new GenMapping(opts);\n }\n\n addMapping(mapping: Parameters[1]): ReturnType {\n maybeAddMapping(this._map, mapping);\n }\n\n setSourceContent(\n source: Parameters[1],\n content: Parameters[2],\n ): ReturnType {\n setSourceContent(this._map, source, content);\n }\n\n toJSON(): ReturnType {\n return toEncodedMap(this._map);\n }\n\n toDecodedMap(): ReturnType {\n return toDecodedMap(this._map);\n }\n}\n"],"names":["sortComparator","resolve","resolveUri","COLUMN","SOURCES_INDEX","SOURCE_LINE","SOURCE_COLUMN","NAMES_INDEX"],"mappings":"AAAA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACrC,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAClC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACzB,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AACD;AACA,MAAM,EAAE,GAAG,OAAO,WAAW,KAAK,WAAW;AAC7C,MAAM,IAAI,WAAW,EAAE;AACvB,MAAM,OAAO,MAAM,KAAK,WAAW;AACnC,UAAU;AACV,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AEjD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC/C;IAED,OAAO;;KAEN;CACF;MAEY,kBAAkB;IAG7B,YAAY,IAAiD;QAC3D,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;KAClC;IAED,UAAU,CAAC,OAA8C;QACvD,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACrC;IAED,gBAAgB,CACd,MAA8C,EAC9C,OAA+C;QAE/C,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9C;IAED,MAAM;QACJ,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;IAED,YAAY;QACV,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/source-map/dist/source-map.umd.js b/node_modules/@jridgewell/source-map/dist/source-map.umd.js deleted file mode 100644 index 77ec63b..0000000 --- a/node_modules/@jridgewell/source-map/dist/source-map.umd.js +++ /dev/null @@ -1,939 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sourceMap = {})); -})(this, (function (exports) { 'use strict'; - - const comma = ','.charCodeAt(0); - const semicolon = ';'.charCodeAt(0); - const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - const intToChar = new Uint8Array(64); // 64 possible chars. - const charToInteger = new Uint8Array(128); // z is 122 in ASCII - for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - charToInteger[c] = i; - intToChar[i] = c; - } - // Provide a fallback for older environments. - const td = typeof TextDecoder !== 'undefined' - ? new TextDecoder() - : typeof Buffer !== 'undefined' - ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - }, - } - : { - decode(buf) { - let out = ''; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - }, - }; - function decode(mappings) { - const state = new Int32Array(5); - const decoded = []; - let line = []; - let sorted = true; - let lastCol = 0; - for (let i = 0; i < mappings.length;) { - const c = mappings.charCodeAt(i); - if (c === comma) { - i++; - } - else if (c === semicolon) { - state[0] = lastCol = 0; - if (!sorted) - sort(line); - sorted = true; - decoded.push(line); - line = []; - i++; - } - else { - i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn - const col = state[0]; - if (col < lastCol) - sorted = false; - lastCol = col; - if (!hasMoreSegments(mappings, i)) { - line.push([col]); - continue; - } - i = decodeInteger(mappings, i, state, 1); // sourceFileIndex - i = decodeInteger(mappings, i, state, 2); // sourceCodeLine - i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn - if (!hasMoreSegments(mappings, i)) { - line.push([col, state[1], state[2], state[3]]); - continue; - } - i = decodeInteger(mappings, i, state, 4); // nameIndex - line.push([col, state[1], state[2], state[3], state[4]]); - } - } - if (!sorted) - sort(line); - decoded.push(line); - return decoded; - } - function decodeInteger(mappings, pos, state, j) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = mappings.charCodeAt(pos++); - integer = charToInteger[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -0x80000000 | -value; - } - state[j] += value; - return pos; - } - function hasMoreSegments(mappings, i) { - if (i >= mappings.length) - return false; - const c = mappings.charCodeAt(i); - if (c === comma || c === semicolon) - return false; - return true; - } - function sort(line) { - line.sort(sortComparator$1); - } - function sortComparator$1(a, b) { - return a[0] - b[0]; - } - function encode(decoded) { - const state = new Int32Array(5); - let buf = new Uint8Array(1024); - let pos = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) { - buf = reserve(buf, pos, 1); - buf[pos++] = semicolon; - } - if (line.length === 0) - continue; - state[0] = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - // We can push up to 5 ints, each int can take at most 7 chars, and we - // may push a comma. - buf = reserve(buf, pos, 36); - if (j > 0) - buf[pos++] = comma; - pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn - if (segment.length === 1) - continue; - pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex - pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine - pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn - if (segment.length === 4) - continue; - pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex - } - } - return td.decode(buf.subarray(0, pos)); - } - function reserve(buf, pos, count) { - if (buf.length > pos + count) - return buf; - const swap = new Uint8Array(buf.length * 2); - swap.set(buf); - return swap; - } - function encodeInteger(buf, pos, state, segment, j) { - const next = segment[j]; - let num = next - state[j]; - state[j] = next; - num = num < 0 ? (-num << 1) | 1 : num << 1; - do { - let clamped = num & 0b011111; - num >>>= 5; - if (num > 0) - clamped |= 0b100000; - buf[pos++] = intToChar[clamped]; - } while (num > 0); - return pos; - } - - // Matches the scheme of a URL, eg "http://" - const schemeRegex = /^[\w+.-]+:\/\//; - /** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - */ - const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/; - /** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may inclue "/", guaranteed. - */ - const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i; - function isAbsoluteUrl(input) { - return schemeRegex.test(input); - } - function isSchemeRelativeUrl(input) { - return input.startsWith('//'); - } - function isAbsolutePath(input) { - return input.startsWith('/'); - } - function isFileUrl(input) { - return input.startsWith('file:'); - } - function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/'); - } - function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path); - } - function makeUrl(scheme, user, host, port, path) { - return { - scheme, - user, - host, - port, - path, - relativePath: false, - }; - } - function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.relativePath = true; - return url; - } - function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - function mergePaths(url, base) { - // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is. - if (!url.relativePath) - return; - normalizePath(base); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } - // If the base path is absolute, then our path is now absolute too. - url.relativePath = base.relativePath; - } - /** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ - function normalizePath(url) { - const { relativePath } = url; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (relativePath) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; - } - /** - * Attempts to resolve `input` URL/path relative to `base`. - */ - function resolve$1(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - // If we have a base, and the input isn't already an absolute URL, then we need to merge. - if (base && !url.scheme) { - const baseUrl = parseUrl(base); - url.scheme = baseUrl.scheme; - // If there's no host, then we were just a path. - if (!url.host) { - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - } - mergePaths(url, baseUrl); - } - normalizePath(url); - // If the input (and base, if there was one) are both relative, then we need to output a relative. - if (url.relativePath) { - // The first char is always a "/". - const path = url.path.slice(1); - if (!path) - return '.'; - // If base started with a leading ".", or there is no base and input started with a ".", then we - // need to ensure that the relative path starts with a ".". We don't know if relative starts - // with a "..", though, so check before prepending. - const keepRelative = (base || input).startsWith('.'); - return !keepRelative || path.startsWith('.') ? path : './' + path; - } - // If there's no host (and no scheme/user/port), then we need to output an absolute path. - if (!url.scheme && !url.host) - return url.path; - // We're outputting either an absolute URL, or a protocol relative one. - return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`; - } - - function resolve(input, base) { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) - base += '/'; - return resolve$1(input, base); - } - - /** - * Removes everything after the last "/", but leaves the slash. - */ - function stripFilename(path) { - if (!path) - return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - - const COLUMN$1 = 0; - const SOURCES_INDEX$1 = 1; - const SOURCE_LINE$1 = 2; - const SOURCE_COLUMN$1 = 3; - const NAMES_INDEX$1 = 4; - - function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) - return mappings; - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) - mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; - } - function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) - return i; - } - return mappings.length; - } - function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { - return false; - } - } - return true; - } - function sortSegments(line, owned) { - if (!owned) - line = line.slice(); - return line.sort(sortComparator); - } - function sortComparator(a, b) { - return a[COLUMN$1] - b[COLUMN$1]; - } - - let found = false; - /** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ - function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN$1] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } - else { - high = mid - 1; - } - } - found = false; - return low - 1; - } - function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; i++, index++) { - if (haystack[i][COLUMN$1] !== needle) - break; - } - return index; - } - function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; i--, index--) { - if (haystack[i][COLUMN$1] !== needle) - break; - } - return index; - } - function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; - } - /** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ - function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } - else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return (state.lastIndex = binarySearch(haystack, needle, low, high)); - } - - const AnyMap = function (map, mapUrl) { - const parsed = typeof map === 'string' ? JSON.parse(map) : map; - if (!('sections' in parsed)) - return new TraceMap(parsed, mapUrl); - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const { sections } = parsed; - let i = 0; - for (; i < sections.length - 1; i++) { - const no = sections[i + 1].offset; - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); - } - if (sections.length > 0) { - addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); - } - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - }; - return presortedDecodedMap(joined); - }; - function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { - const map = AnyMap(section.map, mapUrl); - const { line: lineOffset, column: columnOffset } = section.offset; - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources } = map; - append(sources, resolvedSources); - append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); - append(names, map.names); - // If this section jumps forwards several lines, we need to add lines to the output mappings catch up. - for (let i = mappings.length; i <= lineOffset; i++) - mappings.push([]); - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. - const stopI = stopLine - lineOffset; - const len = Math.min(decoded.length, stopI + 1); - for (let i = 0; i < len; i++) { - const line = decoded[i]; - // On the 0th loop, the line will already exist due to a previous section, or the line catch up - // loop above. - const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN$1]; - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (i === stopI && column >= stopColumn) - break; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX$1]; - const sourceLine = seg[SOURCE_LINE$1]; - const sourceColumn = seg[SOURCE_COLUMN$1]; - if (seg.length === 4) { - out.push([column, sourcesIndex, sourceLine, sourceColumn]); - continue; - } - out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX$1]]); - } - } - } - function append(arr, other) { - for (let i = 0; i < other.length; i++) - arr.push(other[i]); - } - // Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of - // equal length to the sources. This is because the sources and sourcesContent are paired arrays, - // where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined - // sourcemap would desynchronize the sources/contents. - function fillSourcesContent(len) { - const sourcesContent = []; - for (let i = 0; i < len; i++) - sourcesContent[i] = null; - return sourcesContent; - } - - const INVALID_ORIGINAL_MAPPING = Object.freeze({ - source: null, - line: null, - column: null, - name: null, - }); - Object.freeze({ - line: null, - column: null, - }); - const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; - const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; - const LEAST_UPPER_BOUND = -1; - const GREATEST_LOWER_BOUND = 1; - /** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ - let decodedMappings; - /** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ - let originalPositionFor; - /** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ - let presortedDecodedMap; - class TraceMap { - constructor(map, mapUrl) { - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - const isString = typeof map === 'string'; - if (!isString && map.constructor === TraceMap) - return map; - const parsed = (isString ? JSON.parse(map) : map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - if (sourceRoot || mapUrl) { - const from = resolve(sourceRoot || '', stripFilename(mapUrl)); - this.resolvedSources = sources.map((s) => resolve(s || '', from)); - } - else { - this.resolvedSources = sources.map((s) => s || ''); - } - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } - else { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } - } - } - (() => { - decodedMappings = (map) => { - return (map._decoded || (map._decoded = decode(map._encoded))); - }; - originalPositionFor = (map, { line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return INVALID_ORIGINAL_MAPPING; - const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); - if (segment == null) - return INVALID_ORIGINAL_MAPPING; - if (segment.length == 1) - return INVALID_ORIGINAL_MAPPING; - const { names, resolvedSources } = map; - return { - source: resolvedSources[segment[SOURCES_INDEX$1]], - line: segment[SOURCE_LINE$1] + 1, - column: segment[SOURCE_COLUMN$1], - name: segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null, - }; - }; - presortedDecodedMap = (map, mapUrl) => { - const clone = Object.assign({}, map); - clone.mappings = []; - const tracer = new TraceMap(clone, mapUrl); - tracer._decoded = map.mappings; - return tracer; - }; - })(); - function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } - else if (bias === LEAST_UPPER_BOUND) - index++; - if (index === -1 || index === segments.length) - return null; - return segments[index]; - } - - /** - * Gets the index associated with `key` in the backing array, if it is already present. - */ - let get; - /** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ - let put; - /** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ - class SetArray { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } - } - (() => { - get = (strarr, key) => strarr._indexes[key]; - put = (strarr, key) => { - // The key may or may not be present. If it is present, it's a number. - const index = get(strarr, key); - if (index !== undefined) - return index; - const { array, _indexes: indexes } = strarr; - return (indexes[key] = array.push(key) - 1); - }; - })(); - - const COLUMN = 0; - const SOURCES_INDEX = 1; - const SOURCE_LINE = 2; - const SOURCE_COLUMN = 3; - const NAMES_INDEX = 4; - - const NO_NAME = -1; - /** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ - let maybeAddMapping; - /** - * Adds/removes the content of the source file to the source map. - */ - let setSourceContent; - /** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - let toDecodedMap; - /** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - let toEncodedMap; - // This split declaration is only so that terser can elminiate the static initialization block. - let addSegmentInternal; - /** - * Provides the state to generate a sourcemap. - */ - class GenMapping { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - } - } - (() => { - maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); - }; - setSourceContent = (map, source, content) => { - const { _sources: sources, _sourcesContent: sourcesContent } = map; - sourcesContent[put(sources, source)] = content; - }; - toDecodedMap = (map) => { - const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - removeEmptyFinalLines(mappings); - return { - version: 3, - file: file || undefined, - names: names.array, - sourceRoot: sourceRoot || undefined, - sources: sources.array, - sourcesContent, - mappings, - }; - }; - toEncodedMap = (map) => { - const decoded = toDecodedMap(map); - return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); - }; - // Internal helpers - addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { - const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; - const line = getLine(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) - return; - return insert(line, index, [genColumn]); - } - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) - sourcesContent[sourcesIndex] = null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert(line, index, name - ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] - : [genColumn, sourcesIndex, sourceLine, sourceColumn]); - }; - })(); - function getLine(mappings, index) { - for (let i = mappings.length; i <= index; i++) { - mappings[i] = []; - } - return mappings[index]; - } - function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) - break; - } - return index; - } - function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; - } - function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) - break; - } - if (len < length) - mappings.length = len; - } - function skipSourceless(line, index) { - // The start of a line is already sourceless, so adding a sourceless segment to the beginning - // doesn't generate any useful information. - if (index === 0) - return true; - const prev = line[index - 1]; - // If the previous segment is also sourceless, then adding another sourceless segment doesn't - // genrate any new information. Else, this segment will end the source/named segment and point to - // a sourceless position, which is useful. - return prev.length === 1; - } - function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - // A source/named segment at the start of a line gives position at that genColumn - if (index === 0) - return false; - const prev = line[index - 1]; - // If the previous segment is sourceless, then we're transitioning to a source. - if (prev.length === 1) - return false; - // If the previous segment maps to the exact same source position, then this segment doesn't - // provide any new position information. - return (sourcesIndex === prev[SOURCES_INDEX] && - sourceLine === prev[SOURCE_LINE] && - sourceColumn === prev[SOURCE_COLUMN] && - namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); - } - function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name } = mapping; - if (!source) { - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null); - } - const s = source; - return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name); - } - - class SourceMapConsumer { - constructor(map, mapUrl) { - const trace = (this._map = new AnyMap(map, mapUrl)); - this.file = trace.file; - this.names = trace.names; - this.sourceRoot = trace.sourceRoot; - this.sources = trace.resolvedSources; - this.sourcesContent = trace.sourcesContent; - } - originalPositionFor(needle) { - return originalPositionFor(this._map, needle); - } - destroy() { - // noop. - } - } - class SourceMapGenerator { - constructor(opts) { - this._map = new GenMapping(opts); - } - addMapping(mapping) { - maybeAddMapping(this._map, mapping); - } - setSourceContent(source, content) { - setSourceContent(this._map, source, content); - } - toJSON() { - return toEncodedMap(this._map); - } - toDecodedMap() { - return toDecodedMap(this._map); - } - } - - exports.SourceMapConsumer = SourceMapConsumer; - exports.SourceMapGenerator = SourceMapGenerator; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=source-map.umd.js.map diff --git a/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map b/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map deleted file mode 100644 index 358767e..0000000 --- a/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source-map.umd.js","sources":["../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../node_modules/@jridgewell/set-array/dist/set-array.mjs","../node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs","../../src/source-map.ts"],"sourcesContent":["const comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInteger = new Uint8Array(128); // z is 122 in ASCII\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n charToInteger[c] = i;\n intToChar[i] = c;\n}\n// Provide a fallback for older environments.\nconst td = typeof TextDecoder !== 'undefined'\n ? new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\nfunction decode(mappings) {\n const state = new Int32Array(5);\n const decoded = [];\n let line = [];\n let sorted = true;\n let lastCol = 0;\n for (let i = 0; i < mappings.length;) {\n const c = mappings.charCodeAt(i);\n if (c === comma) {\n i++;\n }\n else if (c === semicolon) {\n state[0] = lastCol = 0;\n if (!sorted)\n sort(line);\n sorted = true;\n decoded.push(line);\n line = [];\n i++;\n }\n else {\n i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn\n const col = state[0];\n if (col < lastCol)\n sorted = false;\n lastCol = col;\n if (!hasMoreSegments(mappings, i)) {\n line.push([col]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 1); // sourceFileIndex\n i = decodeInteger(mappings, i, state, 2); // sourceCodeLine\n i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn\n if (!hasMoreSegments(mappings, i)) {\n line.push([col, state[1], state[2], state[3]]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 4); // nameIndex\n line.push([col, state[1], state[2], state[3], state[4]]);\n }\n }\n if (!sorted)\n sort(line);\n decoded.push(line);\n return decoded;\n}\nfunction decodeInteger(mappings, pos, state, j) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInteger[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n state[j] += value;\n return pos;\n}\nfunction hasMoreSegments(mappings, i) {\n if (i >= mappings.length)\n return false;\n const c = mappings.charCodeAt(i);\n if (c === comma || c === semicolon)\n return false;\n return true;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const state = new Int32Array(5);\n let buf = new Uint8Array(1024);\n let pos = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n buf = reserve(buf, pos, 1);\n buf[pos++] = semicolon;\n }\n if (line.length === 0)\n continue;\n state[0] = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n buf = reserve(buf, pos, 36);\n if (j > 0)\n buf[pos++] = comma;\n pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn\n if (segment.length === 1)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn\n if (segment.length === 4)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex\n }\n }\n return td.decode(buf.subarray(0, pos));\n}\nfunction reserve(buf, pos, count) {\n if (buf.length > pos + count)\n return buf;\n const swap = new Uint8Array(buf.length * 2);\n swap.set(buf);\n return swap;\n}\nfunction encodeInteger(buf, pos, state, segment, j) {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0)\n clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n return pos;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?/;\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may inclue \"/\", guaranteed.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/]*)?)?(\\/?.*)/i;\nfunction isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n}\nfunction isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n}\nfunction isAbsolutePath(input) {\n return input.startsWith('/');\n}\nfunction isFileUrl(input) {\n return input.startsWith('file:');\n}\nfunction parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/');\n}\nfunction parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path);\n}\nfunction makeUrl(scheme, user, host, port, path) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n relativePath: false,\n };\n}\nfunction parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.relativePath = true;\n return url;\n}\nfunction stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\nfunction mergePaths(url, base) {\n // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is.\n if (!url.relativePath)\n return;\n normalizePath(base);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n // If the base path is absolute, then our path is now absolute too.\n url.relativePath = base.relativePath;\n}\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url) {\n const { relativePath } = url;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (relativePath) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nfunction resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n // If we have a base, and the input isn't already an absolute URL, then we need to merge.\n if (base && !url.scheme) {\n const baseUrl = parseUrl(base);\n url.scheme = baseUrl.scheme;\n // If there's no host, then we were just a path.\n if (!url.host) {\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n }\n mergePaths(url, baseUrl);\n }\n normalizePath(url);\n // If the input (and base, if there was one) are both relative, then we need to output a relative.\n if (url.relativePath) {\n // The first char is always a \"/\".\n const path = url.path.slice(1);\n if (!path)\n return '.';\n // If base started with a leading \".\", or there is no base and input started with a \".\", then we\n // need to ensure that the relative path starts with a \".\". We don't know if relative starts\n // with a \"..\", though, so check before prepending.\n const keepRelative = (base || input).startsWith('.');\n return !keepRelative || path.startsWith('.') ? path : './' + path;\n }\n // If there's no host (and no scheme/user/port), then we need to output an absolute path.\n if (!url.scheme && !url.host)\n return url.path;\n // We're outputting either an absolute URL, or a protocol relative one.\n return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`;\n}\n\nexport { resolve as default };\n//# sourceMappingURL=resolve-uri.mjs.map\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\nimport resolveUri from '@jridgewell/resolve-uri';\n\nfunction resolve(input, base) {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/'))\n base += '/';\n return resolveUri(input, base);\n}\n\n/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nfunction stripFilename(path) {\n if (!path)\n return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\nconst REV_GENERATED_LINE = 1;\nconst REV_GENERATED_COLUMN = 2;\n\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length)\n return mappings;\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned)\n mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i]))\n return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned)\n line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\nlet found = false;\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n }\n else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; i++, index++) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; i--, index--) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n }\n else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(buildNullArray);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1)\n continue;\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = []));\n const memo = memos[sourceIndex];\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine));\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n return sources;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray() {\n return { __proto__: null };\n}\n\nconst AnyMap = function (map, mapUrl) {\n const parsed = typeof map === 'string' ? JSON.parse(map) : map;\n if (!('sections' in parsed))\n return new TraceMap(parsed, mapUrl);\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const { sections } = parsed;\n let i = 0;\n for (; i < sections.length - 1; i++) {\n const no = sections[i + 1].offset;\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column);\n }\n if (sections.length > 0) {\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity);\n }\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n return presortedDecodedMap(joined);\n};\nfunction addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) {\n const map = AnyMap(section.map, mapUrl);\n const { line: lineOffset, column: columnOffset } = section.offset;\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources } = map;\n append(sources, resolvedSources);\n append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length));\n append(names, map.names);\n // If this section jumps forwards several lines, we need to add lines to the output mappings catch up.\n for (let i = mappings.length; i <= lineOffset; i++)\n mappings.push([]);\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range.\n const stopI = stopLine - lineOffset;\n const len = Math.min(decoded.length, stopI + 1);\n for (let i = 0; i < len; i++) {\n const line = decoded[i];\n // On the 0th loop, the line will already exist due to a previous section, or the line catch up\n // loop above.\n const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (i === stopI && column >= stopColumn)\n break;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n if (seg.length === 4) {\n out.push([column, sourcesIndex, sourceLine, sourceColumn]);\n continue;\n }\n out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]);\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++)\n arr.push(other[i]);\n}\n// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of\n// equal length to the sources. This is because the sources and sourcesContent are paired arrays,\n// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined\n// sourcemap would desynchronize the sources/contents.\nfunction fillSourcesContent(len) {\n const sourcesContent = [];\n for (let i = 0; i < len; i++)\n sourcesContent[i] = null;\n return sourcesContent;\n}\n\nconst INVALID_ORIGINAL_MAPPING = Object.freeze({\n source: null,\n line: null,\n column: null,\n name: null,\n});\nconst INVALID_GENERATED_MAPPING = Object.freeze({\n line: null,\n column: null,\n});\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\nconst LEAST_UPPER_BOUND = -1;\nconst GREATEST_LOWER_BOUND = 1;\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nlet encodedMappings;\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nlet decodedMappings;\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nlet traceSegment;\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nlet originalPositionFor;\n/**\n * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided\n * the found mapping is from the same source and line as the originalPositionFor mapping.\n *\n * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1`\n * using the same needle that would return `id` when calling `originalPositionFor`.\n */\nlet generatedPositionFor;\n/**\n * Iterates each mapping in generated position order.\n */\nlet eachMapping;\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nlet presortedDecodedMap;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet decodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet encodedMap;\nclass TraceMap {\n constructor(map, mapUrl) {\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n const isString = typeof map === 'string';\n if (!isString && map.constructor === TraceMap)\n return map;\n const parsed = (isString ? JSON.parse(map) : map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n if (sourceRoot || mapUrl) {\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n }\n else {\n this.resolvedSources = sources.map((s) => s || '');\n }\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n }\n else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n }\n}\n(() => {\n encodedMappings = (map) => {\n var _a;\n return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded)));\n };\n decodedMappings = (map) => {\n return (map._decoded || (map._decoded = decode(map._encoded)));\n };\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return null;\n return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND);\n };\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return INVALID_ORIGINAL_MAPPING;\n const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_ORIGINAL_MAPPING;\n if (segment.length == 1)\n return INVALID_ORIGINAL_MAPPING;\n const { names, resolvedSources } = map;\n return {\n source: resolvedSources[segment[SOURCES_INDEX]],\n line: segment[SOURCE_LINE] + 1,\n column: segment[SOURCE_COLUMN],\n name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n };\n };\n generatedPositionFor = (map, { source, line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1)\n sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1)\n return INVALID_GENERATED_MAPPING;\n const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState)))));\n const memos = map._bySourceMemos;\n const segments = generated[sourceIndex][line];\n if (segments == null)\n return INVALID_GENERATED_MAPPING;\n const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_GENERATED_MAPPING;\n return {\n line: segment[REV_GENERATED_LINE] + 1,\n column: segment[REV_GENERATED_COLUMN],\n };\n };\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5)\n name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n });\n }\n }\n };\n presortedDecodedMap = (map, mapUrl) => {\n const clone = Object.assign({}, map);\n clone.mappings = [];\n const tracer = new TraceMap(clone, mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n decodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: decodedMappings(map),\n };\n };\n encodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: encodedMappings(map),\n };\n };\n})();\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n }\n else if (bias === LEAST_UPPER_BOUND)\n index++;\n if (index === -1 || index === segments.length)\n return null;\n return segments[index];\n}\n\nexport { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, traceSegment };\n//# sourceMappingURL=trace-mapping.mjs.map\n","/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nlet get;\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nlet put;\n/**\n * Pops the last added item out of the SetArray.\n */\nlet pop;\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nclass SetArray {\n constructor() {\n this._indexes = { __proto__: null };\n this.array = [];\n }\n}\n(() => {\n get = (strarr, key) => strarr._indexes[key];\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined)\n return index;\n const { array, _indexes: indexes } = strarr;\n return (indexes[key] = array.push(key) - 1);\n };\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0)\n return;\n const last = array.pop();\n indexes[last] = undefined;\n };\n})();\n\nexport { SetArray, get, pop, put };\n//# sourceMappingURL=set-array.mjs.map\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\n\nconst NO_NAME = -1;\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nlet addSegment;\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nlet addMapping;\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nlet maybeAddSegment;\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nlet maybeAddMapping;\n/**\n * Adds/removes the content of the source file to the source map.\n */\nlet setSourceContent;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toDecodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toEncodedMap;\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nlet fromMap;\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nlet allMappings;\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal;\n/**\n * Provides the state to generate a sourcemap.\n */\nclass GenMapping {\n constructor({ file, sourceRoot } = {}) {\n this._names = new SetArray();\n this._sources = new SetArray();\n this._sourcesContent = [];\n this._mappings = [];\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n}\n(() => {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping);\n };\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping);\n };\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n toDecodedMap = (map) => {\n const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n removeEmptyFinalLines(mappings);\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });\n };\n allMappings = (map) => {\n const out = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source = undefined;\n let original = undefined;\n let name = undefined;\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n if (seg.length === 5)\n name = names.array[seg[NAMES_INDEX]];\n }\n out.push({ generated, source, original, name });\n }\n }\n return out;\n };\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map);\n return gen;\n };\n // Internal helpers\n addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n if (!source) {\n if (skipable && skipSourceless(line, index))\n return;\n return insert(line, index, [genColumn]);\n }\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length)\n sourcesContent[sourcesIndex] = null;\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n return insert(line, index, name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn]);\n };\n})();\nfunction getLine(mappings, index) {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\nfunction getColumnIndex(line, genColumn) {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN])\n break;\n }\n return index;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\nfunction removeEmptyFinalLines(mappings) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0)\n break;\n }\n if (len < length)\n mappings.length = len;\n}\nfunction putAll(strarr, array) {\n for (let i = 0; i < array.length; i++)\n put(strarr, array[i]);\n}\nfunction skipSourceless(line, index) {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0)\n return true;\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\nfunction skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0)\n return false;\n const prev = line[index - 1];\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1)\n return false;\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));\n}\nfunction addMappingInternal(skipable, map, mapping) {\n const { generated, source, original, name } = mapping;\n if (!source) {\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null);\n }\n const s = source;\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name);\n}\n\nexport { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap };\n//# sourceMappingURL=gen-mapping.mjs.map\n","import { AnyMap, originalPositionFor } from '@jridgewell/trace-mapping';\nimport {\n GenMapping,\n maybeAddMapping,\n toDecodedMap,\n toEncodedMap,\n setSourceContent,\n} from '@jridgewell/gen-mapping';\n\nimport type { TraceMap, SectionedSourceMapInput } from '@jridgewell/trace-mapping';\nexport type { TraceMap, SectionedSourceMapInput };\n\nimport type { Mapping, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/gen-mapping';\nexport type { Mapping, EncodedSourceMap, DecodedSourceMap };\n\nexport class SourceMapConsumer {\n private declare _map: TraceMap;\n declare file: TraceMap['file'];\n declare names: TraceMap['names'];\n declare sourceRoot: TraceMap['sourceRoot'];\n declare sources: TraceMap['sources'];\n declare sourcesContent: TraceMap['sourcesContent'];\n\n constructor(map: ConstructorParameters[0], mapUrl: Parameters[1]) {\n const trace = (this._map = new AnyMap(map, mapUrl));\n\n this.file = trace.file;\n this.names = trace.names;\n this.sourceRoot = trace.sourceRoot;\n this.sources = trace.resolvedSources;\n this.sourcesContent = trace.sourcesContent;\n }\n\n originalPositionFor(\n needle: Parameters[1],\n ): ReturnType {\n return originalPositionFor(this._map, needle);\n }\n\n destroy() {\n // noop.\n }\n}\n\nexport class SourceMapGenerator {\n private declare _map: GenMapping;\n\n constructor(opts: ConstructorParameters[0]) {\n this._map = new GenMapping(opts);\n }\n\n addMapping(mapping: Parameters[1]): ReturnType {\n maybeAddMapping(this._map, mapping);\n }\n\n setSourceContent(\n source: Parameters[1],\n content: Parameters[2],\n ): ReturnType {\n setSourceContent(this._map, source, content);\n }\n\n toJSON(): ReturnType {\n return toEncodedMap(this._map);\n }\n\n toDecodedMap(): ReturnType {\n return toDecodedMap(this._map);\n }\n}\n"],"names":["sortComparator","resolve","resolveUri","COLUMN","SOURCES_INDEX","SOURCE_LINE","SOURCE_COLUMN","NAMES_INDEX"],"mappings":";;;;;;IAAA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;IACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACvC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD;IACA,MAAM,EAAE,GAAG,OAAO,WAAW,KAAK,WAAW;IAC7C,MAAM,IAAI,WAAW,EAAE;IACvB,MAAM,OAAO,MAAM,KAAK,WAAW;IACnC,UAAU;IACV,YAAY,MAAM,CAAC,GAAG,EAAE;IACxB,gBAAgB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACpF,gBAAgB,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACtC,aAAa;IACb,SAAS;IACT,UAAU;IACV,YAAY,MAAM,CAAC,GAAG,EAAE;IACxB,gBAAgB,IAA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BAAgB,CACd,MAA8C,EAC9C,OAA+C;YAE/C,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;SAC9C;QAED,MAAM;YACJ,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;QAED,YAAY;YACV,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts b/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts deleted file mode 100644 index 25ec1d0..0000000 --- a/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AnyMap, originalPositionFor } from '@jridgewell/trace-mapping'; -import { GenMapping, maybeAddMapping, toDecodedMap, toEncodedMap, setSourceContent } from '@jridgewell/gen-mapping'; -import type { TraceMap, SectionedSourceMapInput } from '@jridgewell/trace-mapping'; -export type { TraceMap, SectionedSourceMapInput }; -import type { Mapping, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/gen-mapping'; -export type { Mapping, EncodedSourceMap, DecodedSourceMap }; -export declare class SourceMapConsumer { - private _map; - file: TraceMap['file']; - names: TraceMap['names']; - sourceRoot: TraceMap['sourceRoot']; - sources: TraceMap['sources']; - sourcesContent: TraceMap['sourcesContent']; - constructor(map: ConstructorParameters[0], mapUrl: Parameters[1]); - originalPositionFor(needle: Parameters[1]): ReturnType; - destroy(): void; -} -export declare class SourceMapGenerator { - private _map; - constructor(opts: ConstructorParameters[0]); - addMapping(mapping: Parameters[1]): ReturnType; - setSourceContent(source: Parameters[1], content: Parameters[2]): ReturnType; - toJSON(): ReturnType; - toDecodedMap(): ReturnType; -} diff --git a/node_modules/@jridgewell/source-map/package.json b/node_modules/@jridgewell/source-map/package.json deleted file mode 100644 index 87f1650..0000000 --- a/node_modules/@jridgewell/source-map/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@jridgewell/source-map", - "version": "0.3.5", - "description": "Packages @jridgewell/trace-mapping and @jridgewell/gen-mapping into the familiar source-map API", - "keywords": [ - "sourcemap", - "source", - "map" - ], - "author": "Justin Ridgewell ", - "license": "MIT", - "repository": "https://github.com/jridgewell/source-map", - "main": "dist/source-map.umd.js", - "module": "dist/source-map.mjs", - "types": "dist/types/source-map.d.ts", - "exports": { - ".": [ - { - "types": "./dist/types/source-map.d.ts", - "browser": "./dist/source-map.umd.js", - "require": "./dist/source-map.umd.js", - "import": "./dist/source-map.mjs" - }, - "./dist/source-map.umd.js" - ], - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "scripts": { - "prebuild": "rm -rf dist", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "pretest": "run-s build:rollup", - "test": "run-s -n test:lint test:only", - "test:debug": "mocha --inspect-brk", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:coverage": "c8 mocha", - "test:watch": "mocha --watch", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build" - }, - "devDependencies": { - "@rollup/plugin-node-resolve": "13.2.1", - "@rollup/plugin-typescript": "8.3.0", - "@types/mocha": "9.1.1", - "@types/node": "17.0.30", - "@typescript-eslint/eslint-plugin": "5.10.0", - "@typescript-eslint/parser": "5.10.0", - "c8": "7.11.0", - "eslint": "8.7.0", - "eslint-config-prettier": "8.3.0", - "mocha": "9.2.0", - "npm-run-all": "4.1.5", - "prettier": "2.5.1", - "rollup": "2.66.0", - "typescript": "4.5.5" - }, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } -} diff --git a/node_modules/@jridgewell/sourcemap-codec/LICENSE b/node_modules/@jridgewell/sourcemap-codec/LICENSE deleted file mode 100644 index a331065..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2015 Rich Harris - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/@jridgewell/sourcemap-codec/README.md b/node_modules/@jridgewell/sourcemap-codec/README.md deleted file mode 100644 index 5cbb315..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/README.md +++ /dev/null @@ -1,200 +0,0 @@ -# @jridgewell/sourcemap-codec - -Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). - - -## Why? - -Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. - -This package makes the process slightly easier. - - -## Installation - -```bash -npm install @jridgewell/sourcemap-codec -``` - - -## Usage - -```js -import { encode, decode } from '@jridgewell/sourcemap-codec'; - -var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); - -assert.deepEqual( decoded, [ - // the first line (of the generated code) has no mappings, - // as shown by the starting semi-colon (which separates lines) - [], - - // the second line contains four (comma-separated) segments - [ - // segments are encoded as you'd expect: - // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] - - // i.e. the first segment begins at column 2, and maps back to the second column - // of the second line (both zero-based) of the 0th source, and uses the 0th - // name in the `map.names` array - [ 2, 0, 2, 2, 0 ], - - // the remaining segments are 4-length rather than 5-length, - // because they don't map a name - [ 4, 0, 2, 4 ], - [ 6, 0, 2, 5 ], - [ 7, 0, 2, 7 ] - ], - - // the final line contains two segments - [ - [ 2, 1, 10, 19 ], - [ 12, 1, 11, 20 ] - ] -]); - -var encoded = encode( decoded ); -assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); -``` - -## Benchmarks - -``` -node v18.0.0 - -amp.js.map - 45120 segments - -Decode Memory Usage: -@jridgewell/sourcemap-codec 5479160 bytes -sourcemap-codec 5659336 bytes -source-map-0.6.1 17144440 bytes -source-map-0.8.0 6867424 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Decode speed: -decode: @jridgewell/sourcemap-codec x 502 ops/sec ±1.03% (90 runs sampled) -decode: sourcemap-codec x 445 ops/sec ±0.97% (92 runs sampled) -decode: source-map-0.6.1 x 36.01 ops/sec ±1.64% (49 runs sampled) -decode: source-map-0.8.0 x 367 ops/sec ±0.04% (95 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec - -Encode Memory Usage: -@jridgewell/sourcemap-codec 1261620 bytes -sourcemap-codec 9119248 bytes -source-map-0.6.1 8968560 bytes -source-map-0.8.0 8952952 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Encode speed: -encode: @jridgewell/sourcemap-codec x 738 ops/sec ±0.42% (98 runs sampled) -encode: sourcemap-codec x 238 ops/sec ±0.73% (88 runs sampled) -encode: source-map-0.6.1 x 162 ops/sec ±0.43% (84 runs sampled) -encode: source-map-0.8.0 x 191 ops/sec ±0.34% (90 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec - - -*** - - -babel.min.js.map - 347793 segments - -Decode Memory Usage: -@jridgewell/sourcemap-codec 35338184 bytes -sourcemap-codec 35922736 bytes -source-map-0.6.1 62366360 bytes -source-map-0.8.0 44337416 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Decode speed: -decode: @jridgewell/sourcemap-codec x 40.35 ops/sec ±4.47% (54 runs sampled) -decode: sourcemap-codec x 36.76 ops/sec ±3.67% (51 runs sampled) -decode: source-map-0.6.1 x 4.44 ops/sec ±2.15% (16 runs sampled) -decode: source-map-0.8.0 x 59.35 ops/sec ±0.05% (78 runs sampled) -Fastest is decode: source-map-0.8.0 - -Encode Memory Usage: -@jridgewell/sourcemap-codec 7212604 bytes -sourcemap-codec 21421456 bytes -source-map-0.6.1 25286888 bytes -source-map-0.8.0 25498744 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Encode speed: -encode: @jridgewell/sourcemap-codec x 112 ops/sec ±0.13% (84 runs sampled) -encode: sourcemap-codec x 30.23 ops/sec ±2.76% (53 runs sampled) -encode: source-map-0.6.1 x 19.43 ops/sec ±3.70% (37 runs sampled) -encode: source-map-0.8.0 x 19.40 ops/sec ±3.26% (37 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec - - -*** - - -preact.js.map - 1992 segments - -Decode Memory Usage: -@jridgewell/sourcemap-codec 500272 bytes -sourcemap-codec 516864 bytes -source-map-0.6.1 1596672 bytes -source-map-0.8.0 517272 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Decode speed: -decode: @jridgewell/sourcemap-codec x 16,137 ops/sec ±0.17% (99 runs sampled) -decode: sourcemap-codec x 12,139 ops/sec ±0.13% (99 runs sampled) -decode: source-map-0.6.1 x 1,264 ops/sec ±0.12% (100 runs sampled) -decode: source-map-0.8.0 x 9,894 ops/sec ±0.08% (101 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec - -Encode Memory Usage: -@jridgewell/sourcemap-codec 321026 bytes -sourcemap-codec 830832 bytes -source-map-0.6.1 586608 bytes -source-map-0.8.0 586680 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Encode speed: -encode: @jridgewell/sourcemap-codec x 19,876 ops/sec ±0.78% (95 runs sampled) -encode: sourcemap-codec x 6,983 ops/sec ±0.15% (100 runs sampled) -encode: source-map-0.6.1 x 5,070 ops/sec ±0.12% (102 runs sampled) -encode: source-map-0.8.0 x 5,641 ops/sec ±0.17% (100 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec - - -*** - - -react.js.map - 5726 segments - -Decode Memory Usage: -@jridgewell/sourcemap-codec 734848 bytes -sourcemap-codec 954200 bytes -source-map-0.6.1 2276432 bytes -source-map-0.8.0 955488 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Decode speed: -decode: @jridgewell/sourcemap-codec x 5,723 ops/sec ±0.12% (98 runs sampled) -decode: sourcemap-codec x 4,555 ops/sec ±0.09% (101 runs sampled) -decode: source-map-0.6.1 x 437 ops/sec ±0.11% (93 runs sampled) -decode: source-map-0.8.0 x 3,441 ops/sec ±0.15% (100 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec - -Encode Memory Usage: -@jridgewell/sourcemap-codec 638672 bytes -sourcemap-codec 1109840 bytes -source-map-0.6.1 1321224 bytes -source-map-0.8.0 1324448 bytes -Smallest memory usage is @jridgewell/sourcemap-codec - -Encode speed: -encode: @jridgewell/sourcemap-codec x 6,801 ops/sec ±0.48% (98 runs sampled) -encode: sourcemap-codec x 2,533 ops/sec ±0.13% (101 runs sampled) -encode: source-map-0.6.1 x 2,248 ops/sec ±0.08% (100 runs sampled) -encode: source-map-0.8.0 x 2,303 ops/sec ±0.15% (100 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec -``` - -# License - -MIT diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs deleted file mode 100644 index 3dff372..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +++ /dev/null @@ -1,164 +0,0 @@ -const comma = ','.charCodeAt(0); -const semicolon = ';'.charCodeAt(0); -const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -const intToChar = new Uint8Array(64); // 64 possible chars. -const charToInt = new Uint8Array(128); // z is 122 in ASCII -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} -// Provide a fallback for older environments. -const td = typeof TextDecoder !== 'undefined' - ? /* #__PURE__ */ new TextDecoder() - : typeof Buffer !== 'undefined' - ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - }, - } - : { - decode(buf) { - let out = ''; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - }, - }; -function decode(mappings) { - const state = new Int32Array(5); - const decoded = []; - let index = 0; - do { - const semi = indexOf(mappings, index); - const line = []; - let sorted = true; - let lastCol = 0; - state[0] = 0; - for (let i = index; i < semi; i++) { - let seg; - i = decodeInteger(mappings, i, state, 0); // genColumn - const col = state[0]; - if (col < lastCol) - sorted = false; - lastCol = col; - if (hasMoreVlq(mappings, i, semi)) { - i = decodeInteger(mappings, i, state, 1); // sourcesIndex - i = decodeInteger(mappings, i, state, 2); // sourceLine - i = decodeInteger(mappings, i, state, 3); // sourceColumn - if (hasMoreVlq(mappings, i, semi)) { - i = decodeInteger(mappings, i, state, 4); // namesIndex - seg = [col, state[1], state[2], state[3], state[4]]; - } - else { - seg = [col, state[1], state[2], state[3]]; - } - } - else { - seg = [col]; - } - line.push(seg); - } - if (!sorted) - sort(line); - decoded.push(line); - index = semi + 1; - } while (index <= mappings.length); - return decoded; -} -function indexOf(mappings, index) { - const idx = mappings.indexOf(';', index); - return idx === -1 ? mappings.length : idx; -} -function decodeInteger(mappings, pos, state, j) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = mappings.charCodeAt(pos++); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -0x80000000 | -value; - } - state[j] += value; - return pos; -} -function hasMoreVlq(mappings, i, length) { - if (i >= length) - return false; - return mappings.charCodeAt(i) !== comma; -} -function sort(line) { - line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const state = new Int32Array(5); - const bufLength = 1024 * 16; - const subLength = bufLength - 36; - const buf = new Uint8Array(bufLength); - const sub = buf.subarray(0, subLength); - let pos = 0; - let out = ''; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) { - if (pos === bufLength) { - out += td.decode(buf); - pos = 0; - } - buf[pos++] = semicolon; - } - if (line.length === 0) - continue; - state[0] = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - // We can push up to 5 ints, each int can take at most 7 chars, and we - // may push a comma. - if (pos > subLength) { - out += td.decode(sub); - buf.copyWithin(0, subLength, pos); - pos -= subLength; - } - if (j > 0) - buf[pos++] = comma; - pos = encodeInteger(buf, pos, state, segment, 0); // genColumn - if (segment.length === 1) - continue; - pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex - pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine - pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn - if (segment.length === 4) - continue; - pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex - } - } - return out + td.decode(buf.subarray(0, pos)); -} -function encodeInteger(buf, pos, state, segment, j) { - const next = segment[j]; - let num = next - state[j]; - state[j] = next; - num = num < 0 ? (-num << 1) | 1 : num << 1; - do { - let clamped = num & 0b011111; - num >>>= 5; - if (num > 0) - clamped |= 0b100000; - buf[pos++] = intToChar[clamped]; - } while (num > 0); - return pos; -} - -export { decode, encode }; -//# sourceMappingURL=sourcemap-codec.mjs.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map deleted file mode 100644 index 236fd12..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-codec.mjs","sources":["../src/sourcemap-codec.ts"],"sourcesContent":["export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAEtC,KAAK,IAAI,CAAC,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AAyB,EACzB,CAAS;IAET,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEhB,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IAC3C,GAAG;QACD,IAAI,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC;QAC7B,GAAG,MAAM,CAAC,CAAC;QACX,IAAI,GAAG,GAAG,CAAC;YAAE,OAAO,IAAI,QAAQ,CAAC;QACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;KACjC,QAAQ,GAAG,GAAG,CAAC,EAAE;IAElB,OAAO,GAAG,CAAC;AACb;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js deleted file mode 100644 index bec92a9..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +++ /dev/null @@ -1,175 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sourcemapCodec = {})); -})(this, (function (exports) { 'use strict'; - - const comma = ','.charCodeAt(0); - const semicolon = ';'.charCodeAt(0); - const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - const intToChar = new Uint8Array(64); // 64 possible chars. - const charToInt = new Uint8Array(128); // z is 122 in ASCII - for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; - } - // Provide a fallback for older environments. - const td = typeof TextDecoder !== 'undefined' - ? /* #__PURE__ */ new TextDecoder() - : typeof Buffer !== 'undefined' - ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - }, - } - : { - decode(buf) { - let out = ''; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - }, - }; - function decode(mappings) { - const state = new Int32Array(5); - const decoded = []; - let index = 0; - do { - const semi = indexOf(mappings, index); - const line = []; - let sorted = true; - let lastCol = 0; - state[0] = 0; - for (let i = index; i < semi; i++) { - let seg; - i = decodeInteger(mappings, i, state, 0); // genColumn - const col = state[0]; - if (col < lastCol) - sorted = false; - lastCol = col; - if (hasMoreVlq(mappings, i, semi)) { - i = decodeInteger(mappings, i, state, 1); // sourcesIndex - i = decodeInteger(mappings, i, state, 2); // sourceLine - i = decodeInteger(mappings, i, state, 3); // sourceColumn - if (hasMoreVlq(mappings, i, semi)) { - i = decodeInteger(mappings, i, state, 4); // namesIndex - seg = [col, state[1], state[2], state[3], state[4]]; - } - else { - seg = [col, state[1], state[2], state[3]]; - } - } - else { - seg = [col]; - } - line.push(seg); - } - if (!sorted) - sort(line); - decoded.push(line); - index = semi + 1; - } while (index <= mappings.length); - return decoded; - } - function indexOf(mappings, index) { - const idx = mappings.indexOf(';', index); - return idx === -1 ? mappings.length : idx; - } - function decodeInteger(mappings, pos, state, j) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = mappings.charCodeAt(pos++); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -0x80000000 | -value; - } - state[j] += value; - return pos; - } - function hasMoreVlq(mappings, i, length) { - if (i >= length) - return false; - return mappings.charCodeAt(i) !== comma; - } - function sort(line) { - line.sort(sortComparator); - } - function sortComparator(a, b) { - return a[0] - b[0]; - } - function encode(decoded) { - const state = new Int32Array(5); - const bufLength = 1024 * 16; - const subLength = bufLength - 36; - const buf = new Uint8Array(bufLength); - const sub = buf.subarray(0, subLength); - let pos = 0; - let out = ''; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) { - if (pos === bufLength) { - out += td.decode(buf); - pos = 0; - } - buf[pos++] = semicolon; - } - if (line.length === 0) - continue; - state[0] = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - // We can push up to 5 ints, each int can take at most 7 chars, and we - // may push a comma. - if (pos > subLength) { - out += td.decode(sub); - buf.copyWithin(0, subLength, pos); - pos -= subLength; - } - if (j > 0) - buf[pos++] = comma; - pos = encodeInteger(buf, pos, state, segment, 0); // genColumn - if (segment.length === 1) - continue; - pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex - pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine - pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn - if (segment.length === 4) - continue; - pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex - } - } - return out + td.decode(buf.subarray(0, pos)); - } - function encodeInteger(buf, pos, state, segment, j) { - const next = segment[j]; - let num = next - state[j]; - state[j] = next; - num = num < 0 ? (-num << 1) | 1 : num << 1; - do { - let clamped = num & 0b011111; - num >>>= 5; - if (num > 0) - clamped |= 0b100000; - buf[pos++] = intToChar[clamped]; - } while (num > 0); - return pos; - } - - exports.decode = decode; - exports.encode = encode; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=sourcemap-codec.umd.js.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map deleted file mode 100644 index b6b2003..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-codec.umd.js","sources":["../src/sourcemap-codec.ts"],"sourcesContent":["export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n"],"names":[],"mappings":";;;;;;IAOA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;IACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAClB;IAED;IACA,MAAM,EAAE,GACN,OAAO,WAAW,KAAK,WAAW;0BACd,IAAI,WAAW,EAAE;UACjC,OAAO,MAAM,KAAK,WAAW;cAC7B;gBACE,MAAM,CAAC,GAAe;oBACpB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAA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AAC;YACX,IAAI,GAAG,GAAG,CAAC;gBAAE,OAAO,IAAI,QAAQ,CAAC;YACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;SACjC,QAAQ,GAAG,GAAG,CAAC,EAAE;QAElB,OAAO,GAAG,CAAC;IACb;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts b/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts deleted file mode 100644 index 410d320..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; -export declare type SourceMapLine = SourceMapSegment[]; -export declare type SourceMapMappings = SourceMapLine[]; -export declare function decode(mappings: string): SourceMapMappings; -export declare function encode(decoded: SourceMapMappings): string; -export declare function encode(decoded: Readonly): string; diff --git a/node_modules/@jridgewell/sourcemap-codec/package.json b/node_modules/@jridgewell/sourcemap-codec/package.json deleted file mode 100644 index 578448f..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@jridgewell/sourcemap-codec", - "version": "1.4.15", - "description": "Encode/decode sourcemap mappings", - "keywords": [ - "sourcemap", - "vlq" - ], - "main": "dist/sourcemap-codec.umd.js", - "module": "dist/sourcemap-codec.mjs", - "types": "dist/types/sourcemap-codec.d.ts", - "files": [ - "dist" - ], - "exports": { - ".": [ - { - "types": "./dist/types/sourcemap-codec.d.ts", - "browser": "./dist/sourcemap-codec.umd.js", - "require": "./dist/sourcemap-codec.umd.js", - "import": "./dist/sourcemap-codec.mjs" - }, - "./dist/sourcemap-codec.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:rollup benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.js", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "prebuild": "rm -rf dist", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build", - "pretest": "run-s build:rollup", - "test": "run-s -n test:lint test:only", - "test:debug": "mocha --inspect-brk", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:coverage": "c8 mocha", - "test:watch": "mocha --watch" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemap-codec.git" - }, - "author": "Rich Harris", - "license": "MIT", - "devDependencies": { - "@rollup/plugin-typescript": "8.3.0", - "@types/node": "17.0.15", - "@typescript-eslint/eslint-plugin": "5.10.0", - "@typescript-eslint/parser": "5.10.0", - "benchmark": "2.1.4", - "c8": "7.11.2", - "eslint": "8.7.0", - "eslint-config-prettier": "8.3.0", - "mocha": "9.2.0", - "npm-run-all": "4.1.5", - "prettier": "2.5.1", - "rollup": "2.64.0", - "source-map": "0.6.1", - "source-map-js": "1.0.2", - "sourcemap-codec": "1.4.8", - "typescript": "4.5.4" - } -} diff --git a/node_modules/@jridgewell/trace-mapping/LICENSE b/node_modules/@jridgewell/trace-mapping/LICENSE deleted file mode 100644 index 37bb488..0000000 --- a/node_modules/@jridgewell/trace-mapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2022 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@jridgewell/trace-mapping/README.md b/node_modules/@jridgewell/trace-mapping/README.md deleted file mode 100644 index cc5e4f9..0000000 --- a/node_modules/@jridgewell/trace-mapping/README.md +++ /dev/null @@ -1,252 +0,0 @@ -# @jridgewell/trace-mapping - -> Trace the original position through a source map - -`trace-mapping` allows you to take the line and column of an output file and trace it to the -original location in the source file through a source map. - -You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This -provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. - -## Installation - -```sh -npm install @jridgewell/trace-mapping -``` - -## Usage - -```typescript -import { - TraceMap, - originalPositionFor, - generatedPositionFor, - sourceContentFor, -} from '@jridgewell/trace-mapping'; - -const tracer = new TraceMap({ - version: 3, - sources: ['input.js'], - sourcesContent: ['content of input.js'], - names: ['foo'], - mappings: 'KAyCIA', -}); - -// Lines start at line 1, columns at column 0. -const traced = originalPositionFor(tracer, { line: 1, column: 5 }); -assert.deepEqual(traced, { - source: 'input.js', - line: 42, - column: 4, - name: 'foo', -}); - -const content = sourceContentFor(tracer, traced.source); -assert.strictEqual(content, 'content for input.js'); - -const generated = generatedPositionFor(tracer, { - source: 'input.js', - line: 42, - column: 4, -}); -assert.deepEqual(generated, { - line: 1, - column: 5, -}); -``` - -We also provide a lower level API to get the actual segment that matches our line and column. Unlike -`originalPositionFor`, `traceSegment` uses a 0-base for `line`: - -```typescript -import { traceSegment } from '@jridgewell/trace-mapping'; - -// line is 0-base. -const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); - -// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] -// Again, line is 0-base and so is sourceLine -assert.deepEqual(traced, [5, 0, 41, 4, 0]); -``` - -### SectionedSourceMaps - -The sourcemap spec defines a special `sections` field that's designed to handle concatenation of -output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool -produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` -helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a -`TraceMap` instance: - -```typescript -import { AnyMap } from '@jridgewell/trace-mapping'; -const fooOutput = 'foo'; -const barOutput = 'bar'; -const output = [fooOutput, barOutput].join('\n'); - -const sectioned = new AnyMap({ - version: 3, - sections: [ - { - // 0-base line and column - offset: { line: 0, column: 0 }, - // fooOutput's sourcemap - map: { - version: 3, - sources: ['foo.js'], - names: ['foo'], - mappings: 'AAAAA', - }, - }, - { - // barOutput's sourcemap will not affect the first line, only the second - offset: { line: 1, column: 0 }, - map: { - version: 3, - sources: ['bar.js'], - names: ['bar'], - mappings: 'AAAAA', - }, - }, - ], -}); - -const traced = originalPositionFor(sectioned, { - line: 2, - column: 0, -}); - -assert.deepEqual(traced, { - source: 'bar.js', - line: 1, - column: 0, - name: 'bar', -}); -``` - -## Benchmarks - -``` -node v18.0.0 - -amp.js.map - 45120 segments - -Memory Usage: -trace-mapping decoded 562400 bytes -trace-mapping encoded 5706544 bytes -source-map-js 10717664 bytes -source-map-0.6.1 17446384 bytes -source-map-0.8.0 9701757 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 180 ops/sec ±0.34% (85 runs sampled) -trace-mapping: encoded JSON input x 364 ops/sec ±1.77% (89 runs sampled) -trace-mapping: decoded Object input x 3,116 ops/sec ±0.50% (96 runs sampled) -trace-mapping: encoded Object input x 410 ops/sec ±2.62% (85 runs sampled) -source-map-js: encoded Object input x 84.23 ops/sec ±0.91% (73 runs sampled) -source-map-0.6.1: encoded Object input x 37.21 ops/sec ±2.08% (51 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed: -trace-mapping: decoded originalPositionFor x 3,952,212 ops/sec ±0.17% (98 runs sampled) -trace-mapping: encoded originalPositionFor x 3,487,468 ops/sec ±1.58% (90 runs sampled) -source-map-js: encoded originalPositionFor x 827,730 ops/sec ±0.78% (97 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 748,991 ops/sec ±0.53% (94 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 2,532,894 ops/sec ±0.57% (95 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -babel.min.js.map - 347793 segments - -Memory Usage: -trace-mapping decoded 89832 bytes -trace-mapping encoded 35474640 bytes -source-map-js 51257176 bytes -source-map-0.6.1 63515664 bytes -source-map-0.8.0 42933752 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 15.41 ops/sec ±8.65% (34 runs sampled) -trace-mapping: encoded JSON input x 28.20 ops/sec ±12.87% (42 runs sampled) -trace-mapping: decoded Object input x 964 ops/sec ±0.36% (99 runs sampled) -trace-mapping: encoded Object input x 31.77 ops/sec ±13.79% (45 runs sampled) -source-map-js: encoded Object input x 6.45 ops/sec ±5.16% (21 runs sampled) -source-map-0.6.1: encoded Object input x 4.07 ops/sec ±5.24% (15 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed: -trace-mapping: decoded originalPositionFor x 7,183,038 ops/sec ±0.58% (95 runs sampled) -trace-mapping: encoded originalPositionFor x 5,192,185 ops/sec ±0.41% (100 runs sampled) -source-map-js: encoded originalPositionFor x 4,259,489 ops/sec ±0.79% (94 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 3,742,629 ops/sec ±0.71% (95 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 6,270,211 ops/sec ±0.64% (94 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -preact.js.map - 1992 segments - -Memory Usage: -trace-mapping decoded 37128 bytes -trace-mapping encoded 247280 bytes -source-map-js 1143536 bytes -source-map-0.6.1 1290992 bytes -source-map-0.8.0 96544 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 3,483 ops/sec ±0.30% (98 runs sampled) -trace-mapping: encoded JSON input x 6,092 ops/sec ±0.18% (97 runs sampled) -trace-mapping: decoded Object input x 249,076 ops/sec ±0.24% (98 runs sampled) -trace-mapping: encoded Object input x 14,555 ops/sec ±0.48% (100 runs sampled) -source-map-js: encoded Object input x 2,447 ops/sec ±0.36% (99 runs sampled) -source-map-0.6.1: encoded Object input x 1,201 ops/sec ±0.57% (96 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed: -trace-mapping: decoded originalPositionFor x 7,620,192 ops/sec ±0.09% (99 runs sampled) -trace-mapping: encoded originalPositionFor x 6,872,554 ops/sec ±0.30% (97 runs sampled) -source-map-js: encoded originalPositionFor x 2,489,570 ops/sec ±0.35% (94 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 1,698,633 ops/sec ±0.28% (98 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 4,015,644 ops/sec ±0.22% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -react.js.map - 5726 segments - -Memory Usage: -trace-mapping decoded 16176 bytes -trace-mapping encoded 681552 bytes -source-map-js 2418352 bytes -source-map-0.6.1 2443672 bytes -source-map-0.8.0 111768 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 1,720 ops/sec ±0.34% (98 runs sampled) -trace-mapping: encoded JSON input x 4,406 ops/sec ±0.35% (100 runs sampled) -trace-mapping: decoded Object input x 92,122 ops/sec ±0.10% (99 runs sampled) -trace-mapping: encoded Object input x 5,385 ops/sec ±0.37% (99 runs sampled) -source-map-js: encoded Object input x 794 ops/sec ±0.40% (98 runs sampled) -source-map-0.6.1: encoded Object input x 416 ops/sec ±0.54% (91 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed: -trace-mapping: decoded originalPositionFor x 32,759,519 ops/sec ±0.33% (100 runs sampled) -trace-mapping: encoded originalPositionFor x 31,116,306 ops/sec ±0.33% (97 runs sampled) -source-map-js: encoded originalPositionFor x 17,458,435 ops/sec ±0.44% (97 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 12,687,097 ops/sec ±0.43% (95 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 23,538,275 ops/sec ±0.38% (95 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor -``` - -[source-map]: https://www.npmjs.com/package/source-map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs deleted file mode 100644 index d3c1a7a..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +++ /dev/null @@ -1,552 +0,0 @@ -import { encode, decode } from '@jridgewell/sourcemap-codec'; -import resolveUri from '@jridgewell/resolve-uri'; - -function resolve(input, base) { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) - base += '/'; - return resolveUri(input, base); -} - -/** - * Removes everything after the last "/", but leaves the slash. - */ -function stripFilename(path) { - if (!path) - return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} - -const COLUMN = 0; -const SOURCES_INDEX = 1; -const SOURCE_LINE = 2; -const SOURCE_COLUMN = 3; -const NAMES_INDEX = 4; -const REV_GENERATED_LINE = 1; -const REV_GENERATED_COLUMN = 2; - -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) - return mappings; - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) - mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} -function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) - return i; - } - return mappings.length; -} -function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} -function sortSegments(line, owned) { - if (!owned) - line = line.slice(); - return line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; -} - -let found = false; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } - else { - high = mid - 1; - } - } - found = false; - return low - 1; -} -function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; -} -function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; -} -function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; -} -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } - else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return (state.lastIndex = binarySearch(haystack, needle, low, high)); -} - -// Rebuilds the original source files, with mappings that are ordered by source line/column instead -// of generated line/column. -function buildBySources(decoded, memos) { - const sources = memos.map(buildNullArray); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) - continue; - const sourceIndex = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const originalSource = sources[sourceIndex]; - const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); - const memo = memos[sourceIndex]; - // The binary search either found a match, or it found the left-index just before where the - // segment should go. Either way, we want to insert after that. And there may be multiple - // generated segments associated with an original location, so there may need to move several - // indexes before we find where we need to insert. - const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); - insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); - } - } - return sources; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like -// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. -// Numeric properties on objects are magically sorted in ascending order by the engine regardless of -// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending -// order when iterating with for-in. -function buildNullArray() { - return { __proto__: null }; -} - -const AnyMap = function (map, mapUrl) { - const parsed = typeof map === 'string' ? JSON.parse(map) : map; - if (!('sections' in parsed)) - return new TraceMap(parsed, mapUrl); - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - }; - return presortedDecodedMap(joined); -}; -function recurse(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { - const { sections } = input; - for (let i = 0; i < sections.length; i++) { - const { map, offset } = sections[i]; - let sl = stopLine; - let sc = stopColumn; - if (i + 1 < sections.length) { - const nextOffset = sections[i + 1].offset; - sl = Math.min(stopLine, lineOffset + nextOffset.line); - if (sl === stopLine) { - sc = Math.min(stopColumn, columnOffset + nextOffset.column); - } - else if (sl < stopLine) { - sc = columnOffset + nextOffset.column; - } - } - addSection(map, mapUrl, mappings, sources, sourcesContent, names, lineOffset + offset.line, columnOffset + offset.column, sl, sc); - } -} -function addSection(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { - if ('sections' in input) - return recurse(...arguments); - const map = new TraceMap(input, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents } = map; - append(sources, resolvedSources); - append(names, map.names); - if (contents) - append(sourcesContent, contents); - else - for (let i = 0; i < resolvedSources.length; i++) - sourcesContent.push(null); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. But it may not have any columns that overstep, so we - // still need to check that we don't overstep lines, too. - if (lineI > stopLine) - return; - // The out line may already exist in mappings (if we're continuing the line started by a - // previous section). Or, we may have jumped ahead several lines to start this section. - const out = getLine(mappings, lineI); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (lineI === stopLine && column >= stopColumn) - return; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - out.push(seg.length === 4 - ? [column, sourcesIndex, sourceLine, sourceColumn] - : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); - } - } -} -function append(arr, other) { - for (let i = 0; i < other.length; i++) - arr.push(other[i]); -} -function getLine(arr, index) { - for (let i = arr.length; i <= index; i++) - arr[i] = []; - return arr[index]; -} - -const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; -const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; -const LEAST_UPPER_BOUND = -1; -const GREATEST_LOWER_BOUND = 1; -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -let encodedMappings; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -let decodedMappings; -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -let traceSegment; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -let originalPositionFor; -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -let generatedPositionFor; -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -let allGeneratedPositionsFor; -/** - * Iterates each mapping in generated position order. - */ -let eachMapping; -/** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ -let sourceContentFor; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -let presortedDecodedMap; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let decodedMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -let encodedMap; -class TraceMap { - constructor(map, mapUrl) { - const isString = typeof map === 'string'; - if (!isString && map._decodedMemo) - return map; - const parsed = (isString ? JSON.parse(map) : map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names || []; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - const from = resolve(sourceRoot || '', stripFilename(mapUrl)); - this.resolvedSources = sources.map((s) => resolve(s || '', from)); - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } - else { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - } -} -(() => { - encodedMappings = (map) => { - var _a; - return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded))); - }; - decodedMappings = (map) => { - return (map._decoded || (map._decoded = decode(map._encoded))); - }; - traceSegment = (map, line, column) => { - const decoded = decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return null; - const segments = decoded[line]; - const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); - return index === -1 ? null : segments[index]; - }; - originalPositionFor = (map, { line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); - if (index === -1) - return OMapping(null, null, null, null); - const segment = segments[index]; - if (segment.length === 1) - return OMapping(null, null, null, null); - const { names, resolvedSources } = map; - return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null); - }; - allGeneratedPositionsFor = (map, { source, line, column, bias }) => { - // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); - }; - generatedPositionFor = (map, { source, line, column, bias }) => { - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); - }; - eachMapping = (map, cb) => { - const decoded = decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) - name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name, - }); - } - } - }; - sourceContentFor = (map, source) => { - const { sources, resolvedSources, sourcesContent } = map; - if (sourcesContent == null) - return null; - let index = sources.indexOf(source); - if (index === -1) - index = resolvedSources.indexOf(source); - return index === -1 ? null : sourcesContent[index]; - }; - presortedDecodedMap = (map, mapUrl) => { - const tracer = new TraceMap(clone(map, []), mapUrl); - tracer._decoded = map.mappings; - return tracer; - }; - decodedMap = (map) => { - return clone(map, decodedMappings(map)); - }; - encodedMap = (map) => { - return clone(map, encodedMappings(map)); - }; - function generatedPosition(map, source, line, column, bias, all) { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex = sources.indexOf(source); - if (sourceIndex === -1) - sourceIndex = resolvedSources.indexOf(source); - if (sourceIndex === -1) - return all ? [] : GMapping(null, null); - const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); - const segments = generated[sourceIndex][line]; - if (segments == null) - return all ? [] : GMapping(null, null); - const memo = map._bySourceMemos[sourceIndex]; - if (all) - return sliceGeneratedPositions(segments, memo, line, column, bias); - const index = traceSegmentInternal(segments, memo, line, column, bias); - if (index === -1) - return GMapping(null, null); - const segment = segments[index]; - return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); - } -})(); -function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - }; -} -function OMapping(source, line, column, name) { - return { source, line, column, name }; -} -function GMapping(line, column) { - return { line, column }; -} -function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } - else if (bias === LEAST_UPPER_BOUND) - index++; - if (index === -1 || index === segments.length) - return -1; - return index; -} -function sliceGeneratedPositions(segments, memo, line, column, bias) { - let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); - // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in - // insertion order) segment that matched. Even if we did respect the bias when tracing, we would - // still need to call `lowerBound()` to find the first segment, which is slower than just looking - // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the - // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to - // match LEAST_UPPER_BOUND. - if (!found && bias === LEAST_UPPER_BOUND) - min++; - if (min === -1 || min === segments.length) - return []; - // We may have found the segment that started at an earlier column. If this is the case, then we - // need to slice all generated segments that match _that_ column, because all such segments span - // to our desired column. - const matchedColumn = found ? column : segments[min][COLUMN]; - // The binary search is not guaranteed to find the lower bound when a match wasn't found. - if (!found) - min = lowerBound(segments, matchedColumn, min); - const max = upperBound(segments, matchedColumn, min); - const result = []; - for (; min <= max; min++) { - const segment = segments[min]; - result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); - } - return result; -} - -export { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, allGeneratedPositionsFor, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, sourceContentFor, traceSegment }; -//# sourceMappingURL=trace-mapping.mjs.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map deleted file mode 100644 index e96aac2..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.mjs","sources":["../src/resolve.ts","../src/strip-filename.ts","../src/sourcemap-segment.ts","../src/sort.ts","../src/binary-search.ts","../src/by-source.ts","../src/any-map.ts","../src/trace-mapping.ts"],"sourcesContent":["import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMap,\n DecodedSourceMap,\n EncodedSourceMap,\n Section,\n SectionedSourceMap,\n SourceMapV3,\n Bias,\n EachMapping,\n GeneratedMapping,\n InvalidGeneratedMapping,\n InvalidOriginalMapping,\n Needle,\n OriginalMapping,\n OriginalMapping as Mapping,\n SectionedSourceMapInput,\n SourceMapInput,\n SourceNeedle,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names || [];\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment =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ell/trace-mapping/dist/trace-mapping.umd.js deleted file mode 100644 index c373bc3..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +++ /dev/null @@ -1,560 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/sourcemap-codec'), require('@jridgewell/resolve-uri')) : - typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/sourcemap-codec', '@jridgewell/resolve-uri'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.traceMapping = {}, global.sourcemapCodec, global.resolveURI)); -})(this, (function (exports, sourcemapCodec, resolveUri) { 'use strict'; - - function resolve(input, base) { - // The base is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - if (base && !base.endsWith('/')) - base += '/'; - return resolveUri(input, base); - } - - /** - * Removes everything after the last "/", but leaves the slash. - */ - function stripFilename(path) { - if (!path) - return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - - const COLUMN = 0; - const SOURCES_INDEX = 1; - const SOURCE_LINE = 2; - const SOURCE_COLUMN = 3; - const NAMES_INDEX = 4; - const REV_GENERATED_LINE = 1; - const REV_GENERATED_COLUMN = 2; - - function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) - return mappings; - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) - mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; - } - function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) - return i; - } - return mappings.length; - } - function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; - } - function sortSegments(line, owned) { - if (!owned) - line = line.slice(); - return line.sort(sortComparator); - } - function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; - } - - let found = false; - /** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ - function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } - else { - high = mid - 1; - } - } - found = false; - return low - 1; - } - function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; - } - function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) - break; - } - return index; - } - function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; - } - /** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ - function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } - else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return (state.lastIndex = binarySearch(haystack, needle, low, high)); - } - - // Rebuilds the original source files, with mappings that are ordered by source line/column instead - // of generated line/column. - function buildBySources(decoded, memos) { - const sources = memos.map(buildNullArray); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) - continue; - const sourceIndex = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const originalSource = sources[sourceIndex]; - const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); - const memo = memos[sourceIndex]; - // The binary search either found a match, or it found the left-index just before where the - // segment should go. Either way, we want to insert after that. And there may be multiple - // generated segments associated with an original location, so there may need to move several - // indexes before we find where we need to insert. - const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); - insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); - } - } - return sources; - } - function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; - } - // Null arrays allow us to use ordered index keys without actually allocating contiguous memory like - // a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. - // Numeric properties on objects are magically sorted in ascending order by the engine regardless of - // the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending - // order when iterating with for-in. - function buildNullArray() { - return { __proto__: null }; - } - - const AnyMap = function (map, mapUrl) { - const parsed = typeof map === 'string' ? JSON.parse(map) : map; - if (!('sections' in parsed)) - return new TraceMap(parsed, mapUrl); - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - }; - return exports.presortedDecodedMap(joined); - }; - function recurse(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { - const { sections } = input; - for (let i = 0; i < sections.length; i++) { - const { map, offset } = sections[i]; - let sl = stopLine; - let sc = stopColumn; - if (i + 1 < sections.length) { - const nextOffset = sections[i + 1].offset; - sl = Math.min(stopLine, lineOffset + nextOffset.line); - if (sl === stopLine) { - sc = Math.min(stopColumn, columnOffset + nextOffset.column); - } - else if (sl < stopLine) { - sc = columnOffset + nextOffset.column; - } - } - addSection(map, mapUrl, mappings, sources, sourcesContent, names, lineOffset + offset.line, columnOffset + offset.column, sl, sc); - } - } - function addSection(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { - if ('sections' in input) - return recurse(...arguments); - const map = new TraceMap(input, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = exports.decodedMappings(map); - const { resolvedSources, sourcesContent: contents } = map; - append(sources, resolvedSources); - append(names, map.names); - if (contents) - append(sourcesContent, contents); - else - for (let i = 0; i < resolvedSources.length; i++) - sourcesContent.push(null); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. But it may not have any columns that overstep, so we - // still need to check that we don't overstep lines, too. - if (lineI > stopLine) - return; - // The out line may already exist in mappings (if we're continuing the line started by a - // previous section). Or, we may have jumped ahead several lines to start this section. - const out = getLine(mappings, lineI); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (lineI === stopLine && column >= stopColumn) - return; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - out.push(seg.length === 4 - ? [column, sourcesIndex, sourceLine, sourceColumn] - : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); - } - } - } - function append(arr, other) { - for (let i = 0; i < other.length; i++) - arr.push(other[i]); - } - function getLine(arr, index) { - for (let i = arr.length; i <= index; i++) - arr[i] = []; - return arr[index]; - } - - const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; - const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; - const LEAST_UPPER_BOUND = -1; - const GREATEST_LOWER_BOUND = 1; - /** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ - exports.encodedMappings = void 0; - /** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ - exports.decodedMappings = void 0; - /** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ - exports.traceSegment = void 0; - /** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ - exports.originalPositionFor = void 0; - /** - * Finds the generated line/column position of the provided source/line/column source position. - */ - exports.generatedPositionFor = void 0; - /** - * Finds all generated line/column positions of the provided source/line/column source position. - */ - exports.allGeneratedPositionsFor = void 0; - /** - * Iterates each mapping in generated position order. - */ - exports.eachMapping = void 0; - /** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ - exports.sourceContentFor = void 0; - /** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ - exports.presortedDecodedMap = void 0; - /** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - exports.decodedMap = void 0; - /** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ - exports.encodedMap = void 0; - class TraceMap { - constructor(map, mapUrl) { - const isString = typeof map === 'string'; - if (!isString && map._decodedMemo) - return map; - const parsed = (isString ? JSON.parse(map) : map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names || []; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - const from = resolve(sourceRoot || '', stripFilename(mapUrl)); - this.resolvedSources = sources.map((s) => resolve(s || '', from)); - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } - else { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - } - } - (() => { - exports.encodedMappings = (map) => { - var _a; - return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = sourcemapCodec.encode(map._decoded))); - }; - exports.decodedMappings = (map) => { - return (map._decoded || (map._decoded = sourcemapCodec.decode(map._encoded))); - }; - exports.traceSegment = (map, line, column) => { - const decoded = exports.decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return null; - const segments = decoded[line]; - const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); - return index === -1 ? null : segments[index]; - }; - exports.originalPositionFor = (map, { line, column, bias }) => { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const decoded = exports.decodedMappings(map); - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) - return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); - if (index === -1) - return OMapping(null, null, null, null); - const segment = segments[index]; - if (segment.length === 1) - return OMapping(null, null, null, null); - const { names, resolvedSources } = map; - return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null); - }; - exports.allGeneratedPositionsFor = (map, { source, line, column, bias }) => { - // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); - }; - exports.generatedPositionFor = (map, { source, line, column, bias }) => { - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); - }; - exports.eachMapping = (map, cb) => { - const decoded = exports.decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) - name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name, - }); - } - } - }; - exports.sourceContentFor = (map, source) => { - const { sources, resolvedSources, sourcesContent } = map; - if (sourcesContent == null) - return null; - let index = sources.indexOf(source); - if (index === -1) - index = resolvedSources.indexOf(source); - return index === -1 ? null : sourcesContent[index]; - }; - exports.presortedDecodedMap = (map, mapUrl) => { - const tracer = new TraceMap(clone(map, []), mapUrl); - tracer._decoded = map.mappings; - return tracer; - }; - exports.decodedMap = (map) => { - return clone(map, exports.decodedMappings(map)); - }; - exports.encodedMap = (map) => { - return clone(map, exports.encodedMappings(map)); - }; - function generatedPosition(map, source, line, column, bias, all) { - line--; - if (line < 0) - throw new Error(LINE_GTR_ZERO); - if (column < 0) - throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex = sources.indexOf(source); - if (sourceIndex === -1) - sourceIndex = resolvedSources.indexOf(source); - if (sourceIndex === -1) - return all ? [] : GMapping(null, null); - const generated = (map._bySources || (map._bySources = buildBySources(exports.decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); - const segments = generated[sourceIndex][line]; - if (segments == null) - return all ? [] : GMapping(null, null); - const memo = map._bySourceMemos[sourceIndex]; - if (all) - return sliceGeneratedPositions(segments, memo, line, column, bias); - const index = traceSegmentInternal(segments, memo, line, column, bias); - if (index === -1) - return GMapping(null, null); - const segment = segments[index]; - return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); - } - })(); - function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - }; - } - function OMapping(source, line, column, name) { - return { source, line, column, name }; - } - function GMapping(line, column) { - return { line, column }; - } - function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } - else if (bias === LEAST_UPPER_BOUND) - index++; - if (index === -1 || index === segments.length) - return -1; - return index; - } - function sliceGeneratedPositions(segments, memo, line, column, bias) { - let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); - // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in - // insertion order) segment that matched. Even if we did respect the bias when tracing, we would - // still need to call `lowerBound()` to find the first segment, which is slower than just looking - // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the - // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to - // match LEAST_UPPER_BOUND. - if (!found && bias === LEAST_UPPER_BOUND) - min++; - if (min === -1 || min === segments.length) - return []; - // We may have found the segment that started at an earlier column. If this is the case, then we - // need to slice all generated segments that match _that_ column, because all such segments span - // to our desired column. - const matchedColumn = found ? column : segments[min][COLUMN]; - // The binary search is not guaranteed to find the lower bound when a match wasn't found. - if (!found) - min = lowerBound(segments, matchedColumn, min); - const max = upperBound(segments, matchedColumn, min); - const result = []; - for (; min <= max; min++) { - const segment = segments[min]; - result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); - } - return result; - } - - exports.AnyMap = AnyMap; - exports.GREATEST_LOWER_BOUND = GREATEST_LOWER_BOUND; - exports.LEAST_UPPER_BOUND = LEAST_UPPER_BOUND; - exports.TraceMap = TraceMap; - -})); -//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map deleted file mode 100644 index 3c326ed..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.umd.js","sources":["../src/resolve.ts","../src/strip-filename.ts","../src/sourcemap-segment.ts","../src/sort.ts","../src/binary-search.ts","../src/by-source.ts","../src/any-map.ts","../src/trace-mapping.ts"],"sourcesContent":["import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMap,\n DecodedSourceMap,\n EncodedSourceMap,\n Section,\n SectionedSourceMap,\n SourceMapV3,\n Bias,\n EachMapping,\n GeneratedMapping,\n InvalidGeneratedMapping,\n InvalidOriginalMapping,\n Needle,\n OriginalMapping,\n OriginalMapping as Mapping,\n SectionedSourceMapInput,\n SourceMapInput,\n SourceNeedle,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names || [];\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\n"],"names":["presortedDecodedMap","decodedMappings","encodedMappings","traceSegment","originalPositionFor","generatedPositionFor","allGeneratedPositionsFor","eachMapping","sourceContentFor","decodedMap","encodedMap","encode","decode","bsFound"],"mappings":";;;;;;IAEc,SAAU,OAAO,CAAC,KAAa,EAAE,IAAwB,EAAA;;;;QAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,IAAI,IAAI,GAAG,CAAC;IAE7C,IAAA,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjC;;ICTA;;IAEG;IACqB,SAAA,aAAa,CAAC,IAA+B,EAAA;IACnE,IAAA,IAAI,CAAC,IAAI;IAAE,QAAA,OAAO,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC;;ICQO,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC,CAAC;IACtB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC,CAAC;IAEtB,MAAM,kBAAkB,GAAG,CAAC,CAAC;IAC7B,MAAM,oBAAoB,GAAG,CAAC;;IClBvB,SAAU,SAAS,CAC/B,QAA8B,EAC9B,KAAc,EAAA;QAEd,MAAM,aAAa,GAAG,uBAAuB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3D,IAAA,IAAI,aAAa,KAAK,QAAQ,CAAC,MAAM;IAAE,QAAA,OAAO,QAAQ,CAAC;;;IAIvD,IAAA,IAAI,CAAC,KAAK;IAAE,QAAA,QAAQ,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;QAExC,KAAK,IAAI,CAAC,GAAG,aAAa,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM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ping/dist/types/any-map.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts deleted file mode 100644 index ec775fb..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { TraceMap } from './trace-mapping'; -import type { SectionedSourceMapInput } from './types'; -type AnyMap = { - new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; - (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; -}; -export declare const AnyMap: AnyMap; -export {}; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts deleted file mode 100644 index ecb2873..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; -export type MemoState = { - lastKey: number; - lastNeedle: number; - lastIndex: number; -}; -export declare let found: boolean; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; -export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function memoizedState(): MemoState; -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts deleted file mode 100644 index a91751c..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; -import type { MemoState } from './binary-search'; -export type Source = { - __proto__: null; - [line: number]: Exclude[]; -}; -export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: MemoState[]): Source[]; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts deleted file mode 100644 index cf7d4f8..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts deleted file mode 100644 index 2bfb5dc..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts deleted file mode 100644 index 6d4d318..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -type GeneratedLine = number; -export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export declare const REV_GENERATED_LINE = 1; -export declare const REV_GENERATED_COLUMN = 2; -export {}; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts deleted file mode 100644 index bead5c1..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export default function stripFilename(path: string | undefined | null): string; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts deleted file mode 100644 index f11c439..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping } from './types'; -export type { SourceMapSegment } from './sourcemap-segment'; -export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, } from './types'; -export declare const LEAST_UPPER_BOUND = -1; -export declare const GREATEST_LOWER_BOUND = 1; -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export declare let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings']; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export declare let decodedMappings: (map: TraceMap) => Readonly; -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -export declare let traceSegment: (map: TraceMap, line: number, column: number) => Readonly | null; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -export declare let originalPositionFor: (map: TraceMap, needle: Needle) => OriginalMapping | InvalidOriginalMapping; -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export declare let generatedPositionFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping | InvalidGeneratedMapping; -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export declare let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[]; -/** - * Iterates each mapping in generated position order. - */ -export declare let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void; -/** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ -export declare let sourceContentFor: (map: TraceMap, source: string) => string | null; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export declare let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare let decodedMap: (map: TraceMap) => Omit & { - mappings: readonly SourceMapSegment[][]; -}; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare let encodedMap: (map: TraceMap) => EncodedSourceMap; -export { AnyMap } from './any-map'; -export declare class TraceMap implements SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - resolvedSources: string[]; - private _encoded; - private _decoded; - private _decodedMemo; - private _bySources; - private _bySourceMemos; - constructor(map: SourceMapInput, mapUrl?: string | null); -} diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts deleted file mode 100644 index d881499..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping'; -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: SourceMapSegment[][]; -} -export interface Section { - offset: { - line: number; - column: number; - }; - map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; -} -export interface SectionedSourceMap { - file?: string | null; - sections: Section[]; - version: 3; -} -export type OriginalMapping = { - source: string | null; - line: number; - column: number; - name: string | null; -}; -export type InvalidOriginalMapping = { - source: null; - line: null; - column: null; - name: null; -}; -export type GeneratedMapping = { - line: number; - column: number; -}; -export type InvalidGeneratedMapping = { - line: null; - column: null; -}; -export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; -export type SourceMapInput = string | Ro | Ro | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | Ro; -export type Needle = { - line: number; - column: number; - bias?: Bias; -}; -export type SourceNeedle = { - source: string; - line: number; - column: number; - bias?: Bias; -}; -export type EachMapping = { - generatedLine: number; - generatedColumn: number; - source: null; - originalLine: null; - originalColumn: null; - name: null; -} | { - generatedLine: number; - generatedColumn: number; - source: string | null; - originalLine: number; - originalColumn: number; - name: string | null; -}; -export declare abstract class SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - resolvedSources: SourceMapV3['sources']; -} -export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; -type RoArray = Ro[]; -type RoObject = { - [K in keyof T]: T[K] | Ro; -}; -export {}; diff --git a/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@jridgewell/trace-mapping/package.json deleted file mode 100644 index 2b11a94..0000000 --- a/node_modules/@jridgewell/trace-mapping/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "@jridgewell/trace-mapping", - "version": "0.3.22", - "description": "Trace the original position through a source map", - "keywords": [ - "source", - "map" - ], - "main": "dist/trace-mapping.umd.js", - "module": "dist/trace-mapping.mjs", - "types": "dist/types/trace-mapping.d.ts", - "files": [ - "dist" - ], - "exports": { - ".": [ - { - "types": "./dist/types/trace-mapping.d.ts", - "browser": "./dist/trace-mapping.umd.js", - "require": "./dist/trace-mapping.umd.js", - "import": "./dist/trace-mapping.mjs" - }, - "./dist/trace-mapping.umd.js" - ], - "./package.json": "./package.json" - }, - "author": "Justin Ridgewell ", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/trace-mapping.git" - }, - "license": "MIT", - "scripts": { - "benchmark": "run-s build:rollup benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.mjs", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.mjs", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "prebuild": "rm -rf dist", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build", - "test": "run-s -n test:lint test:only", - "test:debug": "ava debug", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts' '**/*.md'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "c8 ava", - "test:watch": "ava --watch" - }, - "devDependencies": { - "@rollup/plugin-typescript": "11.1.6", - "@typescript-eslint/eslint-plugin": "6.18.1", - "@typescript-eslint/parser": "6.18.1", - "ava": "6.0.1", - "benchmark": "2.1.4", - "c8": "9.0.0", - "esbuild": "0.19.11", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-no-only-tests": "3.1.0", - "npm-run-all": "4.1.5", - "prettier": "3.1.1", - "rollup": "4.9.4", - "tsx": "4.7.0", - "typescript": "5.3.3" - }, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } -} diff --git a/node_modules/@tsconfig/node10/LICENSE b/node_modules/@tsconfig/node10/LICENSE deleted file mode 100644 index 48ea661..0000000 --- a/node_modules/@tsconfig/node10/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/node_modules/@tsconfig/node10/README.md b/node_modules/@tsconfig/node10/README.md deleted file mode 100644 index 7a32f81..0000000 --- a/node_modules/@tsconfig/node10/README.md +++ /dev/null @@ -1,40 +0,0 @@ -### A base TSConfig for working with Node 10. - -Add the package to your `"devDependencies"`: - -```sh -npm install --save-dev @tsconfig/node10 -yarn add --dev @tsconfig/node10 -``` - -Add to your `tsconfig.json`: - -```json -"extends": "@tsconfig/node10/tsconfig.json" -``` - ---- - -The `tsconfig.json`: - -```jsonc -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 10", - - "compilerOptions": { - "lib": ["es2018"], - "module": "commonjs", - "target": "es2018", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} - -``` - -You can find the [code here](https://github.com/tsconfig/bases/blob/master/bases/node10.json). diff --git a/node_modules/@tsconfig/node10/package.json b/node_modules/@tsconfig/node10/package.json deleted file mode 100644 index f2223fc..0000000 --- a/node_modules/@tsconfig/node10/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@tsconfig/node10","repository":{"type":"git","url":"https://github.com/tsconfig/bases.git","directory":"bases"},"license":"MIT","description":"A base TSConfig for working with Node 10.","keywords":["tsconfig","node10"],"version":"1.0.9"} \ No newline at end of file diff --git a/node_modules/@tsconfig/node10/tsconfig.json b/node_modules/@tsconfig/node10/tsconfig.json deleted file mode 100644 index 9cb33be..0000000 --- a/node_modules/@tsconfig/node10/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 10", - - "compilerOptions": { - "lib": ["es2018"], - "module": "commonjs", - "target": "es2018", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} diff --git a/node_modules/@tsconfig/node12/LICENSE b/node_modules/@tsconfig/node12/LICENSE deleted file mode 100644 index 48ea661..0000000 --- a/node_modules/@tsconfig/node12/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/node_modules/@tsconfig/node12/README.md b/node_modules/@tsconfig/node12/README.md deleted file mode 100644 index 6352ccd..0000000 --- a/node_modules/@tsconfig/node12/README.md +++ /dev/null @@ -1,40 +0,0 @@ -### A base TSConfig for working with Node 12. - -Add the package to your `"devDependencies"`: - -```sh -npm install --save-dev @tsconfig/node12 -yarn add --dev @tsconfig/node12 -``` - -Add to your `tsconfig.json`: - -```json -"extends": "@tsconfig/node12/tsconfig.json" -``` - ---- - -The `tsconfig.json`: - -```jsonc -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 12", - - "compilerOptions": { - "lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], - "module": "commonjs", - "target": "es2019", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} - -``` - -You can find the [code here](https://github.com/tsconfig/bases/blob/master/bases/node12.json). diff --git a/node_modules/@tsconfig/node12/package.json b/node_modules/@tsconfig/node12/package.json deleted file mode 100644 index 56aad61..0000000 --- a/node_modules/@tsconfig/node12/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@tsconfig/node12","repository":{"type":"git","url":"https://github.com/tsconfig/bases.git","directory":"bases"},"license":"MIT","description":"A base TSConfig for working with Node 12.","keywords":["tsconfig","node12"],"version":"1.0.11"} \ No newline at end of file diff --git a/node_modules/@tsconfig/node12/tsconfig.json b/node_modules/@tsconfig/node12/tsconfig.json deleted file mode 100644 index eeaf944..0000000 --- a/node_modules/@tsconfig/node12/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 12", - - "compilerOptions": { - "lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], - "module": "commonjs", - "target": "es2019", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} diff --git a/node_modules/@tsconfig/node14/LICENSE b/node_modules/@tsconfig/node14/LICENSE deleted file mode 100644 index 48ea661..0000000 --- a/node_modules/@tsconfig/node14/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/node_modules/@tsconfig/node14/README.md b/node_modules/@tsconfig/node14/README.md deleted file mode 100644 index dad7f02..0000000 --- a/node_modules/@tsconfig/node14/README.md +++ /dev/null @@ -1,40 +0,0 @@ -### A base TSConfig for working with Node 14. - -Add the package to your `"devDependencies"`: - -```sh -npm install --save-dev @tsconfig/node14 -yarn add --dev @tsconfig/node14 -``` - -Add to your `tsconfig.json`: - -```json -"extends": "@tsconfig/node14/tsconfig.json" -``` - ---- - -The `tsconfig.json`: - -```jsonc -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 14", - - "compilerOptions": { - "lib": ["es2020"], - "module": "commonjs", - "target": "es2020", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} - -``` - -You can find the [code here](https://github.com/tsconfig/bases/blob/master/bases/node14.json). diff --git a/node_modules/@tsconfig/node14/package.json b/node_modules/@tsconfig/node14/package.json deleted file mode 100644 index 742f97b..0000000 --- a/node_modules/@tsconfig/node14/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@tsconfig/node14","repository":{"type":"git","url":"https://github.com/tsconfig/bases.git","directory":"bases"},"license":"MIT","description":"A base TSConfig for working with Node 14.","keywords":["tsconfig","node14"],"version":"1.0.3"} \ No newline at end of file diff --git a/node_modules/@tsconfig/node14/tsconfig.json b/node_modules/@tsconfig/node14/tsconfig.json deleted file mode 100644 index d1d7551..0000000 --- a/node_modules/@tsconfig/node14/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 14", - - "compilerOptions": { - "lib": ["es2020"], - "module": "commonjs", - "target": "es2020", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} diff --git a/node_modules/@tsconfig/node16/LICENSE b/node_modules/@tsconfig/node16/LICENSE deleted file mode 100644 index 48ea661..0000000 --- a/node_modules/@tsconfig/node16/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/node_modules/@tsconfig/node16/README.md b/node_modules/@tsconfig/node16/README.md deleted file mode 100644 index 2946b2f..0000000 --- a/node_modules/@tsconfig/node16/README.md +++ /dev/null @@ -1,40 +0,0 @@ -### A base TSConfig for working with Node 16. - -Add the package to your `"devDependencies"`: - -```sh -npm install --save-dev @tsconfig/node16 -yarn add --dev @tsconfig/node16 -``` - -Add to your `tsconfig.json`: - -```json -"extends": "@tsconfig/node16/tsconfig.json" -``` - ---- - -The `tsconfig.json`: - -```jsonc -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 16", - - "compilerOptions": { - "lib": ["es2021"], - "module": "Node16", - "target": "es2021", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} - -``` - -You can find the [code here](https://github.com/tsconfig/bases/blob/master/bases/node16.json). diff --git a/node_modules/@tsconfig/node16/package.json b/node_modules/@tsconfig/node16/package.json deleted file mode 100644 index 8ccc97f..0000000 --- a/node_modules/@tsconfig/node16/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@tsconfig/node16", - "repository": { - "type": "git", - "url": "https://github.com/tsconfig/bases.git", - "directory": "bases" - }, - "license": "MIT", - "description": "A base TSConfig for working with Node 16.", - "keywords": [ - "tsconfig", - "node16" - ], - "version": "1.0.4" -} \ No newline at end of file diff --git a/node_modules/@tsconfig/node16/tsconfig.json b/node_modules/@tsconfig/node16/tsconfig.json deleted file mode 100644 index 2671912..0000000 --- a/node_modules/@tsconfig/node16/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 16", - - "compilerOptions": { - "lib": ["es2021"], - "module": "Node16", - "target": "es2021", - - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" - } -} diff --git a/node_modules/@types/eslint-scope/LICENSE b/node_modules/@types/eslint-scope/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/eslint-scope/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/eslint-scope/README.md b/node_modules/@types/eslint-scope/README.md deleted file mode 100644 index d06f926..0000000 --- a/node_modules/@types/eslint-scope/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Installation -> `npm install --save @types/eslint-scope` - -# Summary -This package contains type definitions for eslint-scope (https://github.com/eslint/eslint-scope). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope/index.d.ts) -````ts -import * as eslint from "eslint"; -import * as estree from "estree"; - -export const version: string; - -export class ScopeManager implements eslint.Scope.ScopeManager { - scopes: Scope[]; - globalScope: Scope; - acquire(node: {}, inner?: boolean): Scope | null; - getDeclaredVariables(node: {}): Variable[]; -} - -export class Scope implements eslint.Scope.Scope { - type: - | "block" - | "catch" - | "class" - | "for" - | "function" - | "function-expression-name" - | "global" - | "module" - | "switch" - | "with" - | "TDZ"; - isStrict: boolean; - upper: Scope | null; - childScopes: Scope[]; - variableScope: Scope; - block: estree.Node; - variables: Variable[]; - set: Map; - references: Reference[]; - through: Reference[]; - functionExpressionScope: boolean; -} - -export class Variable implements eslint.Scope.Variable { - name: string; - scope: Scope; - identifiers: estree.Identifier[]; - references: Reference[]; - defs: eslint.Scope.Definition[]; -} - -export class Reference implements eslint.Scope.Reference { - identifier: estree.Identifier; - from: Scope; - resolved: Variable | null; - writeExpr: estree.Node | null; - init: boolean; - - isWrite(): boolean; - isRead(): boolean; - isWriteOnly(): boolean; - isReadOnly(): boolean; - isReadWrite(): boolean; -} - -export interface AnalysisOptions { - optimistic?: boolean; - directive?: boolean; - ignoreEval?: boolean; - nodejsScope?: boolean; - impliedStrict?: boolean; - fallback?: string | ((node: {}) => string[]); - sourceType?: "script" | "module"; - ecmaVersion?: number; -} - -export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager; - -```` - -### Additional Details - * Last updated: Mon, 06 Nov 2023 22:41:05 GMT - * Dependencies: [@types/eslint](https://npmjs.com/package/@types/eslint), [@types/estree](https://npmjs.com/package/@types/estree) - -# Credits -These definitions were written by [Toru Nagashima](https://github.com/mysticatea). diff --git a/node_modules/@types/eslint-scope/index.d.ts b/node_modules/@types/eslint-scope/index.d.ts deleted file mode 100644 index 96e3fb3..0000000 --- a/node_modules/@types/eslint-scope/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import * as eslint from "eslint"; -import * as estree from "estree"; - -export const version: string; - -export class ScopeManager implements eslint.Scope.ScopeManager { - scopes: Scope[]; - globalScope: Scope; - acquire(node: {}, inner?: boolean): Scope | null; - getDeclaredVariables(node: {}): Variable[]; -} - -export class Scope implements eslint.Scope.Scope { - type: - | "block" - | "catch" - | "class" - | "for" - | "function" - | "function-expression-name" - | "global" - | "module" - | "switch" - | "with" - | "TDZ"; - isStrict: boolean; - upper: Scope | null; - childScopes: Scope[]; - variableScope: Scope; - block: estree.Node; - variables: Variable[]; - set: Map; - references: Reference[]; - through: Reference[]; - functionExpressionScope: boolean; -} - -export class Variable implements eslint.Scope.Variable { - name: string; - scope: Scope; - identifiers: estree.Identifier[]; - references: Reference[]; - defs: eslint.Scope.Definition[]; -} - -export class Reference implements eslint.Scope.Reference { - identifier: estree.Identifier; - from: Scope; - resolved: Variable | null; - writeExpr: estree.Node | null; - init: boolean; - - isWrite(): boolean; - isRead(): boolean; - isWriteOnly(): boolean; - isReadOnly(): boolean; - isReadWrite(): boolean; -} - -export interface AnalysisOptions { - optimistic?: boolean; - directive?: boolean; - ignoreEval?: boolean; - nodejsScope?: boolean; - impliedStrict?: boolean; - fallback?: string | ((node: {}) => string[]); - sourceType?: "script" | "module"; - ecmaVersion?: number; -} - -export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager; diff --git a/node_modules/@types/eslint-scope/package.json b/node_modules/@types/eslint-scope/package.json deleted file mode 100644 index 4dabc9b..0000000 --- a/node_modules/@types/eslint-scope/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@types/eslint-scope", - "version": "3.7.7", - "description": "TypeScript definitions for eslint-scope", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope", - "license": "MIT", - "contributors": [ - { - "name": "Toru Nagashima", - "githubUsername": "mysticatea", - "url": "https://github.com/mysticatea" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/eslint-scope" - }, - "scripts": {}, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - }, - "typesPublisherContentHash": "49eee35b78c19e2c83bc96ce190c7a88329006f876dd7f1fb378c1e8034fc8f2", - "typeScriptVersion": "4.5" -} \ No newline at end of file diff --git a/node_modules/@types/eslint/LICENSE b/node_modules/@types/eslint/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/eslint/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/eslint/README.md b/node_modules/@types/eslint/README.md deleted file mode 100644 index 22d2e56..0000000 --- a/node_modules/@types/eslint/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/eslint` - -# Summary -This package contains type definitions for eslint (https://eslint.org). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint. - -### Additional Details - * Last updated: Thu, 11 Jan 2024 02:18:24 GMT - * Dependencies: [@types/estree](https://npmjs.com/package/@types/estree), [@types/json-schema](https://npmjs.com/package/@types/json-schema) - -# Credits -These definitions were written by [Pierre-Marie Dartus](https://github.com/pmdartus), [Jed Fox](https://github.com/j-f1), [Saad Quadri](https://github.com/saadq), [Jason Kwok](https://github.com/JasonHK), [Brad Zacher](https://github.com/bradzacher), and [JounQin](https://github.com/JounQin). diff --git a/node_modules/@types/eslint/helpers.d.ts b/node_modules/@types/eslint/helpers.d.ts deleted file mode 100644 index 0cf2141..0000000 --- a/node_modules/@types/eslint/helpers.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -type Prepend = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any - ? Result - : never; diff --git a/node_modules/@types/eslint/index.d.ts b/node_modules/@types/eslint/index.d.ts deleted file mode 100644 index 3af1c5a..0000000 --- a/node_modules/@types/eslint/index.d.ts +++ /dev/null @@ -1,1491 +0,0 @@ -/// - -import * as ESTree from "estree"; -import { JSONSchema4 } from "json-schema"; - -export namespace AST { - type TokenType = - | "Boolean" - | "Null" - | "Identifier" - | "Keyword" - | "Punctuator" - | "JSXIdentifier" - | "JSXText" - | "Numeric" - | "String" - | "RegularExpression"; - - interface Token { - type: TokenType; - value: string; - range: Range; - loc: SourceLocation; - } - - interface SourceLocation { - start: ESTree.Position; - end: ESTree.Position; - } - - type Range = [number, number]; - - interface Program extends ESTree.Program { - comments: ESTree.Comment[]; - tokens: Token[]; - loc: SourceLocation; - range: Range; - } -} - -export namespace Scope { - interface ScopeManager { - scopes: Scope[]; - globalScope: Scope | null; - - acquire(node: ESTree.Node, inner?: boolean): Scope | null; - - getDeclaredVariables(node: ESTree.Node): Variable[]; - } - - interface Scope { - type: - | "block" - | "catch" - | "class" - | "for" - | "function" - | "function-expression-name" - | "global" - | "module" - | "switch" - | "with" - | "TDZ"; - isStrict: boolean; - upper: Scope | null; - childScopes: Scope[]; - variableScope: Scope; - block: ESTree.Node; - variables: Variable[]; - set: Map; - references: Reference[]; - through: Reference[]; - functionExpressionScope: boolean; - } - - interface Variable { - name: string; - scope: Scope; - identifiers: ESTree.Identifier[]; - references: Reference[]; - defs: Definition[]; - } - - interface Reference { - identifier: ESTree.Identifier; - from: Scope; - resolved: Variable | null; - writeExpr: ESTree.Node | null; - init: boolean; - - isWrite(): boolean; - - isRead(): boolean; - - isWriteOnly(): boolean; - - isReadOnly(): boolean; - - isReadWrite(): boolean; - } - - type DefinitionType = - | { type: "CatchClause"; node: ESTree.CatchClause; parent: null } - | { type: "ClassName"; node: ESTree.ClassDeclaration | ESTree.ClassExpression; parent: null } - | { type: "FunctionName"; node: ESTree.FunctionDeclaration | ESTree.FunctionExpression; parent: null } - | { type: "ImplicitGlobalVariable"; node: ESTree.Program; parent: null } - | { - type: "ImportBinding"; - node: ESTree.ImportSpecifier | ESTree.ImportDefaultSpecifier | ESTree.ImportNamespaceSpecifier; - parent: ESTree.ImportDeclaration; - } - | { - type: "Parameter"; - node: ESTree.FunctionDeclaration | ESTree.FunctionExpression | ESTree.ArrowFunctionExpression; - parent: null; - } - | { type: "TDZ"; node: any; parent: null } - | { type: "Variable"; node: ESTree.VariableDeclarator; parent: ESTree.VariableDeclaration }; - - type Definition = DefinitionType & { name: ESTree.Identifier }; -} - -// #region SourceCode - -export class SourceCode { - text: string; - ast: AST.Program; - lines: string[]; - hasBOM: boolean; - parserServices: SourceCode.ParserServices; - scopeManager: Scope.ScopeManager; - visitorKeys: SourceCode.VisitorKeys; - - constructor(text: string, ast: AST.Program); - constructor(config: SourceCode.Config); - - static splitLines(text: string): string[]; - - getText(node?: ESTree.Node, beforeCount?: number, afterCount?: number): string; - - getLines(): string[]; - - getAllComments(): ESTree.Comment[]; - - getAncestors(node: ESTree.Node): ESTree.Node[]; - - getComments(node: ESTree.Node): { leading: ESTree.Comment[]; trailing: ESTree.Comment[] }; - - getDeclaredVariables(node: ESTree.Node): Scope.Variable[]; - - getJSDocComment(node: ESTree.Node): ESTree.Comment | null; - - getNodeByRangeIndex(index: number): ESTree.Node | null; - - isSpaceBetweenTokens(first: AST.Token, second: AST.Token): boolean; - - getLocFromIndex(index: number): ESTree.Position; - - getIndexFromLoc(location: ESTree.Position): number; - - // Inherited methods from TokenStore - // --------------------------------- - - getTokenByRangeStart(offset: number, options?: { includeComments: false }): AST.Token | null; - getTokenByRangeStart(offset: number, options: { includeComments: boolean }): AST.Token | ESTree.Comment | null; - - getFirstToken: SourceCode.UnaryNodeCursorWithSkipOptions; - - getFirstTokens: SourceCode.UnaryNodeCursorWithCountOptions; - - getLastToken: SourceCode.UnaryNodeCursorWithSkipOptions; - - getLastTokens: SourceCode.UnaryNodeCursorWithCountOptions; - - getTokenBefore: SourceCode.UnaryCursorWithSkipOptions; - - getTokensBefore: SourceCode.UnaryCursorWithCountOptions; - - getTokenAfter: SourceCode.UnaryCursorWithSkipOptions; - - getTokensAfter: SourceCode.UnaryCursorWithCountOptions; - - getFirstTokenBetween: SourceCode.BinaryCursorWithSkipOptions; - - getFirstTokensBetween: SourceCode.BinaryCursorWithCountOptions; - - getLastTokenBetween: SourceCode.BinaryCursorWithSkipOptions; - - getLastTokensBetween: SourceCode.BinaryCursorWithCountOptions; - - getTokensBetween: SourceCode.BinaryCursorWithCountOptions; - - getTokens: - & ((node: ESTree.Node, beforeCount?: number, afterCount?: number) => AST.Token[]) - & SourceCode.UnaryNodeCursorWithCountOptions; - - commentsExistBetween( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - ): boolean; - - getCommentsBefore(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[]; - - getCommentsAfter(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[]; - - getCommentsInside(node: ESTree.Node): ESTree.Comment[]; - - getScope(node: ESTree.Node): Scope.Scope; - - isSpaceBetween( - first: ESTree.Node | AST.Token, - second: ESTree.Node | AST.Token, - ): boolean; - - markVariableAsUsed(name: string, refNode?: ESTree.Node): boolean; -} - -export namespace SourceCode { - interface Config { - text: string; - ast: AST.Program; - parserServices?: ParserServices | undefined; - scopeManager?: Scope.ScopeManager | undefined; - visitorKeys?: VisitorKeys | undefined; - } - - type ParserServices = any; - - interface VisitorKeys { - [nodeType: string]: string[]; - } - - interface UnaryNodeCursorWithSkipOptions { - ( - node: ESTree.Node, - options: - | ((token: AST.Token) => token is T) - | { - filter: (token: AST.Token) => token is T; - includeComments?: false | undefined; - skip?: number | undefined; - }, - ): T | null; - ( - node: ESTree.Node, - options: { - filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; - includeComments: boolean; - skip?: number | undefined; - }, - ): T | null; - ( - node: ESTree.Node, - options?: - | { - filter?: ((token: AST.Token) => boolean) | undefined; - includeComments?: false | undefined; - skip?: number | undefined; - } - | ((token: AST.Token) => boolean) - | number, - ): AST.Token | null; - ( - node: ESTree.Node, - options: { - filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; - includeComments: boolean; - skip?: number | undefined; - }, - ): AST.Token | ESTree.Comment | null; - } - - interface UnaryNodeCursorWithCountOptions { - ( - node: ESTree.Node, - options: - | ((token: AST.Token) => token is T) - | { - filter: (token: AST.Token) => token is T; - includeComments?: false | undefined; - count?: number | undefined; - }, - ): T[]; - ( - node: ESTree.Node, - options: { - filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; - includeComments: boolean; - count?: number | undefined; - }, - ): T[]; - ( - node: ESTree.Node, - options?: - | { - filter?: ((token: AST.Token) => boolean) | undefined; - includeComments?: false | undefined; - count?: number | undefined; - } - | ((token: AST.Token) => boolean) - | number, - ): AST.Token[]; - ( - node: ESTree.Node, - options: { - filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; - includeComments: boolean; - count?: number | undefined; - }, - ): Array; - } - - interface UnaryCursorWithSkipOptions { - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options: - | ((token: AST.Token) => token is T) - | { - filter: (token: AST.Token) => token is T; - includeComments?: false | undefined; - skip?: number | undefined; - }, - ): T | null; - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; - includeComments: boolean; - skip?: number | undefined; - }, - ): T | null; - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options?: - | { - filter?: ((token: AST.Token) => boolean) | undefined; - includeComments?: false | undefined; - skip?: number | undefined; - } - | ((token: AST.Token) => boolean) - | number, - ): AST.Token | null; - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; - includeComments: boolean; - skip?: number | undefined; - }, - ): AST.Token | ESTree.Comment | null; - } - - interface UnaryCursorWithCountOptions { - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options: - | ((token: AST.Token) => token is T) - | { - filter: (token: AST.Token) => token is T; - includeComments?: false | undefined; - count?: number | undefined; - }, - ): T[]; - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; - includeComments: boolean; - count?: number | undefined; - }, - ): T[]; - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options?: - | { - filter?: ((token: AST.Token) => boolean) | undefined; - includeComments?: false | undefined; - count?: number | undefined; - } - | ((token: AST.Token) => boolean) - | number, - ): AST.Token[]; - ( - node: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; - includeComments: boolean; - count?: number | undefined; - }, - ): Array; - } - - interface BinaryCursorWithSkipOptions { - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options: - | ((token: AST.Token) => token is T) - | { - filter: (token: AST.Token) => token is T; - includeComments?: false | undefined; - skip?: number | undefined; - }, - ): T | null; - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; - includeComments: boolean; - skip?: number | undefined; - }, - ): T | null; - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options?: - | { - filter?: ((token: AST.Token) => boolean) | undefined; - includeComments?: false | undefined; - skip?: number | undefined; - } - | ((token: AST.Token) => boolean) - | number, - ): AST.Token | null; - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; - includeComments: boolean; - skip?: number | undefined; - }, - ): AST.Token | ESTree.Comment | null; - } - - interface BinaryCursorWithCountOptions { - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options: - | ((token: AST.Token) => token is T) - | { - filter: (token: AST.Token) => token is T; - includeComments?: false | undefined; - count?: number | undefined; - }, - ): T[]; - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; - includeComments: boolean; - count?: number | undefined; - }, - ): T[]; - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options?: - | { - filter?: ((token: AST.Token) => boolean) | undefined; - includeComments?: false | undefined; - count?: number | undefined; - } - | ((token: AST.Token) => boolean) - | number, - ): AST.Token[]; - ( - left: ESTree.Node | AST.Token | ESTree.Comment, - right: ESTree.Node | AST.Token | ESTree.Comment, - options: { - filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; - includeComments: boolean; - count?: number | undefined; - }, - ): Array; - } -} - -// #endregion - -export namespace Rule { - /** - * TODO: Old style rules are planned to be removed in v9, remove this type then (https://github.com/eslint/rfcs/blob/main/designs/2021-schema-object-rules/README.md) - * @deprecated Use `RuleModule` instead. - */ - type OldStyleRule = RuleModule["create"]; - - interface RuleModule { - create(context: RuleContext): RuleListener; - meta?: RuleMetaData | undefined; - schema?: RuleMetaData["schema"]; - } - - type NodeTypes = ESTree.Node["type"]; - interface NodeListener { - ArrayExpression?: ((node: ESTree.ArrayExpression & NodeParentExtension) => void) | undefined; - "ArrayExpression:exit"?: ((node: ESTree.ArrayExpression & NodeParentExtension) => void) | undefined; - ArrayPattern?: ((node: ESTree.ArrayPattern & NodeParentExtension) => void) | undefined; - "ArrayPattern:exit"?: ((node: ESTree.ArrayPattern & NodeParentExtension) => void) | undefined; - ArrowFunctionExpression?: ((node: ESTree.ArrowFunctionExpression & NodeParentExtension) => void) | undefined; - "ArrowFunctionExpression:exit"?: - | ((node: ESTree.ArrowFunctionExpression & NodeParentExtension) => void) - | undefined; - AssignmentExpression?: ((node: ESTree.AssignmentExpression & NodeParentExtension) => void) | undefined; - "AssignmentExpression:exit"?: ((node: ESTree.AssignmentExpression & NodeParentExtension) => void) | undefined; - AssignmentPattern?: ((node: ESTree.AssignmentPattern & NodeParentExtension) => void) | undefined; - "AssignmentPattern:exit"?: ((node: ESTree.AssignmentPattern & NodeParentExtension) => void) | undefined; - AwaitExpression?: ((node: ESTree.AwaitExpression & NodeParentExtension) => void) | undefined; - "AwaitExpression:exit"?: ((node: ESTree.AwaitExpression & NodeParentExtension) => void) | undefined; - BinaryExpression?: ((node: ESTree.BinaryExpression & NodeParentExtension) => void) | undefined; - "BinaryExpression:exit"?: ((node: ESTree.BinaryExpression & NodeParentExtension) => void) | undefined; - BlockStatement?: ((node: ESTree.BlockStatement & NodeParentExtension) => void) | undefined; - "BlockStatement:exit"?: ((node: ESTree.BlockStatement & NodeParentExtension) => void) | undefined; - BreakStatement?: ((node: ESTree.BreakStatement & NodeParentExtension) => void) | undefined; - "BreakStatement:exit"?: ((node: ESTree.BreakStatement & NodeParentExtension) => void) | undefined; - CallExpression?: ((node: ESTree.CallExpression & NodeParentExtension) => void) | undefined; - "CallExpression:exit"?: ((node: ESTree.CallExpression & NodeParentExtension) => void) | undefined; - CatchClause?: ((node: ESTree.CatchClause & NodeParentExtension) => void) | undefined; - "CatchClause:exit"?: ((node: ESTree.CatchClause & NodeParentExtension) => void) | undefined; - ChainExpression?: ((node: ESTree.ChainExpression & NodeParentExtension) => void) | undefined; - "ChainExpression:exit"?: ((node: ESTree.ChainExpression & NodeParentExtension) => void) | undefined; - ClassBody?: ((node: ESTree.ClassBody & NodeParentExtension) => void) | undefined; - "ClassBody:exit"?: ((node: ESTree.ClassBody & NodeParentExtension) => void) | undefined; - ClassDeclaration?: ((node: ESTree.ClassDeclaration & NodeParentExtension) => void) | undefined; - "ClassDeclaration:exit"?: ((node: ESTree.ClassDeclaration & NodeParentExtension) => void) | undefined; - ClassExpression?: ((node: ESTree.ClassExpression & NodeParentExtension) => void) | undefined; - "ClassExpression:exit"?: ((node: ESTree.ClassExpression & NodeParentExtension) => void) | undefined; - ConditionalExpression?: ((node: ESTree.ConditionalExpression & NodeParentExtension) => void) | undefined; - "ConditionalExpression:exit"?: ((node: ESTree.ConditionalExpression & NodeParentExtension) => void) | undefined; - ContinueStatement?: ((node: ESTree.ContinueStatement & NodeParentExtension) => void) | undefined; - "ContinueStatement:exit"?: ((node: ESTree.ContinueStatement & NodeParentExtension) => void) | undefined; - DebuggerStatement?: ((node: ESTree.DebuggerStatement & NodeParentExtension) => void) | undefined; - "DebuggerStatement:exit"?: ((node: ESTree.DebuggerStatement & NodeParentExtension) => void) | undefined; - DoWhileStatement?: ((node: ESTree.DoWhileStatement & NodeParentExtension) => void) | undefined; - "DoWhileStatement:exit"?: ((node: ESTree.DoWhileStatement & NodeParentExtension) => void) | undefined; - EmptyStatement?: ((node: ESTree.EmptyStatement & NodeParentExtension) => void) | undefined; - "EmptyStatement:exit"?: ((node: ESTree.EmptyStatement & NodeParentExtension) => void) | undefined; - ExportAllDeclaration?: ((node: ESTree.ExportAllDeclaration & NodeParentExtension) => void) | undefined; - "ExportAllDeclaration:exit"?: ((node: ESTree.ExportAllDeclaration & NodeParentExtension) => void) | undefined; - ExportDefaultDeclaration?: ((node: ESTree.ExportDefaultDeclaration & NodeParentExtension) => void) | undefined; - "ExportDefaultDeclaration:exit"?: - | ((node: ESTree.ExportDefaultDeclaration & NodeParentExtension) => void) - | undefined; - ExportNamedDeclaration?: ((node: ESTree.ExportNamedDeclaration & NodeParentExtension) => void) | undefined; - "ExportNamedDeclaration:exit"?: - | ((node: ESTree.ExportNamedDeclaration & NodeParentExtension) => void) - | undefined; - ExportSpecifier?: ((node: ESTree.ExportSpecifier & NodeParentExtension) => void) | undefined; - "ExportSpecifier:exit"?: ((node: ESTree.ExportSpecifier & NodeParentExtension) => void) | undefined; - ExpressionStatement?: ((node: ESTree.ExpressionStatement & NodeParentExtension) => void) | undefined; - "ExpressionStatement:exit"?: ((node: ESTree.ExpressionStatement & NodeParentExtension) => void) | undefined; - ForInStatement?: ((node: ESTree.ForInStatement & NodeParentExtension) => void) | undefined; - "ForInStatement:exit"?: ((node: ESTree.ForInStatement & NodeParentExtension) => void) | undefined; - ForOfStatement?: ((node: ESTree.ForOfStatement & NodeParentExtension) => void) | undefined; - "ForOfStatement:exit"?: ((node: ESTree.ForOfStatement & NodeParentExtension) => void) | undefined; - ForStatement?: ((node: ESTree.ForStatement & NodeParentExtension) => void) | undefined; - "ForStatement:exit"?: ((node: ESTree.ForStatement & NodeParentExtension) => void) | undefined; - FunctionDeclaration?: ((node: ESTree.FunctionDeclaration & NodeParentExtension) => void) | undefined; - "FunctionDeclaration:exit"?: ((node: ESTree.FunctionDeclaration & NodeParentExtension) => void) | undefined; - FunctionExpression?: ((node: ESTree.FunctionExpression & NodeParentExtension) => void) | undefined; - "FunctionExpression:exit"?: ((node: ESTree.FunctionExpression & NodeParentExtension) => void) | undefined; - Identifier?: ((node: ESTree.Identifier & NodeParentExtension) => void) | undefined; - "Identifier:exit"?: ((node: ESTree.Identifier & NodeParentExtension) => void) | undefined; - IfStatement?: ((node: ESTree.IfStatement & NodeParentExtension) => void) | undefined; - "IfStatement:exit"?: ((node: ESTree.IfStatement & NodeParentExtension) => void) | undefined; - ImportDeclaration?: ((node: ESTree.ImportDeclaration & NodeParentExtension) => void) | undefined; - "ImportDeclaration:exit"?: ((node: ESTree.ImportDeclaration & NodeParentExtension) => void) | undefined; - ImportDefaultSpecifier?: ((node: ESTree.ImportDefaultSpecifier & NodeParentExtension) => void) | undefined; - "ImportDefaultSpecifier:exit"?: - | ((node: ESTree.ImportDefaultSpecifier & NodeParentExtension) => void) - | undefined; - ImportExpression?: ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined; - "ImportExpression:exit"?: ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined; - ImportNamespaceSpecifier?: ((node: ESTree.ImportNamespaceSpecifier & NodeParentExtension) => void) | undefined; - "ImportNamespaceSpecifier:exit"?: - | ((node: ESTree.ImportNamespaceSpecifier & NodeParentExtension) => void) - | undefined; - ImportSpecifier?: ((node: ESTree.ImportSpecifier & NodeParentExtension) => void) | undefined; - "ImportSpecifier:exit"?: ((node: ESTree.ImportSpecifier & NodeParentExtension) => void) | undefined; - LabeledStatement?: ((node: ESTree.LabeledStatement & NodeParentExtension) => void) | undefined; - "LabeledStatement:exit"?: ((node: ESTree.LabeledStatement & NodeParentExtension) => void) | undefined; - Literal?: ((node: ESTree.Literal & NodeParentExtension) => void) | undefined; - "Literal:exit"?: ((node: ESTree.Literal & NodeParentExtension) => void) | undefined; - LogicalExpression?: ((node: ESTree.LogicalExpression & NodeParentExtension) => void) | undefined; - "LogicalExpression:exit"?: ((node: ESTree.LogicalExpression & NodeParentExtension) => void) | undefined; - MemberExpression?: ((node: ESTree.MemberExpression & NodeParentExtension) => void) | undefined; - "MemberExpression:exit"?: ((node: ESTree.MemberExpression & NodeParentExtension) => void) | undefined; - MetaProperty?: ((node: ESTree.MetaProperty & NodeParentExtension) => void) | undefined; - "MetaProperty:exit"?: ((node: ESTree.MetaProperty & NodeParentExtension) => void) | undefined; - MethodDefinition?: ((node: ESTree.MethodDefinition & NodeParentExtension) => void) | undefined; - "MethodDefinition:exit"?: ((node: ESTree.MethodDefinition & NodeParentExtension) => void) | undefined; - NewExpression?: ((node: ESTree.NewExpression & NodeParentExtension) => void) | undefined; - "NewExpression:exit"?: ((node: ESTree.NewExpression & NodeParentExtension) => void) | undefined; - ObjectExpression?: ((node: ESTree.ObjectExpression & NodeParentExtension) => void) | undefined; - "ObjectExpression:exit"?: ((node: ESTree.ObjectExpression & NodeParentExtension) => void) | undefined; - ObjectPattern?: ((node: ESTree.ObjectPattern & NodeParentExtension) => void) | undefined; - "ObjectPattern:exit"?: ((node: ESTree.ObjectPattern & NodeParentExtension) => void) | undefined; - PrivateIdentifier?: ((node: ESTree.PrivateIdentifier & NodeParentExtension) => void) | undefined; - "PrivateIdentifier:exit"?: ((node: ESTree.PrivateIdentifier & NodeParentExtension) => void) | undefined; - Program?: ((node: ESTree.Program) => void) | undefined; - "Program:exit"?: ((node: ESTree.Program) => void) | undefined; - Property?: ((node: ESTree.Property & NodeParentExtension) => void) | undefined; - "Property:exit"?: ((node: ESTree.Property & NodeParentExtension) => void) | undefined; - PropertyDefinition?: ((node: ESTree.PropertyDefinition & NodeParentExtension) => void) | undefined; - "PropertyDefinition:exit"?: ((node: ESTree.PropertyDefinition & NodeParentExtension) => void) | undefined; - RestElement?: ((node: ESTree.RestElement & NodeParentExtension) => void) | undefined; - "RestElement:exit"?: ((node: ESTree.RestElement & NodeParentExtension) => void) | undefined; - ReturnStatement?: ((node: ESTree.ReturnStatement & NodeParentExtension) => void) | undefined; - "ReturnStatement:exit"?: ((node: ESTree.ReturnStatement & NodeParentExtension) => void) | undefined; - SequenceExpression?: ((node: ESTree.SequenceExpression & NodeParentExtension) => void) | undefined; - "SequenceExpression:exit"?: ((node: ESTree.SequenceExpression & NodeParentExtension) => void) | undefined; - SpreadElement?: ((node: ESTree.SpreadElement & NodeParentExtension) => void) | undefined; - "SpreadElement:exit"?: ((node: ESTree.SpreadElement & NodeParentExtension) => void) | undefined; - StaticBlock?: ((node: ESTree.StaticBlock & NodeParentExtension) => void) | undefined; - "StaticBlock:exit"?: ((node: ESTree.StaticBlock & NodeParentExtension) => void) | undefined; - Super?: ((node: ESTree.Super & NodeParentExtension) => void) | undefined; - "Super:exit"?: ((node: ESTree.Super & NodeParentExtension) => void) | undefined; - SwitchCase?: ((node: ESTree.SwitchCase & NodeParentExtension) => void) | undefined; - "SwitchCase:exit"?: ((node: ESTree.SwitchCase & NodeParentExtension) => void) | undefined; - SwitchStatement?: ((node: ESTree.SwitchStatement & NodeParentExtension) => void) | undefined; - "SwitchStatement:exit"?: ((node: ESTree.SwitchStatement & NodeParentExtension) => void) | undefined; - TaggedTemplateExpression?: ((node: ESTree.TaggedTemplateExpression & NodeParentExtension) => void) | undefined; - "TaggedTemplateExpression:exit"?: - | ((node: ESTree.TaggedTemplateExpression & NodeParentExtension) => void) - | undefined; - TemplateElement?: ((node: ESTree.TemplateElement & NodeParentExtension) => void) | undefined; - "TemplateElement:exit"?: ((node: ESTree.TemplateElement & NodeParentExtension) => void) | undefined; - TemplateLiteral?: ((node: ESTree.TemplateLiteral & NodeParentExtension) => void) | undefined; - "TemplateLiteral:exit"?: ((node: ESTree.TemplateLiteral & NodeParentExtension) => void) | undefined; - ThisExpression?: ((node: ESTree.ThisExpression & NodeParentExtension) => void) | undefined; - "ThisExpression:exit"?: ((node: ESTree.ThisExpression & NodeParentExtension) => void) | undefined; - ThrowStatement?: ((node: ESTree.ThrowStatement & NodeParentExtension) => void) | undefined; - "ThrowStatement:exit"?: ((node: ESTree.ThrowStatement & NodeParentExtension) => void) | undefined; - TryStatement?: ((node: ESTree.TryStatement & NodeParentExtension) => void) | undefined; - "TryStatement:exit"?: ((node: ESTree.TryStatement & NodeParentExtension) => void) | undefined; - UnaryExpression?: ((node: ESTree.UnaryExpression & NodeParentExtension) => void) | undefined; - "UnaryExpression:exit"?: ((node: ESTree.UnaryExpression & NodeParentExtension) => void) | undefined; - UpdateExpression?: ((node: ESTree.UpdateExpression & NodeParentExtension) => void) | undefined; - "UpdateExpression:exit"?: ((node: ESTree.UpdateExpression & NodeParentExtension) => void) | undefined; - VariableDeclaration?: ((node: ESTree.VariableDeclaration & NodeParentExtension) => void) | undefined; - "VariableDeclaration:exit"?: ((node: ESTree.VariableDeclaration & NodeParentExtension) => void) | undefined; - VariableDeclarator?: ((node: ESTree.VariableDeclarator & NodeParentExtension) => void) | undefined; - "VariableDeclarator:exit"?: ((node: ESTree.VariableDeclarator & NodeParentExtension) => void) | undefined; - WhileStatement?: ((node: ESTree.WhileStatement & NodeParentExtension) => void) | undefined; - "WhileStatement:exit"?: ((node: ESTree.WhileStatement & NodeParentExtension) => void) | undefined; - WithStatement?: ((node: ESTree.WithStatement & NodeParentExtension) => void) | undefined; - "WithStatement:exit"?: ((node: ESTree.WithStatement & NodeParentExtension) => void) | undefined; - YieldExpression?: ((node: ESTree.YieldExpression & NodeParentExtension) => void) | undefined; - "YieldExpression:exit"?: ((node: ESTree.YieldExpression & NodeParentExtension) => void) | undefined; - } - - interface NodeParentExtension { - parent: Node; - } - type Node = ESTree.Node & NodeParentExtension; - - interface RuleListener extends NodeListener { - onCodePathStart?(codePath: CodePath, node: Node): void; - - onCodePathEnd?(codePath: CodePath, node: Node): void; - - onCodePathSegmentStart?(segment: CodePathSegment, node: Node): void; - - onCodePathSegmentEnd?(segment: CodePathSegment, node: Node): void; - - onCodePathSegmentLoop?(fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node): void; - - [key: string]: - | ((codePath: CodePath, node: Node) => void) - | ((segment: CodePathSegment, node: Node) => void) - | ((fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node) => void) - | ((node: Node) => void) - | NodeListener[keyof NodeListener] - | undefined; - } - - interface CodePath { - id: string; - initialSegment: CodePathSegment; - finalSegments: CodePathSegment[]; - returnedSegments: CodePathSegment[]; - thrownSegments: CodePathSegment[]; - currentSegments: CodePathSegment[]; - upper: CodePath | null; - childCodePaths: CodePath[]; - } - - interface CodePathSegment { - id: string; - nextSegments: CodePathSegment[]; - prevSegments: CodePathSegment[]; - reachable: boolean; - } - - interface RuleMetaData { - docs?: { - /** Provides a short description of the rule. */ - description?: string | undefined; - /** - * TODO: remove this field in next major release of @types/eslint. - * @deprecated no longer used - */ - category?: string | undefined; - /** Whether the rule is enabled in the plugin's `recommended` configuration. */ - recommended?: boolean | undefined; - /** Specifies the URL at which the full documentation can be accessed (enabling code editors to provide a helpful link on highlighted rule violations). */ - url?: string | undefined; - /** - * TODO: remove this field in next major release of @types/eslint. - * @deprecated use `meta.hasSuggestions` instead - */ - suggestion?: boolean | undefined; - } | undefined; - /** Violation and suggestion messages. */ - messages?: { [messageId: string]: string } | undefined; - /** - * Specifies if the `--fix` option on the command line automatically fixes problems reported by the rule. - * Mandatory for fixable rules. - */ - fixable?: "code" | "whitespace" | undefined; - /** - * Specifies the [options](https://eslint.org/docs/latest/developer-guide/working-with-rules#options-schemas) - * so ESLint can prevent invalid [rule configurations](https://eslint.org/docs/latest/user-guide/configuring/rules#configuring-rules). - * TODO: schema is potentially planned to be no longer be optional in v9 (https://github.com/eslint/rfcs/blob/main/designs/2021-schema-object-rules/README.md) - */ - schema?: JSONSchema4 | JSONSchema4[] | undefined; - - /** Indicates whether the rule has been deprecated. Omit if not deprecated. */ - deprecated?: boolean | undefined; - /** The name of the rule(s) this rule was replaced by, if it was deprecated. */ - replacedBy?: readonly string[]; - - /** - * Indicates the type of rule: - * - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve. - * - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed. - * - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, - * all the parts of the program that determine how the code looks rather than how it executes. - * These rules work on parts of the code that aren’t specified in the AST. - */ - type?: "problem" | "suggestion" | "layout" | undefined; - /** - * Specifies whether the rule can return suggestions (defaults to `false` if omitted). - * Mandatory for rules that provide suggestions. - */ - hasSuggestions?: boolean | undefined; - } - - interface RuleContext { - id: string; - options: any[]; - settings: { [name: string]: any }; - parserPath: string | undefined; - languageOptions: Linter.FlatConfig["languageOptions"]; - parserOptions: Linter.ParserOptions; - parserServices: SourceCode.ParserServices; - cwd: string; - filename: string; - physicalFilename: string; - sourceCode: SourceCode; - - getAncestors(): ESTree.Node[]; - - getDeclaredVariables(node: ESTree.Node): Scope.Variable[]; - - /** @deprecated Use property `filename` directly instead */ - getFilename(): string; - - /** @deprecated Use property `physicalFilename` directly instead */ - getPhysicalFilename(): string; - - /** @deprecated Use property `cwd` directly instead */ - getCwd(): string; - - getScope(): Scope.Scope; - - /** @deprecated Use property `sourceCode` directly instead */ - getSourceCode(): SourceCode; - - markVariableAsUsed(name: string): boolean; - - report(descriptor: ReportDescriptor): void; - } - - type ReportFixer = (fixer: RuleFixer) => null | Fix | IterableIterator | Fix[]; - - interface ReportDescriptorOptionsBase { - data?: { [key: string]: string }; - - fix?: null | ReportFixer; - } - - interface SuggestionReportOptions { - data?: { [key: string]: string }; - - fix: ReportFixer; - } - - type SuggestionDescriptorMessage = { desc: string } | { messageId: string }; - type SuggestionReportDescriptor = SuggestionDescriptorMessage & SuggestionReportOptions; - - interface ReportDescriptorOptions extends ReportDescriptorOptionsBase { - suggest?: SuggestionReportDescriptor[] | null | undefined; - } - - type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions; - type ReportDescriptorMessage = { message: string } | { messageId: string }; - type ReportDescriptorLocation = - | { node: ESTree.Node } - | { loc: AST.SourceLocation | { line: number; column: number } }; - - interface RuleFixer { - insertTextAfter(nodeOrToken: ESTree.Node | AST.Token, text: string): Fix; - - insertTextAfterRange(range: AST.Range, text: string): Fix; - - insertTextBefore(nodeOrToken: ESTree.Node | AST.Token, text: string): Fix; - - insertTextBeforeRange(range: AST.Range, text: string): Fix; - - remove(nodeOrToken: ESTree.Node | AST.Token): Fix; - - removeRange(range: AST.Range): Fix; - - replaceText(nodeOrToken: ESTree.Node | AST.Token, text: string): Fix; - - replaceTextRange(range: AST.Range, text: string): Fix; - } - - interface Fix { - range: AST.Range; - text: string; - } -} - -// #region Linter - -export class Linter { - static version: string; - - version: string; - - constructor(options?: { cwd?: string | undefined; configType?: "flat" }); - - verify( - code: SourceCode | string, - config: Linter.Config | Linter.FlatConfig[], - filename?: string, - ): Linter.LintMessage[]; - verify( - code: SourceCode | string, - config: Linter.Config | Linter.FlatConfig[], - options: Linter.LintOptions, - ): Linter.LintMessage[]; - - verifyAndFix(code: string, config: Linter.Config | Linter.FlatConfig[], filename?: string): Linter.FixReport; - verifyAndFix( - code: string, - config: Linter.Config | Linter.FlatConfig[], - options: Linter.FixOptions, - ): Linter.FixReport; - - getSourceCode(): SourceCode; - - defineRule(name: string, rule: Rule.RuleModule): void; - - defineRules(rules: { [name: string]: Rule.RuleModule }): void; - - getRules(): Map; - - defineParser(name: string, parser: Linter.ParserModule): void; -} - -export namespace Linter { - /** - * The numeric severity level for a rule. - * - * - `0` means off. - * - `1` means warn. - * - `2` means error. - * - * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities) - */ - type Severity = 0 | 1 | 2; - - /** - * The human readable severity level for a rule. - * - * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities) - */ - type StringSeverity = "off" | "warn" | "error"; - - /** - * The numeric or human readable severity level for a rule. - * - * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities) - */ - type RuleLevel = Severity | StringSeverity; - - /** - * An array containing the rule severity level, followed by the rule options. - * - * @see [Rules](https://eslint.org/docs/user-guide/configuring/rules) - */ - type RuleLevelAndOptions = Prepend, RuleLevel>; - - /** - * The severity level for the rule or an array containing the rule severity level, followed by the rule options. - * - * @see [Rules](https://eslint.org/docs/user-guide/configuring/rules) - */ - type RuleEntry = RuleLevel | RuleLevelAndOptions; - - /** - * The rules config object is a key/value map of rule names and their severity and options. - */ - interface RulesRecord { - [rule: string]: RuleEntry; - } - - /** - * A configuration object that may have a `rules` block. - */ - interface HasRules { - rules?: Partial | undefined; - } - - /** - * ESLint configuration. - * - * @see [ESLint Configuration](https://eslint.org/docs/latest/user-guide/configuring/) - */ - interface BaseConfig - extends HasRules - { - $schema?: string | undefined; - - /** - * An environment provides predefined global variables. - * - * @see [Environments](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-environments) - */ - env?: { [name: string]: boolean } | undefined; - - /** - * Extending configuration files. - * - * @see [Extends](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#extending-configuration-files) - */ - extends?: string | string[] | undefined; - - /** - * Specifying globals. - * - * @see [Globals](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-globals) - */ - globals?: { [name: string]: boolean | "off" | "readonly" | "readable" | "writable" | "writeable" } | undefined; - - /** - * Disable processing of inline comments. - * - * @see [Disabling Inline Comments](https://eslint.org/docs/latest/user-guide/configuring/rules#disabling-inline-comments) - */ - noInlineConfig?: boolean | undefined; - - /** - * Overrides can be used to use a differing configuration for matching sub-directories and files. - * - * @see [How do overrides work](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#how-do-overrides-work) - */ - overrides?: Array> | undefined; - - /** - * Parser. - * - * @see [Working with Custom Parsers](https://eslint.org/docs/latest/developer-guide/working-with-custom-parsers) - * @see [Specifying Parser](https://eslint.org/docs/latest/user-guide/configuring/plugins#configure-a-parser) - */ - parser?: string | undefined; - - /** - * Parser options. - * - * @see [Working with Custom Parsers](https://eslint.org/docs/latest/developer-guide/working-with-custom-parsers) - * @see [Specifying Parser Options](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options) - */ - parserOptions?: ParserOptions | undefined; - - /** - * Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use. - * - * @see [Configuring Plugins](https://eslint.org/docs/latest/user-guide/configuring/plugins#configure-plugins) - */ - plugins?: string[] | undefined; - - /** - * Specifying processor. - * - * @see [processor](https://eslint.org/docs/latest/user-guide/configuring/plugins#specify-a-processor) - */ - processor?: string | undefined; - - /** - * Report unused `ESLint-disable` comments as warning. - * - * @see [Report unused `ESLint-disable` comments](https://eslint.org/docs/latest/user-guide/configuring/rules#report-unused-eslint-disable-comments) - */ - reportUnusedDisableDirectives?: boolean | undefined; - - /** - * Settings. - * - * @see [Settings](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#adding-shared-settings) - */ - settings?: { [name: string]: any } | undefined; - } - - /** - * The overwrites that apply more differing configuration to specific files or directories. - */ - interface ConfigOverride extends BaseConfig { - /** - * The glob patterns for excluded files. - */ - excludedFiles?: string | string[] | undefined; - - /** - * The glob patterns for target files. - */ - files: string | string[]; - } - - /** - * ESLint configuration. - * - * @see [ESLint Configuration](https://eslint.org/docs/latest/user-guide/configuring/) - */ - // https://github.com/eslint/eslint/blob/v6.8.0/conf/config-schema.js - interface Config - extends BaseConfig - { - /** - * Tell ESLint to ignore specific files and directories. - * - * @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code) - */ - ignorePatterns?: string | string[] | undefined; - - /** - * @see [Using Configuration Files](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-configuration-files) - */ - root?: boolean | undefined; - } - - /** - * Parser options. - * - * @see [Specifying Parser Options](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options) - */ - interface ParserOptions { - /** - * Accepts any valid ECMAScript version number or `'latest'`: - * - * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or - * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or - * - `'latest'` - * - * When it's a version or a year, the value must be a number - so do not include the `es` prefix. - * - * Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default - * - * @default 2018 - * - * @see https://typescript-eslint.io/architecture/parser/#ecmaversion - */ - ecmaVersion?: - | 3 - | 5 - | 6 - | 7 - | 8 - | 9 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 2015 - | 2016 - | 2017 - | 2018 - | 2019 - | 2020 - | 2021 - | 2022 - | 2023 - | 2024 - | "latest" - | undefined; - - /** - * Set to "script" (default) or "module" if your code is in ECMAScript modules. - * - * @default 'script' - * - * @see https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options - */ - sourceType?: "script" | "module" | undefined; - - /** - * An object indicating which additional language features you'd like to use. - * - * @see https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options - * @see https://typescript-eslint.io/architecture/parser#ecmafeatures - */ - ecmaFeatures?: { - globalReturn?: boolean | undefined; - impliedStrict?: boolean | undefined; - jsx?: boolean | undefined; - experimentalObjectRestSpread?: boolean | undefined; - [key: string]: any; - } | undefined; - [key: string]: any; - } - - interface LintOptions { - filename?: string | undefined; - preprocess?: ((code: string) => string[]) | undefined; - postprocess?: ((problemLists: LintMessage[][]) => LintMessage[]) | undefined; - filterCodeBlock?: boolean | undefined; - disableFixes?: boolean | undefined; - allowInlineConfig?: boolean | undefined; - reportUnusedDisableDirectives?: boolean | undefined; - } - - interface LintSuggestion { - desc: string; - fix: Rule.Fix; - messageId?: string | undefined; - } - - interface LintMessage { - column: number; - line: number; - endColumn?: number | undefined; - endLine?: number | undefined; - ruleId: string | null; - message: string; - messageId?: string | undefined; - nodeType?: string | undefined; - fatal?: true | undefined; - severity: Severity; - fix?: Rule.Fix | undefined; - /** @deprecated Use `linter.getSourceCode()` */ - source?: string | null | undefined; - suggestions?: LintSuggestion[] | undefined; - } - - interface LintSuppression { - kind: string; - justification: string; - } - - interface SuppressedLintMessage extends LintMessage { - suppressions: LintSuppression[]; - } - - interface FixOptions extends LintOptions { - fix?: boolean | undefined; - } - - interface FixReport { - fixed: boolean; - output: string; - messages: LintMessage[]; - } - - type ParserModule = - & ESLint.ObjectMetaProperties - & ( - | { parse(text: string, options?: any): AST.Program } - | { parseForESLint(text: string, options?: any): ESLintParseResult } - ); - - interface ESLintParseResult { - ast: AST.Program; - parserServices?: SourceCode.ParserServices | undefined; - scopeManager?: Scope.ScopeManager | undefined; - visitorKeys?: SourceCode.VisitorKeys | undefined; - } - - interface ProcessorFile { - text: string; - filename: string; - } - - // https://eslint.org/docs/developer-guide/working-with-plugins#processors-in-plugins - interface Processor extends ESLint.ObjectMetaProperties { - supportsAutofix?: boolean | undefined; - preprocess?(text: string, filename: string): T[]; - postprocess?(messages: LintMessage[][], filename: string): LintMessage[]; - } - - type FlatConfigFileSpec = string | ((filePath: string) => boolean); - - interface FlatConfig { - /** - * An array of glob patterns indicating the files that the configuration - * object should apply to. If not specified, the configuration object applies - * to all files - */ - files?: Array; - - /** - * An array of glob patterns indicating the files that the configuration - * object should not apply to. If not specified, the configuration object - * applies to all files matched by files - */ - ignores?: FlatConfigFileSpec[]; - - /** - * An object containing settings related to how JavaScript is configured for - * linting. - */ - languageOptions?: { - /** - * The version of ECMAScript to support. May be any year (i.e., 2022) or - * version (i.e., 5). Set to "latest" for the most recent supported version. - * @default "latest" - */ - ecmaVersion?: ParserOptions["ecmaVersion"]; - - /** - * The type of JavaScript source code. Possible values are "script" for - * traditional script files, "module" for ECMAScript modules (ESM), and - * "commonjs" for CommonJS files. (default: "module" for .js and .mjs - * files; "commonjs" for .cjs files) - */ - sourceType?: "script" | "module" | "commonjs"; - - /** - * An object specifying additional objects that should be added to the - * global scope during linting. - */ - globals?: ESLint.Environment["globals"]; - - /** - * An object containing a parse() or parseForESLint() method. - * If not configured, the default ESLint parser (Espree) will be used. - */ - parser?: ParserModule; - - /** - * An object specifying additional options that are passed directly to the - * parser() method on the parser. The available options are parser-dependent - */ - parserOptions?: ESLint.Environment["parserOptions"]; - }; - - /** - * An object containing settings related to the linting process - */ - linterOptions?: { - /** - * A boolean value indicating if inline configuration is allowed. - */ - noInlineConfig?: boolean; - - /** - * A severity value indicating if and how unused disable directives should be - * tracked and reported. - */ - reportUnusedDisableDirectives?: Severity | StringSeverity | boolean; - }; - - /** - * Either an object containing preprocess() and postprocess() methods or a - * string indicating the name of a processor inside of a plugin - * (i.e., "pluginName/processorName"). - */ - processor?: string | Processor; - - /** - * An object containing a name-value mapping of plugin names to plugin objects. - * When files is specified, these plugins are only available to the matching files. - */ - plugins?: Record; - - /** - * An object containing the configured rules. When files or ignores are specified, - * these rule configurations are only available to the matching files. - */ - rules?: RulesRecord; - - /** - * An object containing name-value pairs of information that should be - * available to all rules. - */ - settings?: Record; - } -} - -// #endregion - -// #region ESLint - -export class ESLint { - static version: string; - - static outputFixes(results: ESLint.LintResult[]): Promise; - - static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[]; - - constructor(options?: ESLint.Options); - - lintFiles(patterns: string | string[]): Promise; - - lintText( - code: string, - options?: { filePath?: string | undefined; warnIgnored?: boolean | undefined }, - ): Promise; - - getRulesMetaForResults(results: ESLint.LintResult[]): ESLint.LintResultData["rulesMeta"]; - - calculateConfigForFile(filePath: string): Promise; - - isPathIgnored(filePath: string): Promise; - - loadFormatter(nameOrPath?: string): Promise; -} - -export namespace ESLint { - type ConfigData = Omit, "$schema">; - - interface Globals { - [name: string]: boolean | "writable" | "readonly" | "off"; - } - - interface Environment { - globals?: Globals | undefined; - parserOptions?: Linter.ParserOptions | undefined; - } - - interface ObjectMetaProperties { - /** @deprecated Use `meta.name` instead. */ - name?: string | undefined; - - /** @deprecated Use `meta.version` instead. */ - version?: string | undefined; - - meta?: { - name?: string | undefined; - version?: string | undefined; - }; - } - - interface Plugin extends ObjectMetaProperties { - configs?: Record | undefined; - environments?: Record | undefined; - processors?: Record | undefined; - rules?: Record | undefined; - } - - interface Options { - // File enumeration - cwd?: string | undefined; - errorOnUnmatchedPattern?: boolean | undefined; - extensions?: string[] | undefined; - globInputPaths?: boolean | undefined; - ignore?: boolean | undefined; - ignorePath?: string | undefined; - - // Linting - allowInlineConfig?: boolean | undefined; - baseConfig?: Linter.Config | undefined; - overrideConfig?: Linter.Config | undefined; - overrideConfigFile?: string | undefined; - plugins?: Record | undefined; - reportUnusedDisableDirectives?: Linter.StringSeverity | undefined; - resolvePluginsRelativeTo?: string | undefined; - rulePaths?: string[] | undefined; - useEslintrc?: boolean | undefined; - - // Autofix - fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined; - fixTypes?: Array | undefined; - - // Cache-related - cache?: boolean | undefined; - cacheLocation?: string | undefined; - cacheStrategy?: "content" | "metadata" | undefined; - } - - interface LintResult { - filePath: string; - messages: Linter.LintMessage[]; - suppressedMessages: Linter.SuppressedLintMessage[]; - errorCount: number; - fatalErrorCount: number; - warningCount: number; - fixableErrorCount: number; - fixableWarningCount: number; - output?: string | undefined; - source?: string | undefined; - usedDeprecatedRules: DeprecatedRuleUse[]; - } - - interface LintResultData { - cwd: string; - rulesMeta: { - [ruleId: string]: Rule.RuleMetaData; - }; - } - - interface DeprecatedRuleUse { - ruleId: string; - replacedBy: string[]; - } - - interface Formatter { - format(results: LintResult[], data?: LintResultData): string | Promise; - } - - // Docs reference the type by this name - type EditInfo = Rule.Fix; -} - -// #endregion - -// #region RuleTester - -export class RuleTester { - constructor(config?: any); - - run( - name: string, - rule: Rule.RuleModule, - tests: { - valid?: Array | undefined; - invalid?: RuleTester.InvalidTestCase[] | undefined; - }, - ): void; - - static only( - item: string | RuleTester.ValidTestCase | RuleTester.InvalidTestCase, - ): RuleTester.ValidTestCase | RuleTester.InvalidTestCase; -} - -export namespace RuleTester { - interface ValidTestCase { - name?: string; - code: string; - options?: any; - filename?: string | undefined; - only?: boolean; - parserOptions?: Linter.ParserOptions | undefined; - settings?: { [name: string]: any } | undefined; - parser?: string | undefined; - globals?: { [name: string]: boolean } | undefined; - } - - interface SuggestionOutput { - messageId?: string | undefined; - desc?: string | undefined; - data?: Record | undefined; - output: string; - } - - interface InvalidTestCase extends ValidTestCase { - errors: number | Array; - output?: string | null | undefined; - } - - interface TestCaseError { - message?: string | RegExp | undefined; - messageId?: string | undefined; - type?: string | undefined; - data?: any; - line?: number | undefined; - column?: number | undefined; - endLine?: number | undefined; - endColumn?: number | undefined; - suggestions?: SuggestionOutput[] | undefined; - } -} - -// #endregion diff --git a/node_modules/@types/eslint/package.json b/node_modules/@types/eslint/package.json deleted file mode 100644 index bde8858..0000000 --- a/node_modules/@types/eslint/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@types/eslint", - "version": "8.56.2", - "description": "TypeScript definitions for eslint", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint", - "license": "MIT", - "contributors": [ - { - "name": "Pierre-Marie Dartus", - "githubUsername": "pmdartus", - "url": "https://github.com/pmdartus" - }, - { - "name": "Jed Fox", - "githubUsername": "j-f1", - "url": "https://github.com/j-f1" - }, - { - "name": "Saad Quadri", - "githubUsername": "saadq", - "url": "https://github.com/saadq" - }, - { - "name": "Jason Kwok", - "githubUsername": "JasonHK", - "url": "https://github.com/JasonHK" - }, - { - "name": "Brad Zacher", - "githubUsername": "bradzacher", - "url": "https://github.com/bradzacher" - }, - { - "name": "JounQin", - "githubUsername": "JounQin", - "url": "https://github.com/JounQin" - } - ], - "main": "", - "types": "index.d.ts", - "exports": { - ".": { - "types": "./index.d.ts" - }, - "./use-at-your-own-risk": { - "types": "./use-at-your-own-risk.d.ts" - }, - "./rules": { - "types": "./rules/index.d.ts" - }, - "./package.json": "./package.json" - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/eslint" - }, - "scripts": {}, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - }, - "typesPublisherContentHash": "1f593f127b3936d8611ca577ae65c2c00c4c9f56d078c7e541904c95e572775b", - "typeScriptVersion": "4.6" -} \ No newline at end of file diff --git a/node_modules/@types/eslint/rules/best-practices.d.ts b/node_modules/@types/eslint/rules/best-practices.d.ts deleted file mode 100644 index 9ddd904..0000000 --- a/node_modules/@types/eslint/rules/best-practices.d.ts +++ /dev/null @@ -1,931 +0,0 @@ -import { Linter } from "../index"; - -export interface BestPractices extends Linter.RulesRecord { - /** - * Rule to enforce getter and setter pairs in objects. - * - * @since 0.22.0 - * @see https://eslint.org/docs/rules/accessor-pairs - */ - "accessor-pairs": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - setWithoutGet: boolean; - /** - * @default false - */ - getWithoutSet: boolean; - }>, - ] - >; - - /** - * Rule to enforce `return` statements in callbacks of array methods. - * - * @since 2.0.0-alpha-1 - * @see https://eslint.org/docs/rules/array-callback-return - */ - "array-callback-return": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowImplicit: boolean; - }>, - ] - >; - - /** - * Rule to enforce the use of variables within the scope they are defined. - * - * @since 0.1.0 - * @see https://eslint.org/docs/rules/block-scoped-var - */ - "block-scoped-var": Linter.RuleEntry<[]>; - - /** - * Rule to enforce that class methods utilize `this`. - * - * @since 3.4.0 - * @see https://eslint.org/docs/rules/class-methods-use-this - */ - "class-methods-use-this": Linter.RuleEntry< - [ - Partial<{ - exceptMethods: string[]; - }>, - ] - >; - - /** - * Rule to enforce a maximum cyclomatic complexity allowed in a program. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/complexity - */ - complexity: Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 20 - */ - max: number; - /** - * @deprecated - * @default 20 - */ - maximum: number; - }> - | number, - ] - >; - - /** - * Rule to require `return` statements to either always or never specify values. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/consistent-return - */ - "consistent-return": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - treatUndefinedAsUnspecified: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent brace style for all control statements. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/curly - */ - curly: Linter.RuleEntry<["all" | "multi" | "multi-line" | "multi-or-nest" | "consistent"]>; - - /** - * Rule to require `default` cases in `switch` statements. - * - * @since 0.6.0 - * @see https://eslint.org/docs/rules/default-case - */ - "default-case": Linter.RuleEntry< - [ - Partial<{ - /** - * @default '^no default$' - */ - commentPattern: string; - }>, - ] - >; - - /** - * Rule to enforce consistent newlines before and after dots. - * - * @since 0.21.0 - * @see https://eslint.org/docs/rules/dot-location - */ - "dot-location": Linter.RuleEntry<["object" | "property"]>; - - /** - * Rule to enforce dot notation whenever possible. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/dot-notation - */ - "dot-notation": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - allowKeywords: boolean; - allowPattern: string; - }>, - ] - >; - - /** - * Rule to require the use of `===` and `!==`. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/eqeqeq - */ - eqeqeq: - | Linter.RuleEntry< - [ - "always", - Partial<{ - /** - * @default 'always' - */ - null: "always" | "never" | "ignore"; - }>, - ] - > - | Linter.RuleEntry<["smart" | "allow-null"]>; - - /** - * Rule to require `for-in` loops to include an `if` statement. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/guard-for-in - */ - "guard-for-in": Linter.RuleEntry<[]>; - - /** - * Rule to enforce a maximum number of classes per file. - * - * @since 5.0.0-alpha.3 - * @see https://eslint.org/docs/rules/max-classes-per-file - */ - "max-classes-per-file": Linter.RuleEntry<[number]>; - - /** - * Rule to disallow the use of `alert`, `confirm`, and `prompt`. - * - * @since 0.0.5 - * @see https://eslint.org/docs/rules/no-alert - */ - "no-alert": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `arguments.caller` or `arguments.callee`. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/no-caller - */ - "no-caller": Linter.RuleEntry<[]>; - - /** - * Rule to disallow lexical declarations in case clauses. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 1.9.0 - * @see https://eslint.org/docs/rules/no-case-declarations - */ - "no-case-declarations": Linter.RuleEntry<[]>; - - /** - * Rule to disallow division operators explicitly at the beginning of regular expressions. - * - * @since 0.1.0 - * @see https://eslint.org/docs/rules/no-div-regex - */ - "no-div-regex": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `else` blocks after `return` statements in `if` statements. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-else-return - */ - "no-else-return": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - allowElseIf: boolean; - }>, - ] - >; - - /** - * Rule to disallow empty functions. - * - * @since 2.0.0 - * @see https://eslint.org/docs/rules/no-empty-function - */ - "no-empty-function": Linter.RuleEntry< - [ - Partial<{ - /** - * @default [] - */ - allow: Array< - | "functions" - | "arrowFunctions" - | "generatorFunctions" - | "methods" - | "generatorMethods" - | "getters" - | "setters" - | "constructors" - >; - }>, - ] - >; - - /** - * Rule to disallow empty destructuring patterns. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 1.7.0 - * @see https://eslint.org/docs/rules/no-empty-pattern - */ - "no-empty-pattern": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `null` comparisons without type-checking operators. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-eq-null - */ - "no-eq-null": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `eval()`. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/no-eval - */ - "no-eval": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowIndirect: boolean; - }>, - ] - >; - - /** - * Rule to disallow extending native types. - * - * @since 0.1.4 - * @see https://eslint.org/docs/rules/no-extend-native - */ - "no-extend-native": Linter.RuleEntry< - [ - Partial<{ - exceptions: string[]; - }>, - ] - >; - - /** - * Rule to disallow unnecessary calls to `.bind()`. - * - * @since 0.8.0 - * @see https://eslint.org/docs/rules/no-extra-bind - */ - "no-extra-bind": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary labels. - * - * @since 2.0.0-rc.0 - * @see https://eslint.org/docs/rules/no-extra-label - */ - "no-extra-label": Linter.RuleEntry<[]>; - - /** - * Rule to disallow fallthrough of `case` statements. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/no-fallthrough - */ - "no-fallthrough": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 'falls?\s?through' - */ - commentPattern: string; - }>, - ] - >; - - /** - * Rule to disallow leading or trailing decimal points in numeric literals. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/no-floating-decimal - */ - "no-floating-decimal": Linter.RuleEntry<[]>; - - /** - * Rule to disallow assignments to native objects or read-only global variables. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 3.3.0 - * @see https://eslint.org/docs/rules/no-global-assign - */ - "no-global-assign": Linter.RuleEntry< - [ - Partial<{ - exceptions: string[]; - }>, - ] - >; - - /** - * Rule to disallow shorthand type conversions. - * - * @since 1.0.0-rc-2 - * @see https://eslint.org/docs/rules/no-implicit-coercion - */ - "no-implicit-coercion": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - boolean: boolean; - /** - * @default true - */ - number: boolean; - /** - * @default true - */ - string: boolean; - /** - * @default [] - */ - allow: Array<"~" | "!!" | "+" | "*">; - }>, - ] - >; - - /** - * Rule to disallow variable and `function` declarations in the global scope. - * - * @since 2.0.0-alpha-1 - * @see https://eslint.org/docs/rules/no-implicit-globals - */ - "no-implicit-globals": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `eval()`-like methods. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/no-implied-eval - */ - "no-implied-eval": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `this` keywords outside of classes or class-like objects. - * - * @since 1.0.0-rc-2 - * @see https://eslint.org/docs/rules/no-invalid-this - */ - "no-invalid-this": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of the `__iterator__` property. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-iterator - */ - "no-iterator": Linter.RuleEntry<[]>; - - /** - * Rule to disallow labeled statements. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-labels - */ - "no-labels": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowLoop: boolean; - /** - * @default false - */ - allowSwitch: boolean; - }>, - ] - >; - - /** - * Rule to disallow unnecessary nested blocks. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-lone-blocks - */ - "no-lone-blocks": Linter.RuleEntry<[]>; - - /** - * Rule to disallow function declarations that contain unsafe references inside loop statements. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-loop-func - */ - "no-loop-func": Linter.RuleEntry<[]>; - - /** - * Rule to disallow magic numbers. - * - * @since 1.7.0 - * @see https://eslint.org/docs/rules/no-magic-numbers - */ - "no-magic-numbers": Linter.RuleEntry< - [ - Partial<{ - /** - * @default [] - */ - ignore: number[]; - /** - * @default false - */ - ignoreArrayIndexes: boolean; - /** - * @default false - */ - enforceConst: boolean; - /** - * @default false - */ - detectObjects: boolean; - }>, - ] - >; - - /** - * Rule to disallow multiple spaces. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/no-multi-spaces - */ - "no-multi-spaces": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - ignoreEOLComments: boolean; - /** - * @default { Property: true } - */ - exceptions: Record; - }>, - ] - >; - - /** - * Rule to disallow multiline strings. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-multi-str - */ - "no-multi-str": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `new` operators outside of assignments or comparisons. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/no-new - */ - "no-new": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `new` operators with the `Function` object. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/no-new-func - */ - "no-new-func": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `new` operators with the `String`, `Number`, and `Boolean` objects. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/no-new-wrappers - */ - "no-new-wrappers": Linter.RuleEntry<[]>; - - /** - * Rule to disallow octal literals. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/no-octal - */ - "no-octal": Linter.RuleEntry<[]>; - - /** - * Rule to disallow octal escape sequences in string literals. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-octal-escape - */ - "no-octal-escape": Linter.RuleEntry<[]>; - - /** - * Rule to disallow reassigning `function` parameters. - * - * @since 0.18.0 - * @see https://eslint.org/docs/rules/no-param-reassign - */ - "no-param-reassign": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - props: boolean; - /** - * @default [] - */ - ignorePropertyModificationsFor: string[]; - }>, - ] - >; - - /** - * Rule to disallow the use of the `__proto__` property. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-proto - */ - "no-proto": Linter.RuleEntry<[]>; - - /** - * Rule to disallow variable redeclaration. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-redeclare - */ - "no-redeclare": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - builtinGlobals: boolean; - }>, - ] - >; - - /** - * Rule to disallow certain properties on certain objects. - * - * @since 3.5.0 - * @see https://eslint.org/docs/rules/no-restricted-properties - */ - "no-restricted-properties": Linter.RuleEntry< - [ - ...Array< - | { - object: string; - property?: string | undefined; - message?: string | undefined; - } - | { - property: string; - message?: string | undefined; - } - >, - ] - >; - - /** - * Rule to disallow assignment operators in `return` statements. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-return-assign - */ - "no-return-assign": Linter.RuleEntry<["except-parens" | "always"]>; - - /** - * Rule to disallow unnecessary `return await`. - * - * @since 3.10.0 - * @see https://eslint.org/docs/rules/no-return-await - */ - "no-return-await": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `javascript:` urls. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-script-url - */ - "no-script-url": Linter.RuleEntry<[]>; - - /** - * Rule to disallow assignments where both sides are exactly the same. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 2.0.0-rc.0 - * @see https://eslint.org/docs/rules/no-self-assign - */ - "no-self-assign": Linter.RuleEntry<[]>; - - /** - * Rule to disallow comparisons where both sides are exactly the same. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-self-compare - */ - "no-self-compare": Linter.RuleEntry<[]>; - - /** - * Rule to disallow comma operators. - * - * @since 0.5.1 - * @see https://eslint.org/docs/rules/no-sequences - */ - "no-sequences": Linter.RuleEntry<[]>; - - /** - * Rule to disallow throwing literals as exceptions. - * - * @since 0.15.0 - * @see https://eslint.org/docs/rules/no-throw-literal - */ - "no-throw-literal": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unmodified loop conditions. - * - * @since 2.0.0-alpha-2 - * @see https://eslint.org/docs/rules/no-unmodified-loop-condition - */ - "no-unmodified-loop-condition": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unused expressions. - * - * @since 0.1.0 - * @see https://eslint.org/docs/rules/no-unused-expressions - */ - "no-unused-expressions": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowShortCircuit: boolean; - /** - * @default false - */ - allowTernary: boolean; - /** - * @default false - */ - allowTaggedTemplates: boolean; - }>, - ] - >; - - /** - * Rule to disallow unused labels. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 2.0.0-rc.0 - * @see https://eslint.org/docs/rules/no-unused-labels - */ - "no-unused-labels": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary calls to `.call()` and `.apply()`. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/no-useless-call - */ - "no-useless-call": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary `catch` clauses. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 5.11.0 - * @see https://eslint.org/docs/rules/no-useless-catch - */ - "no-useless-catch": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary concatenation of literals or template literals. - * - * @since 1.3.0 - * @see https://eslint.org/docs/rules/no-useless-concat - */ - "no-useless-concat": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary escape characters. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 2.5.0 - * @see https://eslint.org/docs/rules/no-useless-escape - */ - "no-useless-escape": Linter.RuleEntry<[]>; - - /** - * Rule to disallow redundant return statements. - * - * @since 3.9.0 - * @see https://eslint.org/docs/rules/no-useless-return - */ - "no-useless-return": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `void` operators. - * - * @since 0.8.0 - * @see https://eslint.org/docs/rules/no-void - */ - "no-void": Linter.RuleEntry<[]>; - - /** - * Rule to disallow specified warning terms in comments. - * - * @since 0.4.4 - * @see https://eslint.org/docs/rules/no-warning-comments - */ - "no-warning-comments": Linter.RuleEntry< - [ - { - /** - * @default ["todo", "fixme", "xxx"] - */ - terms: string[]; - /** - * @default 'start' - */ - location: "start" | "anywhere"; - }, - ] - >; - - /** - * Rule to disallow `with` statements. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/no-with - */ - "no-with": Linter.RuleEntry<[]>; - - /** - * Rule to enforce using named capture group in regular expression. - * - * @since 5.15.0 - * @see https://eslint.org/docs/rules/prefer-named-capture-group - */ - "prefer-named-capture-group": Linter.RuleEntry<[]>; - - /** - * Rule to require using Error objects as Promise rejection reasons. - * - * @since 3.14.0 - * @see https://eslint.org/docs/rules/prefer-promise-reject-errors - */ - "prefer-promise-reject-errors": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowEmptyReject: boolean; - }>, - ] - >; - - /** - * Rule to enforce the consistent use of the radix argument when using `parseInt()`. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/radix - */ - radix: Linter.RuleEntry<["always" | "as-needed"]>; - - /** - * Rule to disallow async functions which have no `await` expression. - * - * @since 3.11.0 - * @see https://eslint.org/docs/rules/require-await - */ - "require-await": Linter.RuleEntry<[]>; - - /** - * Rule to enforce the use of `u` flag on RegExp. - * - * @since 5.3.0 - * @see https://eslint.org/docs/rules/require-unicode-regexp - */ - "require-unicode-regexp": Linter.RuleEntry<[]>; - - /** - * Rule to require `var` declarations be placed at the top of their containing scope. - * - * @since 0.8.0 - * @see https://eslint.org/docs/rules/vars-on-top - */ - "vars-on-top": Linter.RuleEntry<[]>; - - /** - * Rule to require parentheses around immediate `function` invocations. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/wrap-iife - */ - "wrap-iife": Linter.RuleEntry< - [ - "outside" | "inside" | "any", - Partial<{ - /** - * @default false - */ - functionPrototypeMethods: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow “Yoda” conditions. - * - * @since 0.7.1 - * @see https://eslint.org/docs/rules/yoda - */ - yoda: - | Linter.RuleEntry< - [ - "never", - Partial<{ - exceptRange: boolean; - onlyEquality: boolean; - }>, - ] - > - | Linter.RuleEntry<["always"]>; -} diff --git a/node_modules/@types/eslint/rules/deprecated.d.ts b/node_modules/@types/eslint/rules/deprecated.d.ts deleted file mode 100644 index 0024d89..0000000 --- a/node_modules/@types/eslint/rules/deprecated.d.ts +++ /dev/null @@ -1,267 +0,0 @@ -import { Linter } from "../index"; - -export interface Deprecated extends Linter.RulesRecord { - /** - * Rule to enforce consistent indentation. - * - * @since 4.0.0-alpha.0 - * @deprecated since 4.0.0, use [`indent`](https://eslint.org/docs/rules/indent) instead. - * @see https://eslint.org/docs/rules/indent-legacy - */ - "indent-legacy": Linter.RuleEntry< - [ - number | "tab", - Partial<{ - /** - * @default 0 - */ - SwitchCase: number; - /** - * @default 1 - */ - VariableDeclarator: - | Partial<{ - /** - * @default 1 - */ - var: number | "first"; - /** - * @default 1 - */ - let: number | "first"; - /** - * @default 1 - */ - const: number | "first"; - }> - | number - | "first"; - /** - * @default 1 - */ - outerIIFEBody: number; - /** - * @default 1 - */ - MemberExpression: number | "off"; - /** - * @default { parameters: 1, body: 1 } - */ - FunctionDeclaration: Partial<{ - /** - * @default 1 - */ - parameters: number | "first" | "off"; - /** - * @default 1 - */ - body: number; - }>; - /** - * @default { parameters: 1, body: 1 } - */ - FunctionExpression: Partial<{ - /** - * @default 1 - */ - parameters: number | "first" | "off"; - /** - * @default 1 - */ - body: number; - }>; - /** - * @default { arguments: 1 } - */ - CallExpression: Partial<{ - /** - * @default 1 - */ - arguments: number | "first" | "off"; - }>; - /** - * @default 1 - */ - ArrayExpression: number | "first" | "off"; - /** - * @default 1 - */ - ObjectExpression: number | "first" | "off"; - /** - * @default 1 - */ - ImportDeclaration: number | "first" | "off"; - /** - * @default false - */ - flatTernaryExpressions: boolean; - ignoredNodes: string[]; - /** - * @default false - */ - ignoreComments: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow newlines around directives. - * - * @since 3.5.0 - * @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead. - * @see https://eslint.org/docs/rules/lines-around-directive - */ - "lines-around-directive": Linter.RuleEntry<["always" | "never"]>; - - /** - * Rule to require or disallow an empty line after variable declarations. - * - * @since 0.18.0 - * @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead. - * @see https://eslint.org/docs/rules/newline-after-var - */ - "newline-after-var": Linter.RuleEntry<["always" | "never"]>; - - /** - * Rule to require an empty line before `return` statements. - * - * @since 2.3.0 - * @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead. - * @see https://eslint.org/docs/rules/newline-before-return - */ - "newline-before-return": Linter.RuleEntry<[]>; - - /** - * Rule to disallow shadowing of variables inside of `catch`. - * - * @since 0.0.9 - * @deprecated since 5.1.0, use [`no-shadow`](https://eslint.org/docs/rules/no-shadow) instead. - * @see https://eslint.org/docs/rules/no-catch-shadow - */ - "no-catch-shadow": Linter.RuleEntry<[]>; - - /** - * Rule to disallow reassignment of native objects. - * - * @since 0.0.9 - * @deprecated since 3.3.0, use [`no-global-assign`](https://eslint.org/docs/rules/no-global-assign) instead. - * @see https://eslint.org/docs/rules/no-native-reassign - */ - "no-native-reassign": Linter.RuleEntry< - [ - Partial<{ - exceptions: string[]; - }>, - ] - >; - - /** - * Rule to disallow negating the left operand in `in` expressions. - * - * @since 0.1.2 - * @deprecated since 3.3.0, use [`no-unsafe-negation`](https://eslint.org/docs/rules/no-unsafe-negation) instead. - * @see https://eslint.org/docs/rules/no-negated-in-lhs - */ - "no-negated-in-lhs": Linter.RuleEntry<[]>; - - /** - * Rule to disallow spacing between function identifiers and their applications. - * - * @since 0.1.2 - * @deprecated since 3.3.0, use [`func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) instead. - * @see https://eslint.org/docs/rules/no-spaced-func - */ - "no-spaced-func": Linter.RuleEntry<[]>; - - /** - * Rule to suggest using `Reflect` methods where applicable. - * - * @since 1.0.0-rc-2 - * @deprecated since 3.9.0 - * @see https://eslint.org/docs/rules/prefer-reflect - */ - "prefer-reflect": Linter.RuleEntry< - [ - Partial<{ - exceptions: string[]; - }>, - ] - >; - - /** - * Rule to require JSDoc comments. - * - * @since 1.4.0 - * @deprecated since 5.10.0 - * @see https://eslint.org/docs/rules/require-jsdoc - */ - "require-jsdoc": Linter.RuleEntry< - [ - Partial<{ - require: Partial<{ - /** - * @default true - */ - FunctionDeclaration: boolean; - /** - * @default false - */ - MethodDefinition: boolean; - /** - * @default false - */ - ClassDeclaration: boolean; - /** - * @default false - */ - ArrowFunctionExpression: boolean; - /** - * @default false - */ - FunctionExpression: boolean; - }>; - }>, - ] - >; - - /** - * Rule to enforce valid JSDoc comments. - * - * @since 0.4.0 - * @deprecated since 5.10.0 - * @see https://eslint.org/docs/rules/valid-jsdoc - */ - "valid-jsdoc": Linter.RuleEntry< - [ - Partial<{ - prefer: Record; - preferType: Record; - /** - * @default true - */ - requireReturn: boolean; - /** - * @default true - */ - requireReturnType: boolean; - /** - * @remarks - * Also accept for regular expression pattern - */ - matchDescription: string; - /** - * @default true - */ - requireParamDescription: boolean; - /** - * @default true - */ - requireReturnDescription: boolean; - /** - * @default true - */ - requireParamType: boolean; - }>, - ] - >; -} diff --git a/node_modules/@types/eslint/rules/ecmascript-6.d.ts b/node_modules/@types/eslint/rules/ecmascript-6.d.ts deleted file mode 100644 index 761e829..0000000 --- a/node_modules/@types/eslint/rules/ecmascript-6.d.ts +++ /dev/null @@ -1,502 +0,0 @@ -import { Linter } from "../index"; - -export interface ECMAScript6 extends Linter.RulesRecord { - /** - * Rule to require braces around arrow function bodies. - * - * @since 1.8.0 - * @see https://eslint.org/docs/rules/arrow-body-style - */ - "arrow-body-style": - | Linter.RuleEntry< - [ - "as-needed", - Partial<{ - /** - * @default false - */ - requireReturnForObjectLiteral: boolean; - }>, - ] - > - | Linter.RuleEntry<["always" | "never"]>; - - /** - * Rule to require parentheses around arrow function arguments. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/arrow-parens - */ - "arrow-parens": - | Linter.RuleEntry<["always"]> - | Linter.RuleEntry< - [ - "as-needed", - Partial<{ - /** - * @default false - */ - requireForBlockBody: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing before and after the arrow in arrow functions. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/arrow-spacing - */ - "arrow-spacing": Linter.RuleEntry<[]>; - - /** - * Rule to require `super()` calls in constructors. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.24.0 - * @see https://eslint.org/docs/rules/constructor-super - */ - "constructor-super": Linter.RuleEntry<[]>; - - /** - * Rule to enforce consistent spacing around `*` operators in generator functions. - * - * @since 0.17.0 - * @see https://eslint.org/docs/rules/generator-star-spacing - */ - "generator-star-spacing": Linter.RuleEntry< - [ - | Partial<{ - before: boolean; - after: boolean; - named: - | Partial<{ - before: boolean; - after: boolean; - }> - | "before" - | "after" - | "both" - | "neither"; - anonymous: - | Partial<{ - before: boolean; - after: boolean; - }> - | "before" - | "after" - | "both" - | "neither"; - method: - | Partial<{ - before: boolean; - after: boolean; - }> - | "before" - | "after" - | "both" - | "neither"; - }> - | "before" - | "after" - | "both" - | "neither", - ] - >; - - /** - * Rule to disallow reassigning class members. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/no-class-assign - */ - "no-class-assign": Linter.RuleEntry<[]>; - - /** - * Rule to disallow arrow functions where they could be confused with comparisons. - * - * @since 2.0.0-alpha-2 - * @see https://eslint.org/docs/rules/no-confusing-arrow - */ - "no-confusing-arrow": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - allowParens: boolean; - }>, - ] - >; - - /** - * Rule to disallow reassigning `const` variables. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/no-const-assign - */ - "no-const-assign": Linter.RuleEntry<[]>; - - /** - * Rule to disallow duplicate class members. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 1.2.0 - * @see https://eslint.org/docs/rules/no-dupe-class-members - */ - "no-dupe-class-members": Linter.RuleEntry<[]>; - - /** - * Rule to disallow duplicate module imports. - * - * @since 2.5.0 - * @see https://eslint.org/docs/rules/no-duplicate-import - */ - "no-duplicate-import": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - includeExports: boolean; - }>, - ] - >; - - /** - * Rule to disallow `new` operators with the `Symbol` object. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 2.0.0-beta.1 - * @see https://eslint.org/docs/rules/no-new-symbol - */ - "no-new-symbol": Linter.RuleEntry<[]>; - - /** - * Rule to disallow specified modules when loaded by `import`. - * - * @since 2.0.0-alpha-1 - * @see https://eslint.org/docs/rules/no-restricted-imports - */ - "no-restricted-imports": Linter.RuleEntry< - [ - ...Array< - | string - | { - name: string; - importNames?: string[] | undefined; - message?: string | undefined; - } - | Partial<{ - paths: Array< - | string - | { - name: string; - importNames?: string[] | undefined; - message?: string | undefined; - } - >; - patterns: string[]; - }> - >, - ] - >; - - /** - * Rule to disallow `this`/`super` before calling `super()` in constructors. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.24.0 - * @see https://eslint.org/docs/rules/no-this-before-super - */ - "no-this-before-super": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary computed property keys in object literals. - * - * @since 2.9.0 - * @see https://eslint.org/docs/rules/no-useless-computed-key - */ - "no-useless-computed-key": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary constructors. - * - * @since 2.0.0-beta.1 - * @see https://eslint.org/docs/rules/no-useless-constructor - */ - "no-useless-constructor": Linter.RuleEntry<[]>; - - /** - * Rule to disallow renaming import, export, and destructured assignments to the same name. - * - * @since 2.11.0 - * @see https://eslint.org/docs/rules/no-useless-rename - */ - "no-useless-rename": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - ignoreImport: boolean; - /** - * @default false - */ - ignoreExport: boolean; - /** - * @default false - */ - ignoreDestructuring: boolean; - }>, - ] - >; - - /** - * Rule to require `let` or `const` instead of `var`. - * - * @since 0.12.0 - * @see https://eslint.org/docs/rules/no-var - */ - "no-var": Linter.RuleEntry<[]>; - - /** - * Rule to require or disallow method and property shorthand syntax for object literals. - * - * @since 0.20.0 - * @see https://eslint.org/docs/rules/object-shorthand - */ - "object-shorthand": - | Linter.RuleEntry< - [ - "always" | "methods", - Partial<{ - /** - * @default false - */ - avoidQuotes: boolean; - /** - * @default false - */ - ignoreConstructors: boolean; - /** - * @default false - */ - avoidExplicitReturnArrows: boolean; - }>, - ] - > - | Linter.RuleEntry< - [ - "properties", - Partial<{ - /** - * @default false - */ - avoidQuotes: boolean; - }>, - ] - > - | Linter.RuleEntry<["never" | "consistent" | "consistent-as-needed"]>; - - /** - * Rule to require using arrow functions for callbacks. - * - * @since 1.2.0 - * @see https://eslint.org/docs/rules/prefer-arrow-callback - */ - "prefer-arrow-callback": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowNamedFunctions: boolean; - /** - * @default true - */ - allowUnboundThis: boolean; - }>, - ] - >; - - /** - * Rule to require `const` declarations for variables that are never reassigned after declared. - * - * @since 0.23.0 - * @see https://eslint.org/docs/rules/prefer-const - */ - "prefer-const": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 'any' - */ - destructuring: "any" | "all"; - /** - * @default false - */ - ignoreReadBeforeAssign: boolean; - }>, - ] - >; - - /** - * Rule to require destructuring from arrays and/or objects. - * - * @since 3.13.0 - * @see https://eslint.org/docs/rules/prefer-destructuring - */ - "prefer-destructuring": Linter.RuleEntry< - [ - Partial< - | { - VariableDeclarator: Partial<{ - array: boolean; - object: boolean; - }>; - AssignmentExpression: Partial<{ - array: boolean; - object: boolean; - }>; - } - | { - array: boolean; - object: boolean; - } - >, - Partial<{ - enforceForRenamedProperties: boolean; - }>, - ] - >; - - /** - * Rule to disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals. - * - * @since 3.5.0 - * @see https://eslint.org/docs/rules/prefer-numeric-literals - */ - "prefer-numeric-literals": Linter.RuleEntry<[]>; - - /** - * Rule to require rest parameters instead of `arguments`. - * - * @since 2.0.0-alpha-1 - * @see https://eslint.org/docs/rules/prefer-rest-params - */ - "prefer-rest-params": Linter.RuleEntry<[]>; - - /** - * Rule to require spread operators instead of `.apply()`. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/prefer-spread - */ - "prefer-spread": Linter.RuleEntry<[]>; - - /** - * Rule to require template literals instead of string concatenation. - * - * @since 1.2.0 - * @see https://eslint.org/docs/rules/prefer-template - */ - "prefer-template": Linter.RuleEntry<[]>; - - /** - * Rule to require generator functions to contain `yield`. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/require-yield - */ - "require-yield": Linter.RuleEntry<[]>; - - /** - * Rule to enforce spacing between rest and spread operators and their expressions. - * - * @since 2.12.0 - * @see https://eslint.org/docs/rules/rest-spread-spacing - */ - "rest-spread-spacing": Linter.RuleEntry<["never" | "always"]>; - - /** - * Rule to enforce sorted import declarations within modules. - * - * @since 2.0.0-beta.1 - * @see https://eslint.org/docs/rules/sort-imports - */ - "sort-imports": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - ignoreCase: boolean; - /** - * @default false - */ - ignoreDeclarationSort: boolean; - /** - * @default false - */ - ignoreMemberSort: boolean; - /** - * @default ['none', 'all', 'multiple', 'single'] - */ - memberSyntaxSortOrder: Array<"none" | "all" | "multiple" | "single">; - }>, - ] - >; - - /** - * Rule to require symbol descriptions. - * - * @since 3.4.0 - * @see https://eslint.org/docs/rules/symbol-description - */ - "symbol-description": Linter.RuleEntry<[]>; - - /** - * Rule to require or disallow spacing around embedded expressions of template strings. - * - * @since 2.0.0-rc.0 - * @see https://eslint.org/docs/rules/template-curly-spacing - */ - "template-curly-spacing": Linter.RuleEntry<["never" | "always"]>; - - /** - * Rule to require or disallow spacing around the `*` in `yield*` expressions. - * - * @since 2.0.0-alpha-1 - * @see https://eslint.org/docs/rules/yield-star-spacing - */ - "yield-star-spacing": Linter.RuleEntry< - [ - | Partial<{ - before: boolean; - after: boolean; - }> - | "before" - | "after" - | "both" - | "neither", - ] - >; -} diff --git a/node_modules/@types/eslint/rules/index.d.ts b/node_modules/@types/eslint/rules/index.d.ts deleted file mode 100644 index 7470777..0000000 --- a/node_modules/@types/eslint/rules/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Linter } from "../index"; - -import { BestPractices } from "./best-practices"; -import { Deprecated } from "./deprecated"; -import { ECMAScript6 } from "./ecmascript-6"; -import { NodeJSAndCommonJS } from "./node-commonjs"; -import { PossibleErrors } from "./possible-errors"; -import { StrictMode } from "./strict-mode"; -import { StylisticIssues } from "./stylistic-issues"; -import { Variables } from "./variables"; - -export interface ESLintRules - extends - Linter.RulesRecord, - PossibleErrors, - BestPractices, - StrictMode, - Variables, - NodeJSAndCommonJS, - StylisticIssues, - ECMAScript6, - Deprecated -{} diff --git a/node_modules/@types/eslint/rules/node-commonjs.d.ts b/node_modules/@types/eslint/rules/node-commonjs.d.ts deleted file mode 100644 index 56a96e3..0000000 --- a/node_modules/@types/eslint/rules/node-commonjs.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { Linter } from "../index"; - -export interface NodeJSAndCommonJS extends Linter.RulesRecord { - /** - * Rule to require `return` statements after callbacks. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/callback-return - */ - "callback-return": Linter.RuleEntry<[string[]]>; - - /** - * Rule to require `require()` calls to be placed at top-level module scope. - * - * @since 1.4.0 - * @see https://eslint.org/docs/rules/global-require - */ - "global-require": Linter.RuleEntry<[]>; - - /** - * Rule to require error handling in callbacks. - * - * @since 0.4.5 - * @see https://eslint.org/docs/rules/handle-callback-err - */ - "handle-callback-err": Linter.RuleEntry<[string]>; - - /** - * Rule to disallow use of the `Buffer()` constructor. - * - * @since 4.0.0-alpha.0 - * @see https://eslint.org/docs/rules/no-buffer-constructor - */ - "no-buffer-constructor": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `require` calls to be mixed with regular variable declarations. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-mixed-requires - */ - "no-mixed-requires": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - grouping: boolean; - /** - * @default false - */ - allowCall: boolean; - }>, - ] - >; - - /** - * Rule to disallow `new` operators with calls to `require`. - * - * @since 0.6.0 - * @see https://eslint.org/docs/rules/no-new-require - */ - "no-new-require": Linter.RuleEntry<[]>; - - /** - * Rule to disallow string concatenation when using `__dirname` and `__filename`. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-path-concat - */ - "no-path-concat": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `process.env`. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/no-process-env - */ - "no-process-env": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `process.exit()`. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-process-exit - */ - "no-process-exit": Linter.RuleEntry<[]>; - - /** - * Rule to disallow specified modules when loaded by `require`. - * - * @since 0.6.0 - * @see https://eslint.org/docs/rules/no-restricted-modules - */ - "no-restricted-modules": Linter.RuleEntry< - [ - ...Array< - | string - | { - name: string; - message?: string | undefined; - } - | Partial<{ - paths: Array< - | string - | { - name: string; - message?: string | undefined; - } - >; - patterns: string[]; - }> - >, - ] - >; - - /** - * Rule to disallow synchronous methods. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-sync - */ - "no-sync": Linter.RuleEntry< - [ - { - /** - * @default false - */ - allowAtRootLevel: boolean; - }, - ] - >; -} diff --git a/node_modules/@types/eslint/rules/possible-errors.d.ts b/node_modules/@types/eslint/rules/possible-errors.d.ts deleted file mode 100644 index 0f3b66b..0000000 --- a/node_modules/@types/eslint/rules/possible-errors.d.ts +++ /dev/null @@ -1,499 +0,0 @@ -import { Linter } from "../index"; - -export interface PossibleErrors extends Linter.RulesRecord { - /** - * Rule to enforce `for` loop update clause moving the counter in the right direction. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 4.0.0-beta.0 - * @see https://eslint.org/docs/rules/for-direction - */ - "for-direction": Linter.RuleEntry<[]>; - - /** - * Rule to enforce `return` statements in getters. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 4.2.0 - * @see https://eslint.org/docs/rules/getter-return - */ - "getter-return": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowImplicit: boolean; - }>, - ] - >; - - /** - * Rule to disallow using an async function as a `Promise` executor. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 5.3.0 - * @see https://eslint.org/docs/rules/no-async-promise-executor - */ - "no-async-promise-executor": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `await` inside of loops. - * - * @since 3.12.0 - * @see https://eslint.org/docs/rules/no-await-in-loop - */ - "no-await-in-loop": Linter.RuleEntry<[]>; - - /** - * Rule to disallow comparing against `-0`. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 3.17.0 - * @see https://eslint.org/docs/rules/no-compare-neg-zero - */ - "no-compare-neg-zero": Linter.RuleEntry<[]>; - - /** - * Rule to disallow assignment operators in conditional statements. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-cond-assign - */ - "no-cond-assign": Linter.RuleEntry<["except-parens" | "always"]>; - - /** - * Rule to disallow the use of `console`. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/no-console - */ - "no-console": Linter.RuleEntry< - [ - Partial<{ - allow: Array; - }>, - ] - >; - - /** - * Rule to disallow constant expressions in conditions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.4.1 - * @see https://eslint.org/docs/rules/no-constant-condition - */ - "no-constant-condition": Linter.RuleEntry< - [ - { - /** - * @default true - */ - checkLoops: boolean; - }, - ] - >; - - /** - * Rule to disallow control characters in regular expressions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.1.0 - * @see https://eslint.org/docs/rules/no-control-regex - */ - "no-control-regex": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `debugger`. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/no-debugger - */ - "no-debugger": Linter.RuleEntry<[]>; - - /** - * Rule to disallow duplicate arguments in `function` definitions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.16.0 - * @see https://eslint.org/docs/rules/no-dupe-args - */ - "no-dupe-args": Linter.RuleEntry<[]>; - - /** - * Rule to disallow duplicate keys in object literals. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-dupe-keys - */ - "no-dupe-keys": Linter.RuleEntry<[]>; - - /** - * Rule to disallow a duplicate case label. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.17.0 - * @see https://eslint.org/docs/rules/no-duplicate-case - */ - "no-duplicate-case": Linter.RuleEntry<[]>; - - /** - * Rule to disallow empty block statements. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/no-empty - */ - "no-empty": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowEmptyCatch: boolean; - }>, - ] - >; - - /** - * Rule to disallow empty character classes in regular expressions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.22.0 - * @see https://eslint.org/docs/rules/no-empty-character-class - */ - "no-empty-character-class": Linter.RuleEntry<[]>; - - /** - * Rule to disallow reassigning exceptions in `catch` clauses. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-ex-assign - */ - "no-ex-assign": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary boolean casts. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-extra-boolean-cast - */ - "no-extra-boolean-cast": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unnecessary parentheses. - * - * @since 0.1.4 - * @see https://eslint.org/docs/rules/no-extra-parens - */ - "no-extra-parens": - | Linter.RuleEntry< - [ - "all", - Partial<{ - /** - * @default true, - */ - conditionalAssign: boolean; - /** - * @default true - */ - returnAssign: boolean; - /** - * @default true - */ - nestedBinaryExpressions: boolean; - /** - * @default 'none' - */ - ignoreJSX: "none" | "all" | "multi-line" | "single-line"; - /** - * @default true - */ - enforceForArrowConditionals: boolean; - }>, - ] - > - | Linter.RuleEntry<["functions"]>; - - /** - * Rule to disallow unnecessary semicolons. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-extra-semi - */ - "no-extra-semi": Linter.RuleEntry<[]>; - - /** - * Rule to disallow reassigning `function` declarations. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-func-assign - */ - "no-func-assign": Linter.RuleEntry<[]>; - - /** - * Rule to disallow variable or `function` declarations in nested blocks. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.6.0 - * @see https://eslint.org/docs/rules/no-inner-declarations - */ - "no-inner-declarations": Linter.RuleEntry<["functions" | "both"]>; - - /** - * Rule to disallow invalid regular expression strings in `RegExp` constructors. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.1.4 - * @see https://eslint.org/docs/rules/no-invalid-regexp - */ - "no-invalid-regexp": Linter.RuleEntry< - [ - Partial<{ - allowConstructorFlags: string[]; - }>, - ] - >; - - /** - * Rule to disallow irregular whitespace. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/no-irregular-whitespace - */ - "no-irregular-whitespace": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - skipStrings: boolean; - /** - * @default false - */ - skipComments: boolean; - /** - * @default false - */ - skipRegExps: boolean; - /** - * @default false - */ - skipTemplates: boolean; - }>, - ] - >; - - /** - * Rule to disallow characters which are made with multiple code points in character class syntax. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 5.3.0 - * @see https://eslint.org/docs/rules/no-misleading-character-class - */ - "no-misleading-character-class": Linter.RuleEntry<[]>; - - /** - * Rule to disallow calling global object properties as functions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-obj-calls - */ - "no-obj-calls": Linter.RuleEntry<[]>; - - /** - * Rule to disallow returning values from Promise executor functions. - * - * @since 7.3.0 - * @see https://eslint.org/docs/rules/no-promise-executor-return - */ - "no-promise-executor-return": Linter.RuleEntry<[ - { - /** - * @default false - */ - allowVoid?: boolean; - }, - ]>; - - /** - * Rule to disallow use of `Object.prototypes` builtins directly. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 2.11.0 - * @see https://eslint.org/docs/rules/no-prototype-builtins - */ - "no-prototype-builtins": Linter.RuleEntry<[]>; - - /** - * Rule to disallow multiple spaces in regular expressions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-regex-spaces - */ - "no-regex-spaces": Linter.RuleEntry<[]>; - - /** - * Rule to disallow sparse arrays. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-sparse-arrays - */ - "no-sparse-arrays": Linter.RuleEntry<[]>; - - /** - * Rule to disallow template literal placeholder syntax in regular strings. - * - * @since 3.3.0 - * @see https://eslint.org/docs/rules/no-template-curly-in-string - */ - "no-template-curly-in-string": Linter.RuleEntry<[]>; - - /** - * Rule to disallow confusing multiline expressions. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.24.0 - * @see https://eslint.org/docs/rules/no-unexpected-multiline - */ - "no-unexpected-multiline": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unreachable code after `return`, `throw`, `continue`, and `break` statements. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/no-unreachable - */ - "no-unreachable": Linter.RuleEntry<[]>; - - /** - * Rule to disallow control flow statements in `finally` blocks. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 2.9.0 - * @see https://eslint.org/docs/rules/no-unsafe-finally - */ - "no-unsafe-finally": Linter.RuleEntry<[]>; - - /** - * Rule to disallow negating the left operand of relational operators. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 3.3.0 - * @see https://eslint.org/docs/rules/no-unsafe-negation - */ - "no-unsafe-negation": Linter.RuleEntry<[]>; - - /** - * Rule to disallow assignments that can lead to race conditions due to usage of `await` or `yield`. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 5.3.0 - * @see https://eslint.org/docs/rules/require-atomic-updates - */ - "require-atomic-updates": Linter.RuleEntry<[]>; - - /** - * Rule to require calls to `isNaN()` when checking for `NaN`. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/use-isnan - */ - "use-isnan": Linter.RuleEntry<[]>; - - /** - * Rule to enforce comparing `typeof` expressions against valid strings. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.5.0 - * @see https://eslint.org/docs/rules/valid-typeof - */ - "valid-typeof": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - requireStringLiterals: boolean; - }>, - ] - >; -} diff --git a/node_modules/@types/eslint/rules/strict-mode.d.ts b/node_modules/@types/eslint/rules/strict-mode.d.ts deleted file mode 100644 index d63929b..0000000 --- a/node_modules/@types/eslint/rules/strict-mode.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Linter } from "../index"; - -export interface StrictMode extends Linter.RulesRecord { - /** - * Rule to require or disallow strict mode directives. - * - * @since 0.1.0 - * @see https://eslint.org/docs/rules/strict - */ - strict: Linter.RuleEntry<["safe" | "global" | "function" | "never"]>; -} diff --git a/node_modules/@types/eslint/rules/stylistic-issues.d.ts b/node_modules/@types/eslint/rules/stylistic-issues.d.ts deleted file mode 100644 index ec2f202..0000000 --- a/node_modules/@types/eslint/rules/stylistic-issues.d.ts +++ /dev/null @@ -1,1905 +0,0 @@ -import { Linter } from "../index"; - -export interface StylisticIssues extends Linter.RulesRecord { - /** - * Rule to enforce linebreaks after opening and before closing array brackets. - * - * @since 4.0.0-alpha.1 - * @see https://eslint.org/docs/rules/array-bracket-newline - */ - "array-bracket-newline": Linter.RuleEntry< - [ - | "always" - | "never" - | "consistent" - | Partial<{ - /** - * @default true - */ - multiline: boolean; - /** - * @default null - */ - minItems: number | null; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing inside array brackets. - * - * @since 0.24.0 - * @see https://eslint.org/docs/rules/array-bracket-spacing - */ - "array-bracket-spacing": - | Linter.RuleEntry< - [ - "never", - Partial<{ - /** - * @default false - */ - singleValue: boolean; - /** - * @default false - */ - objectsInArrays: boolean; - /** - * @default false - */ - arraysInArrays: boolean; - }>, - ] - > - | Linter.RuleEntry< - [ - "always", - Partial<{ - /** - * @default true - */ - singleValue: boolean; - /** - * @default true - */ - objectsInArrays: boolean; - /** - * @default true - */ - arraysInArrays: boolean; - }>, - ] - >; - - /** - * Rule to enforce line breaks after each array element. - * - * @since 4.0.0-rc.0 - * @see https://eslint.org/docs/rules/array-element-newline - */ - "array-element-newline": Linter.RuleEntry< - [ - | "always" - | "never" - | "consistent" - | Partial<{ - /** - * @default true - */ - multiline: boolean; - /** - * @default null - */ - minItems: number | null; - }>, - ] - >; - - /** - * Rule to disallow or enforce spaces inside of blocks after opening block and before closing block. - * - * @since 1.2.0 - * @see https://eslint.org/docs/rules/block-spacing - */ - "block-spacing": Linter.RuleEntry<["always" | "never"]>; - - /** - * Rule to enforce consistent brace style for blocks. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/brace-style - */ - "brace-style": Linter.RuleEntry< - [ - "1tbs" | "stroustrup" | "allman", - Partial<{ - /** - * @default false - */ - allowSingleLine: boolean; - }>, - ] - >; - - /** - * Rule to enforce camelcase naming convention. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/camelcase - */ - camelcase: Linter.RuleEntry< - [ - Partial<{ - /** - * @default 'always' - */ - properties: "always" | "never"; - /** - * @default false - */ - ignoreDestructuring: boolean; - /** - * @remarks - * Also accept for regular expression patterns - */ - allow: string[]; - }>, - ] - >; - - /** - * Rule to enforce or disallow capitalization of the first letter of a comment. - * - * @since 3.11.0 - * @see https://eslint.org/docs/rules/capitalized-comments - */ - "capitalized-comments": Linter.RuleEntry< - [ - "always" | "never", - Partial<{ - ignorePattern: string; - /** - * @default false - */ - ignoreInlineComments: boolean; - /** - * @default false - */ - ignoreConsecutiveComments: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow trailing commas. - * - * @since 0.16.0 - * @see https://eslint.org/docs/rules/comma-dangle - */ - "comma-dangle": Linter.RuleEntry< - [ - | "never" - | "always" - | "always-multiline" - | "only-multiline" - | Partial<{ - /** - * @default 'never' - */ - arrays: "never" | "always" | "always-multiline" | "only-multiline"; - /** - * @default 'never' - */ - objects: "never" | "always" | "always-multiline" | "only-multiline"; - /** - * @default 'never' - */ - imports: "never" | "always" | "always-multiline" | "only-multiline"; - /** - * @default 'never' - */ - exports: "never" | "always" | "always-multiline" | "only-multiline"; - /** - * @default 'never' - */ - functions: "never" | "always" | "always-multiline" | "only-multiline"; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing before and after commas. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/comma-spacing - */ - "comma-spacing": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - before: boolean; - /** - * @default true - */ - after: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent comma style. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/comma-style - */ - "comma-style": Linter.RuleEntry< - [ - "last" | "first", - Partial<{ - exceptions: Record; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing inside computed property brackets. - * - * @since 0.23.0 - * @see https://eslint.org/docs/rules/computed-property-spacing - */ - "computed-property-spacing": Linter.RuleEntry<["never" | "always"]>; - - /** - * Rule to enforce consistent naming when capturing the current execution context. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/consistent-this - */ - "consistent-this": Linter.RuleEntry<[...string[]]>; - - /** - * Rule to require or disallow newline at the end of files. - * - * @since 0.7.1 - * @see https://eslint.org/docs/rules/eol-last - */ - "eol-last": Linter.RuleEntry< - [ - "always" | "never", // | 'unix' | 'windows' - ] - >; - - /** - * Rule to require or disallow spacing between function identifiers and their invocations. - * - * @since 3.3.0 - * @see https://eslint.org/docs/rules/func-call-spacing - */ - "func-call-spacing": Linter.RuleEntry<["never" | "always"]>; - - /** - * Rule to require function names to match the name of the variable or property to which they are assigned. - * - * @since 3.8.0 - * @see https://eslint.org/docs/rules/func-name-matching - */ - "func-name-matching": - | Linter.RuleEntry< - [ - "always" | "never", - Partial<{ - /** - * @default false - */ - considerPropertyDescriptor: boolean; - /** - * @default false - */ - includeCommonJSModuleExports: boolean; - }>, - ] - > - | Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - considerPropertyDescriptor: boolean; - /** - * @default false - */ - includeCommonJSModuleExports: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow named `function` expressions. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/func-names - */ - "func-names": Linter.RuleEntry< - [ - "always" | "as-needed" | "never", - Partial<{ - generators: "always" | "as-needed" | "never"; - }>, - ] - >; - - /** - * Rule to enforce the consistent use of either `function` declarations or expressions. - * - * @since 0.2.0 - * @see https://eslint.org/docs/rules/func-style - */ - "func-style": Linter.RuleEntry< - [ - "expression" | "declaration", - Partial<{ - /** - * @default false - */ - allowArrowFunctions: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent line breaks inside function parentheses. - * - * @since 4.6.0 - * @see https://eslint.org/docs/rules/function-paren-newline - */ - "function-paren-newline": Linter.RuleEntry< - [ - | "always" - | "never" - | "multiline" - | "multiline-arguments" - | "consistent" - | Partial<{ - minItems: number; - }>, - ] - >; - - /** - * Rule to disallow specified identifiers. - * - * @since 2.0.0-beta.2 - * @see https://eslint.org/docs/rules/id-blacklist - */ - "id-blacklist": Linter.RuleEntry<[...string[]]>; - - /** - * Rule to enforce minimum and maximum identifier lengths. - * - * @since 1.0.0 - * @see https://eslint.org/docs/rules/id-length - */ - "id-length": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 2 - */ - min: number; - /** - * @default Infinity - */ - max: number; - /** - * @default 'always' - */ - properties: "always" | "never"; - exceptions: string[]; - }>, - ] - >; - - /** - * Rule to require identifiers to match a specified regular expression. - * - * @since 1.0.0 - * @see https://eslint.org/docs/rules/id-match - */ - "id-match": Linter.RuleEntry< - [ - string, - Partial<{ - /** - * @default false - */ - properties: boolean; - /** - * @default false - */ - onlyDeclarations: boolean; - /** - * @default false - */ - ignoreDestructuring: boolean; - }>, - ] - >; - - /** - * Rule to enforce the location of arrow function bodies. - * - * @since 4.12.0 - * @see https://eslint.org/docs/rules/implicit-arrow-linebreak - */ - "implicit-arrow-linebreak": Linter.RuleEntry<["beside" | "below"]>; - - /** - * Rule to enforce consistent indentation. - * - * @since 0.14.0 - * @see https://eslint.org/docs/rules/indent - */ - indent: Linter.RuleEntry< - [ - number | "tab", - Partial<{ - /** - * @default 0 - */ - SwitchCase: number; - /** - * @default 1 - */ - VariableDeclarator: - | Partial<{ - /** - * @default 1 - */ - var: number | "first"; - /** - * @default 1 - */ - let: number | "first"; - /** - * @default 1 - */ - const: number | "first"; - }> - | number - | "first"; - /** - * @default 1 - */ - outerIIFEBody: number; - /** - * @default 1 - */ - MemberExpression: number | "off"; - /** - * @default { parameters: 1, body: 1 } - */ - FunctionDeclaration: Partial<{ - /** - * @default 1 - */ - parameters: number | "first" | "off"; - /** - * @default 1 - */ - body: number; - }>; - /** - * @default { parameters: 1, body: 1 } - */ - FunctionExpression: Partial<{ - /** - * @default 1 - */ - parameters: number | "first" | "off"; - /** - * @default 1 - */ - body: number; - }>; - /** - * @default { arguments: 1 } - */ - CallExpression: Partial<{ - /** - * @default 1 - */ - arguments: number | "first" | "off"; - }>; - /** - * @default 1 - */ - ArrayExpression: number | "first" | "off"; - /** - * @default 1 - */ - ObjectExpression: number | "first" | "off"; - /** - * @default 1 - */ - ImportDeclaration: number | "first" | "off"; - /** - * @default false - */ - flatTernaryExpressions: boolean; - ignoredNodes: string[]; - /** - * @default false - */ - ignoreComments: boolean; - }>, - ] - >; - - /** - * Rule to enforce the consistent use of either double or single quotes in JSX attributes. - * - * @since 1.4.0 - * @see https://eslint.org/docs/rules/jsx-quotes - */ - "jsx-quotes": Linter.RuleEntry<["prefer-double" | "prefer-single"]>; - - /** - * Rule to enforce consistent spacing between keys and values in object literal properties. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/key-spacing - */ - "key-spacing": Linter.RuleEntry< - [ - | Partial< - | { - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - align: - | Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'colon' - */ - on: "value" | "colon"; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - }> - | "value" - | "colon"; - } - | { - singleLine?: - | Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - }> - | undefined; - multiLine?: - | Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - align: - | Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'colon' - */ - on: "value" | "colon"; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - }> - | "value" - | "colon"; - }> - | undefined; - } - > - | { - align: Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'colon' - */ - on: "value" | "colon"; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - }>; - singleLine?: - | Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - }> - | undefined; - multiLine?: - | Partial<{ - /** - * @default false - */ - beforeColon: boolean; - /** - * @default true - */ - afterColon: boolean; - /** - * @default 'strict' - */ - mode: "strict" | "minimum"; - }> - | undefined; - }, - ] - >; - - /** - * Rule to enforce consistent spacing before and after keywords. - * - * @since 2.0.0-beta.1 - * @see https://eslint.org/docs/rules/keyword-spacing - */ - "keyword-spacing": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - before: boolean; - /** - * @default true - */ - after: boolean; - overrides: Record< - string, - Partial<{ - before: boolean; - after: boolean; - }> - >; - }>, - ] - >; - - /** - * Rule to enforce position of line comments. - * - * @since 3.5.0 - * @see https://eslint.org/docs/rules/line-comment-position - */ - "line-comment-position": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 'above' - */ - position: "above" | "beside"; - ignorePattern: string; - /** - * @default true - */ - applyDefaultIgnorePatterns: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent linebreak style. - * - * @since 0.21.0 - * @see https://eslint.org/docs/rules/linebreak-style - */ - "linebreak-style": Linter.RuleEntry<["unix" | "windows"]>; - - /** - * Rule to require empty lines around comments. - * - * @since 0.22.0 - * @see https://eslint.org/docs/rules/lines-around-comment - */ - "lines-around-comment": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - beforeBlockComment: boolean; - /** - * @default false - */ - afterBlockComment: boolean; - /** - * @default false - */ - beforeLineComment: boolean; - /** - * @default false - */ - afterLineComment: boolean; - /** - * @default false - */ - allowBlockStart: boolean; - /** - * @default false - */ - allowBlockEnd: boolean; - /** - * @default false - */ - allowObjectStart: boolean; - /** - * @default false - */ - allowObjectEnd: boolean; - /** - * @default false - */ - allowArrayStart: boolean; - /** - * @default false - */ - allowArrayEnd: boolean; - /** - * @default false - */ - allowClassStart: boolean; - /** - * @default false - */ - allowClassEnd: boolean; - ignorePattern: string; - /** - * @default true - */ - applyDefaultIgnorePatterns: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow an empty line between class members. - * - * @since 4.9.0 - * @see https://eslint.org/docs/rules/lines-between-class-members - */ - "lines-between-class-members": Linter.RuleEntry< - [ - "always" | "never", - Partial<{ - /** - * @default false - */ - exceptAfterSingleLine: boolean; - }>, - ] - >; - - /** - * Rule to enforce a maximum depth that blocks can be nested. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/max-depth - */ - "max-depth": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 4 - */ - max: number; - }>, - ] - >; - - /** - * Rule to enforce a maximum line length. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/max-len - */ - "max-len": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 80 - */ - code: number; - /** - * @default 4 - */ - tabWidth: number; - comments: number; - ignorePattern: string; - /** - * @default false - */ - ignoreComments: boolean; - /** - * @default false - */ - ignoreTrailingComments: boolean; - /** - * @default false - */ - ignoreUrls: boolean; - /** - * @default false - */ - ignoreStrings: boolean; - /** - * @default false - */ - ignoreTemplateLiterals: boolean; - /** - * @default false - */ - ignoreRegExpLiterals: boolean; - }>, - ] - >; - - /** - * Rule to enforce a maximum number of lines per file. - * - * @since 2.12.0 - * @see https://eslint.org/docs/rules/max-lines - */ - "max-lines": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 300 - */ - max: number; - /** - * @default false - */ - skipBlankLines: boolean; - /** - * @default false - */ - skipComments: boolean; - }> - | number, - ] - >; - - /** - * Rule to enforce a maximum number of line of code in a function. - * - * @since 5.0.0 - * @see https://eslint.org/docs/rules/max-lines-per-function - */ - "max-lines-per-function": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 50 - */ - max: number; - /** - * @default false - */ - skipBlankLines: boolean; - /** - * @default false - */ - skipComments: boolean; - /** - * @default false - */ - IIFEs: boolean; - }>, - ] - >; - - /** - * Rule to enforce a maximum depth that callbacks can be nested. - * - * @since 0.2.0 - * @see https://eslint.org/docs/rules/max-nested-callbacks - */ - "max-nested-callbacks": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 10 - */ - max: number; - }> - | number, - ] - >; - - /** - * Rule to enforce a maximum number of parameters in function definitions. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/max-params - */ - "max-params": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 3 - */ - max: number; - }> - | number, - ] - >; - - /** - * Rule to enforce a maximum number of statements allowed in function blocks. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/max-statements - */ - "max-statements": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 10 - */ - max: number; - /** - * @default false - */ - ignoreTopLevelFunctions: boolean; - }> - | number, - ] - >; - - /** - * Rule to enforce a maximum number of statements allowed per line. - * - * @since 2.5.0 - * @see https://eslint.org/docs/rules/max-statements-per-line - */ - "max-statements-per-line": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 1 - */ - max: number; - }> - | number, - ] - >; - - /** - * Rule to enforce a particular style for multiline comments. - * - * @since 4.10.0 - * @see https://eslint.org/docs/rules/multiline-comment-style - */ - "multiline-comment-style": Linter.RuleEntry<["starred-block" | "bare-block" | "separate-lines"]>; - - /** - * Rule to enforce newlines between operands of ternary expressions. - * - * @since 3.1.0 - * @see https://eslint.org/docs/rules/multiline-ternary - */ - "multiline-ternary": Linter.RuleEntry<["always" | "always-multiline" | "never"]>; - - /** - * Rule to require constructor names to begin with a capital letter. - * - * @since 0.0.3-0 - * @see https://eslint.org/docs/rules/new-cap - */ - "new-cap": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - newIsCap: boolean; - /** - * @default true - */ - capIsNew: boolean; - newIsCapExceptions: string[]; - newIsCapExceptionPattern: string; - capIsNewExceptions: string[]; - capIsNewExceptionPattern: string; - /** - * @default true - */ - properties: boolean; - }>, - ] - >; - - /** - * Rule to enforce or disallow parentheses when invoking a constructor with no arguments. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/new-parens - */ - "new-parens": Linter.RuleEntry<["always" | "never"]>; - - /** - * Rule to require a newline after each call in a method chain. - * - * @since 2.0.0-rc.0 - * @see https://eslint.org/docs/rules/newline-per-chained-call - */ - "newline-per-chained-call": Linter.RuleEntry< - [ - { - /** - * @default 2 - */ - ignoreChainWithDepth: number; - }, - ] - >; - - /** - * Rule to disallow `Array` constructors. - * - * @since 0.4.0 - * @see https://eslint.org/docs/rules/no-array-constructor - */ - "no-array-constructor": Linter.RuleEntry<[]>; - - /** - * Rule to disallow bitwise operators. - * - * @since 0.0.2 - * @see https://eslint.org/docs/rules/no-bitwise - */ - "no-bitwise": Linter.RuleEntry< - [ - Partial<{ - allow: string[]; - /** - * @default false - */ - int32Hint: boolean; - }>, - ] - >; - - /** - * Rule to disallow `continue` statements. - * - * @since 0.19.0 - * @see https://eslint.org/docs/rules/no-continue - */ - "no-continue": Linter.RuleEntry<[]>; - - /** - * Rule to disallow inline comments after code. - * - * @since 0.10.0 - * @see https://eslint.org/docs/rules/no-inline-comments - */ - "no-inline-comments": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `if` statements as the only statement in `else` blocks. - * - * @since 0.6.0 - * @see https://eslint.org/docs/rules/no-lonely-if - */ - "no-lonely-if": Linter.RuleEntry<[]>; - - /** - * Rule to disallow mixed binary operators. - * - * @since 2.12.0 - * @see https://eslint.org/docs/rules/no-mixed-operators - */ - "no-mixed-operators": Linter.RuleEntry< - [ - Partial<{ - /** - * @default - * [ - * ["+", "-", "*", "/", "%", "**"], - * ["&", "|", "^", "~", "<<", ">>", ">>>"], - * ["==", "!=", "===", "!==", ">", ">=", "<", "<="], - * ["&&", "||"], - * ["in", "instanceof"] - * ] - */ - groups: string[][]; - /** - * @default true - */ - allowSamePrecedence: boolean; - }>, - ] - >; - - /** - * Rule to disallow mixed spaces and tabs for indentation. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.7.1 - * @see https://eslint.org/docs/rules/no-mixed-spaces-and-tabs - */ - "no-mixed-spaces-and-tabs": Linter.RuleEntry<["smart-tabs"]>; - - /** - * Rule to disallow use of chained assignment expressions. - * - * @since 3.14.0 - * @see https://eslint.org/docs/rules/no-multi-assign - */ - "no-multi-assign": Linter.RuleEntry<[]>; - - /** - * Rule to disallow multiple empty lines. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/no-multiple-empty-lines - */ - "no-multiple-empty-lines": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default 2 - */ - max: number; - maxEOF: number; - maxBOF: number; - }> - | number, - ] - >; - - /** - * Rule to disallow negated conditions. - * - * @since 1.6.0 - * @see https://eslint.org/docs/rules/no-negated-condition - */ - "no-negated-condition": Linter.RuleEntry<[]>; - - /** - * Rule to disallow nested ternary expressions. - * - * @since 0.2.0 - * @see https://eslint.org/docs/rules/no-nested-ternary - */ - "no-nested-ternary": Linter.RuleEntry<[]>; - - /** - * Rule to disallow `Object` constructors. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-new-object - */ - "no-new-object": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the unary operators `++` and `--`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-plusplus - */ - "no-plusplus": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowForLoopAfterthoughts: boolean; - }>, - ] - >; - - /** - * Rule to disallow specified syntax. - * - * @since 1.4.0 - * @see https://eslint.org/docs/rules/no-restricted-syntax - */ - "no-restricted-syntax": Linter.RuleEntry< - [ - ...Array< - | string - | { - selector: string; - message?: string | undefined; - } - >, - ] - >; - - /** - * Rule to disallow all tabs. - * - * @since 3.2.0 - * @see https://eslint.org/docs/rules/no-tabs - */ - "no-tabs": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowIndentationTabs: boolean; - }>, - ] - >; - - /** - * Rule to disallow ternary operators. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-ternary - */ - "no-ternary": Linter.RuleEntry<[]>; - - /** - * Rule to disallow trailing whitespace at the end of lines. - * - * @since 0.7.1 - * @see https://eslint.org/docs/rules/no-trailing-spaces - */ - "no-trailing-spaces": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - skipBlankLines: boolean; - /** - * @default false - */ - ignoreComments: boolean; - }>, - ] - >; - - /** - * Rule to disallow dangling underscores in identifiers. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-underscore-dangle - */ - "no-underscore-dangle": Linter.RuleEntry< - [ - Partial<{ - allow: string[]; - /** - * @default false - */ - allowAfterThis: boolean; - /** - * @default false - */ - allowAfterSuper: boolean; - /** - * @default false - */ - enforceInMethodNames: boolean; - }>, - ] - >; - - /** - * Rule to disallow ternary operators when simpler alternatives exist. - * - * @since 0.21.0 - * @see https://eslint.org/docs/rules/no-unneeded-ternary - */ - "no-unneeded-ternary": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - defaultAssignment: boolean; - }>, - ] - >; - - /** - * Rule to disallow whitespace before properties. - * - * @since 2.0.0-beta.1 - * @see https://eslint.org/docs/rules/no-whitespace-before-property - */ - "no-whitespace-before-property": Linter.RuleEntry<[]>; - - /** - * Rule to enforce the location of single-line statements. - * - * @since 3.17.0 - * @see https://eslint.org/docs/rules/nonblock-statement-body-position - */ - "nonblock-statement-body-position": Linter.RuleEntry< - [ - "beside" | "below" | "any", - Partial<{ - overrides: Record; - }>, - ] - >; - - /** - * Rule to enforce consistent line breaks inside braces. - * - * @since 2.12.0 - * @see https://eslint.org/docs/rules/object-curly-newline - */ - "object-curly-newline": Linter.RuleEntry< - [ - | "always" - | "never" - | Partial<{ - /** - * @default false - */ - multiline: boolean; - minProperties: number; - /** - * @default true - */ - consistent: boolean; - }> - | Partial< - Record< - "ObjectExpression" | "ObjectPattern" | "ImportDeclaration" | "ExportDeclaration", - | "always" - | "never" - | Partial<{ - /** - * @default false - */ - multiline: boolean; - minProperties: number; - /** - * @default true - */ - consistent: boolean; - }> - > - >, - ] - >; - - /** - * Rule to enforce consistent spacing inside braces. - * - * @since 0.22.0 - * @see https://eslint.org/docs/rules/object-curly-spacing - */ - "object-curly-spacing": - | Linter.RuleEntry< - [ - "never", - { - /** - * @default false - */ - arraysInObjects: boolean; - /** - * @default false - */ - objectsInObjects: boolean; - }, - ] - > - | Linter.RuleEntry< - [ - "always", - { - /** - * @default true - */ - arraysInObjects: boolean; - /** - * @default true - */ - objectsInObjects: boolean; - }, - ] - >; - - /** - * Rule to enforce placing object properties on separate lines. - * - * @since 2.10.0 - * @see https://eslint.org/docs/rules/object-property-newline - */ - "object-property-newline": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - allowAllPropertiesOnSameLine: boolean; - }>, - ] - >; - - /** - * Rule to enforce variables to be declared either together or separately in functions. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/one-var - */ - "one-var": Linter.RuleEntry< - [ - | "always" - | "never" - | "consecutive" - | Partial< - { - /** - * @default false - */ - separateRequires: boolean; - } & Record<"var" | "let" | "const", "always" | "never" | "consecutive"> - > - | Partial>, - ] - >; - - /** - * Rule to require or disallow newlines around variable declarations. - * - * @since 2.0.0-beta.3 - * @see https://eslint.org/docs/rules/one-var-declaration-per-line - */ - "one-var-declaration-per-line": Linter.RuleEntry<["initializations" | "always"]>; - - /** - * Rule to require or disallow assignment operator shorthand where possible. - * - * @since 0.10.0 - * @see https://eslint.org/docs/rules/operator-assignment - */ - "operator-assignment": Linter.RuleEntry<["always" | "never"]>; - - /** - * Rule to enforce consistent linebreak style for operators. - * - * @since 0.19.0 - * @see https://eslint.org/docs/rules/operator-linebreak - */ - "operator-linebreak": Linter.RuleEntry< - [ - "after" | "before" | "none", - Partial<{ - overrides: Record; - }>, - ] - >; - - /** - * Rule to require or disallow padding within blocks. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/padded-blocks - */ - "padded-blocks": Linter.RuleEntry< - [ - "always" | "never" | Partial>, - { - /** - * @default false - */ - allowSingleLineBlocks: boolean; - }, - ] - >; - - /** - * Rule to require or disallow padding lines between statements. - * - * @since 4.0.0-beta.0 - * @see https://eslint.org/docs/rules/padding-line-between-statements - */ - "padding-line-between-statements": Linter.RuleEntry< - [ - ...Array< - { - blankLine: "any" | "never" | "always"; - } & Record<"prev" | "next", string | string[]> - >, - ] - >; - - /** - * Rule to disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. - * - * @since 5.0.0-alpha.3 - * @see https://eslint.org/docs/rules/prefer-object-spread - */ - "prefer-object-spread": Linter.RuleEntry<[]>; - - /** - * Rule to require quotes around object literal property names. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/quote-props - */ - "quote-props": - | Linter.RuleEntry<["always" | "consistent"]> - | Linter.RuleEntry< - [ - "as-needed", - Partial<{ - /** - * @default false - */ - keywords: boolean; - /** - * @default true - */ - unnecessary: boolean; - /** - * @default false - */ - numbers: boolean; - }>, - ] - > - | Linter.RuleEntry< - [ - "consistent-as-needed", - Partial<{ - /** - * @default false - */ - keywords: boolean; - }>, - ] - >; - - /** - * Rule to enforce the consistent use of either backticks, double, or single quotes. - * - * @since 0.0.7 - * @see https://eslint.org/docs/rules/quotes - */ - quotes: Linter.RuleEntry< - [ - "double" | "single" | "backtick", - Partial<{ - /** - * @default false - */ - avoidEscape: boolean; - /** - * @default false - */ - allowTemplateLiterals: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow semicolons instead of ASI. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/semi - */ - semi: - | Linter.RuleEntry< - [ - "always", - Partial<{ - /** - * @default false - */ - omitLastInOneLineBlock: boolean; - }>, - ] - > - | Linter.RuleEntry< - [ - "never", - Partial<{ - /** - * @default 'any' - */ - beforeStatementContinuationChars: "any" | "always" | "never"; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing before and after semicolons. - * - * @since 0.16.0 - * @see https://eslint.org/docs/rules/semi-spacing - */ - "semi-spacing": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - before: boolean; - /** - * @default true - */ - after: boolean; - }>, - ] - >; - - /** - * Rule to enforce location of semicolons. - * - * @since 4.0.0-beta.0 - * @see https://eslint.org/docs/rules/semi-style - */ - "semi-style": Linter.RuleEntry<["last" | "first"]>; - - /** - * Rule to require object keys to be sorted. - * - * @since 3.3.0 - * @see https://eslint.org/docs/rules/sort-keys - */ - "sort-keys": Linter.RuleEntry< - [ - "asc" | "desc", - Partial<{ - /** - * @default true - */ - caseSensitive: boolean; - /** - * @default 2 - */ - minKeys: number; - /** - * @default false - */ - natural: boolean; - /** - * @default false - */ - allowLineSeparatedGroups: boolean; - }>, - ] - >; - - /** - * Rule to require variables within the same declaration block to be sorted. - * - * @since 0.2.0 - * @see https://eslint.org/docs/rules/sort-vars - */ - "sort-vars": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - ignoreCase: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing before blocks. - * - * @since 0.9.0 - * @see https://eslint.org/docs/rules/space-before-blocks - */ - "space-before-blocks": Linter.RuleEntry< - ["always" | "never" | Partial>] - >; - - /** - * Rule to enforce consistent spacing before `function` definition opening parenthesis. - * - * @since 0.18.0 - * @see https://eslint.org/docs/rules/space-before-function-paren - */ - "space-before-function-paren": Linter.RuleEntry< - ["always" | "never" | Partial>] - >; - - /** - * Rule to enforce consistent spacing inside parentheses. - * - * @since 0.8.0 - * @see https://eslint.org/docs/rules/space-in-parens - */ - "space-in-parens": Linter.RuleEntry< - [ - "never" | "always", - Partial<{ - exceptions: string[]; - }>, - ] - >; - - /** - * Rule to require spacing around infix operators. - * - * @since 0.2.0 - * @see https://eslint.org/docs/rules/space-infix-ops - */ - "space-infix-ops": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - int32Hint: boolean; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing before or after unary operators. - * - * @since 0.10.0 - * @see https://eslint.org/docs/rules/space-unary-ops - */ - "space-unary-ops": Linter.RuleEntry< - [ - Partial<{ - /** - * @default true - */ - words: boolean; - /** - * @default false - */ - nonwords: boolean; - overrides: Record; - }>, - ] - >; - - /** - * Rule to enforce consistent spacing after the `//` or `/*` in a comment. - * - * @since 0.23.0 - * @see https://eslint.org/docs/rules/spaced-comment - */ - "spaced-comment": Linter.RuleEntry< - [ - "always" | "never", - { - exceptions: string[]; - markers: string[]; - line: { - exceptions: string[]; - markers: string[]; - }; - block: { - exceptions: string[]; - markers: string[]; - /** - * @default false - */ - balanced: boolean; - }; - }, - ] - >; - - /** - * Rule to enforce spacing around colons of switch statements. - * - * @since 4.0.0-beta.0 - * @see https://eslint.org/docs/rules/switch-colon-spacing - */ - "switch-colon-spacing": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - before: boolean; - /** - * @default true - */ - after: boolean; - }>, - ] - >; - - /** - * Rule to require or disallow spacing between template tags and their literals. - * - * @since 3.15.0 - * @see https://eslint.org/docs/rules/template-tag-spacing - */ - "template-tag-spacing": Linter.RuleEntry<["never" | "always"]>; - - /** - * Rule to require or disallow Unicode byte order mark (BOM). - * - * @since 2.11.0 - * @see https://eslint.org/docs/rules/unicode-bom - */ - "unicode-bom": Linter.RuleEntry<["never" | "always"]>; - - /** - * Rule to require parenthesis around regex literals. - * - * @since 0.1.0 - * @see https://eslint.org/docs/rules/wrap-regex - */ - "wrap-regex": Linter.RuleEntry<[]>; -} diff --git a/node_modules/@types/eslint/rules/variables.d.ts b/node_modules/@types/eslint/rules/variables.d.ts deleted file mode 100644 index 3572935..0000000 --- a/node_modules/@types/eslint/rules/variables.d.ts +++ /dev/null @@ -1,187 +0,0 @@ -import { Linter } from "../index"; - -export interface Variables extends Linter.RulesRecord { - /** - * Rule to require or disallow initialization in variable declarations. - * - * @since 1.0.0-rc-1 - * @see https://eslint.org/docs/rules/init-declarations - */ - "init-declarations": - | Linter.RuleEntry<["always"]> - | Linter.RuleEntry< - [ - "never", - Partial<{ - ignoreForLoopInit: boolean; - }>, - ] - >; - - /** - * Rule to disallow deleting variables. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-delete-var - */ - "no-delete-var": Linter.RuleEntry<[]>; - - /** - * Rule to disallow labels that share a name with a variable. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-label-var - */ - "no-label-var": Linter.RuleEntry<[]>; - - /** - * Rule to disallow specified global variables. - * - * @since 2.3.0 - * @see https://eslint.org/docs/rules/no-restricted-globals - */ - "no-restricted-globals": Linter.RuleEntry< - [ - ...Array< - | string - | { - name: string; - message?: string | undefined; - } - >, - ] - >; - - /** - * Rule to disallow variable declarations from shadowing variables declared in the outer scope. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-shadow - */ - "no-shadow": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - builtinGlobals: boolean; - /** - * @default 'functions' - */ - hoist: "functions" | "all" | "never"; - allow: string[]; - }>, - ] - >; - - /** - * Rule to disallow identifiers from shadowing restricted names. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.1.4 - * @see https://eslint.org/docs/rules/no-shadow-restricted-names - */ - "no-shadow-restricted-names": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of undeclared variables unless mentioned in `global` comments. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-undef - */ - "no-undef": Linter.RuleEntry< - [ - Partial<{ - /** - * @default false - */ - typeof: boolean; - }>, - ] - >; - - /** - * Rule to disallow initializing variables to `undefined`. - * - * @since 0.0.6 - * @see https://eslint.org/docs/rules/no-undef-init - */ - "no-undef-init": Linter.RuleEntry<[]>; - - /** - * Rule to disallow the use of `undefined` as an identifier. - * - * @since 0.7.1 - * @see https://eslint.org/docs/rules/no-undefined - */ - "no-undefined": Linter.RuleEntry<[]>; - - /** - * Rule to disallow unused variables. - * - * @remarks - * Recommended by ESLint, the rule was enabled in `eslint:recommended`. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-unused-vars - */ - "no-unused-vars": Linter.RuleEntry< - [ - Partial<{ - /** - * @default 'all' - */ - vars: "all" | "local"; - varsIgnorePattern: string; - /** - * @default 'after-used' - */ - args: "after-used" | "all" | "none"; - /** - * @default false - */ - ignoreRestSiblings: boolean; - argsIgnorePattern: string; - /** - * @default 'none' - */ - caughtErrors: "none" | "all"; - caughtErrorsIgnorePattern: string; - }>, - ] - >; - - /** - * Rule to disallow the use of variables before they are defined. - * - * @since 0.0.9 - * @see https://eslint.org/docs/rules/no-use-before-define - */ - "no-use-before-define": Linter.RuleEntry< - [ - | Partial<{ - /** - * @default true - */ - functions: boolean; - /** - * @default true - */ - classes: boolean; - /** - * @default true - */ - variables: boolean; - }> - | "nofunc", - ] - >; -} diff --git a/node_modules/@types/eslint/use-at-your-own-risk.d.ts b/node_modules/@types/eslint/use-at-your-own-risk.d.ts deleted file mode 100644 index 089a657..0000000 --- a/node_modules/@types/eslint/use-at-your-own-risk.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @deprecated */ -export const builtinRules: Map; -/** @deprecated */ -export class FileEnumerator { - constructor( - params?: { - cwd?: string; - configArrayFactory?: any; - extensions?: any; - globInputPaths?: boolean; - errorOnUnmatchedPattern?: boolean; - ignore?: boolean; - }, - ); - isTargetPath(filePath: string, providedConfig?: any): boolean; - iterateFiles( - patternOrPatterns: string | string[], - ): IterableIterator<{ config: any; filePath: string; ignored: boolean }>; -} diff --git a/node_modules/@types/estree/LICENSE b/node_modules/@types/estree/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/estree/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/estree/README.md b/node_modules/@types/estree/README.md deleted file mode 100644 index c9bc4d5..0000000 --- a/node_modules/@types/estree/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/estree` - -# Summary -This package contains type definitions for estree (https://github.com/estree/estree). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree. - -### Additional Details - * Last updated: Mon, 06 Nov 2023 22:41:05 GMT - * Dependencies: none - -# Credits -These definitions were written by [RReverser](https://github.com/RReverser). diff --git a/node_modules/@types/estree/flow.d.ts b/node_modules/@types/estree/flow.d.ts deleted file mode 100644 index 9d001a9..0000000 --- a/node_modules/@types/estree/flow.d.ts +++ /dev/null @@ -1,167 +0,0 @@ -declare namespace ESTree { - interface FlowTypeAnnotation extends Node {} - - interface FlowBaseTypeAnnotation extends FlowTypeAnnotation {} - - interface FlowLiteralTypeAnnotation extends FlowTypeAnnotation, Literal {} - - interface FlowDeclaration extends Declaration {} - - interface AnyTypeAnnotation extends FlowBaseTypeAnnotation {} - - interface ArrayTypeAnnotation extends FlowTypeAnnotation { - elementType: FlowTypeAnnotation; - } - - interface BooleanLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {} - - interface BooleanTypeAnnotation extends FlowBaseTypeAnnotation {} - - interface ClassImplements extends Node { - id: Identifier; - typeParameters?: TypeParameterInstantiation | null; - } - - interface ClassProperty { - key: Expression; - value?: Expression | null; - typeAnnotation?: TypeAnnotation | null; - computed: boolean; - static: boolean; - } - - interface DeclareClass extends FlowDeclaration { - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - body: ObjectTypeAnnotation; - extends: InterfaceExtends[]; - } - - interface DeclareFunction extends FlowDeclaration { - id: Identifier; - } - - interface DeclareModule extends FlowDeclaration { - id: Literal | Identifier; - body: BlockStatement; - } - - interface DeclareVariable extends FlowDeclaration { - id: Identifier; - } - - interface FunctionTypeAnnotation extends FlowTypeAnnotation { - params: FunctionTypeParam[]; - returnType: FlowTypeAnnotation; - rest?: FunctionTypeParam | null; - typeParameters?: TypeParameterDeclaration | null; - } - - interface FunctionTypeParam { - name: Identifier; - typeAnnotation: FlowTypeAnnotation; - optional: boolean; - } - - interface GenericTypeAnnotation extends FlowTypeAnnotation { - id: Identifier | QualifiedTypeIdentifier; - typeParameters?: TypeParameterInstantiation | null; - } - - interface InterfaceExtends extends Node { - id: Identifier | QualifiedTypeIdentifier; - typeParameters?: TypeParameterInstantiation | null; - } - - interface InterfaceDeclaration extends FlowDeclaration { - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - extends: InterfaceExtends[]; - body: ObjectTypeAnnotation; - } - - interface IntersectionTypeAnnotation extends FlowTypeAnnotation { - types: FlowTypeAnnotation[]; - } - - interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {} - - interface NullableTypeAnnotation extends FlowTypeAnnotation { - typeAnnotation: TypeAnnotation; - } - - interface NumberLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {} - - interface NumberTypeAnnotation extends FlowBaseTypeAnnotation {} - - interface StringLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {} - - interface StringTypeAnnotation extends FlowBaseTypeAnnotation {} - - interface TupleTypeAnnotation extends FlowTypeAnnotation { - types: FlowTypeAnnotation[]; - } - - interface TypeofTypeAnnotation extends FlowTypeAnnotation { - argument: FlowTypeAnnotation; - } - - interface TypeAlias extends FlowDeclaration { - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - right: FlowTypeAnnotation; - } - - interface TypeAnnotation extends Node { - typeAnnotation: FlowTypeAnnotation; - } - - interface TypeCastExpression extends Expression { - expression: Expression; - typeAnnotation: TypeAnnotation; - } - - interface TypeParameterDeclaration extends Node { - params: Identifier[]; - } - - interface TypeParameterInstantiation extends Node { - params: FlowTypeAnnotation[]; - } - - interface ObjectTypeAnnotation extends FlowTypeAnnotation { - properties: ObjectTypeProperty[]; - indexers: ObjectTypeIndexer[]; - callProperties: ObjectTypeCallProperty[]; - } - - interface ObjectTypeCallProperty extends Node { - value: FunctionTypeAnnotation; - static: boolean; - } - - interface ObjectTypeIndexer extends Node { - id: Identifier; - key: FlowTypeAnnotation; - value: FlowTypeAnnotation; - static: boolean; - } - - interface ObjectTypeProperty extends Node { - key: Expression; - value: FlowTypeAnnotation; - optional: boolean; - static: boolean; - } - - interface QualifiedTypeIdentifier extends Node { - qualification: Identifier | QualifiedTypeIdentifier; - id: Identifier; - } - - interface UnionTypeAnnotation extends FlowTypeAnnotation { - types: FlowTypeAnnotation[]; - } - - interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {} -} diff --git a/node_modules/@types/estree/index.d.ts b/node_modules/@types/estree/index.d.ts deleted file mode 100644 index e933e20..0000000 --- a/node_modules/@types/estree/index.d.ts +++ /dev/null @@ -1,683 +0,0 @@ -// This definition file follows a somewhat unusual format. ESTree allows -// runtime type checks based on the `type` parameter. In order to explain this -// to typescript we want to use discriminated union types: -// https://github.com/Microsoft/TypeScript/pull/9163 -// -// For ESTree this is a bit tricky because the high level interfaces like -// Node or Function are pulling double duty. We want to pass common fields down -// to the interfaces that extend them (like Identifier or -// ArrowFunctionExpression), but you can't extend a type union or enforce -// common fields on them. So we've split the high level interfaces into two -// types, a base type which passes down inherited fields, and a type union of -// all types which extend the base type. Only the type union is exported, and -// the union is how other types refer to the collection of inheriting types. -// -// This makes the definitions file here somewhat more difficult to maintain, -// but it has the notable advantage of making ESTree much easier to use as -// an end user. - -export interface BaseNodeWithoutComments { - // Every leaf interface that extends BaseNode must specify a type property. - // The type property should be a string literal. For example, Identifier - // has: `type: "Identifier"` - type: string; - loc?: SourceLocation | null | undefined; - range?: [number, number] | undefined; -} - -export interface BaseNode extends BaseNodeWithoutComments { - leadingComments?: Comment[] | undefined; - trailingComments?: Comment[] | undefined; -} - -export interface NodeMap { - AssignmentProperty: AssignmentProperty; - CatchClause: CatchClause; - Class: Class; - ClassBody: ClassBody; - Expression: Expression; - Function: Function; - Identifier: Identifier; - Literal: Literal; - MethodDefinition: MethodDefinition; - ModuleDeclaration: ModuleDeclaration; - ModuleSpecifier: ModuleSpecifier; - Pattern: Pattern; - PrivateIdentifier: PrivateIdentifier; - Program: Program; - Property: Property; - PropertyDefinition: PropertyDefinition; - SpreadElement: SpreadElement; - Statement: Statement; - Super: Super; - SwitchCase: SwitchCase; - TemplateElement: TemplateElement; - VariableDeclarator: VariableDeclarator; -} - -export type Node = NodeMap[keyof NodeMap]; - -export interface Comment extends BaseNodeWithoutComments { - type: "Line" | "Block"; - value: string; -} - -export interface SourceLocation { - source?: string | null | undefined; - start: Position; - end: Position; -} - -export interface Position { - /** >= 1 */ - line: number; - /** >= 0 */ - column: number; -} - -export interface Program extends BaseNode { - type: "Program"; - sourceType: "script" | "module"; - body: Array; - comments?: Comment[] | undefined; -} - -export interface Directive extends BaseNode { - type: "ExpressionStatement"; - expression: Literal; - directive: string; -} - -export interface BaseFunction extends BaseNode { - params: Pattern[]; - generator?: boolean | undefined; - async?: boolean | undefined; - // The body is either BlockStatement or Expression because arrow functions - // can have a body that's either. FunctionDeclarations and - // FunctionExpressions have only BlockStatement bodies. - body: BlockStatement | Expression; -} - -export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression; - -export type Statement = - | ExpressionStatement - | BlockStatement - | StaticBlock - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | Declaration; - -export interface BaseStatement extends BaseNode {} - -export interface EmptyStatement extends BaseStatement { - type: "EmptyStatement"; -} - -export interface BlockStatement extends BaseStatement { - type: "BlockStatement"; - body: Statement[]; - innerComments?: Comment[] | undefined; -} - -export interface StaticBlock extends Omit { - type: "StaticBlock"; -} - -export interface ExpressionStatement extends BaseStatement { - type: "ExpressionStatement"; - expression: Expression; -} - -export interface IfStatement extends BaseStatement { - type: "IfStatement"; - test: Expression; - consequent: Statement; - alternate?: Statement | null | undefined; -} - -export interface LabeledStatement extends BaseStatement { - type: "LabeledStatement"; - label: Identifier; - body: Statement; -} - -export interface BreakStatement extends BaseStatement { - type: "BreakStatement"; - label?: Identifier | null | undefined; -} - -export interface ContinueStatement extends BaseStatement { - type: "ContinueStatement"; - label?: Identifier | null | undefined; -} - -export interface WithStatement extends BaseStatement { - type: "WithStatement"; - object: Expression; - body: Statement; -} - -export interface SwitchStatement extends BaseStatement { - type: "SwitchStatement"; - discriminant: Expression; - cases: SwitchCase[]; -} - -export interface ReturnStatement extends BaseStatement { - type: "ReturnStatement"; - argument?: Expression | null | undefined; -} - -export interface ThrowStatement extends BaseStatement { - type: "ThrowStatement"; - argument: Expression; -} - -export interface TryStatement extends BaseStatement { - type: "TryStatement"; - block: BlockStatement; - handler?: CatchClause | null | undefined; - finalizer?: BlockStatement | null | undefined; -} - -export interface WhileStatement extends BaseStatement { - type: "WhileStatement"; - test: Expression; - body: Statement; -} - -export interface DoWhileStatement extends BaseStatement { - type: "DoWhileStatement"; - body: Statement; - test: Expression; -} - -export interface ForStatement extends BaseStatement { - type: "ForStatement"; - init?: VariableDeclaration | Expression | null | undefined; - test?: Expression | null | undefined; - update?: Expression | null | undefined; - body: Statement; -} - -export interface BaseForXStatement extends BaseStatement { - left: VariableDeclaration | Pattern; - right: Expression; - body: Statement; -} - -export interface ForInStatement extends BaseForXStatement { - type: "ForInStatement"; -} - -export interface DebuggerStatement extends BaseStatement { - type: "DebuggerStatement"; -} - -export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration; - -export interface BaseDeclaration extends BaseStatement {} - -export interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration { - type: "FunctionDeclaration"; - /** It is null when a function declaration is a part of the `export default function` statement */ - id: Identifier | null; - body: BlockStatement; -} - -export interface FunctionDeclaration extends MaybeNamedFunctionDeclaration { - id: Identifier; -} - -export interface VariableDeclaration extends BaseDeclaration { - type: "VariableDeclaration"; - declarations: VariableDeclarator[]; - kind: "var" | "let" | "const"; -} - -export interface VariableDeclarator extends BaseNode { - type: "VariableDeclarator"; - id: Pattern; - init?: Expression | null | undefined; -} - -export interface ExpressionMap { - ArrayExpression: ArrayExpression; - ArrowFunctionExpression: ArrowFunctionExpression; - AssignmentExpression: AssignmentExpression; - AwaitExpression: AwaitExpression; - BinaryExpression: BinaryExpression; - CallExpression: CallExpression; - ChainExpression: ChainExpression; - ClassExpression: ClassExpression; - ConditionalExpression: ConditionalExpression; - FunctionExpression: FunctionExpression; - Identifier: Identifier; - ImportExpression: ImportExpression; - Literal: Literal; - LogicalExpression: LogicalExpression; - MemberExpression: MemberExpression; - MetaProperty: MetaProperty; - NewExpression: NewExpression; - ObjectExpression: ObjectExpression; - SequenceExpression: SequenceExpression; - TaggedTemplateExpression: TaggedTemplateExpression; - TemplateLiteral: TemplateLiteral; - ThisExpression: ThisExpression; - UnaryExpression: UnaryExpression; - UpdateExpression: UpdateExpression; - YieldExpression: YieldExpression; -} - -export type Expression = ExpressionMap[keyof ExpressionMap]; - -export interface BaseExpression extends BaseNode {} - -export type ChainElement = SimpleCallExpression | MemberExpression; - -export interface ChainExpression extends BaseExpression { - type: "ChainExpression"; - expression: ChainElement; -} - -export interface ThisExpression extends BaseExpression { - type: "ThisExpression"; -} - -export interface ArrayExpression extends BaseExpression { - type: "ArrayExpression"; - elements: Array; -} - -export interface ObjectExpression extends BaseExpression { - type: "ObjectExpression"; - properties: Array; -} - -export interface PrivateIdentifier extends BaseNode { - type: "PrivateIdentifier"; - name: string; -} - -export interface Property extends BaseNode { - type: "Property"; - key: Expression | PrivateIdentifier; - value: Expression | Pattern; // Could be an AssignmentProperty - kind: "init" | "get" | "set"; - method: boolean; - shorthand: boolean; - computed: boolean; -} - -export interface PropertyDefinition extends BaseNode { - type: "PropertyDefinition"; - key: Expression | PrivateIdentifier; - value?: Expression | null | undefined; - computed: boolean; - static: boolean; -} - -export interface FunctionExpression extends BaseFunction, BaseExpression { - id?: Identifier | null | undefined; - type: "FunctionExpression"; - body: BlockStatement; -} - -export interface SequenceExpression extends BaseExpression { - type: "SequenceExpression"; - expressions: Expression[]; -} - -export interface UnaryExpression extends BaseExpression { - type: "UnaryExpression"; - operator: UnaryOperator; - prefix: true; - argument: Expression; -} - -export interface BinaryExpression extends BaseExpression { - type: "BinaryExpression"; - operator: BinaryOperator; - left: Expression; - right: Expression; -} - -export interface AssignmentExpression extends BaseExpression { - type: "AssignmentExpression"; - operator: AssignmentOperator; - left: Pattern | MemberExpression; - right: Expression; -} - -export interface UpdateExpression extends BaseExpression { - type: "UpdateExpression"; - operator: UpdateOperator; - argument: Expression; - prefix: boolean; -} - -export interface LogicalExpression extends BaseExpression { - type: "LogicalExpression"; - operator: LogicalOperator; - left: Expression; - right: Expression; -} - -export interface ConditionalExpression extends BaseExpression { - type: "ConditionalExpression"; - test: Expression; - alternate: Expression; - consequent: Expression; -} - -export interface BaseCallExpression extends BaseExpression { - callee: Expression | Super; - arguments: Array; -} -export type CallExpression = SimpleCallExpression | NewExpression; - -export interface SimpleCallExpression extends BaseCallExpression { - type: "CallExpression"; - optional: boolean; -} - -export interface NewExpression extends BaseCallExpression { - type: "NewExpression"; -} - -export interface MemberExpression extends BaseExpression, BasePattern { - type: "MemberExpression"; - object: Expression | Super; - property: Expression | PrivateIdentifier; - computed: boolean; - optional: boolean; -} - -export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression; - -export interface BasePattern extends BaseNode {} - -export interface SwitchCase extends BaseNode { - type: "SwitchCase"; - test?: Expression | null | undefined; - consequent: Statement[]; -} - -export interface CatchClause extends BaseNode { - type: "CatchClause"; - param: Pattern | null; - body: BlockStatement; -} - -export interface Identifier extends BaseNode, BaseExpression, BasePattern { - type: "Identifier"; - name: string; -} - -export type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral; - -export interface SimpleLiteral extends BaseNode, BaseExpression { - type: "Literal"; - value: string | boolean | number | null; - raw?: string | undefined; -} - -export interface RegExpLiteral extends BaseNode, BaseExpression { - type: "Literal"; - value?: RegExp | null | undefined; - regex: { - pattern: string; - flags: string; - }; - raw?: string | undefined; -} - -export interface BigIntLiteral extends BaseNode, BaseExpression { - type: "Literal"; - value?: bigint | null | undefined; - bigint: string; - raw?: string | undefined; -} - -export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; - -export type BinaryOperator = - | "==" - | "!=" - | "===" - | "!==" - | "<" - | "<=" - | ">" - | ">=" - | "<<" - | ">>" - | ">>>" - | "+" - | "-" - | "*" - | "/" - | "%" - | "**" - | "|" - | "^" - | "&" - | "in" - | "instanceof"; - -export type LogicalOperator = "||" | "&&" | "??"; - -export type AssignmentOperator = - | "=" - | "+=" - | "-=" - | "*=" - | "/=" - | "%=" - | "**=" - | "<<=" - | ">>=" - | ">>>=" - | "|=" - | "^=" - | "&=" - | "||=" - | "&&=" - | "??="; - -export type UpdateOperator = "++" | "--"; - -export interface ForOfStatement extends BaseForXStatement { - type: "ForOfStatement"; - await: boolean; -} - -export interface Super extends BaseNode { - type: "Super"; -} - -export interface SpreadElement extends BaseNode { - type: "SpreadElement"; - argument: Expression; -} - -export interface ArrowFunctionExpression extends BaseExpression, BaseFunction { - type: "ArrowFunctionExpression"; - expression: boolean; - body: BlockStatement | Expression; -} - -export interface YieldExpression extends BaseExpression { - type: "YieldExpression"; - argument?: Expression | null | undefined; - delegate: boolean; -} - -export interface TemplateLiteral extends BaseExpression { - type: "TemplateLiteral"; - quasis: TemplateElement[]; - expressions: Expression[]; -} - -export interface TaggedTemplateExpression extends BaseExpression { - type: "TaggedTemplateExpression"; - tag: Expression; - quasi: TemplateLiteral; -} - -export interface TemplateElement extends BaseNode { - type: "TemplateElement"; - tail: boolean; - value: { - /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */ - cooked?: string | null | undefined; - raw: string; - }; -} - -export interface AssignmentProperty extends Property { - value: Pattern; - kind: "init"; - method: boolean; // false -} - -export interface ObjectPattern extends BasePattern { - type: "ObjectPattern"; - properties: Array; -} - -export interface ArrayPattern extends BasePattern { - type: "ArrayPattern"; - elements: Array; -} - -export interface RestElement extends BasePattern { - type: "RestElement"; - argument: Pattern; -} - -export interface AssignmentPattern extends BasePattern { - type: "AssignmentPattern"; - left: Pattern; - right: Expression; -} - -export type Class = ClassDeclaration | ClassExpression; -export interface BaseClass extends BaseNode { - superClass?: Expression | null | undefined; - body: ClassBody; -} - -export interface ClassBody extends BaseNode { - type: "ClassBody"; - body: Array; -} - -export interface MethodDefinition extends BaseNode { - type: "MethodDefinition"; - key: Expression | PrivateIdentifier; - value: FunctionExpression; - kind: "constructor" | "method" | "get" | "set"; - computed: boolean; - static: boolean; -} - -export interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration { - type: "ClassDeclaration"; - /** It is null when a class declaration is a part of the `export default class` statement */ - id: Identifier | null; -} - -export interface ClassDeclaration extends MaybeNamedClassDeclaration { - id: Identifier; -} - -export interface ClassExpression extends BaseClass, BaseExpression { - type: "ClassExpression"; - id?: Identifier | null | undefined; -} - -export interface MetaProperty extends BaseExpression { - type: "MetaProperty"; - meta: Identifier; - property: Identifier; -} - -export type ModuleDeclaration = - | ImportDeclaration - | ExportNamedDeclaration - | ExportDefaultDeclaration - | ExportAllDeclaration; -export interface BaseModuleDeclaration extends BaseNode {} - -export type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier; -export interface BaseModuleSpecifier extends BaseNode { - local: Identifier; -} - -export interface ImportDeclaration extends BaseModuleDeclaration { - type: "ImportDeclaration"; - specifiers: Array; - source: Literal; -} - -export interface ImportSpecifier extends BaseModuleSpecifier { - type: "ImportSpecifier"; - imported: Identifier; -} - -export interface ImportExpression extends BaseExpression { - type: "ImportExpression"; - source: Expression; -} - -export interface ImportDefaultSpecifier extends BaseModuleSpecifier { - type: "ImportDefaultSpecifier"; -} - -export interface ImportNamespaceSpecifier extends BaseModuleSpecifier { - type: "ImportNamespaceSpecifier"; -} - -export interface ExportNamedDeclaration extends BaseModuleDeclaration { - type: "ExportNamedDeclaration"; - declaration?: Declaration | null | undefined; - specifiers: ExportSpecifier[]; - source?: Literal | null | undefined; -} - -export interface ExportSpecifier extends BaseModuleSpecifier { - type: "ExportSpecifier"; - exported: Identifier; -} - -export interface ExportDefaultDeclaration extends BaseModuleDeclaration { - type: "ExportDefaultDeclaration"; - declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression; -} - -export interface ExportAllDeclaration extends BaseModuleDeclaration { - type: "ExportAllDeclaration"; - exported: Identifier | null; - source: Literal; -} - -export interface AwaitExpression extends BaseExpression { - type: "AwaitExpression"; - argument: Expression; -} diff --git a/node_modules/@types/estree/package.json b/node_modules/@types/estree/package.json deleted file mode 100644 index 2d5a998..0000000 --- a/node_modules/@types/estree/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@types/estree", - "version": "1.0.5", - "description": "TypeScript definitions for estree", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree", - "license": "MIT", - "contributors": [ - { - "name": "RReverser", - "githubUsername": "RReverser", - "url": "https://github.com/RReverser" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/estree" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "6f0eeaffe488ce594e73f8df619c677d752a279b51edbc744e4aebb20db4b3a7", - "typeScriptVersion": "4.5", - "nonNpm": true -} \ No newline at end of file diff --git a/node_modules/@types/json-schema/LICENSE b/node_modules/@types/json-schema/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/json-schema/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/json-schema/README.md b/node_modules/@types/json-schema/README.md deleted file mode 100644 index 42d55d3..0000000 --- a/node_modules/@types/json-schema/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/json-schema` - -# Summary -This package contains type definitions for json-schema (https://github.com/kriszyp/json-schema). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema. - -### Additional Details - * Last updated: Tue, 07 Nov 2023 03:09:37 GMT - * Dependencies: none - -# Credits -These definitions were written by [Boris Cherny](https://github.com/bcherny), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK). diff --git a/node_modules/@types/json-schema/index.d.ts b/node_modules/@types/json-schema/index.d.ts deleted file mode 100644 index 9381e99..0000000 --- a/node_modules/@types/json-schema/index.d.ts +++ /dev/null @@ -1,749 +0,0 @@ -// ================================================================================================== -// JSON Schema Draft 04 -// ================================================================================================== - -/** - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 - */ -export type JSONSchema4TypeName = - | "string" // - | "number" - | "integer" - | "boolean" - | "object" - | "array" - | "null" - | "any"; - -/** - * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5 - */ -export type JSONSchema4Type = - | string // - | number - | boolean - | JSONSchema4Object - | JSONSchema4Array - | null; - -// Workaround for infinite type recursion -export interface JSONSchema4Object { - [key: string]: JSONSchema4Type; -} - -// Workaround for infinite type recursion -// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 -export interface JSONSchema4Array extends Array {} - -/** - * Meta schema - * - * Recommended values: - * - 'http://json-schema.org/schema#' - * - 'http://json-schema.org/hyper-schema#' - * - 'http://json-schema.org/draft-04/schema#' - * - 'http://json-schema.org/draft-04/hyper-schema#' - * - 'http://json-schema.org/draft-03/schema#' - * - 'http://json-schema.org/draft-03/hyper-schema#' - * - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 - */ -export type JSONSchema4Version = string; - -/** - * JSON Schema V4 - * @see https://tools.ietf.org/html/draft-zyp-json-schema-04 - */ -export interface JSONSchema4 { - id?: string | undefined; - $ref?: string | undefined; - $schema?: JSONSchema4Version | undefined; - - /** - * This attribute is a string that provides a short description of the - * instance property. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21 - */ - title?: string | undefined; - - /** - * This attribute is a string that provides a full description of the of - * purpose the instance property. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22 - */ - description?: string | undefined; - - default?: JSONSchema4Type | undefined; - multipleOf?: number | undefined; - maximum?: number | undefined; - exclusiveMaximum?: boolean | undefined; - minimum?: number | undefined; - exclusiveMinimum?: boolean | undefined; - maxLength?: number | undefined; - minLength?: number | undefined; - pattern?: string | undefined; - - /** - * May only be defined when "items" is defined, and is a tuple of JSONSchemas. - * - * This provides a definition for additional items in an array instance - * when tuple definitions of the items is provided. This can be false - * to indicate additional items in the array are not allowed, or it can - * be a schema that defines the schema of the additional items. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6 - */ - additionalItems?: boolean | JSONSchema4 | undefined; - - /** - * This attribute defines the allowed items in an instance array, and - * MUST be a schema or an array of schemas. The default value is an - * empty schema which allows any value for items in the instance array. - * - * When this attribute value is a schema and the instance value is an - * array, then all the items in the array MUST be valid according to the - * schema. - * - * When this attribute value is an array of schemas and the instance - * value is an array, each position in the instance array MUST conform - * to the schema in the corresponding position for this array. This - * called tuple typing. When tuple typing is used, additional items are - * allowed, disallowed, or constrained by the "additionalItems" - * (Section 5.6) attribute using the same rules as - * "additionalProperties" (Section 5.4) for objects. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5 - */ - items?: JSONSchema4 | JSONSchema4[] | undefined; - - maxItems?: number | undefined; - minItems?: number | undefined; - uniqueItems?: boolean | undefined; - maxProperties?: number | undefined; - minProperties?: number | undefined; - - /** - * This attribute indicates if the instance must have a value, and not - * be undefined. This is false by default, making the instance - * optional. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7 - */ - required?: boolean | string[] | undefined; - - /** - * This attribute defines a schema for all properties that are not - * explicitly defined in an object type definition. If specified, the - * value MUST be a schema or a boolean. If false is provided, no - * additional properties are allowed beyond the properties defined in - * the schema. The default value is an empty schema which allows any - * value for additional properties. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4 - */ - additionalProperties?: boolean | JSONSchema4 | undefined; - - definitions?: { - [k: string]: JSONSchema4; - } | undefined; - - /** - * This attribute is an object with property definitions that define the - * valid values of instance object property values. When the instance - * value is an object, the property values of the instance object MUST - * conform to the property definitions in this object. In this object, - * each property definition's value MUST be a schema, and the property's - * name MUST be the name of the instance property that it defines. The - * instance property value MUST be valid according to the schema from - * the property definition. Properties are considered unordered, the - * order of the instance properties MAY be in any order. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2 - */ - properties?: { - [k: string]: JSONSchema4; - } | undefined; - - /** - * This attribute is an object that defines the schema for a set of - * property names of an object instance. The name of each property of - * this attribute's object is a regular expression pattern in the ECMA - * 262/Perl 5 format, while the value is a schema. If the pattern - * matches the name of a property on the instance object, the value of - * the instance's property MUST be valid against the pattern name's - * schema value. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3 - */ - patternProperties?: { - [k: string]: JSONSchema4; - } | undefined; - dependencies?: { - [k: string]: JSONSchema4 | string[]; - } | undefined; - - /** - * This provides an enumeration of all possible values that are valid - * for the instance property. This MUST be an array, and each item in - * the array represents a possible value for the instance value. If - * this attribute is defined, the instance value MUST be one of the - * values in the array in order for the schema to be valid. - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19 - */ - enum?: JSONSchema4Type[] | undefined; - - /** - * A single type, or a union of simple types - */ - type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined; - - allOf?: JSONSchema4[] | undefined; - anyOf?: JSONSchema4[] | undefined; - oneOf?: JSONSchema4[] | undefined; - not?: JSONSchema4 | undefined; - - /** - * The value of this property MUST be another schema which will provide - * a base schema which the current schema will inherit from. The - * inheritance rules are such that any instance that is valid according - * to the current schema MUST be valid according to the referenced - * schema. This MAY also be an array, in which case, the instance MUST - * be valid for all the schemas in the array. A schema that extends - * another schema MAY define additional attributes, constrain existing - * attributes, or add other constraints. - * - * Conceptually, the behavior of extends can be seen as validating an - * instance against all constraints in the extending schema as well as - * the extended schema(s). - * - * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26 - */ - extends?: string | string[] | undefined; - - /** - * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6 - */ - [k: string]: any; - - format?: string | undefined; -} - -// ================================================================================================== -// JSON Schema Draft 06 -// ================================================================================================== - -export type JSONSchema6TypeName = - | "string" // - | "number" - | "integer" - | "boolean" - | "object" - | "array" - | "null" - | "any"; - -export type JSONSchema6Type = - | string // - | number - | boolean - | JSONSchema6Object - | JSONSchema6Array - | null; - -// Workaround for infinite type recursion -export interface JSONSchema6Object { - [key: string]: JSONSchema6Type; -} - -// Workaround for infinite type recursion -// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 -export interface JSONSchema6Array extends Array {} - -/** - * Meta schema - * - * Recommended values: - * - 'http://json-schema.org/schema#' - * - 'http://json-schema.org/hyper-schema#' - * - 'http://json-schema.org/draft-06/schema#' - * - 'http://json-schema.org/draft-06/hyper-schema#' - * - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 - */ -export type JSONSchema6Version = string; - -/** - * JSON Schema V6 - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01 - */ -export type JSONSchema6Definition = JSONSchema6 | boolean; -export interface JSONSchema6 { - $id?: string | undefined; - $ref?: string | undefined; - $schema?: JSONSchema6Version | undefined; - - /** - * Must be strictly greater than 0. - * A numeric instance is valid only if division by this keyword's value results in an integer. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1 - */ - multipleOf?: number | undefined; - - /** - * Representing an inclusive upper limit for a numeric instance. - * This keyword validates only if the instance is less than or exactly equal to "maximum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2 - */ - maximum?: number | undefined; - - /** - * Representing an exclusive upper limit for a numeric instance. - * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3 - */ - exclusiveMaximum?: number | undefined; - - /** - * Representing an inclusive lower limit for a numeric instance. - * This keyword validates only if the instance is greater than or exactly equal to "minimum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4 - */ - minimum?: number | undefined; - - /** - * Representing an exclusive lower limit for a numeric instance. - * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum". - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5 - */ - exclusiveMinimum?: number | undefined; - - /** - * Must be a non-negative integer. - * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6 - */ - maxLength?: number | undefined; - - /** - * Must be a non-negative integer. - * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. - * Omitting this keyword has the same behavior as a value of 0. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7 - */ - minLength?: number | undefined; - - /** - * Should be a valid regular expression, according to the ECMA 262 regular expression dialect. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8 - */ - pattern?: string | undefined; - - /** - * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. - * Omitting this keyword has the same behavior as an empty schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9 - */ - items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined; - - /** - * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. - * If "items" is an array of schemas, validation succeeds if every instance element - * at a position greater than the size of "items" validates against "additionalItems". - * Otherwise, "additionalItems" MUST be ignored, as the "items" schema - * (possibly the default value of an empty schema) is applied to all elements. - * Omitting this keyword has the same behavior as an empty schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10 - */ - additionalItems?: JSONSchema6Definition | undefined; - - /** - * Must be a non-negative integer. - * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11 - */ - maxItems?: number | undefined; - - /** - * Must be a non-negative integer. - * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword. - * Omitting this keyword has the same behavior as a value of 0. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12 - */ - minItems?: number | undefined; - - /** - * If this keyword has boolean value false, the instance validates successfully. - * If it has boolean value true, the instance validates successfully if all of its elements are unique. - * Omitting this keyword has the same behavior as a value of false. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13 - */ - uniqueItems?: boolean | undefined; - - /** - * An array instance is valid against "contains" if at least one of its elements is valid against the given schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14 - */ - contains?: JSONSchema6Definition | undefined; - - /** - * Must be a non-negative integer. - * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15 - */ - maxProperties?: number | undefined; - - /** - * Must be a non-negative integer. - * An object instance is valid against "maxProperties" if its number of properties is greater than, - * or equal to, the value of this keyword. - * Omitting this keyword has the same behavior as a value of 0. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16 - */ - minProperties?: number | undefined; - - /** - * Elements of this array must be unique. - * An object instance is valid against this keyword if every item in the array is the name of a property in the instance. - * Omitting this keyword has the same behavior as an empty array. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17 - */ - required?: string[] | undefined; - - /** - * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. - * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, - * the child instance for that name successfully validates against the corresponding schema. - * Omitting this keyword has the same behavior as an empty object. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18 - */ - properties?: { - [k: string]: JSONSchema6Definition; - } | undefined; - - /** - * This attribute is an object that defines the schema for a set of property names of an object instance. - * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema. - * If the pattern matches the name of a property on the instance object, the value of the instance's property - * MUST be valid against the pattern name's schema value. - * Omitting this keyword has the same behavior as an empty object. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19 - */ - patternProperties?: { - [k: string]: JSONSchema6Definition; - } | undefined; - - /** - * This attribute defines a schema for all properties that are not explicitly defined in an object type definition. - * If specified, the value MUST be a schema or a boolean. - * If false is provided, no additional properties are allowed beyond the properties defined in the schema. - * The default value is an empty schema which allows any value for additional properties. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20 - */ - additionalProperties?: JSONSchema6Definition | undefined; - - /** - * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. - * Each property specifies a dependency. - * If the dependency value is an array, each element in the array must be unique. - * Omitting this keyword has the same behavior as an empty object. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21 - */ - dependencies?: { - [k: string]: JSONSchema6Definition | string[]; - } | undefined; - - /** - * Takes a schema which validates the names of all properties rather than their values. - * Note the property name that the schema is testing will always be a string. - * Omitting this keyword has the same behavior as an empty schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22 - */ - propertyNames?: JSONSchema6Definition | undefined; - - /** - * This provides an enumeration of all possible values that are valid - * for the instance property. This MUST be an array, and each item in - * the array represents a possible value for the instance value. If - * this attribute is defined, the instance value MUST be one of the - * values in the array in order for the schema to be valid. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23 - */ - enum?: JSONSchema6Type[] | undefined; - - /** - * More readable form of a one-element "enum" - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24 - */ - const?: JSONSchema6Type | undefined; - - /** - * A single type, or a union of simple types - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25 - */ - type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined; - - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26 - */ - allOf?: JSONSchema6Definition[] | undefined; - - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27 - */ - anyOf?: JSONSchema6Definition[] | undefined; - - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28 - */ - oneOf?: JSONSchema6Definition[] | undefined; - - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29 - */ - not?: JSONSchema6Definition | undefined; - - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1 - */ - definitions?: { - [k: string]: JSONSchema6Definition; - } | undefined; - - /** - * This attribute is a string that provides a short description of the instance property. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 - */ - title?: string | undefined; - - /** - * This attribute is a string that provides a full description of the of purpose the instance property. - * - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 - */ - description?: string | undefined; - - /** - * This keyword can be used to supply a default JSON value associated with a particular schema. - * It is RECOMMENDED that a default value be valid against the associated schema. - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3 - */ - default?: JSONSchema6Type | undefined; - - /** - * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4 - */ - examples?: JSONSchema6Type[] | undefined; - - /** - * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8 - */ - format?: string | undefined; -} - -// ================================================================================================== -// JSON Schema Draft 07 -// ================================================================================================== -// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 -// -------------------------------------------------------------------------------------------------- - -/** - * Primitive type - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 - */ -export type JSONSchema7TypeName = - | "string" // - | "number" - | "integer" - | "boolean" - | "object" - | "array" - | "null"; - -/** - * Primitive type - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 - */ -export type JSONSchema7Type = - | string // - | number - | boolean - | JSONSchema7Object - | JSONSchema7Array - | null; - -// Workaround for infinite type recursion -export interface JSONSchema7Object { - [key: string]: JSONSchema7Type; -} - -// Workaround for infinite type recursion -// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 -export interface JSONSchema7Array extends Array {} - -/** - * Meta schema - * - * Recommended values: - * - 'http://json-schema.org/schema#' - * - 'http://json-schema.org/hyper-schema#' - * - 'http://json-schema.org/draft-07/schema#' - * - 'http://json-schema.org/draft-07/hyper-schema#' - * - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 - */ -export type JSONSchema7Version = string; - -/** - * JSON Schema v7 - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 - */ -export type JSONSchema7Definition = JSONSchema7 | boolean; -export interface JSONSchema7 { - $id?: string | undefined; - $ref?: string | undefined; - $schema?: JSONSchema7Version | undefined; - $comment?: string | undefined; - - /** - * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4 - * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A - */ - $defs?: { - [key: string]: JSONSchema7Definition; - } | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 - */ - type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined; - enum?: JSONSchema7Type[] | undefined; - const?: JSONSchema7Type | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 - */ - multipleOf?: number | undefined; - maximum?: number | undefined; - exclusiveMaximum?: number | undefined; - minimum?: number | undefined; - exclusiveMinimum?: number | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 - */ - maxLength?: number | undefined; - minLength?: number | undefined; - pattern?: string | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 - */ - items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined; - additionalItems?: JSONSchema7Definition | undefined; - maxItems?: number | undefined; - minItems?: number | undefined; - uniqueItems?: boolean | undefined; - contains?: JSONSchema7Definition | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 - */ - maxProperties?: number | undefined; - minProperties?: number | undefined; - required?: string[] | undefined; - properties?: { - [key: string]: JSONSchema7Definition; - } | undefined; - patternProperties?: { - [key: string]: JSONSchema7Definition; - } | undefined; - additionalProperties?: JSONSchema7Definition | undefined; - dependencies?: { - [key: string]: JSONSchema7Definition | string[]; - } | undefined; - propertyNames?: JSONSchema7Definition | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 - */ - if?: JSONSchema7Definition | undefined; - then?: JSONSchema7Definition | undefined; - else?: JSONSchema7Definition | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 - */ - allOf?: JSONSchema7Definition[] | undefined; - anyOf?: JSONSchema7Definition[] | undefined; - oneOf?: JSONSchema7Definition[] | undefined; - not?: JSONSchema7Definition | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 - */ - format?: string | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 - */ - contentMediaType?: string | undefined; - contentEncoding?: string | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9 - */ - definitions?: { - [key: string]: JSONSchema7Definition; - } | undefined; - - /** - * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 - */ - title?: string | undefined; - description?: string | undefined; - default?: JSONSchema7Type | undefined; - readOnly?: boolean | undefined; - writeOnly?: boolean | undefined; - examples?: JSONSchema7Type | undefined; -} - -export interface ValidationResult { - valid: boolean; - errors: ValidationError[]; -} - -export interface ValidationError { - property: string; - message: string; -} - -/** - * To use the validator call JSONSchema.validate with an instance object and an optional schema object. - * If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), - * that schema will be used to validate and the schema parameter is not necessary (if both exist, - * both validations will occur). - */ -export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult; - -/** - * The checkPropertyChange method will check to see if an value can legally be in property with the given schema - * This is slightly different than the validate method in that it will fail if the schema is readonly and it will - * not check for self-validation, it is assumed that the passed in value is already internally valid. - */ -export function checkPropertyChange( - value: any, - schema: JSONSchema4 | JSONSchema6 | JSONSchema7, - property: string, -): ValidationResult; - -/** - * This checks to ensure that the result is valid and will throw an appropriate error message if it is not. - */ -export function mustBeValid(result: ValidationResult): void; diff --git a/node_modules/@types/json-schema/package.json b/node_modules/@types/json-schema/package.json deleted file mode 100644 index 3c41bd7..0000000 --- a/node_modules/@types/json-schema/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@types/json-schema", - "version": "7.0.15", - "description": "TypeScript definitions for json-schema", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema", - "license": "MIT", - "contributors": [ - { - "name": "Boris Cherny", - "githubUsername": "bcherny", - "url": "https://github.com/bcherny" - }, - { - "name": "Lucian Buzzo", - "githubUsername": "lucianbuzzo", - "url": "https://github.com/lucianbuzzo" - }, - { - "name": "Roland Groza", - "githubUsername": "rolandjitsu", - "url": "https://github.com/rolandjitsu" - }, - { - "name": "Jason Kwok", - "githubUsername": "JasonHK", - "url": "https://github.com/JasonHK" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/json-schema" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "79984fd70cd25c3f7d72b84368778c763c89728ea0073832d745d4691b705257", - "typeScriptVersion": "4.5" -} \ No newline at end of file diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md deleted file mode 100644 index 30ff285..0000000 --- a/node_modules/@types/node/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Thu, 01 Feb 2024 17:35:23 GMT - * Dependencies: [undici-types](https://npmjs.com/package/undici-types) - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts deleted file mode 100644 index cd82143..0000000 --- a/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,996 +0,0 @@ -/** - * The `node:assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) - */ -declare module "assert" { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - /** - * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. - */ - actual: unknown; - /** - * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. - */ - expected: unknown; - /** - * Set to the passed in operator value. - */ - operator: string; - /** - * Indicates if the message was auto-generated (`true`) or not. - */ - generatedMessage: boolean; - /** - * Value is always `ERR_ASSERTION` to show that the error is an assertion error. - */ - code: "ERR_ASSERTION"; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn - * @return An Array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An Array of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. - * If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function, - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'node:assert'; - * - * const obj1 = { - * a: { - * b: 1, - * }, - * }; - * const obj2 = { - * a: { - * b: 2, - * }, - * }; - * const obj3 = { - * a: { - * b: 1, - * }, - * }; - * const obj4 = { __proto__: obj1 }; - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'node:assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text', - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text', - * }, - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * }, - * ); - * - * // Using regular expressions to validate error properties: - * assert.throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text', - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i, - * }, - * ); - * - * // Fails due to the different `message` and `name` properties: - * assert.throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err, - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error, - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/, - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error', - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'node:assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops', - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error, - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject( - block: (() => Promise) | Promise, - message?: string | Error, - ): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: - & Omit< - typeof assert, - | "equal" - | "notEqual" - | "deepEqual" - | "notDeepEqual" - | "ok" - | "strictEqual" - | "deepStrictEqual" - | "ifError" - | "strict" - > - & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module "node:assert" { - import assert = require("assert"); - export = assert; -} diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts deleted file mode 100644 index f333913..0000000 --- a/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "assert/strict" { - import { strict } from "node:assert"; - export = strict; -} -declare module "node:assert/strict" { - import { strict } from "node:assert"; - export = strict; -} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts deleted file mode 100644 index 0667a61..0000000 --- a/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * We strongly discourage the use of the `async_hooks` API. - * Other APIs that can cover most of its use cases include: - * - * * `AsyncLocalStorage` tracks async context - * * `process.getActiveResourcesInfo()` tracks active resources - * - * The `node:async_hooks` module provides an API to track asynchronous resources. - * It can be accessed using: - * - * ```js - * import async_hooks from 'node:async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js) - */ -declare module "async_hooks" { - /** - * ```js - * import { executionAsyncId } from 'node:async_hooks'; - * import fs from 'node:fs'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * const path = '.'; - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'node:fs'; - * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'node:http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook, - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * }, - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in before is completed. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'node:async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { }, - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg, - ): Func; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>(fn: Func): Func; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope( - fn: (this: This, ...args: any[]) => Result, - thisArg?: This, - ...args: any[] - ): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory - * safe implementation that involves significant optimizations that are non-obvious - * to implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'node:http'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Binds the given function to the current execution context. - * @since v19.8.0 - * @experimental - * @param fn The function to bind to the current execution context. - * @return A new function that calls `fn` within the captured execution context. - */ - static bind any>(fn: Func): Func; - /** - * Captures the current execution context and returns a function that accepts a - * function as an argument. Whenever the returned function is called, it - * calls the function passed to it within the captured context. - * - * ```js - * const asyncLocalStorage = new AsyncLocalStorage(); - * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); - * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); - * console.log(result); // returns 123 - * ``` - * - * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple - * async context tracking purposes, for example: - * - * ```js - * class Foo { - * #runInAsyncScope = AsyncLocalStorage.snapshot(); - * - * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } - * } - * - * const foo = asyncLocalStorage.run(123, () => new Foo()); - * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 - * ``` - * @since v19.8.0 - * @experimental - * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. - */ - static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: () => R): R; - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module "node:async_hooks" { - export * from "async_hooks"; -} diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts deleted file mode 100644 index 2fa2e74..0000000 --- a/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,2362 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js) - */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * This function returns `true` if `input` contains only valid UTF-8-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.4.0, v18.14.0 - * @param input The input to validate. - */ - export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - /** - * This function returns `true` if `input` contains only valid ASCII-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.6.0, v18.15.0 - * @param input The input to validate. - */ - export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "latin1" - | "binary"; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'node:buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new(size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export interface FileOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be - * converted to the platform native line-ending as specified by `require('node:os').EOL`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - import { Blob as NodeBlob } from "buffer"; - // This conditional type will be the existing global Blob in a browser, or - // the copy below in a Node environment. - type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob; - global { - namespace NodeJS { - export { BufferEncoding }; - } - // Buffer class - type BufferEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex"; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: readonly any[]): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new(buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`\-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from( - arrayBuffer: WithImplicitCoercion, - byteOffset?: number, - length?: number, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | readonly number[]): Buffer; - from(data: WithImplicitCoercion): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: "string"): string; - }, - encoding?: BufferEncoding, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength( - string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, - encoding?: BufferEncoding, - ): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: readonly Uint8Array[], totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=': 0'] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than`Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: "Buffer"; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare( - target: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number, - ): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * - * // Fill a buffer with empty string - * const c = Buffer.allocUnsafe(5).fill(''); - * - * console.log(c.fill('')); - * // Prints: - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends __Blob {} - /** - * `Blob` class is a global reference for `require('node:buffer').Blob` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { - onmessage: any; - Blob: infer T; - } ? T - : typeof NodeBlob; - } -} -declare module "node:buffer" { - export * from "buffer"; -} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts deleted file mode 100644 index a97532b..0000000 --- a/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1540 +0,0 @@ -/** - * The `node:child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('node:child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `node:child_process` module provides a handful of - * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js) - */ -declare module "child_process" { - import { ObjectEncodingOptions } from "node:fs"; - import { Abortable, EventEmitter } from "node:events"; - import * as net from "node:net"; - import { Pipe, Readable, Stream, Writable } from "node:stream"; - import { URL } from "node:url"; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('node:assert'); - * const fs = require('node:fs'); - * const child_process = require('node:child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ], - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined, // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('node:child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('node:child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'], - * }, - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * Calls {@link ChildProcess.kill} with `'SIGTERM'`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('node:child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('node:child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('node:net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only - * supported on Unix platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('node:child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('node:net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send( - message: Serializable, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio - extends ChildProcess - { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; - type StdioOptions = IOType | Array; - type SerializationType = "json" | "advanced"; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default false - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = "inherit" | "ignore" | Stream; - type StdioPipeNamed = "pipe" | "overlapped"; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env, - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('node:child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('node:child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('node:child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve - * it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn( - command: string, - args?: readonly string[], - options?: SpawnOptionsWithoutStdio, - ): ChildProcessWithoutNullStreams; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('node:child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('node:child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('node:util'); - * const exec = util.promisify(require('node:child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec( - command: string, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: "buffer" | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = - & Omit - & Omit - & { code?: string | number | undefined | null }; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('node:child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('node:util'); - * const execFile = util.promisify(require('node:child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - function execFile(file: string, args?: readonly string[] | null): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile( - file: string, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile( - file: string, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile( - file: string, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: readonly string[], options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: "buffer" | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithStringEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithBufferEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args?: readonly string[], - options?: SpawnSyncOptions, - ): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - /** - * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: "buffer" | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: "buffer" | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: readonly string[]): Buffer; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithStringEncoding, - ): string; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithBufferEncoding, - ): Buffer; - function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer; -} -declare module "node:child_process" { - export * from "child_process"; -} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts deleted file mode 100644 index 39cd56a..0000000 --- a/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,432 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process - * isolation is not needed, use the `worker_threads` module instead, which - * allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js) - */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - serialization?: SerializationType | undefined; - cwd?: string | undefined; - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker, this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('node:net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener( - event: "message", - listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; -} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts deleted file mode 100644 index bcc3450..0000000 --- a/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** - * The `node:console` module provides a simple debugging console that is similar to - * the JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js) - */ -declare module "console" { - import console = require("node:console"); - export = console; -} -declare module "node:console" { - import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: readonly string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | "auto" | undefined; - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts deleted file mode 100644 index c3ac2b8..0000000 --- a/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module "constants" { - import { constants as osConstants, SignalConstants } from "node:os"; - import { constants as cryptoConstants } from "node:crypto"; - import { constants as fsConstants } from "node:fs"; - - const exp: - & typeof osConstants.errno - & typeof osConstants.priority - & SignalConstants - & typeof cryptoConstants - & typeof fsConstants; - export = exp; -} - -declare module "node:constants" { - import constants = require("constants"); - export = constants; -} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts deleted file mode 100644 index 718697b..0000000 --- a/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,4487 +0,0 @@ -/** - * The `node:crypto` module provides cryptographic functionality that includes a - * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify - * functions. - * - * ```js - * const { createHmac } = await import('node:crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js) - */ -declare module "crypto" { - import * as stream from "node:stream"; - import { PeerCertificate } from "node:tls"; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of HTML5's `keygen` element. - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'node:buffer'; - * const { Certificate } = await import('node:crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ - const SSL_OP_ALLOW_NO_DHE_KEX: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - /** Instructs OpenSSL to disable encrypt-then-MAC. */ - const SSL_OP_NO_ENCRYPT_THEN_MAC: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to disable renegotiation. */ - const SSL_OP_NO_RENEGOTIATION: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - /** Instructs OpenSSL to turn off SSL v2 */ - const SSL_OP_NO_SSLv2: number; - /** Instructs OpenSSL to turn off SSL v3 */ - const SSL_OP_NO_SSLv3: number; - /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ - const SSL_OP_NO_TICKET: number; - /** Instructs OpenSSL to turn off TLS v1 */ - const SSL_OP_NO_TLSv1: number; - /** Instructs OpenSSL to turn off TLS v1.1 */ - const SSL_OP_NO_TLSv1_1: number; - /** Instructs OpenSSL to turn off TLS v1.2 */ - const SSL_OP_NO_TLSv1_2: number; - /** Instructs OpenSSL to turn off TLS v1.3 */ - const SSL_OP_NO_TLSv1_3: number; - /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ - const SSL_OP_PRIORITIZE_CHACHA: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHash, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was - * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not - * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; - type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; - type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { createHash } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: HashOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: "jwk"; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { KeyObject } = await import('node:crypto'); - * const { subtle } = globalThis.crypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256, - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<"pem">): string | Buffer; - export(options?: KeyExportOptions<"der">): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * Returns `true` or `false` depending on whether the keys have exactly the same - * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). - * @since v17.7.0, v16.15.0 - * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. - */ - equals(otherKeyObject: KeyObject): boolean; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305"; - type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; - type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): CipherCCM; - function createCipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): CipherOCB; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): CipherGCM; - function createCipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * - * import { - * pipeline, - * } from 'node:stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): DecipherOCB; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * let chunk; - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; - passphrase?: string | Buffer | undefined; - encoding?: string | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; - encoding?: string | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey, - * } = await import('node:crypto'); - * - * generateKey('hmac', { length: 512 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: "hmac" | "aes", - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void, - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync, - * } = await import('node:crypto'); - * - * const key = generateKeySync('hmac', { length: 512 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: "hmac" | "aes", - options: { - length: number; - }, - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: "jwk"; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = "der" | "ieee-p1363"; - interface SigningOptions { - /** - * @see crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1', - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign( - privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - outputFormat: BinaryToTextEncoding, - ): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: string, - signature_format?: BinaryToTextEncoding, - ): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createDiffieHellman, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values unless they have been - * generated or computed already, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, - * once a private key has been generated or set, calling this function only updates - * the public key but does not generate a new private key. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding: null, - outputEncoding: BinaryToTextEncoding, - ): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * - * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be - * used to manually provide the public key or to automatically derive it. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `node:constants` module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are listed in the documentation for `DiffieHellmanGroup`. - * - * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman, - * } = await import('node:crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2, - * } = await import('node:crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync, - * } = await import('node:crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - ): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2**48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill( - buffer: T, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - size: number, - callback: (err: Error | null, buf: T) => void, - ): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt, - * } = await import('node:crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync, - * } = await import('node:crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers, - * } = await import('node:crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves, - * } = await import('node:crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. - * Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes, - * } = await import('node:crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createECDH, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH, - * } = await import('node:crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: "latin1" | "hex" | "base64" | "base64url", - format?: "uncompressed" | "compressed" | "hybrid", - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time - * algorithm. - * - * This function does not leak timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point** - * **numbers `x` and `y` are equal.** - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - /** - * Must be `'named'` or `'explicit'`. Default: `'named'`. - */ - paramEncoding?: "explicit" | "named" | undefined; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync, - * } = await import('node:crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair, - * } = await import('node:crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - ): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void, - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void, - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdf, - * } = await import('node:crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf( - digest: string, - irm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: ArrayBuffer) => void, - ): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdfSync, - * } = await import('node:crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync( - digest: string, - ikm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - ): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - type UUID = `${string}-${string}-${string}-${string}-${string}`; - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): UUID; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject?: "always" | "default" | "never"; - /** - * @default true - */ - wildcards?: boolean; - /** - * @default true - */ - partialWildcards?: boolean; - /** - * @default false - */ - multiLabelWildcards?: boolean; - /** - * @default false - */ - singleLabelSubdomains?: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('node:crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * - * Because computing the SHA-256 fingerprint is usually faster and because it is - * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be - * a better choice. While SHA-512 presumably provides a higher level of security in - * general, the security of SHA-256 matches that of most algorithms that are - * commonly used to sign certificates. - * @since v17.2.0, v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * - * This is a comma-separated list of subject alternative names. Each entry begins - * with a string identifying the kind of the subject alternative name followed by - * a colon and the value associated with the entry. - * - * Earlier versions of Node.js incorrectly assumed that it is safe to split this - * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, - * both malicious and legitimate certificates can contain subject alternative names - * that include this sequence when represented as a string. - * - * After the prefix denoting the type of the entry, the remainder of each entry - * might be enclosed in quotes to indicate that the value is a JSON string literal. - * For backward compatibility, Node.js only uses JSON string literals within this - * property when necessary to avoid ambiguity. Third-party code should be prepared - * to handle both possible entry formats. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * A textual representation of the certificate's authority information access - * extension. - * - * This is a line feed separated list of access descriptions. Each line begins with - * the access method and the kind of the access location, followed by a colon and - * the value associated with the access location. - * - * After the prefix denoting the access method and the kind of the access location, - * the remainder of each line might be enclosed in quotes to indicate that the - * value is a JSON string literal. For backward compatibility, Node.js only uses - * JSON string literals within this property when necessary to avoid ambiguity. - * Third-party code should be prepared to handle both possible entry formats. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsBigInt, - callback: (err: Error | null, prime: bigint) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsArrayBuffer, - callback: (err: Error | null, prime: ArrayBuffer) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptions, - callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, - ): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime( - value: LargeNumberLike, - options: CheckPrimeOptions, - callback: (err: Error | null, result: boolean) => void, - ): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`): - * - * * `crypto.constants.ENGINE_METHOD_RSA` - * * `crypto.constants.ENGINE_METHOD_DSA` - * * `crypto.constants.ENGINE_METHOD_DH` - * * `crypto.constants.ENGINE_METHOD_RAND` - * * `crypto.constants.ENGINE_METHOD_EC` - * * `crypto.constants.ENGINE_METHOD_CIPHERS` - * * `crypto.constants.ENGINE_METHOD_DIGESTS` - * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * * `crypto.constants.ENGINE_METHOD_ALL` - * * `crypto.constants.ENGINE_METHOD_NONE` - * @since v0.11.11 - * @param flags - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for {@link webcrypto.getRandomValues}. This - * implementation is not compliant with the Web Crypto spec, to write - * web-compatible code use {@link webcrypto.getRandomValues} instead. - * @since v17.4.0 - * @return Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; - type KeyType = "private" | "public" | "secret"; - type KeyUsage = - | "decrypt" - | "deriveBits" - | "deriveKey" - | "encrypt" - | "sign" - | "unwrapKey" - | "verify" - | "wrapKey"; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): UUID; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: "CryptoKey"; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits( - algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: - | AlgorithmIdentifier - | AesDerivedKeyParams - | HmacImportParams - | HkdfParams - | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: "jwk", key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey( - algorithm: RsaHashedKeyGenParams | EcKeyGenParams, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AlgorithmIdentifier, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: "jwk", - keyData: JsonWebKey, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - signature: BufferSource, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey( - format: KeyFormat, - key: CryptoKey, - wrappingKey: CryptoKey, - wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - ): Promise; - } - } - - global { - var crypto: typeof globalThis extends { - crypto: infer T; - onmessage: any; - } ? T - : webcrypto.Crypto; - } -} -declare module "node:crypto" { - export * from "crypto"; -} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts deleted file mode 100644 index 0b86ae7..0000000 --- a/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,596 +0,0 @@ -/** - * The `node:dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js) - */ -declare module "dgram" { - import { AddressInfo } from "node:net"; - import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; - interface RemoteInfo { - address: string; - family: "IPv4" | "IPv6"; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = "udp4" | "udp6"; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: - | (( - hostname: string, - options: dns.LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ) => void) - | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'node:cluster'; - * import dgram from 'node:dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of bytes queued for sending. - */ - getSendQueueSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of send requests currently in the queue awaiting to be processed. - */ - getSendQueueCount(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send( - msg: string | Uint8Array | readonly any[], - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no additional effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - /** - * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } -} -declare module "node:dgram" { - export * from "dgram"; -} diff --git a/node_modules/@types/node/diagnostics_channel.d.ts b/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100644 index cd4bd71..0000000 --- a/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,545 +0,0 @@ -/** - * The `node:diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) - */ -declare module "diagnostics_channel" { - import { AsyncLocalStorage } from "node:async_hooks"; - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string | symbol): boolean; - /** - * This is the primary entry-point for anyone wanting to publish to a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string | symbol): Channel; - type ChannelListener = (message: unknown, name: string | symbol) => void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * diagnostics_channel.subscribe('my-channel', (message, name) => { - * // Received data - * }); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The handler to receive channel messages - */ - function subscribe(name: string | symbol, onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with {@link subscribe}. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * function onMessage(message, name) { - * // Received data - * } - * - * diagnostics_channel.subscribe('my-channel', onMessage); - * - * diagnostics_channel.unsubscribe('my-channel', onMessage); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; - /** - * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing - * channels will be created in the form of `tracing:${name}:${eventType}` where`eventType` corresponds to the types of `TracingChannel Channels`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); - * - * // or... - * - * const channelsByCollection = diagnostics_channel.tracingChannel({ - * start: diagnostics_channel.channel('tracing:my-channel:start'), - * end: diagnostics_channel.channel('tracing:my-channel:end'), - * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), - * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), - * error: diagnostics_channel.channel('tracing:my-channel:error'), - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` - * @return Collection of channels to trace with - */ - function tracingChannel< - StoreType = unknown, - ContextType extends object = StoreType extends object ? StoreType : object, - >( - nameOrChannels: string | TracingChannelCollection, - ): TracingChannel; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is used to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string | symbol; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string | symbol); - /** - * Publish a message to any subscribers to the channel. This will trigger - * message handlers synchronously so they will execute within the same context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message', - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - /** - * When `channel.runStores(context, ...)` is called, the given context data - * will be applied to any store bound to the channel. If the store has already been - * bound the previous `transform` function will be replaced with the new one. - * The `transform` function may be omitted to set the given context data as the - * context directly. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (data) => { - * return { data }; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to which to bind the context data - * @param transform Transform context data before setting the store context - */ - bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; - /** - * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store); - * channel.unbindStore(store); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to unbind from the channel. - * @return `true` if the store was found, `false` otherwise. - */ - unbindStore(store: any): void; - /** - * Applies the given data to any AsyncLocalStorage instances bound to the channel - * for the duration of the given function, then publishes to the channel within - * the scope of that data is applied to the stores. - * - * If a transform function was given to `channel.bindStore(store)` it will be - * applied to transform the message data before it becomes the context value for - * the store. The prior storage context is accessible from within the transform - * function in cases where context linking is required. - * - * The context applied to the store should be accessible in any async code which - * continues from execution which began during the given function, however - * there are some situations in which `context loss` may occur. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (message) => { - * const parent = store.getStore(); - * return new Span(message, parent); - * }); - * channel.runStores({ some: 'message' }, () => { - * store.getStore(); // Span({ some: 'message' }) - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param context Message to send to subscribers and bind to stores - * @param fn Handler to run within the entered storage context - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runStores(): void; - } - interface TracingChannelSubscribers { - start: (message: ContextType) => void; - end: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncStart: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncEnd: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - error: ( - message: ContextType & { - error: unknown; - }, - ) => void; - } - interface TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - } - /** - * The class `TracingChannel` is a collection of `TracingChannel Channels` which - * together express a single traceable action. It is used to formalize and - * simplify the process of producing events for tracing application flow.{@link tracingChannel} is used to construct a`TracingChannel`. As with `Channel` it is recommended to create and reuse a - * single `TracingChannel` at the top-level of the file rather than creating them - * dynamically. - * @since v19.9.0 - * @experimental - */ - class TracingChannel implements TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - /** - * Helper to subscribe a collection of functions to the corresponding channels. - * This is the same as calling `channel.subscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.subscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - */ - subscribe(subscribers: TracingChannelSubscribers): void; - /** - * Helper to unsubscribe a collection of functions from the corresponding channels. - * This is the same as calling `channel.unsubscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.unsubscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. - */ - unsubscribe(subscribers: TracingChannelSubscribers): void; - /** - * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. - * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceSync(() => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Function to wrap a trace around - * @param context Shared object to correlate events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceSync( - fn: (this: ThisArg, ...args: Args) => any, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also - * produce an `error event` if the given function throws an error or the - * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.tracePromise(async () => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Promise-returning function to wrap a trace around - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return Chained from promise returned by the given function - */ - tracePromise( - fn: (this: ThisArg, ...args: Args) => Promise, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or - * the returned - * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * The `position` will be -1 by default to indicate the final argument should - * be used as the callback. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceCallback((arg1, callback) => { - * // Do something - * callback(null, 'result'); - * }, 1, { - * some: 'thing', - * }, thisArg, arg1, callback); - * ``` - * - * The callback will also be run with `channel.runStores(context, ...)` which - * enables context loss recovery in some cases. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * const myStore = new AsyncLocalStorage(); - * - * // The start channel sets the initial store data to something - * // and stores that store data value on the trace context object - * channels.start.bindStore(myStore, (data) => { - * const span = new Span(data); - * data.span = span; - * return span; - * }); - * - * // Then asyncStart can restore from that data it stored previously - * channels.asyncStart.bindStore(myStore, (data) => { - * return data.span; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn callback using function to wrap a trace around - * @param position Zero-indexed argument position of expected callback - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceCallback any>( - fn: Fn, - position: number | undefined, - context: ContextType | undefined, - thisArg: any, - ...args: Parameters - ): void; - } -} -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; -} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts deleted file mode 100644 index 380cf7d..0000000 --- a/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,809 +0,0 @@ -/** - * The `node:dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('node:dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `node:dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('node:dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) - */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - /** - * @default true - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then - * IPv4 and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('node:dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup( - hostname: string, - family: number, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, - ): void; - export function lookup( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('node:dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService( - address: string, - port: number, - callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, - ): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: "A"; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - export interface CaaRecord { - critical: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: "MX"; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - export interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - export interface AnyNsRecord { - type: "NS"; - value: string; - } - export interface AnyPtrRecord { - type: "PTR"; - value: string; - } - export interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - export type AnyRecord = - | AnyARecord - | AnyAaaaRecord - | AnyCnameRecord - | AnyMxRecord - | AnyNaptrRecord - | AnyNsRecord - | AnyPtrRecord - | AnySoaRecord - | AnySrvRecord - | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "A", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "AAAA", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "ANY", - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "CNAME", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "MX", - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NAPTR", - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NS", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "PTR", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SOA", - callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SRV", - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "TXT", - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: string, - callback: ( - err: NodeJS.ErrnoException | null, - addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[], - ) => void, - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__( - hostname: string, - rrtype: string, - ): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, - ): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, - ): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse( - ip: string, - callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, - ): void; - /** - * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - export function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: readonly string[]): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default - * dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('node:dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `node:dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module "node:dns" { - export * from "dns"; -} diff --git a/node_modules/@types/node/dns/promises.d.ts b/node_modules/@types/node/dns/promises.d.ts deleted file mode 100644 index ef9b222..0000000 --- a/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,425 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('node:dns').promises` or `require('node:dns/promises')`. - * @since v10.6.0 - */ -declare module "dns/promises" { - import { - AnyRecord, - CaaRecord, - LookupAddress, - LookupAllOptions, - LookupOneOptions, - LookupOptions, - MxRecord, - NaptrRecord, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - ResolveWithTtlOptions, - SoaRecord, - SrvRecord, - } from "node:dns"; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('node:dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('node:dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A"): Promise; - function resolve(hostname: string, rrtype: "AAAA"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CAA"): Promise; - function resolve(hostname: string, rrtype: "CNAME"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "NS"): Promise; - function resolve(hostname: string, rrtype: "PTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve( - hostname: string, - rrtype: string, - ): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: readonly string[]): void; - /** - * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have - * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the - * default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('node:dns').promises; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org').then((addresses) => { - * // ... - * }); - * - * // Alternatively, the same code can be written using async-await style. - * (async function() { - * const addresses = await resolver.resolve4('example.org'); - * })(); - * ``` - * - * The following methods from the `dnsPromises` API are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v10.6.0 - */ - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module "node:dns/promises" { - export * from "dns/promises"; -} diff --git a/node_modules/@types/node/dom-events.d.ts b/node_modules/@types/node/dom-events.d.ts deleted file mode 100644 index 147a7b6..0000000 --- a/node_modules/@types/node/dom-events.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -export {}; // Don't export anything! - -//// DOM-like Events -// NB: The Event / EventTarget / EventListener implementations below were copied -// from lib.dom.d.ts, then edited to reflect Node's documentation at -// https://nodejs.org/api/events.html#class-eventtarget. -// Please read that link to understand important implementation differences. - -// This conditional type will be the existing global Event in a browser, or -// the copy below in a Node environment. -type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {} - : { - /** This is not used in Node.js and is provided purely for completeness. */ - readonly bubbles: boolean; - /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ - cancelBubble: () => void; - /** True if the event was created with the cancelable option */ - readonly cancelable: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly composed: boolean; - /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ - composedPath(): [EventTarget?]; - /** Alias for event.target. */ - readonly currentTarget: EventTarget | null; - /** Is true if cancelable is true and event.preventDefault() has been called. */ - readonly defaultPrevented: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly eventPhase: 0 | 2; - /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ - readonly isTrusted: boolean; - /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ - preventDefault(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - returnValue: boolean; - /** Alias for event.target. */ - readonly srcElement: EventTarget | null; - /** Stops the invocation of event listeners after the current one completes. */ - stopImmediatePropagation(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - stopPropagation(): void; - /** The `EventTarget` dispatching the event */ - readonly target: EventTarget | null; - /** The millisecond timestamp when the Event object was created. */ - readonly timeStamp: number; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; - }; - -// See comment above explaining conditional type -type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {} - : { - /** - * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. - * - * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. - * - * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. - * Specifically, the `capture` option is used as part of the key when registering a `listener`. - * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. - */ - addEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: AddEventListenerOptions | boolean, - ): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: EventListenerOptions | boolean, - ): void; - }; - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ - capture?: boolean; -} - -interface AddEventListenerOptions extends EventListenerOptions { - /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ - once?: boolean; - /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ - passive?: boolean; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -import {} from "events"; // Make this an ambient declaration -declare global { - /** An event which takes place in the DOM. */ - interface Event extends __Event {} - var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T - : { - prototype: __Event; - new(type: string, eventInitDict?: EventInit): __Event; - }; - - /** - * EventTarget is a DOM interface implemented by objects that can - * receive events and may have listeners for them. - */ - interface EventTarget extends __EventTarget {} - var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T - : { - prototype: __EventTarget; - new(): __EventTarget; - }; -} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts deleted file mode 100644 index 72f17bd..0000000 --- a/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js) - */ -declare module "domain" { - import EventEmitter = require("node:events"); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and low-level requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('node:domain'); - * const fs = require('node:fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module "node:domain" { - export * from "domain"; -} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts deleted file mode 100644 index 6ed47c5..0000000 --- a/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,879 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js) - */ -declare module "events" { - import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; - // NOTE: This class is in the docs but is **not actually exported** by Node. - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node - // actually starts exporting the class, uncomment below. - // import { EventListener, EventListenerObject } from '__dom-events'; - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ - // interface NodeEventTarget extends EventTarget { - // /** - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. - // */ - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ - // eventNames(): string[]; - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ - // listenerCount(type: string): number; - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ - // off(type: string, listener: EventListener | EventListenerObject): this; - // /** Node.js-specific alias for `eventTarget.addListener()`. */ - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ - // once(type: string, listener: EventListener | EventListenerObject): this; - // /** - // * Node.js-specific extension to the `EventTarget` class. - // * If `type` is specified, removes all registered listeners for `type`, - // * otherwise removes all registered listeners. - // */ - // removeAllListeners(type: string): this; - // /** - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. - // */ - // removeListener(type: string, listener: EventListener | EventListenerObject): this; - // } - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - // Any EventTarget with a Node-style `once` function - interface _NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - // Any EventTarget with a DOM-style `addEventListener` - interface _DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - }, - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `node:events` module: - * - * ```js - * import { EventEmitter } from 'node:events'; - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - - [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void; - - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: _NodeEventTarget, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string, - options?: StaticEventEmitterOptions, - ): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @experimental - * @return Disposable that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_`EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - - export interface EventEmitterReferencingAsyncResource extends AsyncResource { - readonly eventEmitter: EventEmitterAsyncResource; - } - - export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { - /** - * The type of async event, this is required when instantiating `EventEmitterAsyncResource` - * directly rather than as a child class. - * @default new.target.name if instantiated as a child class. - */ - name?: string; - } - - /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that - * require manual async tracking. Specifically, all events emitted by instances - * of `events.EventEmitterAsyncResource` will run within its `async context`. - * - * ```js - * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; - * import { notStrictEqual, strictEqual } from 'node:assert'; - * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; - * - * // Async tracking tooling will identify this as 'Q'. - * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); - * - * // 'foo' listeners will run in the EventEmitters async context. - * ee1.on('foo', () => { - * strictEqual(executionAsyncId(), ee1.asyncId); - * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); - * }); - * - * const ee2 = new EventEmitter(); - * - * // 'foo' listeners on ordinary EventEmitters that do not track async - * // context, however, run in the same async context as the emit(). - * ee2.on('foo', () => { - * notStrictEqual(executionAsyncId(), ee2.asyncId); - * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); - * }); - * - * Promise.resolve().then(() => { - * ee1.emit('foo'); - * ee2.emit('foo'); - * }); - * ``` - * - * The `EventEmitterAsyncResource` class has the same methods and takes the - * same options as `EventEmitter` and `AsyncResource` themselves. - * @since v17.4.0, v16.14.0 - */ - export class EventEmitterAsyncResource extends EventEmitter { - /** - * @param options Only optional in child class. - */ - constructor(options?: EventEmitterAsyncResourceOptions); - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - */ - emitDestroy(): void; - /** - * The unique `asyncId` assigned to the resource. - */ - readonly asyncId: number; - /** - * The same triggerAsyncId that is passed to the AsyncResource constructor. - */ - readonly triggerAsyncId: number; - /** - * The returned `AsyncResource` object has an additional `eventEmitter` property - * that provides a reference to this `EventEmitterAsyncResource`. - */ - readonly asyncResource: EventEmitterReferencingAsyncResource; - } - } - global { - namespace NodeJS { - interface EventEmitter { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void; - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * import { EventEmitter } from 'node:events'; - * class MyEmitter extends EventEmitter {} - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: string | symbol, listener?: Function): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module "node:events" { - import events = require("events"); - export = events; -} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts deleted file mode 100644 index 5cbca12..0000000 --- a/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,4311 +0,0 @@ -/** - * The `node:fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'node:fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'node:fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js) - */ -declare module "fs" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | "buffer" - | { - encoding: "buffer"; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - export interface StatsFsBase { - /** Type of file system. */ - type: T; - /** Optimal transfer block size. */ - bsize: T; - /** Total data blocks in file system. */ - blocks: T; - /** Free blocks in file system. */ - bfree: T; - /** Available blocks for unprivileged users */ - bavail: T; - /** Total file nodes in file system. */ - files: T; - /** Free file nodes in file system. */ - ffree: T; - } - export interface StatsFs extends StatsFsBase {} - /** - * Provides information about a mounted file system. - * - * Objects returned from {@link statfs} and its synchronous counterpart are of - * this type. If `bigint` in the `options` passed to those methods is `true`, the - * numeric values will be `bigint` instead of `number`. - * - * ```console - * StatFs { - * type: 1397114950, - * bsize: 4096, - * blocks: 121938943, - * bfree: 61058895, - * bavail: 61058895, - * files: 999, - * ffree: 1000000 - * } - * ``` - * - * `bigint` version: - * - * ```console - * StatFs { - * type: 1397114950n, - * bsize: 4096n, - * blocks: 121938943n, - * bfree: 61058895n, - * bavail: 61058895n, - * files: 999n, - * ffree: 1000000n - * } - * ``` - * @since v19.6.0, v18.15.0 - */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { - bigint?: boolean | undefined; - } - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - /** - * The base path that this `fs.Dirent` object refers to. - * @since v20.1.0 - */ - path: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be fulfilled after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.FSWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.FSWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "ready", listener: () => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "ready", listener: () => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'node:fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'node:fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * {@link stat} follows symbolic links. Use {@link lstat} to look at the - * links themselves. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'node:fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - }, - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - }, - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - }, - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - }, - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - }, - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( - path: PathLike, - options: - | (StatFsOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, - ): void; - export namespace statfs { - /** - * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. - * @param path A path to an existing file or directory on the file system to be queried. - */ - function __promisify__( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatFsOptions): Promise; - } - /** - * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfsSync( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): StatsFs; - export function statfsSync( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. - * If the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction - * points on NTFS volumes can only point to directories. - * - * Relative targets are relative to the link's parent directory. - * - * ```js - * import { symlink } from 'node:fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - * @param [type='null'] - */ - export function symlink( - target: PathLike, - path: PathLike, - type: symlink.Type | undefined | null, - callback: NoParamCallback, - ): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = "dir" | "file" | "junction"; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - * @param [type='null'] - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..`, and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - function native( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - function native( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created (for instance, if it was previously created). - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. If `recursive` is false and the directory exists, - * an `EEXIST` error occurs. - * - * ```js - * import { mkdir } from 'node:fs'; - * - * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. - * mkdir('./tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'node:fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: Mode | MakeDirectoryOptions | null | undefined, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: Mode | MakeDirectoryOptions | null, - ): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('node:path').sep`). - * - * ```js - * import { tmpdir } from 'node:os'; - * import { mkdtemp } from 'node:fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'node:path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | "buffer" - | { - encoding: "buffer"; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp( - prefix: string, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | "buffer" - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - mode: Mode | undefined | null, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write( - fd: number, - string: string, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - * @return The number of bytes written. - */ - export function writeSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset?: number | null, - length?: number | null, - position?: number | null, - ): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void, - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - * @param [position='null'] - */ - export function readSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset: number, - length: number, - position: ReadPosition | null, - ): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile( - path: PathOrFileDescriptor, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): string | Buffer; - export type WriteFileOptions = - | ( - & ObjectEncodingOptions - & Abortable - & { - mode?: Mode | undefined; - flag?: string | undefined; - flush?: boolean | undefined; - } - ) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'node:fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - callback: NoParamCallback, - ): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__( - file: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'node:fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: StatsListener, - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: BigIntStatsListener, - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | "buffer" | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options?: WatchOptions | BufferEncoding | null, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: WatchOptions | string, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'node:fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won't be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'node:fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'node:fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'node:fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - signal?: AbortSignal | null | undefined; - highWaterMark?: number | undefined; - } - interface FSImplementation { - open?: (...args: any[]) => any; - close?: (...args: any[]) => any; - } - interface CreateReadStreamFSImplementation extends FSImplementation { - read: (...args: any[]) => any; - } - interface CreateWriteStreamFSImplementation extends FSImplementation { - write: (...args: any[]) => any; - writev?: (...args: any[]) => any; - } - interface ReadStreamOptions extends StreamOptions { - fs?: CreateReadStreamFSImplementation | null | undefined; - end?: number | undefined; - } - interface WriteStreamOptions extends StreamOptions { - fs?: CreateWriteStreamFSImplementation | null | undefined; - flush?: boolean | undefined; - } - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'node:fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'node:fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] - */ - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @param [position='null'] - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - */ - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - - export interface OpenAsBlobOptions { - /** - * An optional mime type for the blob. - * - * @default 'undefined' - */ - type?: string | undefined; - } - - /** - * Returns a `Blob` whose data is backed by the given file. - * - * The file must not be modified after the `Blob` is created. Any modifications - * will cause reading the `Blob` data to fail with a `DOMException` error. - * Synchronous stat operations on the file when the `Blob` is created, and before - * each read in order to detect whether the file data has been modified on disk. - * - * ```js - * import { openAsBlob } from 'node:fs'; - * - * const blob = await openAsBlob('the.file.txt'); - * const ab = await blob.arrayBuffer(); - * blob.stream(); - * ``` - * @since v19.8.0 - * @experimental - */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - - export interface OpenDirOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - /** - * @default false - */ - recursive?: boolean; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( - path: PathLike, - options: OpenDirOptions, - cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, - ): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} - */ - mode?: number; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp( - source: string | URL, - destination: string | URL, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - export function cp( - source: string | URL, - destination: string | URL, - opts: CopyOptions, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; -} -declare module "node:fs" { - export * from "fs"; -} diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts deleted file mode 100644 index 88a9fc3..0000000 --- a/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,1239 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module "fs/promises" { - import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; - import { - BigIntStats, - BigIntStatsFs, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatFsOptions, - StatOptions, - Stats, - StatsFs, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T | null; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - flush?: boolean | undefined; - } - interface ReadableWebStreamOptions { - /** - * Whether to open a normal or a `'bytes'` stream. - * @since v20.0.0 - */ - type?: "bytes" | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read( - buffer: T, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called - * after the `FileHandle` is closed or closing. - * - * ```js - * import { - * open, - * } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not - * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. - * @since v17.0.0 - * @experimental - */ - readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. - * See `filehandle.createReadStream()` for the options. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * @since v18.11.0 - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - }, - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is fulfilled with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Write `buffer` to the file. - * - * The promise is fulfilled with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param offset The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current - * position. See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is fulfilled with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be fulfilled (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - /** - * An alias for {@link FileHandle.close()}. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - const constants: typeof fsConstants; - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is fulfilled with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access, constants } from 'node:fs/promises'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { copyFile, constants } from 'node:fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * - * ```js - * import { mkdir } from 'node:fs/promises'; - * - * try { - * const projectFolder = new URL('./test/project/', import.meta.url); - * const createDir = await mkdir(projectFolder, { recursive: true }); - * - * console.log(`created ${createDir}`); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'node:fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * fulfilled with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will - * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not - * exist, `'file'` will be used. Windows junction points require the destination - * path to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. Junction points on NTFS volumes - * can only point to directories. - * @since v10.0.0 - * @param [type='null'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v19.6.0, v18.15.0 - * @return Fulfills with the {fs.StatFs} object for the given `path`. - */ - function statfs( - path: PathLike, - opts?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function statfs( - path: PathLike, - opts: StatFsOptions & { - bigint: true; - }, - ): Promise; - function statfs(path: PathLike, opts?: StatFsOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath( - path: PathLike, - options?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs/promises'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * try { - * await mkdtemp(join(tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('node:path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the file system path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs/promises'; - * import { Buffer } from 'node:buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: - | string - | NodeJS.ArrayBufferView - | Iterable - | AsyncIterable - | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile( - path: PathLike | FileHandle, - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * An example of reading a `package.json` file located in the same directory of the - * running code: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * try { - * const filePath = new URL('./package.json', import.meta.url); - * const contents = await readFile(filePath, { encoding: 'utf8' }); - * console.log(contents); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ( - & ObjectEncodingOptions - & Abortable - & { - flag?: OpenMode | undefined; - } - ) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('node:fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch( - filename: PathLike, - options: WatchOptions | string, - ): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; -} -declare module "node:fs/promises" { - export * from "fs/promises"; -} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts deleted file mode 100644 index 5f25006..0000000 --- a/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,411 +0,0 @@ -export {}; // Make this a module - -// #region Fetch and friends -// Conditional type aliases, used at the end of this file. -// Will either be empty if lib-dom is included, or the undici version otherwise. -type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; -type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; -type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; -type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; -type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; -type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").ResponseInit; -type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File; -// #endregion Fetch and friends - -declare global { - // Declare "static" methods in Error - interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; - } - - /*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - - // For backwards compability - interface NodeRequire extends NodeJS.Require {} - interface RequireResolve extends NodeJS.RequireResolve {} - interface NodeModule extends NodeJS.Module {} - - var process: NodeJS.Process; - var console: Console; - - var __filename: string; - var __dirname: string; - - var require: NodeRequire; - var module: NodeModule; - - // Same as module.exports - var exports: any; - - /** - * Only available if `--expose-gc` is passed to the process. - */ - var gc: undefined | (() => void); - - // #region borrowed - // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib - /** A controller object that allows you to abort one or more DOM requests as and when desired. */ - interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; - } - - /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ - interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; - } - - var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - - var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; - // #endregion borrowed - - // #region Disposable - interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; - - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; - } - - interface Disposable { - [Symbol.dispose](): void; - } - - interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; - } - // #endregion Disposable - - // #region ArrayLike.at() - interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; - } - interface String extends RelativeIndexable {} - interface Array extends RelativeIndexable {} - interface ReadonlyArray extends RelativeIndexable {} - interface Int8Array extends RelativeIndexable {} - interface Uint8Array extends RelativeIndexable {} - interface Uint8ClampedArray extends RelativeIndexable {} - interface Int16Array extends RelativeIndexable {} - interface Uint16Array extends RelativeIndexable {} - interface Int32Array extends RelativeIndexable {} - interface Uint32Array extends RelativeIndexable {} - interface Float32Array extends RelativeIndexable {} - interface Float64Array extends RelativeIndexable {} - interface BigInt64Array extends RelativeIndexable {} - interface BigUint64Array extends RelativeIndexable {} - // #endregion ArrayLike.at() end - - /** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ - function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, - ): T; - - /*----------------------------------------------* - * * - * GLOBAL INTERFACES * - * * - *-----------------------------------------------*/ - namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - - /** - * is this an async call (i.e. await, Promise.all(), or Promise.any())? - */ - isAsync(): boolean; - - /** - * is this an async call to Promise.all()? - */ - isPromiseAll(): boolean; - - /** - * returns the index of the promise element that was followed in - * Promise.all() or Promise.any() for async stack traces, or null - * if the CallSite is not an async - */ - getPromiseIndex(): number | null; - - getScriptNameOrSourceURL(): string; - getScriptHash(): string; - - getEnclosingColumnNumber(): number; - getEnclosingLineNumber(): number; - getPosition(): number; - - toString(): string; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } - } - - interface RequestInit extends _RequestInit {} - - function fetch( - input: string | URL | globalThis.Request, - init?: RequestInit, - ): Promise; - - interface Request extends _Request {} - var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; - } ? T - : typeof import("undici-types").Request; - - interface ResponseInit extends _ResponseInit {} - - interface Response extends _Response {} - var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; - } ? T - : typeof import("undici-types").Response; - - interface FormData extends _FormData {} - var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; - } ? T - : typeof import("undici-types").FormData; - - interface Headers extends _Headers {} - var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; - } ? T - : typeof import("undici-types").Headers; - - interface File extends _File {} - var File: typeof globalThis extends { - onmessage: any; - File: infer T; - } ? T - : typeof import("node:buffer").File; -} diff --git a/node_modules/@types/node/globals.global.d.ts b/node_modules/@types/node/globals.global.d.ts deleted file mode 100644 index ef1198c..0000000 --- a/node_modules/@types/node/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts deleted file mode 100644 index 710fe59..0000000 --- a/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,1887 +0,0 @@ -/** - * To use the HTTP server and client one must `require('node:http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```json - * { "content-length": "123", - * "content-type": "text/plain", - * "connection": "keep-alive", - * "host": "example.com", - * "accept": "*" } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js) - */ -declare module "http" { - import * as stream from "node:stream"; - import { URL } from "node:url"; - import { LookupOptions } from "node:dns"; - import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - "accept-language"?: string | undefined; - "accept-patch"?: string | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - "alt-svc"?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - connection?: string | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-type"?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - "proxy-authenticate"?: string | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | undefined; - "sec-websocket-version"?: string | undefined; - "set-cookie"?: string[] | undefined; - "strict-transport-security"?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - upgrade?: string | undefined; - "user-agent"?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - "www-authenticate"?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict { - accept?: string | string[] | undefined; - "accept-charset"?: string | string[] | undefined; - "accept-encoding"?: string | string[] | undefined; - "accept-language"?: string | string[] | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - "cdn-cache-control"?: string | undefined; - connection?: string | string[] | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | number | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-security-policy"?: string | undefined; - "content-security-policy-report-only"?: string | undefined; - cookie?: string | string[] | undefined; - dav?: string | string[] | undefined; - dnt?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-range"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - link?: string | string[] | undefined; - location?: string | undefined; - "max-forwards"?: string | undefined; - origin?: string | undefined; - prgama?: string | string[] | undefined; - "proxy-authenticate"?: string | string[] | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - "public-key-pins-report-only"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "referrer-policy"?: string | undefined; - refresh?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | string[] | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | string[] | undefined; - "sec-websocket-version"?: string | undefined; - server?: string | undefined; - "set-cookie"?: string | string[] | undefined; - "strict-transport-security"?: string | undefined; - te?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - "user-agent"?: string | undefined; - upgrade?: string | undefined; - "upgrade-insecure-requests"?: string | undefined; - vary?: string | undefined; - via?: string | string[] | undefined; - warning?: string | undefined; - "www-authenticate"?: string | string[] | undefined; - "x-content-type-options"?: string | undefined; - "x-dns-prefetch-control"?: string | undefined; - "x-frame-options"?: string | undefined; - "x-xss-protection"?: string | undefined; - } - interface ClientRequestArgs { - _defaultAgent?: Agent | undefined; - agent?: Agent | boolean | undefined; - auth?: string | null | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: - | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) - | undefined; - defaultPort?: number | string | undefined; - family?: number | undefined; - headers?: OutgoingHttpHeaders | undefined; - hints?: LookupOptions["hints"]; - host?: string | null | undefined; - hostname?: string | null | undefined; - insecureHTTPParser?: boolean | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - lookup?: LookupFunction | undefined; - /** - * @default 16384 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - port?: number | string | null | undefined; - protocol?: string | null | undefined; - setHost?: boolean | undefined; - signal?: AbortSignal | undefined; - socketPath?: string | undefined; - timeout?: number | undefined; - uniqueHeaders?: Array | undefined; - joinDuplicateHeaders?: boolean; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > { - /** - * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. - */ - IncomingMessage?: Request | undefined; - /** - * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. - */ - ServerResponse?: Response | undefined; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @see Server.requestTimeout for more information. - * @default 300000 - * @since v18.0.0 - */ - requestTimeout?: number | undefined; - /** - * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. - * @default false - * @since v18.14.0 - */ - joinDuplicateHeaders?: boolean; - /** - * The number of milliseconds of inactivity a server needs to wait for additional incoming data, - * after it has finished writing the last response, before a socket will be destroyed. - * @see Server.keepAliveTimeout for more information. - * @default 5000 - * @since v18.0.0 - */ - keepAliveTimeout?: number | undefined; - /** - * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. - * @default 30000 - */ - connectionsCheckingInterval?: number | undefined; - /** - * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. - * Default: @see stream.getDefaultHighWaterMark(). - * @since v20.1.0 - */ - highWaterMark?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 16384 - * @since v13.3.0 - */ - maxHeaderSize?: number | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default true - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * A list of response headers that should be sent only once. - * If the header's value is an array, the items will be joined using `; `. - */ - uniqueHeaders?: Array | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request - * or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from - * the perspective of the participants of an HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Alias of `outgoingMessage.socket`. - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value. If the header already exists in the to-be-sent - * headers, its value will be replaced. Use an array of strings to send multiple - * headers with the same name. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | readonly string[]): this; - /** - * Append a single header value for the header object. - * - * If the value is an array, this is equivalent of calling this method multiple - * times. - * - * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`. - * - * Depending of the value of `options.uniqueHeaders` when the client request or the - * server were created, this will end up in the header being sent multiple times or - * a single time with values joined using `; `. - * @since v18.3.0, v16.17.0 - * @param name Header name - * @param value Header value - */ - appendHeader(name: string, value: string | readonly string[]): this; - /** - * Gets the value of the HTTP header with the given name. If that header is not - * set, the returned value will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript `Object`. This means that - * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers will **only** be emitted if the message is chunked encoded. If not, - * the trailers will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header field names in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Flushes the message headers. - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - /** - * If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal. - * Mismatching the `Content-Length` header value will result - * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * @since v18.10.0, v16.18.0 - */ - strictContentLength: boolean; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics', - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }, earlyHintsCallback); - * ``` - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain', - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * will check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a \[`Error`\]\[\] being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown, - * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * - * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * import http from 'node:http'; - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * import http from 'node:http'; - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "continue", listener: () => void): this; - on(event: "information", listener: (info: InformationEvent) => void): this; - on(event: "response", listener: (response: IncomingMessage) => void): this; - on(event: "socket", listener: (socket: Socket) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "continue", listener: () => void): this; - once(event: "information", listener: (info: InformationEvent) => void): this; - once(event: "response", listener: (response: IncomingMessage) => void): this; - once(event: "socket", listener: (socket: Socket) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers, and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST', - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * To allow duplicate values of the headers listed above to be joined, - * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more - * information. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with `; `. - * * For all other headers, the values are joined together with `, `. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * Similar to `message.headers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': ['curl/7.22.0'], - * // host: ['127.0.0.1:8000'], - * // accept: ['*'] } - * console.log(request.headersDistinct); - * ``` - * @since v18.3.0, v16.17.0 - */ - headersDistinct: NodeJS.Dict; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * Similar to `message.trailers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * Only populated at the `'end'` event. - * @since v18.3.0, v16.17.0 - */ - trailersDistinct: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.headers.host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.headers.host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: "fifo" | "lifo" | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false, // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent extends EventEmitter { - /** - * By default set to 256. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer(); - * - * // Listen to the request event - * server.on('request', (request, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import http from 'node:http'; - * import { Buffer } from 'node:buffer'; - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!', - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData), - * }, - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'` - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to - * consume the response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called. - * - * Passing illegal value as `name` will result in a `TypeError` being thrown, - * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Example: - * - * ```js - * import { validateHeaderName } from 'node:http'; - * - * try { - * validateHeaderName(''); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' - * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' - * } - * ``` - * @since v14.3.0 - * @param [label='Header name'] Label for error message. - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called. - * - * Passing illegal value as `value` will result in a `TypeError` being thrown. - * - * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Examples: - * - * ```js - * import { validateHeaderValue } from 'node:http'; - * - * try { - * validateHeaderValue('x-my-header', undefined); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true - * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' - * } - * - * try { - * validateHeaderValue('x-my-header', 'oʊmɪɡə'); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true - * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' - * } - * ``` - * @since v14.3.0 - * @param name Header name - * @param value Header value - */ - function validateHeaderValue(name: string, value: string): void; - /** - * Set the maximum number of idle HTTP parsers. - * @since v18.8.0, v16.18.0 - * @param [max=1000] - */ - function setMaxIdleHTTPParsers(max: number): void; - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module "node:http" { - export * from "http"; -} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts deleted file mode 100644 index c3b3e8e..0000000 --- a/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2382 +0,0 @@ -/** - * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. - * It can be accessed using: - * - * ```js - * const http2 = require('node:http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http2.js) - */ -declare module "http2" { - import EventEmitter = require("node:events"); - import * as fs from "node:fs"; - import * as net from "node:net"; - import * as stream from "node:stream"; - import * as tls from "node:tls"; - import * as url from "node:url"; - import { - IncomingHttpHeaders as Http1IncomingHttpHeaders, - IncomingMessage, - OutgoingHttpHeaders, - ServerResponse, - } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { - ":status"?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string | undefined; - ":method"?: string | undefined; - ":authority"?: string | undefined; - ":scheme"?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session | undefined; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('node:http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream( - headers: OutgoingHttpHeaders, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - pushStream( - headers: OutgoingHttpHeaders, - options?: StreamPriorityOptions, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - /** - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * Initiates a response. When the `options.waitForTrailers` option is set, the`'wantTrailers'` event will be emitted immediately after queuing the last chunk - * of payload data to be sent. The `http2stream.sendTrailers()` method can then be - * used to sent trailing header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD( - fd: number | fs.promises.FileHandle, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptions, - ): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.error(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile( - path: string, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptionsWithError, - ): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping( - payload: NodeJS.ArrayBufferView, - callback: (err: Error | null, duration: number, payload: Buffer) => void, - ): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('node:http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings( - settings: Settings, - callback?: (err: Error | null, settings: Settings, duration: number) => void, - ): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('node:http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS, - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: readonly string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('node:http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('node:http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('node:http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: "http:" | "https:" | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions extends ServerSessionOptions {} - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - options: stream.ReadableOptions, - rawHeaders: readonly string[], - ); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 `request` object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ""; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | readonly string[]): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `node:http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }); - * ``` - * @since v18.11.0 - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse( - headers: OutgoingHttpHeaders, - callback: (err: Error | null, res: Http2ServerResponse) => void, - ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('node:http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('node:http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8000); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - export function createServer( - options: ServerOptions, - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8443); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - export function createSecureServer( - options: SecureServerOptions, - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('node:http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect( - authority: string | url.URL, - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; -} -declare module "node:http2" { - export * from "http2"; -} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts deleted file mode 100644 index 36ae5b2..0000000 --- a/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,550 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js) - */ -declare module "https" { - import { Duplex } from "node:stream"; - import * as tls from "node:tls"; - import * as http from "node:http"; - import { URL } from "node:url"; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = - & http.RequestOptions - & tls.SecureContextOptions - & { - checkServerIdentity?: typeof tls.checkServerIdentity | undefined; - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: "request", listener: http.RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: "request", listener: http.RequestListener): this; - once(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('node:https'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('node:https'); - * const fs = require('node:fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample', - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('node:https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false, - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('node:tls'); - * const https = require('node:https'); - * const crypto = require('node:crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha256 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('node:https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module "node:https" { - export * from "https"; -} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts deleted file mode 100644 index a596cad..0000000 --- a/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 4.9+. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts deleted file mode 100644 index 3927b81..0000000 --- a/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,2747 +0,0 @@ -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * - * It can be accessed using: - * - * ```js - * import * as inspector from 'node:inspector/promises'; - * ``` - * - * or - * - * ```js - * import * as inspector from 'node:inspector'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - * @since v8.0.0 - */ - connect(): void; - /** - * Immediately close the session. All pending message callbacks will be called - * with an error. `session.connect()` will need to be called to be able to send - * messages again. Reconnected session will lose all inspector state, such as - * enabled agents or configured breakpoints. - * @since v8.0.0 - */ - disconnect(): void; - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Collect type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - // Events - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -/** - * The inspector module provides an API for interacting with the V8 inspector. - */ -declare module 'node:inspector' { - import inspector = require('inspector'); - export = inspector; -} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts deleted file mode 100644 index c38a9b8..0000000 --- a/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @since v0.3.7 - * @experimental - */ -declare module "module" { - import { URL } from "node:url"; - import { MessagePort } from "node:worker_threads"; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('node:fs'); - * const assert = require('node:assert'); - * const { syncBuiltinESMExports } = require('node:module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('node:fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - interface SourceOrigin { - /** - * The name of the range in the source map, if one was provided - */ - name?: string; - /** - * The file name of the original source, as reported in the SourceMap - */ - fileName: string; - /** - * The 1-indexed lineNumber of the corresponding call site in the original source - */ - lineNumber: number; - /** - * The 1-indexed columnNumber of the corresponding call site in the original source - */ - columnNumber: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line offset and column offset in the generated source - * file, returns an object representing the SourceMap range in the - * original file if found, or an empty object if not. - * - * The object returned contains the following keys: - * - * The returned value represents the raw range as it appears in the - * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and - * column numbers as they appear in Error messages and CallSite - * objects. - * - * To get the corresponding 1-indexed line and column numbers from a - * lineNumber and columnNumber as they are reported by Error stacks - * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` - * @param lineOffset The zero-indexed line number offset in the generated source - * @param columnOffset The zero-indexed column number offset in the generated source - */ - findEntry(lineOffset: number, columnOffset: number): SourceMapping; - /** - * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, - * find the corresponding call site location in the original source. - * - * If the `lineNumber` and `columnNumber` provided are not found in any source map, - * then an empty object is returned. - * @param lineNumber The 1-indexed line number of the call site in the generated source - * @param columnNumber The 1-indexed column number of the call site in the generated source - */ - findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; - } - /** @deprecated Use `ImportAttributes` instead */ - interface ImportAssertions extends ImportAttributes {} - interface ImportAttributes extends NodeJS.Dict { - type?: string | undefined; - } - type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; - type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; - interface GlobalPreloadContext { - port: MessagePort; - } - /** - * @deprecated This hook will be removed in a future version. - * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. - * - * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. - * This hook allows the return of a string that is run as a sloppy-mode script on startup. - * - * @param context Information to assist the preload code - * @return Code to run before application startup - */ - type GlobalPreloadHook = (context: GlobalPreloadContext) => string; - /** - * The `initialize` hook provides a way to define a custom function that runs in the hooks thread - * when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`. - * - * This hook can receive data from a `register` invocation, including ports and other transferrable objects. - * The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes. - */ - type InitializeHook = (data: Data) => void | Promise; - interface ResolveHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions: ImportAttributes; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - /** - * The module importing this one, or undefined if this is the Node.js entry point - */ - parentURL: string | undefined; - } - interface ResolveFnOutput { - /** - * A hint to the load hook (it might be ignored) - */ - format?: ModuleFormat | null | undefined; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions?: ImportAttributes | undefined; - /** - * The import attributes to use when caching the module (optional; if excluded the input will be used) - */ - importAttributes?: ImportAttributes | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The absolute URL to which this input resolves - */ - url: string; - } - /** - * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. - * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); - * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. - * - * @param specifier The specified URL path of the module to be resolved - * @param context - * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook - */ - type ResolveHook = ( - specifier: string, - context: ResolveHookContext, - nextResolve: ( - specifier: string, - context?: ResolveHookContext, - ) => ResolveFnOutput | Promise, - ) => ResolveFnOutput | Promise; - interface LoadHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * The format optionally supplied by the `resolve` hook chain - */ - format: ModuleFormat; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions: ImportAttributes; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - } - interface LoadFnOutput { - format: ModuleFormat; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The source for Node.js to evaluate - */ - source?: ModuleSource; - } - /** - * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. - * It is also in charge of validating the import assertion. - * - * @param url The URL/path of the module to be loaded - * @param context Metadata about the module - * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook - */ - type LoadHook = ( - url: string, - context: LoadHookContext, - nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise, - ) => LoadFnOutput | Promise; - } - interface RegisterOptions { - parentURL: string | URL; - data?: Data | undefined; - transferList?: any[] | undefined; - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static isBuiltin(moduleName: string): boolean; - static Module: typeof Module; - static register( - specifier: string | URL, - parentURL?: string | URL, - options?: RegisterOptions, - ): void; - static register(specifier: string | URL, options?: RegisterOptions): void; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - /** - * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. - * **Caveat:** only present on `file:` modules. - */ - dirname: string; - /** - * The full absolute path and filename of the current module, with symlinks resolved. - * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. - * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. - */ - filename: string; - /** - * The absolute `file:` URL of the module. - */ - url: string; - /** - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * Second `parent` parameter is only used when the `--experimental-import-meta-resolve` - * command flag enabled. - * - * @since v20.6.0 - * - * @param specifier The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. - * @returns The absolute (`file:`) URL string for the resolved module. - */ - resolve(specifier: string, parent?: string | URL | undefined): string; - } - } - export = Module; -} -declare module "node:module" { - import module = require("module"); - export = module; -} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts deleted file mode 100644 index 9af5e3d..0000000 --- a/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,949 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `node:net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('node:net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js) - */ -declare module "net" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import * as dns from "node:dns"; - type LookupFunction = ( - hostname: string, - options: dns.LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, - ) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamily?: boolean | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamilyAttemptTimeout?: number | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. - * If the socket is still writable it implicitly calls `socket.end()`. - * @since v0.3.4 - */ - destroySoon(): void; - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. - * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. - * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0, v16.17.0 - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` - * and it is an array of the addresses that have been attempted. - * - * Each address is a string in the form of `$IP:$PORT`. - * If the connection was successful, then the last address is the one that the socket is currently connected to. - * @since v19.4.0 - */ - readonly autoSelectFamilyAttemptedAddresses: string[]; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting - * (see `socket.connecting`). - * @since v11.2.0, v10.16.0 - */ - readonly pending: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0, v16.18.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * The socket timeout in milliseconds as set by `socket.setTimeout()`. - * It is `undefined` if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. ready - * 9. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "data", listener: (data: Buffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", hadError: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "data", data: Buffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (hadError: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "data", listener: (data: Buffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (hadError: boolean) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: Buffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "data", listener: (data: Buffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "data", listener: (data: Buffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.error('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - readonly listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; - /** - * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } - type IPVersion = "ipv4" | "ipv6"; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('node:net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```bash - * telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```bash - * nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. - * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. - * @since v19.4.0 - */ - function getDefaultAutoSelectFamily(): boolean; - /** - * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. - * @since v19.4.0 - */ - function setDefaultAutoSelectFamily(value: boolean): void; - /** - * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250`. - * @since v19.8.0 - */ - function getDefaultAutoSelectFamilyAttemptTimeout(): number; - /** - * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @since v19.8.0 - */ - function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module "node:net" { - export * from "net"; -} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts deleted file mode 100644 index 39a33f7..0000000 --- a/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,478 +0,0 @@ -/** - * The `node:os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('node:os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js) - */ -declare module "os" { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T | null; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20, - * }, - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * - * `os.cpus().length` should not be used to calculate the amount of parallelism - * available to an application. Use {@link availableParallelism} for this purpose. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns an estimate of the default amount of parallelism a program should use. - * Always returns a value greater than zero. - * - * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). - * @since v19.4.0, v18.14.0 - */ - function availableParallelism(): number; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: "buffer" }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`,`'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, - * and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0, v16.18.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): "BE" | "LE"; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module "node:os" { - export * from "os"; -} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json deleted file mode 100644 index e029dd0..0000000 --- a/node_modules/@types/node/package.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "name": "@types/node", - "version": "20.11.16", - "description": "TypeScript definitions for node", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "githubUsername": "Microsoft", - "url": "https://github.com/Microsoft" - }, - { - "name": "Alberto Schiabel", - "githubUsername": "jkomyno", - "url": "https://github.com/jkomyno" - }, - { - "name": "Alvis HT Tang", - "githubUsername": "alvis", - "url": "https://github.com/alvis" - }, - { - "name": "Andrew Makarov", - "githubUsername": "r3nya", - "url": "https://github.com/r3nya" - }, - { - "name": "Benjamin Toueg", - "githubUsername": "btoueg", - "url": "https://github.com/btoueg" - }, - { - "name": "Chigozirim C.", - "githubUsername": "smac89", - "url": "https://github.com/smac89" - }, - { - "name": "David Junger", - "githubUsername": "touffy", - "url": "https://github.com/touffy" - }, - { - "name": "Deividas Bakanas", - "githubUsername": "DeividasBakanas", - "url": "https://github.com/DeividasBakanas" - }, - { - "name": "Eugene Y. Q. Shen", - "githubUsername": "eyqs", - "url": "https://github.com/eyqs" - }, - { - "name": "Hannes Magnusson", - "githubUsername": "Hannes-Magnusson-CK", - "url": "https://github.com/Hannes-Magnusson-CK" - }, - { - "name": "Huw", - "githubUsername": "hoo29", - "url": "https://github.com/hoo29" - }, - { - "name": "Kelvin Jin", - "githubUsername": "kjin", - "url": "https://github.com/kjin" - }, - { - "name": "Klaus Meinhardt", - "githubUsername": "ajafff", - "url": "https://github.com/ajafff" - }, - { - "name": "Lishude", - "githubUsername": "islishude", - "url": "https://github.com/islishude" - }, - { - "name": "Mariusz Wiktorczyk", - "githubUsername": "mwiktorczyk", - "url": "https://github.com/mwiktorczyk" - }, - { - "name": "Mohsen Azimi", - "githubUsername": "mohsen1", - "url": "https://github.com/mohsen1" - }, - { - "name": "Nicolas Even", - "githubUsername": "n-e", - "url": "https://github.com/n-e" - }, - { - "name": "Nikita Galkin", - "githubUsername": "galkin", - "url": "https://github.com/galkin" - }, - { - "name": "Parambir Singh", - "githubUsername": "parambirs", - "url": "https://github.com/parambirs" - }, - { - "name": "Sebastian Silbermann", - "githubUsername": "eps1lon", - "url": "https://github.com/eps1lon" - }, - { - "name": "Thomas den Hollander", - "githubUsername": "ThomasdenH", - "url": "https://github.com/ThomasdenH" - }, - { - "name": "Wilco Bakker", - "githubUsername": "WilcoBakker", - "url": "https://github.com/WilcoBakker" - }, - { - "name": "wwwy3y3", - "githubUsername": "wwwy3y3", - "url": "https://github.com/wwwy3y3" - }, - { - "name": "Samuel Ainsworth", - "githubUsername": "samuela", - "url": "https://github.com/samuela" - }, - { - "name": "Kyle Uehlein", - "githubUsername": "kuehlein", - "url": "https://github.com/kuehlein" - }, - { - "name": "Thanik Bhongbhibhat", - "githubUsername": "bhongy", - "url": "https://github.com/bhongy" - }, - { - "name": "Marcin Kopacz", - "githubUsername": "chyzwar", - "url": "https://github.com/chyzwar" - }, - { - "name": "Trivikram Kamat", - "githubUsername": "trivikr", - "url": "https://github.com/trivikr" - }, - { - "name": "Junxiao Shi", - "githubUsername": "yoursunny", - "url": "https://github.com/yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "githubUsername": "qwelias", - "url": "https://github.com/qwelias" - }, - { - "name": "ExE Boss", - "githubUsername": "ExE-Boss", - "url": "https://github.com/ExE-Boss" - }, - { - "name": "Piotr Błażejewicz", - "githubUsername": "peterblazejewicz", - "url": "https://github.com/peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "githubUsername": "addaleax", - "url": "https://github.com/addaleax" - }, - { - "name": "Victor Perin", - "githubUsername": "victorperin", - "url": "https://github.com/victorperin" - }, - { - "name": "Yongsheng Zhang", - "githubUsername": "ZYSzys", - "url": "https://github.com/ZYSzys" - }, - { - "name": "NodeJS Contributors", - "githubUsername": "NodeJS", - "url": "https://github.com/NodeJS" - }, - { - "name": "Linus Unnebäck", - "githubUsername": "LinusU", - "url": "https://github.com/LinusU" - }, - { - "name": "wafuwafu13", - "githubUsername": "wafuwafu13", - "url": "https://github.com/wafuwafu13" - }, - { - "name": "Matteo Collina", - "githubUsername": "mcollina", - "url": "https://github.com/mcollina" - }, - { - "name": "Dmitry Semigradsky", - "githubUsername": "Semigradsky", - "url": "https://github.com/Semigradsky" - } - ], - "main": "", - "types": "index.d.ts", - "typesVersions": { - "<=4.8": { - "*": [ - "ts4.8/*" - ] - } - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": { - "undici-types": "~5.26.4" - }, - "typesPublisherContentHash": "c74616c0dddd05b588f3fe3d0da870cc1928ca91bb661c07bccd1d41c3058b05", - "typeScriptVersion": "4.6" -} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts deleted file mode 100644 index 6f07681..0000000 --- a/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} -/** - * The `node:path` module provides utilities for working with file and directory - * paths. It can be accessed using: - * - * ```js - * const path = require('node:path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js) - */ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); - export = path; -} -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); - export = path; -} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100644 index c0ce852..0000000 --- a/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,645 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) - * - * ```js - * const { PerformanceObserver, performance } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js) - */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; - type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net"; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - toJSON(): any; - } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: "mark"; - } - /** - * Exposes measures created via the `Performance.measure()` method. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: "measure"; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = ( - util1?: EventLoopUtilization, - util2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only the named measure. - * @param name - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - * @return The PerformanceMark entry that was created - */ - mark(name?: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: readonly EntryType[]; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from `other` to this histogram. - * @since v17.4.0, v16.14.0 - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('node:perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { performance as _performance } from "perf_hooks"; - global { - /** - * `performance` is a global reference for `require('perf_hooks').performance` - * https://nodejs.org/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } -} -declare module "node:perf_hooks" { - export * from "perf_hooks"; -} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts deleted file mode 100644 index d22308f..0000000 --- a/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1561 +0,0 @@ -declare module "process" { - import * as tty from "node:tty"; - import { Worker } from "node:worker_threads"; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = - | "aix" - | "android" - | "darwin" - | "freebsd" - | "haiku" - | "linux" - | "openbsd" - | "sunos" - | "win32" - | "cygwin" - | "netbsd"; - type Architecture = - | "arm" - | "arm64" - | "ia32" - | "mips" - | "mipsel" - | "ppc" - | "ppc64" - | "riscv64" - | "s390" - | "s390x" - | "x64"; - type Signals = - | "SIGABRT" - | "SIGALRM" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINT" - | "SIGIO" - | "SIGIOT" - | "SIGKILL" - | "SIGPIPE" - | "SIGPOLL" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGUNUSED" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ" - | "SIGBREAK" - | "SIGLOST" - | "SIGINFO"; - type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'node:process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'node:process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```bash - * node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```bash - * node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'node:process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'node:process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'node:process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information', - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'node:process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```bash - * node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'node:process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'node:process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread's `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner - * unlike the main thread. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'node:process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'node:process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'node:process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. - * @since v20.7.0 - * @experimental - */ - readonly sourceMapsEnabled: boolean; - /** - * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for - * stack traces. - * - * It provides same features as launching Node.js process with commandline options`--enable-source-maps`. - * - * Only source maps in JavaScript files that are loaded after source maps has been - * enabled will be parsed and loaded. - * @since v16.6.0, v14.18.0 - * @experimental - */ - setSourceMapsEnabled(value: boolean): void; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'node:process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'node:process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '20.2.0', - * acorn: '8.8.2', - * ada: '2.4.0', - * ares: '1.19.0', - * base64: '0.5.0', - * brotli: '1.0.9', - * cjs_module_lexer: '1.2.2', - * cldr: '43.0', - * icu: '73.1', - * llhttp: '8.1.0', - * modules: '115', - * napi: '8', - * nghttp2: '1.52.0', - * nghttp3: '0.7.0', - * ngtcp2: '0.8.1', - * openssl: '3.0.8+quic', - * simdutf: '3.2.9', - * tz: '2023c', - * undici: '5.22.0', - * unicode: '15.0', - * uv: '1.44.2', - * uvwasi: '0.0.16', - * v8: '11.3.244.8-node.9', - * zlib: '1.2.13' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns a frozen `Object` containing the - * JavaScript representation of the configure options used to compile the current - * Node.js executable. This is the same as the `config.gypi` file that was produced - * when running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'node:process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'node:process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'node:process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'node:process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'node:process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * Gets the amount of memory available to the process (in bytes) based on - * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `undefined` is returned. - * - * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more - * information. - * @since v19.6.0, v18.15.0 - * @experimental - */ - constrainedMemory(): number | undefined; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'node:process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'node:process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Hydrogen', - * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. - * If no IPC channel exists, this property is undefined. - * @since v7.1.0 - */ - channel?: { - /** - * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before. - * @since v7.1.0 - */ - ref(): void; - /** - * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open. - * @since v7.1.0 - */ - unref(): void; - }; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void, - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'node:process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'node:process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; - } - } - } - export = process; -} -declare module "node:process" { - import process = require("process"); - export = process; -} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts deleted file mode 100644 index d2fc9f9..0000000 --- a/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js) - */ -declare module "punycode" { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: readonly number[]): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module "node:punycode" { - export * from "punycode"; -} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts deleted file mode 100644 index b36ea2c..0000000 --- a/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * The `node:querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('node:querystring'); - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical or - * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js) - */ -declare module "querystring" { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends - NodeJS.Dict< - | string - | number - | boolean - | readonly string[] - | readonly number[] - | readonly boolean[] - | null - > - {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```json - * { - * "foo": "bar", - * "abc": ["xyz", "123"] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module "node:querystring" { - export * from "querystring"; -} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts deleted file mode 100644 index b06d58b..0000000 --- a/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * The `node:readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `node:readline`module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js) - */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' '), - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0, v14.17.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * An error will be thrown if calling `rl.question()` after `rl.close()`. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( - line: string, - callback: (err?: null | Error, result?: CompleterResult) => void, - ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('node:readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without - * waiting for user input, call `process.stdin.unref()`. - * @since v0.1.98 - */ - export function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('node:readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ', - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('node:fs'); - * const readline = require('node:readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity, - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('node:fs'); - * const readline = require('node:readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('node:events'); - * const { createReadStream } = require('node:fs'); - * const { createInterface } = require('node:readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module "node:readline" { - export * from "readline"; -} diff --git a/node_modules/@types/node/readline/promises.d.ts b/node_modules/@types/node/readline/promises.d.ts deleted file mode 100644 index 73fb111..0000000 --- a/node_modules/@types/node/readline/promises.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @since v17.0.0 - * @experimental - */ -declare module "readline/promises" { - import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline"; - import { Abortable } from "node:events"; - /** - * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v17.0.0 - */ - class Interface extends _Interface { - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * If the question is called after `rl.close()`, it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an `AbortSignal` to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * @since v17.0.0 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @return A promise that is fulfilled with the user's input in response to the `query`. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - /** - * @since v17.0.0 - */ - class Readline { - /** - * @param stream A TTY stream. - */ - constructor( - stream: NodeJS.WritableStream, - options?: { - autoCommit?: boolean; - }, - ); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an - * action that clears current line of the associated `stream` in a specified - * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an - * action that clears the associated stream from the current position of the - * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated`stream` and clears the internal list of pending actions. - * @since v17.0.0 - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action - * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an - * action that moves the cursor _relative_ to its current position in the - * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback` methods clears the internal list of pending actions without - * sending it to the associated `stream`. - * @since v17.0.0 - * @return this - */ - rollback(): this; - } - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface`instance. - * - * ```js - * const readlinePromises = require('node:readline/promises'); - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case - * is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * @since v17.0.0 - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module "node:readline/promises" { - export * from "readline/promises"; -} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts deleted file mode 100644 index 6c5f81b..0000000 --- a/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -/** - * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation - * that is available both as a standalone program or includible in other - * applications. It can be accessed using: - * - * ```js - * const repl = require('node:repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js) - */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; - import { InspectOptions } from "node:util"; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = ( - this: REPLServer, - evalCmd: string, - context: Context, - file: string, - cb: (err: Error | null, result: any) => void, - ) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('node:repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('node:repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * }, - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('node:repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module "node:repl" { - export * from "repl"; -} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts deleted file mode 100644 index 947a019..0000000 --- a/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1701 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `node:stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `node:stream` module: - * - * ```js - * const stream = require('node:stream'); - * ``` - * - * The `node:stream` module is useful for creating new types of stream instances. - * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/stream.js) - */ -declare module "stream" { - import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamConsumers from "node:stream/consumers"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, - ): T; - } - import Stream = internal.Stream; - import Readable = internal.Readable; - import ReadableOptions = internal.ReadableOptions; - interface ArrayOptions { - /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */ - concurrency?: number; - /** allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal; - } - class ReadableBase extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('node:fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('node:string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array`, or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream`module API as it is currently defined. (See `Compatibility` for more - * information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('node:stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - /** - * The iterator created by this method gives users the option to cancel the destruction - * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, - * or if the iterator should destroy the stream if the stream emitted an error during iteration. - * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. - */ - iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator; - /** - * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. - * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. - * @since v17.4.0, v16.14.0 - * @param fn a function to map over every chunk in the stream. Async or not. - * @returns a stream mapped with the function *fn*. - */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called - * and if it returns a truthy value, the chunk will be passed to the result stream. - * If the *fn* function returns a promise - that promise will be `await`ed. - * @since v17.4.0, v16.14.0 - * @param fn a function to filter chunks from the stream. Async or not. - * @returns a stream filtered with the predicate *fn*. - */ - filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Readable; - /** - * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. - * If the *fn* function returns a promise - that promise will be `await`ed. - * - * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. - * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option - * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. - * In either case the stream will be destroyed. - * - * This method is different from listening to the `'data'` event in that it uses the `readable` event - * in the underlying machinary and can limit the number of concurrent *fn* calls. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise for when the stream has finished. - */ - forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method allows easily obtaining the contents of a stream. - * - * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended - * for interoperability and convenience, not as the primary way to consume streams. - * @since v17.5.0 - * @returns a promise containing an array with the contents of the stream. - */ - toArray(options?: Pick): Promise; - /** - * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream - * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk - * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. - * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. - */ - some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream - * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, - * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. - * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, - * or `undefined` if no element was found. - */ - find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, - ): Promise; - find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream - * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk - * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. - * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. - */ - every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method returns a new stream by applying the given callback to each chunk of the stream - * and then flattening the result. - * - * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams - * will be merged (flattened) into the returned stream. - * @since v17.5.0 - * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. - * @returns a stream flat-mapped with the function *fn*. - */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method returns a new stream with the first *limit* chunks dropped from the start. - * @since v17.5.0 - * @param limit the number of chunks to drop from the readable. - * @returns a stream with *limit* chunks dropped from the start. - */ - drop(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with the first *limit* chunks. - * @since v17.5.0 - * @param limit the number of chunks to take from the readable. - * @returns a stream with *limit* chunks taken. - */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; - /** - * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation - * on the previous element. It returns a promise for the final value of the reduction. - * - * If no *initial* value is supplied the first chunk of the stream is used as the initial value. - * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. - * - * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter - * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. - * @since v17.5.0 - * @param fn a reducer function to call over every chunk in the stream. Async or not. - * @param initial the initial value to use in the reduction. - * @returns a promise for the final value of the reduction. - */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, - initial: T, - options?: Pick, - ): Promise; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - import WritableOptions = internal.WritableOptions; - class WritableBase extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored, or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('node:fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends ReadableBase { - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - readableStream: streamWeb.ReadableStream, - options?: Pick, - ): Readable; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?( - this: Writable, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends WritableBase { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - writableStream: streamWeb.WritableStream, - options?: Pick, - ): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends ReadableBase implements WritableBase { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is - * emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from( - src: - | Stream - | NodeBlob - | ArrayBuffer - | string - | Iterable - | AsyncIterable - | AsyncGeneratorFunction - | Promise - | Object, - ): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - /** - * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; - /** - * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, - options?: Pick< - DuplexOptions, - "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" - >, - ): Duplex; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?( - this: Transform, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * A stream to attach a signal to. - * - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new - * AbortError())` for webstreams. - * - * ```js - * const fs = require('node:fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * - * Or using an `AbortSignal` with a ReadableStream: - * - * ```js - * const controller = new AbortController(); - * const rs = new ReadableStream({ - * start(controller) { - * controller.enqueue('hello'); - * controller.enqueue('world'); - * controller.close(); - * }, - * }); - * - * addAbortSignal(controller.signal, rs); - * - * finished(rs, (err) => { - * if (err) { - * if (err.name === 'AbortError') { - * // The operation was cancelled - * } - * } - * }); - * - * const reader = rs.getReader(); - * - * reader.read().then(({ value, done }) => { - * console.log(value); // hello - * console.log(done); // false - * controller.abort(); - * }); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - /** - * Returns the default highWaterMark used by streams. - * Defaults to `16384` (16 KiB), or `16` for `objectMode`. - * @since v19.9.0 - * @param objectMode - */ - function getDefaultHighWaterMark(objectMode: boolean): number; - /** - * Sets the default highWaterMark used by streams. - * @since v19.9.0 - * @param objectMode - * @param value highWaterMark value - */ - function setDefaultHighWaterMark(objectMode: boolean, value: number): void; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A readable and/or writable stream/webstream. - * - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('node:stream'); - * const fs = require('node:fs'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides `promise version`. - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options: FinishedOptions, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? - | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('node:stream'); - * const fs = require('node:fs'); - * const zlib = require('node:zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * }, - * ); - * ``` - * - * The `pipeline` API provides a `promise version`. - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * const fs = require('node:fs'); - * const http = require('node:http'); - * const { pipeline } = require('node:stream'); - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void, - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0, v16.14.0 - * @experimental - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - /** - * Returns whether the stream is readable. - * @since v17.4.0, v16.14.0 - * @experimental - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module "node:stream" { - import stream = require("stream"); - export = stream; -} diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100644 index 5ad9cba..0000000 --- a/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module "stream/consumers" { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; -} -declare module "node:stream/consumers" { - export * from "stream/consumers"; -} diff --git a/node_modules/@types/node/stream/promises.d.ts b/node_modules/@types/node/stream/promises.d.ts deleted file mode 100644 index 6eac5b7..0000000 --- a/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare module "stream/promises" { - import { - FinishedOptions, - PipelineDestination, - PipelineOptions, - PipelinePromise, - PipelineSource, - PipelineTransform, - } from "node:stream"; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module "node:stream/promises" { - export * from "stream/promises"; -} diff --git a/node_modules/@types/node/stream/web.d.ts b/node_modules/@types/node/stream/web.d.ts deleted file mode 100644 index 361594d..0000000 --- a/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,366 +0,0 @@ -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; - } - interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; - } - type ReadableStreamController = ReadableStreamDefaultController; - type ReadableStreamDefaultReadResult = - | ReadableStreamDefaultReadValueResult - | ReadableStreamDefaultReadDoneResult; - interface ReadableStreamReadValueResult { - done: false; - value: T; - } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; - } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(): ReadableStreamDefaultReader; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): AsyncIterableIterator; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - const ReadableStream: { - prototype: ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - read(view: T): Promise>; - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: any; - const ReadableStreamBYOBRequest: any; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new( - transformer?: Transformer, - writableStrategy?: QueuingStrategy, - readableStrategy?: QueuingStrategy, - ): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; - }; - interface CompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const CompressionStream: { - prototype: CompressionStream; - new(format: string): CompressionStream; - }; - interface DecompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const DecompressionStream: { - prototype: DecompressionStream; - new(format: string): DecompressionStream; - }; -} -declare module "node:stream/web" { - export * from "stream/web"; -} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts deleted file mode 100644 index cd76bf8..0000000 --- a/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `node:string_decoder` module provides an API for decoding `Buffer` objects - * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); // Prints: ¢ - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); // Prints: € - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js) - */ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer The bytes to decode. - */ - write(buffer: string | Buffer | NodeJS.ArrayBufferView): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer The bytes to decode. - */ - end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string; - } -} -declare module "node:string_decoder" { - export * from "string_decoder"; -} diff --git a/node_modules/@types/node/test.d.ts b/node_modules/@types/node/test.d.ts deleted file mode 100644 index 149c9e0..0000000 --- a/node_modules/@types/node/test.d.ts +++ /dev/null @@ -1,1465 +0,0 @@ -/** - * The `node:test` module facilitates the creation of JavaScript tests. - * To access it: - * - * ```js - * import test from 'node:test'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test'; - * ``` - * - * Tests created via the `test` module consist of a single function that is - * processed in one of three ways: - * - * 1. A synchronous function that is considered failing if it throws an exception, - * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` fulfills. - * 3. A function that receives a callback function. If the callback receives any - * truthy value as its first argument, the test is considered failing. If a - * falsy value is passed as the first argument to the callback, the test is - * considered passing. If the test function receives a callback function and - * also returns a `Promise`, the test will fail. - * - * The following example illustrates how tests are written using the`test` module. - * - * ```js - * test('synchronous passing test', (t) => { - * // This test passes because it does not throw an exception. - * assert.strictEqual(1, 1); - * }); - * - * test('synchronous failing test', (t) => { - * // This test fails because it throws an exception. - * assert.strictEqual(1, 2); - * }); - * - * test('asynchronous passing test', async (t) => { - * // This test passes because the Promise returned by the async - * // function is settled and not rejected. - * assert.strictEqual(1, 1); - * }); - * - * test('asynchronous failing test', async (t) => { - * // This test fails because the Promise returned by the async - * // function is rejected. - * assert.strictEqual(1, 2); - * }); - * - * test('failing test using Promises', (t) => { - * // Promises can be used directly as well. - * return new Promise((resolve, reject) => { - * setImmediate(() => { - * reject(new Error('this will cause the test to fail')); - * }); - * }); - * }); - * - * test('callback passing test', (t, done) => { - * // done() is the callback function. When the setImmediate() runs, it invokes - * // done() with no arguments. - * setImmediate(done); - * }); - * - * test('callback failing test', (t, done) => { - * // When the setImmediate() runs, done() is invoked with an Error object and - * // the test fails. - * setImmediate(() => { - * done(new Error('callback failure')); - * }); - * }); - * ``` - * - * If any tests fail, the process exit code is set to `1`. - * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.4.0/lib/test.js) - */ -declare module "node:test" { - import { Readable } from "node:stream"; - import { AsyncResource } from "node:async_hooks"; - /** - * **Note:**`shard` is used to horizontally parallelize test running across - * machines or processes, ideal for large-scale executions across varied - * environments. It's incompatible with `watch` mode, tailored for rapid - * code iteration by automatically rerunning tests on file changes. - * - * ```js - * import { tap } from 'node:test/reporters'; - * import { run } from 'node:test'; - * import process from 'node:process'; - * import path from 'node:path'; - * - * run({ files: [path.resolve('./tests/test.js')] }) - * .compose(tap) - * .pipe(process.stdout); - * ``` - * @since v18.9.0, v16.19.0 - * @param options Configuration options for running tests. The following properties are supported: - */ - function run(options?: RunOptions): TestsStream; - /** - * The `test()` function is the value imported from the `test` module. Each - * invocation of this function results in reporting the test to the `TestsStream`. - * - * The `TestContext` object passed to the `fn` argument can be used to perform - * actions related to the current test. Examples include skipping the test, adding - * additional diagnostic information, or creating subtests. - * - * `test()` returns a `Promise` that fulfills once the test completes. - * if `test()` is called within a `describe()` block, it fulfills immediately. - * The return value can usually be discarded for top level tests. - * However, the return value from subtests should be used to prevent the parent - * test from finishing first and cancelling the subtest - * as shown in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * - * The `timeout` option can be used to fail the test if it takes longer than`timeout` milliseconds to complete. However, it is not a reliable mechanism for - * canceling tests because a running test might block the application thread and - * thus prevent the scheduled cancellation. - * @since v18.0.0, v16.17.0 - * @param [name='The name'] The name of the test, which is displayed when reporting test results. - * @param options Configuration options for the test. The following properties are supported: - * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the callback function is passed as the - * second argument. - * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within {@link describe}. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - namespace test { - export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo }; - } - /** - * The `describe()` function imported from the `node:test` module. Each - * invocation of this function results in the creation of a Subtest. - * After invocation of top level `describe` functions, - * all top level tests and suites will execute. - * @param [name='The name'] The name of the suite, which is displayed when reporting test results. - * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. - * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. - * @return Immediately fulfilled with `undefined`. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function describe(name?: string, fn?: SuiteFn): Promise; - function describe(options?: TestOptions, fn?: SuiteFn): Promise; - function describe(fn?: SuiteFn): Promise; - namespace describe { - /** - * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Shorthand for `test()`. - * - * The `it()` function is imported from the `node:test` module. - * @since v18.6.0, v16.17.0 - */ - function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function it(name?: string, fn?: TestFn): Promise; - function it(options?: TestOptions, fn?: TestFn): Promise; - function it(fn?: TestFn): Promise; - namespace it { - /** - * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - } - /** - * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. - * @since v20.2.0 - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. - * @since v20.2.0 - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. - * @since v20.2.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - /** - * The type of a function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is passed as - * the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; - /** - * The type of a function under Suite. - */ - type SuiteFn = (s: SuiteContext) => void | Promise; - interface TestShard { - /** - * A positive integer between 1 and `` that specifies the index of the shard to run. - */ - index: number; - /** - * A positive integer that specifies the total number of shards to split the test files to. - */ - total: number; - } - interface RunOptions { - /** - * If a number is provided, then that many files would run in parallel. - * If truthy, it would run (number of cpu cores - 1) files in parallel. - * If falsy, it would only run one file at a time. - * If unspecified, subtests inherit this value from their parent. - * @default true - */ - concurrency?: number | boolean | undefined; - /** - * An array containing the list of files to run. - * If unspecified, the test runner execution model will be used. - */ - files?: readonly string[] | undefined; - /** - * Allows aborting an in-progress test execution. - * @default undefined - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the test will fail after. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - /** - * Sets inspector port of test child process. - * If a nullish value is provided, each process gets its own port, - * incremented from the primary's `process.debugPort`. - */ - inspectPort?: number | (() => number) | undefined; - /** - * That can be used to only run tests whose name matches the provided pattern. - * Test name patterns are interpreted as JavaScript regular expressions. - * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. - */ - testNamePatterns?: string | RegExp | string[] | RegExp[]; - /** - * If truthy, the test context will only run tests that have the `only` option set - */ - only?: boolean; - /** - * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run. - */ - setup?: (root: Test) => void | Promise; - /** - * Whether to run in watch mode or not. - * @default false - */ - watch?: boolean | undefined; - /** - * Running tests in a specific shard. - * @default undefined - */ - shard?: TestShard | undefined; - } - class Test extends AsyncResource { - concurrency: number; - nesting: number; - only: boolean; - reporter: TestsStream; - runOnlySubtests: boolean; - testNumber: number; - timeout: number | null; - } - /** - * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.`TestsStream` will emit events, in the - * order of the tests definition - * @since v18.9.0, v16.19.0 - */ - class TestsStream extends Readable implements NodeJS.ReadableStream { - addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - addListener(event: "test:fail", listener: (data: TestFail) => void): this; - addListener(event: "test:pass", listener: (data: TestPass) => void): this; - addListener(event: "test:plan", listener: (data: TestPlan) => void): this; - addListener(event: "test:start", listener: (data: TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:diagnostic", data: DiagnosticData): boolean; - emit(event: "test:fail", data: TestFail): boolean; - emit(event: "test:pass", data: TestPass): boolean; - emit(event: "test:plan", data: TestPlan): boolean; - emit(event: "test:start", data: TestStart): boolean; - emit(event: "test:stderr", data: TestStderr): boolean; - emit(event: "test:stdout", data: TestStdout): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - on(event: "test:fail", listener: (data: TestFail) => void): this; - on(event: "test:pass", listener: (data: TestPass) => void): this; - on(event: "test:plan", listener: (data: TestPlan) => void): this; - on(event: "test:start", listener: (data: TestStart) => void): this; - on(event: "test:stderr", listener: (data: TestStderr) => void): this; - on(event: "test:stdout", listener: (data: TestStdout) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - once(event: "test:fail", listener: (data: TestFail) => void): this; - once(event: "test:pass", listener: (data: TestPass) => void): this; - once(event: "test:plan", listener: (data: TestPlan) => void): this; - once(event: "test:start", listener: (data: TestStart) => void): this; - once(event: "test:stderr", listener: (data: TestStderr) => void): this; - once(event: "test:stdout", listener: (data: TestStdout) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - /** - * An instance of `TestContext` is passed to each test function in order to - * interact with the test runner. However, the `TestContext` constructor is not - * exposed as part of the API. - * @since v18.0.0, v16.17.0 - */ - class TestContext { - /** - * This function is used to create a hook running before subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v20.1.0 - */ - before: typeof before; - /** - * This function is used to create a hook running before each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - beforeEach: typeof beforeEach; - /** - * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.13.0 - */ - after: typeof after; - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - afterEach: typeof afterEach; - /** - * This function is used to write diagnostics to the output. Any diagnostic - * information is included at the end of the test's results. This function does - * not return a value. - * - * ```js - * test('top level test', (t) => { - * t.diagnostic('A diagnostic message'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Message to be reported. - */ - diagnostic(message: string): void; - /** - * The name of the test. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that - * have the `only` option set. Otherwise, all tests are run. If Node.js was not - * started with the `--test-only` command-line option, this function is a - * no-op. - * - * ```js - * test('top level test', (t) => { - * // The test context can be set to run subtests with the 'only' option. - * t.runOnly(true); - * return Promise.all([ - * t.test('this subtest is now skipped'), - * t.test('this subtest is run', { only: true }), - * ]); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param shouldRunOnlyTests Whether or not to run `only` tests. - */ - runOnly(shouldRunOnlyTests: boolean): void; - /** - * ```js - * test('top level test', async (t) => { - * await fetch('some/uri', { signal: t.signal }); - * }); - * ``` - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - /** - * This function causes the test's output to indicate the test as skipped. If`message` is provided, it is included in the output. Calling `skip()` does - * not terminate execution of the test function. This function does not return a - * value. - * - * ```js - * test('top level test', (t) => { - * // Make sure to return here as well if the test contains additional logic. - * t.skip('this is skipped'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional skip message. - */ - skip(message?: string): void; - /** - * This function adds a `TODO` directive to the test's output. If `message` is - * provided, it is included in the output. Calling `todo()` does not terminate - * execution of the test function. This function does not return a value. - * - * ```js - * test('top level test', (t) => { - * // This test is marked as `TODO` - * t.todo('this is a todo'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional `TODO` message. - */ - todo(message?: string): void; - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. This first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - /** - * Each test provides its own MockTracker instance. - */ - readonly mock: MockTracker; - } - /** - * An instance of `SuiteContext` is passed to each suite function in order to - * interact with the test runner. However, the `SuiteContext` constructor is not - * exposed as part of the API. - * @since v18.7.0, v16.17.0 - */ - class SuiteContext { - /** - * The name of the suite. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Can be used to abort test subtasks when the test has been aborted. - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - } - interface TestOptions { - /** - * If a number is provided, then that many tests would run in parallel. - * If truthy, it would run (number of cpu cores - 1) tests in parallel. - * For subtests, it will be `Infinity` tests in parallel. - * If falsy, it would only run one test at a time. - * If unspecified, subtests inherit this value from their parent. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean | undefined; - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal | undefined; - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string | undefined; - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number | undefined; - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string | undefined; - } - /** - * This function is used to create a hook running before running a suite. - * - * ```js - * describe('tests', async () => { - * before(() => console.log('about to run some test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function before(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running after running a suite. - * - * ```js - * describe('tests', async () => { - * after(() => console.log('finished running tests')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function after(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running - * before each subtest of the current suite. - * - * ```js - * describe('tests', async () => { - * beforeEach(() => console.log('about to run a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running - * after each subtest of the current test. - * - * ```js - * describe('tests', async () => { - * afterEach(() => console.log('finished running a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - /** - * The hook function. If the hook uses callbacks, the callback function is passed as the - * second argument. - */ - type HookFn = (s: SuiteContext, done: (result?: any) => void) => any; - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - } - interface MockFunctionOptions { - /** - * The number of times that the mock will use the behavior of `implementation`. - * Once the mock function has been called `times` times, - * it will automatically restore the behavior of `original`. - * This value must be an integer greater than zero. - * @default Infinity - */ - times?: number | undefined; - } - interface MockMethodOptions extends MockFunctionOptions { - /** - * If `true`, `object[methodName]` is treated as a getter. - * This option cannot be used with the `setter` option. - */ - getter?: boolean | undefined; - /** - * If `true`, `object[methodName]` is treated as a setter. - * This option cannot be used with the `getter` option. - */ - setter?: boolean | undefined; - } - type Mock = F & { - mock: MockFunctionContext; - }; - type NoOpFunction = (...args: any[]) => undefined; - type FunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? K : never; - }[keyof T]; - /** - * The `MockTracker` class is used to manage mocking functionality. The test runner - * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's`mock` property. - * @since v19.1.0, v18.13.0 - */ - class MockTracker { - /** - * This function is used to create a mock function. - * - * The following example creates a mock function that increments a counter by one - * on each invocation. The `times` option is used to modify the mock behavior such - * that the first two invocations add two to the counter instead of one. - * - * ```js - * test('mocks a counting function', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); - * - * assert.strictEqual(fn(), 2); - * assert.strictEqual(fn(), 4); - * assert.strictEqual(fn(), 5); - * assert.strictEqual(fn(), 6); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param [original='A no-op function'] An optional function to create a mock on. - * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and - * then restore the behavior of `original`. - * @param options Optional configuration options for the mock function. The following properties are supported: - * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked function. - */ - fn(original?: F, options?: MockFunctionOptions): Mock; - fn( - original?: F, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock; - /** - * This function is used to create a mock on an existing object method. The - * following example demonstrates how a mock is created on an existing object - * method. - * - * ```js - * test('spies on an object method', (t) => { - * const number = { - * value: 5, - * subtract(a) { - * return this.value - a; - * }, - * }; - * - * t.mock.method(number, 'subtract'); - * assert.strictEqual(number.subtract.mock.calls.length, 0); - * assert.strictEqual(number.subtract(3), 2); - * assert.strictEqual(number.subtract.mock.calls.length, 1); - * - * const call = number.subtract.mock.calls[0]; - * - * assert.deepStrictEqual(call.arguments, [3]); - * assert.strictEqual(call.result, 2); - * assert.strictEqual(call.error, undefined); - * assert.strictEqual(call.target, undefined); - * assert.strictEqual(call.this, number); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param object The object whose method is being mocked. - * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. - * @param implementation An optional function used as the mock implementation for `object[methodName]`. - * @param options Optional configuration options for the mock method. The following properties are supported: - * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked method. - */ - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation: Implementation, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method( - object: MockedObject, - methodName: keyof MockedObject, - options: MockMethodOptions, - ): Mock; - method( - object: MockedObject, - methodName: keyof MockedObject, - implementation: Function, - options: MockMethodOptions, - ): Mock; - - /** - * This function is syntax sugar for `MockTracker.method` with `options.getter`set to `true`. - * @since v19.3.0, v18.13.0 - */ - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<() => MockedObject[MethodName]>; - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<(() => MockedObject[MethodName]) | Implementation>; - /** - * This function is syntax sugar for `MockTracker.method` with `options.setter`set to `true`. - * @since v19.3.0, v18.13.0 - */ - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<(value: MockedObject[MethodName]) => void>; - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the`MockTracker` instance. Once disassociated, the mocks can still be used, but the`MockTracker` instance can no longer be - * used to reset their behavior or - * otherwise interact with them. - * - * After each test completes, this function is called on the test context's`MockTracker`. If the global `MockTracker` is used extensively, calling this - * function manually is recommended. - * @since v19.1.0, v18.13.0 - */ - reset(): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does - * not disassociate the mocks from the `MockTracker` instance. - * @since v19.1.0, v18.13.0 - */ - restoreAll(): void; - timers: MockTimers; - } - const mock: MockTracker; - interface MockFunctionCall< - F extends Function, - ReturnType = F extends (...args: any) => infer T ? T - : F extends abstract new(...args: any) => infer T ? T - : unknown, - Args = F extends (...args: infer Y) => any ? Y - : F extends abstract new(...args: infer Y) => any ? Y - : unknown[], - > { - /** - * An array of the arguments passed to the mock function. - */ - arguments: Args; - /** - * If the mocked function threw then this property contains the thrown value. - */ - error: unknown | undefined; - /** - * The value returned by the mocked function. - * - * If the mocked function threw, it will be `undefined`. - */ - result: ReturnType | undefined; - /** - * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. - */ - stack: Error; - /** - * If the mocked function is a constructor, this field contains the class being constructed. - * Otherwise this will be `undefined`. - */ - target: F extends abstract new(...args: any) => any ? F : undefined; - /** - * The mocked function's `this` value. - */ - this: unknown; - } - /** - * The `MockFunctionContext` class is used to inspect or manipulate the behavior of - * mocks created via the `MockTracker` APIs. - * @since v19.1.0, v18.13.0 - */ - class MockFunctionContext { - /** - * A getter that returns a copy of the internal array used to track calls to the - * mock. Each entry in the array is an object with the following properties. - * @since v19.1.0, v18.13.0 - */ - readonly calls: Array>; - /** - * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls`is a getter that creates a copy of the internal call tracking array. - * @since v19.1.0, v18.13.0 - * @return The number of times that this mock has been invoked. - */ - callCount(): number; - /** - * This function is used to change the behavior of an existing mock. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, and then changes the mock implementation to a different function. - * - * ```js - * test('changes a mock behavior', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementation(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 5); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's new implementation. - */ - mockImplementation(implementation: Function): void; - /** - * This function is used to change the behavior of an existing mock for a single - * invocation. Once invocation `onCall` has occurred, the mock will revert to - * whatever behavior it would have used had `mockImplementationOnce()` not been - * called. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, changes the mock implementation to a different function for the - * next invocation, and then resumes its previous behavior. - * - * ```js - * test('changes a mock behavior once', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementationOnce(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 4); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. - * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. - */ - mockImplementationOnce(implementation: Function, onCall?: number): void; - /** - * Resets the call history of the mock function. - * @since v19.3.0, v18.13.0 - */ - resetCalls(): void; - /** - * Resets the implementation of the mock function to its original behavior. The - * mock can still be used after calling this function. - * @since v19.1.0, v18.13.0 - */ - restore(): void; - } - type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; - - interface MockTimersOptions { - apis: Timer[]; - now?: number | Date; - } - /** - * Mocking timers is a technique commonly used in software testing to simulate and - * control the behavior of timers, such as `setInterval` and `setTimeout`, - * without actually waiting for the specified time intervals. - * - * The MockTimers API also allows for mocking of the `Date` constructor and - * `setImmediate`/`clearImmediate` functions. - * - * The `MockTracker` provides a top-level `timers` export - * which is a `MockTimers` instance. - * @since v20.4.0 - * @experimental - */ - class MockTimers { - /** - * Enables timer mocking for the specified timers. - * - * **Note:** When you enable mocking for a specific timer, its associated - * clear function will also be implicitly mocked. - * - * **Note:** Mocking `Date` will affect the behavior of the mocked timers - * as they use the same internal clock. - * - * Example usage without setting initial time: - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); - * ``` - * - * The above example enables mocking for the `Date` constructor, `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, - * `setInterval` and `clearInterval` functions from `node:timers`,`node:timers/promises`, and `globalThis` will be mocked. - * - * Example usage with initial time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: 1000 }); - * ``` - * - * Example usage with initial Date object as time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: new Date() }); - * ``` - * - * Alternatively, if you call `mock.timers.enable()` without any parameters: - * - * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. - * - * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, - * and `globalThis` will be mocked. - * The `Date` constructor from `globalThis` will be mocked. - * - * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date object. It can either be a positive integer, or another Date object. - * @since v20.4.0 - */ - enable(options?: MockTimersOptions): void; - /** - * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. - * Note: This method will execute any mocked timers that are in the past from the new time. - * In the below example we are setting a new time for the mocked date. - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * test('sets the time of a date object', (context) => { - * // Optionally choose what to mock - * context.mock.timers.enable({ apis: ['Date'], now: 100 }); - * assert.strictEqual(Date.now(), 100); - * // Advance in time will also advance the date - * context.mock.timers.setTime(1000); - * context.mock.timers.tick(200); - * assert.strictEqual(Date.now(), 1200); - * }); - * ``` - */ - setTime(time: number): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTimers` instance and disassociates the mocks - * from the `MockTracker` instance. - * - * **Note:** After each test completes, this function is called on - * the test context's `MockTracker`. - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.reset(); - * ``` - * @since v20.4.0 - */ - reset(): void; - /** - * Advances time for all mocked timers. - * - * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts - * only positive numbers. In Node.js, `setTimeout` with negative numbers is - * only supported for web compatibility reasons. - * - * The following example mocks a `setTimeout` function and - * by using `.tick` advances in - * time triggering all pending timers. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Alternativelly, the `.tick` function can be called many times - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * const nineSecs = 9000; - * setTimeout(fn, nineSecs); - * - * const twoSeconds = 3000; - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Advancing time using `.tick` will also advance the time for any `Date` object - * created after the mock was enabled (if `Date` was also set to be mocked). - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * assert.strictEqual(Date.now(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * assert.strictEqual(fn.mock.callCount(), 1); - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * @since v20.4.0 - */ - tick(milliseconds: number): void; - /** - * Triggers all pending mocked timers immediately. If the `Date` object is also - * mocked, it will also advance the `Date` object to the furthest timer's time. - * - * The example below triggers all pending timers immediately, - * causing them to execute without any delay. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * const results = []; - * setTimeout(() => results.push(1), 9999); - * - * // Notice that if both timers have the same timeout, - * // the order of execution is guaranteed - * setTimeout(() => results.push(3), 8888); - * setTimeout(() => results.push(2), 8888); - * - * assert.deepStrictEqual(results, []); - * - * context.mock.timers.runAll(); - * assert.deepStrictEqual(results, [3, 2, 1]); - * // The Date object is also advanced to the furthest timer's time - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * - * **Note:** The `runAll()` function is specifically designed for - * triggering timers in the context of timer mocking. - * It does not have any effect on real-time system - * clocks or actual timers outside of the mocking environment. - * @since v20.4.0 - */ - runAll(): void; - /** - * Calls {@link MockTimers.reset()}. - */ - [Symbol.dispose](): void; - } - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - Mock, - mock, - only, - run, - skip, - test, - test as default, - todo, - }; -} - -interface TestLocationInfo { - /** - * The column number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - column?: number; - /** - * The path of the test file, `undefined` if test is not ran through a file. - */ - file?: string; - /** - * The line number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - line?: number; -} -interface DiagnosticData extends TestLocationInfo { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestFail extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The error thrown by the test. - */ - error: Error; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPass extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPlan extends TestLocationInfo { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; -} -interface TestStart extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestStderr extends TestLocationInfo { - /** - * The message written to `stderr` - */ - message: string; -} -interface TestStdout extends TestLocationInfo { - /** - * The message written to `stdout` - */ - message: string; -} -interface TestEnqueue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestDequeue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform, TransformOptions } from "node:stream"; - - type TestEvent = - | { type: "test:diagnostic"; data: DiagnosticData } - | { type: "test:fail"; data: TestFail } - | { type: "test:pass"; data: TestPass } - | { type: "test:plan"; data: TestPlan } - | { type: "test:start"; data: TestStart } - | { type: "test:stderr"; data: TestStderr } - | { type: "test:stdout"; data: TestStdout } - | { type: "test:enqueue"; data: TestEnqueue } - | { type: "test:dequeue"; data: TestDequeue } - | { type: "test:watch:drained" }; - type TestEventGenerator = AsyncGenerator; - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - */ - function tap(source: TestEventGenerator): AsyncGenerator; - /** - * The `spec` reporter outputs the test results in a human-readable format. - */ - class Spec extends Transform { - constructor(); - } - /** - * The `junit` reporter outputs test results in a jUnit XML format - */ - function junit(source: TestEventGenerator): AsyncGenerator; - class Lcov extends Transform { - constructor(opts?: TransformOptions); - } - export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; -} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts deleted file mode 100644 index 039f31f..0000000 --- a/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('node:timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/timers.js) - */ -declare module "timers" { - import { Abortable } from "node:events"; - import { - setImmediate as setImmediatePromise, - setInterval as setIntervalPromise, - setTimeout as setTimeoutPromise, - } from "node:timers/promises"; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - /** - * This object is created internally and is returned from `setImmediate()`. It - * can be passed to `clearImmediate()` in order to cancel the scheduled - * actions. - * - * By default, when an immediate is scheduled, the Node.js event loop will continue - * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`functions that can be used to - * control this default behavior. - */ - class Immediate implements RefCounted { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Immediate` is active. Calling `immediate.ref()` multiple times will have no - * effect. - * - * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary - * to call `immediate.ref()` unless `immediate.unref()` had been called previously. - * @since v9.7.0 - * @return a reference to `immediate` - */ - ref(): this; - /** - * When called, the active `Immediate` object will not require the Node.js event - * loop to remain active. If there is no other activity keeping the event loop - * running, the process may exit before the `Immediate` object's callback is - * invoked. Calling `immediate.unref()` multiple times will have no effect. - * @since v9.7.0 - * @return a reference to `immediate` - */ - unref(): this; - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - /** - * Cancels the immediate. This is similar to calling `clearImmediate()`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - /** - * This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the - * scheduled actions. - * - * By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the - * timer is active. Each of the `Timeout` objects returned by these functions - * export both `timeout.ref()` and `timeout.unref()` functions that can be used to - * control this default behavior. - */ - class Timeout implements Timer { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. - * - * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary - * to call `timeout.ref()` unless `timeout.unref()` had been called previously. - * @since v0.9.1 - * @return a reference to `timeout` - */ - ref(): this; - /** - * When called, the active `Timeout` object will not require the Node.js event loop - * to remain active. If there is no other activity keeping the event loop running, - * the process may exit before the `Timeout` object's callback is invoked. Calling`timeout.unref()` multiple times will have no effect. - * @since v0.9.1 - * @return a reference to `timeout` - */ - unref(): this; - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - /** - * Cancels the timeout. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - } - /** - * Schedules execution of a one-time `callback` after `delay` milliseconds. - * - * The `callback` will likely not be invoked in precisely `delay` milliseconds. - * Node.js makes no guarantees about the exact timing of when callbacks will fire, - * nor of their ordering. The callback will be called as close as possible to the - * time specified. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay`will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setTimeout()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearTimeout} - */ - function setTimeout( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - /** - * Cancels a `Timeout` object created by `setTimeout()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules repeated execution of `callback` every `delay` milliseconds. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be - * set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setInterval()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearInterval} - */ - function setInterval( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - /** - * Cancels a `Timeout` object created by `setInterval()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules the "immediate" execution of the `callback` after I/O events' - * callbacks. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setImmediate()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of the Node.js `Event Loop` - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearImmediate} - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by {@link setImmediate}. - */ - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module "node:timers" { - export * from "timers"; -} diff --git a/node_modules/@types/node/timers/promises.d.ts b/node_modules/@types/node/timers/promises.d.ts deleted file mode 100644 index 5a54dc7..0000000 --- a/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module "timers/promises" { - import { TimerOptions } from "node:timers"; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * If `ref` is `true`, you need to call `next()` of async iterator explicitly - * or implicitly to keep the event loop alive. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; - interface Scheduler { - /** - * ```js - * import { scheduler } from 'node:timers/promises'; - * - * await scheduler.wait(1000); // Wait one second before continuing - * ``` - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. - * @since v16.14.0 - * @experimental - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - */ - wait: (delay?: number, options?: TimerOptions) => Promise; - /** - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. - * @since v16.14.0 - * @experimental - */ - yield: () => Promise; - } - const scheduler: Scheduler; -} -declare module "node:timers/promises" { - export * from "timers/promises"; -} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts deleted file mode 100644 index 9f6d6be..0000000 --- a/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1210 +0,0 @@ -/** - * The `node:tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('node:tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js) - */ -declare module "tls" { - import { X509Certificate } from "node:crypto"; - import * as net from "node:net"; - import * as stream from "stream"; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - /** - * `true` if a Certificate Authority (CA), `false` otherwise. - * @since v18.13.0 - */ - ca: boolean; - /** - * The DER encoded X.509 certificate data. - */ - raw: Buffer; - /** - * The certificate subject. - */ - subject: Certificate; - /** - * The certificate issuer, described in the same terms as the `subject`. - */ - issuer: Certificate; - /** - * The date-time the certificate is valid from. - */ - valid_from: string; - /** - * The date-time the certificate is valid to. - */ - valid_to: string; - /** - * The certificate serial number, as a hex string. - */ - serialNumber: string; - /** - * The SHA-1 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint: string; - /** - * The SHA-256 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint256: string; - /** - * The SHA-512 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint512: string; - /** - * The extended key usage, a set of OIDs. - */ - ext_key_usage?: string[]; - /** - * A string containing concatenated names for the subject, - * an alternative to the `subject` names. - */ - subjectaltname?: string; - /** - * An array describing the AuthorityInfoAccess, used with OCSP. - */ - infoAccess?: NodeJS.Dict; - /** - * For RSA keys: The RSA bit size. - * - * For EC keys: The key size in bits. - */ - bits?: number; - /** - * The RSA exponent, as a string in hexadecimal number notation. - */ - exponent?: string; - /** - * The RSA modulus, as a hexadecimal string. - */ - modulus?: string; - /** - * The public key. - */ - pubkey?: Buffer; - /** - * The ASN.1 name of the OID of the elliptic curve. - * Well-known curves are identified by an OID. - * While it is unusual, it is possible that the curve - * is identified by its mathematical properties, - * in which case it will not have an OID. - */ - asn1Curve?: string; - /** - * The NIST name for the elliptic curve,if it has one - * (not all well-known curves have been assigned names by NIST). - */ - nistCurve?: string; - } - interface DetailedPeerCertificate extends PeerCertificate { - /** - * The issuer certificate object. - * For self-signed certificates, this may be a circular reference. - */ - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example, a TLSv1.2 protocol with AES256-SHA cipher: - * - * ```json - * { - * "name": "AES256-SHA", - * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", - * "version": "SSLv3" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void, - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: Buffer) => void): this; - addListener(event: "keylog", listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: Buffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: Buffer): boolean; - emit(event: "keylog", line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: Buffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: Buffer) => void): this; - on(event: "keylog", listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: Buffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: Buffer) => void): this; - once(event: "keylog", listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: Buffer) => void): this; - prependListener(event: "keylog", listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: Buffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created - * with {@link createSecureContext} itself. - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: Buffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; - interface SecureContextOptions { - /** - * If set, this will be called when a client opens a connection using the ALPN extension. - * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, - * respectively containing the server name from the SNI extension (if any) and an array of - * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, - * which will be returned to the client as the selected ALPN protocol, or `undefined`, - * to reject the connection with a fatal alert. If a string is returned that does not match one of - * the client's ALPN protocols, an error will be thrown. - * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. - */ - ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. - * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. - * ECDHE-based perfect forward secrecy will still be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom`options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `node:cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('node:tls'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ], - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('node:tls'); - * const fs = require('node:fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect( - port: number, - host?: string, - options?: ConnectionOptions, - secureConnectListener?: () => void, - ): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair( - context?: SecureContext, - isServer?: boolean, - requestCert?: boolean, - rejectUnauthorized?: boolean, - ): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as `server.addContext()`, - * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength - * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can - * be used to create custom parameters. The key length must be greater than or - * equal to 1024 bits or else an error will be thrown. Although 1024 bits is - * permissible, use 2048 bits or larger for stronger security. - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * The default value of the ciphers option of tls.createSecureContext(). - * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of crypto.constants.defaultCoreCipherList, unless - * changed using CLI options using --tls-default-ciphers. - */ - let DEFAULT_CIPHERS: string; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: readonly string[]; -} -declare module "node:tls" { - export * from "tls"; -} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts deleted file mode 100644 index 3361359..0000000 --- a/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,182 +0,0 @@ -/** - * The `node:trace_events` module provides a mechanism to centralize tracing - * information generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `node:trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool - * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool - * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.net.native`: Enables capture of trace data for network. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.fs_dir.sync`: Enables capture of trace data for file system sync - * directory methods. - * * `node.fs.async`: Enables capture of trace data for file system async methods. - * * `node.fs_dir.async`: Enables capture of trace data for file system async - * directory methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * * `node.http`: Enables capture of trace data for http request / response. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `node:trace_events` module: - * - * ```js - * const trace_events = require('node:trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js) - */ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * const trace_events = require('node:trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('node:trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module "node:trace_events" { - export * from "trace_events"; -} diff --git a/node_modules/@types/node/ts4.8/assert.d.ts b/node_modules/@types/node/ts4.8/assert.d.ts deleted file mode 100644 index cd82143..0000000 --- a/node_modules/@types/node/ts4.8/assert.d.ts +++ /dev/null @@ -1,996 +0,0 @@ -/** - * The `node:assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) - */ -declare module "assert" { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - /** - * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. - */ - actual: unknown; - /** - * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. - */ - expected: unknown; - /** - * Set to the passed in operator value. - */ - operator: string; - /** - * Indicates if the message was auto-generated (`true`) or not. - */ - generatedMessage: boolean; - /** - * Value is always `ERR_ASSERTION` to show that the error is an assertion error. - */ - code: "ERR_ASSERTION"; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn - * @return An Array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An Array of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. - * If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function, - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'node:assert'; - * - * const obj1 = { - * a: { - * b: 1, - * }, - * }; - * const obj2 = { - * a: { - * b: 2, - * }, - * }; - * const obj3 = { - * a: { - * b: 1, - * }, - * }; - * const obj4 = { __proto__: obj1 }; - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'node:assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text', - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text', - * }, - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * }, - * ); - * - * // Using regular expressions to validate error properties: - * assert.throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text', - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i, - * }, - * ); - * - * // Fails due to the different `message` and `name` properties: - * assert.throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err, - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error, - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/, - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error', - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'node:assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops', - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error, - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject( - block: (() => Promise) | Promise, - message?: string | Error, - ): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: - & Omit< - typeof assert, - | "equal" - | "notEqual" - | "deepEqual" - | "notDeepEqual" - | "ok" - | "strictEqual" - | "deepStrictEqual" - | "ifError" - | "strict" - > - & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module "node:assert" { - import assert = require("assert"); - export = assert; -} diff --git a/node_modules/@types/node/ts4.8/assert/strict.d.ts b/node_modules/@types/node/ts4.8/assert/strict.d.ts deleted file mode 100644 index f333913..0000000 --- a/node_modules/@types/node/ts4.8/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "assert/strict" { - import { strict } from "node:assert"; - export = strict; -} -declare module "node:assert/strict" { - import { strict } from "node:assert"; - export = strict; -} diff --git a/node_modules/@types/node/ts4.8/async_hooks.d.ts b/node_modules/@types/node/ts4.8/async_hooks.d.ts deleted file mode 100644 index 0667a61..0000000 --- a/node_modules/@types/node/ts4.8/async_hooks.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * We strongly discourage the use of the `async_hooks` API. - * Other APIs that can cover most of its use cases include: - * - * * `AsyncLocalStorage` tracks async context - * * `process.getActiveResourcesInfo()` tracks active resources - * - * The `node:async_hooks` module provides an API to track asynchronous resources. - * It can be accessed using: - * - * ```js - * import async_hooks from 'node:async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js) - */ -declare module "async_hooks" { - /** - * ```js - * import { executionAsyncId } from 'node:async_hooks'; - * import fs from 'node:fs'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * const path = '.'; - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'node:fs'; - * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'node:http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook, - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * }, - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in before is completed. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'node:async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { }, - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg, - ): Func; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>(fn: Func): Func; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope( - fn: (this: This, ...args: any[]) => Result, - thisArg?: This, - ...args: any[] - ): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory - * safe implementation that involves significant optimizations that are non-obvious - * to implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'node:http'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Binds the given function to the current execution context. - * @since v19.8.0 - * @experimental - * @param fn The function to bind to the current execution context. - * @return A new function that calls `fn` within the captured execution context. - */ - static bind any>(fn: Func): Func; - /** - * Captures the current execution context and returns a function that accepts a - * function as an argument. Whenever the returned function is called, it - * calls the function passed to it within the captured context. - * - * ```js - * const asyncLocalStorage = new AsyncLocalStorage(); - * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); - * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); - * console.log(result); // returns 123 - * ``` - * - * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple - * async context tracking purposes, for example: - * - * ```js - * class Foo { - * #runInAsyncScope = AsyncLocalStorage.snapshot(); - * - * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } - * } - * - * const foo = asyncLocalStorage.run(123, () => new Foo()); - * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 - * ``` - * @since v19.8.0 - * @experimental - * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. - */ - static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: () => R): R; - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module "node:async_hooks" { - export * from "async_hooks"; -} diff --git a/node_modules/@types/node/ts4.8/buffer.d.ts b/node_modules/@types/node/ts4.8/buffer.d.ts deleted file mode 100644 index 2fa2e74..0000000 --- a/node_modules/@types/node/ts4.8/buffer.d.ts +++ /dev/null @@ -1,2362 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js) - */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * This function returns `true` if `input` contains only valid UTF-8-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.4.0, v18.14.0 - * @param input The input to validate. - */ - export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - /** - * This function returns `true` if `input` contains only valid ASCII-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.6.0, v18.15.0 - * @param input The input to validate. - */ - export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "latin1" - | "binary"; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'node:buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new(size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export interface FileOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be - * converted to the platform native line-ending as specified by `require('node:os').EOL`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - import { Blob as NodeBlob } from "buffer"; - // This conditional type will be the existing global Blob in a browser, or - // the copy below in a Node environment. - type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob; - global { - namespace NodeJS { - export { BufferEncoding }; - } - // Buffer class - type BufferEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex"; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: readonly any[]): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new(buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`\-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from( - arrayBuffer: WithImplicitCoercion, - byteOffset?: number, - length?: number, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | readonly number[]): Buffer; - from(data: WithImplicitCoercion): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: "string"): string; - }, - encoding?: BufferEncoding, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength( - string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, - encoding?: BufferEncoding, - ): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: readonly Uint8Array[], totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=': 0'] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than`Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: "Buffer"; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare( - target: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number, - ): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * - * // Fill a buffer with empty string - * const c = Buffer.allocUnsafe(5).fill(''); - * - * console.log(c.fill('')); - * // Prints: - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends __Blob {} - /** - * `Blob` class is a global reference for `require('node:buffer').Blob` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { - onmessage: any; - Blob: infer T; - } ? T - : typeof NodeBlob; - } -} -declare module "node:buffer" { - export * from "buffer"; -} diff --git a/node_modules/@types/node/ts4.8/child_process.d.ts b/node_modules/@types/node/ts4.8/child_process.d.ts deleted file mode 100644 index a97532b..0000000 --- a/node_modules/@types/node/ts4.8/child_process.d.ts +++ /dev/null @@ -1,1540 +0,0 @@ -/** - * The `node:child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('node:child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `node:child_process` module provides a handful of - * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js) - */ -declare module "child_process" { - import { ObjectEncodingOptions } from "node:fs"; - import { Abortable, EventEmitter } from "node:events"; - import * as net from "node:net"; - import { Pipe, Readable, Stream, Writable } from "node:stream"; - import { URL } from "node:url"; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('node:assert'); - * const fs = require('node:fs'); - * const child_process = require('node:child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ], - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined, // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('node:child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('node:child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'], - * }, - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * Calls {@link ChildProcess.kill} with `'SIGTERM'`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('node:child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('node:child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('node:net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only - * supported on Unix platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('node:child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('node:net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send( - message: Serializable, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('node:child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio - extends ChildProcess - { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; - type StdioOptions = IOType | Array; - type SerializationType = "json" | "advanced"; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default false - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = "inherit" | "ignore" | Stream; - type StdioPipeNamed = "pipe" | "overlapped"; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env, - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('node:child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('node:child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('node:child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve - * it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn( - command: string, - args?: readonly string[], - options?: SpawnOptionsWithoutStdio, - ): ChildProcessWithoutNullStreams; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('node:child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('node:child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('node:util'); - * const exec = util.promisify(require('node:child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec( - command: string, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: "buffer" | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = - & Omit - & Omit - & { code?: string | number | undefined | null }; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('node:child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('node:util'); - * const execFile = util.promisify(require('node:child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - function execFile(file: string, args?: readonly string[] | null): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile( - file: string, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile( - file: string, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile( - file: string, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('node:child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: readonly string[], options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: "buffer" | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithStringEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithBufferEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args?: readonly string[], - options?: SpawnSyncOptions, - ): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - /** - * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: "buffer" | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: "buffer" | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: readonly string[]): Buffer; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithStringEncoding, - ): string; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithBufferEncoding, - ): Buffer; - function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer; -} -declare module "node:child_process" { - export * from "child_process"; -} diff --git a/node_modules/@types/node/ts4.8/cluster.d.ts b/node_modules/@types/node/ts4.8/cluster.d.ts deleted file mode 100644 index 39cd56a..0000000 --- a/node_modules/@types/node/ts4.8/cluster.d.ts +++ /dev/null @@ -1,432 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process - * isolation is not needed, use the `worker_threads` module instead, which - * allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js) - */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - serialization?: SerializationType | undefined; - cwd?: string | undefined; - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker, this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('node:net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener( - event: "message", - listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; -} diff --git a/node_modules/@types/node/ts4.8/console.d.ts b/node_modules/@types/node/ts4.8/console.d.ts deleted file mode 100644 index bcc3450..0000000 --- a/node_modules/@types/node/ts4.8/console.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** - * The `node:console` module provides a simple debugging console that is similar to - * the JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js) - */ -declare module "console" { - import console = require("node:console"); - export = console; -} -declare module "node:console" { - import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: readonly string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | "auto" | undefined; - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/node_modules/@types/node/ts4.8/constants.d.ts b/node_modules/@types/node/ts4.8/constants.d.ts deleted file mode 100644 index c3ac2b8..0000000 --- a/node_modules/@types/node/ts4.8/constants.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module "constants" { - import { constants as osConstants, SignalConstants } from "node:os"; - import { constants as cryptoConstants } from "node:crypto"; - import { constants as fsConstants } from "node:fs"; - - const exp: - & typeof osConstants.errno - & typeof osConstants.priority - & SignalConstants - & typeof cryptoConstants - & typeof fsConstants; - export = exp; -} - -declare module "node:constants" { - import constants = require("constants"); - export = constants; -} diff --git a/node_modules/@types/node/ts4.8/crypto.d.ts b/node_modules/@types/node/ts4.8/crypto.d.ts deleted file mode 100644 index 718697b..0000000 --- a/node_modules/@types/node/ts4.8/crypto.d.ts +++ /dev/null @@ -1,4487 +0,0 @@ -/** - * The `node:crypto` module provides cryptographic functionality that includes a - * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify - * functions. - * - * ```js - * const { createHmac } = await import('node:crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js) - */ -declare module "crypto" { - import * as stream from "node:stream"; - import { PeerCertificate } from "node:tls"; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of HTML5's `keygen` element. - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'node:buffer'; - * const { Certificate } = await import('node:crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ - const SSL_OP_ALLOW_NO_DHE_KEX: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - /** Instructs OpenSSL to disable encrypt-then-MAC. */ - const SSL_OP_NO_ENCRYPT_THEN_MAC: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to disable renegotiation. */ - const SSL_OP_NO_RENEGOTIATION: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - /** Instructs OpenSSL to turn off SSL v2 */ - const SSL_OP_NO_SSLv2: number; - /** Instructs OpenSSL to turn off SSL v3 */ - const SSL_OP_NO_SSLv3: number; - /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ - const SSL_OP_NO_TICKET: number; - /** Instructs OpenSSL to turn off TLS v1 */ - const SSL_OP_NO_TLSv1: number; - /** Instructs OpenSSL to turn off TLS v1.1 */ - const SSL_OP_NO_TLSv1_1: number; - /** Instructs OpenSSL to turn off TLS v1.2 */ - const SSL_OP_NO_TLSv1_2: number; - /** Instructs OpenSSL to turn off TLS v1.3 */ - const SSL_OP_NO_TLSv1_3: number; - /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ - const SSL_OP_PRIORITIZE_CHACHA: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHash, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was - * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not - * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; - type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; - type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { createHash } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: HashOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: "jwk"; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { KeyObject } = await import('node:crypto'); - * const { subtle } = globalThis.crypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256, - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<"pem">): string | Buffer; - export(options?: KeyExportOptions<"der">): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * Returns `true` or `false` depending on whether the keys have exactly the same - * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). - * @since v17.7.0, v16.15.0 - * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. - */ - equals(otherKeyObject: KeyObject): boolean; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305"; - type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; - type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): CipherCCM; - function createCipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): CipherOCB; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): CipherGCM; - function createCipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * - * import { - * pipeline, - * } from 'node:stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): DecipherOCB; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * let chunk; - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; - passphrase?: string | Buffer | undefined; - encoding?: string | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; - encoding?: string | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey, - * } = await import('node:crypto'); - * - * generateKey('hmac', { length: 512 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: "hmac" | "aes", - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void, - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync, - * } = await import('node:crypto'); - * - * const key = generateKeySync('hmac', { length: 512 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: "hmac" | "aes", - options: { - length: number; - }, - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: "jwk"; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = "der" | "ieee-p1363"; - interface SigningOptions { - /** - * @see crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1', - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign( - privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - outputFormat: BinaryToTextEncoding, - ): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: string, - signature_format?: BinaryToTextEncoding, - ): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createDiffieHellman, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values unless they have been - * generated or computed already, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, - * once a private key has been generated or set, calling this function only updates - * the public key but does not generate a new private key. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding: null, - outputEncoding: BinaryToTextEncoding, - ): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * - * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be - * used to manually provide the public key or to automatically derive it. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `node:constants` module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are listed in the documentation for `DiffieHellmanGroup`. - * - * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman, - * } = await import('node:crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2, - * } = await import('node:crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync, - * } = await import('node:crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - ): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2**48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill( - buffer: T, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - size: number, - callback: (err: Error | null, buf: T) => void, - ): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt, - * } = await import('node:crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync, - * } = await import('node:crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers, - * } = await import('node:crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves, - * } = await import('node:crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. - * Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes, - * } = await import('node:crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createECDH, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH, - * } = await import('node:crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: "latin1" | "hex" | "base64" | "base64url", - format?: "uncompressed" | "compressed" | "hybrid", - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time - * algorithm. - * - * This function does not leak timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point** - * **numbers `x` and `y` are equal.** - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - /** - * Must be `'named'` or `'explicit'`. Default: `'named'`. - */ - paramEncoding?: "explicit" | "named" | undefined; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync, - * } = await import('node:crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair, - * } = await import('node:crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - ): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void, - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void, - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdf, - * } = await import('node:crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf( - digest: string, - irm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: ArrayBuffer) => void, - ): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdfSync, - * } = await import('node:crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync( - digest: string, - ikm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - ): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - type UUID = `${string}-${string}-${string}-${string}-${string}`; - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): UUID; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject?: "always" | "default" | "never"; - /** - * @default true - */ - wildcards?: boolean; - /** - * @default true - */ - partialWildcards?: boolean; - /** - * @default false - */ - multiLabelWildcards?: boolean; - /** - * @default false - */ - singleLabelSubdomains?: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('node:crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * - * Because computing the SHA-256 fingerprint is usually faster and because it is - * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be - * a better choice. While SHA-512 presumably provides a higher level of security in - * general, the security of SHA-256 matches that of most algorithms that are - * commonly used to sign certificates. - * @since v17.2.0, v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * - * This is a comma-separated list of subject alternative names. Each entry begins - * with a string identifying the kind of the subject alternative name followed by - * a colon and the value associated with the entry. - * - * Earlier versions of Node.js incorrectly assumed that it is safe to split this - * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, - * both malicious and legitimate certificates can contain subject alternative names - * that include this sequence when represented as a string. - * - * After the prefix denoting the type of the entry, the remainder of each entry - * might be enclosed in quotes to indicate that the value is a JSON string literal. - * For backward compatibility, Node.js only uses JSON string literals within this - * property when necessary to avoid ambiguity. Third-party code should be prepared - * to handle both possible entry formats. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * A textual representation of the certificate's authority information access - * extension. - * - * This is a line feed separated list of access descriptions. Each line begins with - * the access method and the kind of the access location, followed by a colon and - * the value associated with the access location. - * - * After the prefix denoting the access method and the kind of the access location, - * the remainder of each line might be enclosed in quotes to indicate that the - * value is a JSON string literal. For backward compatibility, Node.js only uses - * JSON string literals within this property when necessary to avoid ambiguity. - * Third-party code should be prepared to handle both possible entry formats. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsBigInt, - callback: (err: Error | null, prime: bigint) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsArrayBuffer, - callback: (err: Error | null, prime: ArrayBuffer) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptions, - callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, - ): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime( - value: LargeNumberLike, - options: CheckPrimeOptions, - callback: (err: Error | null, result: boolean) => void, - ): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`): - * - * * `crypto.constants.ENGINE_METHOD_RSA` - * * `crypto.constants.ENGINE_METHOD_DSA` - * * `crypto.constants.ENGINE_METHOD_DH` - * * `crypto.constants.ENGINE_METHOD_RAND` - * * `crypto.constants.ENGINE_METHOD_EC` - * * `crypto.constants.ENGINE_METHOD_CIPHERS` - * * `crypto.constants.ENGINE_METHOD_DIGESTS` - * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * * `crypto.constants.ENGINE_METHOD_ALL` - * * `crypto.constants.ENGINE_METHOD_NONE` - * @since v0.11.11 - * @param flags - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for {@link webcrypto.getRandomValues}. This - * implementation is not compliant with the Web Crypto spec, to write - * web-compatible code use {@link webcrypto.getRandomValues} instead. - * @since v17.4.0 - * @return Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; - type KeyType = "private" | "public" | "secret"; - type KeyUsage = - | "decrypt" - | "deriveBits" - | "deriveKey" - | "encrypt" - | "sign" - | "unwrapKey" - | "verify" - | "wrapKey"; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): UUID; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: "CryptoKey"; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits( - algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: - | AlgorithmIdentifier - | AesDerivedKeyParams - | HmacImportParams - | HkdfParams - | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: "jwk", key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey( - algorithm: RsaHashedKeyGenParams | EcKeyGenParams, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AlgorithmIdentifier, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: "jwk", - keyData: JsonWebKey, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - signature: BufferSource, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey( - format: KeyFormat, - key: CryptoKey, - wrappingKey: CryptoKey, - wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - ): Promise; - } - } - - global { - var crypto: typeof globalThis extends { - crypto: infer T; - onmessage: any; - } ? T - : webcrypto.Crypto; - } -} -declare module "node:crypto" { - export * from "crypto"; -} diff --git a/node_modules/@types/node/ts4.8/dgram.d.ts b/node_modules/@types/node/ts4.8/dgram.d.ts deleted file mode 100644 index 0b86ae7..0000000 --- a/node_modules/@types/node/ts4.8/dgram.d.ts +++ /dev/null @@ -1,596 +0,0 @@ -/** - * The `node:dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js) - */ -declare module "dgram" { - import { AddressInfo } from "node:net"; - import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; - interface RemoteInfo { - address: string; - family: "IPv4" | "IPv6"; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = "udp4" | "udp6"; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: - | (( - hostname: string, - options: dns.LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ) => void) - | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'node:cluster'; - * import dgram from 'node:dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of bytes queued for sending. - */ - getSendQueueSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of send requests currently in the queue awaiting to be processed. - */ - getSendQueueCount(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send( - msg: string | Uint8Array | readonly any[], - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no additional effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - /** - * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } -} -declare module "node:dgram" { - export * from "dgram"; -} diff --git a/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts deleted file mode 100644 index cd4bd71..0000000 --- a/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +++ /dev/null @@ -1,545 +0,0 @@ -/** - * The `node:diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) - */ -declare module "diagnostics_channel" { - import { AsyncLocalStorage } from "node:async_hooks"; - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string | symbol): boolean; - /** - * This is the primary entry-point for anyone wanting to publish to a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string | symbol): Channel; - type ChannelListener = (message: unknown, name: string | symbol) => void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * diagnostics_channel.subscribe('my-channel', (message, name) => { - * // Received data - * }); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The handler to receive channel messages - */ - function subscribe(name: string | symbol, onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with {@link subscribe}. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * function onMessage(message, name) { - * // Received data - * } - * - * diagnostics_channel.subscribe('my-channel', onMessage); - * - * diagnostics_channel.unsubscribe('my-channel', onMessage); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; - /** - * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing - * channels will be created in the form of `tracing:${name}:${eventType}` where`eventType` corresponds to the types of `TracingChannel Channels`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); - * - * // or... - * - * const channelsByCollection = diagnostics_channel.tracingChannel({ - * start: diagnostics_channel.channel('tracing:my-channel:start'), - * end: diagnostics_channel.channel('tracing:my-channel:end'), - * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), - * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), - * error: diagnostics_channel.channel('tracing:my-channel:error'), - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` - * @return Collection of channels to trace with - */ - function tracingChannel< - StoreType = unknown, - ContextType extends object = StoreType extends object ? StoreType : object, - >( - nameOrChannels: string | TracingChannelCollection, - ): TracingChannel; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is used to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string | symbol; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string | symbol); - /** - * Publish a message to any subscribers to the channel. This will trigger - * message handlers synchronously so they will execute within the same context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message', - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - /** - * When `channel.runStores(context, ...)` is called, the given context data - * will be applied to any store bound to the channel. If the store has already been - * bound the previous `transform` function will be replaced with the new one. - * The `transform` function may be omitted to set the given context data as the - * context directly. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (data) => { - * return { data }; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to which to bind the context data - * @param transform Transform context data before setting the store context - */ - bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; - /** - * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store); - * channel.unbindStore(store); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to unbind from the channel. - * @return `true` if the store was found, `false` otherwise. - */ - unbindStore(store: any): void; - /** - * Applies the given data to any AsyncLocalStorage instances bound to the channel - * for the duration of the given function, then publishes to the channel within - * the scope of that data is applied to the stores. - * - * If a transform function was given to `channel.bindStore(store)` it will be - * applied to transform the message data before it becomes the context value for - * the store. The prior storage context is accessible from within the transform - * function in cases where context linking is required. - * - * The context applied to the store should be accessible in any async code which - * continues from execution which began during the given function, however - * there are some situations in which `context loss` may occur. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (message) => { - * const parent = store.getStore(); - * return new Span(message, parent); - * }); - * channel.runStores({ some: 'message' }, () => { - * store.getStore(); // Span({ some: 'message' }) - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param context Message to send to subscribers and bind to stores - * @param fn Handler to run within the entered storage context - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runStores(): void; - } - interface TracingChannelSubscribers { - start: (message: ContextType) => void; - end: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncStart: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncEnd: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - error: ( - message: ContextType & { - error: unknown; - }, - ) => void; - } - interface TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - } - /** - * The class `TracingChannel` is a collection of `TracingChannel Channels` which - * together express a single traceable action. It is used to formalize and - * simplify the process of producing events for tracing application flow.{@link tracingChannel} is used to construct a`TracingChannel`. As with `Channel` it is recommended to create and reuse a - * single `TracingChannel` at the top-level of the file rather than creating them - * dynamically. - * @since v19.9.0 - * @experimental - */ - class TracingChannel implements TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - /** - * Helper to subscribe a collection of functions to the corresponding channels. - * This is the same as calling `channel.subscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.subscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - */ - subscribe(subscribers: TracingChannelSubscribers): void; - /** - * Helper to unsubscribe a collection of functions from the corresponding channels. - * This is the same as calling `channel.unsubscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.unsubscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. - */ - unsubscribe(subscribers: TracingChannelSubscribers): void; - /** - * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. - * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceSync(() => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Function to wrap a trace around - * @param context Shared object to correlate events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceSync( - fn: (this: ThisArg, ...args: Args) => any, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also - * produce an `error event` if the given function throws an error or the - * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.tracePromise(async () => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Promise-returning function to wrap a trace around - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return Chained from promise returned by the given function - */ - tracePromise( - fn: (this: ThisArg, ...args: Args) => Promise, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or - * the returned - * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * The `position` will be -1 by default to indicate the final argument should - * be used as the callback. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceCallback((arg1, callback) => { - * // Do something - * callback(null, 'result'); - * }, 1, { - * some: 'thing', - * }, thisArg, arg1, callback); - * ``` - * - * The callback will also be run with `channel.runStores(context, ...)` which - * enables context loss recovery in some cases. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * const myStore = new AsyncLocalStorage(); - * - * // The start channel sets the initial store data to something - * // and stores that store data value on the trace context object - * channels.start.bindStore(myStore, (data) => { - * const span = new Span(data); - * data.span = span; - * return span; - * }); - * - * // Then asyncStart can restore from that data it stored previously - * channels.asyncStart.bindStore(myStore, (data) => { - * return data.span; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn callback using function to wrap a trace around - * @param position Zero-indexed argument position of expected callback - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceCallback any>( - fn: Fn, - position: number | undefined, - context: ContextType | undefined, - thisArg: any, - ...args: Parameters - ): void; - } -} -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; -} diff --git a/node_modules/@types/node/ts4.8/dns.d.ts b/node_modules/@types/node/ts4.8/dns.d.ts deleted file mode 100644 index 380cf7d..0000000 --- a/node_modules/@types/node/ts4.8/dns.d.ts +++ /dev/null @@ -1,809 +0,0 @@ -/** - * The `node:dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('node:dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `node:dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('node:dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) - */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - /** - * @default true - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then - * IPv4 and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('node:dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup( - hostname: string, - family: number, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, - ): void; - export function lookup( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('node:dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService( - address: string, - port: number, - callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, - ): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: "A"; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - export interface CaaRecord { - critical: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: "MX"; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - export interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - export interface AnyNsRecord { - type: "NS"; - value: string; - } - export interface AnyPtrRecord { - type: "PTR"; - value: string; - } - export interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - export type AnyRecord = - | AnyARecord - | AnyAaaaRecord - | AnyCnameRecord - | AnyMxRecord - | AnyNaptrRecord - | AnyNsRecord - | AnyPtrRecord - | AnySoaRecord - | AnySrvRecord - | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "A", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "AAAA", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "ANY", - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "CNAME", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "MX", - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NAPTR", - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NS", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "PTR", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SOA", - callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SRV", - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "TXT", - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: string, - callback: ( - err: NodeJS.ErrnoException | null, - addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[], - ) => void, - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__( - hostname: string, - rrtype: string, - ): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, - ): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, - ): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse( - ip: string, - callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, - ): void; - /** - * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - export function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: readonly string[]): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default - * dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('node:dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `node:dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module "node:dns" { - export * from "dns"; -} diff --git a/node_modules/@types/node/ts4.8/dns/promises.d.ts b/node_modules/@types/node/ts4.8/dns/promises.d.ts deleted file mode 100644 index ef9b222..0000000 --- a/node_modules/@types/node/ts4.8/dns/promises.d.ts +++ /dev/null @@ -1,425 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('node:dns').promises` or `require('node:dns/promises')`. - * @since v10.6.0 - */ -declare module "dns/promises" { - import { - AnyRecord, - CaaRecord, - LookupAddress, - LookupAllOptions, - LookupOneOptions, - LookupOptions, - MxRecord, - NaptrRecord, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - ResolveWithTtlOptions, - SoaRecord, - SrvRecord, - } from "node:dns"; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('node:dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('node:dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A"): Promise; - function resolve(hostname: string, rrtype: "AAAA"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CAA"): Promise; - function resolve(hostname: string, rrtype: "CNAME"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "NS"): Promise; - function resolve(hostname: string, rrtype: "PTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve( - hostname: string, - rrtype: string, - ): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: readonly string[]): void; - /** - * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: - * - * * `ipv4first`: sets default `verbatim` `false`. - * * `verbatim`: sets default `verbatim` `true`. - * - * The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have - * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the - * default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('node:dns').promises; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org').then((addresses) => { - * // ... - * }); - * - * // Alternatively, the same code can be written using async-await style. - * (async function() { - * const addresses = await resolver.resolve4('example.org'); - * })(); - * ``` - * - * The following methods from the `dnsPromises` API are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v10.6.0 - */ - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module "node:dns/promises" { - export * from "dns/promises"; -} diff --git a/node_modules/@types/node/ts4.8/dom-events.d.ts b/node_modules/@types/node/ts4.8/dom-events.d.ts deleted file mode 100644 index 147a7b6..0000000 --- a/node_modules/@types/node/ts4.8/dom-events.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -export {}; // Don't export anything! - -//// DOM-like Events -// NB: The Event / EventTarget / EventListener implementations below were copied -// from lib.dom.d.ts, then edited to reflect Node's documentation at -// https://nodejs.org/api/events.html#class-eventtarget. -// Please read that link to understand important implementation differences. - -// This conditional type will be the existing global Event in a browser, or -// the copy below in a Node environment. -type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {} - : { - /** This is not used in Node.js and is provided purely for completeness. */ - readonly bubbles: boolean; - /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ - cancelBubble: () => void; - /** True if the event was created with the cancelable option */ - readonly cancelable: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly composed: boolean; - /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ - composedPath(): [EventTarget?]; - /** Alias for event.target. */ - readonly currentTarget: EventTarget | null; - /** Is true if cancelable is true and event.preventDefault() has been called. */ - readonly defaultPrevented: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly eventPhase: 0 | 2; - /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ - readonly isTrusted: boolean; - /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ - preventDefault(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - returnValue: boolean; - /** Alias for event.target. */ - readonly srcElement: EventTarget | null; - /** Stops the invocation of event listeners after the current one completes. */ - stopImmediatePropagation(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - stopPropagation(): void; - /** The `EventTarget` dispatching the event */ - readonly target: EventTarget | null; - /** The millisecond timestamp when the Event object was created. */ - readonly timeStamp: number; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; - }; - -// See comment above explaining conditional type -type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {} - : { - /** - * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. - * - * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. - * - * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. - * Specifically, the `capture` option is used as part of the key when registering a `listener`. - * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. - */ - addEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: AddEventListenerOptions | boolean, - ): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: EventListenerOptions | boolean, - ): void; - }; - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ - capture?: boolean; -} - -interface AddEventListenerOptions extends EventListenerOptions { - /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ - once?: boolean; - /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ - passive?: boolean; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -import {} from "events"; // Make this an ambient declaration -declare global { - /** An event which takes place in the DOM. */ - interface Event extends __Event {} - var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T - : { - prototype: __Event; - new(type: string, eventInitDict?: EventInit): __Event; - }; - - /** - * EventTarget is a DOM interface implemented by objects that can - * receive events and may have listeners for them. - */ - interface EventTarget extends __EventTarget {} - var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T - : { - prototype: __EventTarget; - new(): __EventTarget; - }; -} diff --git a/node_modules/@types/node/ts4.8/domain.d.ts b/node_modules/@types/node/ts4.8/domain.d.ts deleted file mode 100644 index 72f17bd..0000000 --- a/node_modules/@types/node/ts4.8/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js) - */ -declare module "domain" { - import EventEmitter = require("node:events"); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and low-level requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('node:domain'); - * const fs = require('node:fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module "node:domain" { - export * from "domain"; -} diff --git a/node_modules/@types/node/ts4.8/events.d.ts b/node_modules/@types/node/ts4.8/events.d.ts deleted file mode 100644 index 6ed47c5..0000000 --- a/node_modules/@types/node/ts4.8/events.d.ts +++ /dev/null @@ -1,879 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js) - */ -declare module "events" { - import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; - // NOTE: This class is in the docs but is **not actually exported** by Node. - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node - // actually starts exporting the class, uncomment below. - // import { EventListener, EventListenerObject } from '__dom-events'; - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ - // interface NodeEventTarget extends EventTarget { - // /** - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. - // */ - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ - // eventNames(): string[]; - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ - // listenerCount(type: string): number; - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ - // off(type: string, listener: EventListener | EventListenerObject): this; - // /** Node.js-specific alias for `eventTarget.addListener()`. */ - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ - // once(type: string, listener: EventListener | EventListenerObject): this; - // /** - // * Node.js-specific extension to the `EventTarget` class. - // * If `type` is specified, removes all registered listeners for `type`, - // * otherwise removes all registered listeners. - // */ - // removeAllListeners(type: string): this; - // /** - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. - // */ - // removeListener(type: string, listener: EventListener | EventListenerObject): this; - // } - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - // Any EventTarget with a Node-style `once` function - interface _NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - // Any EventTarget with a DOM-style `addEventListener` - interface _DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - }, - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `node:events` module: - * - * ```js - * import { EventEmitter } from 'node:events'; - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - - [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void; - - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: _NodeEventTarget, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string, - options?: StaticEventEmitterOptions, - ): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @experimental - * @return Disposable that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_`EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - - export interface EventEmitterReferencingAsyncResource extends AsyncResource { - readonly eventEmitter: EventEmitterAsyncResource; - } - - export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { - /** - * The type of async event, this is required when instantiating `EventEmitterAsyncResource` - * directly rather than as a child class. - * @default new.target.name if instantiated as a child class. - */ - name?: string; - } - - /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that - * require manual async tracking. Specifically, all events emitted by instances - * of `events.EventEmitterAsyncResource` will run within its `async context`. - * - * ```js - * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; - * import { notStrictEqual, strictEqual } from 'node:assert'; - * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; - * - * // Async tracking tooling will identify this as 'Q'. - * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); - * - * // 'foo' listeners will run in the EventEmitters async context. - * ee1.on('foo', () => { - * strictEqual(executionAsyncId(), ee1.asyncId); - * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); - * }); - * - * const ee2 = new EventEmitter(); - * - * // 'foo' listeners on ordinary EventEmitters that do not track async - * // context, however, run in the same async context as the emit(). - * ee2.on('foo', () => { - * notStrictEqual(executionAsyncId(), ee2.asyncId); - * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); - * }); - * - * Promise.resolve().then(() => { - * ee1.emit('foo'); - * ee2.emit('foo'); - * }); - * ``` - * - * The `EventEmitterAsyncResource` class has the same methods and takes the - * same options as `EventEmitter` and `AsyncResource` themselves. - * @since v17.4.0, v16.14.0 - */ - export class EventEmitterAsyncResource extends EventEmitter { - /** - * @param options Only optional in child class. - */ - constructor(options?: EventEmitterAsyncResourceOptions); - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - */ - emitDestroy(): void; - /** - * The unique `asyncId` assigned to the resource. - */ - readonly asyncId: number; - /** - * The same triggerAsyncId that is passed to the AsyncResource constructor. - */ - readonly triggerAsyncId: number; - /** - * The returned `AsyncResource` object has an additional `eventEmitter` property - * that provides a reference to this `EventEmitterAsyncResource`. - */ - readonly asyncResource: EventEmitterReferencingAsyncResource; - } - } - global { - namespace NodeJS { - interface EventEmitter { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void; - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * import { EventEmitter } from 'node:events'; - * class MyEmitter extends EventEmitter {} - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: string | symbol, listener?: Function): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module "node:events" { - import events = require("events"); - export = events; -} diff --git a/node_modules/@types/node/ts4.8/fs.d.ts b/node_modules/@types/node/ts4.8/fs.d.ts deleted file mode 100644 index 5cbca12..0000000 --- a/node_modules/@types/node/ts4.8/fs.d.ts +++ /dev/null @@ -1,4311 +0,0 @@ -/** - * The `node:fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'node:fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'node:fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js) - */ -declare module "fs" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | "buffer" - | { - encoding: "buffer"; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - export interface StatsFsBase { - /** Type of file system. */ - type: T; - /** Optimal transfer block size. */ - bsize: T; - /** Total data blocks in file system. */ - blocks: T; - /** Free blocks in file system. */ - bfree: T; - /** Available blocks for unprivileged users */ - bavail: T; - /** Total file nodes in file system. */ - files: T; - /** Free file nodes in file system. */ - ffree: T; - } - export interface StatsFs extends StatsFsBase {} - /** - * Provides information about a mounted file system. - * - * Objects returned from {@link statfs} and its synchronous counterpart are of - * this type. If `bigint` in the `options` passed to those methods is `true`, the - * numeric values will be `bigint` instead of `number`. - * - * ```console - * StatFs { - * type: 1397114950, - * bsize: 4096, - * blocks: 121938943, - * bfree: 61058895, - * bavail: 61058895, - * files: 999, - * ffree: 1000000 - * } - * ``` - * - * `bigint` version: - * - * ```console - * StatFs { - * type: 1397114950n, - * bsize: 4096n, - * blocks: 121938943n, - * bfree: 61058895n, - * bavail: 61058895n, - * files: 999n, - * ffree: 1000000n - * } - * ``` - * @since v19.6.0, v18.15.0 - */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { - bigint?: boolean | undefined; - } - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - /** - * The base path that this `fs.Dirent` object refers to. - * @since v20.1.0 - */ - path: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be fulfilled after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.FSWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.FSWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "ready", listener: () => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "ready", listener: () => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'node:fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'node:fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * {@link stat} follows symbolic links. Use {@link lstat} to look at the - * links themselves. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'node:fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - }, - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - }, - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - }, - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - }, - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - }, - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( - path: PathLike, - options: - | (StatFsOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, - ): void; - export namespace statfs { - /** - * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. - * @param path A path to an existing file or directory on the file system to be queried. - */ - function __promisify__( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatFsOptions): Promise; - } - /** - * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfsSync( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): StatsFs; - export function statfsSync( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. - * If the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction - * points on NTFS volumes can only point to directories. - * - * Relative targets are relative to the link's parent directory. - * - * ```js - * import { symlink } from 'node:fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - * @param [type='null'] - */ - export function symlink( - target: PathLike, - path: PathLike, - type: symlink.Type | undefined | null, - callback: NoParamCallback, - ): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = "dir" | "file" | "junction"; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - * @param [type='null'] - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..`, and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - function native( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - function native( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created (for instance, if it was previously created). - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. If `recursive` is false and the directory exists, - * an `EEXIST` error occurs. - * - * ```js - * import { mkdir } from 'node:fs'; - * - * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. - * mkdir('./tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'node:fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: Mode | MakeDirectoryOptions | null | undefined, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: Mode | MakeDirectoryOptions | null, - ): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('node:path').sep`). - * - * ```js - * import { tmpdir } from 'node:os'; - * import { mkdtemp } from 'node:fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'node:path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | "buffer" - | { - encoding: "buffer"; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp( - prefix: string, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | "buffer" - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - mode: Mode | undefined | null, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write( - fd: number, - string: string, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - * @return The number of bytes written. - */ - export function writeSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset?: number | null, - length?: number | null, - position?: number | null, - ): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void, - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - * @param [position='null'] - */ - export function readSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset: number, - length: number, - position: ReadPosition | null, - ): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile( - path: PathOrFileDescriptor, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): string | Buffer; - export type WriteFileOptions = - | ( - & ObjectEncodingOptions - & Abortable - & { - mode?: Mode | undefined; - flag?: string | undefined; - flush?: boolean | undefined; - } - ) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'node:fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - callback: NoParamCallback, - ): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__( - file: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'node:fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: StatsListener, - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: BigIntStatsListener, - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | "buffer" | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options?: WatchOptions | BufferEncoding | null, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: WatchOptions | string, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'node:fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won't be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'node:fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'node:fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'node:fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - signal?: AbortSignal | null | undefined; - highWaterMark?: number | undefined; - } - interface FSImplementation { - open?: (...args: any[]) => any; - close?: (...args: any[]) => any; - } - interface CreateReadStreamFSImplementation extends FSImplementation { - read: (...args: any[]) => any; - } - interface CreateWriteStreamFSImplementation extends FSImplementation { - write: (...args: any[]) => any; - writev?: (...args: any[]) => any; - } - interface ReadStreamOptions extends StreamOptions { - fs?: CreateReadStreamFSImplementation | null | undefined; - end?: number | undefined; - } - interface WriteStreamOptions extends StreamOptions { - fs?: CreateWriteStreamFSImplementation | null | undefined; - flush?: boolean | undefined; - } - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'node:fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'node:fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] - */ - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @param [position='null'] - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - */ - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - - export interface OpenAsBlobOptions { - /** - * An optional mime type for the blob. - * - * @default 'undefined' - */ - type?: string | undefined; - } - - /** - * Returns a `Blob` whose data is backed by the given file. - * - * The file must not be modified after the `Blob` is created. Any modifications - * will cause reading the `Blob` data to fail with a `DOMException` error. - * Synchronous stat operations on the file when the `Blob` is created, and before - * each read in order to detect whether the file data has been modified on disk. - * - * ```js - * import { openAsBlob } from 'node:fs'; - * - * const blob = await openAsBlob('the.file.txt'); - * const ab = await blob.arrayBuffer(); - * blob.stream(); - * ``` - * @since v19.8.0 - * @experimental - */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - - export interface OpenDirOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - /** - * @default false - */ - recursive?: boolean; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( - path: PathLike, - options: OpenDirOptions, - cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, - ): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} - */ - mode?: number; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp( - source: string | URL, - destination: string | URL, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - export function cp( - source: string | URL, - destination: string | URL, - opts: CopyOptions, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; -} -declare module "node:fs" { - export * from "fs"; -} diff --git a/node_modules/@types/node/ts4.8/fs/promises.d.ts b/node_modules/@types/node/ts4.8/fs/promises.d.ts deleted file mode 100644 index 88a9fc3..0000000 --- a/node_modules/@types/node/ts4.8/fs/promises.d.ts +++ /dev/null @@ -1,1239 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module "fs/promises" { - import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; - import { - BigIntStats, - BigIntStatsFs, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatFsOptions, - StatOptions, - Stats, - StatsFs, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T | null; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - flush?: boolean | undefined; - } - interface ReadableWebStreamOptions { - /** - * Whether to open a normal or a `'bytes'` stream. - * @since v20.0.0 - */ - type?: "bytes" | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read( - buffer: T, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called - * after the `FileHandle` is closed or closing. - * - * ```js - * import { - * open, - * } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not - * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. - * @since v17.0.0 - * @experimental - */ - readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. - * See `filehandle.createReadStream()` for the options. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * @since v18.11.0 - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - }, - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is fulfilled with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Write `buffer` to the file. - * - * The promise is fulfilled with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param offset The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current - * position. See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is fulfilled with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be fulfilled (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - /** - * An alias for {@link FileHandle.close()}. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - const constants: typeof fsConstants; - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is fulfilled with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access, constants } from 'node:fs/promises'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { copyFile, constants } from 'node:fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * - * ```js - * import { mkdir } from 'node:fs/promises'; - * - * try { - * const projectFolder = new URL('./test/project/', import.meta.url); - * const createDir = await mkdir(projectFolder, { recursive: true }); - * - * console.log(`created ${createDir}`); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'node:fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * fulfilled with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will - * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not - * exist, `'file'` will be used. Windows junction points require the destination - * path to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. Junction points on NTFS volumes - * can only point to directories. - * @since v10.0.0 - * @param [type='null'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v19.6.0, v18.15.0 - * @return Fulfills with the {fs.StatFs} object for the given `path`. - */ - function statfs( - path: PathLike, - opts?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function statfs( - path: PathLike, - opts: StatFsOptions & { - bigint: true; - }, - ): Promise; - function statfs(path: PathLike, opts?: StatFsOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath( - path: PathLike, - options?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs/promises'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * try { - * await mkdtemp(join(tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('node:path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the file system path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs/promises'; - * import { Buffer } from 'node:buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: - | string - | NodeJS.ArrayBufferView - | Iterable - | AsyncIterable - | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile( - path: PathLike | FileHandle, - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * An example of reading a `package.json` file located in the same directory of the - * running code: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * try { - * const filePath = new URL('./package.json', import.meta.url); - * const contents = await readFile(filePath, { encoding: 'utf8' }); - * console.log(contents); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ( - & ObjectEncodingOptions - & Abortable - & { - flag?: OpenMode | undefined; - } - ) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('node:fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch( - filename: PathLike, - options: WatchOptions | string, - ): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; -} -declare module "node:fs/promises" { - export * from "fs/promises"; -} diff --git a/node_modules/@types/node/ts4.8/globals.d.ts b/node_modules/@types/node/ts4.8/globals.d.ts deleted file mode 100644 index 5f25006..0000000 --- a/node_modules/@types/node/ts4.8/globals.d.ts +++ /dev/null @@ -1,411 +0,0 @@ -export {}; // Make this a module - -// #region Fetch and friends -// Conditional type aliases, used at the end of this file. -// Will either be empty if lib-dom is included, or the undici version otherwise. -type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; -type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; -type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; -type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; -type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; -type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").ResponseInit; -type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File; -// #endregion Fetch and friends - -declare global { - // Declare "static" methods in Error - interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; - } - - /*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - - // For backwards compability - interface NodeRequire extends NodeJS.Require {} - interface RequireResolve extends NodeJS.RequireResolve {} - interface NodeModule extends NodeJS.Module {} - - var process: NodeJS.Process; - var console: Console; - - var __filename: string; - var __dirname: string; - - var require: NodeRequire; - var module: NodeModule; - - // Same as module.exports - var exports: any; - - /** - * Only available if `--expose-gc` is passed to the process. - */ - var gc: undefined | (() => void); - - // #region borrowed - // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib - /** A controller object that allows you to abort one or more DOM requests as and when desired. */ - interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; - } - - /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ - interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; - } - - var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - - var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - }; - // #endregion borrowed - - // #region Disposable - interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; - - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; - } - - interface Disposable { - [Symbol.dispose](): void; - } - - interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; - } - // #endregion Disposable - - // #region ArrayLike.at() - interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; - } - interface String extends RelativeIndexable {} - interface Array extends RelativeIndexable {} - interface ReadonlyArray extends RelativeIndexable {} - interface Int8Array extends RelativeIndexable {} - interface Uint8Array extends RelativeIndexable {} - interface Uint8ClampedArray extends RelativeIndexable {} - interface Int16Array extends RelativeIndexable {} - interface Uint16Array extends RelativeIndexable {} - interface Int32Array extends RelativeIndexable {} - interface Uint32Array extends RelativeIndexable {} - interface Float32Array extends RelativeIndexable {} - interface Float64Array extends RelativeIndexable {} - interface BigInt64Array extends RelativeIndexable {} - interface BigUint64Array extends RelativeIndexable {} - // #endregion ArrayLike.at() end - - /** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ - function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, - ): T; - - /*----------------------------------------------* - * * - * GLOBAL INTERFACES * - * * - *-----------------------------------------------*/ - namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - - /** - * is this an async call (i.e. await, Promise.all(), or Promise.any())? - */ - isAsync(): boolean; - - /** - * is this an async call to Promise.all()? - */ - isPromiseAll(): boolean; - - /** - * returns the index of the promise element that was followed in - * Promise.all() or Promise.any() for async stack traces, or null - * if the CallSite is not an async - */ - getPromiseIndex(): number | null; - - getScriptNameOrSourceURL(): string; - getScriptHash(): string; - - getEnclosingColumnNumber(): number; - getEnclosingLineNumber(): number; - getPosition(): number; - - toString(): string; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } - } - - interface RequestInit extends _RequestInit {} - - function fetch( - input: string | URL | globalThis.Request, - init?: RequestInit, - ): Promise; - - interface Request extends _Request {} - var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; - } ? T - : typeof import("undici-types").Request; - - interface ResponseInit extends _ResponseInit {} - - interface Response extends _Response {} - var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; - } ? T - : typeof import("undici-types").Response; - - interface FormData extends _FormData {} - var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; - } ? T - : typeof import("undici-types").FormData; - - interface Headers extends _Headers {} - var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; - } ? T - : typeof import("undici-types").Headers; - - interface File extends _File {} - var File: typeof globalThis extends { - onmessage: any; - File: infer T; - } ? T - : typeof import("node:buffer").File; -} diff --git a/node_modules/@types/node/ts4.8/globals.global.d.ts b/node_modules/@types/node/ts4.8/globals.global.d.ts deleted file mode 100644 index ef1198c..0000000 --- a/node_modules/@types/node/ts4.8/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/node_modules/@types/node/ts4.8/http.d.ts b/node_modules/@types/node/ts4.8/http.d.ts deleted file mode 100644 index 710fe59..0000000 --- a/node_modules/@types/node/ts4.8/http.d.ts +++ /dev/null @@ -1,1887 +0,0 @@ -/** - * To use the HTTP server and client one must `require('node:http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```json - * { "content-length": "123", - * "content-type": "text/plain", - * "connection": "keep-alive", - * "host": "example.com", - * "accept": "*" } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js) - */ -declare module "http" { - import * as stream from "node:stream"; - import { URL } from "node:url"; - import { LookupOptions } from "node:dns"; - import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - "accept-language"?: string | undefined; - "accept-patch"?: string | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - "alt-svc"?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - connection?: string | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-type"?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - "proxy-authenticate"?: string | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | undefined; - "sec-websocket-version"?: string | undefined; - "set-cookie"?: string[] | undefined; - "strict-transport-security"?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - upgrade?: string | undefined; - "user-agent"?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - "www-authenticate"?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict { - accept?: string | string[] | undefined; - "accept-charset"?: string | string[] | undefined; - "accept-encoding"?: string | string[] | undefined; - "accept-language"?: string | string[] | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - "cdn-cache-control"?: string | undefined; - connection?: string | string[] | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | number | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-security-policy"?: string | undefined; - "content-security-policy-report-only"?: string | undefined; - cookie?: string | string[] | undefined; - dav?: string | string[] | undefined; - dnt?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-range"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - link?: string | string[] | undefined; - location?: string | undefined; - "max-forwards"?: string | undefined; - origin?: string | undefined; - prgama?: string | string[] | undefined; - "proxy-authenticate"?: string | string[] | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - "public-key-pins-report-only"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "referrer-policy"?: string | undefined; - refresh?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | string[] | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | string[] | undefined; - "sec-websocket-version"?: string | undefined; - server?: string | undefined; - "set-cookie"?: string | string[] | undefined; - "strict-transport-security"?: string | undefined; - te?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - "user-agent"?: string | undefined; - upgrade?: string | undefined; - "upgrade-insecure-requests"?: string | undefined; - vary?: string | undefined; - via?: string | string[] | undefined; - warning?: string | undefined; - "www-authenticate"?: string | string[] | undefined; - "x-content-type-options"?: string | undefined; - "x-dns-prefetch-control"?: string | undefined; - "x-frame-options"?: string | undefined; - "x-xss-protection"?: string | undefined; - } - interface ClientRequestArgs { - _defaultAgent?: Agent | undefined; - agent?: Agent | boolean | undefined; - auth?: string | null | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: - | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) - | undefined; - defaultPort?: number | string | undefined; - family?: number | undefined; - headers?: OutgoingHttpHeaders | undefined; - hints?: LookupOptions["hints"]; - host?: string | null | undefined; - hostname?: string | null | undefined; - insecureHTTPParser?: boolean | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - lookup?: LookupFunction | undefined; - /** - * @default 16384 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - port?: number | string | null | undefined; - protocol?: string | null | undefined; - setHost?: boolean | undefined; - signal?: AbortSignal | undefined; - socketPath?: string | undefined; - timeout?: number | undefined; - uniqueHeaders?: Array | undefined; - joinDuplicateHeaders?: boolean; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > { - /** - * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. - */ - IncomingMessage?: Request | undefined; - /** - * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. - */ - ServerResponse?: Response | undefined; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @see Server.requestTimeout for more information. - * @default 300000 - * @since v18.0.0 - */ - requestTimeout?: number | undefined; - /** - * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. - * @default false - * @since v18.14.0 - */ - joinDuplicateHeaders?: boolean; - /** - * The number of milliseconds of inactivity a server needs to wait for additional incoming data, - * after it has finished writing the last response, before a socket will be destroyed. - * @see Server.keepAliveTimeout for more information. - * @default 5000 - * @since v18.0.0 - */ - keepAliveTimeout?: number | undefined; - /** - * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. - * @default 30000 - */ - connectionsCheckingInterval?: number | undefined; - /** - * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. - * Default: @see stream.getDefaultHighWaterMark(). - * @since v20.1.0 - */ - highWaterMark?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 16384 - * @since v13.3.0 - */ - maxHeaderSize?: number | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default true - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * A list of response headers that should be sent only once. - * If the header's value is an array, the items will be joined using `; `. - */ - uniqueHeaders?: Array | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request - * or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from - * the perspective of the participants of an HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Alias of `outgoingMessage.socket`. - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value. If the header already exists in the to-be-sent - * headers, its value will be replaced. Use an array of strings to send multiple - * headers with the same name. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | readonly string[]): this; - /** - * Append a single header value for the header object. - * - * If the value is an array, this is equivalent of calling this method multiple - * times. - * - * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`. - * - * Depending of the value of `options.uniqueHeaders` when the client request or the - * server were created, this will end up in the header being sent multiple times or - * a single time with values joined using `; `. - * @since v18.3.0, v16.17.0 - * @param name Header name - * @param value Header value - */ - appendHeader(name: string, value: string | readonly string[]): this; - /** - * Gets the value of the HTTP header with the given name. If that header is not - * set, the returned value will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript `Object`. This means that - * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers will **only** be emitted if the message is chunked encoded. If not, - * the trailers will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header field names in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Flushes the message headers. - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - /** - * If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal. - * Mismatching the `Content-Length` header value will result - * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * @since v18.10.0, v16.18.0 - */ - strictContentLength: boolean; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics', - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }, earlyHintsCallback); - * ``` - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain', - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * will check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a \[`Error`\]\[\] being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown, - * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * - * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * import http from 'node:http'; - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * import http from 'node:http'; - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "continue", listener: () => void): this; - on(event: "information", listener: (info: InformationEvent) => void): this; - on(event: "response", listener: (response: IncomingMessage) => void): this; - on(event: "socket", listener: (socket: Socket) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "continue", listener: () => void): this; - once(event: "information", listener: (info: InformationEvent) => void): this; - once(event: "response", listener: (response: IncomingMessage) => void): this; - once(event: "socket", listener: (socket: Socket) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers, and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST', - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * To allow duplicate values of the headers listed above to be joined, - * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more - * information. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with `; `. - * * For all other headers, the values are joined together with `, `. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * Similar to `message.headers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': ['curl/7.22.0'], - * // host: ['127.0.0.1:8000'], - * // accept: ['*'] } - * console.log(request.headersDistinct); - * ``` - * @since v18.3.0, v16.17.0 - */ - headersDistinct: NodeJS.Dict; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * Similar to `message.trailers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * Only populated at the `'end'` event. - * @since v18.3.0, v16.17.0 - */ - trailersDistinct: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.headers.host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.headers.host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: "fifo" | "lifo" | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false, // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent extends EventEmitter { - /** - * By default set to 256. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer(); - * - * // Listen to the request event - * server.on('request', (request, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import http from 'node:http'; - * import { Buffer } from 'node:buffer'; - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!', - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData), - * }, - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'` - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to - * consume the response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called. - * - * Passing illegal value as `name` will result in a `TypeError` being thrown, - * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Example: - * - * ```js - * import { validateHeaderName } from 'node:http'; - * - * try { - * validateHeaderName(''); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' - * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' - * } - * ``` - * @since v14.3.0 - * @param [label='Header name'] Label for error message. - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called. - * - * Passing illegal value as `value` will result in a `TypeError` being thrown. - * - * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Examples: - * - * ```js - * import { validateHeaderValue } from 'node:http'; - * - * try { - * validateHeaderValue('x-my-header', undefined); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true - * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' - * } - * - * try { - * validateHeaderValue('x-my-header', 'oʊmɪɡə'); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true - * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' - * } - * ``` - * @since v14.3.0 - * @param name Header name - * @param value Header value - */ - function validateHeaderValue(name: string, value: string): void; - /** - * Set the maximum number of idle HTTP parsers. - * @since v18.8.0, v16.18.0 - * @param [max=1000] - */ - function setMaxIdleHTTPParsers(max: number): void; - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module "node:http" { - export * from "http"; -} diff --git a/node_modules/@types/node/ts4.8/http2.d.ts b/node_modules/@types/node/ts4.8/http2.d.ts deleted file mode 100644 index c3b3e8e..0000000 --- a/node_modules/@types/node/ts4.8/http2.d.ts +++ /dev/null @@ -1,2382 +0,0 @@ -/** - * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. - * It can be accessed using: - * - * ```js - * const http2 = require('node:http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http2.js) - */ -declare module "http2" { - import EventEmitter = require("node:events"); - import * as fs from "node:fs"; - import * as net from "node:net"; - import * as stream from "node:stream"; - import * as tls from "node:tls"; - import * as url from "node:url"; - import { - IncomingHttpHeaders as Http1IncomingHttpHeaders, - IncomingMessage, - OutgoingHttpHeaders, - ServerResponse, - } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { - ":status"?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string | undefined; - ":method"?: string | undefined; - ":authority"?: string | undefined; - ":scheme"?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session | undefined; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('node:http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream( - headers: OutgoingHttpHeaders, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - pushStream( - headers: OutgoingHttpHeaders, - options?: StreamPriorityOptions, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - /** - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * Initiates a response. When the `options.waitForTrailers` option is set, the`'wantTrailers'` event will be emitted immediately after queuing the last chunk - * of payload data to be sent. The `http2stream.sendTrailers()` method can then be - * used to sent trailing header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD( - fd: number | fs.promises.FileHandle, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptions, - ): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.error(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile( - path: string, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptionsWithError, - ): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping( - payload: NodeJS.ArrayBufferView, - callback: (err: Error | null, duration: number, payload: Buffer) => void, - ): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('node:http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings( - settings: Settings, - callback?: (err: Error | null, settings: Settings, duration: number) => void, - ): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('node:http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS, - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: readonly string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('node:http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('node:http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('node:http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: "http:" | "https:" | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions extends ServerSessionOptions {} - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - options: stream.ReadableOptions, - rawHeaders: readonly string[], - ); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 `request` object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('node:http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ""; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | readonly string[]): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `node:http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }); - * ``` - * @since v18.11.0 - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse( - headers: OutgoingHttpHeaders, - callback: (err: Error | null, res: Http2ServerResponse) => void, - ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('node:http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('node:http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8000); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - export function createServer( - options: ServerOptions, - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('node:http2'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8443); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - export function createSecureServer( - options: SecureServerOptions, - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('node:http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect( - authority: string | url.URL, - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; -} -declare module "node:http2" { - export * from "http2"; -} diff --git a/node_modules/@types/node/ts4.8/https.d.ts b/node_modules/@types/node/ts4.8/https.d.ts deleted file mode 100644 index 36ae5b2..0000000 --- a/node_modules/@types/node/ts4.8/https.d.ts +++ /dev/null @@ -1,550 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js) - */ -declare module "https" { - import { Duplex } from "node:stream"; - import * as tls from "node:tls"; - import * as http from "node:http"; - import { URL } from "node:url"; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = - & http.RequestOptions - & tls.SecureContextOptions - & { - checkServerIdentity?: typeof tls.checkServerIdentity | undefined; - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { - req: InstanceType; - }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: "request", listener: http.RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: "request", listener: http.RequestListener): this; - once(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('node:https'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('node:https'); - * const fs = require('node:fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample', - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('node:https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false, - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('node:tls'); - * const https = require('node:https'); - * const crypto = require('node:crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha256 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('node:https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module "node:https" { - export * from "https"; -} diff --git a/node_modules/@types/node/ts4.8/index.d.ts b/node_modules/@types/node/ts4.8/index.d.ts deleted file mode 100644 index 7c8b38c..0000000 --- a/node_modules/@types/node/ts4.8/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 4.8 and earlier. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/node_modules/@types/node/ts4.8/inspector.d.ts b/node_modules/@types/node/ts4.8/inspector.d.ts deleted file mode 100644 index 3927b81..0000000 --- a/node_modules/@types/node/ts4.8/inspector.d.ts +++ /dev/null @@ -1,2747 +0,0 @@ -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * - * It can be accessed using: - * - * ```js - * import * as inspector from 'node:inspector/promises'; - * ``` - * - * or - * - * ```js - * import * as inspector from 'node:inspector'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - * @since v8.0.0 - */ - connect(): void; - /** - * Immediately close the session. All pending message callbacks will be called - * with an error. `session.connect()` will need to be called to be able to send - * messages again. Reconnected session will lose all inspector state, such as - * enabled agents or configured breakpoints. - * @since v8.0.0 - */ - disconnect(): void; - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Collect type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - // Events - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -/** - * The inspector module provides an API for interacting with the V8 inspector. - */ -declare module 'node:inspector' { - import inspector = require('inspector'); - export = inspector; -} diff --git a/node_modules/@types/node/ts4.8/module.d.ts b/node_modules/@types/node/ts4.8/module.d.ts deleted file mode 100644 index c38a9b8..0000000 --- a/node_modules/@types/node/ts4.8/module.d.ts +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @since v0.3.7 - * @experimental - */ -declare module "module" { - import { URL } from "node:url"; - import { MessagePort } from "node:worker_threads"; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('node:fs'); - * const assert = require('node:assert'); - * const { syncBuiltinESMExports } = require('node:module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('node:fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - interface SourceOrigin { - /** - * The name of the range in the source map, if one was provided - */ - name?: string; - /** - * The file name of the original source, as reported in the SourceMap - */ - fileName: string; - /** - * The 1-indexed lineNumber of the corresponding call site in the original source - */ - lineNumber: number; - /** - * The 1-indexed columnNumber of the corresponding call site in the original source - */ - columnNumber: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line offset and column offset in the generated source - * file, returns an object representing the SourceMap range in the - * original file if found, or an empty object if not. - * - * The object returned contains the following keys: - * - * The returned value represents the raw range as it appears in the - * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and - * column numbers as they appear in Error messages and CallSite - * objects. - * - * To get the corresponding 1-indexed line and column numbers from a - * lineNumber and columnNumber as they are reported by Error stacks - * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` - * @param lineOffset The zero-indexed line number offset in the generated source - * @param columnOffset The zero-indexed column number offset in the generated source - */ - findEntry(lineOffset: number, columnOffset: number): SourceMapping; - /** - * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, - * find the corresponding call site location in the original source. - * - * If the `lineNumber` and `columnNumber` provided are not found in any source map, - * then an empty object is returned. - * @param lineNumber The 1-indexed line number of the call site in the generated source - * @param columnNumber The 1-indexed column number of the call site in the generated source - */ - findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; - } - /** @deprecated Use `ImportAttributes` instead */ - interface ImportAssertions extends ImportAttributes {} - interface ImportAttributes extends NodeJS.Dict { - type?: string | undefined; - } - type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; - type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; - interface GlobalPreloadContext { - port: MessagePort; - } - /** - * @deprecated This hook will be removed in a future version. - * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. - * - * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. - * This hook allows the return of a string that is run as a sloppy-mode script on startup. - * - * @param context Information to assist the preload code - * @return Code to run before application startup - */ - type GlobalPreloadHook = (context: GlobalPreloadContext) => string; - /** - * The `initialize` hook provides a way to define a custom function that runs in the hooks thread - * when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`. - * - * This hook can receive data from a `register` invocation, including ports and other transferrable objects. - * The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes. - */ - type InitializeHook = (data: Data) => void | Promise; - interface ResolveHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions: ImportAttributes; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - /** - * The module importing this one, or undefined if this is the Node.js entry point - */ - parentURL: string | undefined; - } - interface ResolveFnOutput { - /** - * A hint to the load hook (it might be ignored) - */ - format?: ModuleFormat | null | undefined; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions?: ImportAttributes | undefined; - /** - * The import attributes to use when caching the module (optional; if excluded the input will be used) - */ - importAttributes?: ImportAttributes | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The absolute URL to which this input resolves - */ - url: string; - } - /** - * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. - * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); - * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. - * - * @param specifier The specified URL path of the module to be resolved - * @param context - * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook - */ - type ResolveHook = ( - specifier: string, - context: ResolveHookContext, - nextResolve: ( - specifier: string, - context?: ResolveHookContext, - ) => ResolveFnOutput | Promise, - ) => ResolveFnOutput | Promise; - interface LoadHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * The format optionally supplied by the `resolve` hook chain - */ - format: ModuleFormat; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions: ImportAttributes; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - } - interface LoadFnOutput { - format: ModuleFormat; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The source for Node.js to evaluate - */ - source?: ModuleSource; - } - /** - * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. - * It is also in charge of validating the import assertion. - * - * @param url The URL/path of the module to be loaded - * @param context Metadata about the module - * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook - */ - type LoadHook = ( - url: string, - context: LoadHookContext, - nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise, - ) => LoadFnOutput | Promise; - } - interface RegisterOptions { - parentURL: string | URL; - data?: Data | undefined; - transferList?: any[] | undefined; - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static isBuiltin(moduleName: string): boolean; - static Module: typeof Module; - static register( - specifier: string | URL, - parentURL?: string | URL, - options?: RegisterOptions, - ): void; - static register(specifier: string | URL, options?: RegisterOptions): void; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - /** - * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. - * **Caveat:** only present on `file:` modules. - */ - dirname: string; - /** - * The full absolute path and filename of the current module, with symlinks resolved. - * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. - * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. - */ - filename: string; - /** - * The absolute `file:` URL of the module. - */ - url: string; - /** - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * Second `parent` parameter is only used when the `--experimental-import-meta-resolve` - * command flag enabled. - * - * @since v20.6.0 - * - * @param specifier The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. - * @returns The absolute (`file:`) URL string for the resolved module. - */ - resolve(specifier: string, parent?: string | URL | undefined): string; - } - } - export = Module; -} -declare module "node:module" { - import module = require("module"); - export = module; -} diff --git a/node_modules/@types/node/ts4.8/net.d.ts b/node_modules/@types/node/ts4.8/net.d.ts deleted file mode 100644 index 9af5e3d..0000000 --- a/node_modules/@types/node/ts4.8/net.d.ts +++ /dev/null @@ -1,949 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `node:net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('node:net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js) - */ -declare module "net" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import * as dns from "node:dns"; - type LookupFunction = ( - hostname: string, - options: dns.LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, - ) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamily?: boolean | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamilyAttemptTimeout?: number | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. - * If the socket is still writable it implicitly calls `socket.end()`. - * @since v0.3.4 - */ - destroySoon(): void; - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. - * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. - * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0, v16.17.0 - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` - * and it is an array of the addresses that have been attempted. - * - * Each address is a string in the form of `$IP:$PORT`. - * If the connection was successful, then the last address is the one that the socket is currently connected to. - * @since v19.4.0 - */ - readonly autoSelectFamilyAttemptedAddresses: string[]; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting - * (see `socket.connecting`). - * @since v11.2.0, v10.16.0 - */ - readonly pending: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0, v16.18.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * The socket timeout in milliseconds as set by `socket.setTimeout()`. - * It is `undefined` if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. ready - * 9. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "data", listener: (data: Buffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", hadError: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "data", data: Buffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (hadError: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "data", listener: (data: Buffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (hadError: boolean) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: Buffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "data", listener: (data: Buffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "data", listener: (data: Buffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.error('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - readonly listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; - /** - * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } - type IPVersion = "ipv4" | "ipv6"; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('node:net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```bash - * telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```bash - * nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. - * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. - * @since v19.4.0 - */ - function getDefaultAutoSelectFamily(): boolean; - /** - * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. - * @since v19.4.0 - */ - function setDefaultAutoSelectFamily(value: boolean): void; - /** - * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250`. - * @since v19.8.0 - */ - function getDefaultAutoSelectFamilyAttemptTimeout(): number; - /** - * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @since v19.8.0 - */ - function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module "node:net" { - export * from "net"; -} diff --git a/node_modules/@types/node/ts4.8/os.d.ts b/node_modules/@types/node/ts4.8/os.d.ts deleted file mode 100644 index 39a33f7..0000000 --- a/node_modules/@types/node/ts4.8/os.d.ts +++ /dev/null @@ -1,478 +0,0 @@ -/** - * The `node:os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('node:os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js) - */ -declare module "os" { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T | null; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20, - * }, - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * - * `os.cpus().length` should not be used to calculate the amount of parallelism - * available to an application. Use {@link availableParallelism} for this purpose. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns an estimate of the default amount of parallelism a program should use. - * Always returns a value greater than zero. - * - * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). - * @since v19.4.0, v18.14.0 - */ - function availableParallelism(): number; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: "buffer" }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`,`'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, - * and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0, v16.18.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): "BE" | "LE"; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module "node:os" { - export * from "os"; -} diff --git a/node_modules/@types/node/ts4.8/path.d.ts b/node_modules/@types/node/ts4.8/path.d.ts deleted file mode 100644 index 6f07681..0000000 --- a/node_modules/@types/node/ts4.8/path.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} -/** - * The `node:path` module provides utilities for working with file and directory - * paths. It can be accessed using: - * - * ```js - * const path = require('node:path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js) - */ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); - export = path; -} -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); - export = path; -} diff --git a/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/node_modules/@types/node/ts4.8/perf_hooks.d.ts deleted file mode 100644 index c0ce852..0000000 --- a/node_modules/@types/node/ts4.8/perf_hooks.d.ts +++ /dev/null @@ -1,645 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) - * - * ```js - * const { PerformanceObserver, performance } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js) - */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; - type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net"; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - toJSON(): any; - } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: "mark"; - } - /** - * Exposes measures created via the `Performance.measure()` method. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: "measure"; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = ( - util1?: EventLoopUtilization, - util2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only the named measure. - * @param name - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - * @return The PerformanceMark entry that was created - */ - mark(name?: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver, - * } = require('node:perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: readonly EntryType[]; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from `other` to this histogram. - * @since v17.4.0, v16.14.0 - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('node:perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { performance as _performance } from "perf_hooks"; - global { - /** - * `performance` is a global reference for `require('perf_hooks').performance` - * https://nodejs.org/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } -} -declare module "node:perf_hooks" { - export * from "perf_hooks"; -} diff --git a/node_modules/@types/node/ts4.8/process.d.ts b/node_modules/@types/node/ts4.8/process.d.ts deleted file mode 100644 index d22308f..0000000 --- a/node_modules/@types/node/ts4.8/process.d.ts +++ /dev/null @@ -1,1561 +0,0 @@ -declare module "process" { - import * as tty from "node:tty"; - import { Worker } from "node:worker_threads"; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = - | "aix" - | "android" - | "darwin" - | "freebsd" - | "haiku" - | "linux" - | "openbsd" - | "sunos" - | "win32" - | "cygwin" - | "netbsd"; - type Architecture = - | "arm" - | "arm64" - | "ia32" - | "mips" - | "mipsel" - | "ppc" - | "ppc64" - | "riscv64" - | "s390" - | "s390x" - | "x64"; - type Signals = - | "SIGABRT" - | "SIGALRM" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINT" - | "SIGIO" - | "SIGIOT" - | "SIGKILL" - | "SIGPIPE" - | "SIGPOLL" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGUNUSED" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ" - | "SIGBREAK" - | "SIGLOST" - | "SIGINFO"; - type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'node:process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'node:process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```bash - * node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```bash - * node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'node:process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'node:process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'node:process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information', - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'node:process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```bash - * node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'node:process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'node:process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread's `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner - * unlike the main thread. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'node:process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'node:process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'node:process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. - * @since v20.7.0 - * @experimental - */ - readonly sourceMapsEnabled: boolean; - /** - * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for - * stack traces. - * - * It provides same features as launching Node.js process with commandline options`--enable-source-maps`. - * - * Only source maps in JavaScript files that are loaded after source maps has been - * enabled will be parsed and loaded. - * @since v16.6.0, v14.18.0 - * @experimental - */ - setSourceMapsEnabled(value: boolean): void; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'node:process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'node:process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '20.2.0', - * acorn: '8.8.2', - * ada: '2.4.0', - * ares: '1.19.0', - * base64: '0.5.0', - * brotli: '1.0.9', - * cjs_module_lexer: '1.2.2', - * cldr: '43.0', - * icu: '73.1', - * llhttp: '8.1.0', - * modules: '115', - * napi: '8', - * nghttp2: '1.52.0', - * nghttp3: '0.7.0', - * ngtcp2: '0.8.1', - * openssl: '3.0.8+quic', - * simdutf: '3.2.9', - * tz: '2023c', - * undici: '5.22.0', - * unicode: '15.0', - * uv: '1.44.2', - * uvwasi: '0.0.16', - * v8: '11.3.244.8-node.9', - * zlib: '1.2.13' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns a frozen `Object` containing the - * JavaScript representation of the configure options used to compile the current - * Node.js executable. This is the same as the `config.gypi` file that was produced - * when running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'node:process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'node:process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'node:process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'node:process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'node:process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * Gets the amount of memory available to the process (in bytes) based on - * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `undefined` is returned. - * - * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more - * information. - * @since v19.6.0, v18.15.0 - * @experimental - */ - constrainedMemory(): number | undefined; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'node:process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'node:process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Hydrogen', - * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. - * If no IPC channel exists, this property is undefined. - * @since v7.1.0 - */ - channel?: { - /** - * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before. - * @since v7.1.0 - */ - ref(): void; - /** - * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open. - * @since v7.1.0 - */ - unref(): void; - }; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void, - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'node:process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'node:process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; - } - } - } - export = process; -} -declare module "node:process" { - import process = require("process"); - export = process; -} diff --git a/node_modules/@types/node/ts4.8/punycode.d.ts b/node_modules/@types/node/ts4.8/punycode.d.ts deleted file mode 100644 index d2fc9f9..0000000 --- a/node_modules/@types/node/ts4.8/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js) - */ -declare module "punycode" { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: readonly number[]): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module "node:punycode" { - export * from "punycode"; -} diff --git a/node_modules/@types/node/ts4.8/querystring.d.ts b/node_modules/@types/node/ts4.8/querystring.d.ts deleted file mode 100644 index b36ea2c..0000000 --- a/node_modules/@types/node/ts4.8/querystring.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * The `node:querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('node:querystring'); - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical or - * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js) - */ -declare module "querystring" { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends - NodeJS.Dict< - | string - | number - | boolean - | readonly string[] - | readonly number[] - | readonly boolean[] - | null - > - {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```json - * { - * "foo": "bar", - * "abc": ["xyz", "123"] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module "node:querystring" { - export * from "querystring"; -} diff --git a/node_modules/@types/node/ts4.8/readline.d.ts b/node_modules/@types/node/ts4.8/readline.d.ts deleted file mode 100644 index b06d58b..0000000 --- a/node_modules/@types/node/ts4.8/readline.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * The `node:readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `node:readline`module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js) - */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' '), - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0, v14.17.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * An error will be thrown if calling `rl.question()` after `rl.close()`. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( - line: string, - callback: (err?: null | Error, result?: CompleterResult) => void, - ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('node:readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without - * waiting for user input, call `process.stdin.unref()`. - * @since v0.1.98 - */ - export function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('node:readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ', - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('node:fs'); - * const readline = require('node:readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity, - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('node:fs'); - * const readline = require('node:readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('node:events'); - * const { createReadStream } = require('node:fs'); - * const { createInterface } = require('node:readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module "node:readline" { - export * from "readline"; -} diff --git a/node_modules/@types/node/ts4.8/readline/promises.d.ts b/node_modules/@types/node/ts4.8/readline/promises.d.ts deleted file mode 100644 index 73fb111..0000000 --- a/node_modules/@types/node/ts4.8/readline/promises.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @since v17.0.0 - * @experimental - */ -declare module "readline/promises" { - import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline"; - import { Abortable } from "node:events"; - /** - * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v17.0.0 - */ - class Interface extends _Interface { - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * If the question is called after `rl.close()`, it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an `AbortSignal` to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * @since v17.0.0 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @return A promise that is fulfilled with the user's input in response to the `query`. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - /** - * @since v17.0.0 - */ - class Readline { - /** - * @param stream A TTY stream. - */ - constructor( - stream: NodeJS.WritableStream, - options?: { - autoCommit?: boolean; - }, - ); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an - * action that clears current line of the associated `stream` in a specified - * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an - * action that clears the associated stream from the current position of the - * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated`stream` and clears the internal list of pending actions. - * @since v17.0.0 - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action - * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an - * action that moves the cursor _relative_ to its current position in the - * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. - * @since v17.0.0 - * @return this - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback` methods clears the internal list of pending actions without - * sending it to the associated `stream`. - * @since v17.0.0 - * @return this - */ - rollback(): this; - } - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface`instance. - * - * ```js - * const readlinePromises = require('node:readline/promises'); - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case - * is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * @since v17.0.0 - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module "node:readline/promises" { - export * from "readline/promises"; -} diff --git a/node_modules/@types/node/ts4.8/repl.d.ts b/node_modules/@types/node/ts4.8/repl.d.ts deleted file mode 100644 index 6c5f81b..0000000 --- a/node_modules/@types/node/ts4.8/repl.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -/** - * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation - * that is available both as a standalone program or includible in other - * applications. It can be accessed using: - * - * ```js - * const repl = require('node:repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js) - */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; - import { InspectOptions } from "node:util"; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = ( - this: REPLServer, - evalCmd: string, - context: Context, - file: string, - cb: (err: Error | null, result: any) => void, - ) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('node:repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('node:repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * }, - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('node:repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module "node:repl" { - export * from "repl"; -} diff --git a/node_modules/@types/node/ts4.8/stream.d.ts b/node_modules/@types/node/ts4.8/stream.d.ts deleted file mode 100644 index 947a019..0000000 --- a/node_modules/@types/node/ts4.8/stream.d.ts +++ /dev/null @@ -1,1701 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `node:stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `node:stream` module: - * - * ```js - * const stream = require('node:stream'); - * ``` - * - * The `node:stream` module is useful for creating new types of stream instances. - * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/stream.js) - */ -declare module "stream" { - import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamConsumers from "node:stream/consumers"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, - ): T; - } - import Stream = internal.Stream; - import Readable = internal.Readable; - import ReadableOptions = internal.ReadableOptions; - interface ArrayOptions { - /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */ - concurrency?: number; - /** allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal; - } - class ReadableBase extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('node:fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('node:string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array`, or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream`module API as it is currently defined. (See `Compatibility` for more - * information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('node:stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - /** - * The iterator created by this method gives users the option to cancel the destruction - * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, - * or if the iterator should destroy the stream if the stream emitted an error during iteration. - * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. - */ - iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator; - /** - * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. - * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. - * @since v17.4.0, v16.14.0 - * @param fn a function to map over every chunk in the stream. Async or not. - * @returns a stream mapped with the function *fn*. - */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called - * and if it returns a truthy value, the chunk will be passed to the result stream. - * If the *fn* function returns a promise - that promise will be `await`ed. - * @since v17.4.0, v16.14.0 - * @param fn a function to filter chunks from the stream. Async or not. - * @returns a stream filtered with the predicate *fn*. - */ - filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Readable; - /** - * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. - * If the *fn* function returns a promise - that promise will be `await`ed. - * - * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. - * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option - * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. - * In either case the stream will be destroyed. - * - * This method is different from listening to the `'data'` event in that it uses the `readable` event - * in the underlying machinary and can limit the number of concurrent *fn* calls. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise for when the stream has finished. - */ - forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method allows easily obtaining the contents of a stream. - * - * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended - * for interoperability and convenience, not as the primary way to consume streams. - * @since v17.5.0 - * @returns a promise containing an array with the contents of the stream. - */ - toArray(options?: Pick): Promise; - /** - * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream - * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk - * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. - * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. - */ - some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream - * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, - * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. - * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, - * or `undefined` if no element was found. - */ - find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, - ): Promise; - find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream - * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk - * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. - * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. - */ - every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method returns a new stream by applying the given callback to each chunk of the stream - * and then flattening the result. - * - * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams - * will be merged (flattened) into the returned stream. - * @since v17.5.0 - * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. - * @returns a stream flat-mapped with the function *fn*. - */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method returns a new stream with the first *limit* chunks dropped from the start. - * @since v17.5.0 - * @param limit the number of chunks to drop from the readable. - * @returns a stream with *limit* chunks dropped from the start. - */ - drop(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with the first *limit* chunks. - * @since v17.5.0 - * @param limit the number of chunks to take from the readable. - * @returns a stream with *limit* chunks taken. - */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; - /** - * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation - * on the previous element. It returns a promise for the final value of the reduction. - * - * If no *initial* value is supplied the first chunk of the stream is used as the initial value. - * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. - * - * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter - * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. - * @since v17.5.0 - * @param fn a reducer function to call over every chunk in the stream. Async or not. - * @param initial the initial value to use in the reduction. - * @returns a promise for the final value of the reduction. - */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, - initial: T, - options?: Pick, - ): Promise; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - import WritableOptions = internal.WritableOptions; - class WritableBase extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored, or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('node:fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends ReadableBase { - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - readableStream: streamWeb.ReadableStream, - options?: Pick, - ): Readable; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?( - this: Writable, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends WritableBase { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - writableStream: streamWeb.WritableStream, - options?: Pick, - ): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends ReadableBase implements WritableBase { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is - * emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from( - src: - | Stream - | NodeBlob - | ArrayBuffer - | string - | Iterable - | AsyncIterable - | AsyncGeneratorFunction - | Promise - | Object, - ): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - /** - * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; - /** - * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, - options?: Pick< - DuplexOptions, - "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" - >, - ): Duplex; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?( - this: Transform, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * A stream to attach a signal to. - * - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new - * AbortError())` for webstreams. - * - * ```js - * const fs = require('node:fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * - * Or using an `AbortSignal` with a ReadableStream: - * - * ```js - * const controller = new AbortController(); - * const rs = new ReadableStream({ - * start(controller) { - * controller.enqueue('hello'); - * controller.enqueue('world'); - * controller.close(); - * }, - * }); - * - * addAbortSignal(controller.signal, rs); - * - * finished(rs, (err) => { - * if (err) { - * if (err.name === 'AbortError') { - * // The operation was cancelled - * } - * } - * }); - * - * const reader = rs.getReader(); - * - * reader.read().then(({ value, done }) => { - * console.log(value); // hello - * console.log(done); // false - * controller.abort(); - * }); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - /** - * Returns the default highWaterMark used by streams. - * Defaults to `16384` (16 KiB), or `16` for `objectMode`. - * @since v19.9.0 - * @param objectMode - */ - function getDefaultHighWaterMark(objectMode: boolean): number; - /** - * Sets the default highWaterMark used by streams. - * @since v19.9.0 - * @param objectMode - * @param value highWaterMark value - */ - function setDefaultHighWaterMark(objectMode: boolean, value: number): void; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A readable and/or writable stream/webstream. - * - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('node:stream'); - * const fs = require('node:fs'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides `promise version`. - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options: FinishedOptions, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? - | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('node:stream'); - * const fs = require('node:fs'); - * const zlib = require('node:zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * }, - * ); - * ``` - * - * The `pipeline` API provides a `promise version`. - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * const fs = require('node:fs'); - * const http = require('node:http'); - * const { pipeline } = require('node:stream'); - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - callback?: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void, - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0, v16.14.0 - * @experimental - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - /** - * Returns whether the stream is readable. - * @since v17.4.0, v16.14.0 - * @experimental - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module "node:stream" { - import stream = require("stream"); - export = stream; -} diff --git a/node_modules/@types/node/ts4.8/stream/consumers.d.ts b/node_modules/@types/node/ts4.8/stream/consumers.d.ts deleted file mode 100644 index 5ad9cba..0000000 --- a/node_modules/@types/node/ts4.8/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module "stream/consumers" { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; -} -declare module "node:stream/consumers" { - export * from "stream/consumers"; -} diff --git a/node_modules/@types/node/ts4.8/stream/promises.d.ts b/node_modules/@types/node/ts4.8/stream/promises.d.ts deleted file mode 100644 index 6eac5b7..0000000 --- a/node_modules/@types/node/ts4.8/stream/promises.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare module "stream/promises" { - import { - FinishedOptions, - PipelineDestination, - PipelineOptions, - PipelinePromise, - PipelineSource, - PipelineTransform, - } from "node:stream"; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module "node:stream/promises" { - export * from "stream/promises"; -} diff --git a/node_modules/@types/node/ts4.8/stream/web.d.ts b/node_modules/@types/node/ts4.8/stream/web.d.ts deleted file mode 100644 index 361594d..0000000 --- a/node_modules/@types/node/ts4.8/stream/web.d.ts +++ /dev/null @@ -1,366 +0,0 @@ -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; - } - interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; - } - type ReadableStreamController = ReadableStreamDefaultController; - type ReadableStreamDefaultReadResult = - | ReadableStreamDefaultReadValueResult - | ReadableStreamDefaultReadDoneResult; - interface ReadableStreamReadValueResult { - done: false; - value: T; - } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; - } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(): ReadableStreamDefaultReader; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): AsyncIterableIterator; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - const ReadableStream: { - prototype: ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - read(view: T): Promise>; - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: any; - const ReadableStreamBYOBRequest: any; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new( - transformer?: Transformer, - writableStrategy?: QueuingStrategy, - readableStrategy?: QueuingStrategy, - ): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; - }; - interface CompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const CompressionStream: { - prototype: CompressionStream; - new(format: string): CompressionStream; - }; - interface DecompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const DecompressionStream: { - prototype: DecompressionStream; - new(format: string): DecompressionStream; - }; -} -declare module "node:stream/web" { - export * from "stream/web"; -} diff --git a/node_modules/@types/node/ts4.8/string_decoder.d.ts b/node_modules/@types/node/ts4.8/string_decoder.d.ts deleted file mode 100644 index cd76bf8..0000000 --- a/node_modules/@types/node/ts4.8/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `node:string_decoder` module provides an API for decoding `Buffer` objects - * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); // Prints: ¢ - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); // Prints: € - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('node:string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js) - */ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer The bytes to decode. - */ - write(buffer: string | Buffer | NodeJS.ArrayBufferView): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer The bytes to decode. - */ - end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string; - } -} -declare module "node:string_decoder" { - export * from "string_decoder"; -} diff --git a/node_modules/@types/node/ts4.8/test.d.ts b/node_modules/@types/node/ts4.8/test.d.ts deleted file mode 100644 index 149c9e0..0000000 --- a/node_modules/@types/node/ts4.8/test.d.ts +++ /dev/null @@ -1,1465 +0,0 @@ -/** - * The `node:test` module facilitates the creation of JavaScript tests. - * To access it: - * - * ```js - * import test from 'node:test'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test'; - * ``` - * - * Tests created via the `test` module consist of a single function that is - * processed in one of three ways: - * - * 1. A synchronous function that is considered failing if it throws an exception, - * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` fulfills. - * 3. A function that receives a callback function. If the callback receives any - * truthy value as its first argument, the test is considered failing. If a - * falsy value is passed as the first argument to the callback, the test is - * considered passing. If the test function receives a callback function and - * also returns a `Promise`, the test will fail. - * - * The following example illustrates how tests are written using the`test` module. - * - * ```js - * test('synchronous passing test', (t) => { - * // This test passes because it does not throw an exception. - * assert.strictEqual(1, 1); - * }); - * - * test('synchronous failing test', (t) => { - * // This test fails because it throws an exception. - * assert.strictEqual(1, 2); - * }); - * - * test('asynchronous passing test', async (t) => { - * // This test passes because the Promise returned by the async - * // function is settled and not rejected. - * assert.strictEqual(1, 1); - * }); - * - * test('asynchronous failing test', async (t) => { - * // This test fails because the Promise returned by the async - * // function is rejected. - * assert.strictEqual(1, 2); - * }); - * - * test('failing test using Promises', (t) => { - * // Promises can be used directly as well. - * return new Promise((resolve, reject) => { - * setImmediate(() => { - * reject(new Error('this will cause the test to fail')); - * }); - * }); - * }); - * - * test('callback passing test', (t, done) => { - * // done() is the callback function. When the setImmediate() runs, it invokes - * // done() with no arguments. - * setImmediate(done); - * }); - * - * test('callback failing test', (t, done) => { - * // When the setImmediate() runs, done() is invoked with an Error object and - * // the test fails. - * setImmediate(() => { - * done(new Error('callback failure')); - * }); - * }); - * ``` - * - * If any tests fail, the process exit code is set to `1`. - * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.4.0/lib/test.js) - */ -declare module "node:test" { - import { Readable } from "node:stream"; - import { AsyncResource } from "node:async_hooks"; - /** - * **Note:**`shard` is used to horizontally parallelize test running across - * machines or processes, ideal for large-scale executions across varied - * environments. It's incompatible with `watch` mode, tailored for rapid - * code iteration by automatically rerunning tests on file changes. - * - * ```js - * import { tap } from 'node:test/reporters'; - * import { run } from 'node:test'; - * import process from 'node:process'; - * import path from 'node:path'; - * - * run({ files: [path.resolve('./tests/test.js')] }) - * .compose(tap) - * .pipe(process.stdout); - * ``` - * @since v18.9.0, v16.19.0 - * @param options Configuration options for running tests. The following properties are supported: - */ - function run(options?: RunOptions): TestsStream; - /** - * The `test()` function is the value imported from the `test` module. Each - * invocation of this function results in reporting the test to the `TestsStream`. - * - * The `TestContext` object passed to the `fn` argument can be used to perform - * actions related to the current test. Examples include skipping the test, adding - * additional diagnostic information, or creating subtests. - * - * `test()` returns a `Promise` that fulfills once the test completes. - * if `test()` is called within a `describe()` block, it fulfills immediately. - * The return value can usually be discarded for top level tests. - * However, the return value from subtests should be used to prevent the parent - * test from finishing first and cancelling the subtest - * as shown in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * - * The `timeout` option can be used to fail the test if it takes longer than`timeout` milliseconds to complete. However, it is not a reliable mechanism for - * canceling tests because a running test might block the application thread and - * thus prevent the scheduled cancellation. - * @since v18.0.0, v16.17.0 - * @param [name='The name'] The name of the test, which is displayed when reporting test results. - * @param options Configuration options for the test. The following properties are supported: - * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the callback function is passed as the - * second argument. - * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within {@link describe}. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - namespace test { - export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo }; - } - /** - * The `describe()` function imported from the `node:test` module. Each - * invocation of this function results in the creation of a Subtest. - * After invocation of top level `describe` functions, - * all top level tests and suites will execute. - * @param [name='The name'] The name of the suite, which is displayed when reporting test results. - * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. - * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. - * @return Immediately fulfilled with `undefined`. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function describe(name?: string, fn?: SuiteFn): Promise; - function describe(options?: TestOptions, fn?: SuiteFn): Promise; - function describe(fn?: SuiteFn): Promise; - namespace describe { - /** - * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Shorthand for `test()`. - * - * The `it()` function is imported from the `node:test` module. - * @since v18.6.0, v16.17.0 - */ - function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function it(name?: string, fn?: TestFn): Promise; - function it(options?: TestOptions, fn?: TestFn): Promise; - function it(fn?: TestFn): Promise; - namespace it { - /** - * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - } - /** - * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. - * @since v20.2.0 - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. - * @since v20.2.0 - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. - * @since v20.2.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - /** - * The type of a function under test. The first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is passed as - * the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; - /** - * The type of a function under Suite. - */ - type SuiteFn = (s: SuiteContext) => void | Promise; - interface TestShard { - /** - * A positive integer between 1 and `` that specifies the index of the shard to run. - */ - index: number; - /** - * A positive integer that specifies the total number of shards to split the test files to. - */ - total: number; - } - interface RunOptions { - /** - * If a number is provided, then that many files would run in parallel. - * If truthy, it would run (number of cpu cores - 1) files in parallel. - * If falsy, it would only run one file at a time. - * If unspecified, subtests inherit this value from their parent. - * @default true - */ - concurrency?: number | boolean | undefined; - /** - * An array containing the list of files to run. - * If unspecified, the test runner execution model will be used. - */ - files?: readonly string[] | undefined; - /** - * Allows aborting an in-progress test execution. - * @default undefined - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the test will fail after. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - /** - * Sets inspector port of test child process. - * If a nullish value is provided, each process gets its own port, - * incremented from the primary's `process.debugPort`. - */ - inspectPort?: number | (() => number) | undefined; - /** - * That can be used to only run tests whose name matches the provided pattern. - * Test name patterns are interpreted as JavaScript regular expressions. - * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. - */ - testNamePatterns?: string | RegExp | string[] | RegExp[]; - /** - * If truthy, the test context will only run tests that have the `only` option set - */ - only?: boolean; - /** - * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run. - */ - setup?: (root: Test) => void | Promise; - /** - * Whether to run in watch mode or not. - * @default false - */ - watch?: boolean | undefined; - /** - * Running tests in a specific shard. - * @default undefined - */ - shard?: TestShard | undefined; - } - class Test extends AsyncResource { - concurrency: number; - nesting: number; - only: boolean; - reporter: TestsStream; - runOnlySubtests: boolean; - testNumber: number; - timeout: number | null; - } - /** - * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.`TestsStream` will emit events, in the - * order of the tests definition - * @since v18.9.0, v16.19.0 - */ - class TestsStream extends Readable implements NodeJS.ReadableStream { - addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - addListener(event: "test:fail", listener: (data: TestFail) => void): this; - addListener(event: "test:pass", listener: (data: TestPass) => void): this; - addListener(event: "test:plan", listener: (data: TestPlan) => void): this; - addListener(event: "test:start", listener: (data: TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:diagnostic", data: DiagnosticData): boolean; - emit(event: "test:fail", data: TestFail): boolean; - emit(event: "test:pass", data: TestPass): boolean; - emit(event: "test:plan", data: TestPlan): boolean; - emit(event: "test:start", data: TestStart): boolean; - emit(event: "test:stderr", data: TestStderr): boolean; - emit(event: "test:stdout", data: TestStdout): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - on(event: "test:fail", listener: (data: TestFail) => void): this; - on(event: "test:pass", listener: (data: TestPass) => void): this; - on(event: "test:plan", listener: (data: TestPlan) => void): this; - on(event: "test:start", listener: (data: TestStart) => void): this; - on(event: "test:stderr", listener: (data: TestStderr) => void): this; - on(event: "test:stdout", listener: (data: TestStdout) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - once(event: "test:fail", listener: (data: TestFail) => void): this; - once(event: "test:pass", listener: (data: TestPass) => void): this; - once(event: "test:plan", listener: (data: TestPlan) => void): this; - once(event: "test:start", listener: (data: TestStart) => void): this; - once(event: "test:stderr", listener: (data: TestStderr) => void): this; - once(event: "test:stdout", listener: (data: TestStdout) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - /** - * An instance of `TestContext` is passed to each test function in order to - * interact with the test runner. However, the `TestContext` constructor is not - * exposed as part of the API. - * @since v18.0.0, v16.17.0 - */ - class TestContext { - /** - * This function is used to create a hook running before subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v20.1.0 - */ - before: typeof before; - /** - * This function is used to create a hook running before each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - beforeEach: typeof beforeEach; - /** - * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.13.0 - */ - after: typeof after; - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as - * the second argument. Default: A no-op function. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - afterEach: typeof afterEach; - /** - * This function is used to write diagnostics to the output. Any diagnostic - * information is included at the end of the test's results. This function does - * not return a value. - * - * ```js - * test('top level test', (t) => { - * t.diagnostic('A diagnostic message'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Message to be reported. - */ - diagnostic(message: string): void; - /** - * The name of the test. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that - * have the `only` option set. Otherwise, all tests are run. If Node.js was not - * started with the `--test-only` command-line option, this function is a - * no-op. - * - * ```js - * test('top level test', (t) => { - * // The test context can be set to run subtests with the 'only' option. - * t.runOnly(true); - * return Promise.all([ - * t.test('this subtest is now skipped'), - * t.test('this subtest is run', { only: true }), - * ]); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param shouldRunOnlyTests Whether or not to run `only` tests. - */ - runOnly(shouldRunOnlyTests: boolean): void; - /** - * ```js - * test('top level test', async (t) => { - * await fetch('some/uri', { signal: t.signal }); - * }); - * ``` - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - /** - * This function causes the test's output to indicate the test as skipped. If`message` is provided, it is included in the output. Calling `skip()` does - * not terminate execution of the test function. This function does not return a - * value. - * - * ```js - * test('top level test', (t) => { - * // Make sure to return here as well if the test contains additional logic. - * t.skip('this is skipped'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional skip message. - */ - skip(message?: string): void; - /** - * This function adds a `TODO` directive to the test's output. If `message` is - * provided, it is included in the output. Calling `todo()` does not terminate - * execution of the test function. This function does not return a value. - * - * ```js - * test('top level test', (t) => { - * // This test is marked as `TODO` - * t.todo('this is a todo'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional `TODO` message. - */ - todo(message?: string): void; - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Default: The `name` property of fn, or `''` if `fn` does not have a name. - * @param options Configuration options for the test - * @param fn The function under test. This first argument to this function is a - * {@link TestContext} object. If the test uses callbacks, the callback function is - * passed as the second argument. Default: A no-op function. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - /** - * Each test provides its own MockTracker instance. - */ - readonly mock: MockTracker; - } - /** - * An instance of `SuiteContext` is passed to each suite function in order to - * interact with the test runner. However, the `SuiteContext` constructor is not - * exposed as part of the API. - * @since v18.7.0, v16.17.0 - */ - class SuiteContext { - /** - * The name of the suite. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Can be used to abort test subtasks when the test has been aborted. - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - } - interface TestOptions { - /** - * If a number is provided, then that many tests would run in parallel. - * If truthy, it would run (number of cpu cores - 1) tests in parallel. - * For subtests, it will be `Infinity` tests in parallel. - * If falsy, it would only run one test at a time. - * If unspecified, subtests inherit this value from their parent. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean | undefined; - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal | undefined; - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string | undefined; - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number | undefined; - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string | undefined; - } - /** - * This function is used to create a hook running before running a suite. - * - * ```js - * describe('tests', async () => { - * before(() => console.log('about to run some test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function before(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running after running a suite. - * - * ```js - * describe('tests', async () => { - * after(() => console.log('finished running tests')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function after(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running - * before each subtest of the current suite. - * - * ```js - * describe('tests', async () => { - * beforeEach(() => console.log('about to run a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running - * after each subtest of the current test. - * - * ```js - * describe('tests', async () => { - * afterEach(() => console.log('finished running a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. The following properties are supported: - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - /** - * The hook function. If the hook uses callbacks, the callback function is passed as the - * second argument. - */ - type HookFn = (s: SuiteContext, done: (result?: any) => void) => any; - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - } - interface MockFunctionOptions { - /** - * The number of times that the mock will use the behavior of `implementation`. - * Once the mock function has been called `times` times, - * it will automatically restore the behavior of `original`. - * This value must be an integer greater than zero. - * @default Infinity - */ - times?: number | undefined; - } - interface MockMethodOptions extends MockFunctionOptions { - /** - * If `true`, `object[methodName]` is treated as a getter. - * This option cannot be used with the `setter` option. - */ - getter?: boolean | undefined; - /** - * If `true`, `object[methodName]` is treated as a setter. - * This option cannot be used with the `getter` option. - */ - setter?: boolean | undefined; - } - type Mock = F & { - mock: MockFunctionContext; - }; - type NoOpFunction = (...args: any[]) => undefined; - type FunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? K : never; - }[keyof T]; - /** - * The `MockTracker` class is used to manage mocking functionality. The test runner - * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's`mock` property. - * @since v19.1.0, v18.13.0 - */ - class MockTracker { - /** - * This function is used to create a mock function. - * - * The following example creates a mock function that increments a counter by one - * on each invocation. The `times` option is used to modify the mock behavior such - * that the first two invocations add two to the counter instead of one. - * - * ```js - * test('mocks a counting function', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); - * - * assert.strictEqual(fn(), 2); - * assert.strictEqual(fn(), 4); - * assert.strictEqual(fn(), 5); - * assert.strictEqual(fn(), 6); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param [original='A no-op function'] An optional function to create a mock on. - * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and - * then restore the behavior of `original`. - * @param options Optional configuration options for the mock function. The following properties are supported: - * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked function. - */ - fn(original?: F, options?: MockFunctionOptions): Mock; - fn( - original?: F, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock; - /** - * This function is used to create a mock on an existing object method. The - * following example demonstrates how a mock is created on an existing object - * method. - * - * ```js - * test('spies on an object method', (t) => { - * const number = { - * value: 5, - * subtract(a) { - * return this.value - a; - * }, - * }; - * - * t.mock.method(number, 'subtract'); - * assert.strictEqual(number.subtract.mock.calls.length, 0); - * assert.strictEqual(number.subtract(3), 2); - * assert.strictEqual(number.subtract.mock.calls.length, 1); - * - * const call = number.subtract.mock.calls[0]; - * - * assert.deepStrictEqual(call.arguments, [3]); - * assert.strictEqual(call.result, 2); - * assert.strictEqual(call.error, undefined); - * assert.strictEqual(call.target, undefined); - * assert.strictEqual(call.this, number); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param object The object whose method is being mocked. - * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. - * @param implementation An optional function used as the mock implementation for `object[methodName]`. - * @param options Optional configuration options for the mock method. The following properties are supported: - * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked method. - */ - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation: Implementation, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method( - object: MockedObject, - methodName: keyof MockedObject, - options: MockMethodOptions, - ): Mock; - method( - object: MockedObject, - methodName: keyof MockedObject, - implementation: Function, - options: MockMethodOptions, - ): Mock; - - /** - * This function is syntax sugar for `MockTracker.method` with `options.getter`set to `true`. - * @since v19.3.0, v18.13.0 - */ - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<() => MockedObject[MethodName]>; - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<(() => MockedObject[MethodName]) | Implementation>; - /** - * This function is syntax sugar for `MockTracker.method` with `options.setter`set to `true`. - * @since v19.3.0, v18.13.0 - */ - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<(value: MockedObject[MethodName]) => void>; - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the`MockTracker` instance. Once disassociated, the mocks can still be used, but the`MockTracker` instance can no longer be - * used to reset their behavior or - * otherwise interact with them. - * - * After each test completes, this function is called on the test context's`MockTracker`. If the global `MockTracker` is used extensively, calling this - * function manually is recommended. - * @since v19.1.0, v18.13.0 - */ - reset(): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does - * not disassociate the mocks from the `MockTracker` instance. - * @since v19.1.0, v18.13.0 - */ - restoreAll(): void; - timers: MockTimers; - } - const mock: MockTracker; - interface MockFunctionCall< - F extends Function, - ReturnType = F extends (...args: any) => infer T ? T - : F extends abstract new(...args: any) => infer T ? T - : unknown, - Args = F extends (...args: infer Y) => any ? Y - : F extends abstract new(...args: infer Y) => any ? Y - : unknown[], - > { - /** - * An array of the arguments passed to the mock function. - */ - arguments: Args; - /** - * If the mocked function threw then this property contains the thrown value. - */ - error: unknown | undefined; - /** - * The value returned by the mocked function. - * - * If the mocked function threw, it will be `undefined`. - */ - result: ReturnType | undefined; - /** - * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. - */ - stack: Error; - /** - * If the mocked function is a constructor, this field contains the class being constructed. - * Otherwise this will be `undefined`. - */ - target: F extends abstract new(...args: any) => any ? F : undefined; - /** - * The mocked function's `this` value. - */ - this: unknown; - } - /** - * The `MockFunctionContext` class is used to inspect or manipulate the behavior of - * mocks created via the `MockTracker` APIs. - * @since v19.1.0, v18.13.0 - */ - class MockFunctionContext { - /** - * A getter that returns a copy of the internal array used to track calls to the - * mock. Each entry in the array is an object with the following properties. - * @since v19.1.0, v18.13.0 - */ - readonly calls: Array>; - /** - * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls`is a getter that creates a copy of the internal call tracking array. - * @since v19.1.0, v18.13.0 - * @return The number of times that this mock has been invoked. - */ - callCount(): number; - /** - * This function is used to change the behavior of an existing mock. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, and then changes the mock implementation to a different function. - * - * ```js - * test('changes a mock behavior', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementation(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 5); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's new implementation. - */ - mockImplementation(implementation: Function): void; - /** - * This function is used to change the behavior of an existing mock for a single - * invocation. Once invocation `onCall` has occurred, the mock will revert to - * whatever behavior it would have used had `mockImplementationOnce()` not been - * called. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, changes the mock implementation to a different function for the - * next invocation, and then resumes its previous behavior. - * - * ```js - * test('changes a mock behavior once', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementationOnce(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 4); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. - * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. - */ - mockImplementationOnce(implementation: Function, onCall?: number): void; - /** - * Resets the call history of the mock function. - * @since v19.3.0, v18.13.0 - */ - resetCalls(): void; - /** - * Resets the implementation of the mock function to its original behavior. The - * mock can still be used after calling this function. - * @since v19.1.0, v18.13.0 - */ - restore(): void; - } - type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; - - interface MockTimersOptions { - apis: Timer[]; - now?: number | Date; - } - /** - * Mocking timers is a technique commonly used in software testing to simulate and - * control the behavior of timers, such as `setInterval` and `setTimeout`, - * without actually waiting for the specified time intervals. - * - * The MockTimers API also allows for mocking of the `Date` constructor and - * `setImmediate`/`clearImmediate` functions. - * - * The `MockTracker` provides a top-level `timers` export - * which is a `MockTimers` instance. - * @since v20.4.0 - * @experimental - */ - class MockTimers { - /** - * Enables timer mocking for the specified timers. - * - * **Note:** When you enable mocking for a specific timer, its associated - * clear function will also be implicitly mocked. - * - * **Note:** Mocking `Date` will affect the behavior of the mocked timers - * as they use the same internal clock. - * - * Example usage without setting initial time: - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); - * ``` - * - * The above example enables mocking for the `Date` constructor, `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, - * `setInterval` and `clearInterval` functions from `node:timers`,`node:timers/promises`, and `globalThis` will be mocked. - * - * Example usage with initial time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: 1000 }); - * ``` - * - * Example usage with initial Date object as time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: new Date() }); - * ``` - * - * Alternatively, if you call `mock.timers.enable()` without any parameters: - * - * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. - * - * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, - * and `globalThis` will be mocked. - * The `Date` constructor from `globalThis` will be mocked. - * - * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date object. It can either be a positive integer, or another Date object. - * @since v20.4.0 - */ - enable(options?: MockTimersOptions): void; - /** - * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. - * Note: This method will execute any mocked timers that are in the past from the new time. - * In the below example we are setting a new time for the mocked date. - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * test('sets the time of a date object', (context) => { - * // Optionally choose what to mock - * context.mock.timers.enable({ apis: ['Date'], now: 100 }); - * assert.strictEqual(Date.now(), 100); - * // Advance in time will also advance the date - * context.mock.timers.setTime(1000); - * context.mock.timers.tick(200); - * assert.strictEqual(Date.now(), 1200); - * }); - * ``` - */ - setTime(time: number): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTimers` instance and disassociates the mocks - * from the `MockTracker` instance. - * - * **Note:** After each test completes, this function is called on - * the test context's `MockTracker`. - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.reset(); - * ``` - * @since v20.4.0 - */ - reset(): void; - /** - * Advances time for all mocked timers. - * - * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts - * only positive numbers. In Node.js, `setTimeout` with negative numbers is - * only supported for web compatibility reasons. - * - * The following example mocks a `setTimeout` function and - * by using `.tick` advances in - * time triggering all pending timers. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Alternativelly, the `.tick` function can be called many times - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * const nineSecs = 9000; - * setTimeout(fn, nineSecs); - * - * const twoSeconds = 3000; - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Advancing time using `.tick` will also advance the time for any `Date` object - * created after the mock was enabled (if `Date` was also set to be mocked). - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * assert.strictEqual(Date.now(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * assert.strictEqual(fn.mock.callCount(), 1); - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * @since v20.4.0 - */ - tick(milliseconds: number): void; - /** - * Triggers all pending mocked timers immediately. If the `Date` object is also - * mocked, it will also advance the `Date` object to the furthest timer's time. - * - * The example below triggers all pending timers immediately, - * causing them to execute without any delay. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * const results = []; - * setTimeout(() => results.push(1), 9999); - * - * // Notice that if both timers have the same timeout, - * // the order of execution is guaranteed - * setTimeout(() => results.push(3), 8888); - * setTimeout(() => results.push(2), 8888); - * - * assert.deepStrictEqual(results, []); - * - * context.mock.timers.runAll(); - * assert.deepStrictEqual(results, [3, 2, 1]); - * // The Date object is also advanced to the furthest timer's time - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * - * **Note:** The `runAll()` function is specifically designed for - * triggering timers in the context of timer mocking. - * It does not have any effect on real-time system - * clocks or actual timers outside of the mocking environment. - * @since v20.4.0 - */ - runAll(): void; - /** - * Calls {@link MockTimers.reset()}. - */ - [Symbol.dispose](): void; - } - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - Mock, - mock, - only, - run, - skip, - test, - test as default, - todo, - }; -} - -interface TestLocationInfo { - /** - * The column number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - column?: number; - /** - * The path of the test file, `undefined` if test is not ran through a file. - */ - file?: string; - /** - * The line number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - line?: number; -} -interface DiagnosticData extends TestLocationInfo { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestFail extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The error thrown by the test. - */ - error: Error; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPass extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPlan extends TestLocationInfo { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; -} -interface TestStart extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestStderr extends TestLocationInfo { - /** - * The message written to `stderr` - */ - message: string; -} -interface TestStdout extends TestLocationInfo { - /** - * The message written to `stdout` - */ - message: string; -} -interface TestEnqueue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestDequeue extends TestLocationInfo { - /** - * The test name - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform, TransformOptions } from "node:stream"; - - type TestEvent = - | { type: "test:diagnostic"; data: DiagnosticData } - | { type: "test:fail"; data: TestFail } - | { type: "test:pass"; data: TestPass } - | { type: "test:plan"; data: TestPlan } - | { type: "test:start"; data: TestStart } - | { type: "test:stderr"; data: TestStderr } - | { type: "test:stdout"; data: TestStdout } - | { type: "test:enqueue"; data: TestEnqueue } - | { type: "test:dequeue"; data: TestDequeue } - | { type: "test:watch:drained" }; - type TestEventGenerator = AsyncGenerator; - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - */ - function tap(source: TestEventGenerator): AsyncGenerator; - /** - * The `spec` reporter outputs the test results in a human-readable format. - */ - class Spec extends Transform { - constructor(); - } - /** - * The `junit` reporter outputs test results in a jUnit XML format - */ - function junit(source: TestEventGenerator): AsyncGenerator; - class Lcov extends Transform { - constructor(opts?: TransformOptions); - } - export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; -} diff --git a/node_modules/@types/node/ts4.8/timers.d.ts b/node_modules/@types/node/ts4.8/timers.d.ts deleted file mode 100644 index 039f31f..0000000 --- a/node_modules/@types/node/ts4.8/timers.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('node:timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/timers.js) - */ -declare module "timers" { - import { Abortable } from "node:events"; - import { - setImmediate as setImmediatePromise, - setInterval as setIntervalPromise, - setTimeout as setTimeoutPromise, - } from "node:timers/promises"; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - /** - * This object is created internally and is returned from `setImmediate()`. It - * can be passed to `clearImmediate()` in order to cancel the scheduled - * actions. - * - * By default, when an immediate is scheduled, the Node.js event loop will continue - * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`functions that can be used to - * control this default behavior. - */ - class Immediate implements RefCounted { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Immediate` is active. Calling `immediate.ref()` multiple times will have no - * effect. - * - * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary - * to call `immediate.ref()` unless `immediate.unref()` had been called previously. - * @since v9.7.0 - * @return a reference to `immediate` - */ - ref(): this; - /** - * When called, the active `Immediate` object will not require the Node.js event - * loop to remain active. If there is no other activity keeping the event loop - * running, the process may exit before the `Immediate` object's callback is - * invoked. Calling `immediate.unref()` multiple times will have no effect. - * @since v9.7.0 - * @return a reference to `immediate` - */ - unref(): this; - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - /** - * Cancels the immediate. This is similar to calling `clearImmediate()`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - /** - * This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the - * scheduled actions. - * - * By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the - * timer is active. Each of the `Timeout` objects returned by these functions - * export both `timeout.ref()` and `timeout.unref()` functions that can be used to - * control this default behavior. - */ - class Timeout implements Timer { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. - * - * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary - * to call `timeout.ref()` unless `timeout.unref()` had been called previously. - * @since v0.9.1 - * @return a reference to `timeout` - */ - ref(): this; - /** - * When called, the active `Timeout` object will not require the Node.js event loop - * to remain active. If there is no other activity keeping the event loop running, - * the process may exit before the `Timeout` object's callback is invoked. Calling`timeout.unref()` multiple times will have no effect. - * @since v0.9.1 - * @return a reference to `timeout` - */ - unref(): this; - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - /** - * Cancels the timeout. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - } - /** - * Schedules execution of a one-time `callback` after `delay` milliseconds. - * - * The `callback` will likely not be invoked in precisely `delay` milliseconds. - * Node.js makes no guarantees about the exact timing of when callbacks will fire, - * nor of their ordering. The callback will be called as close as possible to the - * time specified. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay`will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setTimeout()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearTimeout} - */ - function setTimeout( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - /** - * Cancels a `Timeout` object created by `setTimeout()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules repeated execution of `callback` every `delay` milliseconds. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be - * set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setInterval()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearInterval} - */ - function setInterval( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - /** - * Cancels a `Timeout` object created by `setInterval()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules the "immediate" execution of the `callback` after I/O events' - * callbacks. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setImmediate()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of the Node.js `Event Loop` - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearImmediate} - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by {@link setImmediate}. - */ - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module "node:timers" { - export * from "timers"; -} diff --git a/node_modules/@types/node/ts4.8/timers/promises.d.ts b/node_modules/@types/node/ts4.8/timers/promises.d.ts deleted file mode 100644 index 5a54dc7..0000000 --- a/node_modules/@types/node/ts4.8/timers/promises.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module "timers/promises" { - import { TimerOptions } from "node:timers"; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * If `ref` is `true`, you need to call `next()` of async iterator explicitly - * or implicitly to keep the event loop alive. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; - interface Scheduler { - /** - * ```js - * import { scheduler } from 'node:timers/promises'; - * - * await scheduler.wait(1000); // Wait one second before continuing - * ``` - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. - * @since v16.14.0 - * @experimental - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - */ - wait: (delay?: number, options?: TimerOptions) => Promise; - /** - * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. - * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. - * @since v16.14.0 - * @experimental - */ - yield: () => Promise; - } - const scheduler: Scheduler; -} -declare module "node:timers/promises" { - export * from "timers/promises"; -} diff --git a/node_modules/@types/node/ts4.8/tls.d.ts b/node_modules/@types/node/ts4.8/tls.d.ts deleted file mode 100644 index 9f6d6be..0000000 --- a/node_modules/@types/node/ts4.8/tls.d.ts +++ /dev/null @@ -1,1210 +0,0 @@ -/** - * The `node:tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('node:tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js) - */ -declare module "tls" { - import { X509Certificate } from "node:crypto"; - import * as net from "node:net"; - import * as stream from "stream"; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - /** - * `true` if a Certificate Authority (CA), `false` otherwise. - * @since v18.13.0 - */ - ca: boolean; - /** - * The DER encoded X.509 certificate data. - */ - raw: Buffer; - /** - * The certificate subject. - */ - subject: Certificate; - /** - * The certificate issuer, described in the same terms as the `subject`. - */ - issuer: Certificate; - /** - * The date-time the certificate is valid from. - */ - valid_from: string; - /** - * The date-time the certificate is valid to. - */ - valid_to: string; - /** - * The certificate serial number, as a hex string. - */ - serialNumber: string; - /** - * The SHA-1 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint: string; - /** - * The SHA-256 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint256: string; - /** - * The SHA-512 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint512: string; - /** - * The extended key usage, a set of OIDs. - */ - ext_key_usage?: string[]; - /** - * A string containing concatenated names for the subject, - * an alternative to the `subject` names. - */ - subjectaltname?: string; - /** - * An array describing the AuthorityInfoAccess, used with OCSP. - */ - infoAccess?: NodeJS.Dict; - /** - * For RSA keys: The RSA bit size. - * - * For EC keys: The key size in bits. - */ - bits?: number; - /** - * The RSA exponent, as a string in hexadecimal number notation. - */ - exponent?: string; - /** - * The RSA modulus, as a hexadecimal string. - */ - modulus?: string; - /** - * The public key. - */ - pubkey?: Buffer; - /** - * The ASN.1 name of the OID of the elliptic curve. - * Well-known curves are identified by an OID. - * While it is unusual, it is possible that the curve - * is identified by its mathematical properties, - * in which case it will not have an OID. - */ - asn1Curve?: string; - /** - * The NIST name for the elliptic curve,if it has one - * (not all well-known curves have been assigned names by NIST). - */ - nistCurve?: string; - } - interface DetailedPeerCertificate extends PeerCertificate { - /** - * The issuer certificate object. - * For self-signed certificates, this may be a circular reference. - */ - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example, a TLSv1.2 protocol with AES256-SHA cipher: - * - * ```json - * { - * "name": "AES256-SHA", - * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", - * "version": "SSLv3" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void, - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: Buffer) => void): this; - addListener(event: "keylog", listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: Buffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: Buffer): boolean; - emit(event: "keylog", line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: Buffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: Buffer) => void): this; - on(event: "keylog", listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: Buffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: Buffer) => void): this; - once(event: "keylog", listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: Buffer) => void): this; - prependListener(event: "keylog", listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: Buffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created - * with {@link createSecureContext} itself. - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: Buffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; - interface SecureContextOptions { - /** - * If set, this will be called when a client opens a connection using the ALPN extension. - * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, - * respectively containing the server name from the SNI extension (if any) and an array of - * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, - * which will be returned to the client as the selected ALPN protocol, or `undefined`, - * to reject the connection with a fatal alert. If a string is returned that does not match one of - * the client's ALPN protocols, an error will be thrown. - * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. - */ - ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. - * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. - * ECDHE-based perfect forward secrecy will still be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom`options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `node:cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('node:tls'); - * const fs = require('node:fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ], - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('node:tls'); - * const fs = require('node:fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect( - port: number, - host?: string, - options?: ConnectionOptions, - secureConnectListener?: () => void, - ): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair( - context?: SecureContext, - isServer?: boolean, - requestCert?: boolean, - rejectUnauthorized?: boolean, - ): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as `server.addContext()`, - * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength - * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can - * be used to create custom parameters. The key length must be greater than or - * equal to 1024 bits or else an error will be thrown. Although 1024 bits is - * permissible, use 2048 bits or larger for stronger security. - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * The default value of the ciphers option of tls.createSecureContext(). - * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of crypto.constants.defaultCoreCipherList, unless - * changed using CLI options using --tls-default-ciphers. - */ - let DEFAULT_CIPHERS: string; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: readonly string[]; -} -declare module "node:tls" { - export * from "tls"; -} diff --git a/node_modules/@types/node/ts4.8/trace_events.d.ts b/node_modules/@types/node/ts4.8/trace_events.d.ts deleted file mode 100644 index 3361359..0000000 --- a/node_modules/@types/node/ts4.8/trace_events.d.ts +++ /dev/null @@ -1,182 +0,0 @@ -/** - * The `node:trace_events` module provides a mechanism to centralize tracing - * information generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `node:trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool - * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool - * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.net.native`: Enables capture of trace data for network. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.fs_dir.sync`: Enables capture of trace data for file system sync - * directory methods. - * * `node.fs.async`: Enables capture of trace data for file system async methods. - * * `node.fs_dir.async`: Enables capture of trace data for file system async - * directory methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * * `node.http`: Enables capture of trace data for http request / response. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `node:trace_events` module: - * - * ```js - * const trace_events = require('node:trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js) - */ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * const trace_events = require('node:trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('node:trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module "node:trace_events" { - export * from "trace_events"; -} diff --git a/node_modules/@types/node/ts4.8/tty.d.ts b/node_modules/@types/node/ts4.8/tty.d.ts deleted file mode 100644 index 1c0dafd..0000000 --- a/node_modules/@types/node/ts4.8/tty.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** - * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream`classes. In most cases, it will not be necessary or possible to use this module - * directly. However, it can be accessed using: - * - * ```js - * const tty = require('node:tty'); - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tty.js) - */ -declare module "tty" { - import * as net from "node:net"; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. - * - * This flag is always `false` when a process starts, even if the terminal is - * operating in raw mode. Its value will change with subsequent calls to`setRawMode`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input - * characters. Ctrl+C will no longer cause a `SIGINT` when - * in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module "node:tty" { - export * from "tty"; -} diff --git a/node_modules/@types/node/ts4.8/url.d.ts b/node_modules/@types/node/ts4.8/url.d.ts deleted file mode 100644 index 20a5d85..0000000 --- a/node_modules/@types/node/ts4.8/url.d.ts +++ /dev/null @@ -1,927 +0,0 @@ -/** - * The `node:url` module provides utilities for URL resolution and parsing. It can - * be accessed using: - * - * ```js - * import url from 'node:url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/url.js) - */ -declare module "url" { - import { Blob as NodeBlob } from "node:buffer"; - import { ClientRequestArgs } from "node:http"; - import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * `url.parse()` uses a lenient, non-standard algorithm for parsing URL - * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted - * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead. - * @since v0.1.25 - * @deprecated Use the WHATWG URL API instead. - * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse( - urlString: string, - parseQueryString: false | undefined, - slashesDenoteHost?: boolean, - ): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('node:url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json' - * } - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a web browser resolving an anchor tag. - * - * ```js - * const url = require('node:url'); - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * To achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param from The base URL to use if `to` is a relative URL. - * @param to The target URL to resolve. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'node:url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'node:url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'node:url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * /* - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0, v14.18.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - auth?: boolean | undefined; - fragment?: boolean | undefined; - search?: boolean | undefined; - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject` s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * const { - * Blob, - * resolveObjectURL, - * } = require('node:buffer'); - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: NodeBlob): string; - /** - * Removes the stored `Blob` identified by the given ID. Attempting to revoke a - * ID that isn't registered will silently fail. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(objectUrl: string): void; - /** - * Checks if an `input` relative to the `base` can be parsed to a `URL`. - * - * ```js - * const isValid = URL.canParse('/foo', 'https://example.org/'); // true - * - * const isNotValid = URL.canParse('/foo'); // false - * ``` - * @since v19.9.0 - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - */ - static canParse(input: string, base?: string): boolean; - constructor(input: string, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com/ - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myURL = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myURL.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myURL.searchParams.sort(); - * - * console.log(myURL.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor( - init?: - | URLSearchParams - | string - | Record - | Iterable<[string, string]> - | ReadonlyArray<[string, string]>, - ); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * If `value` is provided, removes all name-value pairs - * where name is `name` and value is `value`.. - * - * If `value` is not provided, removes all name-value pairs whose name is `name`. - */ - delete(name: string, value?: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach( - callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, - thisArg?: TThis, - ): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Checks if the `URLSearchParams` object contains key-value pair(s) based on`name` and an optional `value` argument. - * - * If `value` is provided, returns `true` when name-value pair with - * same `name` and `value` exists. - * - * If `value` is not provided, returns `true` if there is at least one name-value - * pair whose name is `name`. - */ - has(name: string, value?: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * The total number of parameter entries. - * @since v19.8.0 - */ - readonly size: number; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } - import { URL as _URL, URLSearchParams as _URLSearchParams } from "url"; - global { - interface URLSearchParams extends _URLSearchParams {} - interface URL extends _URL {} - interface Global { - URL: typeof _URL; - URLSearchParams: typeof _URLSearchParams; - } - /** - * `URL` class is a global reference for `require('url').URL` - * https://nodejs.org/api/url.html#the-whatwg-url-api - * @since v10.0.0 - */ - var URL: typeof globalThis extends { - onmessage: any; - URL: infer T; - } ? T - : typeof _URL; - /** - * `URLSearchParams` class is a global reference for `require('url').URLSearchParams` - * https://nodejs.org/api/url.html#class-urlsearchparams - * @since v10.0.0 - */ - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } ? T - : typeof _URLSearchParams; - } -} -declare module "node:url" { - export * from "url"; -} diff --git a/node_modules/@types/node/ts4.8/util.d.ts b/node_modules/@types/node/ts4.8/util.d.ts deleted file mode 100644 index 08712f5..0000000 --- a/node_modules/@types/node/ts4.8/util.d.ts +++ /dev/null @@ -1,2183 +0,0 @@ -/** - * The `node:util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * const util = require('node:util'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/util.js) - */ -declare module "util" { - import * as types from "node:util/types"; - export interface InspectOptions { - /** - * If `true`, object's non-enumerable symbols and properties are included in the formatted result. - * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). - * @default false - */ - showHidden?: boolean | undefined; - /** - * Specifies the number of times to recurse while formatting object. - * This is useful for inspecting large objects. - * To recurse up to the maximum call stack size pass `Infinity` or `null`. - * @default 2 - */ - depth?: number | null | undefined; - /** - * If `true`, the output is styled with ANSI color codes. Colors are customizable. - */ - colors?: boolean | undefined; - /** - * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. - * @default true - */ - customInspect?: boolean | undefined; - /** - * If `true`, `Proxy` inspection includes the target and handler objects. - * @default false - */ - showProxy?: boolean | undefined; - /** - * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements - * to include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no elements. - * @default 100 - */ - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - /** - * The length at which input values are split across multiple lines. - * Set to `Infinity` to format the input as a single line - * (in combination with `compact` set to `true` or any number >= `1`). - * @default 80 - */ - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default true - */ - compact?: boolean | number | undefined; - /** - * If set to `true` or a function, all properties of an object, and `Set` and `Map` - * entries are sorted in the resulting string. - * If set to `true` the default sort is used. - * If set to a function, it is used as a compare function. - */ - sorted?: boolean | ((a: string, b: string) => number) | undefined; - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default false - */ - getters?: "get" | "set" | boolean | undefined; - /** - * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. - * @default false - */ - numericSeparator?: boolean | undefined; - } - export type Style = - | "special" - | "number" - | "bigint" - | "boolean" - | "undefined" - | "null" - | "string" - | "symbol" - | "date" - | "regexp" - | "module"; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`\-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns the string name for a numeric error code that comes from a Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const name = util.getSystemErrorName(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v9.7.0 - */ - export function getSystemErrorName(err: number): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0, v14.17.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * const util = require('node:util'); - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * @since v16.8.0, v14.18.0 - */ - export function toUSVString(string: string): string; - /** - * Creates and returns an `AbortController` instance whose `AbortSignal` is marked - * as transferable and can be used with `structuredClone()` or `postMessage()`. - * @since v18.11.0 - * @experimental - * @returns A transferable AbortController - */ - export function transferableAbortController(): AbortController; - /** - * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. - * - * ```js - * const signal = transferableAbortSignal(AbortSignal.timeout(100)); - * const channel = new MessageChannel(); - * channel.port2.postMessage(signal, [signal]); - * ``` - * @since v18.11.0 - * @experimental - * @param signal The AbortSignal - * @returns The same AbortSignal - */ - export function transferableAbortSignal(signal: AbortSignal): AbortSignal; - /** - * Listens to abort event on the provided `signal` and - * returns a promise that is fulfilled when the `signal` is - * aborted. If the passed `resource` is garbage collected before the `signal` is - * aborted, the returned promise shall remain pending indefinitely. - * - * ```js - * import { aborted } from 'node:util'; - * - * const dependent = obtainSomethingAbortable(); - * - * aborted(dependent.signal, dependent).then(() => { - * // Do something when dependent is aborted. - * }); - * - * dependent.on('event', () => { - * dependent.abort(); - * }); - * ``` - * @since v19.7.0 - * @experimental - * @param resource Any non-null entity, reference to which is held weakly. - */ - export function aborted(signal: AbortSignal, resource: any): Promise; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * const { inspect } = require('node:util'); - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * const util = require('node:util'); - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * const util = require('node:util'); - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]), - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * const { inspect } = require('node:util'); - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * const { inspect } = require('node:util'); - * const assert = require('node:assert'); - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]), - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1], - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }), - * ); - * ``` - * - * The `numericSeparator` option adds an underscore every three digits to all - * numbers. - * - * ```js - * const { inspect } = require('node:util'); - * - * const thousand = 1_000; - * const million = 1_000_000; - * const bigNumber = 123_456_789n; - * const bigDecimal = 1_234.123_45; - * - * console.log(inspect(thousand, { numericSeparator: true })); - * // 1_000 - * console.log(inspect(million, { numericSeparator: true })); - * // 1_000_000 - * console.log(inspect(bigNumber, { numericSeparator: true })); - * // 123_456_789n - * console.log(inspect(bigDecimal, { numericSeparator: true })); - * // 1_234.123_45 - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MiB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options?: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. - * - * ```js - * const util = require('node:util'); - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from`superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * const util = require('node:util'); - * const EventEmitter = require('node:events'); - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * const EventEmitter = require('node:events'); - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @legacy Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * const util = require('node:util'); - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * const util = require('node:util'); - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * const util = require('node:util'); - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - export const debug: typeof debuglog; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * const util = require('node:util'); - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * const util = require('node:util'); - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * const util = require('node:util'); - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * const util = require('node:util'); - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Returns `str` with any ANSI escape codes removed. - * - * ```js - * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); - * // Prints "value" - * ``` - * @since v16.11.0 - */ - export function stripVTControlCharacters(str: string): string; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. - * - * ```js - * const util = require('node:util'); - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named`reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && Object.hasOwn(err, 'reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param fn An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: () => Promise, - ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = - | CustomPromisifySymbol - | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * const util = require('node:util'); - * const fs = require('node:fs'); - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * const util = require('node:util'); - * const fs = require('node:fs'); - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * - * callStat(); - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * const util = require('node:util'); - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify( - fn: (callback: (err: any, result: TResult) => void) => void, - ): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify( - fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - /** - * That can be used to declare custom promisified variants of functions. - */ - const custom: unique symbol; - } - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - }, - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - }, - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util"; - global { - /** - * `TextDecoder` class is a global reference for `require('util').TextDecoder` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } ? TextDecoder - : typeof _TextDecoder; - /** - * `TextEncoder` class is a global reference for `require('util').TextEncoder` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } ? TextEncoder - : typeof _TextEncoder; - } - - //// parseArgs - /** - * Provides a higher level API for command-line argument parsing than interacting - * with `process.argv` directly. Takes a specification for the expected arguments - * and returns a structured object with the parsed options and positionals. - * - * ```js - * import { parseArgs } from 'node:util'; - * const args = ['-f', '--bar', 'b']; - * const options = { - * foo: { - * type: 'boolean', - * short: 'f', - * }, - * bar: { - * type: 'string', - * }, - * }; - * const { - * values, - * positionals, - * } = parseArgs({ args, options }); - * console.log(values, positionals); - * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] - * ``` - * @since v18.3.0, v16.17.0 - * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: - * @return The parsed command line arguments: - */ - export function parseArgs(config?: T): ParsedResults; - interface ParseArgsOptionConfig { - /** - * Type of argument. - */ - type: "string" | "boolean"; - /** - * Whether this option can be provided multiple times. - * If `true`, all values will be collected in an array. - * If `false`, values for the option are last-wins. - * @default false. - */ - multiple?: boolean | undefined; - /** - * A single character alias for the option. - */ - short?: string | undefined; - /** - * The default option value when it is not set by args. - * It must be of the same type as the the `type` property. - * When `multiple` is `true`, it must be an array. - * @since v18.11.0 - */ - default?: string | boolean | string[] | boolean[] | undefined; - } - interface ParseArgsOptionsConfig { - [longOption: string]: ParseArgsOptionConfig; - } - export interface ParseArgsConfig { - /** - * Array of argument strings. - */ - args?: string[] | undefined; - /** - * Used to describe arguments known to the parser. - */ - options?: ParseArgsOptionsConfig | undefined; - /** - * Should an error be thrown when unknown arguments are encountered, - * or when arguments are passed that do not match the `type` configured in `options`. - * @default true - */ - strict?: boolean | undefined; - /** - * Whether this command accepts positional arguments. - */ - allowPositionals?: boolean | undefined; - /** - * Return the parsed tokens. This is useful for extending the built-in behavior, - * from adding additional checks through to reprocessing the tokens in different ways. - * @default false - */ - tokens?: boolean | undefined; - } - /* - IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. - TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 - This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". - But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. - So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. - This is technically incorrect but is a much nicer UX for the common case. - The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. - */ - type IfDefaultsTrue = T extends true ? IfTrue - : T extends false ? IfFalse - : IfTrue; - - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` - type IfDefaultsFalse = T extends false ? IfFalse - : T extends true ? IfTrue - : IfFalse; - - type ExtractOptionValue = IfDefaultsTrue< - T["strict"], - O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, - string | boolean - >; - - type ParsedValues = - & IfDefaultsTrue - & (T["options"] extends ParseArgsOptionsConfig ? { - -readonly [LongOption in keyof T["options"]]: IfDefaultsFalse< - T["options"][LongOption]["multiple"], - undefined | Array>, - undefined | ExtractOptionValue - >; - } - : {}); - - type ParsedPositionals = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type PreciseTokenForOptions< - K extends string, - O extends ParseArgsOptionConfig, - > = O["type"] extends "string" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: string; - inlineValue: boolean; - } - : O["type"] extends "boolean" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: undefined; - inlineValue: undefined; - } - : OptionToken & { name: K }; - - type TokenForOptions< - T extends ParseArgsConfig, - K extends keyof T["options"] = keyof T["options"], - > = K extends unknown - ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions - : OptionToken - : never; - - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - - type ParsedPositionalToken = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type ParsedTokens = Array< - ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } - >; - - type PreciseParsedResults = IfDefaultsFalse< - T["tokens"], - { - values: ParsedValues; - positionals: ParsedPositionals; - tokens: ParsedTokens; - }, - { - values: ParsedValues; - positionals: ParsedPositionals; - } - >; - - type OptionToken = - | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } - | { - kind: "option"; - index: number; - name: string; - rawName: string; - value: undefined; - inlineValue: undefined; - }; - - type Token = - | OptionToken - | { kind: "positional"; index: number; value: string } - | { kind: "option-terminator"; index: number }; - - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. - // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. - type ParsedResults = ParseArgsConfig extends T ? { - values: { - [longOption: string]: undefined | string | boolean | Array; - }; - positionals: string[]; - tokens?: Token[]; - } - : PreciseParsedResults; - - /** - * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). - * - * In accordance with browser conventions, all properties of `MIMEType` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. - * - * A MIME string is a structured string containing multiple meaningful - * components. When parsed, a `MIMEType` object is returned containing - * properties for each of these components. - * @since v19.1.0, v18.13.0 - * @experimental - */ - export class MIMEType { - /** - * Creates a new MIMEType object by parsing the input. - * - * A `TypeError` will be thrown if the `input` is not a valid MIME. - * Note that an effort will be made to coerce the given values into strings. - * @param input The input MIME to parse. - */ - constructor(input: string | { toString: () => string }); - - /** - * Gets and sets the type portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript'); - * console.log(myMIME.type); - * // Prints: text - * myMIME.type = 'application'; - * console.log(myMIME.type); - * // Prints: application - * console.log(String(myMIME)); - * // Prints: application/javascript - * ``` - */ - type: string; - /** - * Gets and sets the subtype portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/ecmascript'); - * console.log(myMIME.subtype); - * // Prints: ecmascript - * myMIME.subtype = 'javascript'; - * console.log(myMIME.subtype); - * // Prints: javascript - * console.log(String(myMIME)); - * // Prints: text/javascript - * ``` - */ - subtype: string; - /** - * Gets the essence of the MIME. This property is read only. - * Use `mime.type` or `mime.subtype` to alter the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript;key=value'); - * console.log(myMIME.essence); - * // Prints: text/javascript - * myMIME.type = 'application'; - * console.log(myMIME.essence); - * // Prints: application/javascript - * console.log(String(myMIME)); - * // Prints: application/javascript;key=value - * ``` - */ - readonly essence: string; - /** - * Gets the `MIMEParams` object representing the - * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. - */ - readonly params: MIMEParams; - /** - * The `toString()` method on the `MIMEType` object returns the serialized MIME. - * - * Because of the need for standard compliance, this method does not allow users - * to customize the serialization process of the MIME. - */ - toString(): string; - } - /** - * The `MIMEParams` API provides read and write access to the parameters of a`MIMEType`. - * @since v19.1.0, v18.13.0 - */ - export class MIMEParams { - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - * Each item of the iterator is a JavaScript `Array`. The first item of the array - * is the `name`, the second item of the array is the `value`. - */ - entries(): IterableIterator<[name: string, value: string]>; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an iterator over the names of each name-value pair. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // bar - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `MIMEParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value`. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * params.set('foo', 'def'); - * params.set('baz', 'xyz'); - * console.log(params.toString()); - * // Prints: foo=def;bar=1;baz=xyz - * ``` - */ - set(name: string, value: string): void; - /** - * Returns an iterator over the values of each name-value pair. - */ - values(): IterableIterator; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - */ - [Symbol.iterator]: typeof MIMEParams.prototype.entries; - } -} -declare module "util/types" { - import { KeyObject, webcrypto } from "node:crypto"; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap( - object: T | {}, - ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) - : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). - * - * ```js - * console.log(util.types.isNativeError(new Error())); // true - * console.log(util.types.isNativeError(new TypeError())); // true - * console.log(util.types.isNativeError(new RangeError())); // true - * ``` - * - * Subclasses of the native error types are also native errors: - * - * ```js - * class MyError extends Error {} - * console.log(util.types.isNativeError(new MyError())); // true - * ``` - * - * A value being `instanceof` a native error class is not equivalent to `isNativeError()`returning `true` for that value. `isNativeError()` returns `true` for errors - * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false`for these errors: - * - * ```js - * const vm = require('node:vm'); - * const context = vm.createContext({}); - * const myError = vm.runInContext('new Error()', context); - * console.log(util.types.isNativeError(myError)); // true - * console.log(myError instanceof Error); // false - * ``` - * - * Conversely, `isNativeError()` returns `false` for all objects which were not - * returned by the constructor of a native error. That includes values - * which are `instanceof` native errors: - * - * ```js - * const myError = { __proto__: Error.prototype }; - * console.log(util.types.isNativeError(myError)); // false - * console.log(myError instanceof Error); // true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet( - object: T | {}, - ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module "node:util" { - export * from "util"; -} -declare module "node:util/types" { - export * from "util/types"; -} diff --git a/node_modules/@types/node/ts4.8/v8.d.ts b/node_modules/@types/node/ts4.8/v8.d.ts deleted file mode 100644 index 6790e76..0000000 --- a/node_modules/@types/node/ts4.8/v8.d.ts +++ /dev/null @@ -1,635 +0,0 @@ -/** - * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: - * - * ```js - * const v8 = require('node:v8'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/v8.js) - */ -declare module "v8" { - import { Readable } from "node:stream"; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - total_global_handles_size: number; - used_global_handles_size: number; - external_memory: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * `total_global_handles_size` The value of total\_global\_handles\_size is the - * total memory size of V8 global handles. - * - * `used_global_handles_size` The value of used\_global\_handles\_size is the - * used memory size of V8 global handles. - * - * `external_memory` The value of external\_memory is the memory size of array - * buffers and external strings. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0, - * total_global_handles_size: 8192, - * used_global_handles_size: 3296, - * external_memory: 318824 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * const v8 = require('node:v8'); - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * // Print heap snapshot to the console - * const v8 = require('node:v8'); - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable containing the V8 heap snapshot. - */ - function getHeapSnapshot(): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * const { writeHeapSnapshot } = require('node:v8'); - * const { - * Worker, - * isMainThread, - * parentPort, - * } = require('node:worker_threads'); - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string): string; - /** - * Get statistics about code and its metadata in the heap, see - * V8[`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the - * following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794, - * cpu_profiler_metadata_size: 0, - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer's internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before`.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer's internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * - * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to - * serialize a huge object which requires buffer - * larger than `buffer.constants.MAX_LENGTH`. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.TypedArray): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function stopCoverage(): void; - /** - * This API collects GC data in current thread. - * @since v19.6.0, v18.15.0 - */ - class GCProfiler { - /** - * Start collecting GC data. - * @since v19.6.0, v18.15.0 - */ - start(): void; - /** - * Stop collecting GC data and return an object.The content of object - * is as follows. - * - * ```json - * { - * "version": 1, - * "startTime": 1674059033862, - * "statistics": [ - * { - * "gcType": "Scavenge", - * "beforeGC": { - * "heapStatistics": { - * "totalHeapSize": 5005312, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5226496, - * "totalAvailableSize": 4341325216, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4883840, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * }, - * "cost": 1574.14, - * "afterGC": { - * "heapStatistics": { - * "totalHeapSize": 6053888, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5500928, - * "totalAvailableSize": 4341101384, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4059096, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * } - * } - * ], - * "endTime": 1674059036865 - * } - * ``` - * - * Here's an example. - * - * ```js - * const { GCProfiler } = require('v8'); - * const profiler = new GCProfiler(); - * profiler.start(); - * setTimeout(() => { - * console.log(profiler.stop()); - * }, 1000); - * ``` - * @since v19.6.0, v18.15.0 - */ - stop(): GCProfilerResult; - } - interface GCProfilerResult { - version: number; - startTime: number; - endTime: number; - statistics: Array<{ - gcType: string; - cost: number; - beforeGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - afterGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - }>; - } - interface HeapStatistics { - totalHeapSize: number; - totalHeapSizeExecutable: number; - totalPhysicalSize: number; - totalAvailableSize: number; - totalGlobalHandlesSize: number; - usedGlobalHandlesSize: number; - usedHeapSize: number; - heapSizeLimit: number; - mallocedMemory: number; - externalMemory: number; - peakMallocedMemory: number; - } - interface HeapSpaceStatistics { - spaceName: string; - spaceSize: number; - spaceUsedSize: number; - spaceAvailableSize: number; - physicalSpaceSize: number; - } - /** - * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will - * happen if a promise is created without ever getting a continuation. - * @since v17.1.0, v16.14.0 - * @param promise The promise being created. - * @param parent The promise continued from, if applicable. - */ - interface Init { - (promise: Promise, parent: Promise): void; - } - /** - * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. - * - * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. - * The before callback may be called many times in the case where many continuations have been made from the same promise. - * @since v17.1.0, v16.14.0 - */ - interface Before { - (promise: Promise): void; - } - /** - * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. - * @since v17.1.0, v16.14.0 - */ - interface After { - (promise: Promise): void; - } - /** - * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or - * {@link Promise.reject()}. - * @since v17.1.0, v16.14.0 - */ - interface Settled { - (promise: Promise): void; - } - /** - * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or - * around an await, and when the promise resolves or rejects. - * - * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and - * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. - * @since v17.1.0, v16.14.0 - */ - interface HookCallbacks { - init?: Init; - before?: Before; - after?: After; - settled?: Settled; - } - interface PromiseHooks { - /** - * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param init The {@link Init | `init` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onInit: (init: Init) => Function; - /** - * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param settled The {@link Settled | `settled` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onSettled: (settled: Settled) => Function; - /** - * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param before The {@link Before | `before` callback} to call before a promise continuation executes. - * @return Call to stop the hook. - */ - onBefore: (before: Before) => Function; - /** - * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param after The {@link After | `after` callback} to call after a promise continuation executes. - * @return Call to stop the hook. - */ - onAfter: (after: After) => Function; - /** - * Registers functions to be called for different lifetime events of each promise. - * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. - * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. - * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register - * @return Used for disabling hooks - */ - createHook: (callbacks: HookCallbacks) => Function; - } - /** - * The `promiseHooks` interface can be used to track promise lifecycle events. - * @since v17.1.0, v16.14.0 - */ - const promiseHooks: PromiseHooks; -} -declare module "node:v8" { - export * from "v8"; -} diff --git a/node_modules/@types/node/ts4.8/vm.d.ts b/node_modules/@types/node/ts4.8/vm.d.ts deleted file mode 100644 index 3a310cc..0000000 --- a/node_modules/@types/node/ts4.8/vm.d.ts +++ /dev/null @@ -1,903 +0,0 @@ -/** - * The `node:vm` module enables compiling and running code within V8 Virtual - * Machine contexts. - * - * **The `node:vm` module is not a security** - * **mechanism. Do not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * const vm = require('node:vm'); - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/vm.js) - */ -declare module "vm" { - import { ImportAttributes } from "node:module"; - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * Default: `''`. - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * Default: `0`. - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - /** - * V8's code cache data for the supplied source. - */ - cachedData?: Buffer | NodeJS.ArrayBufferView | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - /** - * Called during evaluation of this module when `import()` is called. - * If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`. - */ - importModuleDynamically?: - | ((specifier: string, script: Script, importAttributes: ImportAttributes) => Module) - | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * Default: `true`. - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * Default: `false`. - */ - breakOnSigint?: boolean | undefined; - } - interface RunningScriptInNewContextOptions extends RunningScriptOptions { - /** - * Human-readable name of the newly created context. - */ - contextName?: CreateContextOptions["name"]; - /** - * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, - * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - */ - contextOrigin?: CreateContextOptions["origin"]; - contextCodeGeneration?: CreateContextOptions["codeGeneration"]; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: CreateContextOptions["microtaskMode"]; - } - interface RunningCodeOptions extends RunningScriptOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * Default: `false`, - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string | undefined; - /** - * Corresponds to the newly created context for display purposes. - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), - * like the value of the `url.origin` property of a URL object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - * @default '' - */ - origin?: string | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: "afterEvaluate" | undefined; - } - type MeasureMemoryMode = "summary" | "detailed"; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - /** - * @default 'default' - */ - execution?: "default" | "eager" | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions | string); - /** - * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * const vm = require('node:vm'); - * - * const context = { - * animal: 'cat', - * count: 2, - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; - /** - * First contextifies the given `contextObject`, runs the compiled code contained - * by the `vm.Script` object within the created context, and returns the result. - * Running code does not have access to local scope. - * - * The following example compiles code that sets a global variable, then executes - * the code multiple times in different contexts. The globals are set on and - * contained within each individual `context`. - * - * ```js - * const vm = require('node:vm'); - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any; - /** - * Runs the compiled code contained by the `vm.Script` within the context of the - * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * const vm = require('node:vm'); - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * The code cache of the `Script` doesn't contain any JavaScript observable - * states. The code cache is safe to be saved along side the script source and - * used to construct new `Script` instances multiple times. - * - * Functions in the `Script` source can be marked as lazily compiled and they are - * not compiled at construction of the `Script`. These functions are going to be - * compiled when they are invoked the first time. The code cache serializes the - * metadata that V8 currently knows about the `Script` that it can use to speed up - * future compilations. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutAdd = script.createCachedData(); - * // In `cacheWithoutAdd` the function `add()` is marked for full compilation - * // upon invocation. - * - * script.runInThisContext(); - * - * const cacheWithAdd = script.createCachedData(); - * // `cacheWithAdd` contains fully compiled function `add()`. - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - /** - * When `cachedData` is supplied to create the `vm.Script`, this value will be set - * to either `true` or `false` depending on acceptance of the data by V8\. - * Otherwise the value is `undefined`. - * @since v5.7.0 - */ - cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; - /** - * When the script is compiled from a source that contains a source map magic - * comment, this property will be set to the URL of the source map. - * - * ```js - * import vm from 'node:vm'; - * - * const script = new vm.Script(` - * function myFunc() {} - * //# sourceMappingURL=sourcemap.json - * `); - * - * console.log(script.sourceMapURL); - * // Prints: sourcemap.json - * ``` - * @since v19.1.0, v18.13.0 - */ - sourceMapURL?: string | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will `prepare - * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, - * the `contextObject` will be the global object, retaining all of its existing - * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables - * will remain unchanged. - * - * ```js - * const vm = require('node:vm'); - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * The `vm.createContext()` method is primarily useful for creating a single - * context that can be used to run multiple scripts. For instance, if emulating a - * web browser, the method can be used to create a single context representing a - * window's global object, then run all ` - -``` - -Open the above .html file in a browser and you should see - -Node Example - -**[Full online demo](http://kpdecker.github.com/jsdiff)** - -## Compatibility - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/jsdiff.svg)](https://saucelabs.com/u/jsdiff) - -jsdiff supports all ES3 environments with some known issues on IE8 and below. Under these browsers some diff algorithms such as word diff and others may fail due to lack of support for capturing groups in the `split` operation. - -## License - -See [LICENSE](https://github.com/kpdecker/jsdiff/blob/master/LICENSE). diff --git a/node_modules/diff/dist/diff.js b/node_modules/diff/dist/diff.js deleted file mode 100644 index 03571ca..0000000 --- a/node_modules/diff/dist/diff.js +++ /dev/null @@ -1,1585 +0,0 @@ -/*! - - diff v4.0.1 - -Software License Agreement (BSD License) - -Copyright (c) 2009-2015, Kevin Decker - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@license -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.Diff = {})); -}(this, function (exports) { 'use strict'; - - function Diff() {} - Diff.prototype = { - diff: function diff(oldString, newString) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var callback = options.callback; - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - this.options = options; - var self = this; - - function done(value) { - if (callback) { - setTimeout(function () { - callback(undefined, value); - }, 0); - return true; - } else { - return value; - } - } // Allow subclasses to massage the input prior to running - - - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, - oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; // Seed editLength = 0, i.e. the content starts with the same values - - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - // Identity per the equality and tokenizer - return done([{ - value: this.join(newString), - count: newString.length - }]); - } // Main worker method. checks all permutations of a given edit length for acceptance. - - - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = void 0; - - var addPath = bestPath[diagonalPath - 1], - removePath = bestPath[diagonalPath + 1], - _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath - 1] = undefined; - } - - var canAdd = addPath && addPath.newPos + 1 < newLen, - canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - bestPath[diagonalPath] = undefined; - continue; - } // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - - - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self.pushComponent(basePath.components, undefined, true); - } else { - basePath = addPath; // No need to clone, we've pulled it from the list - - basePath.newPos++; - self.pushComponent(basePath.components, true, undefined); - } - - _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done - - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); - } else { - // Otherwise track this path as a potential candidate and continue. - bestPath[diagonalPath] = basePath; - } - } - - editLength++; - } // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. - - - if (callback) { - (function exec() { - setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ - if (editLength > maxEditLength) { - return callback(); - } - - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - - if (ret) { - return ret; - } - } - } - }, - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; - - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length - 1] = { - count: last.count + 1, - added: added, - removed: removed - }; - } else { - components.push({ - count: 1, - added: added, - removed: removed - }); - } - }, - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath, - commonCount = 0; - - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - - basePath.newPos = newPos; - return oldPos; - }, - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - removeEmpty: function removeEmpty(array) { - var ret = []; - - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - - return ret; - }, - castInput: function castInput(value) { - return value; - }, - tokenize: function tokenize(value) { - return value.split(''); - }, - join: function join(chars) { - return chars.join(''); - } - }; - - function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, - componentLen = components.length, - newPos = 0, - oldPos = 0; - - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } - - newPos += component.count; // Common case - - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; // Reverse add and remove so removes are output first to match common convention - // The diffing algorithm is tied to add then remove output and this is the simplest - // route to get the desired output with minimal overhead. - - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } // Special case handle for when one terminal is ignored (i.e. whitespace). - // For this case we merge the terminal into the prior string and drop the change. - // This is only available for string mode. - - - var lastComponent = components[componentLen - 1]; - - if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - - return components; - } - - function clonePath(path) { - return { - newPos: path.newPos, - components: path.components.slice(0) - }; - } - - var characterDiff = new Diff(); - function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); - } - - function generateOptions(options, defaults) { - if (typeof options === 'function') { - defaults.callback = options; - } else if (options) { - for (var name in options) { - /* istanbul ignore else */ - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - - return defaults; - } - - // - // Ranges and exceptions: - // Latin-1 Supplement, 0080–00FF - // - U+00D7 × Multiplication sign - // - U+00F7 ÷ Division sign - // Latin Extended-A, 0100–017F - // Latin Extended-B, 0180–024F - // IPA Extensions, 0250–02AF - // Spacing Modifier Letters, 02B0–02FF - // - U+02C7 ˇ ˇ Caron - // - U+02D8 ˘ ˘ Breve - // - U+02D9 ˙ ˙ Dot Above - // - U+02DA ˚ ˚ Ring Above - // - U+02DB ˛ ˛ Ogonek - // - U+02DC ˜ ˜ Small Tilde - // - U+02DD ˝ ˝ Double Acute Accent - // Latin Extended Additional, 1E00–1EFF - - var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; - var reWhitespace = /\S/; - var wordDiff = new Diff(); - - wordDiff.equals = function (left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); - }; - - wordDiff.tokenize = function (value) { - var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. - - for (var i = 0; i < tokens.length - 1; i++) { - // If we have an empty string in the next field and we have only word chars before and after, merge - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - - return tokens; - }; - - function diffWords(oldStr, newStr, options) { - options = generateOptions(options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); - } - function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); - } - - var lineDiff = new Diff(); - - lineDiff.tokenize = function (value) { - var retLines = [], - linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line - - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } // Merge the content and line separators into single tokens - - - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - - retLines.push(line); - } - } - - return retLines; - }; - - function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); - } - function diffTrimmedLines(oldStr, newStr, callback) { - var options = generateOptions(callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); - } - - var sentenceDiff = new Diff(); - - sentenceDiff.tokenize = function (value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); - }; - - function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); - } - - var cssDiff = new Diff(); - - cssDiff.tokenize = function (value) { - return value.split(/([{}:;,]|\s+)/); - }; - - function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); - } - - function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); - } - - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } - } - - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); - } - - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); - } - - var objectPrototypeToString = Object.prototype.toString; - var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a - // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: - - jsonDiff.useLongestToken = true; - jsonDiff.tokenize = lineDiff.tokenize; - - jsonDiff.castInput = function (value) { - var _this$options = this.options, - undefinedReplacement = _this$options.undefinedReplacement, - _this$options$stringi = _this$options.stringifyReplacer, - stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) { - return typeof v === 'undefined' ? undefinedReplacement : v; - } : _this$options$stringi; - return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); - }; - - jsonDiff.equals = function (left, right) { - return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')); - }; - - function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); - } // This function handles the presence of circular references by bailing out when encountering an - // object that is already on the "stack" of items being processed. Accepts an optional replacer - - function canonicalize(obj, stack, replacementStack, replacer, key) { - stack = stack || []; - replacementStack = replacementStack || []; - - if (replacer) { - obj = replacer(key, obj); - } - - var i; - - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - - var canonicalizedObj; - - if ('[object Array]' === objectPrototypeToString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); - } - - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - - if (_typeof(obj) === 'object' && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - - var sortedKeys = [], - _key; - - for (_key in obj) { - /* istanbul ignore else */ - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - - sortedKeys.sort(); - - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - - return canonicalizedObj; - } - - var arrayDiff = new Diff(); - - arrayDiff.tokenize = function (value) { - return value.slice(); - }; - - arrayDiff.join = arrayDiff.removeEmpty = function (value) { - return value; - }; - - function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); - } - - function parsePatch(uniDiff) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], - list = [], - i = 0; - - function parseIndex() { - var index = {}; - list.push(index); // Parse diff metadata - - while (i < diffstr.length) { - var line = diffstr[i]; // File header found, end parsing diff metadata - - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } // Diff index - - - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - - if (header) { - index.index = header[1]; - } - - i++; - } // Parse file headers if they are defined. Unified diff requires them, but - // there's no technical issues to have an isolated hunk without file header - - - parseFileHeader(index); - parseFileHeader(index); // Parse hunks - - index.hunks = []; - - while (i < diffstr.length) { - var _line = diffstr[i]; - - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - // Ignore unexpected content unless in strict mode - throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); - } else { - i++; - } - } - } // Parses the --- and +++ headers, if none are found, no lines - // are consumed. - - - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - - if (fileHeader) { - var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; - var data = fileHeader[2].split('\t', 2); - var fileName = data[0].replace(/\\\\/g, '\\'); - - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - - index[keyPrefix + 'FileName'] = fileName; - index[keyPrefix + 'Header'] = (data[1] || '').trim(); - i++; - } - } // Parses a hunk - // This assumes that we are at the start of a hunk. - - - function parseHunk() { - var chunkHeaderIndex = i, - chunkHeaderLine = diffstr[i++], - chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: +chunkHeader[2] || 1, - newStart: +chunkHeader[3], - newLines: +chunkHeader[4] || 1, - lines: [], - linedelimiters: [] - }; - var addCount = 0, - removeCount = 0; - - for (; i < diffstr.length; i++) { - // Lines starting with '---' could be mistaken for the "remove line" operation - // But they could be the header for the next file. Therefore prune such cases out. - if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { - break; - } - - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; - - if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || '\n'); - - if (operation === '+') { - addCount++; - } else if (operation === '-') { - removeCount++; - } else if (operation === ' ') { - addCount++; - removeCount++; - } - } else { - break; - } - } // Handle the empty block count case - - - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } // Perform optional sanity checking - - - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - - if (removeCount !== hunk.oldLines) { - throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - } - - return hunk; - } - - while (i < diffstr.length) { - parseIndex(); - } - - return list; - } - - // Iterator that traverses in the range of [min, max], stepping - // by distance from a given start position. I.e. for [0, 4], with - // start of 2, this will iterate 2, 3, 1, 4, 0. - function distanceIterator (start, minLine, maxLine) { - var wantForward = true, - backwardExhausted = false, - forwardExhausted = false, - localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } // Check if trying to fit beyond text length, and if not, check it fits - // after offset location (or desired location on first iteration) - - - if (start + localOffset <= maxLine) { - return localOffset; - } - - forwardExhausted = true; - } - - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } // Check if trying to fit before text beginning, and if not, check it fits - // before offset location - - - if (minLine <= start - localOffset) { - return -localOffset++; - } - - backwardExhausted = true; - return iterator(); - } // We tried to fit hunk before text beginning and beyond text length, then - // hunk can't fit on the text. Return undefined - - }; - } - - function applyPatch(source, uniDiff) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (typeof uniDiff === 'string') { - uniDiff = parsePatch(uniDiff); - } - - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error('applyPatch only works with a single input.'); - } - - uniDiff = uniDiff[0]; - } // Apply the diff to the input - - - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], - hunks = uniDiff.hunks, - compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { - return line === patchContent; - }, - errorCount = 0, - fuzzFactor = options.fuzzFactor || 0, - minLine = 0, - offset = 0, - removeEOFNL, - addEOFNL; - /** - * Checks if the hunk exactly fits on the provided location - */ - - - function hunkFits(hunk, toPos) { - for (var j = 0; j < hunk.lines.length; j++) { - var line = hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line; - - if (operation === ' ' || operation === '-') { - // Context sanity check - if (!compareLine(toPos + 1, lines[toPos], operation, content)) { - errorCount++; - - if (errorCount > fuzzFactor) { - return false; - } - } - - toPos++; - } - } - - return true; - } // Search best fit offsets for each hunk based on the previous ones - - - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], - maxLine = lines.length - hunk.oldLines, - localOffset = 0, - toPos = offset + hunk.oldStart - 1; - var iterator = distanceIterator(toPos, minLine, maxLine); - - for (; localOffset !== undefined; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } - } - - if (localOffset === undefined) { - return false; - } // Set lower text limit to end of the current hunk, so next ones don't try - // to fit over already patched text - - - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } // Apply patch hunks - - - var diffOffset = 0; - - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], - _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; - - diffOffset += _hunk.newLines - _hunk.oldLines; - - if (_toPos < 0) { - // Creating a new file - _toPos = 0; - } - - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line, - delimiter = _hunk.linedelimiters[j]; - - if (operation === ' ') { - _toPos++; - } else if (operation === '-') { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - /* istanbul ignore else */ - } else if (operation === '+') { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === '\\') { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; - - if (previousOperation === '+') { - removeEOFNL = true; - } else if (previousOperation === '-') { - addEOFNL = true; - } - } - } - } // Handle EOFNL insertion/removal - - - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(''); - delimiters.push('\n'); - } - - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - - return lines.join(''); - } // Wrapper that supports multiple file patches via callbacks. - - function applyPatches(uniDiff, options) { - if (typeof uniDiff === 'string') { - uniDiff = parsePatch(uniDiff); - } - - var currentIndex = 0; - - function processIndex() { - var index = uniDiff[currentIndex++]; - - if (!index) { - return options.complete(); - } - - options.loadFile(index, function (err, data) { - if (err) { - return options.complete(err); - } - - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function (err) { - if (err) { - return options.complete(err); - } - - processIndex(); - }); - }); - } - - processIndex(); - } - - function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - - if (typeof options.context === 'undefined') { - options.context = 4; - } - - var diff = diffLines(oldStr, newStr, options); - diff.push({ - value: '', - lines: [] - }); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function (entry) { - return ' ' + entry; - }); - } - - var hunks = []; - var oldRangeStart = 0, - newRangeStart = 0, - curRange = [], - oldLine = 1, - newLine = 1; - - var _loop = function _loop(i) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, '').split('\n'); - current.lines = lines; - - if (current.added || current.removed) { - var _curRange; - - // If we have previous context, start with that - if (!oldRangeStart) { - var prev = diff[i - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } // Output our changes - - - (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { - return (current.added ? '+' : '-') + entry; - }))); // Track the updated file position - - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - // Identical context lines. Track line changes - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= options.context * 2 && i < diff.length - 2) { - var _curRange2; - - // Overlapping - (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); - } else { - var _curRange3; - - // end the range and output - var contextSize = Math.min(lines.length, options.context); - - (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); - - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - - if (i >= diff.length - 2 && lines.length <= options.context) { - // EOF is inside this hunk - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - - if (!oldEOFNewline && noNlBeforeAdds) { - // special case: old has no eol and no trailing context; no-nl can end up before adds - curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); - } - - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push('\\ No newline at end of file'); - } - } - - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - - oldLine += lines.length; - newLine += lines.length; - } - }; - - for (var i = 0; i < diff.length; i++) { - _loop(i); - } - - return { - oldFileName: oldFileName, - newFileName: newFileName, - oldHeader: oldHeader, - newHeader: newHeader, - hunks: hunks - }; - } - function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); - var ret = []; - - if (oldFileName == newFileName) { - ret.push('Index: ' + oldFileName); - } - - ret.push('==================================================================='); - ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); - ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); - - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; - ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); - ret.push.apply(ret, hunk.lines); - } - - return ret.join('\n') + '\n'; - } - function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); - } - - function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - - return arrayStartsWith(a, b); - } - function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; - } - } - - return true; - } - - function calcLineCount(hunk) { - var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), - oldLines = _calcOldNewLineCount.oldLines, - newLines = _calcOldNewLineCount.newLines; - - if (oldLines !== undefined) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } - - if (newLines !== undefined) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } - } - function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. - // Leaving sanity checks on this to the API consumer that may know more about the - // meaning in their own context. - - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } - - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - // No header or no change in ours, use theirs (and ours if theirs does not exist) - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - // No header or no change in theirs, use ours - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - // Both changed... figure it out - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } - - ret.hunks = []; - var mineIndex = 0, - theirsIndex = 0, - mineOffset = 0, - theirsOffset = 0; - - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, - theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; - - if (hunkBefore(mineCurrent, theirsCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - // Overlap, merge as best we can - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } - } - - return ret; - } - - function loadPatch(param, base) { - if (typeof param === 'string') { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return parsePatch(param)[0]; - } - - if (!base) { - throw new Error('Must provide a base reference or pass in a patch'); - } - - return structuredPatch(undefined, undefined, base, param); - } - - return param; - } - - function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; - } - - function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine: mine, - theirs: theirs - }; - } - } - - function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; - } - - function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; - } - - function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - // This will generally result in a conflicted hunk, but there are cases where the context - // is the only overlap where we can successfully merge the content here. - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, - their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; // Handle any leading content - - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. - - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], - theirCurrent = their.lines[their.index]; - - if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { - // Both modified ... - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { - var _hunk$lines; - - // Mine inserted - (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); - } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { - var _hunk$lines2; - - // Theirs inserted - (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); - } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { - // Mine removed or edited - removal(hunk, mine, their); - } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { - // Their removed or edited - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - // Context identity - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - // Context mismatch - conflict(hunk, collectChange(mine), collectChange(their)); - } - } // Now push anything that may be remaining - - - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); - } - - function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), - theirChanges = collectChange(their); - - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - // Special case for remove changes that are supersets of one another - if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - var _hunk$lines3; - - (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); - - return; - } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - var _hunk$lines4; - - (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); - - return; - } - } else if (arrayEqual(myChanges, theirChanges)) { - var _hunk$lines5; - - (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); - - return; - } - - conflict(hunk, myChanges, theirChanges); - } - - function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), - theirChanges = collectContext(their, myChanges); - - if (theirChanges.merged) { - var _hunk$lines6; - - (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } - } - - function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine: mine, - theirs: their - }); - } - - function insertLeading(hunk, insert, their) { - while (insert.offset < their.offset && insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - insert.offset++; - } - } - - function insertTrailing(hunk, insert) { - while (insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - } - } - - function collectChange(state) { - var ret = [], - operation = state.lines[state.index][0]; - - while (state.index < state.lines.length) { - var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. - - if (operation === '-' && line[0] === '+') { - operation = '+'; - } - - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } - - return ret; - } - - function collectContext(state, matchChanges) { - var changes = [], - merged = [], - matchIndex = 0, - contextChanges = false, - conflicted = false; - - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], - match = matchChanges[matchIndex]; // Once we've hit our add, then we are done - - if (match[0] === '+') { - break; - } - - contextChanges = contextChanges || change[0] !== ' '; - merged.push(match); - matchIndex++; // Consume any additions in the other block as a conflict to attempt - // to pull in the remaining context after this - - if (change[0] === '+') { - conflicted = true; - - while (change[0] === '+') { - changes.push(change); - change = state.lines[++state.index]; - } - } - - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - - if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { - conflicted = true; - } - - if (conflicted) { - return changes; - } - - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } - - return { - merged: merged, - changes: changes - }; - } - - function allRemoves(changes) { - return changes.reduce(function (prev, change) { - return prev && change[0] === '-'; - }, true); - } - - function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - - if (state.lines[state.index + i] !== ' ' + changeContent) { - return false; - } - } - - state.index += delta; - return true; - } - - function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function (line) { - if (typeof line !== 'string') { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - - if (oldLines !== undefined) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = undefined; - } - } - - if (newLines !== undefined) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = undefined; - } - } - } else { - if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { - newLines++; - } - - if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { - oldLines++; - } - } - }); - return { - oldLines: oldLines, - newLines: newLines - }; - } - - // See: http://code.google.com/p/google-diff-match-patch/wiki/API - function convertChangesToDMP(changes) { - var ret = [], - change, - operation; - - for (var i = 0; i < changes.length; i++) { - change = changes[i]; - - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } - - ret.push([operation, change.value]); - } - - return ret; - } - - function convertChangesToXML(changes) { - var ret = []; - - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - } - - return ret.join(''); - } - - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, '&'); - n = n.replace(//g, '>'); - n = n.replace(/"/g, '"'); - return n; - } - - /* See LICENSE file for terms of use */ - - exports.Diff = Diff; - exports.diffChars = diffChars; - exports.diffWords = diffWords; - exports.diffWordsWithSpace = diffWordsWithSpace; - exports.diffLines = diffLines; - exports.diffTrimmedLines = diffTrimmedLines; - exports.diffSentences = diffSentences; - exports.diffCss = diffCss; - exports.diffJson = diffJson; - exports.diffArrays = diffArrays; - exports.structuredPatch = structuredPatch; - exports.createTwoFilesPatch = createTwoFilesPatch; - exports.createPatch = createPatch; - exports.applyPatch = applyPatch; - exports.applyPatches = applyPatches; - exports.parsePatch = parsePatch; - exports.merge = merge; - exports.convertChangesToDMP = convertChangesToDMP; - exports.convertChangesToXML = convertChangesToXML; - exports.canonicalize = canonicalize; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/node_modules/diff/dist/diff.min.js b/node_modules/diff/dist/diff.min.js deleted file mode 100644 index 976ad93..0000000 --- a/node_modules/diff/dist/diff.min.js +++ /dev/null @@ -1,38 +0,0 @@ -/*! - - diff v4.0.1 - -Software License Agreement (BSD License) - -Copyright (c) 2009-2015, Kevin Decker - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@license -*/ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Diff={})}(this,function(e){"use strict";function t(){}function g(e,n,t,r,i){for(var o=0,s=n.length,l=0,a=0;oe.length?t:e}),u.value=e.join(d)}else u.value=e.join(t.slice(l,l+u.count));l+=u.count,u.added||(a+=u.count)}}var c=n[s-1];return 1=c&&h<=r+1)return d([{value:this.join(u),count:u.length}]);function i(){for(var e=-1*p;e<=p;e+=2){var n=void 0,t=v[e-1],r=v[e+1],i=(r?r.newPos:0)-e;t&&(v[e-1]=void 0);var o=t&&t.newPos+1=c&&h<=i+1)return d(g(f,n.components,u,a,f.useLongestToken));v[e]=n}else v[e]=void 0}var l;p++}if(n)!function e(){setTimeout(function(){if(t=v.length-2&&t.length<=p.context){var u=/\n$/.test(c),f=/\n$/.test(h),d=0==t.length&&x.length>a.oldLines;!u&&d&&x.splice(a.oldLines,0,"\\ No newline at end of file"),(u||d)&&f||x.push("\\ No newline at end of file")}m.push(a),y=w=0,x=[]}L+=t.length,S+=t.length}},o=0;oe.length)return!1;for(var t=0;t"):r.removed&&n.push(""),n.push((i=r.value,void 0,i.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""))),r.added?n.push(""):r.removed&&n.push("")}var i;return n.join("")},e.canonicalize=v,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/node_modules/diff/lib/convert/dmp.js b/node_modules/diff/lib/convert/dmp.js deleted file mode 100644 index 91ff40a..0000000 --- a/node_modules/diff/lib/convert/dmp.js +++ /dev/null @@ -1,32 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.convertChangesToDMP = convertChangesToDMP; - -/*istanbul ignore end*/ -// See: http://code.google.com/p/google-diff-match-patch/wiki/API -function convertChangesToDMP(changes) { - var ret = [], - change, - operation; - - for (var i = 0; i < changes.length; i++) { - change = changes[i]; - - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } - - ret.push([operation, change.value]); - } - - return ret; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvRE1QIiwiY2hhbmdlcyIsInJldCIsImNoYW5nZSIsIm9wZXJhdGlvbiIsImkiLCJsZW5ndGgiLCJhZGRlZCIsInJlbW92ZWQiLCJwdXNoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBO0FBQ08sU0FBU0EsbUJBQVQsQ0FBNkJDLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUlDLEdBQUcsR0FBRyxFQUFWO0FBQUEsTUFDSUMsTUFESjtBQUFBLE1BRUlDLFNBRko7O0FBR0EsT0FBSyxJQUFJQyxDQUFDLEdBQUcsQ0FBYixFQUFnQkEsQ0FBQyxHQUFHSixPQUFPLENBQUNLLE1BQTVCLEVBQW9DRCxDQUFDLEVBQXJDLEVBQXlDO0FBQ3ZDRixJQUFBQSxNQUFNLEdBQUdGLE9BQU8sQ0FBQ0ksQ0FBRCxDQUFoQjs7QUFDQSxRQUFJRixNQUFNLENBQUNJLEtBQVgsRUFBa0I7QUFDaEJILE1BQUFBLFNBQVMsR0FBRyxDQUFaO0FBQ0QsS0FGRCxNQUVPLElBQUlELE1BQU0sQ0FBQ0ssT0FBWCxFQUFvQjtBQUN6QkosTUFBQUEsU0FBUyxHQUFHLENBQUMsQ0FBYjtBQUNELEtBRk0sTUFFQTtBQUNMQSxNQUFBQSxTQUFTLEdBQUcsQ0FBWjtBQUNEOztBQUVERixJQUFBQSxHQUFHLENBQUNPLElBQUosQ0FBUyxDQUFDTCxTQUFELEVBQVlELE1BQU0sQ0FBQ08sS0FBbkIsQ0FBVDtBQUNEOztBQUNELFNBQU9SLEdBQVA7QUFDRCIsInNvdXJjZXNDb250ZW50IjpbIi8vIFNlZTogaHR0cDovL2NvZGUuZ29vZ2xlLmNvbS9wL2dvb2dsZS1kaWZmLW1hdGNoLXBhdGNoL3dpa2kvQVBJXG5leHBvcnQgZnVuY3Rpb24gY29udmVydENoYW5nZXNUb0RNUChjaGFuZ2VzKSB7XG4gIGxldCByZXQgPSBbXSxcbiAgICAgIGNoYW5nZSxcbiAgICAgIG9wZXJhdGlvbjtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgY2hhbmdlID0gY2hhbmdlc1tpXTtcbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAxO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIG9wZXJhdGlvbiA9IC0xO1xuICAgIH0gZWxzZSB7XG4gICAgICBvcGVyYXRpb24gPSAwO1xuICAgIH1cblxuICAgIHJldC5wdXNoKFtvcGVyYXRpb24sIGNoYW5nZS52YWx1ZV0pO1xuICB9XG4gIHJldHVybiByZXQ7XG59XG4iXX0= diff --git a/node_modules/diff/lib/convert/xml.js b/node_modules/diff/lib/convert/xml.js deleted file mode 100644 index 69ec60c..0000000 --- a/node_modules/diff/lib/convert/xml.js +++ /dev/null @@ -1,42 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.convertChangesToXML = convertChangesToXML; - -/*istanbul ignore end*/ -function convertChangesToXML(changes) { - var ret = []; - - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - } - - return ret.join(''); -} - -function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, '&'); - n = n.replace(//g, '>'); - n = n.replace(/"/g, '"'); - return n; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2hhbmdlcyIsInJldCIsImkiLCJsZW5ndGgiLCJjaGFuZ2UiLCJhZGRlZCIsInB1c2giLCJyZW1vdmVkIiwiZXNjYXBlSFRNTCIsInZhbHVlIiwiam9pbiIsInMiLCJuIiwicmVwbGFjZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQU8sU0FBU0EsbUJBQVQsQ0FBNkJDLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUlDLEdBQUcsR0FBRyxFQUFWOztBQUNBLE9BQUssSUFBSUMsQ0FBQyxHQUFHLENBQWIsRUFBZ0JBLENBQUMsR0FBR0YsT0FBTyxDQUFDRyxNQUE1QixFQUFvQ0QsQ0FBQyxFQUFyQyxFQUF5QztBQUN2QyxRQUFJRSxNQUFNLEdBQUdKLE9BQU8sQ0FBQ0UsQ0FBRCxDQUFwQjs7QUFDQSxRQUFJRSxNQUFNLENBQUNDLEtBQVgsRUFBa0I7QUFDaEJKLE1BQUFBLEdBQUcsQ0FBQ0ssSUFBSixDQUFTLE9BQVQ7QUFDRCxLQUZELE1BRU8sSUFBSUYsTUFBTSxDQUFDRyxPQUFYLEVBQW9CO0FBQ3pCTixNQUFBQSxH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aSsrKSB7XG4gICAgbGV0IGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgcmV0LnB1c2goJzxpbnM+Jyk7XG4gICAgfSBlbHNlIGlmIChjaGFuZ2UucmVtb3ZlZCkge1xuICAgICAgcmV0LnB1c2goJzxkZWw+Jyk7XG4gICAgfVxuXG4gICAgcmV0LnB1c2goZXNjYXBlSFRNTChjaGFuZ2UudmFsdWUpKTtcblxuICAgIGlmIChjaGFuZ2UuYWRkZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8L2lucz4nKTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICByZXQucHVzaCgnPC9kZWw+Jyk7XG4gICAgfVxuICB9XG4gIHJldHVybiByZXQuam9pbignJyk7XG59XG5cbmZ1bmN0aW9uIGVzY2FwZUhUTUwocykge1xuICBsZXQgbiA9IHM7XG4gIG4gPSBuLnJlcGxhY2UoLyYvZywgJyZhbXA7Jyk7XG4gIG4gPSBuLnJlcGxhY2UoLzwvZywgJyZsdDsnKTtcbiAgbiA9IG4ucmVwbGFjZSgvPi9nLCAnJmd0OycpO1xuICBuID0gbi5yZXBsYWNlKC9cIi9nLCAnJnF1b3Q7Jyk7XG5cbiAgcmV0dXJuIG47XG59XG4iXX0= diff --git a/node_modules/diff/lib/diff/array.js b/node_modules/diff/lib/diff/array.js deleted file mode 100644 index 81f42ea..0000000 --- a/node_modules/diff/lib/diff/array.js +++ /dev/null @@ -1,45 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffArrays = diffArrays; -exports.arrayDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -var arrayDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); - -/*istanbul ignore start*/ -exports.arrayDiff = arrayDiff; - -/*istanbul ignore end*/ -arrayDiff.tokenize = function (value) { - return value.slice(); -}; - -arrayDiff.join = arrayDiff.removeEmpty = function (value) { - return value; -}; - -function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RGlmZiIsIkRpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic2xpY2UiLCJqb2luIiwicmVtb3ZlRW1wdHkiLCJkaWZmQXJyYXlzIiwib2xkQXJyIiwibmV3QXJyIiwiY2FsbGJhY2siLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7QUFFTyxJQUFNQSxTQUFTLEdBQUc7QUFBSUM7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBSjtBQUFBLEVBQWxCOzs7Ozs7QUFDUEQsU0FBUyxDQUFDRSxRQUFWLEdBQXFCLFVBQVNDLEtBQVQsRUFBZ0I7QUFDbkMsU0FBT0EsS0FBSyxDQUFDQyxLQUFOLEVBQVA7QUFDRCxDQUZEOztBQUdBSixTQUFTLENBQUNLLElBQVYsR0FBaUJMLFNBQVMsQ0FBQ00sV0FBVixHQUF3QixVQUFTSCxLQUFULEVBQWdCO0FBQ3ZELFNBQU9BLEtBQVA7QUFDRCxDQUZEOztBQUlPLFNBQVNJLFVBQVQsQ0FBb0JDLE1BQXBCLEVBQTRCQyxNQUE1QixFQUFvQ0MsUUFBcEMsRUFBOEM7QUFBRSxTQUFPVixTQUFTLENBQUNXLElBQVYsQ0FBZUgsTUFBZixFQUF1QkMsTUFBdkIsRUFBK0JDLFFBQS9CLENBQVA7QUFBa0QiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgYXJyYXlEaWZmID0gbmV3IERpZmYoKTtcbmFycmF5RGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIHJldHVybiB2YWx1ZS5zbGljZSgpO1xufTtcbmFycmF5RGlmZi5qb2luID0gYXJyYXlEaWZmLnJlbW92ZUVtcHR5ID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZBcnJheXMob2xkQXJyLCBuZXdBcnIsIGNhbGxiYWNrKSB7IHJldHVybiBhcnJheURpZmYuZGlmZihvbGRBcnIsIG5ld0FyciwgY2FsbGJhY2spOyB9XG4iXX0= diff --git a/node_modules/diff/lib/diff/base.js b/node_modules/diff/lib/diff/base.js deleted file mode 100644 index ea661fe..0000000 --- a/node_modules/diff/lib/diff/base.js +++ /dev/null @@ -1,304 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Diff; - -/*istanbul ignore end*/ -function Diff() {} - -Diff.prototype = { - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - diff: function diff(oldString, newString) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var callback = options.callback; - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - this.options = options; - var self = this; - - function done(value) { - if (callback) { - setTimeout(function () { - callback(undefined, value); - }, 0); - return true; - } else { - return value; - } - } // Allow subclasses to massage the input prior to running - - - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, - oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; // Seed editLength = 0, i.e. the content starts with the same values - - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - // Identity per the equality and tokenizer - return done([{ - value: this.join(newString), - count: newString.length - }]); - } // Main worker method. checks all permutations of a given edit length for acceptance. - - - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = - /*istanbul ignore start*/ - void 0 - /*istanbul ignore end*/ - ; - - var addPath = bestPath[diagonalPath - 1], - removePath = bestPath[diagonalPath + 1], - _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath - 1] = undefined; - } - - var canAdd = addPath && addPath.newPos + 1 < newLen, - canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - bestPath[diagonalPath] = undefined; - continue; - } // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - - - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self.pushComponent(basePath.components, undefined, true); - } else { - basePath = addPath; // No need to clone, we've pulled it from the list - - basePath.newPos++; - self.pushComponent(basePath.components, true, undefined); - } - - _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done - - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); - } else { - // Otherwise track this path as a potential candidate and continue. - bestPath[diagonalPath] = basePath; - } - } - - editLength++; - } // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. - - - if (callback) { - (function exec() { - setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ - if (editLength > maxEditLength) { - return callback(); - } - - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - - if (ret) { - return ret; - } - } - } - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; - - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length - 1] = { - count: last.count + 1, - added: added, - removed: removed - }; - } else { - components.push({ - count: 1, - added: added, - removed: removed - }); - } - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath, - commonCount = 0; - - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - - basePath.newPos = newPos; - return oldPos; - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - removeEmpty: function removeEmpty(array) { - var ret = []; - - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - - return ret; - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - castInput: function castInput(value) { - return value; - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - tokenize: function tokenize(value) { - return value.split(''); - }, - - /*istanbul ignore start*/ - - /*istanbul ignore end*/ - join: function join(chars) { - return chars.join(''); - } -}; - -function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, - componentLen = components.length, - newPos = 0, - oldPos = 0; - - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } - - newPos += component.count; // Common case - - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; // Reverse add and remove so removes are output first to match common convention - // The diffing algorithm is tied to add then remove output and this is the simplest - // route to get the desired output with minimal overhead. - - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } // Special case handle for when one terminal is ignored (i.e. whitespace). - // For this case we merge the terminal into the prior string and drop the change. - // This is only available for string mode. - - - var lastComponent = components[componentLen - 1]; - - if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - - return components; -} - -function clonePath(path) { - return { - newPos: path.newPos, - components: path.components.slice(0) - }; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsInByb3RvdHlwZSIsImRpZmYiLCJvbGRTdHJpbmciLCJuZXdTdHJpbmciLCJvcHRpb25zIiwiY2FsbGJhY2siLCJzZWxmIiwiZG9uZSIsInZhbHVlIiwic2V0VGltZW91dCIsInVuZGVmaW5lZCIsImNhc3RJbnB1dCIsInJlbW92ZUVtcHR5IiwidG9rZW5pemUiLCJuZXdMZW4iLCJsZW5ndGgiLCJvbGRMZW4iLCJlZGl0TGVuZ3RoIiwibWF4RWRpdExlbmd0aCIsImJlc3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Q29tcG9uZW50LnJlbW92ZWQpXG4gICAgICAmJiBkaWZmLmVxdWFscygnJywgbGFzdENvbXBvbmVudC52YWx1ZSkpIHtcbiAgICBjb21wb25lbnRzW2NvbXBvbmVudExlbiAtIDJdLnZhbHVlICs9IGxhc3RDb21wb25lbnQudmFsdWU7XG4gICAgY29tcG9uZW50cy5wb3AoKTtcbiAgfVxuXG4gIHJldHVybiBjb21wb25lbnRzO1xufVxuXG5mdW5jdGlvbiBjbG9uZVBhdGgocGF0aCkge1xuICByZXR1cm4geyBuZXdQb3M6IHBhdGgubmV3UG9zLCBjb21wb25lbnRzOiBwYXRoLmNvbXBvbmVudHMuc2xpY2UoMCkgfTtcbn1cbiJdfQ== diff --git a/node_modules/diff/lib/diff/character.js b/node_modules/diff/lib/diff/character.js deleted file mode 100644 index 4722b16..0000000 --- a/node_modules/diff/lib/diff/character.js +++ /dev/null @@ -1,37 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffChars = diffChars; -exports.characterDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -var characterDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); - -/*istanbul ignore start*/ -exports.characterDiff = characterDiff; - -/*istanbul ignore end*/ -function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6WyJjaGFyYWN0ZXJEaWZmIiwiRGlmZiIsImRpZmZDaGFycyIsIm9sZFN0ciIsIm5ld1N0ciIsIm9wdGlvbnMiLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7QUFFTyxJQUFNQSxhQUFhLEdBQUc7QUFBSUM7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBSjtBQUFBLEVBQXRCOzs7Ozs7QUFDQSxTQUFTQyxTQUFULENBQW1CQyxNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNDLE9BQW5DLEVBQTRDO0FBQUUsU0FBT0wsYUFBYSxDQUFDTSxJQUFkLENBQW1CSCxNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNDLE9BQW5DLENBQVA7QUFBcUQiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgY2hhcmFjdGVyRGlmZiA9IG5ldyBEaWZmKCk7XG5leHBvcnQgZnVuY3Rpb24gZGlmZkNoYXJzKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKSB7IHJldHVybiBjaGFyYWN0ZXJEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIG9wdGlvbnMpOyB9XG4iXX0= diff --git a/node_modules/diff/lib/diff/css.js b/node_modules/diff/lib/diff/css.js deleted file mode 100644 index 69ba47e..0000000 --- a/node_modules/diff/lib/diff/css.js +++ /dev/null @@ -1,41 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffCss = diffCss; -exports.cssDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -var cssDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); - -/*istanbul ignore start*/ -exports.cssDiff = cssDiff; - -/*istanbul ignore end*/ -cssDiff.tokenize = function (value) { - return value.split(/([{}:;,]|\s+)/); -}; - -function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6WyJjc3NEaWZmIiwiRGlmZiIsInRva2VuaXplIiwidmFsdWUiLCJzcGxpdCIsImRpZmZDc3MiLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7OztBQUVPLElBQU1BLE9BQU8sR0FBRztBQUFJQztBQUFBQTtBQUFBQTtBQUFBQTtBQUFBQTtBQUFBQTtBQUFKO0FBQUEsRUFBaEI7Ozs7OztBQUNQRCxPQUFPLENBQUNFLFFBQVIsR0FBbUIsVUFBU0MsS0FBVCxFQUFnQjtBQUNqQyxTQUFPQSxLQUFLLENBQUNDLEtBQU4sQ0FBWSxlQUFaLENBQVA7QUFDRCxDQUZEOztBQUlPLFNBQVNDLE9BQVQsQ0FBaUJDLE1BQWpCLEVBQXlCQyxNQUF6QixFQUFpQ0MsUUFBakMsRUFBMkM7QUFBRSxTQUFPUixPQUFPLENBQUNTLElBQVIsQ0FBYUgsTUFBYixFQUFxQkMsTUFBckIsRUFBNkJDLFFBQTdCLENBQVA7QUFBZ0QiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgY3NzRGlmZiA9IG5ldyBEaWZmKCk7XG5jc3NEaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlLnNwbGl0KC8oW3t9OjssXXxcXHMrKS8pO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDc3Mob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBjc3NEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuIl19 diff --git a/node_modules/diff/lib/diff/json.js b/node_modules/diff/lib/diff/json.js deleted file mode 100644 index 715ef08..0000000 --- a/node_modules/diff/lib/diff/json.js +++ /dev/null @@ -1,163 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffJson = diffJson; -exports.canonicalize = canonicalize; -exports.jsonDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_line = require("./line") -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/*istanbul ignore end*/ -var objectPrototypeToString = Object.prototype.toString; -var jsonDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a -// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: - -/*istanbul ignore start*/ -exports.jsonDiff = jsonDiff; - -/*istanbul ignore end*/ -jsonDiff.useLongestToken = true; -jsonDiff.tokenize = -/*istanbul ignore start*/ -_line -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -lineDiff -/*istanbul ignore end*/ -.tokenize; - -jsonDiff.castInput = function (value) { - /*istanbul ignore start*/ - var _this$options = - /*istanbul ignore end*/ - this.options, - undefinedReplacement = _this$options.undefinedReplacement, - _this$options$stringi = _this$options.stringifyReplacer, - stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) - /*istanbul ignore start*/ - { - return ( - /*istanbul ignore end*/ - typeof v === 'undefined' ? undefinedReplacement : v - ); - } : _this$options$stringi; - return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); -}; - -jsonDiff.equals = function (left, right) { - return ( - /*istanbul ignore start*/ - _base - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - default - /*istanbul ignore end*/ - .prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) - ); -}; - -function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); -} // This function handles the presence of circular references by bailing out when encountering an -// object that is already on the "stack" of items being processed. Accepts an optional replacer - - -function canonicalize(obj, stack, replacementStack, replacer, key) { - stack = stack || []; - replacementStack = replacementStack || []; - - if (replacer) { - obj = replacer(key, obj); - } - - var i; - - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - - var canonicalizedObj; - - if ('[object Array]' === objectPrototypeToString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); - } - - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - - if ( - /*istanbul ignore start*/ - _typeof( - /*istanbul ignore end*/ - obj) === 'object' && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - - var sortedKeys = [], - _key; - - for (_key in obj) { - /* istanbul ignore else */ - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - - sortedKeys.sort(); - - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - - return canonicalizedObj; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOlsib2JqZWN0UHJvdG90eXBlVG9TdHJpbmciLCJPYmplY3QiLCJwcm90b3R5cGUiLCJ0b1N0cmluZyIsImpzb25EaWZmIiwiRGlmZiIsInVzZUxvbmdlc3RUb2tlbiIsInRva2VuaXplIiwibGluZURpZmYiLCJjYXN0SW5wdXQiLCJ2YWx1ZSIsIm9wdGlvbnMiLCJ1bmRlZmluZWRSZXBsYWNlbWVudCIsInN0cmluZ2lmeVJlcGxhY2VyIiwiayIsInYiLCJKU09OIiwic3RyaW5naWZ5IiwiY2Fub25pY2FsaXplIiwiZXF1YWxzIiwibGVmdCIsInJpZ2h0IiwiY2FsbCIsInJlcGxhY2UiLCJkaWZmSnNvbiIsIm9sZE9iaiIsIm5ld09iaiIsImRpZmYiLCJvYmoiLCJzdGFjayIsInJlcGxhY2VtZW50U3RhY2siLCJyZXBsYWNlciIsImtleSIsImkiLCJsZW5ndGgiLCJjYW5vbmljYWxpemVkT2JqIiwicHVzaCIsIkFycmF5IiwicG9wIiwidG9KU09OIiwic29ydGVkS2V5cyIsImhhc093blByb3BlcnR5Iiwic29ydCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQUE7Ozs7Ozs7QUFFQSxJQUFNQSx1QkFBdUIsR0FBR0MsTUFBTSxDQUFDQyxTQUFQLENBQWlCQyxRQUFqR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3AoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnBvcCgpO1xuICB9IGVsc2Uge1xuICAgIGNhbm9uaWNhbGl6ZWRPYmogPSBvYmo7XG4gIH1cbiAgcmV0dXJuIGNhbm9uaWNhbGl6ZWRPYmo7XG59XG4iXX0= diff --git a/node_modules/diff/lib/diff/line.js b/node_modules/diff/lib/diff/line.js deleted file mode 100644 index f323f84..0000000 --- a/node_modules/diff/lib/diff/line.js +++ /dev/null @@ -1,89 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffLines = diffLines; -exports.diffTrimmedLines = diffTrimmedLines; -exports.lineDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_params = require("../util/params") -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -var lineDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); - -/*istanbul ignore start*/ -exports.lineDiff = lineDiff; - -/*istanbul ignore end*/ -lineDiff.tokenize = function (value) { - var retLines = [], - linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line - - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } // Merge the content and line separators into single tokens - - - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - - retLines.push(line); - } - } - - return retLines; -}; - -function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); -} - -function diffTrimmedLines(oldStr, newStr, callback) { - var options = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _params - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - generateOptions) - /*istanbul ignore end*/ - (callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsibGluZURpZmYiLCJEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJkaWZmTGluZXMiLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiLCJkaWZmVHJpbW1lZExpbmVzIiwiZ2VuZXJhdGVPcHRpb25zIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7QUFFTyxJQUFNQSxRQUFRLEdBQUc7QUFBSUM7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBSjtBQUFBLEVBQWpCOzs7Ozs7QUFDUEQsUUFBUSxDQUFDRSxRQUFULEdBQW9CLFVBQVNDLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSUMsUUFBUSxHQUFHLEVBQWY7QUFBQSxNQUNJQyxnQkFBZ0IsR0FBR0YsS0FBSyxDQUFDRyxLQUFOLENBQVksV0FBWixDQUR2QixDQURrQyxDQUlsQzs7QUFDQSxNQUFJLENBQUNELGdCQUFnQixDQUFDQSxnQkFBZ0IsQ0FBQ0UsTUFBakIsR0FBMEIsQ0FBM0I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ZTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKHRoaXMub3B0aW9ucy5pZ25vcmVXaGl0ZXNwYWNlKSB7XG4gICAgICAgIGxpbmUgPSBsaW5lLnRyaW0oKTtcbiAgICAgIH1cbiAgICAgIHJldExpbmVzLnB1c2gobGluZSk7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHJldExpbmVzO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZMaW5lcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIGxpbmVEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZUcmltbWVkTGluZXMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7XG4gIGxldCBvcHRpb25zID0gZ2VuZXJhdGVPcHRpb25zKGNhbGxiYWNrLCB7aWdub3JlV2hpdGVzcGFjZTogdHJ1ZX0pO1xuICByZXR1cm4gbGluZURpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG4iXX0= diff --git a/node_modules/diff/lib/diff/sentence.js b/node_modules/diff/lib/diff/sentence.js deleted file mode 100644 index 9ee96e9..0000000 --- a/node_modules/diff/lib/diff/sentence.js +++ /dev/null @@ -1,41 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffSentences = diffSentences; -exports.sentenceDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -var sentenceDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); - -/*istanbul ignore start*/ -exports.sentenceDiff = sentenceDiff; - -/*istanbul ignore end*/ -sentenceDiff.tokenize = function (value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); -}; - -function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbInNlbnRlbmNlRGlmZiIsIkRpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic3BsaXQiLCJkaWZmU2VudGVuY2VzIiwib2xkU3RyIiwibmV3U3RyIiwiY2FsbGJhY2siLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7QUFHTyxJQUFNQSxZQUFZLEdBQUc7QUFBSUM7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBSjtBQUFBLEVBQXJCOzs7Ozs7QUFDUEQsWUFBWSxDQUFDRSxRQUFiLEdBQXdCLFVBQVNDLEtBQVQsRUFBZ0I7QUFDdEMsU0FBT0EsS0FBSyxDQUFDQyxLQUFOLENBQVksdUJBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBU0MsYUFBVCxDQUF1QkMsTUFBdkIsRUFBK0JDLE1BQS9CLEVBQXVDQyxRQUF2QyxFQUFpRDtBQUFFLFNBQU9SLFlBQVksQ0FBQ1MsSUFBYixDQUFrQkgsTUFBbEIsRUFBMEJDLE1BQTFCLEVBQWtDQyxRQUFsQyxDQUFQO0FBQXFEIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuXG5leHBvcnQgY29uc3Qgc2VudGVuY2VEaWZmID0gbmV3IERpZmYoKTtcbnNlbnRlbmNlRGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIHJldHVybiB2YWx1ZS5zcGxpdCgvKFxcUy4rP1suIT9dKSg/PVxccyt8JCkvKTtcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmU2VudGVuY2VzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gc2VudGVuY2VEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuIl19 diff --git a/node_modules/diff/lib/diff/word.js b/node_modules/diff/lib/diff/word.js deleted file mode 100644 index 0b952e0..0000000 --- a/node_modules/diff/lib/diff/word.js +++ /dev/null @@ -1,107 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.diffWords = diffWords; -exports.diffWordsWithSpace = diffWordsWithSpace; -exports.wordDiff = void 0; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./base")) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_params = require("../util/params") -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode -// -// Ranges and exceptions: -// Latin-1 Supplement, 0080–00FF -// - U+00D7 × Multiplication sign -// - U+00F7 ÷ Division sign -// Latin Extended-A, 0100–017F -// Latin Extended-B, 0180–024F -// IPA Extensions, 0250–02AF -// Spacing Modifier Letters, 02B0–02FF -// - U+02C7 ˇ ˇ Caron -// - U+02D8 ˘ ˘ Breve -// - U+02D9 ˙ ˙ Dot Above -// - U+02DA ˚ ˚ Ring Above -// - U+02DB ˛ ˛ Ogonek -// - U+02DC ˜ ˜ Small Tilde -// - U+02DD ˝ ˝ Double Acute Accent -// Latin Extended Additional, 1E00–1EFF -var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; -var reWhitespace = /\S/; -var wordDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -default -/*istanbul ignore end*/ -(); - -/*istanbul ignore start*/ -exports.wordDiff = wordDiff; - -/*istanbul ignore end*/ -wordDiff.equals = function (left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); -}; - -wordDiff.tokenize = function (value) { - var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. - - for (var i = 0; i < tokens.length - 1; i++) { - // If we have an empty string in the next field and we have only word chars before and after, merge - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - - return tokens; -}; - -function diffWords(oldStr, newStr, options) { - options = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _params - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - generateOptions) - /*istanbul ignore end*/ - (options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); -} - -function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOlsiZXh0ZW5kZWRXb3JkQ2hhcnMiLCJyZVdoaXRlc3BhY2UiLCJ3b3JkRGlmZiIsIkRpZmYiLCJlcXVhbHMiLCJsZWZ0IiwicmlnaHQiLCJvcHRpb25zIiwiaWdub3JlQ2FzZSIsInRvTG93ZXJDYXNlIiwiaWdub3JlV2hpdGVzcGFjZSIsInRlc3QiLCJ0b2tlbml6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pZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG4iXX0= diff --git a/node_modules/diff/lib/index.es6.js b/node_modules/diff/lib/index.es6.js deleted file mode 100644 index b645843..0000000 --- a/node_modules/diff/lib/index.es6.js +++ /dev/null @@ -1,1519 +0,0 @@ -function Diff() {} -Diff.prototype = { - diff: function diff(oldString, newString) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var callback = options.callback; - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - this.options = options; - var self = this; - - function done(value) { - if (callback) { - setTimeout(function () { - callback(undefined, value); - }, 0); - return true; - } else { - return value; - } - } // Allow subclasses to massage the input prior to running - - - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, - oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; // Seed editLength = 0, i.e. the content starts with the same values - - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - // Identity per the equality and tokenizer - return done([{ - value: this.join(newString), - count: newString.length - }]); - } // Main worker method. checks all permutations of a given edit length for acceptance. - - - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = void 0; - - var addPath = bestPath[diagonalPath - 1], - removePath = bestPath[diagonalPath + 1], - _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath - 1] = undefined; - } - - var canAdd = addPath && addPath.newPos + 1 < newLen, - canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - bestPath[diagonalPath] = undefined; - continue; - } // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - - - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self.pushComponent(basePath.components, undefined, true); - } else { - basePath = addPath; // No need to clone, we've pulled it from the list - - basePath.newPos++; - self.pushComponent(basePath.components, true, undefined); - } - - _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done - - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); - } else { - // Otherwise track this path as a potential candidate and continue. - bestPath[diagonalPath] = basePath; - } - } - - editLength++; - } // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. - - - if (callback) { - (function exec() { - setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ - if (editLength > maxEditLength) { - return callback(); - } - - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - - if (ret) { - return ret; - } - } - } - }, - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; - - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length - 1] = { - count: last.count + 1, - added: added, - removed: removed - }; - } else { - components.push({ - count: 1, - added: added, - removed: removed - }); - } - }, - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath, - commonCount = 0; - - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - - basePath.newPos = newPos; - return oldPos; - }, - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - removeEmpty: function removeEmpty(array) { - var ret = []; - - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - - return ret; - }, - castInput: function castInput(value) { - return value; - }, - tokenize: function tokenize(value) { - return value.split(''); - }, - join: function join(chars) { - return chars.join(''); - } -}; - -function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, - componentLen = components.length, - newPos = 0, - oldPos = 0; - - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } - - newPos += component.count; // Common case - - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; // Reverse add and remove so removes are output first to match common convention - // The diffing algorithm is tied to add then remove output and this is the simplest - // route to get the desired output with minimal overhead. - - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } // Special case handle for when one terminal is ignored (i.e. whitespace). - // For this case we merge the terminal into the prior string and drop the change. - // This is only available for string mode. - - - var lastComponent = components[componentLen - 1]; - - if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - - return components; -} - -function clonePath(path) { - return { - newPos: path.newPos, - components: path.components.slice(0) - }; -} - -var characterDiff = new Diff(); -function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); -} - -function generateOptions(options, defaults) { - if (typeof options === 'function') { - defaults.callback = options; - } else if (options) { - for (var name in options) { - /* istanbul ignore else */ - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - - return defaults; -} - -// -// Ranges and exceptions: -// Latin-1 Supplement, 0080–00FF -// - U+00D7 × Multiplication sign -// - U+00F7 ÷ Division sign -// Latin Extended-A, 0100–017F -// Latin Extended-B, 0180–024F -// IPA Extensions, 0250–02AF -// Spacing Modifier Letters, 02B0–02FF -// - U+02C7 ˇ ˇ Caron -// - U+02D8 ˘ ˘ Breve -// - U+02D9 ˙ ˙ Dot Above -// - U+02DA ˚ ˚ Ring Above -// - U+02DB ˛ ˛ Ogonek -// - U+02DC ˜ ˜ Small Tilde -// - U+02DD ˝ ˝ Double Acute Accent -// Latin Extended Additional, 1E00–1EFF - -var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; -var reWhitespace = /\S/; -var wordDiff = new Diff(); - -wordDiff.equals = function (left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); -}; - -wordDiff.tokenize = function (value) { - var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. - - for (var i = 0; i < tokens.length - 1; i++) { - // If we have an empty string in the next field and we have only word chars before and after, merge - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - - return tokens; -}; - -function diffWords(oldStr, newStr, options) { - options = generateOptions(options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); -} -function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); -} - -var lineDiff = new Diff(); - -lineDiff.tokenize = function (value) { - var retLines = [], - linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line - - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } // Merge the content and line separators into single tokens - - - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - - retLines.push(line); - } - } - - return retLines; -}; - -function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); -} -function diffTrimmedLines(oldStr, newStr, callback) { - var options = generateOptions(callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); -} - -var sentenceDiff = new Diff(); - -sentenceDiff.tokenize = function (value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); -}; - -function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); -} - -var cssDiff = new Diff(); - -cssDiff.tokenize = function (value) { - return value.split(/([{}:;,]|\s+)/); -}; - -function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); -} - -function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } -} - -function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); -} - -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); -} - -var objectPrototypeToString = Object.prototype.toString; -var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a -// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: - -jsonDiff.useLongestToken = true; -jsonDiff.tokenize = lineDiff.tokenize; - -jsonDiff.castInput = function (value) { - var _this$options = this.options, - undefinedReplacement = _this$options.undefinedReplacement, - _this$options$stringi = _this$options.stringifyReplacer, - stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) { - return typeof v === 'undefined' ? undefinedReplacement : v; - } : _this$options$stringi; - return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); -}; - -jsonDiff.equals = function (left, right) { - return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')); -}; - -function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); -} // This function handles the presence of circular references by bailing out when encountering an -// object that is already on the "stack" of items being processed. Accepts an optional replacer - -function canonicalize(obj, stack, replacementStack, replacer, key) { - stack = stack || []; - replacementStack = replacementStack || []; - - if (replacer) { - obj = replacer(key, obj); - } - - var i; - - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - - var canonicalizedObj; - - if ('[object Array]' === objectPrototypeToString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); - } - - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - - if (_typeof(obj) === 'object' && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - - var sortedKeys = [], - _key; - - for (_key in obj) { - /* istanbul ignore else */ - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - - sortedKeys.sort(); - - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - - return canonicalizedObj; -} - -var arrayDiff = new Diff(); - -arrayDiff.tokenize = function (value) { - return value.slice(); -}; - -arrayDiff.join = arrayDiff.removeEmpty = function (value) { - return value; -}; - -function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); -} - -function parsePatch(uniDiff) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], - list = [], - i = 0; - - function parseIndex() { - var index = {}; - list.push(index); // Parse diff metadata - - while (i < diffstr.length) { - var line = diffstr[i]; // File header found, end parsing diff metadata - - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } // Diff index - - - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - - if (header) { - index.index = header[1]; - } - - i++; - } // Parse file headers if they are defined. Unified diff requires them, but - // there's no technical issues to have an isolated hunk without file header - - - parseFileHeader(index); - parseFileHeader(index); // Parse hunks - - index.hunks = []; - - while (i < diffstr.length) { - var _line = diffstr[i]; - - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - // Ignore unexpected content unless in strict mode - throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); - } else { - i++; - } - } - } // Parses the --- and +++ headers, if none are found, no lines - // are consumed. - - - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - - if (fileHeader) { - var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; - var data = fileHeader[2].split('\t', 2); - var fileName = data[0].replace(/\\\\/g, '\\'); - - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - - index[keyPrefix + 'FileName'] = fileName; - index[keyPrefix + 'Header'] = (data[1] || '').trim(); - i++; - } - } // Parses a hunk - // This assumes that we are at the start of a hunk. - - - function parseHunk() { - var chunkHeaderIndex = i, - chunkHeaderLine = diffstr[i++], - chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: +chunkHeader[2] || 1, - newStart: +chunkHeader[3], - newLines: +chunkHeader[4] || 1, - lines: [], - linedelimiters: [] - }; - var addCount = 0, - removeCount = 0; - - for (; i < diffstr.length; i++) { - // Lines starting with '---' could be mistaken for the "remove line" operation - // But they could be the header for the next file. Therefore prune such cases out. - if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { - break; - } - - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; - - if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || '\n'); - - if (operation === '+') { - addCount++; - } else if (operation === '-') { - removeCount++; - } else if (operation === ' ') { - addCount++; - removeCount++; - } - } else { - break; - } - } // Handle the empty block count case - - - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } // Perform optional sanity checking - - - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - - if (removeCount !== hunk.oldLines) { - throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - } - - return hunk; - } - - while (i < diffstr.length) { - parseIndex(); - } - - return list; -} - -// Iterator that traverses in the range of [min, max], stepping -// by distance from a given start position. I.e. for [0, 4], with -// start of 2, this will iterate 2, 3, 1, 4, 0. -function distanceIterator (start, minLine, maxLine) { - var wantForward = true, - backwardExhausted = false, - forwardExhausted = false, - localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } // Check if trying to fit beyond text length, and if not, check it fits - // after offset location (or desired location on first iteration) - - - if (start + localOffset <= maxLine) { - return localOffset; - } - - forwardExhausted = true; - } - - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } // Check if trying to fit before text beginning, and if not, check it fits - // before offset location - - - if (minLine <= start - localOffset) { - return -localOffset++; - } - - backwardExhausted = true; - return iterator(); - } // We tried to fit hunk before text beginning and beyond text length, then - // hunk can't fit on the text. Return undefined - - }; -} - -function applyPatch(source, uniDiff) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (typeof uniDiff === 'string') { - uniDiff = parsePatch(uniDiff); - } - - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error('applyPatch only works with a single input.'); - } - - uniDiff = uniDiff[0]; - } // Apply the diff to the input - - - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], - hunks = uniDiff.hunks, - compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { - return line === patchContent; - }, - errorCount = 0, - fuzzFactor = options.fuzzFactor || 0, - minLine = 0, - offset = 0, - removeEOFNL, - addEOFNL; - /** - * Checks if the hunk exactly fits on the provided location - */ - - - function hunkFits(hunk, toPos) { - for (var j = 0; j < hunk.lines.length; j++) { - var line = hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line; - - if (operation === ' ' || operation === '-') { - // Context sanity check - if (!compareLine(toPos + 1, lines[toPos], operation, content)) { - errorCount++; - - if (errorCount > fuzzFactor) { - return false; - } - } - - toPos++; - } - } - - return true; - } // Search best fit offsets for each hunk based on the previous ones - - - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], - maxLine = lines.length - hunk.oldLines, - localOffset = 0, - toPos = offset + hunk.oldStart - 1; - var iterator = distanceIterator(toPos, minLine, maxLine); - - for (; localOffset !== undefined; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } - } - - if (localOffset === undefined) { - return false; - } // Set lower text limit to end of the current hunk, so next ones don't try - // to fit over already patched text - - - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } // Apply patch hunks - - - var diffOffset = 0; - - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], - _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; - - diffOffset += _hunk.newLines - _hunk.oldLines; - - if (_toPos < 0) { - // Creating a new file - _toPos = 0; - } - - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line, - delimiter = _hunk.linedelimiters[j]; - - if (operation === ' ') { - _toPos++; - } else if (operation === '-') { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - /* istanbul ignore else */ - } else if (operation === '+') { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === '\\') { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; - - if (previousOperation === '+') { - removeEOFNL = true; - } else if (previousOperation === '-') { - addEOFNL = true; - } - } - } - } // Handle EOFNL insertion/removal - - - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(''); - delimiters.push('\n'); - } - - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - - return lines.join(''); -} // Wrapper that supports multiple file patches via callbacks. - -function applyPatches(uniDiff, options) { - if (typeof uniDiff === 'string') { - uniDiff = parsePatch(uniDiff); - } - - var currentIndex = 0; - - function processIndex() { - var index = uniDiff[currentIndex++]; - - if (!index) { - return options.complete(); - } - - options.loadFile(index, function (err, data) { - if (err) { - return options.complete(err); - } - - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function (err) { - if (err) { - return options.complete(err); - } - - processIndex(); - }); - }); - } - - processIndex(); -} - -function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - - if (typeof options.context === 'undefined') { - options.context = 4; - } - - var diff = diffLines(oldStr, newStr, options); - diff.push({ - value: '', - lines: [] - }); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function (entry) { - return ' ' + entry; - }); - } - - var hunks = []; - var oldRangeStart = 0, - newRangeStart = 0, - curRange = [], - oldLine = 1, - newLine = 1; - - var _loop = function _loop(i) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, '').split('\n'); - current.lines = lines; - - if (current.added || current.removed) { - var _curRange; - - // If we have previous context, start with that - if (!oldRangeStart) { - var prev = diff[i - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } // Output our changes - - - (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { - return (current.added ? '+' : '-') + entry; - }))); // Track the updated file position - - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - // Identical context lines. Track line changes - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= options.context * 2 && i < diff.length - 2) { - var _curRange2; - - // Overlapping - (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); - } else { - var _curRange3; - - // end the range and output - var contextSize = Math.min(lines.length, options.context); - - (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); - - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - - if (i >= diff.length - 2 && lines.length <= options.context) { - // EOF is inside this hunk - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - - if (!oldEOFNewline && noNlBeforeAdds) { - // special case: old has no eol and no trailing context; no-nl can end up before adds - curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); - } - - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push('\\ No newline at end of file'); - } - } - - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - - oldLine += lines.length; - newLine += lines.length; - } - }; - - for (var i = 0; i < diff.length; i++) { - _loop(i); - } - - return { - oldFileName: oldFileName, - newFileName: newFileName, - oldHeader: oldHeader, - newHeader: newHeader, - hunks: hunks - }; -} -function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); - var ret = []; - - if (oldFileName == newFileName) { - ret.push('Index: ' + oldFileName); - } - - ret.push('==================================================================='); - ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); - ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); - - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; - ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); - ret.push.apply(ret, hunk.lines); - } - - return ret.join('\n') + '\n'; -} -function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); -} - -function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - - return arrayStartsWith(a, b); -} -function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; - } - } - - return true; -} - -function calcLineCount(hunk) { - var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), - oldLines = _calcOldNewLineCount.oldLines, - newLines = _calcOldNewLineCount.newLines; - - if (oldLines !== undefined) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } - - if (newLines !== undefined) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } -} -function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. - // Leaving sanity checks on this to the API consumer that may know more about the - // meaning in their own context. - - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } - - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - // No header or no change in ours, use theirs (and ours if theirs does not exist) - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - // No header or no change in theirs, use ours - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - // Both changed... figure it out - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } - - ret.hunks = []; - var mineIndex = 0, - theirsIndex = 0, - mineOffset = 0, - theirsOffset = 0; - - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, - theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; - - if (hunkBefore(mineCurrent, theirsCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - // Overlap, merge as best we can - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } - } - - return ret; -} - -function loadPatch(param, base) { - if (typeof param === 'string') { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return parsePatch(param)[0]; - } - - if (!base) { - throw new Error('Must provide a base reference or pass in a patch'); - } - - return structuredPatch(undefined, undefined, base, param); - } - - return param; -} - -function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; -} - -function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine: mine, - theirs: theirs - }; - } -} - -function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; -} - -function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; -} - -function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - // This will generally result in a conflicted hunk, but there are cases where the context - // is the only overlap where we can successfully merge the content here. - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, - their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; // Handle any leading content - - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. - - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], - theirCurrent = their.lines[their.index]; - - if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { - // Both modified ... - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { - var _hunk$lines; - - // Mine inserted - (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); - } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { - var _hunk$lines2; - - // Theirs inserted - (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); - } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { - // Mine removed or edited - removal(hunk, mine, their); - } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { - // Their removed or edited - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - // Context identity - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - // Context mismatch - conflict(hunk, collectChange(mine), collectChange(their)); - } - } // Now push anything that may be remaining - - - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); -} - -function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), - theirChanges = collectChange(their); - - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - // Special case for remove changes that are supersets of one another - if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - var _hunk$lines3; - - (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); - - return; - } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - var _hunk$lines4; - - (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); - - return; - } - } else if (arrayEqual(myChanges, theirChanges)) { - var _hunk$lines5; - - (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); - - return; - } - - conflict(hunk, myChanges, theirChanges); -} - -function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), - theirChanges = collectContext(their, myChanges); - - if (theirChanges.merged) { - var _hunk$lines6; - - (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } -} - -function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine: mine, - theirs: their - }); -} - -function insertLeading(hunk, insert, their) { - while (insert.offset < their.offset && insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - insert.offset++; - } -} - -function insertTrailing(hunk, insert) { - while (insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - } -} - -function collectChange(state) { - var ret = [], - operation = state.lines[state.index][0]; - - while (state.index < state.lines.length) { - var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. - - if (operation === '-' && line[0] === '+') { - operation = '+'; - } - - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } - - return ret; -} - -function collectContext(state, matchChanges) { - var changes = [], - merged = [], - matchIndex = 0, - contextChanges = false, - conflicted = false; - - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], - match = matchChanges[matchIndex]; // Once we've hit our add, then we are done - - if (match[0] === '+') { - break; - } - - contextChanges = contextChanges || change[0] !== ' '; - merged.push(match); - matchIndex++; // Consume any additions in the other block as a conflict to attempt - // to pull in the remaining context after this - - if (change[0] === '+') { - conflicted = true; - - while (change[0] === '+') { - changes.push(change); - change = state.lines[++state.index]; - } - } - - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - - if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { - conflicted = true; - } - - if (conflicted) { - return changes; - } - - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } - - return { - merged: merged, - changes: changes - }; -} - -function allRemoves(changes) { - return changes.reduce(function (prev, change) { - return prev && change[0] === '-'; - }, true); -} - -function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - - if (state.lines[state.index + i] !== ' ' + changeContent) { - return false; - } - } - - state.index += delta; - return true; -} - -function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function (line) { - if (typeof line !== 'string') { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - - if (oldLines !== undefined) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = undefined; - } - } - - if (newLines !== undefined) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = undefined; - } - } - } else { - if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { - newLines++; - } - - if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { - oldLines++; - } - } - }); - return { - oldLines: oldLines, - newLines: newLines - }; -} - -// See: http://code.google.com/p/google-diff-match-patch/wiki/API -function convertChangesToDMP(changes) { - var ret = [], - change, - operation; - - for (var i = 0; i < changes.length; i++) { - change = changes[i]; - - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } - - ret.push([operation, change.value]); - } - - return ret; -} - -function convertChangesToXML(changes) { - var ret = []; - - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - } - - return ret.join(''); -} - -function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, '&'); - n = n.replace(//g, '>'); - n = n.replace(/"/g, '"'); - return n; -} - -/* See LICENSE file for terms of use */ - -export { Diff, diffChars, diffWords, diffWordsWithSpace, diffLines, diffTrimmedLines, diffSentences, diffCss, diffJson, diffArrays, structuredPatch, createTwoFilesPatch, createPatch, applyPatch, applyPatches, parsePatch, merge, convertChangesToDMP, convertChangesToXML, canonicalize }; diff --git a/node_modules/diff/lib/index.js b/node_modules/diff/lib/index.js deleted file mode 100644 index ff8ae91..0000000 --- a/node_modules/diff/lib/index.js +++ /dev/null @@ -1,216 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "Diff", { - enumerable: true, - get: function get() { - return _base.default; - } -}); -Object.defineProperty(exports, "diffChars", { - enumerable: true, - get: function get() { - return _character.diffChars; - } -}); -Object.defineProperty(exports, "diffWords", { - enumerable: true, - get: function get() { - return _word.diffWords; - } -}); -Object.defineProperty(exports, "diffWordsWithSpace", { - enumerable: true, - get: function get() { - return _word.diffWordsWithSpace; - } -}); -Object.defineProperty(exports, "diffLines", { - enumerable: true, - get: function get() { - return _line.diffLines; - } -}); -Object.defineProperty(exports, "diffTrimmedLines", { - enumerable: true, - get: function get() { - return _line.diffTrimmedLines; - } -}); -Object.defineProperty(exports, "diffSentences", { - enumerable: true, - get: function get() { - return _sentence.diffSentences; - } -}); -Object.defineProperty(exports, "diffCss", { - enumerable: true, - get: function get() { - return _css.diffCss; - } -}); -Object.defineProperty(exports, "diffJson", { - enumerable: true, - get: function get() { - return _json.diffJson; - } -}); -Object.defineProperty(exports, "canonicalize", { - enumerable: true, - get: function get() { - return _json.canonicalize; - } -}); -Object.defineProperty(exports, "diffArrays", { - enumerable: true, - get: function get() { - return _array.diffArrays; - } -}); -Object.defineProperty(exports, "applyPatch", { - enumerable: true, - get: function get() { - return _apply.applyPatch; - } -}); -Object.defineProperty(exports, "applyPatches", { - enumerable: true, - get: function get() { - return _apply.applyPatches; - } -}); -Object.defineProperty(exports, "parsePatch", { - enumerable: true, - get: function get() { - return _parse.parsePatch; - } -}); -Object.defineProperty(exports, "merge", { - enumerable: true, - get: function get() { - return _merge.merge; - } -}); -Object.defineProperty(exports, "structuredPatch", { - enumerable: true, - get: function get() { - return _create.structuredPatch; - } -}); -Object.defineProperty(exports, "createTwoFilesPatch", { - enumerable: true, - get: function get() { - return _create.createTwoFilesPatch; - } -}); -Object.defineProperty(exports, "createPatch", { - enumerable: true, - get: function get() { - return _create.createPatch; - } -}); -Object.defineProperty(exports, "convertChangesToDMP", { - enumerable: true, - get: function get() { - return _dmp.convertChangesToDMP; - } -}); -Object.defineProperty(exports, "convertChangesToXML", { - enumerable: true, - get: function get() { - return _xml.convertChangesToXML; - } -}); - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(require("./diff/base")) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_character = require("./diff/character") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_word = require("./diff/word") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_line = require("./diff/line") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_sentence = require("./diff/sentence") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_css = require("./diff/css") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_json = require("./diff/json") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_array = require("./diff/array") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_apply = require("./patch/apply") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_parse = require("./patch/parse") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_merge = require("./patch/merge") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_create = require("./patch/create") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_dmp = require("./convert/dmp") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_xml = require("./convert/xml") -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _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mZkFycmF5c30gZnJvbSAnLi9kaWZmL2FycmF5JztcblxuaW1wb3J0IHthcHBseVBhdGNoLCBhcHBseVBhdGNoZXN9IGZyb20gJy4vcGF0Y2gvYXBwbHknO1xuaW1wb3J0IHtwYXJzZVBhdGNofSBmcm9tICcuL3BhdGNoL3BhcnNlJztcbmltcG9ydCB7bWVyZ2V9IGZyb20gJy4vcGF0Y2gvbWVyZ2UnO1xuaW1wb3J0IHtzdHJ1Y3R1cmVkUGF0Y2gsIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gsIGNyZWF0ZVBhdGNofSBmcm9tICcuL3BhdGNoL2NyZWF0ZSc7XG5cbmltcG9ydCB7Y29udmVydENoYW5nZXNUb0RNUH0gZnJvbSAnLi9jb252ZXJ0L2RtcCc7XG5pbXBvcnQge2NvbnZlcnRDaGFuZ2VzVG9YTUx9IGZyb20gJy4vY29udmVydC94bWwnO1xuXG5leHBvcnQge1xuICBEaWZmLFxuXG4gIGRpZmZDaGFycyxcbiAgZGlmZldvcmRzLFxuICBkaWZmV29yZHNXaXRoU3BhY2UsXG4gIGRpZmZMaW5lcyxcbiAgZGlmZlRyaW1tZWRMaW5lcyxcbiAgZGlmZlNlbnRlbmNlcyxcblxuICBkaWZmQ3NzLFxuICBkaWZmSnNvbixcblxuICBkaWZmQXJyYXlzLFxuXG4gIHN0cnVjdHVyZWRQYXRjaCxcbiAgY3JlYXRlVHdvRmlsZXNQYXRjaCxcbiAgY3JlYXRlUGF0Y2gsXG4gIGFwcGx5UGF0Y2gsXG4gIGFwcGx5UGF0Y2hlcyxcbiAgcGFyc2VQYXRjaCxcbiAgbWVyZ2UsXG4gIGNvbnZlcnRDaGFuZ2VzVG9ETVAsXG4gIGNvbnZlcnRDaGFuZ2VzVG9YTUwsXG4gIGNhbm9uaWNhbGl6ZVxufTtcbiJdfQ== diff --git a/node_modules/diff/lib/patch/apply.js b/node_modules/diff/lib/patch/apply.js deleted file mode 100644 index 19bddd8..0000000 --- a/node_modules/diff/lib/patch/apply.js +++ /dev/null @@ -1,243 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.applyPatch = applyPatch; -exports.applyPatches = applyPatches; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_parse = require("./parse") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_distanceIterator = _interopRequireDefault(require("../util/distance-iterator")) -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/*istanbul ignore end*/ -function applyPatch(source, uniDiff) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (typeof uniDiff === 'string') { - uniDiff = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _parse - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - parsePatch) - /*istanbul ignore end*/ - (uniDiff); - } - - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error('applyPatch only works with a single input.'); - } - - uniDiff = uniDiff[0]; - } // Apply the diff to the input - - - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], - hunks = uniDiff.hunks, - compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) - /*istanbul ignore start*/ - { - return ( - /*istanbul ignore end*/ - line === patchContent - ); - }, - errorCount = 0, - fuzzFactor = options.fuzzFactor || 0, - minLine = 0, - offset = 0, - removeEOFNL, - addEOFNL; - /** - * Checks if the hunk exactly fits on the provided location - */ - - - function hunkFits(hunk, toPos) { - for (var j = 0; j < hunk.lines.length; j++) { - var line = hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line; - - if (operation === ' ' || operation === '-') { - // Context sanity check - if (!compareLine(toPos + 1, lines[toPos], operation, content)) { - errorCount++; - - if (errorCount > fuzzFactor) { - return false; - } - } - - toPos++; - } - } - - return true; - } // Search best fit offsets for each hunk based on the previous ones - - - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], - maxLine = lines.length - hunk.oldLines, - localOffset = 0, - toPos = offset + hunk.oldStart - 1; - var iterator = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _distanceIterator - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - default) - /*istanbul ignore end*/ - (toPos, minLine, maxLine); - - for (; localOffset !== undefined; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } - } - - if (localOffset === undefined) { - return false; - } // Set lower text limit to end of the current hunk, so next ones don't try - // to fit over already patched text - - - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } // Apply patch hunks - - - var diffOffset = 0; - - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], - _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; - - diffOffset += _hunk.newLines - _hunk.oldLines; - - if (_toPos < 0) { - // Creating a new file - _toPos = 0; - } - - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line, - delimiter = _hunk.linedelimiters[j]; - - if (operation === ' ') { - _toPos++; - } else if (operation === '-') { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - /* istanbul ignore else */ - } else if (operation === '+') { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === '\\') { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; - - if (previousOperation === '+') { - removeEOFNL = true; - } else if (previousOperation === '-') { - addEOFNL = true; - } - } - } - } // Handle EOFNL insertion/removal - - - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(''); - delimiters.push('\n'); - } - - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - - return lines.join(''); -} // Wrapper that supports multiple file patches via callbacks. - - -function applyPatches(uniDiff, options) { - if (typeof uniDiff === 'string') { - uniDiff = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _parse - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - parsePatch) - /*istanbul ignore end*/ - (uniDiff); - } - - var currentIndex = 0; - - function processIndex() { - var index = uniDiff[currentIndex++]; - - if (!index) { - return options.complete(); - } - - options.loadFile(index, function (err, data) { - if (err) { - return options.complete(err); - } - - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function (err) { - if (err) { - return options.complete(err); - } - - processIndex(); - }); - }); - } - - processIndex(); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6WyJhcHBseVBhdGNoIiwic291cmNlIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJwYXJzZVBhdGNoIiwiQXJyYXkiLCJpc0FycmF5IiwibGVuZ3RoIiwiRXJyb3IiLCJsaW5lcyIsInNwbGl0IiwiZGVsaW1pdGVycyIsIm1hdGNoIiwiaHVua3MiLCJjb21wYXJlTGluZSIsImxpbmVOdW1iZXIiLCJsaW5lIiwib3BlcmF0aW9uIiwicGF0Y2hDb250ZW50IiwiZXJyb3JDb3VudCIsImZ1enpGYWN0b3IiLCJtaW5MaW5lIiwib2Zmc2V0IiwicmVtb3ZlRU9GTkwiLCJhZGRFT0ZOTCIsImh1bmtGaXRzIiwiaHVuayIsInRvUG9zIiwiaiIsImNvbnRlbnQiLCJzdWJzdHIiLCJpIiwibWF4TGluZSIsIm9sZExpbmVzIiwibG9jYWxPZmZzZXQiLCJvbGRTdGFydCIsIml0ZXJhdG9yIiwiZGlzd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aHVuay5vbGRTdGFydCArIGh1bmsub2xkTGluZXM7XG4gIH1cblxuICAvLyBBcHBseSBwYXRjaCBodW5rc1xuICBsZXQgZGlmZk9mZnNldCA9IDA7XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgaHVua3MubGVuZ3RoOyBpKyspIHtcbiAgICBsZXQgaHVuayA9IGh1bmtzW2ldLFxuICAgICAgICB0b1BvcyA9IGh1bmsub2xkU3RhcnQgKyBodW5rLm9mZnNldCArIGRpZmZPZmZzZXQgLSAxO1xuICAgIGRpZmZPZmZzZXQgKz0gaHVuay5uZXdMaW5lcyAtIGh1bmsub2xkTGluZXM7XG5cbiAgICBpZiAodG9Qb3MgPCAwKSB7IC8vIENyZWF0aW5nIGEgbmV3IGZpbGVcbiAgICAgIHRvUG9zID0gMDtcbiAgICB9XG5cbiAgICBmb3IgKGxldCBqID0gMDsgaiA8IGh1bmsubGluZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgIGxldCBsaW5lID0gaHVuay5saW5lc1tqXSxcbiAgICAgICAgICBvcGVyYXRpb24gPSAobGluZS5sZW5ndGggPiAwID8gbGluZVswXSA6ICcgJyksXG4gICAgICAgICAgY29udGVudCA9IChsaW5lLmxlbmd0aCA+IDAgPyBsaW5lLnN1YnN0cigxKSA6IGxpbmUpLFxuICAgICAgICAgIGRlbGltaXRlciA9IGh1bmsubGluZWRlbGltaXRlcnNbal07XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICB0b1BvcysrO1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICBsaW5lcy5zcGxpY2UodG9Qb3MsIDEpO1xuICAgICAgICBkZWxpbWl0ZXJzLnNwbGljZSh0b1BvcywgMSk7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICcrJykge1xuICAgICAgICBsaW5lcy5zcGxpY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y5cbmV4cG9ydCBmdW5jdGlvbiBhcHBseVBhdGNoZXModW5pRGlmZiwgb3B0aW9ucykge1xuICBpZiAodHlwZW9mIHVuaURpZmYgPT09ICdzdHJpbmcnKSB7XG4gICAgdW5pRGlmZiA9IHBhcnNlUGF0Y2godW5pRGlmZik7XG4gIH1cblxuICBsZXQgY3VycmVudEluZGV4ID0gMDtcbiAgZnVuY3Rpb24gcHJvY2Vzc0luZGV4KCkge1xuICAgIGxldCBpbmRleCA9IHVuaURpZmZbY3VycmVudEluZGV4KytdO1xuICAgIGlmICghaW5kZXgpIHtcbiAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKCk7XG4gICAgfVxuXG4gICAgb3B0aW9ucy5sb2FkRmlsZShpbmRleCwgZnVuY3Rpb24oZXJyLCBkYXRhKSB7XG4gICAgICBpZiAoZXJyKSB7XG4gICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICB9XG5cbiAgICAgIGxldCB1cGRhdGVkQ29udGVudCA9IGFwcGx5UGF0Y2goZGF0YSwgaW5kZXgsIG9wdGlvbnMpO1xuICAgICAgb3B0aW9ucy5wYXRjaGVkKGluZGV4LCB1cGRhdGVkQ29udGVudCwgZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICByZXR1cm4gb3B0aW9ucy5jb21wbGV0ZShlcnIpO1xuICAgICAgICB9XG5cbiAgICAgICAgcHJvY2Vzc0luZGV4KCk7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxuICBwcm9jZXNzSW5kZXgoKTtcbn1cbiJdfQ== diff --git a/node_modules/diff/lib/patch/create.js b/node_modules/diff/lib/patch/create.js deleted file mode 100644 index d1717fe..0000000 --- a/node_modules/diff/lib/patch/create.js +++ /dev/null @@ -1,247 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.structuredPatch = structuredPatch; -exports.createTwoFilesPatch = createTwoFilesPatch; -exports.createPatch = createPatch; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_line = require("../diff/line") -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -/*istanbul ignore end*/ -function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - - if (typeof options.context === 'undefined') { - options.context = 4; - } - - var diff = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _line - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - diffLines) - /*istanbul ignore end*/ - (oldStr, newStr, options); - diff.push({ - value: '', - lines: [] - }); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function (entry) { - return ' ' + entry; - }); - } - - var hunks = []; - var oldRangeStart = 0, - newRangeStart = 0, - curRange = [], - oldLine = 1, - newLine = 1; - - /*istanbul ignore start*/ - var _loop = function _loop( - /*istanbul ignore end*/ - i) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, '').split('\n'); - current.lines = lines; - - if (current.added || current.removed) { - /*istanbul ignore start*/ - var _curRange; - - /*istanbul ignore end*/ - // If we have previous context, start with that - if (!oldRangeStart) { - var prev = diff[i - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } // Output our changes - - - /*istanbul ignore start*/ - (_curRange = - /*istanbul ignore end*/ - curRange).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _curRange - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - lines.map(function (entry) { - return (current.added ? '+' : '-') + entry; - }))); // Track the updated file position - - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - // Identical context lines. Track line changes - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= options.context * 2 && i < diff.length - 2) { - /*istanbul ignore start*/ - var _curRange2; - - /*istanbul ignore end*/ - // Overlapping - - /*istanbul ignore start*/ - (_curRange2 = - /*istanbul ignore end*/ - curRange).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _curRange2 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - contextLines(lines))); - } else { - /*istanbul ignore start*/ - var _curRange3; - - /*istanbul ignore end*/ - // end the range and output - var contextSize = Math.min(lines.length, options.context); - - /*istanbul ignore start*/ - (_curRange3 = - /*istanbul ignore end*/ - curRange).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _curRange3 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - contextLines(lines.slice(0, contextSize)))); - - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - - if (i >= diff.length - 2 && lines.length <= options.context) { - // EOF is inside this hunk - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - - if (!oldEOFNewline && noNlBeforeAdds) { - // special case: old has no eol and no trailing context; no-nl can end up before adds - curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); - } - - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push('\\ No newline at end of file'); - } - } - - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - - oldLine += lines.length; - newLine += lines.length; - } - }; - - for (var i = 0; i < diff.length; i++) { - /*istanbul ignore start*/ - _loop( - /*istanbul ignore end*/ - i); - } - - return { - oldFileName: oldFileName, - newFileName: newFileName, - oldHeader: oldHeader, - newHeader: newHeader, - hunks: hunks - }; -} - -function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); - var ret = []; - - if (oldFileName == newFileName) { - ret.push('Index: ' + oldFileName); - } - - ret.push('==================================================================='); - ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); - ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); - - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; - ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); - ret.push.apply(ret, hunk.lines); - } - - return ret.join('\n') + '\n'; -} - -function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOlsic3RydWN0dXJlZFBhdGNoIiwib2xkRmlsZU5hbWUiLCJuZXdGaWxlTmFtZSIsIm9sZFN0ciIsIm5ld1N0ciIsIm9sZEhlYWRlciIsIm5ld0hlYWRlciIsIm9wdGlvbnMiLCJjb250ZXh0IiwiZGlmZiIsImR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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0nKTtcbiAgcmV0LnB1c2goJy0tLSAnICsgZGlmZi5vbGRGaWxlTmFtZSArICh0eXBlb2YgZGlmZi5vbGRIZWFkZXIgPT09ICd1bmRlZmluZWQnID8gJycgOiAnXFx0JyArIGRpZmYub2xkSGVhZGVyKSk7XG4gIHJldC5wdXNoKCcrKysgJyArIGRpZmYubmV3RmlsZU5hbWUgKyAodHlwZW9mIGRpZmYubmV3SGVhZGVyID09PSAndW5kZWZpbmVkJyA/ICcnIDogJ1xcdCcgKyBkaWZmLm5ld0hlYWRlcikpO1xuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgZGlmZi5odW5rcy5sZW5ndGg7IGkrKykge1xuICAgIGNvbnN0IGh1bmsgPSBkaWZmLmh1bmtzW2ldO1xuICAgIHJldC5wdXNoKFxuICAgICAgJ0BAIC0nICsgaHVuay5vbGRTdGFydCArICcsJyArIGh1bmsub2xkTGluZXNcbiAgICAgICsgJyArJyArIGh1bmsubmV3U3RhcnQgKyAnLCcgKyBodW5rLm5ld0xpbmVzXG4gICAgICArICcgQEAnXG4gICAgKTtcbiAgICByZXQucHVzaC5hcHBseShyZXQsIGh1bmsubGluZXMpO1xuICB9XG5cbiAgcmV0dXJuIHJldC5qb2luKCdcXG4nKSArICdcXG4nO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlUGF0Y2goZmlsZU5hbWUsIG9sZFN0ciwgbmV3U3RyLCBvbGRIZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucykge1xuICByZXR1cm4gY3JlYXRlVHdvRmlsZXNQYXRjaChmaWxlTmFtZSwgZmlsZU5hbWUsIG9sZFN0ciwgbmV3U3RyLCBvbGRIZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucyk7XG59XG4iXX0= diff --git a/node_modules/diff/lib/patch/merge.js b/node_modules/diff/lib/patch/merge.js deleted file mode 100644 index bbd429a..0000000 --- a/node_modules/diff/lib/patch/merge.js +++ /dev/null @@ -1,609 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.calcLineCount = calcLineCount; -exports.merge = merge; - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_create = require("./create") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_parse = require("./parse") -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_array = require("../util/array") -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -/*istanbul ignore end*/ -function calcLineCount(hunk) { - /*istanbul ignore start*/ - var _calcOldNewLineCount = - /*istanbul ignore end*/ - calcOldNewLineCount(hunk.lines), - oldLines = _calcOldNewLineCount.oldLines, - newLines = _calcOldNewLineCount.newLines; - - if (oldLines !== undefined) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } - - if (newLines !== undefined) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } -} - -function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. - // Leaving sanity checks on this to the API consumer that may know more about the - // meaning in their own context. - - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } - - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - // No header or no change in ours, use theirs (and ours if theirs does not exist) - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - // No header or no change in theirs, use ours - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - // Both changed... figure it out - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } - - ret.hunks = []; - var mineIndex = 0, - theirsIndex = 0, - mineOffset = 0, - theirsOffset = 0; - - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, - theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; - - if (hunkBefore(mineCurrent, theirsCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - // Overlap, merge as best we can - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } - } - - return ret; -} - -function loadPatch(param, base) { - if (typeof param === 'string') { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _parse - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - parsePatch) - /*istanbul ignore end*/ - (param)[0] - ); - } - - if (!base) { - throw new Error('Must provide a base reference or pass in a patch'); - } - - return ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _create - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - structuredPatch) - /*istanbul ignore end*/ - (undefined, undefined, base, param) - ); - } - - return param; -} - -function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; -} - -function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine: mine, - theirs: theirs - }; - } -} - -function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; -} - -function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; -} - -function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - // This will generally result in a conflicted hunk, but there are cases where the context - // is the only overlap where we can successfully merge the content here. - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, - their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; // Handle any leading content - - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. - - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], - theirCurrent = their.lines[their.index]; - - if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { - // Both modified ... - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { - /*istanbul ignore start*/ - var _hunk$lines; - - /*istanbul ignore end*/ - // Mine inserted - - /*istanbul ignore start*/ - (_hunk$lines = - /*istanbul ignore end*/ - hunk.lines).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _hunk$lines - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - collectChange(mine))); - } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { - /*istanbul ignore start*/ - var _hunk$lines2; - - /*istanbul ignore end*/ - // Theirs inserted - - /*istanbul ignore start*/ - (_hunk$lines2 = - /*istanbul ignore end*/ - hunk.lines).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _hunk$lines2 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - collectChange(their))); - } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { - // Mine removed or edited - removal(hunk, mine, their); - } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { - // Their removed or edited - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - // Context identity - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - // Context mismatch - conflict(hunk, collectChange(mine), collectChange(their)); - } - } // Now push anything that may be remaining - - - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); -} - -function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), - theirChanges = collectChange(their); - - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - // Special case for remove changes that are supersets of one another - if ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _array - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - arrayStartsWith) - /*istanbul ignore end*/ - (myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - /*istanbul ignore start*/ - var _hunk$lines3; - - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - (_hunk$lines3 = - /*istanbul ignore end*/ - hunk.lines).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _hunk$lines3 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - myChanges)); - - return; - } else if ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _array - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - arrayStartsWith) - /*istanbul ignore end*/ - (theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - /*istanbul ignore start*/ - var _hunk$lines4; - - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - (_hunk$lines4 = - /*istanbul ignore end*/ - hunk.lines).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _hunk$lines4 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - theirChanges)); - - return; - } - } else if ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _array - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - arrayEqual) - /*istanbul ignore end*/ - (myChanges, theirChanges)) { - /*istanbul ignore start*/ - var _hunk$lines5; - - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - (_hunk$lines5 = - /*istanbul ignore end*/ - hunk.lines).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _hunk$lines5 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - myChanges)); - - return; - } - - conflict(hunk, myChanges, theirChanges); -} - -function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), - theirChanges = collectContext(their, myChanges); - - if (theirChanges.merged) { - /*istanbul ignore start*/ - var _hunk$lines6; - - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - (_hunk$lines6 = - /*istanbul ignore end*/ - hunk.lines).push. - /*istanbul ignore start*/ - apply - /*istanbul ignore end*/ - ( - /*istanbul ignore start*/ - _hunk$lines6 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } -} - -function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine: mine, - theirs: their - }); -} - -function insertLeading(hunk, insert, their) { - while (insert.offset < their.offset && insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - insert.offset++; - } -} - -function insertTrailing(hunk, insert) { - while (insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - } -} - -function collectChange(state) { - var ret = [], - operation = state.lines[state.index][0]; - - while (state.index < state.lines.length) { - var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. - - if (operation === '-' && line[0] === '+') { - operation = '+'; - } - - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } - - return ret; -} - -function collectContext(state, matchChanges) { - var changes = [], - merged = [], - matchIndex = 0, - contextChanges = false, - conflicted = false; - - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], - match = matchChanges[matchIndex]; // Once we've hit our add, then we are done - - if (match[0] === '+') { - break; - } - - contextChanges = contextChanges || change[0] !== ' '; - merged.push(match); - matchIndex++; // Consume any additions in the other block as a conflict to attempt - // to pull in the remaining context after this - - if (change[0] === '+') { - conflicted = true; - - while (change[0] === '+') { - changes.push(change); - change = state.lines[++state.index]; - } - } - - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - - if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { - conflicted = true; - } - - if (conflicted) { - return changes; - } - - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } - - return { - merged: merged, - changes: changes - }; -} - -function allRemoves(changes) { - return changes.reduce(function (prev, change) { - return prev && change[0] === '-'; - }, true); -} - -function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - - if (state.lines[state.index + i] !== ' ' + changeContent) { - return false; - } - } - - state.index += delta; - return true; -} - -function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function (line) { - if (typeof line !== 'string') { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - - if (oldLines !== undefined) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = undefined; - } - } - - if (newLines !== undefined) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = undefined; - } - } - } else { - if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { - newLines++; - } - - if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { - oldLines++; - } - } - }); - return { - oldLines: oldLines, - newLines: newLines - }; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9tZXJnZS5qcyJdLCJuYW1lcyI6WyJjYWxjTGluZUNvdW50IiwiaHVuayIsImNhbGNPbGROZXdMaW5lQ291bnQiLCJsaW5lcyIsIm9sZExpbmVzIiwibmV3TGluZXMiLCJ1bmRlZmluZWQiLCJtZXJnZSIsIm1pbmUiLCJ0aGVpcnMiLCJiYXNlIiwibG9hZFBhdGNoIiwicmV0IiwiaW5kZXgiLCJuZXdGaWxlTmFtZSIsImZpbGVOYW1lQ2hhbmdlZCIsIm9sZEZpbGVOYW1lIiwib2xkSGVhZGVyIiwibmV3SGVhZGVyIiwic2VsZWN0RmllbGQiLCJodW5rcyIsIm1pbmVJbmRleCIsInRoZWlyc0luZGV4IiwibWluZU9mZnNldCIsInRoZWlyc09mZnNldCIsImxlbmd0aCIsIm1pb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bmVzID0gMDtcbiAgbGV0IG5ld0xpbmVzID0gMDtcblxuICBsaW5lcy5mb3JFYWNoKGZ1bmN0aW9uKGxpbmUpIHtcbiAgICBpZiAodHlwZW9mIGxpbmUgIT09ICdzdHJpbmcnKSB7XG4gICAgICBsZXQgbXlDb3VudCA9IGNhbGNPbGROZXdMaW5lQ291bnQobGluZS5taW5lKTtcbiAgICAgIGxldCB0aGVpckNvdW50ID0gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lLnRoZWlycyk7XG5cbiAgICAgIGlmIChvbGRMaW5lcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmIChteUNvdW50Lm9sZExpbmVzID09PSB0aGVpckNvdW50Lm9sZExpbmVzKSB7XG4gICAgICAgICAgb2xkTGluZXMgKz0gbXlDb3VudC5vbGRMaW5lcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvbGRMaW5lcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAobmV3TGluZXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAobXlDb3VudC5uZXdMaW5lcyA9PT0gdGhlaXJDb3VudC5uZXdMaW5lcykge1xuICAgICAgICAgIG5ld0xpbmVzICs9IG15Q291bnQubmV3TGluZXM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbmV3TGluZXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKG5ld0xpbmVzICE9PSB1bmRlZmluZWQgJiYgKGxpbmVbMF0gPT09ICcrJyB8fCBsaW5lWzBdID09PSAnICcpKSB7XG4gICAgICAgIG5ld0xpbmVzKys7XG4gICAgICB9XG4gICAgICBpZiAob2xkTGluZXMgIT09IHVuZGVmaW5lZCAmJiAobGluZVswXSA9PT0gJy0nIHx8IGxpbmVbMF0gPT09ICcgJykpIHtcbiAgICAgICAgb2xkTGluZXMrKztcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuXG4gIHJldHVybiB7b2xkTGluZXMsIG5ld0xpbmVzfTtcbn1cbiJdfQ== diff --git a/node_modules/diff/lib/patch/parse.js b/node_modules/diff/lib/patch/parse.js deleted file mode 100644 index b65d5c6..0000000 --- a/node_modules/diff/lib/patch/parse.js +++ /dev/null @@ -1,156 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parsePatch = parsePatch; - -/*istanbul ignore end*/ -function parsePatch(uniDiff) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], - list = [], - i = 0; - - function parseIndex() { - var index = {}; - list.push(index); // Parse diff metadata - - while (i < diffstr.length) { - var line = diffstr[i]; // File header found, end parsing diff metadata - - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } // Diff index - - - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - - if (header) { - index.index = header[1]; - } - - i++; - } // Parse file headers if they are defined. Unified diff requires them, but - // there's no technical issues to have an isolated hunk without file header - - - parseFileHeader(index); - parseFileHeader(index); // Parse hunks - - index.hunks = []; - - while (i < diffstr.length) { - var _line = diffstr[i]; - - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - // Ignore unexpected content unless in strict mode - throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); - } else { - i++; - } - } - } // Parses the --- and +++ headers, if none are found, no lines - // are consumed. - - - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - - if (fileHeader) { - var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; - var data = fileHeader[2].split('\t', 2); - var fileName = data[0].replace(/\\\\/g, '\\'); - - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - - index[keyPrefix + 'FileName'] = fileName; - index[keyPrefix + 'Header'] = (data[1] || '').trim(); - i++; - } - } // Parses a hunk - // This assumes that we are at the start of a hunk. - - - function parseHunk() { - var chunkHeaderIndex = i, - chunkHeaderLine = diffstr[i++], - chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: +chunkHeader[2] || 1, - newStart: +chunkHeader[3], - newLines: +chunkHeader[4] || 1, - lines: [], - linedelimiters: [] - }; - var addCount = 0, - removeCount = 0; - - for (; i < diffstr.length; i++) { - // Lines starting with '---' could be mistaken for the "remove line" operation - // But they could be the header for the next file. Therefore prune such cases out. - if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { - break; - } - - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; - - if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || '\n'); - - if (operation === '+') { - addCount++; - } else if (operation === '-') { - removeCount++; - } else if (operation === ' ') { - addCount++; - removeCount++; - } - } else { - break; - } - } // Handle the empty block count case - - - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } // Perform optional sanity checking - - - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - - if (removeCount !== hunk.oldLines) { - throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - } - - return hunk; - } - - while (i < diffstr.length) { - parseInd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uayBhdCBsaW5lICcgKyAoY2h1bmtIZWFkZXJJbmRleCArIDEpKTtcbiAgICAgIH1cbiAgICAgIGlmIChyZW1vdmVDb3VudCAhPT0gaHVuay5vbGRMaW5lcykge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1JlbW92ZWQgbGluZSBjb3VudCBkaWQgbm90IG1hdGNoIGZvciBodW5rIGF0IGxpbmUgJyArIChjaHVua0hlYWRlckluZGV4ICsgMSkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBodW5rO1xuICB9XG5cbiAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgIHBhcnNlSW5kZXgoKTtcbiAgfVxuXG4gIHJldHVybiBsaXN0O1xufVxuIl19 diff --git a/node_modules/diff/lib/util/array.js b/node_modules/diff/lib/util/array.js deleted file mode 100644 index aecf67a..0000000 --- a/node_modules/diff/lib/util/array.js +++ /dev/null @@ -1,32 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.arrayEqual = arrayEqual; -exports.arrayStartsWith = arrayStartsWith; - -/*istanbul ignore end*/ -function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - - return arrayStartsWith(a, b); -} - -function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; - } - } - - return true; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RXF1YWwiLCJhIiwiYiIsImxlbmd0aCIsImFycmF5U3RhcnRzV2l0aCIsImFycmF5Iiwic3RhcnQiLCJpIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQU8sU0FBU0EsVUFBVCxDQUFvQkMsQ0FBcEIsRUFBdUJDLENBQXZCLEVBQTBC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hcnJheVtpXSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuIl19 diff --git a/node_modules/diff/lib/util/distance-iterator.js b/node_modules/diff/lib/util/distance-iterator.js deleted file mode 100644 index 5edbaf8..0000000 --- a/node_modules/diff/lib/util/distance-iterator.js +++ /dev/null @@ -1,57 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -/*istanbul ignore end*/ -// Iterator that traverses in the range of [min, max], stepping -// by distance from a given start position. I.e. for [0, 4], with -// start of 2, this will iterate 2, 3, 1, 4, 0. -function -/*istanbul ignore start*/ -_default -/*istanbul ignore end*/ -(start, minLine, maxLine) { - var wantForward = true, - backwardExhausted = false, - forwardExhausted = false, - localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } // Check if trying to fit beyond text length, and if not, check it fits - // after offset location (or desired location on first iteration) - - - if (start + localOffset <= maxLine) { - return localOffset; - } - - forwardExhausted = true; - } - - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } // Check if trying to fit before text beginning, and if not, check it fits - // before offset location - - - if (minLine <= start - localOffset) { - return -localOffset++; - } - - backwardExhausted = true; - return iterator(); - } // We tried to fit hunk before text beginning and beyond text length, then - // hunk can't fit on the text. Return undefined - - }; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRlcmF0b3IiXSwibWFwcGluZ3MiOiI7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9IHRydWU7XG4gICAgfVxuXG4gICAgaWYgKCFiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgaWYgKCFmb3J3YXJkRXhoYXVzdGVkKSB7XG4gICAgICAgIHdhbnRGb3J3YXJkID0gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZWZvcmUgdGV4dCBiZWdpbm5pbmcsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGJlZm9yZSBvZmZzZXQgbG9jYXRpb25cbiAgICAgIGlmIChtaW5MaW5lIDw9IHN0YXJ0IC0gbG9jYWxPZmZzZXQpIHtcbiAgICAgICAgcmV0dXJuIC1sb2NhbE9mZnNldCsrO1xuICAgICAgfVxuXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmd0aCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0= diff --git a/node_modules/diff/lib/util/params.js b/node_modules/diff/lib/util/params.js deleted file mode 100644 index e838eb2..0000000 --- a/node_modules/diff/lib/util/params.js +++ /dev/null @@ -1,24 +0,0 @@ -/*istanbul ignore start*/ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.generateOptions = generateOptions; - -/*istanbul ignore end*/ -function generateOptions(options, defaults) { - if (typeof options === 'function') { - defaults.callback = options; - } else if (options) { - for (var name in options) { - /* istanbul ignore else */ - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - - return defaults; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJza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kpIHtcbiAgICAgICAgZGVmYXVsdHNbbmFtZV0gPSBvcHRpb25zW25hbWVdO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gZGVmYXVsdHM7XG59XG4iXX0= diff --git a/node_modules/diff/package.json b/node_modules/diff/package.json deleted file mode 100644 index 3308b32..0000000 --- a/node_modules/diff/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "diff", - "version": "4.0.2", - "description": "A javascript text diff implementation.", - "keywords": [ - "diff", - "javascript" - ], - "maintainers": [ - "Kevin Decker (http://incaseofstairs.com)" - ], - "bugs": { - "email": "kpdecker@gmail.com", - "url": "http://github.com/kpdecker/jsdiff/issues" - }, - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "git://github.com/kpdecker/jsdiff.git" - }, - "engines": { - "node": ">=0.3.1" - }, - "main": "./lib/index.js", - "module": "./lib/index.es6.js", - "browser": "./dist/diff.js", - "scripts": { - "clean": "rm -rf lib/ dist/", - "build:node": "yarn babel --out-dir lib --source-maps=inline src", - "test": "grunt" - }, - "devDependencies": { - "@babel/cli": "^7.2.3", - "@babel/core": "^7.2.2", - "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@babel/preset-env": "^7.2.3", - "@babel/register": "^7.0.0", - "babel-eslint": "^10.0.1", - "babel-loader": "^8.0.5", - "chai": "^4.2.0", - "colors": "^1.3.3", - "eslint": "^5.12.0", - "grunt": "^1.0.3", - "grunt-babel": "^8.0.0", - "grunt-clean": "^0.4.0", - "grunt-cli": "^1.3.2", - "grunt-contrib-clean": "^2.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-uglify": "^4.0.0", - "grunt-contrib-watch": "^1.1.0", - "grunt-eslint": "^21.0.0", - "grunt-exec": "^3.0.0", - "grunt-karma": "^3.0.1", - "grunt-mocha-istanbul": "^5.0.2", - "grunt-mocha-test": "^0.13.3", - "grunt-webpack": "^3.1.3", - "istanbul": "github:kpdecker/istanbul", - "karma": "^3.1.4", - "karma-chrome-launcher": "^2.2.0", - "karma-mocha": "^1.3.0", - "karma-mocha-reporter": "^2.0.0", - "karma-sauce-launcher": "^2.0.2", - "karma-sourcemap-loader": "^0.3.6", - "karma-webpack": "^3.0.5", - "mocha": "^5.2.0", - "rollup": "^1.0.2", - "rollup-plugin-babel": "^4.2.0", - "semver": "^5.6.0", - "webpack": "^4.28.3", - "webpack-dev-server": "^3.1.14" - }, - "optionalDependencies": {} -} diff --git a/node_modules/diff/release-notes.md b/node_modules/diff/release-notes.md deleted file mode 100644 index edc4cd3..0000000 --- a/node_modules/diff/release-notes.md +++ /dev/null @@ -1,261 +0,0 @@ -# Release Notes - -## Development - -[Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.1...master) - -## v4.0.1 - January 6th, 2019 -- Fix main reference path - b826104 - -[Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.0...v4.0.1) - -## v4.0.0 - January 5th, 2019 -- [#94](https://github.com/kpdecker/jsdiff/issues/94) - Missing "No newline at end of file" when comparing two texts that do not end in newlines ([@federicotdn](https://api.github.com/users/federicotdn)) -- [#227](https://github.com/kpdecker/jsdiff/issues/227) - Licence -- [#199](https://github.com/kpdecker/jsdiff/issues/199) - Import statement for jsdiff -- [#159](https://github.com/kpdecker/jsdiff/issues/159) - applyPatch affecting wrong line number with with new lines -- [#8](https://github.com/kpdecker/jsdiff/issues/8) - A new state "replace" -- Drop ie9 from karma targets - 79c31bd -- Upgrade deps. Convert from webpack to rollup - 2c1a29c -- Make ()[]"' as word boundaries between each other - f27b899 -- jsdiff: Replaced phantomJS by chrome - ec3114e -- Add yarn.lock to .npmignore - 29466d8 - -Compatibility notes: -- Bower and Component packages no longer supported - - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.5.0...v4.0.0) - -## v3.5.0 - March 4th, 2018 -- Omit redundant slice in join method of diffArrays - 1023590 -- Support patches with empty lines - fb0f208 -- Accept a custom JSON replacer function for JSON diffing - 69c7f0a -- Optimize parch header parser - 2aec429 -- Fix typos - e89c832 - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.4.0...v3.5.0) - -## v3.4.0 - October 7th, 2017 -- [#183](https://github.com/kpdecker/jsdiff/issues/183) - Feature request: ability to specify a custom equality checker for `diffArrays` -- [#173](https://github.com/kpdecker/jsdiff/issues/173) - Bug: diffArrays gives wrong result on array of booleans -- [#158](https://github.com/kpdecker/jsdiff/issues/158) - diffArrays will not compare the empty string in array? -- comparator for custom equality checks - 30e141e -- count oldLines and newLines when there are conflicts - 53bf384 -- Fix: diffArrays can compare falsey items - 9e24284 -- Docs: Replace grunt with npm test - 00e2f94 - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.1...v3.4.0) - -## v3.3.1 - September 3rd, 2017 -- [#141](https://github.com/kpdecker/jsdiff/issues/141) - Cannot apply patch because my file delimiter is "/r/n" instead of "/n" -- [#192](https://github.com/kpdecker/jsdiff/pull/192) - Fix: Bad merge when adding new files (#189) -- correct spelling mistake - 21fa478 - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.0...v3.3.1) - -## v3.3.0 - July 5th, 2017 -- [#114](https://github.com/kpdecker/jsdiff/issues/114) - /patch/merge not exported -- Gracefully accept invalid newStart in hunks, same as patch(1) does. - d8a3635 -- Use regex rather than starts/ends with for parsePatch - 6cab62c -- Add browser flag - e64f674 -- refactor: simplified code a bit more - 8f8e0f2 -- refactor: simplified code a bit - b094a6f -- fix: some corrections re ignoreCase option - 3c78fd0 -- ignoreCase option - 3cbfbb5 -- Sanitize filename while parsing patches - 2fe8129 -- Added better installation methods - aced50b -- Simple export of functionality - 8690f31 - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.2.0...v3.3.0) - -## v3.2.0 - December 26th, 2016 -- [#156](https://github.com/kpdecker/jsdiff/pull/156) - Add `undefinedReplacement` option to `diffJson` ([@ewnd9](https://api.github.com/users/ewnd9)) -- [#154](https://github.com/kpdecker/jsdiff/pull/154) - Add `examples` and `images` to `.npmignore`. ([@wtgtybhertgeghgtwtg](https://api.github.com/users/wtgtybhertgeghgtwtg)) -- [#153](https://github.com/kpdecker/jsdiff/pull/153) - feat(structuredPatch): Pass options to diffLines ([@Kiougar](https://api.github.com/users/Kiougar)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.1.0...v3.2.0) - -## v3.1.0 - November 27th, 2016 -- [#146](https://github.com/kpdecker/jsdiff/pull/146) - JsDiff.diffArrays to compare arrays ([@wvanderdeijl](https://api.github.com/users/wvanderdeijl)) -- [#144](https://github.com/kpdecker/jsdiff/pull/144) - Split file using all possible line delimiter instead of hard-coded "/n" and join lines back using the original delimiters ([@soulbeing](https://api.github.com/users/soulbeing)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.0.1...v3.1.0) - -## v3.0.1 - October 9th, 2016 -- [#139](https://github.com/kpdecker/jsdiff/pull/139) - Make README.md look nicer in npmjs.com ([@takenspc](https://api.github.com/users/takenspc)) -- [#135](https://github.com/kpdecker/jsdiff/issues/135) - parsePatch combines patches from multiple files into a single IUniDiff when there is no "Index" line ([@ramya-rao-a](https://api.github.com/users/ramya-rao-a)) -- [#124](https://github.com/kpdecker/jsdiff/issues/124) - IE7/IE8 failure since 2.0.0 ([@boneskull](https://api.github.com/users/boneskull)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v3.0.0...v3.0.1) - -## v3.0.0 - August 23rd, 2016 -- [#130](https://github.com/kpdecker/jsdiff/pull/130) - Add callback argument to applyPatches `patched` option ([@piranna](https://api.github.com/users/piranna)) -- [#120](https://github.com/kpdecker/jsdiff/pull/120) - Correctly handle file names containing spaces ([@adius](https://api.github.com/users/adius)) -- [#119](https://github.com/kpdecker/jsdiff/pull/119) - Do single reflow ([@wifiextender](https://api.github.com/users/wifiextender)) -- [#117](https://github.com/kpdecker/jsdiff/pull/117) - Make more usable with long strings. ([@abnbgist](https://api.github.com/users/abnbgist)) - -Compatibility notes: -- applyPatches patch callback now is async and requires the callback be called to continue operation - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.3...v3.0.0) - -## v2.2.3 - May 31st, 2016 -- [#118](https://github.com/kpdecker/jsdiff/pull/118) - Add a fix for applying 0-length destination patches ([@chaaz](https://api.github.com/users/chaaz)) -- [#115](https://github.com/kpdecker/jsdiff/pull/115) - Fixed grammar in README ([@krizalys](https://api.github.com/users/krizalys)) -- [#113](https://github.com/kpdecker/jsdiff/pull/113) - fix typo ([@vmazare](https://api.github.com/users/vmazare)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.2...v2.2.3) - -## v2.2.2 - March 13th, 2016 -- [#102](https://github.com/kpdecker/jsdiff/issues/102) - diffJson with dates, returns empty curly braces ([@dr-dimitru](https://api.github.com/users/dr-dimitru)) -- [#97](https://github.com/kpdecker/jsdiff/issues/97) - Whitespaces & diffWords ([@faiwer](https://api.github.com/users/faiwer)) -- [#92](https://github.com/kpdecker/jsdiff/pull/92) - Fixes typo in the readme ([@bg451](https://api.github.com/users/bg451)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.1...v2.2.2) - -## v2.2.1 - November 12th, 2015 -- [#89](https://github.com/kpdecker/jsdiff/pull/89) - add in display selector to readme ([@FranDias](https://api.github.com/users/FranDias)) -- [#88](https://github.com/kpdecker/jsdiff/pull/88) - Split diffs based on file headers instead of 'Index:' metadata ([@piranna](https://api.github.com/users/piranna)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.0...v2.2.1) - -## v2.2.0 - October 29th, 2015 -- [#80](https://github.com/kpdecker/jsdiff/pull/80) - Fix a typo: applyPath -> applyPatch ([@fluxxu](https://api.github.com/users/fluxxu)) -- [#83](https://github.com/kpdecker/jsdiff/pull/83) - Add basic fuzzy matching to applyPatch ([@piranna](https://github.com/piranna)) -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.0...v2.2.0) - -## v2.2.0 - October 29th, 2015 -- [#80](https://github.com/kpdecker/jsdiff/pull/80) - Fix a typo: applyPath -> applyPatch ([@fluxxu](https://api.github.com/users/fluxxu)) -- [#83](https://github.com/kpdecker/jsdiff/pull/83) - Add basic fuzzy matching to applyPatch ([@piranna](https://github.com/piranna)) -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.3...v2.2.0) - -## v2.1.3 - September 30th, 2015 -- [#78](https://github.com/kpdecker/jsdiff/pull/78) - fix: error throwing when apply patch to empty string ([@21paradox](https://api.github.com/users/21paradox)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.2...v2.1.3) - -## v2.1.2 - September 23rd, 2015 -- [#76](https://github.com/kpdecker/jsdiff/issues/76) - diff headers give error ([@piranna](https://api.github.com/users/piranna)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.1...v2.1.2) - -## v2.1.1 - September 9th, 2015 -- [#73](https://github.com/kpdecker/jsdiff/issues/73) - Is applyPatches() exposed in the API? ([@davidparsson](https://api.github.com/users/davidparsson)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.0...v2.1.1) - -## v2.1.0 - August 27th, 2015 -- [#72](https://github.com/kpdecker/jsdiff/issues/72) - Consider using options object API for flag permutations ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#70](https://github.com/kpdecker/jsdiff/issues/70) - diffWords treats \n at the end as significant whitespace ([@nesQuick](https://api.github.com/users/nesQuick)) -- [#69](https://github.com/kpdecker/jsdiff/issues/69) - Missing count ([@wfalkwallace](https://api.github.com/users/wfalkwallace)) -- [#68](https://github.com/kpdecker/jsdiff/issues/68) - diffLines seems broken ([@wfalkwallace](https://api.github.com/users/wfalkwallace)) -- [#60](https://github.com/kpdecker/jsdiff/issues/60) - Support multiple diff hunks ([@piranna](https://api.github.com/users/piranna)) -- [#54](https://github.com/kpdecker/jsdiff/issues/54) - Feature Request: 3-way merge ([@mog422](https://api.github.com/users/mog422)) -- [#42](https://github.com/kpdecker/jsdiff/issues/42) - Fuzz factor for applyPatch ([@stuartpb](https://api.github.com/users/stuartpb)) -- Move whitespace ignore out of equals method - 542063c -- Include source maps in babel output - 7f7ab21 -- Merge diff/line and diff/patch implementations - 1597705 -- Drop map utility method - 1ddc939 -- Documentation for parsePatch and applyPatches - 27c4b77 - -Compatibility notes: -- The undocumented ignoreWhitespace flag has been removed from the Diff equality check directly. This implementation may be copied to diff utilities if dependencies existed on this functionality. - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.2...v2.1.0) - -## v2.0.2 - August 8th, 2015 -- [#67](https://github.com/kpdecker/jsdiff/issues/67) - cannot require from npm module in node ([@commenthol](https://api.github.com/users/commenthol)) -- Convert to chai since we don’t support IE8 - a96bbad - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.1...v2.0.2) - -## v2.0.1 - August 7th, 2015 -- Add release build at proper step - 57542fd - -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.0...v2.0.1) - -## v2.0.0 - August 7th, 2015 -- [#66](https://github.com/kpdecker/jsdiff/issues/66) - Add karma and sauce tests ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#65](https://github.com/kpdecker/jsdiff/issues/65) - Create component repository for bower ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#64](https://github.com/kpdecker/jsdiff/issues/64) - Automatically call removeEmpty for all tokenizer calls ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#62](https://github.com/kpdecker/jsdiff/pull/62) - Allow access to structured object representation of patch data ([@bittrance](https://api.github.com/users/bittrance)) -- [#61](https://github.com/kpdecker/jsdiff/pull/61) - Use svg instead of png to get better image quality ([@PeterDaveHello](https://api.github.com/users/PeterDaveHello)) -- [#29](https://github.com/kpdecker/jsdiff/issues/29) - word tokenizer works only for 7 bit ascii ([@plasmagunman](https://api.github.com/users/plasmagunman)) - -Compatibility notes: -- `this.removeEmpty` is now called automatically for all instances. If this is not desired, this may be overridden on a per instance basis. -- The library has been refactored to use some ES6 features. The external APIs should remain the same, but bower projects that directly referenced the repository will now have to point to the [components/jsdiff](https://github.com/components/jsdiff) repository. - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.4.0...v2.0.0) - -## v1.4.0 - May 6th, 2015 -- [#57](https://github.com/kpdecker/jsdiff/issues/57) - createPatch -> applyPatch failed. ([@mog422](https://api.github.com/users/mog422)) -- [#56](https://github.com/kpdecker/jsdiff/pull/56) - Two files patch ([@rgeissert](https://api.github.com/users/rgeissert)) -- [#14](https://github.com/kpdecker/jsdiff/issues/14) - Flip added and removed order? ([@jakesandlund](https://api.github.com/users/jakesandlund)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.2...v1.4.0) - -## v1.3.2 - March 30th, 2015 -- [#53](https://github.com/kpdecker/jsdiff/pull/53) - Updated README.MD with Bower installation instructions ([@ofbriggs](https://api.github.com/users/ofbriggs)) -- [#49](https://github.com/kpdecker/jsdiff/issues/49) - Cannot read property 'oldlines' of undefined ([@nwtn](https://api.github.com/users/nwtn)) -- [#44](https://github.com/kpdecker/jsdiff/issues/44) - invalid-meta jsdiff is missing "main" entry in bower.json - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.1...v1.3.2) - -## v1.3.1 - March 13th, 2015 -- [#52](https://github.com/kpdecker/jsdiff/pull/52) - Fix for #51 Wrong result of JsDiff.diffLines ([@felicienfrancois](https://api.github.com/users/felicienfrancois)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.0...v1.3.1) - -## v1.3.0 - March 2nd, 2015 -- [#47](https://github.com/kpdecker/jsdiff/pull/47) - Adding Diff Trimmed Lines ([@JamesGould123](https://api.github.com/users/JamesGould123)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.2...v1.3.0) - -## v1.2.2 - January 26th, 2015 -- [#45](https://github.com/kpdecker/jsdiff/pull/45) - Fix AMD module loading ([@pedrocarrico](https://api.github.com/users/pedrocarrico)) -- [#43](https://github.com/kpdecker/jsdiff/pull/43) - added a bower file ([@nbrustein](https://api.github.com/users/nbrustein)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.1...v1.2.2) - -## v1.2.1 - December 26th, 2014 -- [#41](https://github.com/kpdecker/jsdiff/pull/41) - change condition of using node export system. ([@ironhee](https://api.github.com/users/ironhee)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.0...v1.2.1) - -## v1.2.0 - November 29th, 2014 -- [#37](https://github.com/kpdecker/jsdiff/pull/37) - Add support for sentences. ([@vmariano](https://api.github.com/users/vmariano)) -- [#28](https://github.com/kpdecker/jsdiff/pull/28) - Implemented diffJson ([@papandreou](https://api.github.com/users/papandreou)) -- [#27](https://github.com/kpdecker/jsdiff/issues/27) - Slow to execute over diffs with a large number of changes ([@termi](https://api.github.com/users/termi)) -- Allow for optional async diffing - 19385b9 -- Fix diffChars implementation - eaa44ed - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.1.0...v1.2.0) - -## v1.1.0 - November 25th, 2014 -- [#33](https://github.com/kpdecker/jsdiff/pull/33) - AMD and global exports ([@ovcharik](https://api.github.com/users/ovcharik)) -- [#32](https://github.com/kpdecker/jsdiff/pull/32) - Add support for component ([@vmariano](https://api.github.com/users/vmariano)) -- [#31](https://github.com/kpdecker/jsdiff/pull/31) - Don't rely on Array.prototype.map ([@papandreou](https://api.github.com/users/papandreou)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.8...v1.1.0) - -## v1.0.8 - December 22nd, 2013 -- [#24](https://github.com/kpdecker/jsdiff/pull/24) - Handle windows newlines on non windows machines. ([@benogle](https://api.github.com/users/benogle)) -- [#23](https://github.com/kpdecker/jsdiff/pull/23) - Prettied up the API formatting a little, and added basic node and web examples ([@airportyh](https://api.github.com/users/airportyh)) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.7...v1.0.8) - -## v1.0.7 - September 11th, 2013 - -- [#22](https://github.com/kpdecker/jsdiff/pull/22) - Added variant of WordDiff that doesn't ignore whitespace differences ([@papandreou](https://api.github.com/users/papandreou) - -- Add 0.10 to travis tests - 243a526 - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.6...v1.0.7) - -## v1.0.6 - August 30th, 2013 - -- [#19](https://github.com/kpdecker/jsdiff/pull/19) - Explicitly define contents of npm package ([@sindresorhus](https://api.github.com/users/sindresorhus) - -[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.5...v1.0.6) diff --git a/node_modules/diff/runtime.js b/node_modules/diff/runtime.js deleted file mode 100644 index 82ea7e6..0000000 --- a/node_modules/diff/runtime.js +++ /dev/null @@ -1,3 +0,0 @@ -require('@babel/register')({ - ignore: ['lib', 'node_modules'] -}); diff --git a/node_modules/electron-to-chromium/CHANGELOG.md b/node_modules/electron-to-chromium/CHANGELOG.md deleted file mode 100644 index 1669c34..0000000 --- a/node_modules/electron-to-chromium/CHANGELOG.md +++ /dev/null @@ -1,14 +0,0 @@ -v1.3.0 - * Additionally include chromium to electron mappings - -v1.2.0 - * versions and full-versions are now separately importable. - -v1.1.0 - * Both electronToChromium and electronToBrowserList now can accept strings as well as numbers. - -v1.0.1 - Update documentation - -v1.0.0 - Inititial release diff --git a/node_modules/electron-to-chromium/LICENSE b/node_modules/electron-to-chromium/LICENSE deleted file mode 100644 index 6c7b614..0000000 --- a/node_modules/electron-to-chromium/LICENSE +++ /dev/null @@ -1,5 +0,0 @@ -Copyright 2018 Kilian Valkhof - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/electron-to-chromium/README.md b/node_modules/electron-to-chromium/README.md deleted file mode 100644 index a96ddf1..0000000 --- a/node_modules/electron-to-chromium/README.md +++ /dev/null @@ -1,186 +0,0 @@ -### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof) - -#### Other projects: - -- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once -- 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website -- 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad - ---- - -# Electron-to-Chromium [![npm](https://img.shields.io/npm/v/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![travis](https://img.shields.io/travis/Kilian/electron-to-chromium/master.svg)](https://travis-ci.org/Kilian/electron-to-chromium) [![npm-downloads](https://img.shields.io/npm/dm/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![codecov](https://codecov.io/gh/Kilian/electron-to-chromium/branch/master/graph/badge.svg)](https://codecov.io/gh/Kilian/electron-to-chromium)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield) - -This repository provides a mapping of Electron versions to the Chromium version that it uses. - -This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat). - -**Supported by:** - - - - - - -## Install -Install using `npm install electron-to-chromium`. - -## Usage -To include Electron-to-Chromium, require it: - -```js -var e2c = require('electron-to-chromium'); -``` - -### Properties -The Electron-to-Chromium object has 4 properties to use: - -#### `versions` -An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value. - -```js -var versions = e2c.versions; -console.log(versions['1.4']); -// returns "53" -``` - -#### `fullVersions` -An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value. - -```js -var versions = e2c.fullVersions; -console.log(versions['1.4.11']); -// returns "53.0.2785.143" -``` - -#### `chromiumVersions` -An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value. - -```js -var versions = e2c.chromiumVersions; -console.log(versions['54']); -// returns "1.4" -``` - -#### `fullChromiumVersions` -An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value. - -```js -var versions = e2c.fullChromiumVersions; -console.log(versions['54.0.2840.101']); -// returns ["1.5.1", "1.5.0"] -``` -### Functions - -#### `electronToChromium(query)` -Arguments: -* Query: string or number, required. A major or full Electron version. - -A function that returns the corresponding Chromium version for a given Electron function. Returns a string. - -If you provide it with a major Electron version, it will return a major Chromium version: - -```js -var chromeVersion = e2c.electronToChromium('1.4'); -// chromeVersion is "53" -``` - -If you provide it with a full Electron version, it will return the full Chromium version. - -```js -var chromeVersion = e2c.electronToChromium('1.4.11'); -// chromeVersion is "53.0.2785.143" -``` - -If a query does not match a Chromium version, it will return `undefined`. - -```js -var chromeVersion = e2c.electronToChromium('9000'); -// chromeVersion is undefined -``` - -#### `chromiumToElectron(query)` -Arguments: -* Query: string or number, required. A major or full Chromium version. - -Returns a string with the corresponding Electron version for a given Chromium query. - -If you provide it with a major Chromium version, it will return a major Electron version: - -```js -var electronVersion = e2c.chromiumToElectron('54'); -// electronVersion is "1.4" -``` - -If you provide it with a full Chrome version, it will return an array of full Electron versions. - -```js -var electronVersions = e2c.chromiumToElectron('56.0.2924.87'); -// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"] -``` - -If a query does not match an Electron version, it will return `undefined`. - -```js -var electronVersion = e2c.chromiumToElectron('10'); -// electronVersion is undefined -``` - -#### `electronToBrowserList(query)` **DEPRECATED** -Arguments: -* Query: string or number, required. A major Electron version. - -_**Deprecated**: Browserlist already includes electron-to-chromium._ - -A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string. - -If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities: - -```js -var query = e2c.electronToBrowserList('1.4'); -// query is "Chrome >= 53" -``` - -If a query does not match a Chromium version, it will return `undefined`. - -```js -var query = e2c.electronToBrowserList('9000'); -// query is undefined -``` - -### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions -All lists can be imported on their own, if file size is a concern. - -#### `versions` - -```js -var versions = require('electron-to-chromium/versions'); -``` - -#### `fullVersions` - -```js -var fullVersions = require('electron-to-chromium/full-versions'); -``` - -#### `chromiumVersions` - -```js -var chromiumVersions = require('electron-to-chromium/chromium-versions'); -``` - -#### `fullChromiumVersions` - -```js -var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions'); -``` - -## Updating -This package will be updated with each new Electron release. - -To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions. - -To verify correct behaviour, run `npm test`. - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large) diff --git a/node_modules/electron-to-chromium/chromium-versions.js b/node_modules/electron-to-chromium/chromium-versions.js deleted file mode 100644 index ca435fd..0000000 --- a/node_modules/electron-to-chromium/chromium-versions.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - "39": "0.20", - "40": "0.21", - "41": "0.21", - "42": "0.25", - "43": "0.27", - "44": "0.30", - "45": "0.31", - "47": "0.36", - "49": "0.37", - "50": "1.1", - "51": "1.2", - "52": "1.3", - "53": "1.4", - "54": "1.4", - "56": "1.6", - "58": "1.7", - "59": "1.8", - "61": "2.0", - "66": "3.0", - "69": "4.0", - "72": "5.0", - "73": "5.0", - "76": "6.0", - "78": "7.0", - "79": "8.0", - "80": "8.0", - "82": "9.0", - "83": "9.0", - "84": "10.0", - "85": "10.0", - "86": "11.0", - "87": "11.0", - "89": "12.0", - "90": "13.0", - "91": "13.0", - "92": "14.0", - "93": "14.0", - "94": "15.0", - "95": "16.0", - "96": "16.0", - "98": "17.0", - "99": "18.0", - "100": "18.0", - "102": "19.0", - "103": "20.0", - "104": "20.0", - "105": "21.0", - "106": "21.0", - "107": "22.0", - "108": "22.0", - "110": "23.0", - "111": "24.0", - "112": "24.0", - "114": "25.0", - "116": "26.0", - "118": "27.0", - "119": "28.0", - "120": "28.0", - "121": "29.0", - "122": "29.0" -}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/chromium-versions.json b/node_modules/electron-to-chromium/chromium-versions.json deleted file mode 100644 index ab8da99..0000000 --- a/node_modules/electron-to-chromium/chromium-versions.json +++ /dev/null @@ -1 +0,0 @@ -{"39":"0.20","40":"0.21","41":"0.21","42":"0.25","43":"0.27","44":"0.30","45":"0.31","47":"0.36","49":"0.37","50":"1.1","51":"1.2","52":"1.3","53":"1.4","54":"1.4","56":"1.6","58":"1.7","59":"1.8","61":"2.0","66":"3.0","69":"4.0","72":"5.0","73":"5.0","76":"6.0","78":"7.0","79":"8.0","80":"8.0","82":"9.0","83":"9.0","84":"10.0","85":"10.0","86":"11.0","87":"11.0","89":"12.0","90":"13.0","91":"13.0","92":"14.0","93":"14.0","94":"15.0","95":"16.0","96":"16.0","98":"17.0","99":"18.0","100":"18.0","102":"19.0","103":"20.0","104":"20.0","105":"21.0","106":"21.0","107":"22.0","108":"22.0","110":"23.0","111":"24.0","112":"24.0","114":"25.0","116":"26.0","118":"27.0","119":"28.0","120":"28.0","121":"29.0","122":"29.0"} \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-chromium-versions.js b/node_modules/electron-to-chromium/full-chromium-versions.js deleted file mode 100644 index 96e8a33..0000000 --- a/node_modules/electron-to-chromium/full-chromium-versions.js +++ /dev/null @@ -1,3072 +0,0 @@ -module.exports = { - "39.0.2171.65": [ - "0.20.0", - "0.20.1", - "0.20.2", - "0.20.3", - "0.20.4", - "0.20.5", - "0.20.6", - "0.20.7", - "0.20.8" - ], - "40.0.2214.91": [ - "0.21.0", - "0.21.1", - "0.21.2" - ], - "41.0.2272.76": [ - "0.21.3", - "0.22.1", - "0.22.2", - "0.22.3", - "0.23.0", - "0.24.0" - ], - "42.0.2311.107": [ - "0.25.0", - "0.25.1", - "0.25.2", - "0.25.3", - "0.26.0", - "0.26.1", - "0.27.0", - "0.27.1" - ], - "43.0.2357.65": [ - "0.27.2", - "0.27.3", - "0.28.0", - "0.28.1", - "0.28.2", - "0.28.3", - "0.29.1", - "0.29.2" - ], - "44.0.2403.125": [ - "0.30.4", - "0.31.0" - ], - "45.0.2454.85": [ - "0.31.2", - "0.32.2", - "0.32.3", - "0.33.0", - "0.33.1", - "0.33.2", - "0.33.3", - "0.33.4", - "0.33.6", - "0.33.7", - "0.33.8", - "0.33.9", - "0.34.0", - "0.34.1", - "0.34.2", - "0.34.3", - "0.34.4", - "0.35.1", - "0.35.2", - "0.35.3", - "0.35.4", - "0.35.5" - ], - "47.0.2526.73": [ - "0.36.0", - "0.36.2", - "0.36.3", - "0.36.4" - ], - "47.0.2526.110": [ - "0.36.5", - "0.36.6", - "0.36.7", - "0.36.8", - "0.36.9", - "0.36.10", - "0.36.11", - "0.36.12" - ], - "49.0.2623.75": [ - "0.37.0", - "0.37.1", - "0.37.3", - "0.37.4", - "0.37.5", - "0.37.6", - "0.37.7", - "0.37.8", - "1.0.0", - "1.0.1", - "1.0.2" - ], - "50.0.2661.102": [ - "1.1.0", - "1.1.1", - "1.1.2", - "1.1.3" - ], - "51.0.2704.63": [ - "1.2.0", - "1.2.1" - ], - "51.0.2704.84": [ - "1.2.2", - "1.2.3" - ], - "51.0.2704.103": [ - "1.2.4", - "1.2.5" - ], - "51.0.2704.106": [ - "1.2.6", - "1.2.7", - "1.2.8" - ], - "52.0.2743.82": [ - "1.3.0", - "1.3.1", - "1.3.2", - "1.3.3", - "1.3.4", - "1.3.5", - "1.3.6", - "1.3.7", - "1.3.9", - "1.3.10", - "1.3.13", - "1.3.14", - "1.3.15" - ], - "53.0.2785.113": [ - "1.4.0", - "1.4.1", - "1.4.2", - "1.4.3", - "1.4.4", - "1.4.5" - ], - "53.0.2785.143": [ - "1.4.6", - "1.4.7", - "1.4.8", - "1.4.10", - "1.4.11", - "1.4.13", - "1.4.14", - "1.4.15", - "1.4.16" - ], - "54.0.2840.51": [ - "1.4.12" - ], - "54.0.2840.101": [ - "1.5.0", - "1.5.1" - ], - "56.0.2924.87": [ - "1.6.0", - "1.6.1", - "1.6.2", - "1.6.3", - "1.6.4", - "1.6.5", - "1.6.6", - "1.6.7", - "1.6.8", - "1.6.9", - "1.6.10", - "1.6.11", - "1.6.12", - "1.6.13", - "1.6.14", - "1.6.15", - "1.6.16", - "1.6.17", - "1.6.18" - ], - "58.0.3029.110": [ - "1.7.0", - "1.7.1", - "1.7.2", - "1.7.3", - "1.7.4", - "1.7.5", - "1.7.6", - "1.7.7", - "1.7.8", - "1.7.9", - "1.7.10", - "1.7.11", - "1.7.12", - "1.7.13", - "1.7.14", - "1.7.15", - "1.7.16" - ], - "59.0.3071.115": [ - "1.8.0", - "1.8.1", - "1.8.2-beta.1", - "1.8.2-beta.2", - "1.8.2-beta.3", - "1.8.2-beta.4", - "1.8.2-beta.5", - "1.8.2", - "1.8.3", - "1.8.4", - "1.8.5", - "1.8.6", - "1.8.7", - "1.8.8" - ], - "61.0.3163.100": [ - "2.0.0-beta.1", - "2.0.0-beta.2", - "2.0.0-beta.3", - "2.0.0-beta.4", - "2.0.0-beta.5", - "2.0.0-beta.6", - "2.0.0-beta.7", - "2.0.0-beta.8", - "2.0.0", - "2.0.1", - "2.0.2", - "2.0.3", - "2.0.4", - "2.0.5", - "2.0.6", - "2.0.7", - "2.0.8-nightly.20180819", - "2.0.8-nightly.20180820", - "2.0.8", - "2.0.9", - "2.0.10", - "2.0.11", - "2.0.12", - "2.0.13", - "2.0.14", - "2.0.15", - "2.0.16", - "2.0.17", - "2.0.18", - "2.1.0-unsupported.20180809" - ], - "66.0.3359.181": [ - "3.0.0-beta.1", - "3.0.0-beta.2", - "3.0.0-beta.3", - "3.0.0-beta.4", - "3.0.0-beta.5", - "3.0.0-beta.6", - "3.0.0-beta.7", - "3.0.0-beta.8", - "3.0.0-beta.9", - "3.0.0-beta.10", - "3.0.0-beta.11", - "3.0.0-beta.12", - "3.0.0-beta.13", - "3.0.0-nightly.20180818", - "3.0.0-nightly.20180821", - "3.0.0-nightly.20180823", - "3.0.0-nightly.20180904", - "3.0.0", - "3.0.1", - "3.0.2", - "3.0.3", - "3.0.4", - "3.0.5", - "3.0.6", - "3.0.7", - "3.0.8", - "3.0.9", - "3.0.10", - "3.0.11", - "3.0.12", - "3.0.13", - "3.0.14", - "3.0.15", - "3.0.16", - "3.1.0-beta.1", - "3.1.0-beta.2", - "3.1.0-beta.3", - "3.1.0-beta.4", - "3.1.0-beta.5", - "3.1.0", - "3.1.1", - "3.1.2", - "3.1.3", - "3.1.4", - "3.1.5", - "3.1.6", - "3.1.7", - "3.1.8", - "3.1.9", - "3.1.10", - "3.1.11", - "3.1.12", - "3.1.13", - "4.0.0-nightly.20180817", - "4.0.0-nightly.20180819", - "4.0.0-nightly.20180821" - ], - "69.0.3497.106": [ - "4.0.0-beta.1", - "4.0.0-beta.2", - "4.0.0-beta.3", - "4.0.0-beta.4", - "4.0.0-beta.5", - "4.0.0-beta.6", - "4.0.0-beta.7", - "4.0.0-beta.8", - "4.0.0-beta.9", - "4.0.0-beta.10", - "4.0.0-beta.11", - "4.0.0-nightly.20181010", - "4.0.0", - "4.0.1", - "4.0.2", - "4.0.3", - "4.0.4", - "4.0.5", - "4.0.6" - ], - "67.0.3396.99": [ - "4.0.0-nightly.20180929" - ], - "68.0.3440.128": [ - "4.0.0-nightly.20181006" - ], - "69.0.3497.128": [ - "4.0.7", - "4.0.8", - "4.1.0", - "4.1.1", - "4.1.2", - "4.1.3", - "4.1.4", - "4.1.5", - "4.2.0", - "4.2.1", - "4.2.2", - "4.2.3", - "4.2.4", - "4.2.5", - "4.2.6", - "4.2.7", - "4.2.8", - "4.2.9", - "4.2.10", - "4.2.11", - "4.2.12" - ], - "72.0.3626.52": [ - "5.0.0-beta.1", - "5.0.0-beta.2", - "6.0.0-nightly.20190123" - ], - "73.0.3683.27": [ - "5.0.0-beta.3" - ], - "73.0.3683.54": [ - "5.0.0-beta.4" - ], - "73.0.3683.61": [ - "5.0.0-beta.5" - ], - "73.0.3683.84": [ - "5.0.0-beta.6" - ], - "73.0.3683.94": [ - "5.0.0-beta.7" - ], - "73.0.3683.104": [ - "5.0.0-beta.8" - ], - "73.0.3683.117": [ - "5.0.0-beta.9" - ], - "70.0.3538.110": [ - "5.0.0-nightly.20190107" - ], - "71.0.3578.98": [ - "5.0.0-nightly.20190121", - "5.0.0-nightly.20190122" - ], - "73.0.3683.119": [ - "5.0.0" - ], - "73.0.3683.121": [ - "5.0.1", - "5.0.2", - "5.0.3", - "5.0.4", - "5.0.5", - "5.0.6", - "5.0.7", - "5.0.8", - "5.0.9", - "5.0.10", - "5.0.11", - "5.0.12", - "5.0.13" - ], - "76.0.3774.1": [ - "6.0.0-beta.1" - ], - "76.0.3783.1": [ - "6.0.0-beta.2", - "6.0.0-beta.3", - "6.0.0-beta.4" - ], - "76.0.3805.4": [ - "6.0.0-beta.5" - ], - "76.0.3809.3": [ - "6.0.0-beta.6" - ], - "76.0.3809.22": [ - "6.0.0-beta.7" - ], - "76.0.3809.26": [ - "6.0.0-beta.8", - "6.0.0-beta.9" - ], - "76.0.3809.37": [ - "6.0.0-beta.10" - ], - "76.0.3809.42": [ - "6.0.0-beta.11" - ], - "76.0.3809.54": [ - "6.0.0-beta.12" - ], - "76.0.3809.60": [ - "6.0.0-beta.13" - ], - "76.0.3809.68": [ - "6.0.0-beta.14" - ], - "76.0.3809.74": [ - "6.0.0-beta.15" - ], - "72.0.3626.107": [ - "6.0.0-nightly.20190212" - ], - "72.0.3626.110": [ - "6.0.0-nightly.20190213" - ], - "74.0.3724.8": [ - "6.0.0-nightly.20190311" - ], - "76.0.3809.88": [ - "6.0.0" - ], - "76.0.3809.102": [ - "6.0.1" - ], - "76.0.3809.110": [ - "6.0.2" - ], - "76.0.3809.126": [ - "6.0.3" - ], - "76.0.3809.131": [ - "6.0.4" - ], - "76.0.3809.136": [ - "6.0.5" - ], - "76.0.3809.138": [ - "6.0.6" - ], - "76.0.3809.139": [ - "6.0.7" - ], - "76.0.3809.146": [ - "6.0.8", - "6.0.9", - "6.0.10", - "6.0.11", - "6.0.12", - "6.1.0", - "6.1.1", - "6.1.2", - "6.1.3", - "6.1.4", - "6.1.5", - "6.1.6", - "6.1.7", - "6.1.8", - "6.1.9", - "6.1.10", - "6.1.11", - "6.1.12" - ], - "78.0.3866.0": [ - "7.0.0-beta.1", - "7.0.0-beta.2", - "7.0.0-beta.3", - "7.0.0-nightly.20190727", - "7.0.0-nightly.20190728", - "7.0.0-nightly.20190729", - "7.0.0-nightly.20190730", - "7.0.0-nightly.20190731", - "8.0.0-nightly.20190801", - "8.0.0-nightly.20190802" - ], - "78.0.3896.6": [ - "7.0.0-beta.4" - ], - "78.0.3905.1": [ - "7.0.0-beta.5", - "7.0.0-beta.6", - "7.0.0-beta.7", - "7.0.0" - ], - "76.0.3784.0": [ - "7.0.0-nightly.20190521" - ], - "76.0.3806.0": [ - "7.0.0-nightly.20190529", - "7.0.0-nightly.20190530", - "7.0.0-nightly.20190531", - "7.0.0-nightly.20190602", - "7.0.0-nightly.20190603" - ], - "77.0.3814.0": [ - "7.0.0-nightly.20190604" - ], - "77.0.3815.0": [ - "7.0.0-nightly.20190605", - "7.0.0-nightly.20190606", - "7.0.0-nightly.20190607", - "7.0.0-nightly.20190608", - "7.0.0-nightly.20190609", - "7.0.0-nightly.20190611", - "7.0.0-nightly.20190612", - "7.0.0-nightly.20190613", - "7.0.0-nightly.20190615", - "7.0.0-nightly.20190616", - "7.0.0-nightly.20190618", - "7.0.0-nightly.20190619", - "7.0.0-nightly.20190622", - "7.0.0-nightly.20190623", - "7.0.0-nightly.20190624", - "7.0.0-nightly.20190627", - "7.0.0-nightly.20190629", - "7.0.0-nightly.20190630", - "7.0.0-nightly.20190701", - "7.0.0-nightly.20190702" - ], - "77.0.3843.0": [ - "7.0.0-nightly.20190704", - "7.0.0-nightly.20190705" - ], - "77.0.3848.0": [ - "7.0.0-nightly.20190719", - "7.0.0-nightly.20190720", - "7.0.0-nightly.20190721" - ], - "77.0.3864.0": [ - "7.0.0-nightly.20190726" - ], - "78.0.3904.92": [ - "7.0.1" - ], - "78.0.3904.94": [ - "7.1.0" - ], - "78.0.3904.99": [ - "7.1.1" - ], - "78.0.3904.113": [ - "7.1.2" - ], - "78.0.3904.126": [ - "7.1.3" - ], - "78.0.3904.130": [ - "7.1.4", - "7.1.5", - "7.1.6", - "7.1.7", - "7.1.8", - "7.1.9", - "7.1.10", - "7.1.11", - "7.1.12", - "7.1.13", - "7.1.14", - "7.2.0", - "7.2.1", - "7.2.2", - "7.2.3", - "7.2.4", - "7.3.0", - "7.3.1", - "7.3.2", - "7.3.3" - ], - "79.0.3931.0": [ - "8.0.0-beta.1", - "8.0.0-beta.2", - "8.0.0-nightly.20191019", - "8.0.0-nightly.20191020", - "8.0.0-nightly.20191021", - "8.0.0-nightly.20191023" - ], - "80.0.3955.0": [ - "8.0.0-beta.3", - "8.0.0-beta.4" - ], - "80.0.3987.14": [ - "8.0.0-beta.5" - ], - "80.0.3987.51": [ - "8.0.0-beta.6" - ], - "80.0.3987.59": [ - "8.0.0-beta.7" - ], - "80.0.3987.75": [ - "8.0.0-beta.8", - "8.0.0-beta.9" - ], - "78.0.3871.0": [ - "8.0.0-nightly.20190803", - "8.0.0-nightly.20190806", - "8.0.0-nightly.20190807", - "8.0.0-nightly.20190808", - "8.0.0-nightly.20190809", - "8.0.0-nightly.20190810", - "8.0.0-nightly.20190811", - "8.0.0-nightly.20190812", - "8.0.0-nightly.20190813", - "8.0.0-nightly.20190814", - "8.0.0-nightly.20190815" - ], - "78.0.3881.0": [ - "8.0.0-nightly.20190816", - "8.0.0-nightly.20190817", - "8.0.0-nightly.20190818", - "8.0.0-nightly.20190819", - "8.0.0-nightly.20190820" - ], - "78.0.3892.0": [ - "8.0.0-nightly.20190824", - "8.0.0-nightly.20190825", - "8.0.0-nightly.20190827", - "8.0.0-nightly.20190828", - "8.0.0-nightly.20190830", - "8.0.0-nightly.20190901", - "8.0.0-nightly.20190902", - "8.0.0-nightly.20190907", - "8.0.0-nightly.20190909", - "8.0.0-nightly.20190910", - "8.0.0-nightly.20190911", - "8.0.0-nightly.20190912", - "8.0.0-nightly.20190913", - "8.0.0-nightly.20190914", - "8.0.0-nightly.20190915", - "8.0.0-nightly.20190917" - ], - "79.0.3915.0": [ - "8.0.0-nightly.20190919", - "8.0.0-nightly.20190920" - ], - "79.0.3919.0": [ - "8.0.0-nightly.20190922", - "8.0.0-nightly.20190923", - "8.0.0-nightly.20190924", - "8.0.0-nightly.20190926", - "8.0.0-nightly.20190928", - "8.0.0-nightly.20190929", - "8.0.0-nightly.20190930", - "8.0.0-nightly.20191001", - "8.0.0-nightly.20191004", - "8.0.0-nightly.20191005", - "8.0.0-nightly.20191006", - "8.0.0-nightly.20191009", - "8.0.0-nightly.20191011", - "8.0.0-nightly.20191012", - "8.0.0-nightly.20191017" - ], - "80.0.3952.0": [ - "8.0.0-nightly.20191101", - "8.0.0-nightly.20191103", - "8.0.0-nightly.20191105" - ], - "80.0.3987.86": [ - "8.0.0", - "8.0.1", - "8.0.2" - ], - "80.0.3987.134": [ - "8.0.3" - ], - "80.0.3987.137": [ - "8.1.0" - ], - "80.0.3987.141": [ - "8.1.1" - ], - "80.0.3987.158": [ - "8.2.0" - ], - "80.0.3987.163": [ - "8.2.1", - "8.2.2", - "8.2.3", - "8.5.3", - "8.5.4", - "8.5.5" - ], - "80.0.3987.165": [ - "8.2.4", - "8.2.5", - "8.3.0", - "8.3.1", - "8.3.2", - "8.3.3", - "8.3.4", - "8.4.0", - "8.4.1", - "8.5.0", - "8.5.1", - "8.5.2" - ], - "82.0.4048.0": [ - "9.0.0-beta.1", - "9.0.0-beta.2", - "9.0.0-beta.3", - "9.0.0-beta.4", - "9.0.0-beta.5" - ], - "82.0.4058.2": [ - "9.0.0-beta.6", - "9.0.0-beta.7", - "9.0.0-beta.9" - ], - "82.0.4085.10": [ - "9.0.0-beta.10" - ], - "82.0.4085.14": [ - "9.0.0-beta.11", - "9.0.0-beta.12", - "9.0.0-beta.13" - ], - "82.0.4085.27": [ - "9.0.0-beta.14" - ], - "83.0.4102.3": [ - "9.0.0-beta.15", - "9.0.0-beta.16" - ], - "83.0.4103.14": [ - "9.0.0-beta.17" - ], - "83.0.4103.16": [ - "9.0.0-beta.18" - ], - "83.0.4103.24": [ - "9.0.0-beta.19" - ], - "83.0.4103.26": [ - "9.0.0-beta.20", - "9.0.0-beta.21" - ], - "83.0.4103.34": [ - "9.0.0-beta.22" - ], - "83.0.4103.44": [ - "9.0.0-beta.23" - ], - "83.0.4103.45": [ - "9.0.0-beta.24" - ], - "80.0.3954.0": [ - "9.0.0-nightly.20191121", - "9.0.0-nightly.20191122", - "9.0.0-nightly.20191123", - "9.0.0-nightly.20191124", - "9.0.0-nightly.20191126", - "9.0.0-nightly.20191128", - "9.0.0-nightly.20191129", - "9.0.0-nightly.20191130", - "9.0.0-nightly.20191201", - "9.0.0-nightly.20191202", - "9.0.0-nightly.20191203", - "9.0.0-nightly.20191204", - "9.0.0-nightly.20191205", - "9.0.0-nightly.20191210" - ], - "81.0.3994.0": [ - "9.0.0-nightly.20191220", - "9.0.0-nightly.20191221", - "9.0.0-nightly.20191222", - "9.0.0-nightly.20191223", - "9.0.0-nightly.20191224", - "9.0.0-nightly.20191225", - "9.0.0-nightly.20191226", - "9.0.0-nightly.20191228", - "9.0.0-nightly.20191229", - "9.0.0-nightly.20191230", - "9.0.0-nightly.20191231", - "9.0.0-nightly.20200101", - "9.0.0-nightly.20200103", - "9.0.0-nightly.20200104", - "9.0.0-nightly.20200105", - "9.0.0-nightly.20200106", - "9.0.0-nightly.20200108", - "9.0.0-nightly.20200109", - "9.0.0-nightly.20200110", - "9.0.0-nightly.20200111", - "9.0.0-nightly.20200113", - "9.0.0-nightly.20200115", - "9.0.0-nightly.20200116", - "9.0.0-nightly.20200117" - ], - "81.0.4030.0": [ - "9.0.0-nightly.20200119", - "9.0.0-nightly.20200121" - ], - "83.0.4103.64": [ - "9.0.0" - ], - "83.0.4103.94": [ - "9.0.1", - "9.0.2" - ], - "83.0.4103.100": [ - "9.0.3" - ], - "83.0.4103.104": [ - "9.0.4" - ], - "83.0.4103.119": [ - "9.0.5" - ], - "83.0.4103.122": [ - "9.1.0", - "9.1.1", - "9.1.2", - "9.2.0", - "9.2.1", - "9.3.0", - "9.3.1", - "9.3.2", - "9.3.3", - "9.3.4", - "9.3.5", - "9.4.0", - "9.4.1", - "9.4.2", - "9.4.3", - "9.4.4" - ], - "84.0.4129.0": [ - "10.0.0-beta.1", - "10.0.0-beta.2", - "10.0.0-nightly.20200501", - "10.0.0-nightly.20200504", - "10.0.0-nightly.20200505", - "10.0.0-nightly.20200506", - "10.0.0-nightly.20200507", - "10.0.0-nightly.20200508", - "10.0.0-nightly.20200511", - "10.0.0-nightly.20200512", - "10.0.0-nightly.20200513", - "10.0.0-nightly.20200514", - "10.0.0-nightly.20200515", - "10.0.0-nightly.20200518", - "10.0.0-nightly.20200519", - "10.0.0-nightly.20200520", - "10.0.0-nightly.20200521", - "11.0.0-nightly.20200525", - "11.0.0-nightly.20200526" - ], - "85.0.4161.2": [ - "10.0.0-beta.3", - "10.0.0-beta.4" - ], - "85.0.4181.1": [ - "10.0.0-beta.8", - "10.0.0-beta.9" - ], - "85.0.4183.19": [ - "10.0.0-beta.10" - ], - "85.0.4183.20": [ - "10.0.0-beta.11" - ], - "85.0.4183.26": [ - "10.0.0-beta.12" - ], - "85.0.4183.39": [ - "10.0.0-beta.13", - "10.0.0-beta.14", - "10.0.0-beta.15", - "10.0.0-beta.17", - "10.0.0-beta.19", - "10.0.0-beta.20", - "10.0.0-beta.21" - ], - "85.0.4183.70": [ - "10.0.0-beta.23" - ], - "85.0.4183.78": [ - "10.0.0-beta.24" - ], - "85.0.4183.80": [ - "10.0.0-beta.25" - ], - "82.0.4050.0": [ - "10.0.0-nightly.20200209", - "10.0.0-nightly.20200210", - "10.0.0-nightly.20200211", - "10.0.0-nightly.20200216", - "10.0.0-nightly.20200217", - "10.0.0-nightly.20200218", - "10.0.0-nightly.20200221", - "10.0.0-nightly.20200222", - "10.0.0-nightly.20200223", - "10.0.0-nightly.20200226", - "10.0.0-nightly.20200303" - ], - "82.0.4076.0": [ - "10.0.0-nightly.20200304", - "10.0.0-nightly.20200305", - "10.0.0-nightly.20200306", - "10.0.0-nightly.20200309", - "10.0.0-nightly.20200310" - ], - "82.0.4083.0": [ - "10.0.0-nightly.20200311" - ], - "83.0.4086.0": [ - "10.0.0-nightly.20200316" - ], - "83.0.4087.0": [ - "10.0.0-nightly.20200317", - "10.0.0-nightly.20200318", - "10.0.0-nightly.20200320", - "10.0.0-nightly.20200323", - "10.0.0-nightly.20200324", - "10.0.0-nightly.20200325", - "10.0.0-nightly.20200326", - "10.0.0-nightly.20200327", - "10.0.0-nightly.20200330", - "10.0.0-nightly.20200331", - "10.0.0-nightly.20200401", - "10.0.0-nightly.20200402", - "10.0.0-nightly.20200403", - "10.0.0-nightly.20200406" - ], - "83.0.4095.0": [ - "10.0.0-nightly.20200408", - "10.0.0-nightly.20200410", - "10.0.0-nightly.20200413" - ], - "84.0.4114.0": [ - "10.0.0-nightly.20200414" - ], - "84.0.4115.0": [ - "10.0.0-nightly.20200415", - "10.0.0-nightly.20200416", - "10.0.0-nightly.20200417" - ], - "84.0.4121.0": [ - "10.0.0-nightly.20200422", - "10.0.0-nightly.20200423" - ], - "84.0.4125.0": [ - "10.0.0-nightly.20200427", - "10.0.0-nightly.20200428", - "10.0.0-nightly.20200429", - "10.0.0-nightly.20200430" - ], - "85.0.4183.84": [ - "10.0.0" - ], - "85.0.4183.86": [ - "10.0.1" - ], - "85.0.4183.87": [ - "10.1.0" - ], - "85.0.4183.93": [ - "10.1.1" - ], - "85.0.4183.98": [ - "10.1.2" - ], - "85.0.4183.121": [ - "10.1.3", - "10.1.4", - "10.1.5", - "10.1.6", - "10.1.7", - "10.2.0", - "10.3.0", - "10.3.1", - "10.3.2", - "10.4.0", - "10.4.1", - "10.4.2", - "10.4.3", - "10.4.4", - "10.4.5", - "10.4.6", - "10.4.7" - ], - "86.0.4234.0": [ - "11.0.0-beta.1", - "11.0.0-beta.3", - "11.0.0-beta.4", - "11.0.0-beta.5", - "11.0.0-beta.6", - "11.0.0-beta.7", - "11.0.0-nightly.20200822", - "11.0.0-nightly.20200824", - "11.0.0-nightly.20200825", - "11.0.0-nightly.20200826", - "12.0.0-nightly.20200827", - "12.0.0-nightly.20200831", - "12.0.0-nightly.20200902", - "12.0.0-nightly.20200903", - "12.0.0-nightly.20200907", - "12.0.0-nightly.20200910", - "12.0.0-nightly.20200911", - "12.0.0-nightly.20200914" - ], - "87.0.4251.1": [ - "11.0.0-beta.8", - "11.0.0-beta.9", - "11.0.0-beta.11" - ], - "87.0.4280.11": [ - "11.0.0-beta.12", - "11.0.0-beta.13" - ], - "87.0.4280.27": [ - "11.0.0-beta.16", - "11.0.0-beta.17", - "11.0.0-beta.18", - "11.0.0-beta.19" - ], - "87.0.4280.40": [ - "11.0.0-beta.20" - ], - "87.0.4280.47": [ - "11.0.0-beta.22", - "11.0.0-beta.23" - ], - "85.0.4156.0": [ - "11.0.0-nightly.20200529" - ], - "85.0.4162.0": [ - "11.0.0-nightly.20200602", - "11.0.0-nightly.20200603", - "11.0.0-nightly.20200604", - "11.0.0-nightly.20200609", - "11.0.0-nightly.20200610", - "11.0.0-nightly.20200611", - "11.0.0-nightly.20200615", - "11.0.0-nightly.20200616", - "11.0.0-nightly.20200617", - "11.0.0-nightly.20200618", - "11.0.0-nightly.20200619" - ], - "85.0.4179.0": [ - "11.0.0-nightly.20200701", - "11.0.0-nightly.20200702", - "11.0.0-nightly.20200703", - "11.0.0-nightly.20200706", - "11.0.0-nightly.20200707", - "11.0.0-nightly.20200708", - "11.0.0-nightly.20200709" - ], - "86.0.4203.0": [ - "11.0.0-nightly.20200716", - "11.0.0-nightly.20200717", - "11.0.0-nightly.20200720", - "11.0.0-nightly.20200721" - ], - "86.0.4209.0": [ - "11.0.0-nightly.20200723", - "11.0.0-nightly.20200724", - "11.0.0-nightly.20200729", - "11.0.0-nightly.20200730", - "11.0.0-nightly.20200731", - "11.0.0-nightly.20200803", - "11.0.0-nightly.20200804", - "11.0.0-nightly.20200805", - "11.0.0-nightly.20200811", - "11.0.0-nightly.20200812" - ], - "87.0.4280.60": [ - "11.0.0", - "11.0.1" - ], - "87.0.4280.67": [ - "11.0.2", - "11.0.3", - "11.0.4" - ], - "87.0.4280.88": [ - "11.0.5", - "11.1.0", - "11.1.1" - ], - "87.0.4280.141": [ - "11.2.0", - "11.2.1", - "11.2.2", - "11.2.3", - "11.3.0", - "11.4.0", - "11.4.1", - "11.4.2", - "11.4.3", - "11.4.4", - "11.4.5", - "11.4.6", - "11.4.7", - "11.4.8", - "11.4.9", - "11.4.10", - "11.4.11", - "11.4.12", - "11.5.0" - ], - "89.0.4328.0": [ - "12.0.0-beta.1", - "12.0.0-beta.3", - "12.0.0-beta.4", - "12.0.0-beta.5", - "12.0.0-beta.6", - "12.0.0-beta.7", - "12.0.0-beta.8", - "12.0.0-beta.9", - "12.0.0-beta.10", - "12.0.0-beta.11", - "12.0.0-beta.12", - "12.0.0-beta.14", - "13.0.0-nightly.20201119", - "13.0.0-nightly.20201123", - "13.0.0-nightly.20201124", - "13.0.0-nightly.20201126", - "13.0.0-nightly.20201127", - "13.0.0-nightly.20201130", - "13.0.0-nightly.20201201", - "13.0.0-nightly.20201202", - "13.0.0-nightly.20201203", - "13.0.0-nightly.20201204", - "13.0.0-nightly.20201207", - "13.0.0-nightly.20201208", - "13.0.0-nightly.20201209", - "13.0.0-nightly.20201210", - "13.0.0-nightly.20201211", - "13.0.0-nightly.20201214" - ], - "89.0.4348.1": [ - "12.0.0-beta.16", - "12.0.0-beta.18", - "12.0.0-beta.19", - "12.0.0-beta.20" - ], - "89.0.4388.2": [ - "12.0.0-beta.21", - "12.0.0-beta.22", - "12.0.0-beta.23", - "12.0.0-beta.24", - "12.0.0-beta.25", - "12.0.0-beta.26" - ], - "89.0.4389.23": [ - "12.0.0-beta.27", - "12.0.0-beta.28", - "12.0.0-beta.29" - ], - "89.0.4389.58": [ - "12.0.0-beta.30", - "12.0.0-beta.31" - ], - "87.0.4268.0": [ - "12.0.0-nightly.20201002", - "12.0.0-nightly.20201007", - "12.0.0-nightly.20201009", - "12.0.0-nightly.20201012", - "12.0.0-nightly.20201013", - "12.0.0-nightly.20201014", - "12.0.0-nightly.20201015" - ], - "88.0.4292.0": [ - "12.0.0-nightly.20201023", - "12.0.0-nightly.20201026" - ], - "88.0.4306.0": [ - "12.0.0-nightly.20201030", - "12.0.0-nightly.20201102", - "12.0.0-nightly.20201103", - "12.0.0-nightly.20201104", - "12.0.0-nightly.20201105", - "12.0.0-nightly.20201106", - "12.0.0-nightly.20201111", - "12.0.0-nightly.20201112" - ], - "88.0.4324.0": [ - "12.0.0-nightly.20201116" - ], - "89.0.4389.69": [ - "12.0.0" - ], - "89.0.4389.82": [ - "12.0.1" - ], - "89.0.4389.90": [ - "12.0.2" - ], - "89.0.4389.114": [ - "12.0.3", - "12.0.4" - ], - "89.0.4389.128": [ - "12.0.5", - "12.0.6", - "12.0.7", - "12.0.8", - "12.0.9", - "12.0.10", - "12.0.11", - "12.0.12", - "12.0.13", - "12.0.14", - "12.0.15", - "12.0.16", - "12.0.17", - "12.0.18", - "12.1.0", - "12.1.1", - "12.1.2", - "12.2.0", - "12.2.1", - "12.2.2", - "12.2.3" - ], - "90.0.4402.0": [ - "13.0.0-beta.2", - "13.0.0-beta.3", - "13.0.0-nightly.20210210", - "13.0.0-nightly.20210211", - "13.0.0-nightly.20210212", - "13.0.0-nightly.20210216", - "13.0.0-nightly.20210217", - "13.0.0-nightly.20210218", - "13.0.0-nightly.20210219", - "13.0.0-nightly.20210222", - "13.0.0-nightly.20210225", - "13.0.0-nightly.20210226", - "13.0.0-nightly.20210301", - "13.0.0-nightly.20210302", - "13.0.0-nightly.20210303", - "14.0.0-nightly.20210304" - ], - "90.0.4415.0": [ - "13.0.0-beta.4", - "13.0.0-beta.5", - "13.0.0-beta.6", - "13.0.0-beta.7", - "13.0.0-beta.8", - "13.0.0-beta.9", - "13.0.0-beta.10", - "13.0.0-beta.11", - "13.0.0-beta.12", - "13.0.0-beta.13", - "14.0.0-nightly.20210305", - "14.0.0-nightly.20210308", - "14.0.0-nightly.20210309", - "14.0.0-nightly.20210311", - "14.0.0-nightly.20210315", - "14.0.0-nightly.20210316", - "14.0.0-nightly.20210317", - "14.0.0-nightly.20210318", - "14.0.0-nightly.20210319", - "14.0.0-nightly.20210323", - "14.0.0-nightly.20210324", - "14.0.0-nightly.20210325", - "14.0.0-nightly.20210326", - "14.0.0-nightly.20210329", - "14.0.0-nightly.20210330" - ], - "91.0.4448.0": [ - "13.0.0-beta.14", - "13.0.0-beta.16", - "13.0.0-beta.17", - "13.0.0-beta.18", - "13.0.0-beta.20", - "14.0.0-nightly.20210331", - "14.0.0-nightly.20210401", - "14.0.0-nightly.20210402", - "14.0.0-nightly.20210406", - "14.0.0-nightly.20210407", - "14.0.0-nightly.20210408", - "14.0.0-nightly.20210409", - "14.0.0-nightly.20210413" - ], - "91.0.4472.33": [ - "13.0.0-beta.21", - "13.0.0-beta.22", - "13.0.0-beta.23" - ], - "91.0.4472.38": [ - "13.0.0-beta.24", - "13.0.0-beta.25", - "13.0.0-beta.26", - "13.0.0-beta.27", - "13.0.0-beta.28" - ], - "89.0.4349.0": [ - "13.0.0-nightly.20201215", - "13.0.0-nightly.20201216", - "13.0.0-nightly.20201221", - "13.0.0-nightly.20201222" - ], - "89.0.4359.0": [ - "13.0.0-nightly.20201223", - "13.0.0-nightly.20210104", - "13.0.0-nightly.20210108", - "13.0.0-nightly.20210111" - ], - "89.0.4386.0": [ - "13.0.0-nightly.20210113", - "13.0.0-nightly.20210114", - "13.0.0-nightly.20210118", - "13.0.0-nightly.20210122", - "13.0.0-nightly.20210125" - ], - "89.0.4389.0": [ - "13.0.0-nightly.20210127", - "13.0.0-nightly.20210128", - "13.0.0-nightly.20210129", - "13.0.0-nightly.20210201", - "13.0.0-nightly.20210202", - "13.0.0-nightly.20210203", - "13.0.0-nightly.20210205", - "13.0.0-nightly.20210208", - "13.0.0-nightly.20210209" - ], - "91.0.4472.69": [ - "13.0.0", - "13.0.1" - ], - "91.0.4472.77": [ - "13.1.0", - "13.1.1", - "13.1.2" - ], - "91.0.4472.106": [ - "13.1.3", - "13.1.4" - ], - "91.0.4472.124": [ - "13.1.5", - "13.1.6", - "13.1.7" - ], - "91.0.4472.164": [ - "13.1.8", - "13.1.9", - "13.2.0", - "13.2.1", - "13.2.2", - "13.2.3", - "13.3.0", - "13.4.0", - "13.5.0", - "13.5.1", - "13.5.2", - "13.6.0", - "13.6.1", - "13.6.2", - "13.6.3", - "13.6.6", - "13.6.7", - "13.6.8", - "13.6.9" - ], - "92.0.4511.0": [ - "14.0.0-beta.1", - "14.0.0-beta.2", - "14.0.0-beta.3", - "14.0.0-nightly.20210520", - "14.0.0-nightly.20210523", - "14.0.0-nightly.20210524", - "15.0.0-nightly.20210527", - "15.0.0-nightly.20210528", - "15.0.0-nightly.20210531", - "15.0.0-nightly.20210601", - "15.0.0-nightly.20210602" - ], - "93.0.4536.0": [ - "14.0.0-beta.5", - "14.0.0-beta.6", - "14.0.0-beta.7", - "14.0.0-beta.8", - "15.0.0-nightly.20210609", - "15.0.0-nightly.20210610", - "15.0.0-nightly.20210611", - "15.0.0-nightly.20210614", - "15.0.0-nightly.20210615", - "15.0.0-nightly.20210616" - ], - "93.0.4539.0": [ - "14.0.0-beta.9", - "14.0.0-beta.10", - "15.0.0-nightly.20210617", - "15.0.0-nightly.20210618", - "15.0.0-nightly.20210621", - "15.0.0-nightly.20210622" - ], - "93.0.4557.4": [ - "14.0.0-beta.11", - "14.0.0-beta.12" - ], - "93.0.4566.0": [ - "14.0.0-beta.13", - "14.0.0-beta.14", - "14.0.0-beta.15", - "14.0.0-beta.16", - "14.0.0-beta.17", - "15.0.0-alpha.1", - "15.0.0-alpha.2", - "15.0.0-nightly.20210706", - "15.0.0-nightly.20210707", - "15.0.0-nightly.20210708", - "15.0.0-nightly.20210709", - "15.0.0-nightly.20210712", - "15.0.0-nightly.20210713", - "15.0.0-nightly.20210714", - "15.0.0-nightly.20210715", - "15.0.0-nightly.20210716", - "15.0.0-nightly.20210719", - "15.0.0-nightly.20210720", - "15.0.0-nightly.20210721", - "16.0.0-nightly.20210722", - "16.0.0-nightly.20210723", - "16.0.0-nightly.20210726" - ], - "93.0.4577.15": [ - "14.0.0-beta.18", - "14.0.0-beta.19", - "14.0.0-beta.20", - "14.0.0-beta.21" - ], - "93.0.4577.25": [ - "14.0.0-beta.22", - "14.0.0-beta.23" - ], - "93.0.4577.51": [ - "14.0.0-beta.24", - "14.0.0-beta.25" - ], - "92.0.4475.0": [ - "14.0.0-nightly.20210426", - "14.0.0-nightly.20210427" - ], - "92.0.4488.0": [ - "14.0.0-nightly.20210430", - "14.0.0-nightly.20210503" - ], - "92.0.4496.0": [ - "14.0.0-nightly.20210505" - ], - "92.0.4498.0": [ - "14.0.0-nightly.20210506" - ], - "92.0.4499.0": [ - "14.0.0-nightly.20210507", - "14.0.0-nightly.20210510", - "14.0.0-nightly.20210511", - "14.0.0-nightly.20210512", - "14.0.0-nightly.20210513" - ], - "92.0.4505.0": [ - "14.0.0-nightly.20210514", - "14.0.0-nightly.20210517", - "14.0.0-nightly.20210518", - "14.0.0-nightly.20210519" - ], - "93.0.4577.58": [ - "14.0.0" - ], - "93.0.4577.63": [ - "14.0.1" - ], - "93.0.4577.82": [ - "14.0.2", - "14.1.0", - "14.1.1", - "14.2.0", - "14.2.1", - "14.2.2", - "14.2.3", - "14.2.4", - "14.2.5", - "14.2.6", - "14.2.7", - "14.2.8", - "14.2.9" - ], - "94.0.4584.0": [ - "15.0.0-alpha.3", - "15.0.0-alpha.4", - "15.0.0-alpha.5", - "15.0.0-alpha.6", - "16.0.0-nightly.20210727", - "16.0.0-nightly.20210728", - "16.0.0-nightly.20210729", - "16.0.0-nightly.20210730", - "16.0.0-nightly.20210802", - "16.0.0-nightly.20210803", - "16.0.0-nightly.20210804", - "16.0.0-nightly.20210805", - "16.0.0-nightly.20210806", - "16.0.0-nightly.20210809", - "16.0.0-nightly.20210810", - "16.0.0-nightly.20210811" - ], - "94.0.4590.2": [ - "15.0.0-alpha.7", - "15.0.0-alpha.8", - "15.0.0-alpha.9", - "16.0.0-nightly.20210812", - "16.0.0-nightly.20210813", - "16.0.0-nightly.20210816", - "16.0.0-nightly.20210817", - "16.0.0-nightly.20210818", - "16.0.0-nightly.20210819", - "16.0.0-nightly.20210820", - "16.0.0-nightly.20210823" - ], - "94.0.4606.12": [ - "15.0.0-alpha.10" - ], - "94.0.4606.20": [ - "15.0.0-beta.1", - "15.0.0-beta.2" - ], - "94.0.4606.31": [ - "15.0.0-beta.3", - "15.0.0-beta.4", - "15.0.0-beta.5", - "15.0.0-beta.6", - "15.0.0-beta.7" - ], - "93.0.4530.0": [ - "15.0.0-nightly.20210603", - "15.0.0-nightly.20210604" - ], - "93.0.4535.0": [ - "15.0.0-nightly.20210608" - ], - "93.0.4550.0": [ - "15.0.0-nightly.20210623", - "15.0.0-nightly.20210624" - ], - "93.0.4552.0": [ - "15.0.0-nightly.20210625", - "15.0.0-nightly.20210628", - "15.0.0-nightly.20210629" - ], - "93.0.4558.0": [ - "15.0.0-nightly.20210630", - "15.0.0-nightly.20210701", - "15.0.0-nightly.20210702", - "15.0.0-nightly.20210705" - ], - "94.0.4606.51": [ - "15.0.0" - ], - "94.0.4606.61": [ - "15.1.0", - "15.1.1" - ], - "94.0.4606.71": [ - "15.1.2" - ], - "94.0.4606.81": [ - "15.2.0", - "15.3.0", - "15.3.1", - "15.3.2", - "15.3.3", - "15.3.4", - "15.3.5", - "15.3.6", - "15.3.7", - "15.4.0", - "15.4.1", - "15.4.2", - "15.5.0", - "15.5.1", - "15.5.2", - "15.5.3", - "15.5.4", - "15.5.5", - "15.5.6", - "15.5.7" - ], - "95.0.4629.0": [ - "16.0.0-alpha.1", - "16.0.0-alpha.2", - "16.0.0-alpha.3", - "16.0.0-alpha.4", - "16.0.0-alpha.5", - "16.0.0-alpha.6", - "16.0.0-alpha.7", - "16.0.0-nightly.20210902", - "16.0.0-nightly.20210903", - "16.0.0-nightly.20210906", - "16.0.0-nightly.20210907", - "16.0.0-nightly.20210908", - "16.0.0-nightly.20210909", - "16.0.0-nightly.20210910", - "16.0.0-nightly.20210913", - "16.0.0-nightly.20210914", - "16.0.0-nightly.20210915", - "16.0.0-nightly.20210916", - "16.0.0-nightly.20210917", - "16.0.0-nightly.20210920", - "16.0.0-nightly.20210921", - "16.0.0-nightly.20210922", - "17.0.0-nightly.20210923", - "17.0.0-nightly.20210924", - "17.0.0-nightly.20210927", - "17.0.0-nightly.20210928", - "17.0.0-nightly.20210929", - "17.0.0-nightly.20210930", - "17.0.0-nightly.20211001", - "17.0.0-nightly.20211004", - "17.0.0-nightly.20211005" - ], - "96.0.4647.0": [ - "16.0.0-alpha.8", - "16.0.0-alpha.9", - "16.0.0-beta.1", - "16.0.0-beta.2", - "16.0.0-beta.3", - "17.0.0-nightly.20211006", - "17.0.0-nightly.20211007", - "17.0.0-nightly.20211008", - "17.0.0-nightly.20211011", - "17.0.0-nightly.20211012", - "17.0.0-nightly.20211013", - "17.0.0-nightly.20211014", - "17.0.0-nightly.20211015", - "17.0.0-nightly.20211018", - "17.0.0-nightly.20211019", - "17.0.0-nightly.20211020", - "17.0.0-nightly.20211021" - ], - "96.0.4664.18": [ - "16.0.0-beta.4", - "16.0.0-beta.5" - ], - "96.0.4664.27": [ - "16.0.0-beta.6", - "16.0.0-beta.7" - ], - "96.0.4664.35": [ - "16.0.0-beta.8", - "16.0.0-beta.9" - ], - "95.0.4612.5": [ - "16.0.0-nightly.20210824", - "16.0.0-nightly.20210825", - "16.0.0-nightly.20210826", - "16.0.0-nightly.20210827", - "16.0.0-nightly.20210830", - "16.0.0-nightly.20210831", - "16.0.0-nightly.20210901" - ], - "96.0.4664.45": [ - "16.0.0", - "16.0.1" - ], - "96.0.4664.55": [ - "16.0.2", - "16.0.3", - "16.0.4", - "16.0.5" - ], - "96.0.4664.110": [ - "16.0.6", - "16.0.7", - "16.0.8" - ], - "96.0.4664.174": [ - "16.0.9", - "16.0.10", - "16.1.0", - "16.1.1", - "16.2.0", - "16.2.1", - "16.2.2", - "16.2.3", - "16.2.4", - "16.2.5", - "16.2.6", - "16.2.7", - "16.2.8" - ], - "96.0.4664.4": [ - "17.0.0-alpha.1", - "17.0.0-alpha.2", - "17.0.0-alpha.3", - "17.0.0-nightly.20211022", - "17.0.0-nightly.20211025", - "17.0.0-nightly.20211026", - "17.0.0-nightly.20211027", - "17.0.0-nightly.20211028", - "17.0.0-nightly.20211029", - "17.0.0-nightly.20211101", - "17.0.0-nightly.20211102", - "17.0.0-nightly.20211103", - "17.0.0-nightly.20211104", - "17.0.0-nightly.20211105", - "17.0.0-nightly.20211108", - "17.0.0-nightly.20211109", - "17.0.0-nightly.20211110", - "17.0.0-nightly.20211111", - "17.0.0-nightly.20211112", - "17.0.0-nightly.20211115", - "17.0.0-nightly.20211116", - "17.0.0-nightly.20211117", - "18.0.0-nightly.20211118", - "18.0.0-nightly.20211119", - "18.0.0-nightly.20211122", - "18.0.0-nightly.20211123" - ], - "98.0.4706.0": [ - "17.0.0-alpha.4", - "17.0.0-alpha.5", - "17.0.0-alpha.6", - "17.0.0-beta.1", - "17.0.0-beta.2", - "18.0.0-nightly.20211124", - "18.0.0-nightly.20211125", - "18.0.0-nightly.20211126", - "18.0.0-nightly.20211129", - "18.0.0-nightly.20211130", - "18.0.0-nightly.20211201", - "18.0.0-nightly.20211202", - "18.0.0-nightly.20211203", - "18.0.0-nightly.20211206", - "18.0.0-nightly.20211207", - "18.0.0-nightly.20211208", - "18.0.0-nightly.20211209", - "18.0.0-nightly.20211210", - "18.0.0-nightly.20211213", - "18.0.0-nightly.20211214", - "18.0.0-nightly.20211215", - "18.0.0-nightly.20211216", - "18.0.0-nightly.20211217", - "18.0.0-nightly.20211220", - "18.0.0-nightly.20211221", - "18.0.0-nightly.20211222", - "18.0.0-nightly.20211223", - "18.0.0-nightly.20211228", - "18.0.0-nightly.20211229", - "18.0.0-nightly.20211231", - "18.0.0-nightly.20220103", - "18.0.0-nightly.20220104", - "18.0.0-nightly.20220105", - "18.0.0-nightly.20220106", - "18.0.0-nightly.20220107", - "18.0.0-nightly.20220110" - ], - "98.0.4758.9": [ - "17.0.0-beta.3" - ], - "98.0.4758.11": [ - "17.0.0-beta.4", - "17.0.0-beta.5", - "17.0.0-beta.6", - "17.0.0-beta.7", - "17.0.0-beta.8", - "17.0.0-beta.9" - ], - "98.0.4758.74": [ - "17.0.0" - ], - "98.0.4758.82": [ - "17.0.1" - ], - "98.0.4758.102": [ - "17.1.0" - ], - "98.0.4758.109": [ - "17.1.1", - "17.1.2", - "17.2.0" - ], - "98.0.4758.141": [ - "17.3.0", - "17.3.1", - "17.4.0", - "17.4.1", - "17.4.2", - "17.4.3", - "17.4.4", - "17.4.5", - "17.4.6", - "17.4.7", - "17.4.8", - "17.4.9", - "17.4.10", - "17.4.11" - ], - "99.0.4767.0": [ - "18.0.0-alpha.1", - "18.0.0-alpha.2", - "18.0.0-alpha.3", - "18.0.0-alpha.4", - "18.0.0-alpha.5", - "18.0.0-nightly.20220111", - "18.0.0-nightly.20220112", - "18.0.0-nightly.20220113", - "18.0.0-nightly.20220114", - "18.0.0-nightly.20220117", - "18.0.0-nightly.20220118", - "18.0.0-nightly.20220119", - "18.0.0-nightly.20220121", - "18.0.0-nightly.20220124", - "18.0.0-nightly.20220125", - "18.0.0-nightly.20220127", - "18.0.0-nightly.20220128", - "18.0.0-nightly.20220131", - "18.0.0-nightly.20220201", - "19.0.0-nightly.20220202", - "19.0.0-nightly.20220203", - "19.0.0-nightly.20220204", - "19.0.0-nightly.20220207", - "19.0.0-nightly.20220208", - "19.0.0-nightly.20220209" - ], - "100.0.4894.0": [ - "18.0.0-beta.1", - "18.0.0-beta.2", - "18.0.0-beta.3", - "18.0.0-beta.4", - "18.0.0-beta.5", - "18.0.0-beta.6", - "19.0.0-nightly.20220308", - "19.0.0-nightly.20220309", - "19.0.0-nightly.20220310", - "19.0.0-nightly.20220311", - "19.0.0-nightly.20220314", - "19.0.0-nightly.20220315", - "19.0.0-nightly.20220316", - "19.0.0-nightly.20220317", - "19.0.0-nightly.20220318", - "19.0.0-nightly.20220321", - "19.0.0-nightly.20220322", - "19.0.0-nightly.20220323", - "19.0.0-nightly.20220324" - ], - "100.0.4896.56": [ - "18.0.0" - ], - "100.0.4896.60": [ - "18.0.1", - "18.0.2" - ], - "100.0.4896.75": [ - "18.0.3", - "18.0.4" - ], - "100.0.4896.127": [ - "18.1.0" - ], - "100.0.4896.143": [ - "18.2.0", - "18.2.1", - "18.2.2", - "18.2.3" - ], - "100.0.4896.160": [ - "18.2.4", - "18.3.0", - "18.3.1", - "18.3.2", - "18.3.3", - "18.3.4", - "18.3.5", - "18.3.6", - "18.3.7", - "18.3.8", - "18.3.9", - "18.3.11", - "18.3.12", - "18.3.13", - "18.3.14", - "18.3.15" - ], - "102.0.4962.3": [ - "19.0.0-alpha.1", - "19.0.0-nightly.20220328", - "19.0.0-nightly.20220329", - "20.0.0-nightly.20220330" - ], - "102.0.4971.0": [ - "19.0.0-alpha.2", - "19.0.0-alpha.3", - "20.0.0-nightly.20220411" - ], - "102.0.4989.0": [ - "19.0.0-alpha.4", - "19.0.0-alpha.5", - "20.0.0-nightly.20220414", - "20.0.0-nightly.20220415", - "20.0.0-nightly.20220418", - "20.0.0-nightly.20220419", - "20.0.0-nightly.20220420", - "20.0.0-nightly.20220421" - ], - "102.0.4999.0": [ - "19.0.0-beta.1", - "19.0.0-beta.2", - "19.0.0-beta.3", - "20.0.0-nightly.20220425", - "20.0.0-nightly.20220426", - "20.0.0-nightly.20220427", - "20.0.0-nightly.20220428", - "20.0.0-nightly.20220429", - "20.0.0-nightly.20220502", - "20.0.0-nightly.20220503", - "20.0.0-nightly.20220504", - "20.0.0-nightly.20220505", - "20.0.0-nightly.20220506", - "20.0.0-nightly.20220509", - "20.0.0-nightly.20220511", - "20.0.0-nightly.20220512", - "20.0.0-nightly.20220513", - "20.0.0-nightly.20220516", - "20.0.0-nightly.20220517" - ], - "102.0.5005.27": [ - "19.0.0-beta.4" - ], - "102.0.5005.40": [ - "19.0.0-beta.5", - "19.0.0-beta.6", - "19.0.0-beta.7" - ], - "102.0.5005.49": [ - "19.0.0-beta.8" - ], - "102.0.4961.0": [ - "19.0.0-nightly.20220325" - ], - "102.0.5005.61": [ - "19.0.0", - "19.0.1" - ], - "102.0.5005.63": [ - "19.0.2", - "19.0.3", - "19.0.4" - ], - "102.0.5005.115": [ - "19.0.5", - "19.0.6" - ], - "102.0.5005.134": [ - "19.0.7" - ], - "102.0.5005.148": [ - "19.0.8" - ], - "102.0.5005.167": [ - "19.0.9", - "19.0.10", - "19.0.11", - "19.0.12", - "19.0.13", - "19.0.14", - "19.0.15", - "19.0.16", - "19.0.17", - "19.1.0", - "19.1.1", - "19.1.2", - "19.1.3", - "19.1.4", - "19.1.5", - "19.1.6", - "19.1.7", - "19.1.8", - "19.1.9" - ], - "103.0.5044.0": [ - "20.0.0-alpha.1", - "20.0.0-nightly.20220518", - "20.0.0-nightly.20220519", - "20.0.0-nightly.20220520", - "20.0.0-nightly.20220523", - "20.0.0-nightly.20220524", - "21.0.0-nightly.20220526", - "21.0.0-nightly.20220527", - "21.0.0-nightly.20220530", - "21.0.0-nightly.20220531" - ], - "104.0.5073.0": [ - "20.0.0-alpha.2", - "20.0.0-alpha.3", - "20.0.0-alpha.4", - "20.0.0-alpha.5", - "20.0.0-alpha.6", - "20.0.0-alpha.7", - "20.0.0-beta.1", - "20.0.0-beta.2", - "20.0.0-beta.3", - "20.0.0-beta.4", - "20.0.0-beta.5", - "20.0.0-beta.6", - "20.0.0-beta.7", - "20.0.0-beta.8", - "21.0.0-nightly.20220602", - "21.0.0-nightly.20220603", - "21.0.0-nightly.20220606", - "21.0.0-nightly.20220607", - "21.0.0-nightly.20220608", - "21.0.0-nightly.20220609", - "21.0.0-nightly.20220610", - "21.0.0-nightly.20220613", - "21.0.0-nightly.20220614", - "21.0.0-nightly.20220615", - "21.0.0-nightly.20220616", - "21.0.0-nightly.20220617", - "21.0.0-nightly.20220620", - "21.0.0-nightly.20220621", - "21.0.0-nightly.20220622", - "21.0.0-nightly.20220623", - "21.0.0-nightly.20220624", - "21.0.0-nightly.20220627" - ], - "104.0.5112.39": [ - "20.0.0-beta.9" - ], - "104.0.5112.48": [ - "20.0.0-beta.10", - "20.0.0-beta.11", - "20.0.0-beta.12" - ], - "104.0.5112.57": [ - "20.0.0-beta.13" - ], - "104.0.5112.65": [ - "20.0.0" - ], - "104.0.5112.81": [ - "20.0.1", - "20.0.2", - "20.0.3" - ], - "104.0.5112.102": [ - "20.1.0", - "20.1.1" - ], - "104.0.5112.114": [ - "20.1.2", - "20.1.3", - "20.1.4" - ], - "104.0.5112.124": [ - "20.2.0", - "20.3.0", - "20.3.1", - "20.3.2", - "20.3.3", - "20.3.4", - "20.3.5", - "20.3.6", - "20.3.7", - "20.3.8", - "20.3.9", - "20.3.10", - "20.3.11", - "20.3.12" - ], - "105.0.5187.0": [ - "21.0.0-alpha.1", - "21.0.0-alpha.2", - "21.0.0-alpha.3", - "21.0.0-alpha.4", - "21.0.0-alpha.5", - "21.0.0-nightly.20220720", - "21.0.0-nightly.20220721", - "21.0.0-nightly.20220722", - "21.0.0-nightly.20220725", - "21.0.0-nightly.20220726", - "21.0.0-nightly.20220727", - "21.0.0-nightly.20220728", - "21.0.0-nightly.20220801", - "21.0.0-nightly.20220802", - "22.0.0-nightly.20220808", - "22.0.0-nightly.20220809", - "22.0.0-nightly.20220810", - "22.0.0-nightly.20220811", - "22.0.0-nightly.20220812", - "22.0.0-nightly.20220815", - "22.0.0-nightly.20220816", - "22.0.0-nightly.20220817" - ], - "106.0.5216.0": [ - "21.0.0-alpha.6", - "21.0.0-beta.1", - "21.0.0-beta.2", - "21.0.0-beta.3", - "21.0.0-beta.4", - "21.0.0-beta.5", - "22.0.0-nightly.20220822", - "22.0.0-nightly.20220823", - "22.0.0-nightly.20220824", - "22.0.0-nightly.20220825", - "22.0.0-nightly.20220829", - "22.0.0-nightly.20220830", - "22.0.0-nightly.20220831", - "22.0.0-nightly.20220901", - "22.0.0-nightly.20220902", - "22.0.0-nightly.20220905" - ], - "106.0.5249.40": [ - "21.0.0-beta.6", - "21.0.0-beta.7", - "21.0.0-beta.8" - ], - "105.0.5129.0": [ - "21.0.0-nightly.20220628", - "21.0.0-nightly.20220629", - "21.0.0-nightly.20220630", - "21.0.0-nightly.20220701", - "21.0.0-nightly.20220704", - "21.0.0-nightly.20220705", - "21.0.0-nightly.20220706", - "21.0.0-nightly.20220707", - "21.0.0-nightly.20220708", - "21.0.0-nightly.20220711", - "21.0.0-nightly.20220712", - "21.0.0-nightly.20220713" - ], - "105.0.5173.0": [ - "21.0.0-nightly.20220715", - "21.0.0-nightly.20220718", - "21.0.0-nightly.20220719" - ], - "106.0.5249.51": [ - "21.0.0" - ], - "106.0.5249.61": [ - "21.0.1" - ], - "106.0.5249.91": [ - "21.1.0" - ], - "106.0.5249.103": [ - "21.1.1" - ], - "106.0.5249.119": [ - "21.2.0" - ], - "106.0.5249.165": [ - "21.2.1" - ], - "106.0.5249.168": [ - "21.2.2", - "21.2.3" - ], - "106.0.5249.181": [ - "21.3.0", - "21.3.1" - ], - "106.0.5249.199": [ - "21.3.3", - "21.3.4", - "21.3.5", - "21.4.0", - "21.4.1", - "21.4.2", - "21.4.3", - "21.4.4" - ], - "107.0.5286.0": [ - "22.0.0-alpha.1", - "22.0.0-nightly.20220909", - "22.0.0-nightly.20220912", - "22.0.0-nightly.20220913", - "22.0.0-nightly.20220914", - "22.0.0-nightly.20220915", - "22.0.0-nightly.20220916", - "22.0.0-nightly.20220919", - "22.0.0-nightly.20220920", - "22.0.0-nightly.20220921", - "22.0.0-nightly.20220922", - "22.0.0-nightly.20220923", - "22.0.0-nightly.20220926", - "22.0.0-nightly.20220927", - "22.0.0-nightly.20220928", - "23.0.0-nightly.20220929", - "23.0.0-nightly.20220930", - "23.0.0-nightly.20221003" - ], - "108.0.5329.0": [ - "22.0.0-alpha.3", - "22.0.0-alpha.4", - "22.0.0-alpha.5", - "22.0.0-alpha.6", - "23.0.0-nightly.20221004", - "23.0.0-nightly.20221005", - "23.0.0-nightly.20221006", - "23.0.0-nightly.20221007", - "23.0.0-nightly.20221010", - "23.0.0-nightly.20221011", - "23.0.0-nightly.20221012", - "23.0.0-nightly.20221013", - "23.0.0-nightly.20221014", - "23.0.0-nightly.20221017" - ], - "108.0.5355.0": [ - "22.0.0-alpha.7", - "23.0.0-nightly.20221018", - "23.0.0-nightly.20221019", - "23.0.0-nightly.20221020", - "23.0.0-nightly.20221021", - "23.0.0-nightly.20221024", - "23.0.0-nightly.20221026" - ], - "108.0.5359.10": [ - "22.0.0-alpha.8", - "22.0.0-beta.1", - "22.0.0-beta.2", - "22.0.0-beta.3" - ], - "108.0.5359.29": [ - "22.0.0-beta.4" - ], - "108.0.5359.40": [ - "22.0.0-beta.5", - "22.0.0-beta.6" - ], - "108.0.5359.48": [ - "22.0.0-beta.7", - "22.0.0-beta.8" - ], - "107.0.5274.0": [ - "22.0.0-nightly.20220908" - ], - "108.0.5359.62": [ - "22.0.0" - ], - "108.0.5359.125": [ - "22.0.1" - ], - "108.0.5359.179": [ - "22.0.2", - "22.0.3", - "22.1.0" - ], - "108.0.5359.215": [ - "22.2.0", - "22.2.1", - "22.3.0", - "22.3.1", - "22.3.2", - "22.3.3", - "22.3.4", - "22.3.5", - "22.3.6", - "22.3.7", - "22.3.8", - "22.3.9", - "22.3.10", - "22.3.11", - "22.3.12", - "22.3.13", - "22.3.14", - "22.3.15", - "22.3.16", - "22.3.17", - "22.3.18", - "22.3.20", - "22.3.21", - "22.3.22", - "22.3.23", - "22.3.24", - "22.3.25", - "22.3.26", - "22.3.27" - ], - "110.0.5415.0": [ - "23.0.0-alpha.1", - "23.0.0-nightly.20221118", - "23.0.0-nightly.20221121", - "23.0.0-nightly.20221122", - "23.0.0-nightly.20221123", - "23.0.0-nightly.20221124", - "23.0.0-nightly.20221125", - "23.0.0-nightly.20221128", - "23.0.0-nightly.20221129", - "23.0.0-nightly.20221130", - "24.0.0-nightly.20221201", - "24.0.0-nightly.20221202", - "24.0.0-nightly.20221205" - ], - "110.0.5451.0": [ - "23.0.0-alpha.2", - "23.0.0-alpha.3", - "24.0.0-nightly.20221206", - "24.0.0-nightly.20221207", - "24.0.0-nightly.20221208", - "24.0.0-nightly.20221213", - "24.0.0-nightly.20221214", - "24.0.0-nightly.20221215", - "24.0.0-nightly.20221216" - ], - "110.0.5478.5": [ - "23.0.0-beta.1", - "23.0.0-beta.2", - "23.0.0-beta.3" - ], - "110.0.5481.30": [ - "23.0.0-beta.4" - ], - "110.0.5481.38": [ - "23.0.0-beta.5" - ], - "110.0.5481.52": [ - "23.0.0-beta.6", - "23.0.0-beta.8" - ], - "109.0.5382.0": [ - "23.0.0-nightly.20221027", - "23.0.0-nightly.20221028", - "23.0.0-nightly.20221031", - "23.0.0-nightly.20221101", - "23.0.0-nightly.20221102", - "23.0.0-nightly.20221103", - "23.0.0-nightly.20221104", - "23.0.0-nightly.20221107", - "23.0.0-nightly.20221108", - "23.0.0-nightly.20221109", - "23.0.0-nightly.20221110", - "23.0.0-nightly.20221111", - "23.0.0-nightly.20221114", - "23.0.0-nightly.20221115", - "23.0.0-nightly.20221116", - "23.0.0-nightly.20221117" - ], - "110.0.5481.77": [ - "23.0.0" - ], - "110.0.5481.100": [ - "23.1.0" - ], - "110.0.5481.104": [ - "23.1.1" - ], - "110.0.5481.177": [ - "23.1.2" - ], - "110.0.5481.179": [ - "23.1.3" - ], - "110.0.5481.192": [ - "23.1.4", - "23.2.0" - ], - "110.0.5481.208": [ - "23.2.1", - "23.2.2", - "23.2.3", - "23.2.4", - "23.3.0", - "23.3.1", - "23.3.2", - "23.3.3", - "23.3.4", - "23.3.5", - "23.3.6", - "23.3.7", - "23.3.8", - "23.3.9", - "23.3.10", - "23.3.11", - "23.3.12", - "23.3.13" - ], - "111.0.5560.0": [ - "24.0.0-alpha.1", - "24.0.0-alpha.2", - "24.0.0-alpha.3", - "24.0.0-alpha.4", - "24.0.0-alpha.5", - "24.0.0-alpha.6", - "24.0.0-alpha.7", - "24.0.0-nightly.20230203", - "24.0.0-nightly.20230206", - "24.0.0-nightly.20230207", - "24.0.0-nightly.20230208", - "24.0.0-nightly.20230209", - "25.0.0-nightly.20230210", - "25.0.0-nightly.20230214", - "25.0.0-nightly.20230215", - "25.0.0-nightly.20230216", - "25.0.0-nightly.20230217", - "25.0.0-nightly.20230220", - "25.0.0-nightly.20230221", - "25.0.0-nightly.20230222", - "25.0.0-nightly.20230223", - "25.0.0-nightly.20230224", - "25.0.0-nightly.20230227", - "25.0.0-nightly.20230228", - "25.0.0-nightly.20230301", - "25.0.0-nightly.20230302", - "25.0.0-nightly.20230303", - "25.0.0-nightly.20230306", - "25.0.0-nightly.20230307", - "25.0.0-nightly.20230308", - "25.0.0-nightly.20230309", - "25.0.0-nightly.20230310" - ], - "111.0.5563.50": [ - "24.0.0-beta.1", - "24.0.0-beta.2" - ], - "112.0.5615.20": [ - "24.0.0-beta.3", - "24.0.0-beta.4" - ], - "112.0.5615.29": [ - "24.0.0-beta.5" - ], - "112.0.5615.39": [ - "24.0.0-beta.6", - "24.0.0-beta.7" - ], - "111.0.5518.0": [ - "24.0.0-nightly.20230109", - "24.0.0-nightly.20230110", - "24.0.0-nightly.20230111", - "24.0.0-nightly.20230112", - "24.0.0-nightly.20230113", - "24.0.0-nightly.20230116", - "24.0.0-nightly.20230117", - "24.0.0-nightly.20230118", - "24.0.0-nightly.20230119", - "24.0.0-nightly.20230120", - "24.0.0-nightly.20230123", - "24.0.0-nightly.20230124", - "24.0.0-nightly.20230125", - "24.0.0-nightly.20230126", - "24.0.0-nightly.20230127", - "24.0.0-nightly.20230131", - "24.0.0-nightly.20230201", - "24.0.0-nightly.20230202" - ], - "112.0.5615.49": [ - "24.0.0" - ], - "112.0.5615.50": [ - "24.1.0", - "24.1.1" - ], - "112.0.5615.87": [ - "24.1.2" - ], - "112.0.5615.165": [ - "24.1.3", - "24.2.0", - "24.3.0" - ], - "112.0.5615.183": [ - "24.3.1" - ], - "112.0.5615.204": [ - "24.4.0", - "24.4.1", - "24.5.0", - "24.5.1", - "24.6.0", - "24.6.1", - "24.6.2", - "24.6.3", - "24.6.4", - "24.6.5", - "24.7.0", - "24.7.1", - "24.8.0", - "24.8.1", - "24.8.2", - "24.8.3", - "24.8.4", - "24.8.5", - "24.8.6", - "24.8.7", - "24.8.8" - ], - "114.0.5694.0": [ - "25.0.0-alpha.1", - "25.0.0-alpha.2", - "25.0.0-nightly.20230405", - "26.0.0-nightly.20230406", - "26.0.0-nightly.20230407", - "26.0.0-nightly.20230410", - "26.0.0-nightly.20230411" - ], - "114.0.5710.0": [ - "25.0.0-alpha.3", - "25.0.0-alpha.4", - "26.0.0-nightly.20230413", - "26.0.0-nightly.20230414", - "26.0.0-nightly.20230417" - ], - "114.0.5719.0": [ - "25.0.0-alpha.5", - "25.0.0-alpha.6", - "25.0.0-beta.1", - "25.0.0-beta.2", - "25.0.0-beta.3", - "26.0.0-nightly.20230421", - "26.0.0-nightly.20230424", - "26.0.0-nightly.20230425", - "26.0.0-nightly.20230426", - "26.0.0-nightly.20230427", - "26.0.0-nightly.20230428", - "26.0.0-nightly.20230501", - "26.0.0-nightly.20230502", - "26.0.0-nightly.20230503", - "26.0.0-nightly.20230504", - "26.0.0-nightly.20230505", - "26.0.0-nightly.20230508", - "26.0.0-nightly.20230509", - "26.0.0-nightly.20230510" - ], - "114.0.5735.16": [ - "25.0.0-beta.4", - "25.0.0-beta.5", - "25.0.0-beta.6", - "25.0.0-beta.7" - ], - "114.0.5735.35": [ - "25.0.0-beta.8" - ], - "114.0.5735.45": [ - "25.0.0-beta.9", - "25.0.0", - "25.0.1" - ], - "113.0.5636.0": [ - "25.0.0-nightly.20230314" - ], - "113.0.5651.0": [ - "25.0.0-nightly.20230315" - ], - "113.0.5653.0": [ - "25.0.0-nightly.20230317" - ], - "113.0.5660.0": [ - "25.0.0-nightly.20230320" - ], - "113.0.5664.0": [ - "25.0.0-nightly.20230321" - ], - "113.0.5666.0": [ - "25.0.0-nightly.20230322" - ], - "113.0.5668.0": [ - "25.0.0-nightly.20230323" - ], - "113.0.5670.0": [ - "25.0.0-nightly.20230324", - "25.0.0-nightly.20230327", - "25.0.0-nightly.20230328", - "25.0.0-nightly.20230329", - "25.0.0-nightly.20230330" - ], - "114.0.5684.0": [ - "25.0.0-nightly.20230331", - "25.0.0-nightly.20230403" - ], - "114.0.5692.0": [ - "25.0.0-nightly.20230404" - ], - "114.0.5735.106": [ - "25.1.0", - "25.1.1" - ], - "114.0.5735.134": [ - "25.2.0" - ], - "114.0.5735.199": [ - "25.3.0" - ], - "114.0.5735.243": [ - "25.3.1" - ], - "114.0.5735.248": [ - "25.3.2", - "25.4.0" - ], - "114.0.5735.289": [ - "25.5.0", - "25.6.0", - "25.7.0", - "25.8.0", - "25.8.1", - "25.8.2", - "25.8.3", - "25.8.4", - "25.9.0", - "25.9.1", - "25.9.2", - "25.9.3", - "25.9.4", - "25.9.5", - "25.9.6", - "25.9.7", - "25.9.8" - ], - "116.0.5791.0": [ - "26.0.0-alpha.1", - "26.0.0-alpha.2", - "26.0.0-alpha.3", - "26.0.0-alpha.4", - "26.0.0-alpha.5", - "26.0.0-nightly.20230526", - "26.0.0-nightly.20230529", - "26.0.0-nightly.20230530", - "26.0.0-nightly.20230531", - "27.0.0-nightly.20230601", - "27.0.0-nightly.20230602", - "27.0.0-nightly.20230605", - "27.0.0-nightly.20230606", - "27.0.0-nightly.20230607", - "27.0.0-nightly.20230609" - ], - "116.0.5815.0": [ - "26.0.0-alpha.6", - "27.0.0-nightly.20230612", - "27.0.0-nightly.20230613" - ], - "116.0.5831.0": [ - "26.0.0-alpha.7", - "27.0.0-nightly.20230615" - ], - "116.0.5845.0": [ - "26.0.0-alpha.8", - "26.0.0-beta.1", - "27.0.0-nightly.20230622", - "27.0.0-nightly.20230623", - "27.0.0-nightly.20230626", - "27.0.0-nightly.20230627", - "27.0.0-nightly.20230628", - "27.0.0-nightly.20230629", - "27.0.0-nightly.20230630" - ], - "116.0.5845.14": [ - "26.0.0-beta.2", - "26.0.0-beta.3", - "26.0.0-beta.4", - "26.0.0-beta.5", - "26.0.0-beta.6", - "26.0.0-beta.7" - ], - "116.0.5845.42": [ - "26.0.0-beta.8", - "26.0.0-beta.9" - ], - "116.0.5845.49": [ - "26.0.0-beta.10", - "26.0.0-beta.11" - ], - "116.0.5845.62": [ - "26.0.0-beta.12" - ], - "114.0.5708.0": [ - "26.0.0-nightly.20230412" - ], - "114.0.5715.0": [ - "26.0.0-nightly.20230418" - ], - "115.0.5760.0": [ - "26.0.0-nightly.20230511", - "26.0.0-nightly.20230512", - "26.0.0-nightly.20230515", - "26.0.0-nightly.20230516", - "26.0.0-nightly.20230517", - "26.0.0-nightly.20230518", - "26.0.0-nightly.20230519", - "26.0.0-nightly.20230522", - "26.0.0-nightly.20230523" - ], - "115.0.5786.0": [ - "26.0.0-nightly.20230524" - ], - "115.0.5790.0": [ - "26.0.0-nightly.20230525" - ], - "116.0.5845.82": [ - "26.0.0" - ], - "116.0.5845.97": [ - "26.1.0" - ], - "116.0.5845.179": [ - "26.2.0" - ], - "116.0.5845.188": [ - "26.2.1" - ], - "116.0.5845.190": [ - "26.2.2", - "26.2.3", - "26.2.4" - ], - "116.0.5845.228": [ - "26.3.0", - "26.4.0", - "26.4.1", - "26.4.2", - "26.4.3", - "26.5.0", - "26.6.0", - "26.6.1", - "26.6.2", - "26.6.3", - "26.6.4", - "26.6.5", - "26.6.6", - "26.6.7", - "26.6.8" - ], - "118.0.5949.0": [ - "27.0.0-alpha.1", - "27.0.0-alpha.2", - "27.0.0-alpha.3", - "27.0.0-alpha.4", - "27.0.0-alpha.5", - "27.0.0-alpha.6", - "27.0.0-nightly.20230816", - "28.0.0-nightly.20230817", - "28.0.0-nightly.20230818", - "28.0.0-nightly.20230821", - "28.0.0-nightly.20230822", - "28.0.0-nightly.20230823", - "28.0.0-nightly.20230824", - "28.0.0-nightly.20230825", - "28.0.0-nightly.20230828", - "28.0.0-nightly.20230829", - "28.0.0-nightly.20230830", - "28.0.0-nightly.20230831" - ], - "118.0.5993.5": [ - "27.0.0-beta.1", - "27.0.0-beta.2", - "27.0.0-beta.3" - ], - "118.0.5993.11": [ - "27.0.0-beta.4" - ], - "118.0.5993.18": [ - "27.0.0-beta.5", - "27.0.0-beta.6", - "27.0.0-beta.7", - "27.0.0-beta.8", - "27.0.0-beta.9" - ], - "116.0.5829.0": [ - "27.0.0-nightly.20230614" - ], - "116.0.5833.0": [ - "27.0.0-nightly.20230616", - "27.0.0-nightly.20230619", - "27.0.0-nightly.20230620", - "27.0.0-nightly.20230621" - ], - "117.0.5852.0": [ - "27.0.0-nightly.20230703", - "27.0.0-nightly.20230704", - "27.0.0-nightly.20230705", - "27.0.0-nightly.20230706", - "27.0.0-nightly.20230707", - "27.0.0-nightly.20230710", - "27.0.0-nightly.20230711", - "27.0.0-nightly.20230712", - "27.0.0-nightly.20230713", - "27.0.0-nightly.20230714" - ], - "117.0.5884.1": [ - "27.0.0-nightly.20230717", - "27.0.0-nightly.20230718" - ], - "117.0.5892.0": [ - "27.0.0-nightly.20230719" - ], - "117.0.5897.0": [ - "27.0.0-nightly.20230720", - "27.0.0-nightly.20230721", - "27.0.0-nightly.20230724", - "27.0.0-nightly.20230725", - "27.0.0-nightly.20230726", - "27.0.0-nightly.20230727", - "27.0.0-nightly.20230728", - "27.0.0-nightly.20230731" - ], - "117.0.5911.0": [ - "27.0.0-nightly.20230801", - "27.0.0-nightly.20230802", - "27.0.0-nightly.20230803" - ], - "117.0.5921.0": [ - "27.0.0-nightly.20230804", - "27.0.0-nightly.20230807", - "27.0.0-nightly.20230808", - "27.0.0-nightly.20230814", - "27.0.0-nightly.20230815" - ], - "118.0.5993.54": [ - "27.0.0" - ], - "118.0.5993.89": [ - "27.0.1", - "27.0.2" - ], - "118.0.5993.120": [ - "27.0.3" - ], - "118.0.5993.129": [ - "27.0.4" - ], - "118.0.5993.144": [ - "27.1.0", - "27.1.2" - ], - "118.0.5993.159": [ - "27.1.3", - "27.2.0", - "27.2.1", - "27.2.2", - "27.2.3", - "27.2.4", - "27.3.0", - "27.3.1" - ], - "119.0.6045.0": [ - "28.0.0-alpha.1", - "28.0.0-alpha.2", - "28.0.0-nightly.20231006", - "28.0.0-nightly.20231009", - "28.0.0-nightly.20231010", - "28.0.0-nightly.20231011", - "29.0.0-nightly.20231012", - "29.0.0-nightly.20231013", - "29.0.0-nightly.20231016", - "29.0.0-nightly.20231017", - "29.0.0-nightly.20231018", - "29.0.0-nightly.20231019", - "29.0.0-nightly.20231020", - "29.0.0-nightly.20231023", - "29.0.0-nightly.20231024" - ], - "119.0.6045.21": [ - "28.0.0-alpha.3", - "28.0.0-alpha.4" - ], - "119.0.6045.33": [ - "28.0.0-alpha.5", - "28.0.0-alpha.6", - "28.0.0-alpha.7", - "28.0.0-beta.1" - ], - "120.0.6099.0": [ - "28.0.0-beta.2" - ], - "120.0.6099.5": [ - "28.0.0-beta.3", - "28.0.0-beta.4" - ], - "120.0.6099.18": [ - "28.0.0-beta.5", - "28.0.0-beta.6", - "28.0.0-beta.7", - "28.0.0-beta.8", - "28.0.0-beta.9", - "28.0.0-beta.10" - ], - "120.0.6099.35": [ - "28.0.0-beta.11" - ], - "118.0.5991.0": [ - "28.0.0-nightly.20230906" - ], - "118.0.5993.0": [ - "28.0.0-nightly.20230907", - "28.0.0-nightly.20230908", - "28.0.0-nightly.20230911", - "28.0.0-nightly.20230912", - "28.0.0-nightly.20230913", - "28.0.0-nightly.20230914", - "28.0.0-nightly.20230915" - ], - "119.0.6006.0": [ - "28.0.0-nightly.20230919" - ], - "119.0.6017.0": [ - "28.0.0-nightly.20230920" - ], - "119.0.6019.2": [ - "28.0.0-nightly.20230921", - "28.0.0-nightly.20230925", - "28.0.0-nightly.20230926", - "28.0.0-nightly.20230927", - "28.0.0-nightly.20230928" - ], - "119.0.6029.0": [ - "28.0.0-nightly.20230929", - "28.0.0-nightly.20231002" - ], - "119.0.6043.0": [ - "28.0.0-nightly.20231003", - "28.0.0-nightly.20231004", - "28.0.0-nightly.20231005" - ], - "120.0.6099.56": [ - "28.0.0" - ], - "120.0.6099.109": [ - "28.1.0", - "28.1.1" - ], - "120.0.6099.199": [ - "28.1.2", - "28.1.3" - ], - "120.0.6099.216": [ - "28.1.4" - ], - "120.0.6099.227": [ - "28.2.0" - ], - "120.0.6099.268": [ - "28.2.1" - ], - "121.0.6147.0": [ - "29.0.0-alpha.1", - "29.0.0-alpha.2", - "29.0.0-alpha.3", - "29.0.0-nightly.20231129", - "29.0.0-nightly.20231130", - "29.0.0-nightly.20231201", - "29.0.0-nightly.20231204", - "29.0.0-nightly.20231205", - "29.0.0-nightly.20231206", - "30.0.0-nightly.20231207", - "30.0.0-nightly.20231208", - "30.0.0-nightly.20231211" - ], - "121.0.6159.0": [ - "29.0.0-alpha.4", - "29.0.0-alpha.5", - "29.0.0-alpha.6", - "29.0.0-alpha.7", - "30.0.0-nightly.20231212", - "30.0.0-nightly.20231213", - "30.0.0-nightly.20231214", - "30.0.0-nightly.20231215", - "30.0.0-nightly.20231218", - "30.0.0-nightly.20240102" - ], - "122.0.6194.0": [ - "29.0.0-alpha.8", - "30.0.0-nightly.20240103", - "30.0.0-nightly.20240104", - "30.0.0-nightly.20240105", - "30.0.0-nightly.20240108", - "30.0.0-nightly.20240109", - "30.0.0-nightly.20240110" - ], - "122.0.6236.2": [ - "29.0.0-alpha.9", - "29.0.0-alpha.10", - "29.0.0-alpha.11", - "29.0.0-beta.1", - "29.0.0-beta.2", - "30.0.0-nightly.20240111", - "30.0.0-nightly.20240112", - "30.0.0-nightly.20240115", - "30.0.0-nightly.20240116", - "30.0.0-nightly.20240117", - "30.0.0-nightly.20240118", - "30.0.0-nightly.20240119", - "30.0.0-nightly.20240122", - "30.0.0-nightly.20240123", - "30.0.0-nightly.20240124", - "30.0.0-nightly.20240125" - ], - "122.0.6261.6": [ - "29.0.0-beta.3", - "29.0.0-beta.4" - ], - "122.0.6261.18": [ - "29.0.0-beta.5" - ], - "120.0.6078.0": [ - "29.0.0-nightly.20231025", - "29.0.0-nightly.20231026", - "29.0.0-nightly.20231027", - "29.0.0-nightly.20231030", - "29.0.0-nightly.20231031", - "29.0.0-nightly.20231101" - ], - "121.0.6100.0": [ - "29.0.0-nightly.20231102", - "29.0.0-nightly.20231103" - ], - "121.0.6104.0": [ - "29.0.0-nightly.20231106" - ], - "121.0.6110.0": [ - "29.0.0-nightly.20231107", - "29.0.0-nightly.20231108", - "29.0.0-nightly.20231109", - "29.0.0-nightly.20231110", - "29.0.0-nightly.20231113", - "29.0.0-nightly.20231114" - ], - "121.0.6116.0": [ - "29.0.0-nightly.20231115", - "29.0.0-nightly.20231116", - "29.0.0-nightly.20231117", - "29.0.0-nightly.20231120", - "29.0.0-nightly.20231121", - "29.0.0-nightly.20231122", - "29.0.0-nightly.20231123", - "29.0.0-nightly.20231124", - "29.0.0-nightly.20231127", - "29.0.0-nightly.20231128" - ], - "123.0.6264.0": [ - "30.0.0-nightly.20240126", - "30.0.0-nightly.20240129", - "30.0.0-nightly.20240130", - "30.0.0-nightly.20240131" - ], - "123.0.6272.0": [ - "30.0.0-nightly.20240201", - "30.0.0-nightly.20240202", - "30.0.0-nightly.20240205" - ] -}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-chromium-versions.json b/node_modules/electron-to-chromium/full-chromium-versions.json deleted file mode 100644 index cc6f991..0000000 --- a/node_modules/electron-to-chromium/full-chromium-versions.json +++ /dev/null @@ -1 +0,0 @@ -{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8-nightly.20180819","2.0.8-nightly.20180820","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0-nightly.20180818","3.0.0-nightly.20180821","3.0.0-nightly.20180823","3.0.0-nightly.20180904","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13","4.0.0-nightly.20180817","4.0.0-nightly.20180819","4.0.0-nightly.20180821"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0-nightly.20181010","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"67.0.3396.99":["4.0.0-nightly.20180929"],"68.0.3440.128":["4.0.0-nightly.20181006"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2","6.0.0-nightly.20190123"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"70.0.3538.110":["5.0.0-nightly.20190107"],"71.0.3578.98":["5.0.0-nightly.20190121","5.0.0-nightly.20190122"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"72.0.3626.107":["6.0.0-nightly.20190212"],"72.0.3626.110":["6.0.0-nightly.20190213"],"74.0.3724.8":["6.0.0-nightly.20190311"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3","7.0.0-nightly.20190727","7.0.0-nightly.20190728","7.0.0-nightly.20190729","7.0.0-nightly.20190730","7.0.0-nightly.20190731","8.0.0-nightly.20190801","8.0.0-nightly.20190802"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"76.0.3784.0":["7.0.0-nightly.20190521"],"76.0.3806.0":["7.0.0-nightly.20190529","7.0.0-nightly.20190530","7.0.0-nightly.20190531","7.0.0-nightly.20190602","7.0.0-nightly.20190603"],"77.0.3814.0":["7.0.0-nightly.20190604"],"77.0.3815.0":["7.0.0-nightly.20190605","7.0.0-nightly.20190606","7.0.0-nightly.20190607","7.0.0-nightly.20190608","7.0.0-nightly.20190609","7.0.0-nightly.20190611","7.0.0-nightly.20190612","7.0.0-nightly.20190613","7.0.0-nightly.20190615","7.0.0-nightly.20190616","7.0.0-nightly.20190618","7.0.0-nightly.20190619","7.0.0-nightly.20190622","7.0.0-nightly.20190623","7.0.0-nightly.20190624","7.0.0-nightly.20190627","7.0.0-nightly.20190629","7.0.0-nightly.20190630","7.0.0-nightly.20190701","7.0.0-nightly.20190702"],"77.0.3843.0":["7.0.0-nightly.20190704","7.0.0-nightly.20190705"],"77.0.3848.0":["7.0.0-nightly.20190719","7.0.0-nightly.20190720","7.0.0-nightly.20190721"],"77.0.3864.0":["7.0.0-nightly.20190726"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2","8.0.0-nightly.20191019","8.0.0-nightly.20191020","8.0.0-nightly.20191021","8.0.0-nightly.20191023"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"78.0.3871.0":["8.0.0-nightly.20190803","8.0.0-nightly.20190806","8.0.0-nightly.20190807","8.0.0-nightly.20190808","8.0.0-nightly.20190809","8.0.0-nightly.20190810","8.0.0-nightly.20190811","8.0.0-nightly.20190812","8.0.0-nightly.20190813","8.0.0-nightly.20190814","8.0.0-nightly.20190815"],"78.0.3881.0":["8.0.0-nightly.20190816","8.0.0-nightly.20190817","8.0.0-nightly.20190818","8.0.0-nightly.20190819","8.0.0-nightly.20190820"],"78.0.3892.0":["8.0.0-nightly.20190824","8.0.0-nightly.20190825","8.0.0-nightly.20190827","8.0.0-nightly.20190828","8.0.0-nightly.20190830","8.0.0-nightly.20190901","8.0.0-nightly.20190902","8.0.0-nightly.20190907","8.0.0-nightly.20190909","8.0.0-nightly.20190910","8.0.0-nightly.20190911","8.0.0-nightly.20190912","8.0.0-nightly.20190913","8.0.0-nightly.20190914","8.0.0-nightly.20190915","8.0.0-nightly.20190917"],"79.0.3915.0":["8.0.0-nightly.20190919","8.0.0-nightly.20190920"],"79.0.3919.0":["8.0.0-nightly.20190922","8.0.0-nightly.20190923","8.0.0-nightly.20190924","8.0.0-nightly.20190926","8.0.0-nightly.20190928","8.0.0-nightly.20190929","8.0.0-nightly.20190930","8.0.0-nightly.20191001","8.0.0-nightly.20191004","8.0.0-nightly.20191005","8.0.0-nightly.20191006","8.0.0-nightly.20191009","8.0.0-nightly.20191011","8.0.0-nightly.20191012","8.0.0-nightly.20191017"],"80.0.3952.0":["8.0.0-nightly.20191101","8.0.0-nightly.20191103","8.0.0-nightly.20191105"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.11","9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"80.0.3954.0":["9.0.0-nightly.20191121","9.0.0-nightly.20191122","9.0.0-nightly.20191123","9.0.0-nightly.20191124","9.0.0-nightly.20191126","9.0.0-nightly.20191128","9.0.0-nightly.20191129","9.0.0-nightly.20191130","9.0.0-nightly.20191201","9.0.0-nightly.20191202","9.0.0-nightly.20191203","9.0.0-nightly.20191204","9.0.0-nightly.20191205","9.0.0-nightly.20191210"],"81.0.3994.0":["9.0.0-nightly.20191220","9.0.0-nightly.20191221","9.0.0-nightly.20191222","9.0.0-nightly.20191223","9.0.0-nightly.20191224","9.0.0-nightly.20191225","9.0.0-nightly.20191226","9.0.0-nightly.20191228","9.0.0-nightly.20191229","9.0.0-nightly.20191230","9.0.0-nightly.20191231","9.0.0-nightly.20200101","9.0.0-nightly.20200103","9.0.0-nightly.20200104","9.0.0-nightly.20200105","9.0.0-nightly.20200106","9.0.0-nightly.20200108","9.0.0-nightly.20200109","9.0.0-nightly.20200110","9.0.0-nightly.20200111","9.0.0-nightly.20200113","9.0.0-nightly.20200115","9.0.0-nightly.20200116","9.0.0-nightly.20200117"],"81.0.4030.0":["9.0.0-nightly.20200119","9.0.0-nightly.20200121"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2","10.0.0-nightly.20200501","10.0.0-nightly.20200504","10.0.0-nightly.20200505","10.0.0-nightly.20200506","10.0.0-nightly.20200507","10.0.0-nightly.20200508","10.0.0-nightly.20200511","10.0.0-nightly.20200512","10.0.0-nightly.20200513","10.0.0-nightly.20200514","10.0.0-nightly.20200515","10.0.0-nightly.20200518","10.0.0-nightly.20200519","10.0.0-nightly.20200520","10.0.0-nightly.20200521","11.0.0-nightly.20200525","11.0.0-nightly.20200526"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"82.0.4050.0":["10.0.0-nightly.20200209","10.0.0-nightly.20200210","10.0.0-nightly.20200211","10.0.0-nightly.20200216","10.0.0-nightly.20200217","10.0.0-nightly.20200218","10.0.0-nightly.20200221","10.0.0-nightly.20200222","10.0.0-nightly.20200223","10.0.0-nightly.20200226","10.0.0-nightly.20200303"],"82.0.4076.0":["10.0.0-nightly.20200304","10.0.0-nightly.20200305","10.0.0-nightly.20200306","10.0.0-nightly.20200309","10.0.0-nightly.20200310"],"82.0.4083.0":["10.0.0-nightly.20200311"],"83.0.4086.0":["10.0.0-nightly.20200316"],"83.0.4087.0":["10.0.0-nightly.20200317","10.0.0-nightly.20200318","10.0.0-nightly.20200320","10.0.0-nightly.20200323","10.0.0-nightly.20200324","10.0.0-nightly.20200325","10.0.0-nightly.20200326","10.0.0-nightly.20200327","10.0.0-nightly.20200330","10.0.0-nightly.20200331","10.0.0-nightly.20200401","10.0.0-nightly.20200402","10.0.0-nightly.20200403","10.0.0-nightly.20200406"],"83.0.4095.0":["10.0.0-nightly.20200408","10.0.0-nightly.20200410","10.0.0-nightly.20200413"],"84.0.4114.0":["10.0.0-nightly.20200414"],"84.0.4115.0":["10.0.0-nightly.20200415","10.0.0-nightly.20200416","10.0.0-nightly.20200417"],"84.0.4121.0":["10.0.0-nightly.20200422","10.0.0-nightly.20200423"],"84.0.4125.0":["10.0.0-nightly.20200427","10.0.0-nightly.20200428","10.0.0-nightly.20200429","10.0.0-nightly.20200430"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7","11.0.0-nightly.20200822","11.0.0-nightly.20200824","11.0.0-nightly.20200825","11.0.0-nightly.20200826","12.0.0-nightly.20200827","12.0.0-nightly.20200831","12.0.0-nightly.20200902","12.0.0-nightly.20200903","12.0.0-nightly.20200907","12.0.0-nightly.20200910","12.0.0-nightly.20200911","12.0.0-nightly.20200914"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"85.0.4156.0":["11.0.0-nightly.20200529"],"85.0.4162.0":["11.0.0-nightly.20200602","11.0.0-nightly.20200603","11.0.0-nightly.20200604","11.0.0-nightly.20200609","11.0.0-nightly.20200610","11.0.0-nightly.20200611","11.0.0-nightly.20200615","11.0.0-nightly.20200616","11.0.0-nightly.20200617","11.0.0-nightly.20200618","11.0.0-nightly.20200619"],"85.0.4179.0":["11.0.0-nightly.20200701","11.0.0-nightly.20200702","11.0.0-nightly.20200703","11.0.0-nightly.20200706","11.0.0-nightly.20200707","11.0.0-nightly.20200708","11.0.0-nightly.20200709"],"86.0.4203.0":["11.0.0-nightly.20200716","11.0.0-nightly.20200717","11.0.0-nightly.20200720","11.0.0-nightly.20200721"],"86.0.4209.0":["11.0.0-nightly.20200723","11.0.0-nightly.20200724","11.0.0-nightly.20200729","11.0.0-nightly.20200730","11.0.0-nightly.20200731","11.0.0-nightly.20200803","11.0.0-nightly.20200804","11.0.0-nightly.20200805","11.0.0-nightly.20200811","11.0.0-nightly.20200812"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14","13.0.0-nightly.20201119","13.0.0-nightly.20201123","13.0.0-nightly.20201124","13.0.0-nightly.20201126","13.0.0-nightly.20201127","13.0.0-nightly.20201130","13.0.0-nightly.20201201","13.0.0-nightly.20201202","13.0.0-nightly.20201203","13.0.0-nightly.20201204","13.0.0-nightly.20201207","13.0.0-nightly.20201208","13.0.0-nightly.20201209","13.0.0-nightly.20201210","13.0.0-nightly.20201211","13.0.0-nightly.20201214"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"87.0.4268.0":["12.0.0-nightly.20201002","12.0.0-nightly.20201007","12.0.0-nightly.20201009","12.0.0-nightly.20201012","12.0.0-nightly.20201013","12.0.0-nightly.20201014","12.0.0-nightly.20201015"],"88.0.4292.0":["12.0.0-nightly.20201023","12.0.0-nightly.20201026"],"88.0.4306.0":["12.0.0-nightly.20201030","12.0.0-nightly.20201102","12.0.0-nightly.20201103","12.0.0-nightly.20201104","12.0.0-nightly.20201105","12.0.0-nightly.20201106","12.0.0-nightly.20201111","12.0.0-nightly.20201112"],"88.0.4324.0":["12.0.0-nightly.20201116"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3","13.0.0-nightly.20210210","13.0.0-nightly.20210211","13.0.0-nightly.20210212","13.0.0-nightly.20210216","13.0.0-nightly.20210217","13.0.0-nightly.20210218","13.0.0-nightly.20210219","13.0.0-nightly.20210222","13.0.0-nightly.20210225","13.0.0-nightly.20210226","13.0.0-nightly.20210301","13.0.0-nightly.20210302","13.0.0-nightly.20210303","14.0.0-nightly.20210304"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.10","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13","14.0.0-nightly.20210305","14.0.0-nightly.20210308","14.0.0-nightly.20210309","14.0.0-nightly.20210311","14.0.0-nightly.20210315","14.0.0-nightly.20210316","14.0.0-nightly.20210317","14.0.0-nightly.20210318","14.0.0-nightly.20210319","14.0.0-nightly.20210323","14.0.0-nightly.20210324","14.0.0-nightly.20210325","14.0.0-nightly.20210326","14.0.0-nightly.20210329","14.0.0-nightly.20210330"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20","14.0.0-nightly.20210331","14.0.0-nightly.20210401","14.0.0-nightly.20210402","14.0.0-nightly.20210406","14.0.0-nightly.20210407","14.0.0-nightly.20210408","14.0.0-nightly.20210409","14.0.0-nightly.20210413"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.25","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"89.0.4349.0":["13.0.0-nightly.20201215","13.0.0-nightly.20201216","13.0.0-nightly.20201221","13.0.0-nightly.20201222"],"89.0.4359.0":["13.0.0-nightly.20201223","13.0.0-nightly.20210104","13.0.0-nightly.20210108","13.0.0-nightly.20210111"],"89.0.4386.0":["13.0.0-nightly.20210113","13.0.0-nightly.20210114","13.0.0-nightly.20210118","13.0.0-nightly.20210122","13.0.0-nightly.20210125"],"89.0.4389.0":["13.0.0-nightly.20210127","13.0.0-nightly.20210128","13.0.0-nightly.20210129","13.0.0-nightly.20210201","13.0.0-nightly.20210202","13.0.0-nightly.20210203","13.0.0-nightly.20210205","13.0.0-nightly.20210208","13.0.0-nightly.20210209"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2","13.6.3","13.6.6","13.6.7","13.6.8","13.6.9"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3","14.0.0-nightly.20210520","14.0.0-nightly.20210523","14.0.0-nightly.20210524","15.0.0-nightly.20210527","15.0.0-nightly.20210528","15.0.0-nightly.20210531","15.0.0-nightly.20210601","15.0.0-nightly.20210602"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8","15.0.0-nightly.20210609","15.0.0-nightly.20210610","15.0.0-nightly.20210611","15.0.0-nightly.20210614","15.0.0-nightly.20210615","15.0.0-nightly.20210616"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10","15.0.0-nightly.20210617","15.0.0-nightly.20210618","15.0.0-nightly.20210621","15.0.0-nightly.20210622"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2","15.0.0-nightly.20210706","15.0.0-nightly.20210707","15.0.0-nightly.20210708","15.0.0-nightly.20210709","15.0.0-nightly.20210712","15.0.0-nightly.20210713","15.0.0-nightly.20210714","15.0.0-nightly.20210715","15.0.0-nightly.20210716","15.0.0-nightly.20210719","15.0.0-nightly.20210720","15.0.0-nightly.20210721","16.0.0-nightly.20210722","16.0.0-nightly.20210723","16.0.0-nightly.20210726"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"92.0.4475.0":["14.0.0-nightly.20210426","14.0.0-nightly.20210427"],"92.0.4488.0":["14.0.0-nightly.20210430","14.0.0-nightly.20210503"],"92.0.4496.0":["14.0.0-nightly.20210505"],"92.0.4498.0":["14.0.0-nightly.20210506"],"92.0.4499.0":["14.0.0-nightly.20210507","14.0.0-nightly.20210510","14.0.0-nightly.20210511","14.0.0-nightly.20210512","14.0.0-nightly.20210513"],"92.0.4505.0":["14.0.0-nightly.20210514","14.0.0-nightly.20210517","14.0.0-nightly.20210518","14.0.0-nightly.20210519"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1","14.2.2","14.2.3","14.2.4","14.2.5","14.2.6","14.2.7","14.2.8","14.2.9"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6","16.0.0-nightly.20210727","16.0.0-nightly.20210728","16.0.0-nightly.20210729","16.0.0-nightly.20210730","16.0.0-nightly.20210802","16.0.0-nightly.20210803","16.0.0-nightly.20210804","16.0.0-nightly.20210805","16.0.0-nightly.20210806","16.0.0-nightly.20210809","16.0.0-nightly.20210810","16.0.0-nightly.20210811"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9","16.0.0-nightly.20210812","16.0.0-nightly.20210813","16.0.0-nightly.20210816","16.0.0-nightly.20210817","16.0.0-nightly.20210818","16.0.0-nightly.20210819","16.0.0-nightly.20210820","16.0.0-nightly.20210823"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"93.0.4530.0":["15.0.0-nightly.20210603","15.0.0-nightly.20210604"],"93.0.4535.0":["15.0.0-nightly.20210608"],"93.0.4550.0":["15.0.0-nightly.20210623","15.0.0-nightly.20210624"],"93.0.4552.0":["15.0.0-nightly.20210625","15.0.0-nightly.20210628","15.0.0-nightly.20210629"],"93.0.4558.0":["15.0.0-nightly.20210630","15.0.0-nightly.20210701","15.0.0-nightly.20210702","15.0.0-nightly.20210705"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2","15.3.3","15.3.4","15.3.5","15.3.6","15.3.7","15.4.0","15.4.1","15.4.2","15.5.0","15.5.1","15.5.2","15.5.3","15.5.4","15.5.5","15.5.6","15.5.7"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7","16.0.0-nightly.20210902","16.0.0-nightly.20210903","16.0.0-nightly.20210906","16.0.0-nightly.20210907","16.0.0-nightly.20210908","16.0.0-nightly.20210909","16.0.0-nightly.20210910","16.0.0-nightly.20210913","16.0.0-nightly.20210914","16.0.0-nightly.20210915","16.0.0-nightly.20210916","16.0.0-nightly.20210917","16.0.0-nightly.20210920","16.0.0-nightly.20210921","16.0.0-nightly.20210922","17.0.0-nightly.20210923","17.0.0-nightly.20210924","17.0.0-nightly.20210927","17.0.0-nightly.20210928","17.0.0-nightly.20210929","17.0.0-nightly.20210930","17.0.0-nightly.20211001","17.0.0-nightly.20211004","17.0.0-nightly.20211005"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3","17.0.0-nightly.20211006","17.0.0-nightly.20211007","17.0.0-nightly.20211008","17.0.0-nightly.20211011","17.0.0-nightly.20211012","17.0.0-nightly.20211013","17.0.0-nightly.20211014","17.0.0-nightly.20211015","17.0.0-nightly.20211018","17.0.0-nightly.20211019","17.0.0-nightly.20211020","17.0.0-nightly.20211021"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"95.0.4612.5":["16.0.0-nightly.20210824","16.0.0-nightly.20210825","16.0.0-nightly.20210826","16.0.0-nightly.20210827","16.0.0-nightly.20210830","16.0.0-nightly.20210831","16.0.0-nightly.20210901"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2","16.0.3","16.0.4","16.0.5"],"96.0.4664.110":["16.0.6","16.0.7","16.0.8"],"96.0.4664.174":["16.0.9","16.0.10","16.1.0","16.1.1","16.2.0","16.2.1","16.2.2","16.2.3","16.2.4","16.2.5","16.2.6","16.2.7","16.2.8"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3","17.0.0-nightly.20211022","17.0.0-nightly.20211025","17.0.0-nightly.20211026","17.0.0-nightly.20211027","17.0.0-nightly.20211028","17.0.0-nightly.20211029","17.0.0-nightly.20211101","17.0.0-nightly.20211102","17.0.0-nightly.20211103","17.0.0-nightly.20211104","17.0.0-nightly.20211105","17.0.0-nightly.20211108","17.0.0-nightly.20211109","17.0.0-nightly.20211110","17.0.0-nightly.20211111","17.0.0-nightly.20211112","17.0.0-nightly.20211115","17.0.0-nightly.20211116","17.0.0-nightly.20211117","18.0.0-nightly.20211118","18.0.0-nightly.20211119","18.0.0-nightly.20211122","18.0.0-nightly.20211123"],"98.0.4706.0":["17.0.0-alpha.4","17.0.0-alpha.5","17.0.0-alpha.6","17.0.0-beta.1","17.0.0-beta.2","18.0.0-nightly.20211124","18.0.0-nightly.20211125","18.0.0-nightly.20211126","18.0.0-nightly.20211129","18.0.0-nightly.20211130","18.0.0-nightly.20211201","18.0.0-nightly.20211202","18.0.0-nightly.20211203","18.0.0-nightly.20211206","18.0.0-nightly.20211207","18.0.0-nightly.20211208","18.0.0-nightly.20211209","18.0.0-nightly.20211210","18.0.0-nightly.20211213","18.0.0-nightly.20211214","18.0.0-nightly.20211215","18.0.0-nightly.20211216","18.0.0-nightly.20211217","18.0.0-nightly.20211220","18.0.0-nightly.20211221","18.0.0-nightly.20211222","18.0.0-nightly.20211223","18.0.0-nightly.20211228","18.0.0-nightly.20211229","18.0.0-nightly.20211231","18.0.0-nightly.20220103","18.0.0-nightly.20220104","18.0.0-nightly.20220105","18.0.0-nightly.20220106","18.0.0-nightly.20220107","18.0.0-nightly.20220110"],"98.0.4758.9":["17.0.0-beta.3"],"98.0.4758.11":["17.0.0-beta.4","17.0.0-beta.5","17.0.0-beta.6","17.0.0-beta.7","17.0.0-beta.8","17.0.0-beta.9"],"98.0.4758.74":["17.0.0"],"98.0.4758.82":["17.0.1"],"98.0.4758.102":["17.1.0"],"98.0.4758.109":["17.1.1","17.1.2","17.2.0"],"98.0.4758.141":["17.3.0","17.3.1","17.4.0","17.4.1","17.4.2","17.4.3","17.4.4","17.4.5","17.4.6","17.4.7","17.4.8","17.4.9","17.4.10","17.4.11"],"99.0.4767.0":["18.0.0-alpha.1","18.0.0-alpha.2","18.0.0-alpha.3","18.0.0-alpha.4","18.0.0-alpha.5","18.0.0-nightly.20220111","18.0.0-nightly.20220112","18.0.0-nightly.20220113","18.0.0-nightly.20220114","18.0.0-nightly.20220117","18.0.0-nightly.20220118","18.0.0-nightly.20220119","18.0.0-nightly.20220121","18.0.0-nightly.20220124","18.0.0-nightly.20220125","18.0.0-nightly.20220127","18.0.0-nightly.20220128","18.0.0-nightly.20220131","18.0.0-nightly.20220201","19.0.0-nightly.20220202","19.0.0-nightly.20220203","19.0.0-nightly.20220204","19.0.0-nightly.20220207","19.0.0-nightly.20220208","19.0.0-nightly.20220209"],"100.0.4894.0":["18.0.0-beta.1","18.0.0-beta.2","18.0.0-beta.3","18.0.0-beta.4","18.0.0-beta.5","18.0.0-beta.6","19.0.0-nightly.20220308","19.0.0-nightly.20220309","19.0.0-nightly.20220310","19.0.0-nightly.20220311","19.0.0-nightly.20220314","19.0.0-nightly.20220315","19.0.0-nightly.20220316","19.0.0-nightly.20220317","19.0.0-nightly.20220318","19.0.0-nightly.20220321","19.0.0-nightly.20220322","19.0.0-nightly.20220323","19.0.0-nightly.20220324"],"100.0.4896.56":["18.0.0"],"100.0.4896.60":["18.0.1","18.0.2"],"100.0.4896.75":["18.0.3","18.0.4"],"100.0.4896.127":["18.1.0"],"100.0.4896.143":["18.2.0","18.2.1","18.2.2","18.2.3"],"100.0.4896.160":["18.2.4","18.3.0","18.3.1","18.3.2","18.3.3","18.3.4","18.3.5","18.3.6","18.3.7","18.3.8","18.3.9","18.3.11","18.3.12","18.3.13","18.3.14","18.3.15"],"102.0.4962.3":["19.0.0-alpha.1","19.0.0-nightly.20220328","19.0.0-nightly.20220329","20.0.0-nightly.20220330"],"102.0.4971.0":["19.0.0-alpha.2","19.0.0-alpha.3","20.0.0-nightly.20220411"],"102.0.4989.0":["19.0.0-alpha.4","19.0.0-alpha.5","20.0.0-nightly.20220414","20.0.0-nightly.20220415","20.0.0-nightly.20220418","20.0.0-nightly.20220419","20.0.0-nightly.20220420","20.0.0-nightly.20220421"],"102.0.4999.0":["19.0.0-beta.1","19.0.0-beta.2","19.0.0-beta.3","20.0.0-nightly.20220425","20.0.0-nightly.20220426","20.0.0-nightly.20220427","20.0.0-nightly.20220428","20.0.0-nightly.20220429","20.0.0-nightly.20220502","20.0.0-nightly.20220503","20.0.0-nightly.20220504","20.0.0-nightly.20220505","20.0.0-nightly.20220506","20.0.0-nightly.20220509","20.0.0-nightly.20220511","20.0.0-nightly.20220512","20.0.0-nightly.20220513","20.0.0-nightly.20220516","20.0.0-nightly.20220517"],"102.0.5005.27":["19.0.0-beta.4"],"102.0.5005.40":["19.0.0-beta.5","19.0.0-beta.6","19.0.0-beta.7"],"102.0.5005.49":["19.0.0-beta.8"],"102.0.4961.0":["19.0.0-nightly.20220325"],"102.0.5005.61":["19.0.0","19.0.1"],"102.0.5005.63":["19.0.2","19.0.3","19.0.4"],"102.0.5005.115":["19.0.5","19.0.6"],"102.0.5005.134":["19.0.7"],"102.0.5005.148":["19.0.8"],"102.0.5005.167":["19.0.9","19.0.10","19.0.11","19.0.12","19.0.13","19.0.14","19.0.15","19.0.16","19.0.17","19.1.0","19.1.1","19.1.2","19.1.3","19.1.4","19.1.5","19.1.6","19.1.7","19.1.8","19.1.9"],"103.0.5044.0":["20.0.0-alpha.1","20.0.0-nightly.20220518","20.0.0-nightly.20220519","20.0.0-nightly.20220520","20.0.0-nightly.20220523","20.0.0-nightly.20220524","21.0.0-nightly.20220526","21.0.0-nightly.20220527","21.0.0-nightly.20220530","21.0.0-nightly.20220531"],"104.0.5073.0":["20.0.0-alpha.2","20.0.0-alpha.3","20.0.0-alpha.4","20.0.0-alpha.5","20.0.0-alpha.6","20.0.0-alpha.7","20.0.0-beta.1","20.0.0-beta.2","20.0.0-beta.3","20.0.0-beta.4","20.0.0-beta.5","20.0.0-beta.6","20.0.0-beta.7","20.0.0-beta.8","21.0.0-nightly.20220602","21.0.0-nightly.20220603","21.0.0-nightly.20220606","21.0.0-nightly.20220607","21.0.0-nightly.20220608","21.0.0-nightly.20220609","21.0.0-nightly.20220610","21.0.0-nightly.20220613","21.0.0-nightly.20220614","21.0.0-nightly.20220615","21.0.0-nightly.20220616","21.0.0-nightly.20220617","21.0.0-nightly.20220620","21.0.0-nightly.20220621","21.0.0-nightly.20220622","21.0.0-nightly.20220623","21.0.0-nightly.20220624","21.0.0-nightly.20220627"],"104.0.5112.39":["20.0.0-beta.9"],"104.0.5112.48":["20.0.0-beta.10","20.0.0-beta.11","20.0.0-beta.12"],"104.0.5112.57":["20.0.0-beta.13"],"104.0.5112.65":["20.0.0"],"104.0.5112.81":["20.0.1","20.0.2","20.0.3"],"104.0.5112.102":["20.1.0","20.1.1"],"104.0.5112.114":["20.1.2","20.1.3","20.1.4"],"104.0.5112.124":["20.2.0","20.3.0","20.3.1","20.3.2","20.3.3","20.3.4","20.3.5","20.3.6","20.3.7","20.3.8","20.3.9","20.3.10","20.3.11","20.3.12"],"105.0.5187.0":["21.0.0-alpha.1","21.0.0-alpha.2","21.0.0-alpha.3","21.0.0-alpha.4","21.0.0-alpha.5","21.0.0-nightly.20220720","21.0.0-nightly.20220721","21.0.0-nightly.20220722","21.0.0-nightly.20220725","21.0.0-nightly.20220726","21.0.0-nightly.20220727","21.0.0-nightly.20220728","21.0.0-nightly.20220801","21.0.0-nightly.20220802","22.0.0-nightly.20220808","22.0.0-nightly.20220809","22.0.0-nightly.20220810","22.0.0-nightly.20220811","22.0.0-nightly.20220812","22.0.0-nightly.20220815","22.0.0-nightly.20220816","22.0.0-nightly.20220817"],"106.0.5216.0":["21.0.0-alpha.6","21.0.0-beta.1","21.0.0-beta.2","21.0.0-beta.3","21.0.0-beta.4","21.0.0-beta.5","22.0.0-nightly.20220822","22.0.0-nightly.20220823","22.0.0-nightly.20220824","22.0.0-nightly.20220825","22.0.0-nightly.20220829","22.0.0-nightly.20220830","22.0.0-nightly.20220831","22.0.0-nightly.20220901","22.0.0-nightly.20220902","22.0.0-nightly.20220905"],"106.0.5249.40":["21.0.0-beta.6","21.0.0-beta.7","21.0.0-beta.8"],"105.0.5129.0":["21.0.0-nightly.20220628","21.0.0-nightly.20220629","21.0.0-nightly.20220630","21.0.0-nightly.20220701","21.0.0-nightly.20220704","21.0.0-nightly.20220705","21.0.0-nightly.20220706","21.0.0-nightly.20220707","21.0.0-nightly.20220708","21.0.0-nightly.20220711","21.0.0-nightly.20220712","21.0.0-nightly.20220713"],"105.0.5173.0":["21.0.0-nightly.20220715","21.0.0-nightly.20220718","21.0.0-nightly.20220719"],"106.0.5249.51":["21.0.0"],"106.0.5249.61":["21.0.1"],"106.0.5249.91":["21.1.0"],"106.0.5249.103":["21.1.1"],"106.0.5249.119":["21.2.0"],"106.0.5249.165":["21.2.1"],"106.0.5249.168":["21.2.2","21.2.3"],"106.0.5249.181":["21.3.0","21.3.1"],"106.0.5249.199":["21.3.3","21.3.4","21.3.5","21.4.0","21.4.1","21.4.2","21.4.3","21.4.4"],"107.0.5286.0":["22.0.0-alpha.1","22.0.0-nightly.20220909","22.0.0-nightly.20220912","22.0.0-nightly.20220913","22.0.0-nightly.20220914","22.0.0-nightly.20220915","22.0.0-nightly.20220916","22.0.0-nightly.20220919","22.0.0-nightly.20220920","22.0.0-nightly.20220921","22.0.0-nightly.20220922","22.0.0-nightly.20220923","22.0.0-nightly.20220926","22.0.0-nightly.20220927","22.0.0-nightly.20220928","23.0.0-nightly.20220929","23.0.0-nightly.20220930","23.0.0-nightly.20221003"],"108.0.5329.0":["22.0.0-alpha.3","22.0.0-alpha.4","22.0.0-alpha.5","22.0.0-alpha.6","23.0.0-nightly.20221004","23.0.0-nightly.20221005","23.0.0-nightly.20221006","23.0.0-nightly.20221007","23.0.0-nightly.20221010","23.0.0-nightly.20221011","23.0.0-nightly.20221012","23.0.0-nightly.20221013","23.0.0-nightly.20221014","23.0.0-nightly.20221017"],"108.0.5355.0":["22.0.0-alpha.7","23.0.0-nightly.20221018","23.0.0-nightly.20221019","23.0.0-nightly.20221020","23.0.0-nightly.20221021","23.0.0-nightly.20221024","23.0.0-nightly.20221026"],"108.0.5359.10":["22.0.0-alpha.8","22.0.0-beta.1","22.0.0-beta.2","22.0.0-beta.3"],"108.0.5359.29":["22.0.0-beta.4"],"108.0.5359.40":["22.0.0-beta.5","22.0.0-beta.6"],"108.0.5359.48":["22.0.0-beta.7","22.0.0-beta.8"],"107.0.5274.0":["22.0.0-nightly.20220908"],"108.0.5359.62":["22.0.0"],"108.0.5359.125":["22.0.1"],"108.0.5359.179":["22.0.2","22.0.3","22.1.0"],"108.0.5359.215":["22.2.0","22.2.1","22.3.0","22.3.1","22.3.2","22.3.3","22.3.4","22.3.5","22.3.6","22.3.7","22.3.8","22.3.9","22.3.10","22.3.11","22.3.12","22.3.13","22.3.14","22.3.15","22.3.16","22.3.17","22.3.18","22.3.20","22.3.21","22.3.22","22.3.23","22.3.24","22.3.25","22.3.26","22.3.27"],"110.0.5415.0":["23.0.0-alpha.1","23.0.0-nightly.20221118","23.0.0-nightly.20221121","23.0.0-nightly.20221122","23.0.0-nightly.20221123","23.0.0-nightly.20221124","23.0.0-nightly.20221125","23.0.0-nightly.20221128","23.0.0-nightly.20221129","23.0.0-nightly.20221130","24.0.0-nightly.20221201","24.0.0-nightly.20221202","24.0.0-nightly.20221205"],"110.0.5451.0":["23.0.0-alpha.2","23.0.0-alpha.3","24.0.0-nightly.20221206","24.0.0-nightly.20221207","24.0.0-nightly.20221208","24.0.0-nightly.20221213","24.0.0-nightly.20221214","24.0.0-nightly.20221215","24.0.0-nightly.20221216"],"110.0.5478.5":["23.0.0-beta.1","23.0.0-beta.2","23.0.0-beta.3"],"110.0.5481.30":["23.0.0-beta.4"],"110.0.5481.38":["23.0.0-beta.5"],"110.0.5481.52":["23.0.0-beta.6","23.0.0-beta.8"],"109.0.5382.0":["23.0.0-nightly.20221027","23.0.0-nightly.20221028","23.0.0-nightly.20221031","23.0.0-nightly.20221101","23.0.0-nightly.20221102","23.0.0-nightly.20221103","23.0.0-nightly.20221104","23.0.0-nightly.20221107","23.0.0-nightly.20221108","23.0.0-nightly.20221109","23.0.0-nightly.20221110","23.0.0-nightly.20221111","23.0.0-nightly.20221114","23.0.0-nightly.20221115","23.0.0-nightly.20221116","23.0.0-nightly.20221117"],"110.0.5481.77":["23.0.0"],"110.0.5481.100":["23.1.0"],"110.0.5481.104":["23.1.1"],"110.0.5481.177":["23.1.2"],"110.0.5481.179":["23.1.3"],"110.0.5481.192":["23.1.4","23.2.0"],"110.0.5481.208":["23.2.1","23.2.2","23.2.3","23.2.4","23.3.0","23.3.1","23.3.2","23.3.3","23.3.4","23.3.5","23.3.6","23.3.7","23.3.8","23.3.9","23.3.10","23.3.11","23.3.12","23.3.13"],"111.0.5560.0":["24.0.0-alpha.1","24.0.0-alpha.2","24.0.0-alpha.3","24.0.0-alpha.4","24.0.0-alpha.5","24.0.0-alpha.6","24.0.0-alpha.7","24.0.0-nightly.20230203","24.0.0-nightly.20230206","24.0.0-nightly.20230207","24.0.0-nightly.20230208","24.0.0-nightly.20230209","25.0.0-nightly.20230210","25.0.0-nightly.20230214","25.0.0-nightly.20230215","25.0.0-nightly.20230216","25.0.0-nightly.20230217","25.0.0-nightly.20230220","25.0.0-nightly.20230221","25.0.0-nightly.20230222","25.0.0-nightly.20230223","25.0.0-nightly.20230224","25.0.0-nightly.20230227","25.0.0-nightly.20230228","25.0.0-nightly.20230301","25.0.0-nightly.20230302","25.0.0-nightly.20230303","25.0.0-nightly.20230306","25.0.0-nightly.20230307","25.0.0-nightly.20230308","25.0.0-nightly.20230309","25.0.0-nightly.20230310"],"111.0.5563.50":["24.0.0-beta.1","24.0.0-beta.2"],"112.0.5615.20":["24.0.0-beta.3","24.0.0-beta.4"],"112.0.5615.29":["24.0.0-beta.5"],"112.0.5615.39":["24.0.0-beta.6","24.0.0-beta.7"],"111.0.5518.0":["24.0.0-nightly.20230109","24.0.0-nightly.20230110","24.0.0-nightly.20230111","24.0.0-nightly.20230112","24.0.0-nightly.20230113","24.0.0-nightly.20230116","24.0.0-nightly.20230117","24.0.0-nightly.20230118","24.0.0-nightly.20230119","24.0.0-nightly.20230120","24.0.0-nightly.20230123","24.0.0-nightly.20230124","24.0.0-nightly.20230125","24.0.0-nightly.20230126","24.0.0-nightly.20230127","24.0.0-nightly.20230131","24.0.0-nightly.20230201","24.0.0-nightly.20230202"],"112.0.5615.49":["24.0.0"],"112.0.5615.50":["24.1.0","24.1.1"],"112.0.5615.87":["24.1.2"],"112.0.5615.165":["24.1.3","24.2.0","24.3.0"],"112.0.5615.183":["24.3.1"],"112.0.5615.204":["24.4.0","24.4.1","24.5.0","24.5.1","24.6.0","24.6.1","24.6.2","24.6.3","24.6.4","24.6.5","24.7.0","24.7.1","24.8.0","24.8.1","24.8.2","24.8.3","24.8.4","24.8.5","24.8.6","24.8.7","24.8.8"],"114.0.5694.0":["25.0.0-alpha.1","25.0.0-alpha.2","25.0.0-nightly.20230405","26.0.0-nightly.20230406","26.0.0-nightly.20230407","26.0.0-nightly.20230410","26.0.0-nightly.20230411"],"114.0.5710.0":["25.0.0-alpha.3","25.0.0-alpha.4","26.0.0-nightly.20230413","26.0.0-nightly.20230414","26.0.0-nightly.20230417"],"114.0.5719.0":["25.0.0-alpha.5","25.0.0-alpha.6","25.0.0-beta.1","25.0.0-beta.2","25.0.0-beta.3","26.0.0-nightly.20230421","26.0.0-nightly.20230424","26.0.0-nightly.20230425","26.0.0-nightly.20230426","26.0.0-nightly.20230427","26.0.0-nightly.20230428","26.0.0-nightly.20230501","26.0.0-nightly.20230502","26.0.0-nightly.20230503","26.0.0-nightly.20230504","26.0.0-nightly.20230505","26.0.0-nightly.20230508","26.0.0-nightly.20230509","26.0.0-nightly.20230510"],"114.0.5735.16":["25.0.0-beta.4","25.0.0-beta.5","25.0.0-beta.6","25.0.0-beta.7"],"114.0.5735.35":["25.0.0-beta.8"],"114.0.5735.45":["25.0.0-beta.9","25.0.0","25.0.1"],"113.0.5636.0":["25.0.0-nightly.20230314"],"113.0.5651.0":["25.0.0-nightly.20230315"],"113.0.5653.0":["25.0.0-nightly.20230317"],"113.0.5660.0":["25.0.0-nightly.20230320"],"113.0.5664.0":["25.0.0-nightly.20230321"],"113.0.5666.0":["25.0.0-nightly.20230322"],"113.0.5668.0":["25.0.0-nightly.20230323"],"113.0.5670.0":["25.0.0-nightly.20230324","25.0.0-nightly.20230327","25.0.0-nightly.20230328","25.0.0-nightly.20230329","25.0.0-nightly.20230330"],"114.0.5684.0":["25.0.0-nightly.20230331","25.0.0-nightly.20230403"],"114.0.5692.0":["25.0.0-nightly.20230404"],"114.0.5735.106":["25.1.0","25.1.1"],"114.0.5735.134":["25.2.0"],"114.0.5735.199":["25.3.0"],"114.0.5735.243":["25.3.1"],"114.0.5735.248":["25.3.2","25.4.0"],"114.0.5735.289":["25.5.0","25.6.0","25.7.0","25.8.0","25.8.1","25.8.2","25.8.3","25.8.4","25.9.0","25.9.1","25.9.2","25.9.3","25.9.4","25.9.5","25.9.6","25.9.7","25.9.8"],"116.0.5791.0":["26.0.0-alpha.1","26.0.0-alpha.2","26.0.0-alpha.3","26.0.0-alpha.4","26.0.0-alpha.5","26.0.0-nightly.20230526","26.0.0-nightly.20230529","26.0.0-nightly.20230530","26.0.0-nightly.20230531","27.0.0-nightly.20230601","27.0.0-nightly.20230602","27.0.0-nightly.20230605","27.0.0-nightly.20230606","27.0.0-nightly.20230607","27.0.0-nightly.20230609"],"116.0.5815.0":["26.0.0-alpha.6","27.0.0-nightly.20230612","27.0.0-nightly.20230613"],"116.0.5831.0":["26.0.0-alpha.7","27.0.0-nightly.20230615"],"116.0.5845.0":["26.0.0-alpha.8","26.0.0-beta.1","27.0.0-nightly.20230622","27.0.0-nightly.20230623","27.0.0-nightly.20230626","27.0.0-nightly.20230627","27.0.0-nightly.20230628","27.0.0-nightly.20230629","27.0.0-nightly.20230630"],"116.0.5845.14":["26.0.0-beta.2","26.0.0-beta.3","26.0.0-beta.4","26.0.0-beta.5","26.0.0-beta.6","26.0.0-beta.7"],"116.0.5845.42":["26.0.0-beta.8","26.0.0-beta.9"],"116.0.5845.49":["26.0.0-beta.10","26.0.0-beta.11"],"116.0.5845.62":["26.0.0-beta.12"],"114.0.5708.0":["26.0.0-nightly.20230412"],"114.0.5715.0":["26.0.0-nightly.20230418"],"115.0.5760.0":["26.0.0-nightly.20230511","26.0.0-nightly.20230512","26.0.0-nightly.20230515","26.0.0-nightly.20230516","26.0.0-nightly.20230517","26.0.0-nightly.20230518","26.0.0-nightly.20230519","26.0.0-nightly.20230522","26.0.0-nightly.20230523"],"115.0.5786.0":["26.0.0-nightly.20230524"],"115.0.5790.0":["26.0.0-nightly.20230525"],"116.0.5845.82":["26.0.0"],"116.0.5845.97":["26.1.0"],"116.0.5845.179":["26.2.0"],"116.0.5845.188":["26.2.1"],"116.0.5845.190":["26.2.2","26.2.3","26.2.4"],"116.0.5845.228":["26.3.0","26.4.0","26.4.1","26.4.2","26.4.3","26.5.0","26.6.0","26.6.1","26.6.2","26.6.3","26.6.4","26.6.5","26.6.6","26.6.7","26.6.8"],"118.0.5949.0":["27.0.0-alpha.1","27.0.0-alpha.2","27.0.0-alpha.3","27.0.0-alpha.4","27.0.0-alpha.5","27.0.0-alpha.6","27.0.0-nightly.20230816","28.0.0-nightly.20230817","28.0.0-nightly.20230818","28.0.0-nightly.20230821","28.0.0-nightly.20230822","28.0.0-nightly.20230823","28.0.0-nightly.20230824","28.0.0-nightly.20230825","28.0.0-nightly.20230828","28.0.0-nightly.20230829","28.0.0-nightly.20230830","28.0.0-nightly.20230831"],"118.0.5993.5":["27.0.0-beta.1","27.0.0-beta.2","27.0.0-beta.3"],"118.0.5993.11":["27.0.0-beta.4"],"118.0.5993.18":["27.0.0-beta.5","27.0.0-beta.6","27.0.0-beta.7","27.0.0-beta.8","27.0.0-beta.9"],"116.0.5829.0":["27.0.0-nightly.20230614"],"116.0.5833.0":["27.0.0-nightly.20230616","27.0.0-nightly.20230619","27.0.0-nightly.20230620","27.0.0-nightly.20230621"],"117.0.5852.0":["27.0.0-nightly.20230703","27.0.0-nightly.20230704","27.0.0-nightly.20230705","27.0.0-nightly.20230706","27.0.0-nightly.20230707","27.0.0-nightly.20230710","27.0.0-nightly.20230711","27.0.0-nightly.20230712","27.0.0-nightly.20230713","27.0.0-nightly.20230714"],"117.0.5884.1":["27.0.0-nightly.20230717","27.0.0-nightly.20230718"],"117.0.5892.0":["27.0.0-nightly.20230719"],"117.0.5897.0":["27.0.0-nightly.20230720","27.0.0-nightly.20230721","27.0.0-nightly.20230724","27.0.0-nightly.20230725","27.0.0-nightly.20230726","27.0.0-nightly.20230727","27.0.0-nightly.20230728","27.0.0-nightly.20230731"],"117.0.5911.0":["27.0.0-nightly.20230801","27.0.0-nightly.20230802","27.0.0-nightly.20230803"],"117.0.5921.0":["27.0.0-nightly.20230804","27.0.0-nightly.20230807","27.0.0-nightly.20230808","27.0.0-nightly.20230814","27.0.0-nightly.20230815"],"118.0.5993.54":["27.0.0"],"118.0.5993.89":["27.0.1","27.0.2"],"118.0.5993.120":["27.0.3"],"118.0.5993.129":["27.0.4"],"118.0.5993.144":["27.1.0","27.1.2"],"118.0.5993.159":["27.1.3","27.2.0","27.2.1","27.2.2","27.2.3","27.2.4","27.3.0","27.3.1"],"119.0.6045.0":["28.0.0-alpha.1","28.0.0-alpha.2","28.0.0-nightly.20231006","28.0.0-nightly.20231009","28.0.0-nightly.20231010","28.0.0-nightly.20231011","29.0.0-nightly.20231012","29.0.0-nightly.20231013","29.0.0-nightly.20231016","29.0.0-nightly.20231017","29.0.0-nightly.20231018","29.0.0-nightly.20231019","29.0.0-nightly.20231020","29.0.0-nightly.20231023","29.0.0-nightly.20231024"],"119.0.6045.21":["28.0.0-alpha.3","28.0.0-alpha.4"],"119.0.6045.33":["28.0.0-alpha.5","28.0.0-alpha.6","28.0.0-alpha.7","28.0.0-beta.1"],"120.0.6099.0":["28.0.0-beta.2"],"120.0.6099.5":["28.0.0-beta.3","28.0.0-beta.4"],"120.0.6099.18":["28.0.0-beta.5","28.0.0-beta.6","28.0.0-beta.7","28.0.0-beta.8","28.0.0-beta.9","28.0.0-beta.10"],"120.0.6099.35":["28.0.0-beta.11"],"118.0.5991.0":["28.0.0-nightly.20230906"],"118.0.5993.0":["28.0.0-nightly.20230907","28.0.0-nightly.20230908","28.0.0-nightly.20230911","28.0.0-nightly.20230912","28.0.0-nightly.20230913","28.0.0-nightly.20230914","28.0.0-nightly.20230915"],"119.0.6006.0":["28.0.0-nightly.20230919"],"119.0.6017.0":["28.0.0-nightly.20230920"],"119.0.6019.2":["28.0.0-nightly.20230921","28.0.0-nightly.20230925","28.0.0-nightly.20230926","28.0.0-nightly.20230927","28.0.0-nightly.20230928"],"119.0.6029.0":["28.0.0-nightly.20230929","28.0.0-nightly.20231002"],"119.0.6043.0":["28.0.0-nightly.20231003","28.0.0-nightly.20231004","28.0.0-nightly.20231005"],"120.0.6099.56":["28.0.0"],"120.0.6099.109":["28.1.0","28.1.1"],"120.0.6099.199":["28.1.2","28.1.3"],"120.0.6099.216":["28.1.4"],"120.0.6099.227":["28.2.0"],"120.0.6099.268":["28.2.1"],"121.0.6147.0":["29.0.0-alpha.1","29.0.0-alpha.2","29.0.0-alpha.3","29.0.0-nightly.20231129","29.0.0-nightly.20231130","29.0.0-nightly.20231201","29.0.0-nightly.20231204","29.0.0-nightly.20231205","29.0.0-nightly.20231206","30.0.0-nightly.20231207","30.0.0-nightly.20231208","30.0.0-nightly.20231211"],"121.0.6159.0":["29.0.0-alpha.4","29.0.0-alpha.5","29.0.0-alpha.6","29.0.0-alpha.7","30.0.0-nightly.20231212","30.0.0-nightly.20231213","30.0.0-nightly.20231214","30.0.0-nightly.20231215","30.0.0-nightly.20231218","30.0.0-nightly.20240102"],"122.0.6194.0":["29.0.0-alpha.8","30.0.0-nightly.20240103","30.0.0-nightly.20240104","30.0.0-nightly.20240105","30.0.0-nightly.20240108","30.0.0-nightly.20240109","30.0.0-nightly.20240110"],"122.0.6236.2":["29.0.0-alpha.9","29.0.0-alpha.10","29.0.0-alpha.11","29.0.0-beta.1","29.0.0-beta.2","30.0.0-nightly.20240111","30.0.0-nightly.20240112","30.0.0-nightly.20240115","30.0.0-nightly.20240116","30.0.0-nightly.20240117","30.0.0-nightly.20240118","30.0.0-nightly.20240119","30.0.0-nightly.20240122","30.0.0-nightly.20240123","30.0.0-nightly.20240124","30.0.0-nightly.20240125"],"122.0.6261.6":["29.0.0-beta.3","29.0.0-beta.4"],"122.0.6261.18":["29.0.0-beta.5"],"120.0.6078.0":["29.0.0-nightly.20231025","29.0.0-nightly.20231026","29.0.0-nightly.20231027","29.0.0-nightly.20231030","29.0.0-nightly.20231031","29.0.0-nightly.20231101"],"121.0.6100.0":["29.0.0-nightly.20231102","29.0.0-nightly.20231103"],"121.0.6104.0":["29.0.0-nightly.20231106"],"121.0.6110.0":["29.0.0-nightly.20231107","29.0.0-nightly.20231108","29.0.0-nightly.20231109","29.0.0-nightly.20231110","29.0.0-nightly.20231113","29.0.0-nightly.20231114"],"121.0.6116.0":["29.0.0-nightly.20231115","29.0.0-nightly.20231116","29.0.0-nightly.20231117","29.0.0-nightly.20231120","29.0.0-nightly.20231121","29.0.0-nightly.20231122","29.0.0-nightly.20231123","29.0.0-nightly.20231124","29.0.0-nightly.20231127","29.0.0-nightly.20231128"],"123.0.6264.0":["30.0.0-nightly.20240126","30.0.0-nightly.20240129","30.0.0-nightly.20240130","30.0.0-nightly.20240131"],"123.0.6272.0":["30.0.0-nightly.20240201","30.0.0-nightly.20240202","30.0.0-nightly.20240205"]} \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-versions.js b/node_modules/electron-to-chromium/full-versions.js deleted file mode 100644 index fe3f772..0000000 --- a/node_modules/electron-to-chromium/full-versions.js +++ /dev/null @@ -1,2238 +0,0 @@ -module.exports = { - "0.20.0": "39.0.2171.65", - "0.20.1": "39.0.2171.65", - "0.20.2": "39.0.2171.65", - "0.20.3": "39.0.2171.65", - "0.20.4": "39.0.2171.65", - "0.20.5": "39.0.2171.65", - "0.20.6": "39.0.2171.65", - "0.20.7": "39.0.2171.65", - "0.20.8": "39.0.2171.65", - "0.21.0": "40.0.2214.91", - "0.21.1": "40.0.2214.91", - "0.21.2": "40.0.2214.91", - "0.21.3": "41.0.2272.76", - "0.22.1": "41.0.2272.76", - "0.22.2": "41.0.2272.76", - "0.22.3": "41.0.2272.76", - "0.23.0": "41.0.2272.76", - "0.24.0": "41.0.2272.76", - "0.25.0": "42.0.2311.107", - "0.25.1": "42.0.2311.107", - "0.25.2": "42.0.2311.107", - "0.25.3": "42.0.2311.107", - "0.26.0": "42.0.2311.107", - "0.26.1": "42.0.2311.107", - "0.27.0": "42.0.2311.107", - "0.27.1": "42.0.2311.107", - "0.27.2": "43.0.2357.65", - "0.27.3": "43.0.2357.65", - "0.28.0": "43.0.2357.65", - "0.28.1": "43.0.2357.65", - "0.28.2": "43.0.2357.65", - "0.28.3": "43.0.2357.65", - "0.29.1": "43.0.2357.65", - "0.29.2": "43.0.2357.65", - "0.30.4": "44.0.2403.125", - "0.31.0": "44.0.2403.125", - "0.31.2": "45.0.2454.85", - "0.32.2": "45.0.2454.85", - "0.32.3": "45.0.2454.85", - "0.33.0": "45.0.2454.85", - "0.33.1": "45.0.2454.85", - "0.33.2": "45.0.2454.85", - "0.33.3": "45.0.2454.85", - "0.33.4": "45.0.2454.85", - "0.33.6": "45.0.2454.85", - "0.33.7": "45.0.2454.85", - "0.33.8": "45.0.2454.85", - "0.33.9": "45.0.2454.85", - "0.34.0": "45.0.2454.85", - "0.34.1": "45.0.2454.85", - "0.34.2": "45.0.2454.85", - "0.34.3": "45.0.2454.85", - "0.34.4": "45.0.2454.85", - "0.35.1": "45.0.2454.85", - "0.35.2": "45.0.2454.85", - "0.35.3": "45.0.2454.85", - "0.35.4": "45.0.2454.85", - "0.35.5": "45.0.2454.85", - "0.36.0": "47.0.2526.73", - "0.36.2": "47.0.2526.73", - "0.36.3": "47.0.2526.73", - "0.36.4": "47.0.2526.73", - "0.36.5": "47.0.2526.110", - "0.36.6": "47.0.2526.110", - "0.36.7": "47.0.2526.110", - "0.36.8": "47.0.2526.110", - "0.36.9": "47.0.2526.110", - "0.36.10": "47.0.2526.110", - "0.36.11": "47.0.2526.110", - "0.36.12": "47.0.2526.110", - "0.37.0": "49.0.2623.75", - "0.37.1": "49.0.2623.75", - "0.37.3": "49.0.2623.75", - "0.37.4": "49.0.2623.75", - "0.37.5": "49.0.2623.75", - "0.37.6": "49.0.2623.75", - "0.37.7": "49.0.2623.75", - "0.37.8": "49.0.2623.75", - "1.0.0": "49.0.2623.75", - "1.0.1": "49.0.2623.75", - "1.0.2": "49.0.2623.75", - "1.1.0": "50.0.2661.102", - "1.1.1": "50.0.2661.102", - "1.1.2": "50.0.2661.102", - "1.1.3": "50.0.2661.102", - "1.2.0": "51.0.2704.63", - "1.2.1": "51.0.2704.63", - "1.2.2": "51.0.2704.84", - "1.2.3": "51.0.2704.84", - "1.2.4": "51.0.2704.103", - "1.2.5": "51.0.2704.103", - "1.2.6": "51.0.2704.106", - "1.2.7": "51.0.2704.106", - "1.2.8": "51.0.2704.106", - "1.3.0": "52.0.2743.82", - "1.3.1": "52.0.2743.82", - "1.3.2": "52.0.2743.82", - "1.3.3": "52.0.2743.82", - "1.3.4": "52.0.2743.82", - "1.3.5": "52.0.2743.82", - "1.3.6": "52.0.2743.82", - "1.3.7": "52.0.2743.82", - "1.3.9": "52.0.2743.82", - "1.3.10": "52.0.2743.82", - "1.3.13": "52.0.2743.82", - "1.3.14": "52.0.2743.82", - "1.3.15": "52.0.2743.82", - "1.4.0": "53.0.2785.113", - "1.4.1": "53.0.2785.113", - "1.4.2": "53.0.2785.113", - "1.4.3": "53.0.2785.113", - "1.4.4": "53.0.2785.113", - "1.4.5": "53.0.2785.113", - "1.4.6": "53.0.2785.143", - "1.4.7": "53.0.2785.143", - "1.4.8": "53.0.2785.143", - "1.4.10": "53.0.2785.143", - "1.4.11": "53.0.2785.143", - "1.4.12": "54.0.2840.51", - "1.4.13": "53.0.2785.143", - "1.4.14": "53.0.2785.143", - "1.4.15": "53.0.2785.143", - "1.4.16": "53.0.2785.143", - "1.5.0": "54.0.2840.101", - "1.5.1": "54.0.2840.101", - "1.6.0": "56.0.2924.87", - "1.6.1": "56.0.2924.87", - "1.6.2": "56.0.2924.87", - "1.6.3": "56.0.2924.87", - "1.6.4": "56.0.2924.87", - "1.6.5": "56.0.2924.87", - "1.6.6": "56.0.2924.87", - "1.6.7": "56.0.2924.87", - "1.6.8": "56.0.2924.87", - "1.6.9": "56.0.2924.87", - "1.6.10": "56.0.2924.87", - "1.6.11": "56.0.2924.87", - "1.6.12": "56.0.2924.87", - "1.6.13": "56.0.2924.87", - "1.6.14": "56.0.2924.87", - "1.6.15": "56.0.2924.87", - "1.6.16": "56.0.2924.87", - "1.6.17": "56.0.2924.87", - "1.6.18": "56.0.2924.87", - "1.7.0": "58.0.3029.110", - "1.7.1": "58.0.3029.110", - "1.7.2": "58.0.3029.110", - "1.7.3": "58.0.3029.110", - "1.7.4": "58.0.3029.110", - "1.7.5": "58.0.3029.110", - "1.7.6": "58.0.3029.110", - "1.7.7": "58.0.3029.110", - "1.7.8": "58.0.3029.110", - "1.7.9": "58.0.3029.110", - "1.7.10": "58.0.3029.110", - "1.7.11": "58.0.3029.110", - "1.7.12": "58.0.3029.110", - "1.7.13": "58.0.3029.110", - "1.7.14": "58.0.3029.110", - "1.7.15": "58.0.3029.110", - "1.7.16": "58.0.3029.110", - "1.8.0": "59.0.3071.115", - "1.8.1": "59.0.3071.115", - "1.8.2-beta.1": "59.0.3071.115", - "1.8.2-beta.2": "59.0.3071.115", - "1.8.2-beta.3": "59.0.3071.115", - "1.8.2-beta.4": "59.0.3071.115", - "1.8.2-beta.5": "59.0.3071.115", - "1.8.2": "59.0.3071.115", - "1.8.3": "59.0.3071.115", - "1.8.4": "59.0.3071.115", - "1.8.5": "59.0.3071.115", - "1.8.6": "59.0.3071.115", - "1.8.7": "59.0.3071.115", - "1.8.8": "59.0.3071.115", - "2.0.0-beta.1": "61.0.3163.100", - "2.0.0-beta.2": "61.0.3163.100", - "2.0.0-beta.3": "61.0.3163.100", - "2.0.0-beta.4": "61.0.3163.100", - "2.0.0-beta.5": "61.0.3163.100", - "2.0.0-beta.6": "61.0.3163.100", - "2.0.0-beta.7": "61.0.3163.100", - "2.0.0-beta.8": "61.0.3163.100", - "2.0.0": "61.0.3163.100", - "2.0.1": "61.0.3163.100", - "2.0.2": "61.0.3163.100", - "2.0.3": "61.0.3163.100", - "2.0.4": "61.0.3163.100", - "2.0.5": "61.0.3163.100", - "2.0.6": "61.0.3163.100", - "2.0.7": "61.0.3163.100", - "2.0.8-nightly.20180819": "61.0.3163.100", - "2.0.8-nightly.20180820": "61.0.3163.100", - "2.0.8": "61.0.3163.100", - "2.0.9": "61.0.3163.100", - "2.0.10": "61.0.3163.100", - "2.0.11": "61.0.3163.100", - "2.0.12": "61.0.3163.100", - "2.0.13": "61.0.3163.100", - "2.0.14": "61.0.3163.100", - "2.0.15": "61.0.3163.100", - "2.0.16": "61.0.3163.100", - "2.0.17": "61.0.3163.100", - "2.0.18": "61.0.3163.100", - "2.1.0-unsupported.20180809": "61.0.3163.100", - "3.0.0-beta.1": "66.0.3359.181", - "3.0.0-beta.2": "66.0.3359.181", - "3.0.0-beta.3": "66.0.3359.181", - "3.0.0-beta.4": "66.0.3359.181", - "3.0.0-beta.5": "66.0.3359.181", - "3.0.0-beta.6": "66.0.3359.181", - "3.0.0-beta.7": "66.0.3359.181", - "3.0.0-beta.8": "66.0.3359.181", - "3.0.0-beta.9": "66.0.3359.181", - "3.0.0-beta.10": "66.0.3359.181", - "3.0.0-beta.11": "66.0.3359.181", - "3.0.0-beta.12": "66.0.3359.181", - "3.0.0-beta.13": "66.0.3359.181", - "3.0.0-nightly.20180818": "66.0.3359.181", - "3.0.0-nightly.20180821": "66.0.3359.181", - "3.0.0-nightly.20180823": "66.0.3359.181", - "3.0.0-nightly.20180904": "66.0.3359.181", - "3.0.0": "66.0.3359.181", - "3.0.1": "66.0.3359.181", - "3.0.2": "66.0.3359.181", - "3.0.3": "66.0.3359.181", - "3.0.4": "66.0.3359.181", - "3.0.5": "66.0.3359.181", - "3.0.6": "66.0.3359.181", - "3.0.7": "66.0.3359.181", - "3.0.8": "66.0.3359.181", - "3.0.9": "66.0.3359.181", - "3.0.10": "66.0.3359.181", - "3.0.11": "66.0.3359.181", - "3.0.12": "66.0.3359.181", - "3.0.13": "66.0.3359.181", - "3.0.14": "66.0.3359.181", - "3.0.15": "66.0.3359.181", - "3.0.16": "66.0.3359.181", - "3.1.0-beta.1": "66.0.3359.181", - "3.1.0-beta.2": "66.0.3359.181", - "3.1.0-beta.3": "66.0.3359.181", - "3.1.0-beta.4": "66.0.3359.181", - "3.1.0-beta.5": "66.0.3359.181", - "3.1.0": "66.0.3359.181", - "3.1.1": "66.0.3359.181", - "3.1.2": "66.0.3359.181", - "3.1.3": "66.0.3359.181", - "3.1.4": "66.0.3359.181", - "3.1.5": "66.0.3359.181", - "3.1.6": "66.0.3359.181", - "3.1.7": "66.0.3359.181", - "3.1.8": "66.0.3359.181", - "3.1.9": "66.0.3359.181", - "3.1.10": "66.0.3359.181", - "3.1.11": "66.0.3359.181", - "3.1.12": "66.0.3359.181", - "3.1.13": "66.0.3359.181", - "4.0.0-beta.1": "69.0.3497.106", - "4.0.0-beta.2": "69.0.3497.106", - "4.0.0-beta.3": "69.0.3497.106", - "4.0.0-beta.4": "69.0.3497.106", - "4.0.0-beta.5": "69.0.3497.106", - "4.0.0-beta.6": "69.0.3497.106", - "4.0.0-beta.7": "69.0.3497.106", - "4.0.0-beta.8": "69.0.3497.106", - "4.0.0-beta.9": "69.0.3497.106", - "4.0.0-beta.10": "69.0.3497.106", - "4.0.0-beta.11": "69.0.3497.106", - "4.0.0-nightly.20180817": "66.0.3359.181", - "4.0.0-nightly.20180819": "66.0.3359.181", - "4.0.0-nightly.20180821": "66.0.3359.181", - "4.0.0-nightly.20180929": "67.0.3396.99", - "4.0.0-nightly.20181006": "68.0.3440.128", - "4.0.0-nightly.20181010": "69.0.3497.106", - "4.0.0": "69.0.3497.106", - "4.0.1": "69.0.3497.106", - "4.0.2": "69.0.3497.106", - "4.0.3": "69.0.3497.106", - "4.0.4": "69.0.3497.106", - "4.0.5": "69.0.3497.106", - "4.0.6": "69.0.3497.106", - "4.0.7": "69.0.3497.128", - "4.0.8": "69.0.3497.128", - "4.1.0": "69.0.3497.128", - "4.1.1": "69.0.3497.128", - "4.1.2": "69.0.3497.128", - "4.1.3": "69.0.3497.128", - "4.1.4": "69.0.3497.128", - "4.1.5": "69.0.3497.128", - "4.2.0": "69.0.3497.128", - "4.2.1": "69.0.3497.128", - "4.2.2": "69.0.3497.128", - "4.2.3": "69.0.3497.128", - "4.2.4": "69.0.3497.128", - "4.2.5": "69.0.3497.128", - "4.2.6": "69.0.3497.128", - "4.2.7": "69.0.3497.128", - "4.2.8": "69.0.3497.128", - "4.2.9": "69.0.3497.128", - "4.2.10": "69.0.3497.128", - "4.2.11": "69.0.3497.128", - "4.2.12": "69.0.3497.128", - "5.0.0-beta.1": "72.0.3626.52", - "5.0.0-beta.2": "72.0.3626.52", - "5.0.0-beta.3": "73.0.3683.27", - "5.0.0-beta.4": "73.0.3683.54", - "5.0.0-beta.5": "73.0.3683.61", - "5.0.0-beta.6": "73.0.3683.84", - "5.0.0-beta.7": "73.0.3683.94", - "5.0.0-beta.8": "73.0.3683.104", - "5.0.0-beta.9": "73.0.3683.117", - "5.0.0-nightly.20190107": "70.0.3538.110", - "5.0.0-nightly.20190121": "71.0.3578.98", - "5.0.0-nightly.20190122": "71.0.3578.98", - "5.0.0": "73.0.3683.119", - "5.0.1": "73.0.3683.121", - "5.0.2": "73.0.3683.121", - "5.0.3": "73.0.3683.121", - "5.0.4": "73.0.3683.121", - "5.0.5": "73.0.3683.121", - "5.0.6": "73.0.3683.121", - "5.0.7": "73.0.3683.121", - "5.0.8": "73.0.3683.121", - "5.0.9": "73.0.3683.121", - "5.0.10": "73.0.3683.121", - "5.0.11": "73.0.3683.121", - "5.0.12": "73.0.3683.121", - "5.0.13": "73.0.3683.121", - "6.0.0-beta.1": "76.0.3774.1", - "6.0.0-beta.2": "76.0.3783.1", - "6.0.0-beta.3": "76.0.3783.1", - "6.0.0-beta.4": "76.0.3783.1", - "6.0.0-beta.5": "76.0.3805.4", - "6.0.0-beta.6": "76.0.3809.3", - "6.0.0-beta.7": "76.0.3809.22", - "6.0.0-beta.8": "76.0.3809.26", - "6.0.0-beta.9": "76.0.3809.26", - "6.0.0-beta.10": "76.0.3809.37", - "6.0.0-beta.11": "76.0.3809.42", - "6.0.0-beta.12": "76.0.3809.54", - "6.0.0-beta.13": "76.0.3809.60", - "6.0.0-beta.14": "76.0.3809.68", - "6.0.0-beta.15": "76.0.3809.74", - "6.0.0-nightly.20190123": "72.0.3626.52", - "6.0.0-nightly.20190212": "72.0.3626.107", - "6.0.0-nightly.20190213": "72.0.3626.110", - "6.0.0-nightly.20190311": "74.0.3724.8", - "6.0.0": "76.0.3809.88", - "6.0.1": "76.0.3809.102", - "6.0.2": "76.0.3809.110", - "6.0.3": "76.0.3809.126", - "6.0.4": "76.0.3809.131", - "6.0.5": "76.0.3809.136", - "6.0.6": "76.0.3809.138", - "6.0.7": "76.0.3809.139", - "6.0.8": "76.0.3809.146", - "6.0.9": "76.0.3809.146", - "6.0.10": "76.0.3809.146", - "6.0.11": "76.0.3809.146", - "6.0.12": "76.0.3809.146", - "6.1.0": "76.0.3809.146", - "6.1.1": "76.0.3809.146", - "6.1.2": "76.0.3809.146", - "6.1.3": "76.0.3809.146", - "6.1.4": "76.0.3809.146", - "6.1.5": "76.0.3809.146", - "6.1.6": "76.0.3809.146", - "6.1.7": "76.0.3809.146", - "6.1.8": "76.0.3809.146", - "6.1.9": "76.0.3809.146", - "6.1.10": "76.0.3809.146", - "6.1.11": "76.0.3809.146", - "6.1.12": "76.0.3809.146", - "7.0.0-beta.1": "78.0.3866.0", - "7.0.0-beta.2": "78.0.3866.0", - "7.0.0-beta.3": "78.0.3866.0", - "7.0.0-beta.4": "78.0.3896.6", - "7.0.0-beta.5": "78.0.3905.1", - "7.0.0-beta.6": "78.0.3905.1", - "7.0.0-beta.7": "78.0.3905.1", - "7.0.0-nightly.20190521": "76.0.3784.0", - "7.0.0-nightly.20190529": "76.0.3806.0", - "7.0.0-nightly.20190530": "76.0.3806.0", - "7.0.0-nightly.20190531": "76.0.3806.0", - "7.0.0-nightly.20190602": "76.0.3806.0", - "7.0.0-nightly.20190603": "76.0.3806.0", - "7.0.0-nightly.20190604": "77.0.3814.0", - "7.0.0-nightly.20190605": "77.0.3815.0", - "7.0.0-nightly.20190606": "77.0.3815.0", - "7.0.0-nightly.20190607": "77.0.3815.0", - "7.0.0-nightly.20190608": "77.0.3815.0", - "7.0.0-nightly.20190609": "77.0.3815.0", - "7.0.0-nightly.20190611": "77.0.3815.0", - "7.0.0-nightly.20190612": "77.0.3815.0", - "7.0.0-nightly.20190613": "77.0.3815.0", - "7.0.0-nightly.20190615": "77.0.3815.0", - "7.0.0-nightly.20190616": "77.0.3815.0", - "7.0.0-nightly.20190618": "77.0.3815.0", - "7.0.0-nightly.20190619": "77.0.3815.0", - "7.0.0-nightly.20190622": "77.0.3815.0", - "7.0.0-nightly.20190623": "77.0.3815.0", - "7.0.0-nightly.20190624": "77.0.3815.0", - "7.0.0-nightly.20190627": "77.0.3815.0", - "7.0.0-nightly.20190629": "77.0.3815.0", - "7.0.0-nightly.20190630": "77.0.3815.0", - "7.0.0-nightly.20190701": "77.0.3815.0", - "7.0.0-nightly.20190702": "77.0.3815.0", - "7.0.0-nightly.20190704": "77.0.3843.0", - "7.0.0-nightly.20190705": "77.0.3843.0", - "7.0.0-nightly.20190719": "77.0.3848.0", - "7.0.0-nightly.20190720": "77.0.3848.0", - "7.0.0-nightly.20190721": "77.0.3848.0", - "7.0.0-nightly.20190726": "77.0.3864.0", - "7.0.0-nightly.20190727": "78.0.3866.0", - "7.0.0-nightly.20190728": "78.0.3866.0", - "7.0.0-nightly.20190729": "78.0.3866.0", - "7.0.0-nightly.20190730": "78.0.3866.0", - "7.0.0-nightly.20190731": "78.0.3866.0", - "7.0.0": "78.0.3905.1", - "7.0.1": "78.0.3904.92", - "7.1.0": "78.0.3904.94", - "7.1.1": "78.0.3904.99", - "7.1.2": "78.0.3904.113", - "7.1.3": "78.0.3904.126", - "7.1.4": "78.0.3904.130", - "7.1.5": "78.0.3904.130", - "7.1.6": "78.0.3904.130", - "7.1.7": "78.0.3904.130", - "7.1.8": "78.0.3904.130", - "7.1.9": "78.0.3904.130", - "7.1.10": "78.0.3904.130", - "7.1.11": "78.0.3904.130", - "7.1.12": "78.0.3904.130", - "7.1.13": "78.0.3904.130", - "7.1.14": "78.0.3904.130", - "7.2.0": "78.0.3904.130", - "7.2.1": "78.0.3904.130", - "7.2.2": "78.0.3904.130", - "7.2.3": "78.0.3904.130", - "7.2.4": "78.0.3904.130", - "7.3.0": "78.0.3904.130", - "7.3.1": "78.0.3904.130", - "7.3.2": "78.0.3904.130", - "7.3.3": "78.0.3904.130", - "8.0.0-beta.1": "79.0.3931.0", - "8.0.0-beta.2": "79.0.3931.0", - "8.0.0-beta.3": "80.0.3955.0", - "8.0.0-beta.4": "80.0.3955.0", - "8.0.0-beta.5": "80.0.3987.14", - "8.0.0-beta.6": "80.0.3987.51", - "8.0.0-beta.7": "80.0.3987.59", - "8.0.0-beta.8": "80.0.3987.75", - "8.0.0-beta.9": "80.0.3987.75", - "8.0.0-nightly.20190801": "78.0.3866.0", - "8.0.0-nightly.20190802": "78.0.3866.0", - "8.0.0-nightly.20190803": "78.0.3871.0", - "8.0.0-nightly.20190806": "78.0.3871.0", - "8.0.0-nightly.20190807": "78.0.3871.0", - "8.0.0-nightly.20190808": "78.0.3871.0", - "8.0.0-nightly.20190809": "78.0.3871.0", - "8.0.0-nightly.20190810": "78.0.3871.0", - "8.0.0-nightly.20190811": "78.0.3871.0", - "8.0.0-nightly.20190812": "78.0.3871.0", - "8.0.0-nightly.20190813": "78.0.3871.0", - "8.0.0-nightly.20190814": "78.0.3871.0", - "8.0.0-nightly.20190815": "78.0.3871.0", - "8.0.0-nightly.20190816": "78.0.3881.0", - "8.0.0-nightly.20190817": "78.0.3881.0", - "8.0.0-nightly.20190818": "78.0.3881.0", - "8.0.0-nightly.20190819": "78.0.3881.0", - "8.0.0-nightly.20190820": "78.0.3881.0", - "8.0.0-nightly.20190824": "78.0.3892.0", - "8.0.0-nightly.20190825": "78.0.3892.0", - "8.0.0-nightly.20190827": "78.0.3892.0", - "8.0.0-nightly.20190828": "78.0.3892.0", - "8.0.0-nightly.20190830": "78.0.3892.0", - "8.0.0-nightly.20190901": "78.0.3892.0", - "8.0.0-nightly.20190902": "78.0.3892.0", - "8.0.0-nightly.20190907": "78.0.3892.0", - "8.0.0-nightly.20190909": "78.0.3892.0", - "8.0.0-nightly.20190910": "78.0.3892.0", - "8.0.0-nightly.20190911": "78.0.3892.0", - "8.0.0-nightly.20190912": "78.0.3892.0", - "8.0.0-nightly.20190913": "78.0.3892.0", - "8.0.0-nightly.20190914": "78.0.3892.0", - "8.0.0-nightly.20190915": "78.0.3892.0", - "8.0.0-nightly.20190917": "78.0.3892.0", - "8.0.0-nightly.20190919": "79.0.3915.0", - "8.0.0-nightly.20190920": "79.0.3915.0", - "8.0.0-nightly.20190922": "79.0.3919.0", - "8.0.0-nightly.20190923": "79.0.3919.0", - "8.0.0-nightly.20190924": "79.0.3919.0", - "8.0.0-nightly.20190926": "79.0.3919.0", - "8.0.0-nightly.20190928": "79.0.3919.0", - "8.0.0-nightly.20190929": "79.0.3919.0", - "8.0.0-nightly.20190930": "79.0.3919.0", - "8.0.0-nightly.20191001": "79.0.3919.0", - "8.0.0-nightly.20191004": "79.0.3919.0", - "8.0.0-nightly.20191005": "79.0.3919.0", - "8.0.0-nightly.20191006": "79.0.3919.0", - "8.0.0-nightly.20191009": "79.0.3919.0", - "8.0.0-nightly.20191011": "79.0.3919.0", - "8.0.0-nightly.20191012": "79.0.3919.0", - "8.0.0-nightly.20191017": "79.0.3919.0", - "8.0.0-nightly.20191019": "79.0.3931.0", - "8.0.0-nightly.20191020": "79.0.3931.0", - "8.0.0-nightly.20191021": "79.0.3931.0", - "8.0.0-nightly.20191023": "79.0.3931.0", - "8.0.0-nightly.20191101": "80.0.3952.0", - "8.0.0-nightly.20191103": "80.0.3952.0", - "8.0.0-nightly.20191105": "80.0.3952.0", - "8.0.0": "80.0.3987.86", - "8.0.1": "80.0.3987.86", - "8.0.2": "80.0.3987.86", - "8.0.3": "80.0.3987.134", - "8.1.0": "80.0.3987.137", - "8.1.1": "80.0.3987.141", - "8.2.0": "80.0.3987.158", - "8.2.1": "80.0.3987.163", - "8.2.2": "80.0.3987.163", - "8.2.3": "80.0.3987.163", - "8.2.4": "80.0.3987.165", - "8.2.5": "80.0.3987.165", - "8.3.0": "80.0.3987.165", - "8.3.1": "80.0.3987.165", - "8.3.2": "80.0.3987.165", - "8.3.3": "80.0.3987.165", - "8.3.4": "80.0.3987.165", - "8.4.0": "80.0.3987.165", - "8.4.1": "80.0.3987.165", - "8.5.0": "80.0.3987.165", - "8.5.1": "80.0.3987.165", - "8.5.2": "80.0.3987.165", - "8.5.3": "80.0.3987.163", - "8.5.4": "80.0.3987.163", - "8.5.5": "80.0.3987.163", - "9.0.0-beta.1": "82.0.4048.0", - "9.0.0-beta.2": "82.0.4048.0", - "9.0.0-beta.3": "82.0.4048.0", - "9.0.0-beta.4": "82.0.4048.0", - "9.0.0-beta.5": "82.0.4048.0", - "9.0.0-beta.6": "82.0.4058.2", - "9.0.0-beta.7": "82.0.4058.2", - "9.0.0-beta.9": "82.0.4058.2", - "9.0.0-beta.10": "82.0.4085.10", - "9.0.0-beta.11": "82.0.4085.14", - "9.0.0-beta.12": "82.0.4085.14", - "9.0.0-beta.13": "82.0.4085.14", - "9.0.0-beta.14": "82.0.4085.27", - "9.0.0-beta.15": "83.0.4102.3", - "9.0.0-beta.16": "83.0.4102.3", - "9.0.0-beta.17": "83.0.4103.14", - "9.0.0-beta.18": "83.0.4103.16", - "9.0.0-beta.19": "83.0.4103.24", - "9.0.0-beta.20": "83.0.4103.26", - "9.0.0-beta.21": "83.0.4103.26", - "9.0.0-beta.22": "83.0.4103.34", - "9.0.0-beta.23": "83.0.4103.44", - "9.0.0-beta.24": "83.0.4103.45", - "9.0.0-nightly.20191121": "80.0.3954.0", - "9.0.0-nightly.20191122": "80.0.3954.0", - "9.0.0-nightly.20191123": "80.0.3954.0", - "9.0.0-nightly.20191124": "80.0.3954.0", - "9.0.0-nightly.20191126": "80.0.3954.0", - "9.0.0-nightly.20191128": "80.0.3954.0", - "9.0.0-nightly.20191129": "80.0.3954.0", - "9.0.0-nightly.20191130": "80.0.3954.0", - "9.0.0-nightly.20191201": "80.0.3954.0", - "9.0.0-nightly.20191202": "80.0.3954.0", - "9.0.0-nightly.20191203": "80.0.3954.0", - "9.0.0-nightly.20191204": "80.0.3954.0", - "9.0.0-nightly.20191205": "80.0.3954.0", - "9.0.0-nightly.20191210": "80.0.3954.0", - "9.0.0-nightly.20191220": "81.0.3994.0", - "9.0.0-nightly.20191221": "81.0.3994.0", - "9.0.0-nightly.20191222": "81.0.3994.0", - "9.0.0-nightly.20191223": "81.0.3994.0", - "9.0.0-nightly.20191224": "81.0.3994.0", - "9.0.0-nightly.20191225": "81.0.3994.0", - "9.0.0-nightly.20191226": "81.0.3994.0", - "9.0.0-nightly.20191228": "81.0.3994.0", - "9.0.0-nightly.20191229": "81.0.3994.0", - "9.0.0-nightly.20191230": "81.0.3994.0", - "9.0.0-nightly.20191231": "81.0.3994.0", - "9.0.0-nightly.20200101": "81.0.3994.0", - "9.0.0-nightly.20200103": "81.0.3994.0", - "9.0.0-nightly.20200104": "81.0.3994.0", - "9.0.0-nightly.20200105": "81.0.3994.0", - "9.0.0-nightly.20200106": "81.0.3994.0", - "9.0.0-nightly.20200108": "81.0.3994.0", - "9.0.0-nightly.20200109": "81.0.3994.0", - "9.0.0-nightly.20200110": "81.0.3994.0", - "9.0.0-nightly.20200111": "81.0.3994.0", - "9.0.0-nightly.20200113": "81.0.3994.0", - "9.0.0-nightly.20200115": "81.0.3994.0", - "9.0.0-nightly.20200116": "81.0.3994.0", - "9.0.0-nightly.20200117": "81.0.3994.0", - "9.0.0-nightly.20200119": "81.0.4030.0", - "9.0.0-nightly.20200121": "81.0.4030.0", - "9.0.0": "83.0.4103.64", - "9.0.1": "83.0.4103.94", - "9.0.2": "83.0.4103.94", - "9.0.3": "83.0.4103.100", - "9.0.4": "83.0.4103.104", - "9.0.5": "83.0.4103.119", - "9.1.0": "83.0.4103.122", - "9.1.1": "83.0.4103.122", - "9.1.2": "83.0.4103.122", - "9.2.0": "83.0.4103.122", - "9.2.1": "83.0.4103.122", - "9.3.0": "83.0.4103.122", - "9.3.1": "83.0.4103.122", - "9.3.2": "83.0.4103.122", - "9.3.3": "83.0.4103.122", - "9.3.4": "83.0.4103.122", - "9.3.5": "83.0.4103.122", - "9.4.0": "83.0.4103.122", - "9.4.1": "83.0.4103.122", - "9.4.2": "83.0.4103.122", - "9.4.3": "83.0.4103.122", - "9.4.4": "83.0.4103.122", - "10.0.0-beta.1": "84.0.4129.0", - "10.0.0-beta.2": "84.0.4129.0", - "10.0.0-beta.3": "85.0.4161.2", - "10.0.0-beta.4": "85.0.4161.2", - "10.0.0-beta.8": "85.0.4181.1", - "10.0.0-beta.9": "85.0.4181.1", - "10.0.0-beta.10": "85.0.4183.19", - "10.0.0-beta.11": "85.0.4183.20", - "10.0.0-beta.12": "85.0.4183.26", - "10.0.0-beta.13": "85.0.4183.39", - "10.0.0-beta.14": "85.0.4183.39", - "10.0.0-beta.15": "85.0.4183.39", - "10.0.0-beta.17": "85.0.4183.39", - "10.0.0-beta.19": "85.0.4183.39", - "10.0.0-beta.20": "85.0.4183.39", - "10.0.0-beta.21": "85.0.4183.39", - "10.0.0-beta.23": "85.0.4183.70", - "10.0.0-beta.24": "85.0.4183.78", - "10.0.0-beta.25": "85.0.4183.80", - "10.0.0-nightly.20200209": "82.0.4050.0", - "10.0.0-nightly.20200210": "82.0.4050.0", - "10.0.0-nightly.20200211": "82.0.4050.0", - "10.0.0-nightly.20200216": "82.0.4050.0", - "10.0.0-nightly.20200217": "82.0.4050.0", - "10.0.0-nightly.20200218": "82.0.4050.0", - "10.0.0-nightly.20200221": "82.0.4050.0", - "10.0.0-nightly.20200222": "82.0.4050.0", - "10.0.0-nightly.20200223": "82.0.4050.0", - "10.0.0-nightly.20200226": "82.0.4050.0", - "10.0.0-nightly.20200303": "82.0.4050.0", - "10.0.0-nightly.20200304": "82.0.4076.0", - "10.0.0-nightly.20200305": "82.0.4076.0", - "10.0.0-nightly.20200306": "82.0.4076.0", - "10.0.0-nightly.20200309": "82.0.4076.0", - "10.0.0-nightly.20200310": "82.0.4076.0", - "10.0.0-nightly.20200311": "82.0.4083.0", - "10.0.0-nightly.20200316": "83.0.4086.0", - "10.0.0-nightly.20200317": "83.0.4087.0", - "10.0.0-nightly.20200318": "83.0.4087.0", - "10.0.0-nightly.20200320": "83.0.4087.0", - "10.0.0-nightly.20200323": "83.0.4087.0", - "10.0.0-nightly.20200324": "83.0.4087.0", - "10.0.0-nightly.20200325": "83.0.4087.0", - "10.0.0-nightly.20200326": "83.0.4087.0", - "10.0.0-nightly.20200327": "83.0.4087.0", - "10.0.0-nightly.20200330": "83.0.4087.0", - "10.0.0-nightly.20200331": "83.0.4087.0", - "10.0.0-nightly.20200401": "83.0.4087.0", - "10.0.0-nightly.20200402": "83.0.4087.0", - "10.0.0-nightly.20200403": "83.0.4087.0", - "10.0.0-nightly.20200406": "83.0.4087.0", - "10.0.0-nightly.20200408": "83.0.4095.0", - "10.0.0-nightly.20200410": "83.0.4095.0", - "10.0.0-nightly.20200413": "83.0.4095.0", - "10.0.0-nightly.20200414": "84.0.4114.0", - "10.0.0-nightly.20200415": "84.0.4115.0", - "10.0.0-nightly.20200416": "84.0.4115.0", - "10.0.0-nightly.20200417": "84.0.4115.0", - "10.0.0-nightly.20200422": "84.0.4121.0", - "10.0.0-nightly.20200423": "84.0.4121.0", - "10.0.0-nightly.20200427": "84.0.4125.0", - "10.0.0-nightly.20200428": "84.0.4125.0", - "10.0.0-nightly.20200429": "84.0.4125.0", - "10.0.0-nightly.20200430": "84.0.4125.0", - "10.0.0-nightly.20200501": "84.0.4129.0", - "10.0.0-nightly.20200504": "84.0.4129.0", - "10.0.0-nightly.20200505": "84.0.4129.0", - "10.0.0-nightly.20200506": "84.0.4129.0", - "10.0.0-nightly.20200507": "84.0.4129.0", - "10.0.0-nightly.20200508": "84.0.4129.0", - "10.0.0-nightly.20200511": "84.0.4129.0", - "10.0.0-nightly.20200512": "84.0.4129.0", - "10.0.0-nightly.20200513": "84.0.4129.0", - "10.0.0-nightly.20200514": "84.0.4129.0", - "10.0.0-nightly.20200515": "84.0.4129.0", - "10.0.0-nightly.20200518": "84.0.4129.0", - "10.0.0-nightly.20200519": "84.0.4129.0", - "10.0.0-nightly.20200520": "84.0.4129.0", - "10.0.0-nightly.20200521": "84.0.4129.0", - "10.0.0": "85.0.4183.84", - "10.0.1": "85.0.4183.86", - "10.1.0": "85.0.4183.87", - "10.1.1": "85.0.4183.93", - "10.1.2": "85.0.4183.98", - "10.1.3": "85.0.4183.121", - "10.1.4": "85.0.4183.121", - "10.1.5": "85.0.4183.121", - "10.1.6": "85.0.4183.121", - "10.1.7": "85.0.4183.121", - "10.2.0": "85.0.4183.121", - "10.3.0": "85.0.4183.121", - "10.3.1": "85.0.4183.121", - "10.3.2": "85.0.4183.121", - "10.4.0": "85.0.4183.121", - "10.4.1": "85.0.4183.121", - "10.4.2": "85.0.4183.121", - "10.4.3": "85.0.4183.121", - "10.4.4": "85.0.4183.121", - "10.4.5": "85.0.4183.121", - "10.4.6": "85.0.4183.121", - "10.4.7": "85.0.4183.121", - "11.0.0-beta.1": "86.0.4234.0", - "11.0.0-beta.3": "86.0.4234.0", - "11.0.0-beta.4": "86.0.4234.0", - "11.0.0-beta.5": "86.0.4234.0", - "11.0.0-beta.6": "86.0.4234.0", - "11.0.0-beta.7": "86.0.4234.0", - "11.0.0-beta.8": "87.0.4251.1", - "11.0.0-beta.9": "87.0.4251.1", - "11.0.0-beta.11": "87.0.4251.1", - "11.0.0-beta.12": "87.0.4280.11", - "11.0.0-beta.13": "87.0.4280.11", - "11.0.0-beta.16": "87.0.4280.27", - "11.0.0-beta.17": "87.0.4280.27", - "11.0.0-beta.18": "87.0.4280.27", - "11.0.0-beta.19": "87.0.4280.27", - "11.0.0-beta.20": "87.0.4280.40", - "11.0.0-beta.22": "87.0.4280.47", - "11.0.0-beta.23": "87.0.4280.47", - "11.0.0-nightly.20200525": "84.0.4129.0", - "11.0.0-nightly.20200526": "84.0.4129.0", - "11.0.0-nightly.20200529": "85.0.4156.0", - "11.0.0-nightly.20200602": "85.0.4162.0", - "11.0.0-nightly.20200603": "85.0.4162.0", - "11.0.0-nightly.20200604": "85.0.4162.0", - "11.0.0-nightly.20200609": "85.0.4162.0", - "11.0.0-nightly.20200610": "85.0.4162.0", - "11.0.0-nightly.20200611": "85.0.4162.0", - "11.0.0-nightly.20200615": "85.0.4162.0", - "11.0.0-nightly.20200616": "85.0.4162.0", - "11.0.0-nightly.20200617": "85.0.4162.0", - "11.0.0-nightly.20200618": "85.0.4162.0", - "11.0.0-nightly.20200619": "85.0.4162.0", - "11.0.0-nightly.20200701": "85.0.4179.0", - "11.0.0-nightly.20200702": "85.0.4179.0", - "11.0.0-nightly.20200703": "85.0.4179.0", - "11.0.0-nightly.20200706": "85.0.4179.0", - "11.0.0-nightly.20200707": "85.0.4179.0", - "11.0.0-nightly.20200708": "85.0.4179.0", - "11.0.0-nightly.20200709": "85.0.4179.0", - "11.0.0-nightly.20200716": "86.0.4203.0", - "11.0.0-nightly.20200717": "86.0.4203.0", - "11.0.0-nightly.20200720": "86.0.4203.0", - "11.0.0-nightly.20200721": "86.0.4203.0", - "11.0.0-nightly.20200723": "86.0.4209.0", - "11.0.0-nightly.20200724": "86.0.4209.0", - "11.0.0-nightly.20200729": "86.0.4209.0", - "11.0.0-nightly.20200730": "86.0.4209.0", - "11.0.0-nightly.20200731": "86.0.4209.0", - "11.0.0-nightly.20200803": "86.0.4209.0", - "11.0.0-nightly.20200804": "86.0.4209.0", - "11.0.0-nightly.20200805": "86.0.4209.0", - "11.0.0-nightly.20200811": "86.0.4209.0", - "11.0.0-nightly.20200812": "86.0.4209.0", - "11.0.0-nightly.20200822": "86.0.4234.0", - "11.0.0-nightly.20200824": "86.0.4234.0", - "11.0.0-nightly.20200825": "86.0.4234.0", - "11.0.0-nightly.20200826": "86.0.4234.0", - "11.0.0": "87.0.4280.60", - "11.0.1": "87.0.4280.60", - "11.0.2": "87.0.4280.67", - "11.0.3": "87.0.4280.67", - "11.0.4": "87.0.4280.67", - "11.0.5": "87.0.4280.88", - "11.1.0": "87.0.4280.88", - "11.1.1": "87.0.4280.88", - "11.2.0": "87.0.4280.141", - "11.2.1": "87.0.4280.141", - "11.2.2": "87.0.4280.141", - "11.2.3": "87.0.4280.141", - "11.3.0": "87.0.4280.141", - "11.4.0": "87.0.4280.141", - "11.4.1": "87.0.4280.141", - "11.4.2": "87.0.4280.141", - "11.4.3": "87.0.4280.141", - "11.4.4": "87.0.4280.141", - "11.4.5": "87.0.4280.141", - "11.4.6": "87.0.4280.141", - "11.4.7": "87.0.4280.141", - "11.4.8": "87.0.4280.141", - "11.4.9": "87.0.4280.141", - "11.4.10": "87.0.4280.141", - "11.4.11": "87.0.4280.141", - "11.4.12": "87.0.4280.141", - "11.5.0": "87.0.4280.141", - "12.0.0-beta.1": "89.0.4328.0", - "12.0.0-beta.3": "89.0.4328.0", - "12.0.0-beta.4": "89.0.4328.0", - "12.0.0-beta.5": "89.0.4328.0", - "12.0.0-beta.6": "89.0.4328.0", - "12.0.0-beta.7": "89.0.4328.0", - "12.0.0-beta.8": "89.0.4328.0", - "12.0.0-beta.9": "89.0.4328.0", - "12.0.0-beta.10": "89.0.4328.0", - "12.0.0-beta.11": "89.0.4328.0", - "12.0.0-beta.12": "89.0.4328.0", - "12.0.0-beta.14": "89.0.4328.0", - "12.0.0-beta.16": "89.0.4348.1", - "12.0.0-beta.18": "89.0.4348.1", - "12.0.0-beta.19": "89.0.4348.1", - "12.0.0-beta.20": "89.0.4348.1", - "12.0.0-beta.21": "89.0.4388.2", - "12.0.0-beta.22": "89.0.4388.2", - "12.0.0-beta.23": "89.0.4388.2", - "12.0.0-beta.24": "89.0.4388.2", - "12.0.0-beta.25": "89.0.4388.2", - "12.0.0-beta.26": "89.0.4388.2", - "12.0.0-beta.27": "89.0.4389.23", - "12.0.0-beta.28": "89.0.4389.23", - "12.0.0-beta.29": "89.0.4389.23", - "12.0.0-beta.30": "89.0.4389.58", - "12.0.0-beta.31": "89.0.4389.58", - "12.0.0-nightly.20200827": "86.0.4234.0", - "12.0.0-nightly.20200831": "86.0.4234.0", - "12.0.0-nightly.20200902": "86.0.4234.0", - "12.0.0-nightly.20200903": "86.0.4234.0", - "12.0.0-nightly.20200907": "86.0.4234.0", - "12.0.0-nightly.20200910": "86.0.4234.0", - "12.0.0-nightly.20200911": "86.0.4234.0", - "12.0.0-nightly.20200914": "86.0.4234.0", - "12.0.0-nightly.20201002": "87.0.4268.0", - "12.0.0-nightly.20201007": "87.0.4268.0", - "12.0.0-nightly.20201009": "87.0.4268.0", - "12.0.0-nightly.20201012": "87.0.4268.0", - "12.0.0-nightly.20201013": "87.0.4268.0", - "12.0.0-nightly.20201014": "87.0.4268.0", - "12.0.0-nightly.20201015": "87.0.4268.0", - "12.0.0-nightly.20201023": "88.0.4292.0", - "12.0.0-nightly.20201026": "88.0.4292.0", - "12.0.0-nightly.20201030": "88.0.4306.0", - "12.0.0-nightly.20201102": "88.0.4306.0", - "12.0.0-nightly.20201103": "88.0.4306.0", - "12.0.0-nightly.20201104": "88.0.4306.0", - "12.0.0-nightly.20201105": "88.0.4306.0", - "12.0.0-nightly.20201106": "88.0.4306.0", - "12.0.0-nightly.20201111": "88.0.4306.0", - "12.0.0-nightly.20201112": "88.0.4306.0", - "12.0.0-nightly.20201116": "88.0.4324.0", - "12.0.0": "89.0.4389.69", - "12.0.1": "89.0.4389.82", - "12.0.2": "89.0.4389.90", - "12.0.3": "89.0.4389.114", - "12.0.4": "89.0.4389.114", - "12.0.5": "89.0.4389.128", - "12.0.6": "89.0.4389.128", - "12.0.7": "89.0.4389.128", - "12.0.8": "89.0.4389.128", - "12.0.9": "89.0.4389.128", - "12.0.10": "89.0.4389.128", - "12.0.11": "89.0.4389.128", - "12.0.12": "89.0.4389.128", - "12.0.13": "89.0.4389.128", - "12.0.14": "89.0.4389.128", - "12.0.15": "89.0.4389.128", - "12.0.16": "89.0.4389.128", - "12.0.17": "89.0.4389.128", - "12.0.18": "89.0.4389.128", - "12.1.0": "89.0.4389.128", - "12.1.1": "89.0.4389.128", - "12.1.2": "89.0.4389.128", - "12.2.0": "89.0.4389.128", - "12.2.1": "89.0.4389.128", - "12.2.2": "89.0.4389.128", - "12.2.3": "89.0.4389.128", - "13.0.0-beta.2": "90.0.4402.0", - "13.0.0-beta.3": "90.0.4402.0", - "13.0.0-beta.4": "90.0.4415.0", - "13.0.0-beta.5": "90.0.4415.0", - "13.0.0-beta.6": "90.0.4415.0", - "13.0.0-beta.7": "90.0.4415.0", - "13.0.0-beta.8": "90.0.4415.0", - "13.0.0-beta.9": "90.0.4415.0", - "13.0.0-beta.10": "90.0.4415.0", - "13.0.0-beta.11": "90.0.4415.0", - "13.0.0-beta.12": "90.0.4415.0", - "13.0.0-beta.13": "90.0.4415.0", - "13.0.0-beta.14": "91.0.4448.0", - "13.0.0-beta.16": "91.0.4448.0", - "13.0.0-beta.17": "91.0.4448.0", - "13.0.0-beta.18": "91.0.4448.0", - "13.0.0-beta.20": "91.0.4448.0", - "13.0.0-beta.21": "91.0.4472.33", - "13.0.0-beta.22": "91.0.4472.33", - "13.0.0-beta.23": "91.0.4472.33", - "13.0.0-beta.24": "91.0.4472.38", - "13.0.0-beta.25": "91.0.4472.38", - "13.0.0-beta.26": "91.0.4472.38", - "13.0.0-beta.27": "91.0.4472.38", - "13.0.0-beta.28": "91.0.4472.38", - "13.0.0-nightly.20201119": "89.0.4328.0", - "13.0.0-nightly.20201123": "89.0.4328.0", - "13.0.0-nightly.20201124": "89.0.4328.0", - "13.0.0-nightly.20201126": "89.0.4328.0", - "13.0.0-nightly.20201127": "89.0.4328.0", - "13.0.0-nightly.20201130": "89.0.4328.0", - "13.0.0-nightly.20201201": "89.0.4328.0", - "13.0.0-nightly.20201202": "89.0.4328.0", - "13.0.0-nightly.20201203": "89.0.4328.0", - "13.0.0-nightly.20201204": "89.0.4328.0", - "13.0.0-nightly.20201207": "89.0.4328.0", - "13.0.0-nightly.20201208": "89.0.4328.0", - "13.0.0-nightly.20201209": "89.0.4328.0", - "13.0.0-nightly.20201210": "89.0.4328.0", - "13.0.0-nightly.20201211": "89.0.4328.0", - "13.0.0-nightly.20201214": "89.0.4328.0", - "13.0.0-nightly.20201215": "89.0.4349.0", - "13.0.0-nightly.20201216": "89.0.4349.0", - "13.0.0-nightly.20201221": "89.0.4349.0", - "13.0.0-nightly.20201222": "89.0.4349.0", - "13.0.0-nightly.20201223": "89.0.4359.0", - "13.0.0-nightly.20210104": "89.0.4359.0", - "13.0.0-nightly.20210108": "89.0.4359.0", - "13.0.0-nightly.20210111": "89.0.4359.0", - "13.0.0-nightly.20210113": "89.0.4386.0", - "13.0.0-nightly.20210114": "89.0.4386.0", - "13.0.0-nightly.20210118": "89.0.4386.0", - "13.0.0-nightly.20210122": "89.0.4386.0", - "13.0.0-nightly.20210125": "89.0.4386.0", - "13.0.0-nightly.20210127": "89.0.4389.0", - "13.0.0-nightly.20210128": "89.0.4389.0", - "13.0.0-nightly.20210129": "89.0.4389.0", - "13.0.0-nightly.20210201": "89.0.4389.0", - "13.0.0-nightly.20210202": "89.0.4389.0", - "13.0.0-nightly.20210203": "89.0.4389.0", - "13.0.0-nightly.20210205": "89.0.4389.0", - "13.0.0-nightly.20210208": "89.0.4389.0", - "13.0.0-nightly.20210209": "89.0.4389.0", - "13.0.0-nightly.20210210": "90.0.4402.0", - "13.0.0-nightly.20210211": "90.0.4402.0", - "13.0.0-nightly.20210212": "90.0.4402.0", - "13.0.0-nightly.20210216": "90.0.4402.0", - "13.0.0-nightly.20210217": "90.0.4402.0", - "13.0.0-nightly.20210218": "90.0.4402.0", - "13.0.0-nightly.20210219": "90.0.4402.0", - "13.0.0-nightly.20210222": "90.0.4402.0", - "13.0.0-nightly.20210225": "90.0.4402.0", - "13.0.0-nightly.20210226": "90.0.4402.0", - "13.0.0-nightly.20210301": "90.0.4402.0", - "13.0.0-nightly.20210302": "90.0.4402.0", - "13.0.0-nightly.20210303": "90.0.4402.0", - "13.0.0": "91.0.4472.69", - "13.0.1": "91.0.4472.69", - "13.1.0": "91.0.4472.77", - "13.1.1": "91.0.4472.77", - "13.1.2": "91.0.4472.77", - "13.1.3": "91.0.4472.106", - "13.1.4": "91.0.4472.106", - "13.1.5": "91.0.4472.124", - "13.1.6": "91.0.4472.124", - "13.1.7": "91.0.4472.124", - "13.1.8": "91.0.4472.164", - "13.1.9": "91.0.4472.164", - "13.2.0": "91.0.4472.164", - "13.2.1": "91.0.4472.164", - "13.2.2": "91.0.4472.164", - "13.2.3": "91.0.4472.164", - "13.3.0": "91.0.4472.164", - "13.4.0": "91.0.4472.164", - "13.5.0": "91.0.4472.164", - "13.5.1": "91.0.4472.164", - "13.5.2": "91.0.4472.164", - "13.6.0": "91.0.4472.164", - "13.6.1": "91.0.4472.164", - "13.6.2": "91.0.4472.164", - "13.6.3": "91.0.4472.164", - "13.6.6": "91.0.4472.164", - "13.6.7": "91.0.4472.164", - "13.6.8": "91.0.4472.164", - "13.6.9": "91.0.4472.164", - "14.0.0-beta.1": "92.0.4511.0", - "14.0.0-beta.2": "92.0.4511.0", - "14.0.0-beta.3": "92.0.4511.0", - "14.0.0-beta.5": "93.0.4536.0", - "14.0.0-beta.6": "93.0.4536.0", - "14.0.0-beta.7": "93.0.4536.0", - "14.0.0-beta.8": "93.0.4536.0", - "14.0.0-beta.9": "93.0.4539.0", - "14.0.0-beta.10": "93.0.4539.0", - "14.0.0-beta.11": "93.0.4557.4", - "14.0.0-beta.12": "93.0.4557.4", - "14.0.0-beta.13": "93.0.4566.0", - "14.0.0-beta.14": "93.0.4566.0", - "14.0.0-beta.15": "93.0.4566.0", - "14.0.0-beta.16": "93.0.4566.0", - "14.0.0-beta.17": "93.0.4566.0", - "14.0.0-beta.18": "93.0.4577.15", - "14.0.0-beta.19": "93.0.4577.15", - "14.0.0-beta.20": "93.0.4577.15", - "14.0.0-beta.21": "93.0.4577.15", - "14.0.0-beta.22": "93.0.4577.25", - "14.0.0-beta.23": "93.0.4577.25", - "14.0.0-beta.24": "93.0.4577.51", - "14.0.0-beta.25": "93.0.4577.51", - "14.0.0-nightly.20210304": "90.0.4402.0", - "14.0.0-nightly.20210305": "90.0.4415.0", - "14.0.0-nightly.20210308": "90.0.4415.0", - "14.0.0-nightly.20210309": "90.0.4415.0", - "14.0.0-nightly.20210311": "90.0.4415.0", - "14.0.0-nightly.20210315": "90.0.4415.0", - "14.0.0-nightly.20210316": "90.0.4415.0", - "14.0.0-nightly.20210317": "90.0.4415.0", - "14.0.0-nightly.20210318": "90.0.4415.0", - "14.0.0-nightly.20210319": "90.0.4415.0", - "14.0.0-nightly.20210323": "90.0.4415.0", - "14.0.0-nightly.20210324": "90.0.4415.0", - "14.0.0-nightly.20210325": "90.0.4415.0", - "14.0.0-nightly.20210326": "90.0.4415.0", - "14.0.0-nightly.20210329": "90.0.4415.0", - "14.0.0-nightly.20210330": "90.0.4415.0", - "14.0.0-nightly.20210331": "91.0.4448.0", - "14.0.0-nightly.20210401": "91.0.4448.0", - "14.0.0-nightly.20210402": "91.0.4448.0", - "14.0.0-nightly.20210406": "91.0.4448.0", - "14.0.0-nightly.20210407": "91.0.4448.0", - "14.0.0-nightly.20210408": "91.0.4448.0", - "14.0.0-nightly.20210409": "91.0.4448.0", - "14.0.0-nightly.20210413": "91.0.4448.0", - "14.0.0-nightly.20210426": "92.0.4475.0", - "14.0.0-nightly.20210427": "92.0.4475.0", - "14.0.0-nightly.20210430": "92.0.4488.0", - "14.0.0-nightly.20210503": "92.0.4488.0", - "14.0.0-nightly.20210505": "92.0.4496.0", - "14.0.0-nightly.20210506": "92.0.4498.0", - "14.0.0-nightly.20210507": "92.0.4499.0", - "14.0.0-nightly.20210510": "92.0.4499.0", - "14.0.0-nightly.20210511": "92.0.4499.0", - "14.0.0-nightly.20210512": "92.0.4499.0", - "14.0.0-nightly.20210513": "92.0.4499.0", - "14.0.0-nightly.20210514": "92.0.4505.0", - "14.0.0-nightly.20210517": "92.0.4505.0", - "14.0.0-nightly.20210518": "92.0.4505.0", - "14.0.0-nightly.20210519": "92.0.4505.0", - "14.0.0-nightly.20210520": "92.0.4511.0", - "14.0.0-nightly.20210523": "92.0.4511.0", - "14.0.0-nightly.20210524": "92.0.4511.0", - "14.0.0": "93.0.4577.58", - "14.0.1": "93.0.4577.63", - "14.0.2": "93.0.4577.82", - "14.1.0": "93.0.4577.82", - "14.1.1": "93.0.4577.82", - "14.2.0": "93.0.4577.82", - "14.2.1": "93.0.4577.82", - "14.2.2": "93.0.4577.82", - "14.2.3": "93.0.4577.82", - "14.2.4": "93.0.4577.82", - "14.2.5": "93.0.4577.82", - "14.2.6": "93.0.4577.82", - "14.2.7": "93.0.4577.82", - "14.2.8": "93.0.4577.82", - "14.2.9": "93.0.4577.82", - "15.0.0-alpha.1": "93.0.4566.0", - "15.0.0-alpha.2": "93.0.4566.0", - "15.0.0-alpha.3": "94.0.4584.0", - "15.0.0-alpha.4": "94.0.4584.0", - "15.0.0-alpha.5": "94.0.4584.0", - "15.0.0-alpha.6": "94.0.4584.0", - "15.0.0-alpha.7": "94.0.4590.2", - "15.0.0-alpha.8": "94.0.4590.2", - "15.0.0-alpha.9": "94.0.4590.2", - "15.0.0-alpha.10": "94.0.4606.12", - "15.0.0-beta.1": "94.0.4606.20", - "15.0.0-beta.2": "94.0.4606.20", - "15.0.0-beta.3": "94.0.4606.31", - "15.0.0-beta.4": "94.0.4606.31", - "15.0.0-beta.5": "94.0.4606.31", - "15.0.0-beta.6": "94.0.4606.31", - "15.0.0-beta.7": "94.0.4606.31", - "15.0.0-nightly.20210527": "92.0.4511.0", - "15.0.0-nightly.20210528": "92.0.4511.0", - "15.0.0-nightly.20210531": "92.0.4511.0", - "15.0.0-nightly.20210601": "92.0.4511.0", - "15.0.0-nightly.20210602": "92.0.4511.0", - "15.0.0-nightly.20210603": "93.0.4530.0", - "15.0.0-nightly.20210604": "93.0.4530.0", - "15.0.0-nightly.20210608": "93.0.4535.0", - "15.0.0-nightly.20210609": "93.0.4536.0", - "15.0.0-nightly.20210610": "93.0.4536.0", - "15.0.0-nightly.20210611": "93.0.4536.0", - "15.0.0-nightly.20210614": "93.0.4536.0", - "15.0.0-nightly.20210615": "93.0.4536.0", - "15.0.0-nightly.20210616": "93.0.4536.0", - "15.0.0-nightly.20210617": "93.0.4539.0", - "15.0.0-nightly.20210618": "93.0.4539.0", - "15.0.0-nightly.20210621": "93.0.4539.0", - "15.0.0-nightly.20210622": "93.0.4539.0", - "15.0.0-nightly.20210623": "93.0.4550.0", - "15.0.0-nightly.20210624": "93.0.4550.0", - "15.0.0-nightly.20210625": "93.0.4552.0", - "15.0.0-nightly.20210628": "93.0.4552.0", - "15.0.0-nightly.20210629": "93.0.4552.0", - "15.0.0-nightly.20210630": "93.0.4558.0", - "15.0.0-nightly.20210701": "93.0.4558.0", - "15.0.0-nightly.20210702": "93.0.4558.0", - "15.0.0-nightly.20210705": "93.0.4558.0", - "15.0.0-nightly.20210706": "93.0.4566.0", - "15.0.0-nightly.20210707": "93.0.4566.0", - "15.0.0-nightly.20210708": "93.0.4566.0", - "15.0.0-nightly.20210709": "93.0.4566.0", - "15.0.0-nightly.20210712": "93.0.4566.0", - "15.0.0-nightly.20210713": "93.0.4566.0", - "15.0.0-nightly.20210714": "93.0.4566.0", - "15.0.0-nightly.20210715": "93.0.4566.0", - "15.0.0-nightly.20210716": "93.0.4566.0", - "15.0.0-nightly.20210719": "93.0.4566.0", - "15.0.0-nightly.20210720": "93.0.4566.0", - "15.0.0-nightly.20210721": "93.0.4566.0", - "15.0.0": "94.0.4606.51", - "15.1.0": "94.0.4606.61", - "15.1.1": "94.0.4606.61", - "15.1.2": "94.0.4606.71", - "15.2.0": "94.0.4606.81", - "15.3.0": "94.0.4606.81", - "15.3.1": "94.0.4606.81", - "15.3.2": "94.0.4606.81", - "15.3.3": "94.0.4606.81", - "15.3.4": "94.0.4606.81", - "15.3.5": "94.0.4606.81", - "15.3.6": "94.0.4606.81", - "15.3.7": "94.0.4606.81", - "15.4.0": "94.0.4606.81", - "15.4.1": "94.0.4606.81", - "15.4.2": "94.0.4606.81", - "15.5.0": "94.0.4606.81", - "15.5.1": "94.0.4606.81", - "15.5.2": "94.0.4606.81", - "15.5.3": "94.0.4606.81", - "15.5.4": "94.0.4606.81", - "15.5.5": "94.0.4606.81", - "15.5.6": "94.0.4606.81", - "15.5.7": "94.0.4606.81", - "16.0.0-alpha.1": "95.0.4629.0", - "16.0.0-alpha.2": "95.0.4629.0", - "16.0.0-alpha.3": "95.0.4629.0", - "16.0.0-alpha.4": "95.0.4629.0", - "16.0.0-alpha.5": "95.0.4629.0", - "16.0.0-alpha.6": "95.0.4629.0", - "16.0.0-alpha.7": "95.0.4629.0", - "16.0.0-alpha.8": "96.0.4647.0", - "16.0.0-alpha.9": "96.0.4647.0", - "16.0.0-beta.1": "96.0.4647.0", - "16.0.0-beta.2": "96.0.4647.0", - "16.0.0-beta.3": "96.0.4647.0", - "16.0.0-beta.4": "96.0.4664.18", - "16.0.0-beta.5": "96.0.4664.18", - "16.0.0-beta.6": "96.0.4664.27", - "16.0.0-beta.7": "96.0.4664.27", - "16.0.0-beta.8": "96.0.4664.35", - "16.0.0-beta.9": "96.0.4664.35", - "16.0.0-nightly.20210722": "93.0.4566.0", - "16.0.0-nightly.20210723": "93.0.4566.0", - "16.0.0-nightly.20210726": "93.0.4566.0", - "16.0.0-nightly.20210727": "94.0.4584.0", - "16.0.0-nightly.20210728": "94.0.4584.0", - "16.0.0-nightly.20210729": "94.0.4584.0", - "16.0.0-nightly.20210730": "94.0.4584.0", - "16.0.0-nightly.20210802": "94.0.4584.0", - "16.0.0-nightly.20210803": "94.0.4584.0", - "16.0.0-nightly.20210804": "94.0.4584.0", - "16.0.0-nightly.20210805": "94.0.4584.0", - "16.0.0-nightly.20210806": "94.0.4584.0", - "16.0.0-nightly.20210809": "94.0.4584.0", - "16.0.0-nightly.20210810": "94.0.4584.0", - "16.0.0-nightly.20210811": "94.0.4584.0", - "16.0.0-nightly.20210812": "94.0.4590.2", - "16.0.0-nightly.20210813": "94.0.4590.2", - "16.0.0-nightly.20210816": "94.0.4590.2", - "16.0.0-nightly.20210817": "94.0.4590.2", - "16.0.0-nightly.20210818": "94.0.4590.2", - "16.0.0-nightly.20210819": "94.0.4590.2", - "16.0.0-nightly.20210820": "94.0.4590.2", - "16.0.0-nightly.20210823": "94.0.4590.2", - "16.0.0-nightly.20210824": "95.0.4612.5", - "16.0.0-nightly.20210825": "95.0.4612.5", - "16.0.0-nightly.20210826": "95.0.4612.5", - "16.0.0-nightly.20210827": "95.0.4612.5", - "16.0.0-nightly.20210830": "95.0.4612.5", - "16.0.0-nightly.20210831": "95.0.4612.5", - "16.0.0-nightly.20210901": "95.0.4612.5", - "16.0.0-nightly.20210902": "95.0.4629.0", - "16.0.0-nightly.20210903": "95.0.4629.0", - "16.0.0-nightly.20210906": "95.0.4629.0", - "16.0.0-nightly.20210907": "95.0.4629.0", - "16.0.0-nightly.20210908": "95.0.4629.0", - "16.0.0-nightly.20210909": "95.0.4629.0", - "16.0.0-nightly.20210910": "95.0.4629.0", - "16.0.0-nightly.20210913": "95.0.4629.0", - "16.0.0-nightly.20210914": "95.0.4629.0", - "16.0.0-nightly.20210915": "95.0.4629.0", - "16.0.0-nightly.20210916": "95.0.4629.0", - "16.0.0-nightly.20210917": "95.0.4629.0", - "16.0.0-nightly.20210920": "95.0.4629.0", - "16.0.0-nightly.20210921": "95.0.4629.0", - "16.0.0-nightly.20210922": "95.0.4629.0", - "16.0.0": "96.0.4664.45", - "16.0.1": "96.0.4664.45", - "16.0.2": "96.0.4664.55", - "16.0.3": "96.0.4664.55", - "16.0.4": "96.0.4664.55", - "16.0.5": "96.0.4664.55", - "16.0.6": "96.0.4664.110", - "16.0.7": "96.0.4664.110", - "16.0.8": "96.0.4664.110", - "16.0.9": "96.0.4664.174", - "16.0.10": "96.0.4664.174", - "16.1.0": "96.0.4664.174", - "16.1.1": "96.0.4664.174", - "16.2.0": "96.0.4664.174", - "16.2.1": "96.0.4664.174", - "16.2.2": "96.0.4664.174", - "16.2.3": "96.0.4664.174", - "16.2.4": "96.0.4664.174", - "16.2.5": "96.0.4664.174", - "16.2.6": "96.0.4664.174", - "16.2.7": "96.0.4664.174", - "16.2.8": "96.0.4664.174", - "17.0.0-alpha.1": "96.0.4664.4", - "17.0.0-alpha.2": "96.0.4664.4", - "17.0.0-alpha.3": "96.0.4664.4", - "17.0.0-alpha.4": "98.0.4706.0", - "17.0.0-alpha.5": "98.0.4706.0", - "17.0.0-alpha.6": "98.0.4706.0", - "17.0.0-beta.1": "98.0.4706.0", - "17.0.0-beta.2": "98.0.4706.0", - "17.0.0-beta.3": "98.0.4758.9", - "17.0.0-beta.4": "98.0.4758.11", - "17.0.0-beta.5": "98.0.4758.11", - "17.0.0-beta.6": "98.0.4758.11", - "17.0.0-beta.7": "98.0.4758.11", - "17.0.0-beta.8": "98.0.4758.11", - "17.0.0-beta.9": "98.0.4758.11", - "17.0.0-nightly.20210923": "95.0.4629.0", - "17.0.0-nightly.20210924": "95.0.4629.0", - "17.0.0-nightly.20210927": "95.0.4629.0", - "17.0.0-nightly.20210928": "95.0.4629.0", - "17.0.0-nightly.20210929": "95.0.4629.0", - "17.0.0-nightly.20210930": "95.0.4629.0", - "17.0.0-nightly.20211001": "95.0.4629.0", - "17.0.0-nightly.20211004": "95.0.4629.0", - "17.0.0-nightly.20211005": "95.0.4629.0", - "17.0.0-nightly.20211006": "96.0.4647.0", - "17.0.0-nightly.20211007": "96.0.4647.0", - "17.0.0-nightly.20211008": "96.0.4647.0", - "17.0.0-nightly.20211011": "96.0.4647.0", - "17.0.0-nightly.20211012": "96.0.4647.0", - "17.0.0-nightly.20211013": "96.0.4647.0", - "17.0.0-nightly.20211014": "96.0.4647.0", - "17.0.0-nightly.20211015": "96.0.4647.0", - "17.0.0-nightly.20211018": "96.0.4647.0", - "17.0.0-nightly.20211019": "96.0.4647.0", - "17.0.0-nightly.20211020": "96.0.4647.0", - "17.0.0-nightly.20211021": "96.0.4647.0", - "17.0.0-nightly.20211022": "96.0.4664.4", - "17.0.0-nightly.20211025": "96.0.4664.4", - "17.0.0-nightly.20211026": "96.0.4664.4", - "17.0.0-nightly.20211027": "96.0.4664.4", - "17.0.0-nightly.20211028": "96.0.4664.4", - "17.0.0-nightly.20211029": "96.0.4664.4", - "17.0.0-nightly.20211101": "96.0.4664.4", - "17.0.0-nightly.20211102": "96.0.4664.4", - "17.0.0-nightly.20211103": "96.0.4664.4", - "17.0.0-nightly.20211104": "96.0.4664.4", - "17.0.0-nightly.20211105": "96.0.4664.4", - "17.0.0-nightly.20211108": "96.0.4664.4", - "17.0.0-nightly.20211109": "96.0.4664.4", - "17.0.0-nightly.20211110": "96.0.4664.4", - "17.0.0-nightly.20211111": "96.0.4664.4", - "17.0.0-nightly.20211112": "96.0.4664.4", - "17.0.0-nightly.20211115": "96.0.4664.4", - "17.0.0-nightly.20211116": "96.0.4664.4", - "17.0.0-nightly.20211117": "96.0.4664.4", - "17.0.0": "98.0.4758.74", - "17.0.1": "98.0.4758.82", - "17.1.0": "98.0.4758.102", - "17.1.1": "98.0.4758.109", - "17.1.2": "98.0.4758.109", - "17.2.0": "98.0.4758.109", - "17.3.0": "98.0.4758.141", - "17.3.1": "98.0.4758.141", - "17.4.0": "98.0.4758.141", - "17.4.1": "98.0.4758.141", - "17.4.2": "98.0.4758.141", - "17.4.3": "98.0.4758.141", - "17.4.4": "98.0.4758.141", - "17.4.5": "98.0.4758.141", - "17.4.6": "98.0.4758.141", - "17.4.7": "98.0.4758.141", - "17.4.8": "98.0.4758.141", - "17.4.9": "98.0.4758.141", - "17.4.10": "98.0.4758.141", - "17.4.11": "98.0.4758.141", - "18.0.0-alpha.1": "99.0.4767.0", - "18.0.0-alpha.2": "99.0.4767.0", - "18.0.0-alpha.3": "99.0.4767.0", - "18.0.0-alpha.4": "99.0.4767.0", - "18.0.0-alpha.5": "99.0.4767.0", - "18.0.0-beta.1": "100.0.4894.0", - "18.0.0-beta.2": "100.0.4894.0", - "18.0.0-beta.3": "100.0.4894.0", - "18.0.0-beta.4": "100.0.4894.0", - "18.0.0-beta.5": "100.0.4894.0", - "18.0.0-beta.6": "100.0.4894.0", - "18.0.0-nightly.20211118": "96.0.4664.4", - "18.0.0-nightly.20211119": "96.0.4664.4", - "18.0.0-nightly.20211122": "96.0.4664.4", - "18.0.0-nightly.20211123": "96.0.4664.4", - "18.0.0-nightly.20211124": "98.0.4706.0", - "18.0.0-nightly.20211125": "98.0.4706.0", - "18.0.0-nightly.20211126": "98.0.4706.0", - "18.0.0-nightly.20211129": "98.0.4706.0", - "18.0.0-nightly.20211130": "98.0.4706.0", - "18.0.0-nightly.20211201": "98.0.4706.0", - "18.0.0-nightly.20211202": "98.0.4706.0", - "18.0.0-nightly.20211203": "98.0.4706.0", - "18.0.0-nightly.20211206": "98.0.4706.0", - "18.0.0-nightly.20211207": "98.0.4706.0", - "18.0.0-nightly.20211208": "98.0.4706.0", - "18.0.0-nightly.20211209": "98.0.4706.0", - "18.0.0-nightly.20211210": "98.0.4706.0", - "18.0.0-nightly.20211213": "98.0.4706.0", - "18.0.0-nightly.20211214": "98.0.4706.0", - "18.0.0-nightly.20211215": "98.0.4706.0", - "18.0.0-nightly.20211216": "98.0.4706.0", - "18.0.0-nightly.20211217": "98.0.4706.0", - "18.0.0-nightly.20211220": "98.0.4706.0", - "18.0.0-nightly.20211221": "98.0.4706.0", - "18.0.0-nightly.20211222": "98.0.4706.0", - "18.0.0-nightly.20211223": "98.0.4706.0", - "18.0.0-nightly.20211228": "98.0.4706.0", - "18.0.0-nightly.20211229": "98.0.4706.0", - "18.0.0-nightly.20211231": "98.0.4706.0", - "18.0.0-nightly.20220103": "98.0.4706.0", - "18.0.0-nightly.20220104": "98.0.4706.0", - "18.0.0-nightly.20220105": "98.0.4706.0", - "18.0.0-nightly.20220106": "98.0.4706.0", - "18.0.0-nightly.20220107": "98.0.4706.0", - "18.0.0-nightly.20220110": "98.0.4706.0", - "18.0.0-nightly.20220111": "99.0.4767.0", - "18.0.0-nightly.20220112": "99.0.4767.0", - "18.0.0-nightly.20220113": "99.0.4767.0", - "18.0.0-nightly.20220114": "99.0.4767.0", - "18.0.0-nightly.20220117": "99.0.4767.0", - "18.0.0-nightly.20220118": "99.0.4767.0", - "18.0.0-nightly.20220119": "99.0.4767.0", - "18.0.0-nightly.20220121": "99.0.4767.0", - "18.0.0-nightly.20220124": "99.0.4767.0", - "18.0.0-nightly.20220125": "99.0.4767.0", - "18.0.0-nightly.20220127": "99.0.4767.0", - "18.0.0-nightly.20220128": "99.0.4767.0", - "18.0.0-nightly.20220131": "99.0.4767.0", - "18.0.0-nightly.20220201": "99.0.4767.0", - "18.0.0": "100.0.4896.56", - "18.0.1": "100.0.4896.60", - "18.0.2": "100.0.4896.60", - "18.0.3": "100.0.4896.75", - "18.0.4": "100.0.4896.75", - "18.1.0": "100.0.4896.127", - "18.2.0": "100.0.4896.143", - "18.2.1": "100.0.4896.143", - "18.2.2": "100.0.4896.143", - "18.2.3": "100.0.4896.143", - "18.2.4": "100.0.4896.160", - "18.3.0": "100.0.4896.160", - "18.3.1": "100.0.4896.160", - "18.3.2": "100.0.4896.160", - "18.3.3": "100.0.4896.160", - "18.3.4": "100.0.4896.160", - "18.3.5": "100.0.4896.160", - "18.3.6": "100.0.4896.160", - "18.3.7": "100.0.4896.160", - "18.3.8": "100.0.4896.160", - "18.3.9": "100.0.4896.160", - "18.3.11": "100.0.4896.160", - "18.3.12": "100.0.4896.160", - "18.3.13": "100.0.4896.160", - "18.3.14": "100.0.4896.160", - "18.3.15": "100.0.4896.160", - "19.0.0-alpha.1": "102.0.4962.3", - "19.0.0-alpha.2": "102.0.4971.0", - "19.0.0-alpha.3": "102.0.4971.0", - "19.0.0-alpha.4": "102.0.4989.0", - "19.0.0-alpha.5": "102.0.4989.0", - "19.0.0-beta.1": "102.0.4999.0", - "19.0.0-beta.2": "102.0.4999.0", - "19.0.0-beta.3": "102.0.4999.0", - "19.0.0-beta.4": "102.0.5005.27", - "19.0.0-beta.5": "102.0.5005.40", - "19.0.0-beta.6": "102.0.5005.40", - "19.0.0-beta.7": "102.0.5005.40", - "19.0.0-beta.8": "102.0.5005.49", - "19.0.0-nightly.20220202": "99.0.4767.0", - "19.0.0-nightly.20220203": "99.0.4767.0", - "19.0.0-nightly.20220204": "99.0.4767.0", - "19.0.0-nightly.20220207": "99.0.4767.0", - "19.0.0-nightly.20220208": "99.0.4767.0", - "19.0.0-nightly.20220209": "99.0.4767.0", - "19.0.0-nightly.20220308": "100.0.4894.0", - "19.0.0-nightly.20220309": "100.0.4894.0", - "19.0.0-nightly.20220310": "100.0.4894.0", - "19.0.0-nightly.20220311": "100.0.4894.0", - "19.0.0-nightly.20220314": "100.0.4894.0", - "19.0.0-nightly.20220315": "100.0.4894.0", - "19.0.0-nightly.20220316": "100.0.4894.0", - "19.0.0-nightly.20220317": "100.0.4894.0", - "19.0.0-nightly.20220318": "100.0.4894.0", - "19.0.0-nightly.20220321": "100.0.4894.0", - "19.0.0-nightly.20220322": "100.0.4894.0", - "19.0.0-nightly.20220323": "100.0.4894.0", - "19.0.0-nightly.20220324": "100.0.4894.0", - "19.0.0-nightly.20220325": "102.0.4961.0", - "19.0.0-nightly.20220328": "102.0.4962.3", - "19.0.0-nightly.20220329": "102.0.4962.3", - "19.0.0": "102.0.5005.61", - "19.0.1": "102.0.5005.61", - "19.0.2": "102.0.5005.63", - "19.0.3": "102.0.5005.63", - "19.0.4": "102.0.5005.63", - "19.0.5": "102.0.5005.115", - "19.0.6": "102.0.5005.115", - "19.0.7": "102.0.5005.134", - "19.0.8": "102.0.5005.148", - "19.0.9": "102.0.5005.167", - "19.0.10": "102.0.5005.167", - "19.0.11": "102.0.5005.167", - "19.0.12": "102.0.5005.167", - "19.0.13": "102.0.5005.167", - "19.0.14": "102.0.5005.167", - "19.0.15": "102.0.5005.167", - "19.0.16": "102.0.5005.167", - "19.0.17": "102.0.5005.167", - "19.1.0": "102.0.5005.167", - "19.1.1": "102.0.5005.167", - "19.1.2": "102.0.5005.167", - "19.1.3": "102.0.5005.167", - "19.1.4": "102.0.5005.167", - "19.1.5": "102.0.5005.167", - "19.1.6": "102.0.5005.167", - "19.1.7": "102.0.5005.167", - "19.1.8": "102.0.5005.167", - "19.1.9": "102.0.5005.167", - "20.0.0-alpha.1": "103.0.5044.0", - "20.0.0-alpha.2": "104.0.5073.0", - "20.0.0-alpha.3": "104.0.5073.0", - "20.0.0-alpha.4": "104.0.5073.0", - "20.0.0-alpha.5": "104.0.5073.0", - "20.0.0-alpha.6": "104.0.5073.0", - "20.0.0-alpha.7": "104.0.5073.0", - "20.0.0-beta.1": "104.0.5073.0", - "20.0.0-beta.2": "104.0.5073.0", - "20.0.0-beta.3": "104.0.5073.0", - "20.0.0-beta.4": "104.0.5073.0", - "20.0.0-beta.5": "104.0.5073.0", - "20.0.0-beta.6": "104.0.5073.0", - "20.0.0-beta.7": "104.0.5073.0", - "20.0.0-beta.8": "104.0.5073.0", - "20.0.0-beta.9": "104.0.5112.39", - "20.0.0-beta.10": "104.0.5112.48", - "20.0.0-beta.11": "104.0.5112.48", - "20.0.0-beta.12": "104.0.5112.48", - "20.0.0-beta.13": "104.0.5112.57", - "20.0.0-nightly.20220330": "102.0.4962.3", - "20.0.0-nightly.20220411": "102.0.4971.0", - "20.0.0-nightly.20220414": "102.0.4989.0", - "20.0.0-nightly.20220415": "102.0.4989.0", - "20.0.0-nightly.20220418": "102.0.4989.0", - "20.0.0-nightly.20220419": "102.0.4989.0", - "20.0.0-nightly.20220420": "102.0.4989.0", - "20.0.0-nightly.20220421": "102.0.4989.0", - "20.0.0-nightly.20220425": "102.0.4999.0", - "20.0.0-nightly.20220426": "102.0.4999.0", - "20.0.0-nightly.20220427": "102.0.4999.0", - "20.0.0-nightly.20220428": "102.0.4999.0", - "20.0.0-nightly.20220429": "102.0.4999.0", - "20.0.0-nightly.20220502": "102.0.4999.0", - "20.0.0-nightly.20220503": "102.0.4999.0", - "20.0.0-nightly.20220504": "102.0.4999.0", - "20.0.0-nightly.20220505": "102.0.4999.0", - "20.0.0-nightly.20220506": "102.0.4999.0", - "20.0.0-nightly.20220509": "102.0.4999.0", - "20.0.0-nightly.20220511": "102.0.4999.0", - "20.0.0-nightly.20220512": "102.0.4999.0", - "20.0.0-nightly.20220513": "102.0.4999.0", - "20.0.0-nightly.20220516": "102.0.4999.0", - "20.0.0-nightly.20220517": "102.0.4999.0", - "20.0.0-nightly.20220518": "103.0.5044.0", - "20.0.0-nightly.20220519": "103.0.5044.0", - "20.0.0-nightly.20220520": "103.0.5044.0", - "20.0.0-nightly.20220523": "103.0.5044.0", - "20.0.0-nightly.20220524": "103.0.5044.0", - "20.0.0": "104.0.5112.65", - "20.0.1": "104.0.5112.81", - "20.0.2": "104.0.5112.81", - "20.0.3": "104.0.5112.81", - "20.1.0": "104.0.5112.102", - "20.1.1": "104.0.5112.102", - "20.1.2": "104.0.5112.114", - "20.1.3": "104.0.5112.114", - "20.1.4": "104.0.5112.114", - "20.2.0": "104.0.5112.124", - "20.3.0": "104.0.5112.124", - "20.3.1": "104.0.5112.124", - "20.3.2": "104.0.5112.124", - "20.3.3": "104.0.5112.124", - "20.3.4": "104.0.5112.124", - "20.3.5": "104.0.5112.124", - "20.3.6": "104.0.5112.124", - "20.3.7": "104.0.5112.124", - "20.3.8": "104.0.5112.124", - "20.3.9": "104.0.5112.124", - "20.3.10": "104.0.5112.124", - "20.3.11": "104.0.5112.124", - "20.3.12": "104.0.5112.124", - "21.0.0-alpha.1": "105.0.5187.0", - "21.0.0-alpha.2": "105.0.5187.0", - "21.0.0-alpha.3": "105.0.5187.0", - "21.0.0-alpha.4": "105.0.5187.0", - "21.0.0-alpha.5": "105.0.5187.0", - "21.0.0-alpha.6": "106.0.5216.0", - "21.0.0-beta.1": "106.0.5216.0", - "21.0.0-beta.2": "106.0.5216.0", - "21.0.0-beta.3": "106.0.5216.0", - "21.0.0-beta.4": "106.0.5216.0", - "21.0.0-beta.5": "106.0.5216.0", - "21.0.0-beta.6": "106.0.5249.40", - "21.0.0-beta.7": "106.0.5249.40", - "21.0.0-beta.8": "106.0.5249.40", - "21.0.0-nightly.20220526": "103.0.5044.0", - "21.0.0-nightly.20220527": "103.0.5044.0", - "21.0.0-nightly.20220530": "103.0.5044.0", - "21.0.0-nightly.20220531": "103.0.5044.0", - "21.0.0-nightly.20220602": "104.0.5073.0", - "21.0.0-nightly.20220603": "104.0.5073.0", - "21.0.0-nightly.20220606": "104.0.5073.0", - "21.0.0-nightly.20220607": "104.0.5073.0", - "21.0.0-nightly.20220608": "104.0.5073.0", - "21.0.0-nightly.20220609": "104.0.5073.0", - "21.0.0-nightly.20220610": "104.0.5073.0", - "21.0.0-nightly.20220613": "104.0.5073.0", - "21.0.0-nightly.20220614": "104.0.5073.0", - "21.0.0-nightly.20220615": "104.0.5073.0", - "21.0.0-nightly.20220616": "104.0.5073.0", - "21.0.0-nightly.20220617": "104.0.5073.0", - "21.0.0-nightly.20220620": "104.0.5073.0", - "21.0.0-nightly.20220621": "104.0.5073.0", - "21.0.0-nightly.20220622": "104.0.5073.0", - "21.0.0-nightly.20220623": "104.0.5073.0", - "21.0.0-nightly.20220624": "104.0.5073.0", - "21.0.0-nightly.20220627": "104.0.5073.0", - "21.0.0-nightly.20220628": "105.0.5129.0", - "21.0.0-nightly.20220629": "105.0.5129.0", - "21.0.0-nightly.20220630": "105.0.5129.0", - "21.0.0-nightly.20220701": "105.0.5129.0", - "21.0.0-nightly.20220704": "105.0.5129.0", - "21.0.0-nightly.20220705": "105.0.5129.0", - "21.0.0-nightly.20220706": "105.0.5129.0", - "21.0.0-nightly.20220707": "105.0.5129.0", - "21.0.0-nightly.20220708": "105.0.5129.0", - "21.0.0-nightly.20220711": "105.0.5129.0", - "21.0.0-nightly.20220712": "105.0.5129.0", - "21.0.0-nightly.20220713": "105.0.5129.0", - "21.0.0-nightly.20220715": "105.0.5173.0", - "21.0.0-nightly.20220718": "105.0.5173.0", - "21.0.0-nightly.20220719": "105.0.5173.0", - "21.0.0-nightly.20220720": "105.0.5187.0", - "21.0.0-nightly.20220721": "105.0.5187.0", - "21.0.0-nightly.20220722": "105.0.5187.0", - "21.0.0-nightly.20220725": "105.0.5187.0", - "21.0.0-nightly.20220726": "105.0.5187.0", - "21.0.0-nightly.20220727": "105.0.5187.0", - "21.0.0-nightly.20220728": "105.0.5187.0", - "21.0.0-nightly.20220801": "105.0.5187.0", - "21.0.0-nightly.20220802": "105.0.5187.0", - "21.0.0": "106.0.5249.51", - "21.0.1": "106.0.5249.61", - "21.1.0": "106.0.5249.91", - "21.1.1": "106.0.5249.103", - "21.2.0": "106.0.5249.119", - "21.2.1": "106.0.5249.165", - "21.2.2": "106.0.5249.168", - "21.2.3": "106.0.5249.168", - "21.3.0": "106.0.5249.181", - "21.3.1": "106.0.5249.181", - "21.3.3": "106.0.5249.199", - "21.3.4": "106.0.5249.199", - "21.3.5": "106.0.5249.199", - "21.4.0": "106.0.5249.199", - "21.4.1": "106.0.5249.199", - "21.4.2": "106.0.5249.199", - "21.4.3": "106.0.5249.199", - "21.4.4": "106.0.5249.199", - "22.0.0-alpha.1": "107.0.5286.0", - "22.0.0-alpha.3": "108.0.5329.0", - "22.0.0-alpha.4": "108.0.5329.0", - "22.0.0-alpha.5": "108.0.5329.0", - "22.0.0-alpha.6": "108.0.5329.0", - "22.0.0-alpha.7": "108.0.5355.0", - "22.0.0-alpha.8": "108.0.5359.10", - "22.0.0-beta.1": "108.0.5359.10", - "22.0.0-beta.2": "108.0.5359.10", - "22.0.0-beta.3": "108.0.5359.10", - "22.0.0-beta.4": "108.0.5359.29", - "22.0.0-beta.5": "108.0.5359.40", - "22.0.0-beta.6": "108.0.5359.40", - "22.0.0-beta.7": "108.0.5359.48", - "22.0.0-beta.8": "108.0.5359.48", - "22.0.0-nightly.20220808": "105.0.5187.0", - "22.0.0-nightly.20220809": "105.0.5187.0", - "22.0.0-nightly.20220810": "105.0.5187.0", - "22.0.0-nightly.20220811": "105.0.5187.0", - "22.0.0-nightly.20220812": "105.0.5187.0", - "22.0.0-nightly.20220815": "105.0.5187.0", - "22.0.0-nightly.20220816": "105.0.5187.0", - "22.0.0-nightly.20220817": "105.0.5187.0", - "22.0.0-nightly.20220822": "106.0.5216.0", - "22.0.0-nightly.20220823": "106.0.5216.0", - "22.0.0-nightly.20220824": "106.0.5216.0", - "22.0.0-nightly.20220825": "106.0.5216.0", - "22.0.0-nightly.20220829": "106.0.5216.0", - "22.0.0-nightly.20220830": "106.0.5216.0", - "22.0.0-nightly.20220831": "106.0.5216.0", - "22.0.0-nightly.20220901": "106.0.5216.0", - "22.0.0-nightly.20220902": "106.0.5216.0", - "22.0.0-nightly.20220905": "106.0.5216.0", - "22.0.0-nightly.20220908": "107.0.5274.0", - "22.0.0-nightly.20220909": "107.0.5286.0", - "22.0.0-nightly.20220912": "107.0.5286.0", - "22.0.0-nightly.20220913": "107.0.5286.0", - "22.0.0-nightly.20220914": "107.0.5286.0", - "22.0.0-nightly.20220915": "107.0.5286.0", - "22.0.0-nightly.20220916": "107.0.5286.0", - "22.0.0-nightly.20220919": "107.0.5286.0", - "22.0.0-nightly.20220920": "107.0.5286.0", - "22.0.0-nightly.20220921": "107.0.5286.0", - "22.0.0-nightly.20220922": "107.0.5286.0", - "22.0.0-nightly.20220923": "107.0.5286.0", - "22.0.0-nightly.20220926": "107.0.5286.0", - "22.0.0-nightly.20220927": "107.0.5286.0", - "22.0.0-nightly.20220928": "107.0.5286.0", - "22.0.0": "108.0.5359.62", - "22.0.1": "108.0.5359.125", - "22.0.2": "108.0.5359.179", - "22.0.3": "108.0.5359.179", - "22.1.0": "108.0.5359.179", - "22.2.0": "108.0.5359.215", - "22.2.1": "108.0.5359.215", - "22.3.0": "108.0.5359.215", - "22.3.1": "108.0.5359.215", - "22.3.2": "108.0.5359.215", - "22.3.3": "108.0.5359.215", - "22.3.4": "108.0.5359.215", - "22.3.5": "108.0.5359.215", - "22.3.6": "108.0.5359.215", - "22.3.7": "108.0.5359.215", - "22.3.8": "108.0.5359.215", - "22.3.9": "108.0.5359.215", - "22.3.10": "108.0.5359.215", - "22.3.11": "108.0.5359.215", - "22.3.12": "108.0.5359.215", - "22.3.13": "108.0.5359.215", - "22.3.14": "108.0.5359.215", - "22.3.15": "108.0.5359.215", - "22.3.16": "108.0.5359.215", - "22.3.17": "108.0.5359.215", - "22.3.18": "108.0.5359.215", - "22.3.20": "108.0.5359.215", - "22.3.21": "108.0.5359.215", - "22.3.22": "108.0.5359.215", - "22.3.23": "108.0.5359.215", - "22.3.24": "108.0.5359.215", - "22.3.25": "108.0.5359.215", - "22.3.26": "108.0.5359.215", - "22.3.27": "108.0.5359.215", - "23.0.0-alpha.1": "110.0.5415.0", - "23.0.0-alpha.2": "110.0.5451.0", - "23.0.0-alpha.3": "110.0.5451.0", - "23.0.0-beta.1": "110.0.5478.5", - "23.0.0-beta.2": "110.0.5478.5", - "23.0.0-beta.3": "110.0.5478.5", - "23.0.0-beta.4": "110.0.5481.30", - "23.0.0-beta.5": "110.0.5481.38", - "23.0.0-beta.6": "110.0.5481.52", - "23.0.0-beta.8": "110.0.5481.52", - "23.0.0-nightly.20220929": "107.0.5286.0", - "23.0.0-nightly.20220930": "107.0.5286.0", - "23.0.0-nightly.20221003": "107.0.5286.0", - "23.0.0-nightly.20221004": "108.0.5329.0", - "23.0.0-nightly.20221005": "108.0.5329.0", - "23.0.0-nightly.20221006": "108.0.5329.0", - "23.0.0-nightly.20221007": "108.0.5329.0", - "23.0.0-nightly.20221010": "108.0.5329.0", - "23.0.0-nightly.20221011": "108.0.5329.0", - "23.0.0-nightly.20221012": "108.0.5329.0", - "23.0.0-nightly.20221013": "108.0.5329.0", - "23.0.0-nightly.20221014": "108.0.5329.0", - "23.0.0-nightly.20221017": "108.0.5329.0", - "23.0.0-nightly.20221018": "108.0.5355.0", - "23.0.0-nightly.20221019": "108.0.5355.0", - "23.0.0-nightly.20221020": "108.0.5355.0", - "23.0.0-nightly.20221021": "108.0.5355.0", - "23.0.0-nightly.20221024": "108.0.5355.0", - "23.0.0-nightly.20221026": "108.0.5355.0", - "23.0.0-nightly.20221027": "109.0.5382.0", - "23.0.0-nightly.20221028": "109.0.5382.0", - "23.0.0-nightly.20221031": "109.0.5382.0", - "23.0.0-nightly.20221101": "109.0.5382.0", - "23.0.0-nightly.20221102": "109.0.5382.0", - "23.0.0-nightly.20221103": "109.0.5382.0", - "23.0.0-nightly.20221104": "109.0.5382.0", - "23.0.0-nightly.20221107": "109.0.5382.0", - "23.0.0-nightly.20221108": "109.0.5382.0", - "23.0.0-nightly.20221109": "109.0.5382.0", - "23.0.0-nightly.20221110": "109.0.5382.0", - "23.0.0-nightly.20221111": "109.0.5382.0", - "23.0.0-nightly.20221114": "109.0.5382.0", - "23.0.0-nightly.20221115": "109.0.5382.0", - "23.0.0-nightly.20221116": "109.0.5382.0", - "23.0.0-nightly.20221117": "109.0.5382.0", - "23.0.0-nightly.20221118": "110.0.5415.0", - "23.0.0-nightly.20221121": "110.0.5415.0", - "23.0.0-nightly.20221122": "110.0.5415.0", - "23.0.0-nightly.20221123": "110.0.5415.0", - "23.0.0-nightly.20221124": "110.0.5415.0", - "23.0.0-nightly.20221125": "110.0.5415.0", - "23.0.0-nightly.20221128": "110.0.5415.0", - "23.0.0-nightly.20221129": "110.0.5415.0", - "23.0.0-nightly.20221130": "110.0.5415.0", - "23.0.0": "110.0.5481.77", - "23.1.0": "110.0.5481.100", - "23.1.1": "110.0.5481.104", - "23.1.2": "110.0.5481.177", - "23.1.3": "110.0.5481.179", - "23.1.4": "110.0.5481.192", - "23.2.0": "110.0.5481.192", - "23.2.1": "110.0.5481.208", - "23.2.2": "110.0.5481.208", - "23.2.3": "110.0.5481.208", - "23.2.4": "110.0.5481.208", - "23.3.0": "110.0.5481.208", - "23.3.1": "110.0.5481.208", - "23.3.2": "110.0.5481.208", - "23.3.3": "110.0.5481.208", - "23.3.4": "110.0.5481.208", - "23.3.5": "110.0.5481.208", - "23.3.6": "110.0.5481.208", - "23.3.7": "110.0.5481.208", - "23.3.8": "110.0.5481.208", - "23.3.9": "110.0.5481.208", - "23.3.10": "110.0.5481.208", - "23.3.11": "110.0.5481.208", - "23.3.12": "110.0.5481.208", - "23.3.13": "110.0.5481.208", - "24.0.0-alpha.1": "111.0.5560.0", - "24.0.0-alpha.2": "111.0.5560.0", - "24.0.0-alpha.3": "111.0.5560.0", - "24.0.0-alpha.4": "111.0.5560.0", - "24.0.0-alpha.5": "111.0.5560.0", - "24.0.0-alpha.6": "111.0.5560.0", - "24.0.0-alpha.7": "111.0.5560.0", - "24.0.0-beta.1": "111.0.5563.50", - "24.0.0-beta.2": "111.0.5563.50", - "24.0.0-beta.3": "112.0.5615.20", - "24.0.0-beta.4": "112.0.5615.20", - "24.0.0-beta.5": "112.0.5615.29", - "24.0.0-beta.6": "112.0.5615.39", - "24.0.0-beta.7": "112.0.5615.39", - "24.0.0-nightly.20221201": "110.0.5415.0", - "24.0.0-nightly.20221202": "110.0.5415.0", - "24.0.0-nightly.20221205": "110.0.5415.0", - "24.0.0-nightly.20221206": "110.0.5451.0", - "24.0.0-nightly.20221207": "110.0.5451.0", - "24.0.0-nightly.20221208": "110.0.5451.0", - "24.0.0-nightly.20221213": "110.0.5451.0", - "24.0.0-nightly.20221214": "110.0.5451.0", - "24.0.0-nightly.20221215": "110.0.5451.0", - "24.0.0-nightly.20221216": "110.0.5451.0", - "24.0.0-nightly.20230109": "111.0.5518.0", - "24.0.0-nightly.20230110": "111.0.5518.0", - "24.0.0-nightly.20230111": "111.0.5518.0", - "24.0.0-nightly.20230112": "111.0.5518.0", - "24.0.0-nightly.20230113": "111.0.5518.0", - "24.0.0-nightly.20230116": "111.0.5518.0", - "24.0.0-nightly.20230117": "111.0.5518.0", - "24.0.0-nightly.20230118": "111.0.5518.0", - "24.0.0-nightly.20230119": "111.0.5518.0", - "24.0.0-nightly.20230120": "111.0.5518.0", - "24.0.0-nightly.20230123": "111.0.5518.0", - "24.0.0-nightly.20230124": "111.0.5518.0", - "24.0.0-nightly.20230125": "111.0.5518.0", - "24.0.0-nightly.20230126": "111.0.5518.0", - "24.0.0-nightly.20230127": "111.0.5518.0", - "24.0.0-nightly.20230131": "111.0.5518.0", - "24.0.0-nightly.20230201": "111.0.5518.0", - "24.0.0-nightly.20230202": "111.0.5518.0", - "24.0.0-nightly.20230203": "111.0.5560.0", - "24.0.0-nightly.20230206": "111.0.5560.0", - "24.0.0-nightly.20230207": "111.0.5560.0", - "24.0.0-nightly.20230208": "111.0.5560.0", - "24.0.0-nightly.20230209": "111.0.5560.0", - "24.0.0": "112.0.5615.49", - "24.1.0": "112.0.5615.50", - "24.1.1": "112.0.5615.50", - "24.1.2": "112.0.5615.87", - "24.1.3": "112.0.5615.165", - "24.2.0": "112.0.5615.165", - "24.3.0": "112.0.5615.165", - "24.3.1": "112.0.5615.183", - "24.4.0": "112.0.5615.204", - "24.4.1": "112.0.5615.204", - "24.5.0": "112.0.5615.204", - "24.5.1": "112.0.5615.204", - "24.6.0": "112.0.5615.204", - "24.6.1": "112.0.5615.204", - "24.6.2": "112.0.5615.204", - "24.6.3": "112.0.5615.204", - "24.6.4": "112.0.5615.204", - "24.6.5": "112.0.5615.204", - "24.7.0": "112.0.5615.204", - "24.7.1": "112.0.5615.204", - "24.8.0": "112.0.5615.204", - "24.8.1": "112.0.5615.204", - "24.8.2": "112.0.5615.204", - "24.8.3": "112.0.5615.204", - "24.8.4": "112.0.5615.204", - "24.8.5": "112.0.5615.204", - "24.8.6": "112.0.5615.204", - "24.8.7": "112.0.5615.204", - "24.8.8": "112.0.5615.204", - "25.0.0-alpha.1": "114.0.5694.0", - "25.0.0-alpha.2": "114.0.5694.0", - "25.0.0-alpha.3": "114.0.5710.0", - "25.0.0-alpha.4": "114.0.5710.0", - "25.0.0-alpha.5": "114.0.5719.0", - "25.0.0-alpha.6": "114.0.5719.0", - "25.0.0-beta.1": "114.0.5719.0", - "25.0.0-beta.2": "114.0.5719.0", - "25.0.0-beta.3": "114.0.5719.0", - "25.0.0-beta.4": "114.0.5735.16", - "25.0.0-beta.5": "114.0.5735.16", - "25.0.0-beta.6": "114.0.5735.16", - "25.0.0-beta.7": "114.0.5735.16", - "25.0.0-beta.8": "114.0.5735.35", - "25.0.0-beta.9": "114.0.5735.45", - "25.0.0-nightly.20230210": "111.0.5560.0", - "25.0.0-nightly.20230214": "111.0.5560.0", - "25.0.0-nightly.20230215": "111.0.5560.0", - "25.0.0-nightly.20230216": "111.0.5560.0", - "25.0.0-nightly.20230217": "111.0.5560.0", - "25.0.0-nightly.20230220": "111.0.5560.0", - "25.0.0-nightly.20230221": "111.0.5560.0", - "25.0.0-nightly.20230222": "111.0.5560.0", - "25.0.0-nightly.20230223": "111.0.5560.0", - "25.0.0-nightly.20230224": "111.0.5560.0", - "25.0.0-nightly.20230227": "111.0.5560.0", - "25.0.0-nightly.20230228": "111.0.5560.0", - "25.0.0-nightly.20230301": "111.0.5560.0", - "25.0.0-nightly.20230302": "111.0.5560.0", - "25.0.0-nightly.20230303": "111.0.5560.0", - "25.0.0-nightly.20230306": "111.0.5560.0", - "25.0.0-nightly.20230307": "111.0.5560.0", - "25.0.0-nightly.20230308": "111.0.5560.0", - "25.0.0-nightly.20230309": "111.0.5560.0", - "25.0.0-nightly.20230310": "111.0.5560.0", - "25.0.0-nightly.20230314": "113.0.5636.0", - "25.0.0-nightly.20230315": "113.0.5651.0", - "25.0.0-nightly.20230317": "113.0.5653.0", - "25.0.0-nightly.20230320": "113.0.5660.0", - "25.0.0-nightly.20230321": "113.0.5664.0", - "25.0.0-nightly.20230322": "113.0.5666.0", - "25.0.0-nightly.20230323": "113.0.5668.0", - "25.0.0-nightly.20230324": "113.0.5670.0", - "25.0.0-nightly.20230327": "113.0.5670.0", - "25.0.0-nightly.20230328": "113.0.5670.0", - "25.0.0-nightly.20230329": "113.0.5670.0", - "25.0.0-nightly.20230330": "113.0.5670.0", - "25.0.0-nightly.20230331": "114.0.5684.0", - "25.0.0-nightly.20230403": "114.0.5684.0", - "25.0.0-nightly.20230404": "114.0.5692.0", - "25.0.0-nightly.20230405": "114.0.5694.0", - "25.0.0": "114.0.5735.45", - "25.0.1": "114.0.5735.45", - "25.1.0": "114.0.5735.106", - "25.1.1": "114.0.5735.106", - "25.2.0": "114.0.5735.134", - "25.3.0": "114.0.5735.199", - "25.3.1": "114.0.5735.243", - "25.3.2": "114.0.5735.248", - "25.4.0": "114.0.5735.248", - "25.5.0": "114.0.5735.289", - "25.6.0": "114.0.5735.289", - "25.7.0": "114.0.5735.289", - "25.8.0": "114.0.5735.289", - "25.8.1": "114.0.5735.289", - "25.8.2": "114.0.5735.289", - "25.8.3": "114.0.5735.289", - "25.8.4": "114.0.5735.289", - "25.9.0": "114.0.5735.289", - "25.9.1": "114.0.5735.289", - "25.9.2": "114.0.5735.289", - "25.9.3": "114.0.5735.289", - "25.9.4": "114.0.5735.289", - "25.9.5": "114.0.5735.289", - "25.9.6": "114.0.5735.289", - "25.9.7": "114.0.5735.289", - "25.9.8": "114.0.5735.289", - "26.0.0-alpha.1": "116.0.5791.0", - "26.0.0-alpha.2": "116.0.5791.0", - "26.0.0-alpha.3": "116.0.5791.0", - "26.0.0-alpha.4": "116.0.5791.0", - "26.0.0-alpha.5": "116.0.5791.0", - "26.0.0-alpha.6": "116.0.5815.0", - "26.0.0-alpha.7": "116.0.5831.0", - "26.0.0-alpha.8": "116.0.5845.0", - "26.0.0-beta.1": "116.0.5845.0", - "26.0.0-beta.2": "116.0.5845.14", - "26.0.0-beta.3": "116.0.5845.14", - "26.0.0-beta.4": "116.0.5845.14", - "26.0.0-beta.5": "116.0.5845.14", - "26.0.0-beta.6": "116.0.5845.14", - "26.0.0-beta.7": "116.0.5845.14", - "26.0.0-beta.8": "116.0.5845.42", - "26.0.0-beta.9": "116.0.5845.42", - "26.0.0-beta.10": "116.0.5845.49", - "26.0.0-beta.11": "116.0.5845.49", - "26.0.0-beta.12": "116.0.5845.62", - "26.0.0-nightly.20230406": "114.0.5694.0", - "26.0.0-nightly.20230407": "114.0.5694.0", - "26.0.0-nightly.20230410": "114.0.5694.0", - "26.0.0-nightly.20230411": "114.0.5694.0", - "26.0.0-nightly.20230412": "114.0.5708.0", - "26.0.0-nightly.20230413": "114.0.5710.0", - "26.0.0-nightly.20230414": "114.0.5710.0", - "26.0.0-nightly.20230417": "114.0.5710.0", - "26.0.0-nightly.20230418": "114.0.5715.0", - "26.0.0-nightly.20230421": "114.0.5719.0", - "26.0.0-nightly.20230424": "114.0.5719.0", - "26.0.0-nightly.20230425": "114.0.5719.0", - "26.0.0-nightly.20230426": "114.0.5719.0", - "26.0.0-nightly.20230427": "114.0.5719.0", - "26.0.0-nightly.20230428": "114.0.5719.0", - "26.0.0-nightly.20230501": "114.0.5719.0", - "26.0.0-nightly.20230502": "114.0.5719.0", - "26.0.0-nightly.20230503": "114.0.5719.0", - "26.0.0-nightly.20230504": "114.0.5719.0", - "26.0.0-nightly.20230505": "114.0.5719.0", - "26.0.0-nightly.20230508": "114.0.5719.0", - "26.0.0-nightly.20230509": "114.0.5719.0", - "26.0.0-nightly.20230510": "114.0.5719.0", - "26.0.0-nightly.20230511": "115.0.5760.0", - "26.0.0-nightly.20230512": "115.0.5760.0", - "26.0.0-nightly.20230515": "115.0.5760.0", - "26.0.0-nightly.20230516": "115.0.5760.0", - "26.0.0-nightly.20230517": "115.0.5760.0", - "26.0.0-nightly.20230518": "115.0.5760.0", - "26.0.0-nightly.20230519": "115.0.5760.0", - "26.0.0-nightly.20230522": "115.0.5760.0", - "26.0.0-nightly.20230523": "115.0.5760.0", - "26.0.0-nightly.20230524": "115.0.5786.0", - "26.0.0-nightly.20230525": "115.0.5790.0", - "26.0.0-nightly.20230526": "116.0.5791.0", - "26.0.0-nightly.20230529": "116.0.5791.0", - "26.0.0-nightly.20230530": "116.0.5791.0", - "26.0.0-nightly.20230531": "116.0.5791.0", - "26.0.0": "116.0.5845.82", - "26.1.0": "116.0.5845.97", - "26.2.0": "116.0.5845.179", - "26.2.1": "116.0.5845.188", - "26.2.2": "116.0.5845.190", - "26.2.3": "116.0.5845.190", - "26.2.4": "116.0.5845.190", - "26.3.0": "116.0.5845.228", - "26.4.0": "116.0.5845.228", - "26.4.1": "116.0.5845.228", - "26.4.2": "116.0.5845.228", - "26.4.3": "116.0.5845.228", - "26.5.0": "116.0.5845.228", - "26.6.0": "116.0.5845.228", - "26.6.1": "116.0.5845.228", - "26.6.2": "116.0.5845.228", - "26.6.3": "116.0.5845.228", - "26.6.4": "116.0.5845.228", - "26.6.5": "116.0.5845.228", - "26.6.6": "116.0.5845.228", - "26.6.7": "116.0.5845.228", - "26.6.8": "116.0.5845.228", - "27.0.0-alpha.1": "118.0.5949.0", - "27.0.0-alpha.2": "118.0.5949.0", - "27.0.0-alpha.3": "118.0.5949.0", - "27.0.0-alpha.4": "118.0.5949.0", - "27.0.0-alpha.5": "118.0.5949.0", - "27.0.0-alpha.6": "118.0.5949.0", - "27.0.0-beta.1": "118.0.5993.5", - "27.0.0-beta.2": "118.0.5993.5", - "27.0.0-beta.3": "118.0.5993.5", - "27.0.0-beta.4": "118.0.5993.11", - "27.0.0-beta.5": "118.0.5993.18", - "27.0.0-beta.6": "118.0.5993.18", - "27.0.0-beta.7": "118.0.5993.18", - "27.0.0-beta.8": "118.0.5993.18", - "27.0.0-beta.9": "118.0.5993.18", - "27.0.0-nightly.20230601": "116.0.5791.0", - "27.0.0-nightly.20230602": "116.0.5791.0", - "27.0.0-nightly.20230605": "116.0.5791.0", - "27.0.0-nightly.20230606": "116.0.5791.0", - "27.0.0-nightly.20230607": "116.0.5791.0", - "27.0.0-nightly.20230609": "116.0.5791.0", - "27.0.0-nightly.20230612": "116.0.5815.0", - "27.0.0-nightly.20230613": "116.0.5815.0", - "27.0.0-nightly.20230614": "116.0.5829.0", - "27.0.0-nightly.20230615": "116.0.5831.0", - "27.0.0-nightly.20230616": "116.0.5833.0", - "27.0.0-nightly.20230619": "116.0.5833.0", - "27.0.0-nightly.20230620": "116.0.5833.0", - "27.0.0-nightly.20230621": "116.0.5833.0", - "27.0.0-nightly.20230622": "116.0.5845.0", - "27.0.0-nightly.20230623": "116.0.5845.0", - "27.0.0-nightly.20230626": "116.0.5845.0", - "27.0.0-nightly.20230627": "116.0.5845.0", - "27.0.0-nightly.20230628": "116.0.5845.0", - "27.0.0-nightly.20230629": "116.0.5845.0", - "27.0.0-nightly.20230630": "116.0.5845.0", - "27.0.0-nightly.20230703": "117.0.5852.0", - "27.0.0-nightly.20230704": "117.0.5852.0", - "27.0.0-nightly.20230705": "117.0.5852.0", - "27.0.0-nightly.20230706": "117.0.5852.0", - "27.0.0-nightly.20230707": "117.0.5852.0", - "27.0.0-nightly.20230710": "117.0.5852.0", - "27.0.0-nightly.20230711": "117.0.5852.0", - "27.0.0-nightly.20230712": "117.0.5852.0", - "27.0.0-nightly.20230713": "117.0.5852.0", - "27.0.0-nightly.20230714": "117.0.5852.0", - "27.0.0-nightly.20230717": "117.0.5884.1", - "27.0.0-nightly.20230718": "117.0.5884.1", - "27.0.0-nightly.20230719": "117.0.5892.0", - "27.0.0-nightly.20230720": "117.0.5897.0", - "27.0.0-nightly.20230721": "117.0.5897.0", - "27.0.0-nightly.20230724": "117.0.5897.0", - "27.0.0-nightly.20230725": "117.0.5897.0", - "27.0.0-nightly.20230726": "117.0.5897.0", - "27.0.0-nightly.20230727": "117.0.5897.0", - "27.0.0-nightly.20230728": "117.0.5897.0", - "27.0.0-nightly.20230731": "117.0.5897.0", - "27.0.0-nightly.20230801": "117.0.5911.0", - "27.0.0-nightly.20230802": "117.0.5911.0", - "27.0.0-nightly.20230803": "117.0.5911.0", - "27.0.0-nightly.20230804": "117.0.5921.0", - "27.0.0-nightly.20230807": "117.0.5921.0", - "27.0.0-nightly.20230808": "117.0.5921.0", - "27.0.0-nightly.20230814": "117.0.5921.0", - "27.0.0-nightly.20230815": "117.0.5921.0", - "27.0.0-nightly.20230816": "118.0.5949.0", - "27.0.0": "118.0.5993.54", - "27.0.1": "118.0.5993.89", - "27.0.2": "118.0.5993.89", - "27.0.3": "118.0.5993.120", - "27.0.4": "118.0.5993.129", - "27.1.0": "118.0.5993.144", - "27.1.2": "118.0.5993.144", - "27.1.3": "118.0.5993.159", - "27.2.0": "118.0.5993.159", - "27.2.1": "118.0.5993.159", - "27.2.2": "118.0.5993.159", - "27.2.3": "118.0.5993.159", - "27.2.4": "118.0.5993.159", - "27.3.0": "118.0.5993.159", - "27.3.1": "118.0.5993.159", - "28.0.0-alpha.1": "119.0.6045.0", - "28.0.0-alpha.2": "119.0.6045.0", - "28.0.0-alpha.3": "119.0.6045.21", - "28.0.0-alpha.4": "119.0.6045.21", - "28.0.0-alpha.5": "119.0.6045.33", - "28.0.0-alpha.6": "119.0.6045.33", - "28.0.0-alpha.7": "119.0.6045.33", - "28.0.0-beta.1": "119.0.6045.33", - "28.0.0-beta.2": "120.0.6099.0", - "28.0.0-beta.3": "120.0.6099.5", - "28.0.0-beta.4": "120.0.6099.5", - "28.0.0-beta.5": "120.0.6099.18", - "28.0.0-beta.6": "120.0.6099.18", - "28.0.0-beta.7": "120.0.6099.18", - "28.0.0-beta.8": "120.0.6099.18", - "28.0.0-beta.9": "120.0.6099.18", - "28.0.0-beta.10": "120.0.6099.18", - "28.0.0-beta.11": "120.0.6099.35", - "28.0.0-nightly.20230817": "118.0.5949.0", - "28.0.0-nightly.20230818": "118.0.5949.0", - "28.0.0-nightly.20230821": "118.0.5949.0", - "28.0.0-nightly.20230822": "118.0.5949.0", - "28.0.0-nightly.20230823": "118.0.5949.0", - "28.0.0-nightly.20230824": "118.0.5949.0", - "28.0.0-nightly.20230825": "118.0.5949.0", - "28.0.0-nightly.20230828": "118.0.5949.0", - "28.0.0-nightly.20230829": "118.0.5949.0", - "28.0.0-nightly.20230830": "118.0.5949.0", - "28.0.0-nightly.20230831": "118.0.5949.0", - "28.0.0-nightly.20230906": "118.0.5991.0", - "28.0.0-nightly.20230907": "118.0.5993.0", - "28.0.0-nightly.20230908": "118.0.5993.0", - "28.0.0-nightly.20230911": "118.0.5993.0", - "28.0.0-nightly.20230912": "118.0.5993.0", - "28.0.0-nightly.20230913": "118.0.5993.0", - "28.0.0-nightly.20230914": "118.0.5993.0", - "28.0.0-nightly.20230915": "118.0.5993.0", - "28.0.0-nightly.20230919": "119.0.6006.0", - "28.0.0-nightly.20230920": "119.0.6017.0", - "28.0.0-nightly.20230921": "119.0.6019.2", - "28.0.0-nightly.20230925": "119.0.6019.2", - "28.0.0-nightly.20230926": "119.0.6019.2", - "28.0.0-nightly.20230927": "119.0.6019.2", - "28.0.0-nightly.20230928": "119.0.6019.2", - "28.0.0-nightly.20230929": "119.0.6029.0", - "28.0.0-nightly.20231002": "119.0.6029.0", - "28.0.0-nightly.20231003": "119.0.6043.0", - "28.0.0-nightly.20231004": "119.0.6043.0", - "28.0.0-nightly.20231005": "119.0.6043.0", - "28.0.0-nightly.20231006": "119.0.6045.0", - "28.0.0-nightly.20231009": "119.0.6045.0", - "28.0.0-nightly.20231010": "119.0.6045.0", - "28.0.0-nightly.20231011": "119.0.6045.0", - "28.0.0": "120.0.6099.56", - "28.1.0": "120.0.6099.109", - "28.1.1": "120.0.6099.109", - "28.1.2": "120.0.6099.199", - "28.1.3": "120.0.6099.199", - "28.1.4": "120.0.6099.216", - "28.2.0": "120.0.6099.227", - "28.2.1": "120.0.6099.268", - "29.0.0-alpha.1": "121.0.6147.0", - "29.0.0-alpha.2": "121.0.6147.0", - "29.0.0-alpha.3": "121.0.6147.0", - "29.0.0-alpha.4": "121.0.6159.0", - "29.0.0-alpha.5": "121.0.6159.0", - "29.0.0-alpha.6": "121.0.6159.0", - "29.0.0-alpha.7": "121.0.6159.0", - "29.0.0-alpha.8": "122.0.6194.0", - "29.0.0-alpha.9": "122.0.6236.2", - "29.0.0-alpha.10": "122.0.6236.2", - "29.0.0-alpha.11": "122.0.6236.2", - "29.0.0-beta.1": "122.0.6236.2", - "29.0.0-beta.2": "122.0.6236.2", - "29.0.0-beta.3": "122.0.6261.6", - "29.0.0-beta.4": "122.0.6261.6", - "29.0.0-beta.5": "122.0.6261.18", - "29.0.0-nightly.20231012": "119.0.6045.0", - "29.0.0-nightly.20231013": "119.0.6045.0", - "29.0.0-nightly.20231016": "119.0.6045.0", - "29.0.0-nightly.20231017": "119.0.6045.0", - "29.0.0-nightly.20231018": "119.0.6045.0", - "29.0.0-nightly.20231019": "119.0.6045.0", - "29.0.0-nightly.20231020": "119.0.6045.0", - "29.0.0-nightly.20231023": "119.0.6045.0", - "29.0.0-nightly.20231024": "119.0.6045.0", - "29.0.0-nightly.20231025": "120.0.6078.0", - "29.0.0-nightly.20231026": "120.0.6078.0", - "29.0.0-nightly.20231027": "120.0.6078.0", - "29.0.0-nightly.20231030": "120.0.6078.0", - "29.0.0-nightly.20231031": "120.0.6078.0", - "29.0.0-nightly.20231101": "120.0.6078.0", - "29.0.0-nightly.20231102": "121.0.6100.0", - "29.0.0-nightly.20231103": "121.0.6100.0", - "29.0.0-nightly.20231106": "121.0.6104.0", - "29.0.0-nightly.20231107": "121.0.6110.0", - "29.0.0-nightly.20231108": "121.0.6110.0", - "29.0.0-nightly.20231109": "121.0.6110.0", - "29.0.0-nightly.20231110": "121.0.6110.0", - "29.0.0-nightly.20231113": "121.0.6110.0", - "29.0.0-nightly.20231114": "121.0.6110.0", - "29.0.0-nightly.20231115": "121.0.6116.0", - "29.0.0-nightly.20231116": "121.0.6116.0", - "29.0.0-nightly.20231117": "121.0.6116.0", - "29.0.0-nightly.20231120": "121.0.6116.0", - "29.0.0-nightly.20231121": "121.0.6116.0", - "29.0.0-nightly.20231122": "121.0.6116.0", - "29.0.0-nightly.20231123": "121.0.6116.0", - "29.0.0-nightly.20231124": "121.0.6116.0", - "29.0.0-nightly.20231127": "121.0.6116.0", - "29.0.0-nightly.20231128": "121.0.6116.0", - "29.0.0-nightly.20231129": "121.0.6147.0", - "29.0.0-nightly.20231130": "121.0.6147.0", - "29.0.0-nightly.20231201": "121.0.6147.0", - "29.0.0-nightly.20231204": "121.0.6147.0", - "29.0.0-nightly.20231205": "121.0.6147.0", - "29.0.0-nightly.20231206": "121.0.6147.0", - "30.0.0-nightly.20231207": "121.0.6147.0", - "30.0.0-nightly.20231208": "121.0.6147.0", - "30.0.0-nightly.20231211": "121.0.6147.0", - "30.0.0-nightly.20231212": "121.0.6159.0", - "30.0.0-nightly.20231213": "121.0.6159.0", - "30.0.0-nightly.20231214": "121.0.6159.0", - "30.0.0-nightly.20231215": "121.0.6159.0", - "30.0.0-nightly.20231218": "121.0.6159.0", - "30.0.0-nightly.20240102": "121.0.6159.0", - "30.0.0-nightly.20240103": "122.0.6194.0", - "30.0.0-nightly.20240104": "122.0.6194.0", - "30.0.0-nightly.20240105": "122.0.6194.0", - "30.0.0-nightly.20240108": "122.0.6194.0", - "30.0.0-nightly.20240109": "122.0.6194.0", - "30.0.0-nightly.20240110": "122.0.6194.0", - "30.0.0-nightly.20240111": "122.0.6236.2", - "30.0.0-nightly.20240112": "122.0.6236.2", - "30.0.0-nightly.20240115": "122.0.6236.2", - "30.0.0-nightly.20240116": "122.0.6236.2", - "30.0.0-nightly.20240117": "122.0.6236.2", - "30.0.0-nightly.20240118": "122.0.6236.2", - "30.0.0-nightly.20240119": "122.0.6236.2", - "30.0.0-nightly.20240122": "122.0.6236.2", - "30.0.0-nightly.20240123": "122.0.6236.2", - "30.0.0-nightly.20240124": "122.0.6236.2", - "30.0.0-nightly.20240125": "122.0.6236.2", - "30.0.0-nightly.20240126": "123.0.6264.0", - "30.0.0-nightly.20240129": "123.0.6264.0", - "30.0.0-nightly.20240130": "123.0.6264.0", - "30.0.0-nightly.20240131": "123.0.6264.0", - "30.0.0-nightly.20240201": "123.0.6272.0", - "30.0.0-nightly.20240202": "123.0.6272.0", - "30.0.0-nightly.20240205": "123.0.6272.0" -}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-versions.json b/node_modules/electron-to-chromium/full-versions.json deleted file mode 100644 index 48010bd..0000000 --- a/node_modules/electron-to-chromium/full-versions.json +++ /dev/null @@ -1 +0,0 @@ -{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8-nightly.20180819":"61.0.3163.100","2.0.8-nightly.20180820":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0-nightly.20180818":"66.0.3359.181","3.0.0-nightly.20180821":"66.0.3359.181","3.0.0-nightly.20180823":"66.0.3359.181","3.0.0-nightly.20180904":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0-nightly.20180817":"66.0.3359.181","4.0.0-nightly.20180819":"66.0.3359.181","4.0.0-nightly.20180821":"66.0.3359.181","4.0.0-nightly.20180929":"67.0.3396.99","4.0.0-nightly.20181006":"68.0.3440.128","4.0.0-nightly.20181010":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0-nightly.20190107":"70.0.3538.110","5.0.0-nightly.20190121":"71.0.3578.98","5.0.0-nightly.20190122":"71.0.3578.98","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0-nightly.20190123":"72.0.3626.52","6.0.0-nightly.20190212":"72.0.3626.107","6.0.0-nightly.20190213":"72.0.3626.110","6.0.0-nightly.20190311":"74.0.3724.8","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0-nightly.20190521":"76.0.3784.0","7.0.0-nightly.20190529":"76.0.3806.0","7.0.0-nightly.20190530":"76.0.3806.0","7.0.0-nightly.20190531":"76.0.3806.0","7.0.0-nightly.20190602":"76.0.3806.0","7.0.0-nightly.20190603":"76.0.3806.0","7.0.0-nightly.20190604":"77.0.3814.0","7.0.0-nightly.20190605":"77.0.3815.0","7.0.0-nightly.20190606":"77.0.3815.0","7.0.0-nightly.20190607":"77.0.3815.0","7.0.0-nightly.20190608":"77.0.3815.0","7.0.0-nightly.20190609":"77.0.3815.0","7.0.0-nightly.20190611":"77.0.3815.0","7.0.0-nightly.20190612":"77.0.3815.0","7.0.0-nightly.20190613":"77.0.3815.0","7.0.0-nightly.20190615":"77.0.3815.0","7.0.0-nightly.20190616":"77.0.3815.0","7.0.0-nightly.20190618":"77.0.3815.0","7.0.0-nightly.20190619":"77.0.3815.0","7.0.0-nightly.20190622":"77.0.3815.0","7.0.0-nightly.20190623":"77.0.3815.0","7.0.0-nightly.20190624":"77.0.3815.0","7.0.0-nightly.20190627":"77.0.3815.0","7.0.0-nightly.20190629":"77.0.3815.0","7.0.0-nightly.20190630":"77.0.3815.0","7.0.0-nightly.20190701":"77.0.3815.0","7.0.0-nightly.20190702":"77.0.3815.0","7.0.0-nightly.20190704":"77.0.3843.0","7.0.0-nightly.20190705":"77.0.3843.0","7.0.0-nightly.20190719":"77.0.3848.0","7.0.0-nightly.20190720":"77.0.3848.0","7.0.0-nightly.20190721":"77.0.3848.0","7.0.0-nightly.20190726":"77.0.3864.0","7.0.0-nightly.20190727":"78.0.3866.0","7.0.0-nightly.20190728":"78.0.3866.0","7.0.0-nightly.20190729":"78.0.3866.0","7.0.0-nightly.20190730":"78.0.3866.0","7.0.0-nightly.20190731":"78.0.3866.0","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0-nightly.20190801":"78.0.3866.0","8.0.0-nightly.20190802":"78.0.3866.0","8.0.0-nightly.20190803":"78.0.3871.0","8.0.0-nightly.20190806":"78.0.3871.0","8.0.0-nightly.20190807":"78.0.3871.0","8.0.0-nightly.20190808":"78.0.3871.0","8.0.0-nightly.20190809":"78.0.3871.0","8.0.0-nightly.20190810":"78.0.3871.0","8.0.0-nightly.20190811":"78.0.3871.0","8.0.0-nightly.20190812":"78.0.3871.0","8.0.0-nightly.20190813":"78.0.3871.0","8.0.0-nightly.20190814":"78.0.3871.0","8.0.0-nightly.20190815":"78.0.3871.0","8.0.0-nightly.20190816":"78.0.3881.0","8.0.0-nightly.20190817":"78.0.3881.0","8.0.0-nightly.20190818":"78.0.3881.0","8.0.0-nightly.20190819":"78.0.3881.0","8.0.0-nightly.20190820":"78.0.3881.0","8.0.0-nightly.20190824":"78.0.3892.0","8.0.0-nightly.20190825":"78.0.3892.0","8.0.0-nightly.20190827":"78.0.3892.0","8.0.0-nightly.20190828":"78.0.3892.0","8.0.0-nightly.20190830":"78.0.3892.0","8.0.0-nightly.20190901":"78.0.3892.0","8.0.0-nightly.20190902":"78.0.3892.0","8.0.0-nightly.20190907":"78.0.3892.0","8.0.0-nightly.20190909":"78.0.3892.0","8.0.0-nightly.20190910":"78.0.3892.0","8.0.0-nightly.20190911":"78.0.3892.0","8.0.0-nightly.20190912":"78.0.3892.0","8.0.0-nightly.20190913":"78.0.3892.0","8.0.0-nightly.20190914":"78.0.3892.0","8.0.0-nightly.20190915":"78.0.3892.0","8.0.0-nightly.20190917":"78.0.3892.0","8.0.0-nightly.20190919":"79.0.3915.0","8.0.0-nightly.20190920":"79.0.3915.0","8.0.0-nightly.20190922":"79.0.3919.0","8.0.0-nightly.20190923":"79.0.3919.0","8.0.0-nightly.20190924":"79.0.3919.0","8.0.0-nightly.20190926":"79.0.3919.0","8.0.0-nightly.20190928":"79.0.3919.0","8.0.0-nightly.20190929":"79.0.3919.0","8.0.0-nightly.20190930":"79.0.3919.0","8.0.0-nightly.20191001":"79.0.3919.0","8.0.0-nightly.20191004":"79.0.3919.0","8.0.0-nightly.20191005":"79.0.3919.0","8.0.0-nightly.20191006":"79.0.3919.0","8.0.0-nightly.20191009":"79.0.3919.0","8.0.0-nightly.20191011":"79.0.3919.0","8.0.0-nightly.20191012":"79.0.3919.0","8.0.0-nightly.20191017":"79.0.3919.0","8.0.0-nightly.20191019":"79.0.3931.0","8.0.0-nightly.20191020":"79.0.3931.0","8.0.0-nightly.20191021":"79.0.3931.0","8.0.0-nightly.20191023":"79.0.3931.0","8.0.0-nightly.20191101":"80.0.3952.0","8.0.0-nightly.20191103":"80.0.3952.0","8.0.0-nightly.20191105":"80.0.3952.0","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.11":"82.0.4085.14","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0-nightly.20191121":"80.0.3954.0","9.0.0-nightly.20191122":"80.0.3954.0","9.0.0-nightly.20191123":"80.0.3954.0","9.0.0-nightly.20191124":"80.0.3954.0","9.0.0-nightly.20191126":"80.0.3954.0","9.0.0-nightly.20191128":"80.0.3954.0","9.0.0-nightly.20191129":"80.0.3954.0","9.0.0-nightly.20191130":"80.0.3954.0","9.0.0-nightly.20191201":"80.0.3954.0","9.0.0-nightly.20191202":"80.0.3954.0","9.0.0-nightly.20191203":"80.0.3954.0","9.0.0-nightly.20191204":"80.0.3954.0","9.0.0-nightly.20191205":"80.0.3954.0","9.0.0-nightly.20191210":"80.0.3954.0","9.0.0-nightly.20191220":"81.0.3994.0","9.0.0-nightly.20191221":"81.0.3994.0","9.0.0-nightly.20191222":"81.0.3994.0","9.0.0-nightly.20191223":"81.0.3994.0","9.0.0-nightly.20191224":"81.0.3994.0","9.0.0-nightly.20191225":"81.0.3994.0","9.0.0-nightly.20191226":"81.0.3994.0","9.0.0-nightly.20191228":"81.0.3994.0","9.0.0-nightly.20191229":"81.0.3994.0","9.0.0-nightly.20191230":"81.0.3994.0","9.0.0-nightly.20191231":"81.0.3994.0","9.0.0-nightly.20200101":"81.0.3994.0","9.0.0-nightly.20200103":"81.0.3994.0","9.0.0-nightly.20200104":"81.0.3994.0","9.0.0-nightly.20200105":"81.0.3994.0","9.0.0-nightly.20200106":"81.0.3994.0","9.0.0-nightly.20200108":"81.0.3994.0","9.0.0-nightly.20200109":"81.0.3994.0","9.0.0-nightly.20200110":"81.0.3994.0","9.0.0-nightly.20200111":"81.0.3994.0","9.0.0-nightly.20200113":"81.0.3994.0","9.0.0-nightly.20200115":"81.0.3994.0","9.0.0-nightly.20200116":"81.0.3994.0","9.0.0-nightly.20200117":"81.0.3994.0","9.0.0-nightly.20200119":"81.0.4030.0","9.0.0-nightly.20200121":"81.0.4030.0","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0-nightly.20200209":"82.0.4050.0","10.0.0-nightly.20200210":"82.0.4050.0","10.0.0-nightly.20200211":"82.0.4050.0","10.0.0-nightly.20200216":"82.0.4050.0","10.0.0-nightly.20200217":"82.0.4050.0","10.0.0-nightly.20200218":"82.0.4050.0","10.0.0-nightly.20200221":"82.0.4050.0","10.0.0-nightly.20200222":"82.0.4050.0","10.0.0-nightly.20200223":"82.0.4050.0","10.0.0-nightly.20200226":"82.0.4050.0","10.0.0-nightly.20200303":"82.0.4050.0","10.0.0-nightly.20200304":"82.0.4076.0","10.0.0-nightly.20200305":"82.0.4076.0","10.0.0-nightly.20200306":"82.0.4076.0","10.0.0-nightly.20200309":"82.0.4076.0","10.0.0-nightly.20200310":"82.0.4076.0","10.0.0-nightly.20200311":"82.0.4083.0","10.0.0-nightly.20200316":"83.0.4086.0","10.0.0-nightly.20200317":"83.0.4087.0","10.0.0-nightly.20200318":"83.0.4087.0","10.0.0-nightly.20200320":"83.0.4087.0","10.0.0-nightly.20200323":"83.0.4087.0","10.0.0-nightly.20200324":"83.0.4087.0","10.0.0-nightly.20200325":"83.0.4087.0","10.0.0-nightly.20200326":"83.0.4087.0","10.0.0-nightly.20200327":"83.0.4087.0","10.0.0-nightly.20200330":"83.0.4087.0","10.0.0-nightly.20200331":"83.0.4087.0","10.0.0-nightly.20200401":"83.0.4087.0","10.0.0-nightly.20200402":"83.0.4087.0","10.0.0-nightly.20200403":"83.0.4087.0","10.0.0-nightly.20200406":"83.0.4087.0","10.0.0-nightly.20200408":"83.0.4095.0","10.0.0-nightly.20200410":"83.0.4095.0","10.0.0-nightly.20200413":"83.0.4095.0","10.0.0-nightly.20200414":"84.0.4114.0","10.0.0-nightly.20200415":"84.0.4115.0","10.0.0-nightly.20200416":"84.0.4115.0","10.0.0-nightly.20200417":"84.0.4115.0","10.0.0-nightly.20200422":"84.0.4121.0","10.0.0-nightly.20200423":"84.0.4121.0","10.0.0-nightly.20200427":"84.0.4125.0","10.0.0-nightly.20200428":"84.0.4125.0","10.0.0-nightly.20200429":"84.0.4125.0","10.0.0-nightly.20200430":"84.0.4125.0","10.0.0-nightly.20200501":"84.0.4129.0","10.0.0-nightly.20200504":"84.0.4129.0","10.0.0-nightly.20200505":"84.0.4129.0","10.0.0-nightly.20200506":"84.0.4129.0","10.0.0-nightly.20200507":"84.0.4129.0","10.0.0-nightly.20200508":"84.0.4129.0","10.0.0-nightly.20200511":"84.0.4129.0","10.0.0-nightly.20200512":"84.0.4129.0","10.0.0-nightly.20200513":"84.0.4129.0","10.0.0-nightly.20200514":"84.0.4129.0","10.0.0-nightly.20200515":"84.0.4129.0","10.0.0-nightly.20200518":"84.0.4129.0","10.0.0-nightly.20200519":"84.0.4129.0","10.0.0-nightly.20200520":"84.0.4129.0","10.0.0-nightly.20200521":"84.0.4129.0","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0-nightly.20200525":"84.0.4129.0","11.0.0-nightly.20200526":"84.0.4129.0","11.0.0-nightly.20200529":"85.0.4156.0","11.0.0-nightly.20200602":"85.0.4162.0","11.0.0-nightly.20200603":"85.0.4162.0","11.0.0-nightly.20200604":"85.0.4162.0","11.0.0-nightly.20200609":"85.0.4162.0","11.0.0-nightly.20200610":"85.0.4162.0","11.0.0-nightly.20200611":"85.0.4162.0","11.0.0-nightly.20200615":"85.0.4162.0","11.0.0-nightly.20200616":"85.0.4162.0","11.0.0-nightly.20200617":"85.0.4162.0","11.0.0-nightly.20200618":"85.0.4162.0","11.0.0-nightly.20200619":"85.0.4162.0","11.0.0-nightly.20200701":"85.0.4179.0","11.0.0-nightly.20200702":"85.0.4179.0","11.0.0-nightly.20200703":"85.0.4179.0","11.0.0-nightly.20200706":"85.0.4179.0","11.0.0-nightly.20200707":"85.0.4179.0","11.0.0-nightly.20200708":"85.0.4179.0","11.0.0-nightly.20200709":"85.0.4179.0","11.0.0-nightly.20200716":"86.0.4203.0","11.0.0-nightly.20200717":"86.0.4203.0","11.0.0-nightly.20200720":"86.0.4203.0","11.0.0-nightly.20200721":"86.0.4203.0","11.0.0-nightly.20200723":"86.0.4209.0","11.0.0-nightly.20200724":"86.0.4209.0","11.0.0-nightly.20200729":"86.0.4209.0","11.0.0-nightly.20200730":"86.0.4209.0","11.0.0-nightly.20200731":"86.0.4209.0","11.0.0-nightly.20200803":"86.0.4209.0","11.0.0-nightly.20200804":"86.0.4209.0","11.0.0-nightly.20200805":"86.0.4209.0","11.0.0-nightly.20200811":"86.0.4209.0","11.0.0-nightly.20200812":"86.0.4209.0","11.0.0-nightly.20200822":"86.0.4234.0","11.0.0-nightly.20200824":"86.0.4234.0","11.0.0-nightly.20200825":"86.0.4234.0","11.0.0-nightly.20200826":"86.0.4234.0","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0-nightly.20200827":"86.0.4234.0","12.0.0-nightly.20200831":"86.0.4234.0","12.0.0-nightly.20200902":"86.0.4234.0","12.0.0-nightly.20200903":"86.0.4234.0","12.0.0-nightly.20200907":"86.0.4234.0","12.0.0-nightly.20200910":"86.0.4234.0","12.0.0-nightly.20200911":"86.0.4234.0","12.0.0-nightly.20200914":"86.0.4234.0","12.0.0-nightly.20201002":"87.0.4268.0","12.0.0-nightly.20201007":"87.0.4268.0","12.0.0-nightly.20201009":"87.0.4268.0","12.0.0-nightly.20201012":"87.0.4268.0","12.0.0-nightly.20201013":"87.0.4268.0","12.0.0-nightly.20201014":"87.0.4268.0","12.0.0-nightly.20201015":"87.0.4268.0","12.0.0-nightly.20201023":"88.0.4292.0","12.0.0-nightly.20201026":"88.0.4292.0","12.0.0-nightly.20201030":"88.0.4306.0","12.0.0-nightly.20201102":"88.0.4306.0","12.0.0-nightly.20201103":"88.0.4306.0","12.0.0-nightly.20201104":"88.0.4306.0","12.0.0-nightly.20201105":"88.0.4306.0","12.0.0-nightly.20201106":"88.0.4306.0","12.0.0-nightly.20201111":"88.0.4306.0","12.0.0-nightly.20201112":"88.0.4306.0","12.0.0-nightly.20201116":"88.0.4324.0","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.10":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.25":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0-nightly.20201119":"89.0.4328.0","13.0.0-nightly.20201123":"89.0.4328.0","13.0.0-nightly.20201124":"89.0.4328.0","13.0.0-nightly.20201126":"89.0.4328.0","13.0.0-nightly.20201127":"89.0.4328.0","13.0.0-nightly.20201130":"89.0.4328.0","13.0.0-nightly.20201201":"89.0.4328.0","13.0.0-nightly.20201202":"89.0.4328.0","13.0.0-nightly.20201203":"89.0.4328.0","13.0.0-nightly.20201204":"89.0.4328.0","13.0.0-nightly.20201207":"89.0.4328.0","13.0.0-nightly.20201208":"89.0.4328.0","13.0.0-nightly.20201209":"89.0.4328.0","13.0.0-nightly.20201210":"89.0.4328.0","13.0.0-nightly.20201211":"89.0.4328.0","13.0.0-nightly.20201214":"89.0.4328.0","13.0.0-nightly.20201215":"89.0.4349.0","13.0.0-nightly.20201216":"89.0.4349.0","13.0.0-nightly.20201221":"89.0.4349.0","13.0.0-nightly.20201222":"89.0.4349.0","13.0.0-nightly.20201223":"89.0.4359.0","13.0.0-nightly.20210104":"89.0.4359.0","13.0.0-nightly.20210108":"89.0.4359.0","13.0.0-nightly.20210111":"89.0.4359.0","13.0.0-nightly.20210113":"89.0.4386.0","13.0.0-nightly.20210114":"89.0.4386.0","13.0.0-nightly.20210118":"89.0.4386.0","13.0.0-nightly.20210122":"89.0.4386.0","13.0.0-nightly.20210125":"89.0.4386.0","13.0.0-nightly.20210127":"89.0.4389.0","13.0.0-nightly.20210128":"89.0.4389.0","13.0.0-nightly.20210129":"89.0.4389.0","13.0.0-nightly.20210201":"89.0.4389.0","13.0.0-nightly.20210202":"89.0.4389.0","13.0.0-nightly.20210203":"89.0.4389.0","13.0.0-nightly.20210205":"89.0.4389.0","13.0.0-nightly.20210208":"89.0.4389.0","13.0.0-nightly.20210209":"89.0.4389.0","13.0.0-nightly.20210210":"90.0.4402.0","13.0.0-nightly.20210211":"90.0.4402.0","13.0.0-nightly.20210212":"90.0.4402.0","13.0.0-nightly.20210216":"90.0.4402.0","13.0.0-nightly.20210217":"90.0.4402.0","13.0.0-nightly.20210218":"90.0.4402.0","13.0.0-nightly.20210219":"90.0.4402.0","13.0.0-nightly.20210222":"90.0.4402.0","13.0.0-nightly.20210225":"90.0.4402.0","13.0.0-nightly.20210226":"90.0.4402.0","13.0.0-nightly.20210301":"90.0.4402.0","13.0.0-nightly.20210302":"90.0.4402.0","13.0.0-nightly.20210303":"90.0.4402.0","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","13.6.3":"91.0.4472.164","13.6.6":"91.0.4472.164","13.6.7":"91.0.4472.164","13.6.8":"91.0.4472.164","13.6.9":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0-nightly.20210304":"90.0.4402.0","14.0.0-nightly.20210305":"90.0.4415.0","14.0.0-nightly.20210308":"90.0.4415.0","14.0.0-nightly.20210309":"90.0.4415.0","14.0.0-nightly.20210311":"90.0.4415.0","14.0.0-nightly.20210315":"90.0.4415.0","14.0.0-nightly.20210316":"90.0.4415.0","14.0.0-nightly.20210317":"90.0.4415.0","14.0.0-nightly.20210318":"90.0.4415.0","14.0.0-nightly.20210319":"90.0.4415.0","14.0.0-nightly.20210323":"90.0.4415.0","14.0.0-nightly.20210324":"90.0.4415.0","14.0.0-nightly.20210325":"90.0.4415.0","14.0.0-nightly.20210326":"90.0.4415.0","14.0.0-nightly.20210329":"90.0.4415.0","14.0.0-nightly.20210330":"90.0.4415.0","14.0.0-nightly.20210331":"91.0.4448.0","14.0.0-nightly.20210401":"91.0.4448.0","14.0.0-nightly.20210402":"91.0.4448.0","14.0.0-nightly.20210406":"91.0.4448.0","14.0.0-nightly.20210407":"91.0.4448.0","14.0.0-nightly.20210408":"91.0.4448.0","14.0.0-nightly.20210409":"91.0.4448.0","14.0.0-nightly.20210413":"91.0.4448.0","14.0.0-nightly.20210426":"92.0.4475.0","14.0.0-nightly.20210427":"92.0.4475.0","14.0.0-nightly.20210430":"92.0.4488.0","14.0.0-nightly.20210503":"92.0.4488.0","14.0.0-nightly.20210505":"92.0.4496.0","14.0.0-nightly.20210506":"92.0.4498.0","14.0.0-nightly.20210507":"92.0.4499.0","14.0.0-nightly.20210510":"92.0.4499.0","14.0.0-nightly.20210511":"92.0.4499.0","14.0.0-nightly.20210512":"92.0.4499.0","14.0.0-nightly.20210513":"92.0.4499.0","14.0.0-nightly.20210514":"92.0.4505.0","14.0.0-nightly.20210517":"92.0.4505.0","14.0.0-nightly.20210518":"92.0.4505.0","14.0.0-nightly.20210519":"92.0.4505.0","14.0.0-nightly.20210520":"92.0.4511.0","14.0.0-nightly.20210523":"92.0.4511.0","14.0.0-nightly.20210524":"92.0.4511.0","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","14.2.2":"93.0.4577.82","14.2.3":"93.0.4577.82","14.2.4":"93.0.4577.82","14.2.5":"93.0.4577.82","14.2.6":"93.0.4577.82","14.2.7":"93.0.4577.82","14.2.8":"93.0.4577.82","14.2.9":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0-nightly.20210527":"92.0.4511.0","15.0.0-nightly.20210528":"92.0.4511.0","15.0.0-nightly.20210531":"92.0.4511.0","15.0.0-nightly.20210601":"92.0.4511.0","15.0.0-nightly.20210602":"92.0.4511.0","15.0.0-nightly.20210603":"93.0.4530.0","15.0.0-nightly.20210604":"93.0.4530.0","15.0.0-nightly.20210608":"93.0.4535.0","15.0.0-nightly.20210609":"93.0.4536.0","15.0.0-nightly.20210610":"93.0.4536.0","15.0.0-nightly.20210611":"93.0.4536.0","15.0.0-nightly.20210614":"93.0.4536.0","15.0.0-nightly.20210615":"93.0.4536.0","15.0.0-nightly.20210616":"93.0.4536.0","15.0.0-nightly.20210617":"93.0.4539.0","15.0.0-nightly.20210618":"93.0.4539.0","15.0.0-nightly.20210621":"93.0.4539.0","15.0.0-nightly.20210622":"93.0.4539.0","15.0.0-nightly.20210623":"93.0.4550.0","15.0.0-nightly.20210624":"93.0.4550.0","15.0.0-nightly.20210625":"93.0.4552.0","15.0.0-nightly.20210628":"93.0.4552.0","15.0.0-nightly.20210629":"93.0.4552.0","15.0.0-nightly.20210630":"93.0.4558.0","15.0.0-nightly.20210701":"93.0.4558.0","15.0.0-nightly.20210702":"93.0.4558.0","15.0.0-nightly.20210705":"93.0.4558.0","15.0.0-nightly.20210706":"93.0.4566.0","15.0.0-nightly.20210707":"93.0.4566.0","15.0.0-nightly.20210708":"93.0.4566.0","15.0.0-nightly.20210709":"93.0.4566.0","15.0.0-nightly.20210712":"93.0.4566.0","15.0.0-nightly.20210713":"93.0.4566.0","15.0.0-nightly.20210714":"93.0.4566.0","15.0.0-nightly.20210715":"93.0.4566.0","15.0.0-nightly.20210716":"93.0.4566.0","15.0.0-nightly.20210719":"93.0.4566.0","15.0.0-nightly.20210720":"93.0.4566.0","15.0.0-nightly.20210721":"93.0.4566.0","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","15.3.3":"94.0.4606.81","15.3.4":"94.0.4606.81","15.3.5":"94.0.4606.81","15.3.6":"94.0.4606.81","15.3.7":"94.0.4606.81","15.4.0":"94.0.4606.81","15.4.1":"94.0.4606.81","15.4.2":"94.0.4606.81","15.5.0":"94.0.4606.81","15.5.1":"94.0.4606.81","15.5.2":"94.0.4606.81","15.5.3":"94.0.4606.81","15.5.4":"94.0.4606.81","15.5.5":"94.0.4606.81","15.5.6":"94.0.4606.81","15.5.7":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0-nightly.20210722":"93.0.4566.0","16.0.0-nightly.20210723":"93.0.4566.0","16.0.0-nightly.20210726":"93.0.4566.0","16.0.0-nightly.20210727":"94.0.4584.0","16.0.0-nightly.20210728":"94.0.4584.0","16.0.0-nightly.20210729":"94.0.4584.0","16.0.0-nightly.20210730":"94.0.4584.0","16.0.0-nightly.20210802":"94.0.4584.0","16.0.0-nightly.20210803":"94.0.4584.0","16.0.0-nightly.20210804":"94.0.4584.0","16.0.0-nightly.20210805":"94.0.4584.0","16.0.0-nightly.20210806":"94.0.4584.0","16.0.0-nightly.20210809":"94.0.4584.0","16.0.0-nightly.20210810":"94.0.4584.0","16.0.0-nightly.20210811":"94.0.4584.0","16.0.0-nightly.20210812":"94.0.4590.2","16.0.0-nightly.20210813":"94.0.4590.2","16.0.0-nightly.20210816":"94.0.4590.2","16.0.0-nightly.20210817":"94.0.4590.2","16.0.0-nightly.20210818":"94.0.4590.2","16.0.0-nightly.20210819":"94.0.4590.2","16.0.0-nightly.20210820":"94.0.4590.2","16.0.0-nightly.20210823":"94.0.4590.2","16.0.0-nightly.20210824":"95.0.4612.5","16.0.0-nightly.20210825":"95.0.4612.5","16.0.0-nightly.20210826":"95.0.4612.5","16.0.0-nightly.20210827":"95.0.4612.5","16.0.0-nightly.20210830":"95.0.4612.5","16.0.0-nightly.20210831":"95.0.4612.5","16.0.0-nightly.20210901":"95.0.4612.5","16.0.0-nightly.20210902":"95.0.4629.0","16.0.0-nightly.20210903":"95.0.4629.0","16.0.0-nightly.20210906":"95.0.4629.0","16.0.0-nightly.20210907":"95.0.4629.0","16.0.0-nightly.20210908":"95.0.4629.0","16.0.0-nightly.20210909":"95.0.4629.0","16.0.0-nightly.20210910":"95.0.4629.0","16.0.0-nightly.20210913":"95.0.4629.0","16.0.0-nightly.20210914":"95.0.4629.0","16.0.0-nightly.20210915":"95.0.4629.0","16.0.0-nightly.20210916":"95.0.4629.0","16.0.0-nightly.20210917":"95.0.4629.0","16.0.0-nightly.20210920":"95.0.4629.0","16.0.0-nightly.20210921":"95.0.4629.0","16.0.0-nightly.20210922":"95.0.4629.0","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","16.0.3":"96.0.4664.55","16.0.4":"96.0.4664.55","16.0.5":"96.0.4664.55","16.0.6":"96.0.4664.110","16.0.7":"96.0.4664.110","16.0.8":"96.0.4664.110","16.0.9":"96.0.4664.174","16.0.10":"96.0.4664.174","16.1.0":"96.0.4664.174","16.1.1":"96.0.4664.174","16.2.0":"96.0.4664.174","16.2.1":"96.0.4664.174","16.2.2":"96.0.4664.174","16.2.3":"96.0.4664.174","16.2.4":"96.0.4664.174","16.2.5":"96.0.4664.174","16.2.6":"96.0.4664.174","16.2.7":"96.0.4664.174","16.2.8":"96.0.4664.174","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-alpha.5":"98.0.4706.0","17.0.0-alpha.6":"98.0.4706.0","17.0.0-beta.1":"98.0.4706.0","17.0.0-beta.2":"98.0.4706.0","17.0.0-beta.3":"98.0.4758.9","17.0.0-beta.4":"98.0.4758.11","17.0.0-beta.5":"98.0.4758.11","17.0.0-beta.6":"98.0.4758.11","17.0.0-beta.7":"98.0.4758.11","17.0.0-beta.8":"98.0.4758.11","17.0.0-beta.9":"98.0.4758.11","17.0.0-nightly.20210923":"95.0.4629.0","17.0.0-nightly.20210924":"95.0.4629.0","17.0.0-nightly.20210927":"95.0.4629.0","17.0.0-nightly.20210928":"95.0.4629.0","17.0.0-nightly.20210929":"95.0.4629.0","17.0.0-nightly.20210930":"95.0.4629.0","17.0.0-nightly.20211001":"95.0.4629.0","17.0.0-nightly.20211004":"95.0.4629.0","17.0.0-nightly.20211005":"95.0.4629.0","17.0.0-nightly.20211006":"96.0.4647.0","17.0.0-nightly.20211007":"96.0.4647.0","17.0.0-nightly.20211008":"96.0.4647.0","17.0.0-nightly.20211011":"96.0.4647.0","17.0.0-nightly.20211012":"96.0.4647.0","17.0.0-nightly.20211013":"96.0.4647.0","17.0.0-nightly.20211014":"96.0.4647.0","17.0.0-nightly.20211015":"96.0.4647.0","17.0.0-nightly.20211018":"96.0.4647.0","17.0.0-nightly.20211019":"96.0.4647.0","17.0.0-nightly.20211020":"96.0.4647.0","17.0.0-nightly.20211021":"96.0.4647.0","17.0.0-nightly.20211022":"96.0.4664.4","17.0.0-nightly.20211025":"96.0.4664.4","17.0.0-nightly.20211026":"96.0.4664.4","17.0.0-nightly.20211027":"96.0.4664.4","17.0.0-nightly.20211028":"96.0.4664.4","17.0.0-nightly.20211029":"96.0.4664.4","17.0.0-nightly.20211101":"96.0.4664.4","17.0.0-nightly.20211102":"96.0.4664.4","17.0.0-nightly.20211103":"96.0.4664.4","17.0.0-nightly.20211104":"96.0.4664.4","17.0.0-nightly.20211105":"96.0.4664.4","17.0.0-nightly.20211108":"96.0.4664.4","17.0.0-nightly.20211109":"96.0.4664.4","17.0.0-nightly.20211110":"96.0.4664.4","17.0.0-nightly.20211111":"96.0.4664.4","17.0.0-nightly.20211112":"96.0.4664.4","17.0.0-nightly.20211115":"96.0.4664.4","17.0.0-nightly.20211116":"96.0.4664.4","17.0.0-nightly.20211117":"96.0.4664.4","17.0.0":"98.0.4758.74","17.0.1":"98.0.4758.82","17.1.0":"98.0.4758.102","17.1.1":"98.0.4758.109","17.1.2":"98.0.4758.109","17.2.0":"98.0.4758.109","17.3.0":"98.0.4758.141","17.3.1":"98.0.4758.141","17.4.0":"98.0.4758.141","17.4.1":"98.0.4758.141","17.4.2":"98.0.4758.141","17.4.3":"98.0.4758.141","17.4.4":"98.0.4758.141","17.4.5":"98.0.4758.141","17.4.6":"98.0.4758.141","17.4.7":"98.0.4758.141","17.4.8":"98.0.4758.141","17.4.9":"98.0.4758.141","17.4.10":"98.0.4758.141","17.4.11":"98.0.4758.141","18.0.0-alpha.1":"99.0.4767.0","18.0.0-alpha.2":"99.0.4767.0","18.0.0-alpha.3":"99.0.4767.0","18.0.0-alpha.4":"99.0.4767.0","18.0.0-alpha.5":"99.0.4767.0","18.0.0-beta.1":"100.0.4894.0","18.0.0-beta.2":"100.0.4894.0","18.0.0-beta.3":"100.0.4894.0","18.0.0-beta.4":"100.0.4894.0","18.0.0-beta.5":"100.0.4894.0","18.0.0-beta.6":"100.0.4894.0","18.0.0-nightly.20211118":"96.0.4664.4","18.0.0-nightly.20211119":"96.0.4664.4","18.0.0-nightly.20211122":"96.0.4664.4","18.0.0-nightly.20211123":"96.0.4664.4","18.0.0-nightly.20211124":"98.0.4706.0","18.0.0-nightly.20211125":"98.0.4706.0","18.0.0-nightly.20211126":"98.0.4706.0","18.0.0-nightly.20211129":"98.0.4706.0","18.0.0-nightly.20211130":"98.0.4706.0","18.0.0-nightly.20211201":"98.0.4706.0","18.0.0-nightly.20211202":"98.0.4706.0","18.0.0-nightly.20211203":"98.0.4706.0","18.0.0-nightly.20211206":"98.0.4706.0","18.0.0-nightly.20211207":"98.0.4706.0","18.0.0-nightly.20211208":"98.0.4706.0","18.0.0-nightly.20211209":"98.0.4706.0","18.0.0-nightly.20211210":"98.0.4706.0","18.0.0-nightly.20211213":"98.0.4706.0","18.0.0-nightly.20211214":"98.0.4706.0","18.0.0-nightly.20211215":"98.0.4706.0","18.0.0-nightly.20211216":"98.0.4706.0","18.0.0-nightly.20211217":"98.0.4706.0","18.0.0-nightly.20211220":"98.0.4706.0","18.0.0-nightly.20211221":"98.0.4706.0","18.0.0-nightly.20211222":"98.0.4706.0","18.0.0-nightly.20211223":"98.0.4706.0","18.0.0-nightly.20211228":"98.0.4706.0","18.0.0-nightly.20211229":"98.0.4706.0","18.0.0-nightly.20211231":"98.0.4706.0","18.0.0-nightly.20220103":"98.0.4706.0","18.0.0-nightly.20220104":"98.0.4706.0","18.0.0-nightly.20220105":"98.0.4706.0","18.0.0-nightly.20220106":"98.0.4706.0","18.0.0-nightly.20220107":"98.0.4706.0","18.0.0-nightly.20220110":"98.0.4706.0","18.0.0-nightly.20220111":"99.0.4767.0","18.0.0-nightly.20220112":"99.0.4767.0","18.0.0-nightly.20220113":"99.0.4767.0","18.0.0-nightly.20220114":"99.0.4767.0","18.0.0-nightly.20220117":"99.0.4767.0","18.0.0-nightly.20220118":"99.0.4767.0","18.0.0-nightly.20220119":"99.0.4767.0","18.0.0-nightly.20220121":"99.0.4767.0","18.0.0-nightly.20220124":"99.0.4767.0","18.0.0-nightly.20220125":"99.0.4767.0","18.0.0-nightly.20220127":"99.0.4767.0","18.0.0-nightly.20220128":"99.0.4767.0","18.0.0-nightly.20220131":"99.0.4767.0","18.0.0-nightly.20220201":"99.0.4767.0","18.0.0":"100.0.4896.56","18.0.1":"100.0.4896.60","18.0.2":"100.0.4896.60","18.0.3":"100.0.4896.75","18.0.4":"100.0.4896.75","18.1.0":"100.0.4896.127","18.2.0":"100.0.4896.143","18.2.1":"100.0.4896.143","18.2.2":"100.0.4896.143","18.2.3":"100.0.4896.143","18.2.4":"100.0.4896.160","18.3.0":"100.0.4896.160","18.3.1":"100.0.4896.160","18.3.2":"100.0.4896.160","18.3.3":"100.0.4896.160","18.3.4":"100.0.4896.160","18.3.5":"100.0.4896.160","18.3.6":"100.0.4896.160","18.3.7":"100.0.4896.160","18.3.8":"100.0.4896.160","18.3.9":"100.0.4896.160","18.3.11":"100.0.4896.160","18.3.12":"100.0.4896.160","18.3.13":"100.0.4896.160","18.3.14":"100.0.4896.160","18.3.15":"100.0.4896.160","19.0.0-alpha.1":"102.0.4962.3","19.0.0-alpha.2":"102.0.4971.0","19.0.0-alpha.3":"102.0.4971.0","19.0.0-alpha.4":"102.0.4989.0","19.0.0-alpha.5":"102.0.4989.0","19.0.0-beta.1":"102.0.4999.0","19.0.0-beta.2":"102.0.4999.0","19.0.0-beta.3":"102.0.4999.0","19.0.0-beta.4":"102.0.5005.27","19.0.0-beta.5":"102.0.5005.40","19.0.0-beta.6":"102.0.5005.40","19.0.0-beta.7":"102.0.5005.40","19.0.0-beta.8":"102.0.5005.49","19.0.0-nightly.20220202":"99.0.4767.0","19.0.0-nightly.20220203":"99.0.4767.0","19.0.0-nightly.20220204":"99.0.4767.0","19.0.0-nightly.20220207":"99.0.4767.0","19.0.0-nightly.20220208":"99.0.4767.0","19.0.0-nightly.20220209":"99.0.4767.0","19.0.0-nightly.20220308":"100.0.4894.0","19.0.0-nightly.20220309":"100.0.4894.0","19.0.0-nightly.20220310":"100.0.4894.0","19.0.0-nightly.20220311":"100.0.4894.0","19.0.0-nightly.20220314":"100.0.4894.0","19.0.0-nightly.20220315":"100.0.4894.0","19.0.0-nightly.20220316":"100.0.4894.0","19.0.0-nightly.20220317":"100.0.4894.0","19.0.0-nightly.20220318":"100.0.4894.0","19.0.0-nightly.20220321":"100.0.4894.0","19.0.0-nightly.20220322":"100.0.4894.0","19.0.0-nightly.20220323":"100.0.4894.0","19.0.0-nightly.20220324":"100.0.4894.0","19.0.0-nightly.20220325":"102.0.4961.0","19.0.0-nightly.20220328":"102.0.4962.3","19.0.0-nightly.20220329":"102.0.4962.3","19.0.0":"102.0.5005.61","19.0.1":"102.0.5005.61","19.0.2":"102.0.5005.63","19.0.3":"102.0.5005.63","19.0.4":"102.0.5005.63","19.0.5":"102.0.5005.115","19.0.6":"102.0.5005.115","19.0.7":"102.0.5005.134","19.0.8":"102.0.5005.148","19.0.9":"102.0.5005.167","19.0.10":"102.0.5005.167","19.0.11":"102.0.5005.167","19.0.12":"102.0.5005.167","19.0.13":"102.0.5005.167","19.0.14":"102.0.5005.167","19.0.15":"102.0.5005.167","19.0.16":"102.0.5005.167","19.0.17":"102.0.5005.167","19.1.0":"102.0.5005.167","19.1.1":"102.0.5005.167","19.1.2":"102.0.5005.167","19.1.3":"102.0.5005.167","19.1.4":"102.0.5005.167","19.1.5":"102.0.5005.167","19.1.6":"102.0.5005.167","19.1.7":"102.0.5005.167","19.1.8":"102.0.5005.167","19.1.9":"102.0.5005.167","20.0.0-alpha.1":"103.0.5044.0","20.0.0-alpha.2":"104.0.5073.0","20.0.0-alpha.3":"104.0.5073.0","20.0.0-alpha.4":"104.0.5073.0","20.0.0-alpha.5":"104.0.5073.0","20.0.0-alpha.6":"104.0.5073.0","20.0.0-alpha.7":"104.0.5073.0","20.0.0-beta.1":"104.0.5073.0","20.0.0-beta.2":"104.0.5073.0","20.0.0-beta.3":"104.0.5073.0","20.0.0-beta.4":"104.0.5073.0","20.0.0-beta.5":"104.0.5073.0","20.0.0-beta.6":"104.0.5073.0","20.0.0-beta.7":"104.0.5073.0","20.0.0-beta.8":"104.0.5073.0","20.0.0-beta.9":"104.0.5112.39","20.0.0-beta.10":"104.0.5112.48","20.0.0-beta.11":"104.0.5112.48","20.0.0-beta.12":"104.0.5112.48","20.0.0-beta.13":"104.0.5112.57","20.0.0-nightly.20220330":"102.0.4962.3","20.0.0-nightly.20220411":"102.0.4971.0","20.0.0-nightly.20220414":"102.0.4989.0","20.0.0-nightly.20220415":"102.0.4989.0","20.0.0-nightly.20220418":"102.0.4989.0","20.0.0-nightly.20220419":"102.0.4989.0","20.0.0-nightly.20220420":"102.0.4989.0","20.0.0-nightly.20220421":"102.0.4989.0","20.0.0-nightly.20220425":"102.0.4999.0","20.0.0-nightly.20220426":"102.0.4999.0","20.0.0-nightly.20220427":"102.0.4999.0","20.0.0-nightly.20220428":"102.0.4999.0","20.0.0-nightly.20220429":"102.0.4999.0","20.0.0-nightly.20220502":"102.0.4999.0","20.0.0-nightly.20220503":"102.0.4999.0","20.0.0-nightly.20220504":"102.0.4999.0","20.0.0-nightly.20220505":"102.0.4999.0","20.0.0-nightly.20220506":"102.0.4999.0","20.0.0-nightly.20220509":"102.0.4999.0","20.0.0-nightly.20220511":"102.0.4999.0","20.0.0-nightly.20220512":"102.0.4999.0","20.0.0-nightly.20220513":"102.0.4999.0","20.0.0-nightly.20220516":"102.0.4999.0","20.0.0-nightly.20220517":"102.0.4999.0","20.0.0-nightly.20220518":"103.0.5044.0","20.0.0-nightly.20220519":"103.0.5044.0","20.0.0-nightly.20220520":"103.0.5044.0","20.0.0-nightly.20220523":"103.0.5044.0","20.0.0-nightly.20220524":"103.0.5044.0","20.0.0":"104.0.5112.65","20.0.1":"104.0.5112.81","20.0.2":"104.0.5112.81","20.0.3":"104.0.5112.81","20.1.0":"104.0.5112.102","20.1.1":"104.0.5112.102","20.1.2":"104.0.5112.114","20.1.3":"104.0.5112.114","20.1.4":"104.0.5112.114","20.2.0":"104.0.5112.124","20.3.0":"104.0.5112.124","20.3.1":"104.0.5112.124","20.3.2":"104.0.5112.124","20.3.3":"104.0.5112.124","20.3.4":"104.0.5112.124","20.3.5":"104.0.5112.124","20.3.6":"104.0.5112.124","20.3.7":"104.0.5112.124","20.3.8":"104.0.5112.124","20.3.9":"104.0.5112.124","20.3.10":"104.0.5112.124","20.3.11":"104.0.5112.124","20.3.12":"104.0.5112.124","21.0.0-alpha.1":"105.0.5187.0","21.0.0-alpha.2":"105.0.5187.0","21.0.0-alpha.3":"105.0.5187.0","21.0.0-alpha.4":"105.0.5187.0","21.0.0-alpha.5":"105.0.5187.0","21.0.0-alpha.6":"106.0.5216.0","21.0.0-beta.1":"106.0.5216.0","21.0.0-beta.2":"106.0.5216.0","21.0.0-beta.3":"106.0.5216.0","21.0.0-beta.4":"106.0.5216.0","21.0.0-beta.5":"106.0.5216.0","21.0.0-beta.6":"106.0.5249.40","21.0.0-beta.7":"106.0.5249.40","21.0.0-beta.8":"106.0.5249.40","21.0.0-nightly.20220526":"103.0.5044.0","21.0.0-nightly.20220527":"103.0.5044.0","21.0.0-nightly.20220530":"103.0.5044.0","21.0.0-nightly.20220531":"103.0.5044.0","21.0.0-nightly.20220602":"104.0.5073.0","21.0.0-nightly.20220603":"104.0.5073.0","21.0.0-nightly.20220606":"104.0.5073.0","21.0.0-nightly.20220607":"104.0.5073.0","21.0.0-nightly.20220608":"104.0.5073.0","21.0.0-nightly.20220609":"104.0.5073.0","21.0.0-nightly.20220610":"104.0.5073.0","21.0.0-nightly.20220613":"104.0.5073.0","21.0.0-nightly.20220614":"104.0.5073.0","21.0.0-nightly.20220615":"104.0.5073.0","21.0.0-nightly.20220616":"104.0.5073.0","21.0.0-nightly.20220617":"104.0.5073.0","21.0.0-nightly.20220620":"104.0.5073.0","21.0.0-nightly.20220621":"104.0.5073.0","21.0.0-nightly.20220622":"104.0.5073.0","21.0.0-nightly.20220623":"104.0.5073.0","21.0.0-nightly.20220624":"104.0.5073.0","21.0.0-nightly.20220627":"104.0.5073.0","21.0.0-nightly.20220628":"105.0.5129.0","21.0.0-nightly.20220629":"105.0.5129.0","21.0.0-nightly.20220630":"105.0.5129.0","21.0.0-nightly.20220701":"105.0.5129.0","21.0.0-nightly.20220704":"105.0.5129.0","21.0.0-nightly.20220705":"105.0.5129.0","21.0.0-nightly.20220706":"105.0.5129.0","21.0.0-nightly.20220707":"105.0.5129.0","21.0.0-nightly.20220708":"105.0.5129.0","21.0.0-nightly.20220711":"105.0.5129.0","21.0.0-nightly.20220712":"105.0.5129.0","21.0.0-nightly.20220713":"105.0.5129.0","21.0.0-nightly.20220715":"105.0.5173.0","21.0.0-nightly.20220718":"105.0.5173.0","21.0.0-nightly.20220719":"105.0.5173.0","21.0.0-nightly.20220720":"105.0.5187.0","21.0.0-nightly.20220721":"105.0.5187.0","21.0.0-nightly.20220722":"105.0.5187.0","21.0.0-nightly.20220725":"105.0.5187.0","21.0.0-nightly.20220726":"105.0.5187.0","21.0.0-nightly.20220727":"105.0.5187.0","21.0.0-nightly.20220728":"105.0.5187.0","21.0.0-nightly.20220801":"105.0.5187.0","21.0.0-nightly.20220802":"105.0.5187.0","21.0.0":"106.0.5249.51","21.0.1":"106.0.5249.61","21.1.0":"106.0.5249.91","21.1.1":"106.0.5249.103","21.2.0":"106.0.5249.119","21.2.1":"106.0.5249.165","21.2.2":"106.0.5249.168","21.2.3":"106.0.5249.168","21.3.0":"106.0.5249.181","21.3.1":"106.0.5249.181","21.3.3":"106.0.5249.199","21.3.4":"106.0.5249.199","21.3.5":"106.0.5249.199","21.4.0":"106.0.5249.199","21.4.1":"106.0.5249.199","21.4.2":"106.0.5249.199","21.4.3":"106.0.5249.199","21.4.4":"106.0.5249.199","22.0.0-alpha.1":"107.0.5286.0","22.0.0-alpha.3":"108.0.5329.0","22.0.0-alpha.4":"108.0.5329.0","22.0.0-alpha.5":"108.0.5329.0","22.0.0-alpha.6":"108.0.5329.0","22.0.0-alpha.7":"108.0.5355.0","22.0.0-alpha.8":"108.0.5359.10","22.0.0-beta.1":"108.0.5359.10","22.0.0-beta.2":"108.0.5359.10","22.0.0-beta.3":"108.0.5359.10","22.0.0-beta.4":"108.0.5359.29","22.0.0-beta.5":"108.0.5359.40","22.0.0-beta.6":"108.0.5359.40","22.0.0-beta.7":"108.0.5359.48","22.0.0-beta.8":"108.0.5359.48","22.0.0-nightly.20220808":"105.0.5187.0","22.0.0-nightly.20220809":"105.0.5187.0","22.0.0-nightly.20220810":"105.0.5187.0","22.0.0-nightly.20220811":"105.0.5187.0","22.0.0-nightly.20220812":"105.0.5187.0","22.0.0-nightly.20220815":"105.0.5187.0","22.0.0-nightly.20220816":"105.0.5187.0","22.0.0-nightly.20220817":"105.0.5187.0","22.0.0-nightly.20220822":"106.0.5216.0","22.0.0-nightly.20220823":"106.0.5216.0","22.0.0-nightly.20220824":"106.0.5216.0","22.0.0-nightly.20220825":"106.0.5216.0","22.0.0-nightly.20220829":"106.0.5216.0","22.0.0-nightly.20220830":"106.0.5216.0","22.0.0-nightly.20220831":"106.0.5216.0","22.0.0-nightly.20220901":"106.0.5216.0","22.0.0-nightly.20220902":"106.0.5216.0","22.0.0-nightly.20220905":"106.0.5216.0","22.0.0-nightly.20220908":"107.0.5274.0","22.0.0-nightly.20220909":"107.0.5286.0","22.0.0-nightly.20220912":"107.0.5286.0","22.0.0-nightly.20220913":"107.0.5286.0","22.0.0-nightly.20220914":"107.0.5286.0","22.0.0-nightly.20220915":"107.0.5286.0","22.0.0-nightly.20220916":"107.0.5286.0","22.0.0-nightly.20220919":"107.0.5286.0","22.0.0-nightly.20220920":"107.0.5286.0","22.0.0-nightly.20220921":"107.0.5286.0","22.0.0-nightly.20220922":"107.0.5286.0","22.0.0-nightly.20220923":"107.0.5286.0","22.0.0-nightly.20220926":"107.0.5286.0","22.0.0-nightly.20220927":"107.0.5286.0","22.0.0-nightly.20220928":"107.0.5286.0","22.0.0":"108.0.5359.62","22.0.1":"108.0.5359.125","22.0.2":"108.0.5359.179","22.0.3":"108.0.5359.179","22.1.0":"108.0.5359.179","22.2.0":"108.0.5359.215","22.2.1":"108.0.5359.215","22.3.0":"108.0.5359.215","22.3.1":"108.0.5359.215","22.3.2":"108.0.5359.215","22.3.3":"108.0.5359.215","22.3.4":"108.0.5359.215","22.3.5":"108.0.5359.215","22.3.6":"108.0.5359.215","22.3.7":"108.0.5359.215","22.3.8":"108.0.5359.215","22.3.9":"108.0.5359.215","22.3.10":"108.0.5359.215","22.3.11":"108.0.5359.215","22.3.12":"108.0.5359.215","22.3.13":"108.0.5359.215","22.3.14":"108.0.5359.215","22.3.15":"108.0.5359.215","22.3.16":"108.0.5359.215","22.3.17":"108.0.5359.215","22.3.18":"108.0.5359.215","22.3.20":"108.0.5359.215","22.3.21":"108.0.5359.215","22.3.22":"108.0.5359.215","22.3.23":"108.0.5359.215","22.3.24":"108.0.5359.215","22.3.25":"108.0.5359.215","22.3.26":"108.0.5359.215","22.3.27":"108.0.5359.215","23.0.0-alpha.1":"110.0.5415.0","23.0.0-alpha.2":"110.0.5451.0","23.0.0-alpha.3":"110.0.5451.0","23.0.0-beta.1":"110.0.5478.5","23.0.0-beta.2":"110.0.5478.5","23.0.0-beta.3":"110.0.5478.5","23.0.0-beta.4":"110.0.5481.30","23.0.0-beta.5":"110.0.5481.38","23.0.0-beta.6":"110.0.5481.52","23.0.0-beta.8":"110.0.5481.52","23.0.0-nightly.20220929":"107.0.5286.0","23.0.0-nightly.20220930":"107.0.5286.0","23.0.0-nightly.20221003":"107.0.5286.0","23.0.0-nightly.20221004":"108.0.5329.0","23.0.0-nightly.20221005":"108.0.5329.0","23.0.0-nightly.20221006":"108.0.5329.0","23.0.0-nightly.20221007":"108.0.5329.0","23.0.0-nightly.20221010":"108.0.5329.0","23.0.0-nightly.20221011":"108.0.5329.0","23.0.0-nightly.20221012":"108.0.5329.0","23.0.0-nightly.20221013":"108.0.5329.0","23.0.0-nightly.20221014":"108.0.5329.0","23.0.0-nightly.20221017":"108.0.5329.0","23.0.0-nightly.20221018":"108.0.5355.0","23.0.0-nightly.20221019":"108.0.5355.0","23.0.0-nightly.20221020":"108.0.5355.0","23.0.0-nightly.20221021":"108.0.5355.0","23.0.0-nightly.20221024":"108.0.5355.0","23.0.0-nightly.20221026":"108.0.5355.0","23.0.0-nightly.20221027":"109.0.5382.0","23.0.0-nightly.20221028":"109.0.5382.0","23.0.0-nightly.20221031":"109.0.5382.0","23.0.0-nightly.20221101":"109.0.5382.0","23.0.0-nightly.20221102":"109.0.5382.0","23.0.0-nightly.20221103":"109.0.5382.0","23.0.0-nightly.20221104":"109.0.5382.0","23.0.0-nightly.20221107":"109.0.5382.0","23.0.0-nightly.20221108":"109.0.5382.0","23.0.0-nightly.20221109":"109.0.5382.0","23.0.0-nightly.20221110":"109.0.5382.0","23.0.0-nightly.20221111":"109.0.5382.0","23.0.0-nightly.20221114":"109.0.5382.0","23.0.0-nightly.20221115":"109.0.5382.0","23.0.0-nightly.20221116":"109.0.5382.0","23.0.0-nightly.20221117":"109.0.5382.0","23.0.0-nightly.20221118":"110.0.5415.0","23.0.0-nightly.20221121":"110.0.5415.0","23.0.0-nightly.20221122":"110.0.5415.0","23.0.0-nightly.20221123":"110.0.5415.0","23.0.0-nightly.20221124":"110.0.5415.0","23.0.0-nightly.20221125":"110.0.5415.0","23.0.0-nightly.20221128":"110.0.5415.0","23.0.0-nightly.20221129":"110.0.5415.0","23.0.0-nightly.20221130":"110.0.5415.0","23.0.0":"110.0.5481.77","23.1.0":"110.0.5481.100","23.1.1":"110.0.5481.104","23.1.2":"110.0.5481.177","23.1.3":"110.0.5481.179","23.1.4":"110.0.5481.192","23.2.0":"110.0.5481.192","23.2.1":"110.0.5481.208","23.2.2":"110.0.5481.208","23.2.3":"110.0.5481.208","23.2.4":"110.0.5481.208","23.3.0":"110.0.5481.208","23.3.1":"110.0.5481.208","23.3.2":"110.0.5481.208","23.3.3":"110.0.5481.208","23.3.4":"110.0.5481.208","23.3.5":"110.0.5481.208","23.3.6":"110.0.5481.208","23.3.7":"110.0.5481.208","23.3.8":"110.0.5481.208","23.3.9":"110.0.5481.208","23.3.10":"110.0.5481.208","23.3.11":"110.0.5481.208","23.3.12":"110.0.5481.208","23.3.13":"110.0.5481.208","24.0.0-alpha.1":"111.0.5560.0","24.0.0-alpha.2":"111.0.5560.0","24.0.0-alpha.3":"111.0.5560.0","24.0.0-alpha.4":"111.0.5560.0","24.0.0-alpha.5":"111.0.5560.0","24.0.0-alpha.6":"111.0.5560.0","24.0.0-alpha.7":"111.0.5560.0","24.0.0-beta.1":"111.0.5563.50","24.0.0-beta.2":"111.0.5563.50","24.0.0-beta.3":"112.0.5615.20","24.0.0-beta.4":"112.0.5615.20","24.0.0-beta.5":"112.0.5615.29","24.0.0-beta.6":"112.0.5615.39","24.0.0-beta.7":"112.0.5615.39","24.0.0-nightly.20221201":"110.0.5415.0","24.0.0-nightly.20221202":"110.0.5415.0","24.0.0-nightly.20221205":"110.0.5415.0","24.0.0-nightly.20221206":"110.0.5451.0","24.0.0-nightly.20221207":"110.0.5451.0","24.0.0-nightly.20221208":"110.0.5451.0","24.0.0-nightly.20221213":"110.0.5451.0","24.0.0-nightly.20221214":"110.0.5451.0","24.0.0-nightly.20221215":"110.0.5451.0","24.0.0-nightly.20221216":"110.0.5451.0","24.0.0-nightly.20230109":"111.0.5518.0","24.0.0-nightly.20230110":"111.0.5518.0","24.0.0-nightly.20230111":"111.0.5518.0","24.0.0-nightly.20230112":"111.0.5518.0","24.0.0-nightly.20230113":"111.0.5518.0","24.0.0-nightly.20230116":"111.0.5518.0","24.0.0-nightly.20230117":"111.0.5518.0","24.0.0-nightly.20230118":"111.0.5518.0","24.0.0-nightly.20230119":"111.0.5518.0","24.0.0-nightly.20230120":"111.0.5518.0","24.0.0-nightly.20230123":"111.0.5518.0","24.0.0-nightly.20230124":"111.0.5518.0","24.0.0-nightly.20230125":"111.0.5518.0","24.0.0-nightly.20230126":"111.0.5518.0","24.0.0-nightly.20230127":"111.0.5518.0","24.0.0-nightly.20230131":"111.0.5518.0","24.0.0-nightly.20230201":"111.0.5518.0","24.0.0-nightly.20230202":"111.0.5518.0","24.0.0-nightly.20230203":"111.0.5560.0","24.0.0-nightly.20230206":"111.0.5560.0","24.0.0-nightly.20230207":"111.0.5560.0","24.0.0-nightly.20230208":"111.0.5560.0","24.0.0-nightly.20230209":"111.0.5560.0","24.0.0":"112.0.5615.49","24.1.0":"112.0.5615.50","24.1.1":"112.0.5615.50","24.1.2":"112.0.5615.87","24.1.3":"112.0.5615.165","24.2.0":"112.0.5615.165","24.3.0":"112.0.5615.165","24.3.1":"112.0.5615.183","24.4.0":"112.0.5615.204","24.4.1":"112.0.5615.204","24.5.0":"112.0.5615.204","24.5.1":"112.0.5615.204","24.6.0":"112.0.5615.204","24.6.1":"112.0.5615.204","24.6.2":"112.0.5615.204","24.6.3":"112.0.5615.204","24.6.4":"112.0.5615.204","24.6.5":"112.0.5615.204","24.7.0":"112.0.5615.204","24.7.1":"112.0.5615.204","24.8.0":"112.0.5615.204","24.8.1":"112.0.5615.204","24.8.2":"112.0.5615.204","24.8.3":"112.0.5615.204","24.8.4":"112.0.5615.204","24.8.5":"112.0.5615.204","24.8.6":"112.0.5615.204","24.8.7":"112.0.5615.204","24.8.8":"112.0.5615.204","25.0.0-alpha.1":"114.0.5694.0","25.0.0-alpha.2":"114.0.5694.0","25.0.0-alpha.3":"114.0.5710.0","25.0.0-alpha.4":"114.0.5710.0","25.0.0-alpha.5":"114.0.5719.0","25.0.0-alpha.6":"114.0.5719.0","25.0.0-beta.1":"114.0.5719.0","25.0.0-beta.2":"114.0.5719.0","25.0.0-beta.3":"114.0.5719.0","25.0.0-beta.4":"114.0.5735.16","25.0.0-beta.5":"114.0.5735.16","25.0.0-beta.6":"114.0.5735.16","25.0.0-beta.7":"114.0.5735.16","25.0.0-beta.8":"114.0.5735.35","25.0.0-beta.9":"114.0.5735.45","25.0.0-nightly.20230210":"111.0.5560.0","25.0.0-nightly.20230214":"111.0.5560.0","25.0.0-nightly.20230215":"111.0.5560.0","25.0.0-nightly.20230216":"111.0.5560.0","25.0.0-nightly.20230217":"111.0.5560.0","25.0.0-nightly.20230220":"111.0.5560.0","25.0.0-nightly.20230221":"111.0.5560.0","25.0.0-nightly.20230222":"111.0.5560.0","25.0.0-nightly.20230223":"111.0.5560.0","25.0.0-nightly.20230224":"111.0.5560.0","25.0.0-nightly.20230227":"111.0.5560.0","25.0.0-nightly.20230228":"111.0.5560.0","25.0.0-nightly.20230301":"111.0.5560.0","25.0.0-nightly.20230302":"111.0.5560.0","25.0.0-nightly.20230303":"111.0.5560.0","25.0.0-nightly.20230306":"111.0.5560.0","25.0.0-nightly.20230307":"111.0.5560.0","25.0.0-nightly.20230308":"111.0.5560.0","25.0.0-nightly.20230309":"111.0.5560.0","25.0.0-nightly.20230310":"111.0.5560.0","25.0.0-nightly.20230314":"113.0.5636.0","25.0.0-nightly.20230315":"113.0.5651.0","25.0.0-nightly.20230317":"113.0.5653.0","25.0.0-nightly.20230320":"113.0.5660.0","25.0.0-nightly.20230321":"113.0.5664.0","25.0.0-nightly.20230322":"113.0.5666.0","25.0.0-nightly.20230323":"113.0.5668.0","25.0.0-nightly.20230324":"113.0.5670.0","25.0.0-nightly.20230327":"113.0.5670.0","25.0.0-nightly.20230328":"113.0.5670.0","25.0.0-nightly.20230329":"113.0.5670.0","25.0.0-nightly.20230330":"113.0.5670.0","25.0.0-nightly.20230331":"114.0.5684.0","25.0.0-nightly.20230403":"114.0.5684.0","25.0.0-nightly.20230404":"114.0.5692.0","25.0.0-nightly.20230405":"114.0.5694.0","25.0.0":"114.0.5735.45","25.0.1":"114.0.5735.45","25.1.0":"114.0.5735.106","25.1.1":"114.0.5735.106","25.2.0":"114.0.5735.134","25.3.0":"114.0.5735.199","25.3.1":"114.0.5735.243","25.3.2":"114.0.5735.248","25.4.0":"114.0.5735.248","25.5.0":"114.0.5735.289","25.6.0":"114.0.5735.289","25.7.0":"114.0.5735.289","25.8.0":"114.0.5735.289","25.8.1":"114.0.5735.289","25.8.2":"114.0.5735.289","25.8.3":"114.0.5735.289","25.8.4":"114.0.5735.289","25.9.0":"114.0.5735.289","25.9.1":"114.0.5735.289","25.9.2":"114.0.5735.289","25.9.3":"114.0.5735.289","25.9.4":"114.0.5735.289","25.9.5":"114.0.5735.289","25.9.6":"114.0.5735.289","25.9.7":"114.0.5735.289","25.9.8":"114.0.5735.289","26.0.0-alpha.1":"116.0.5791.0","26.0.0-alpha.2":"116.0.5791.0","26.0.0-alpha.3":"116.0.5791.0","26.0.0-alpha.4":"116.0.5791.0","26.0.0-alpha.5":"116.0.5791.0","26.0.0-alpha.6":"116.0.5815.0","26.0.0-alpha.7":"116.0.5831.0","26.0.0-alpha.8":"116.0.5845.0","26.0.0-beta.1":"116.0.5845.0","26.0.0-beta.2":"116.0.5845.14","26.0.0-beta.3":"116.0.5845.14","26.0.0-beta.4":"116.0.5845.14","26.0.0-beta.5":"116.0.5845.14","26.0.0-beta.6":"116.0.5845.14","26.0.0-beta.7":"116.0.5845.14","26.0.0-beta.8":"116.0.5845.42","26.0.0-beta.9":"116.0.5845.42","26.0.0-beta.10":"116.0.5845.49","26.0.0-beta.11":"116.0.5845.49","26.0.0-beta.12":"116.0.5845.62","26.0.0-nightly.20230406":"114.0.5694.0","26.0.0-nightly.20230407":"114.0.5694.0","26.0.0-nightly.20230410":"114.0.5694.0","26.0.0-nightly.20230411":"114.0.5694.0","26.0.0-nightly.20230412":"114.0.5708.0","26.0.0-nightly.20230413":"114.0.5710.0","26.0.0-nightly.20230414":"114.0.5710.0","26.0.0-nightly.20230417":"114.0.5710.0","26.0.0-nightly.20230418":"114.0.5715.0","26.0.0-nightly.20230421":"114.0.5719.0","26.0.0-nightly.20230424":"114.0.5719.0","26.0.0-nightly.20230425":"114.0.5719.0","26.0.0-nightly.20230426":"114.0.5719.0","26.0.0-nightly.20230427":"114.0.5719.0","26.0.0-nightly.20230428":"114.0.5719.0","26.0.0-nightly.20230501":"114.0.5719.0","26.0.0-nightly.20230502":"114.0.5719.0","26.0.0-nightly.20230503":"114.0.5719.0","26.0.0-nightly.20230504":"114.0.5719.0","26.0.0-nightly.20230505":"114.0.5719.0","26.0.0-nightly.20230508":"114.0.5719.0","26.0.0-nightly.20230509":"114.0.5719.0","26.0.0-nightly.20230510":"114.0.5719.0","26.0.0-nightly.20230511":"115.0.5760.0","26.0.0-nightly.20230512":"115.0.5760.0","26.0.0-nightly.20230515":"115.0.5760.0","26.0.0-nightly.20230516":"115.0.5760.0","26.0.0-nightly.20230517":"115.0.5760.0","26.0.0-nightly.20230518":"115.0.5760.0","26.0.0-nightly.20230519":"115.0.5760.0","26.0.0-nightly.20230522":"115.0.5760.0","26.0.0-nightly.20230523":"115.0.5760.0","26.0.0-nightly.20230524":"115.0.5786.0","26.0.0-nightly.20230525":"115.0.5790.0","26.0.0-nightly.20230526":"116.0.5791.0","26.0.0-nightly.20230529":"116.0.5791.0","26.0.0-nightly.20230530":"116.0.5791.0","26.0.0-nightly.20230531":"116.0.5791.0","26.0.0":"116.0.5845.82","26.1.0":"116.0.5845.97","26.2.0":"116.0.5845.179","26.2.1":"116.0.5845.188","26.2.2":"116.0.5845.190","26.2.3":"116.0.5845.190","26.2.4":"116.0.5845.190","26.3.0":"116.0.5845.228","26.4.0":"116.0.5845.228","26.4.1":"116.0.5845.228","26.4.2":"116.0.5845.228","26.4.3":"116.0.5845.228","26.5.0":"116.0.5845.228","26.6.0":"116.0.5845.228","26.6.1":"116.0.5845.228","26.6.2":"116.0.5845.228","26.6.3":"116.0.5845.228","26.6.4":"116.0.5845.228","26.6.5":"116.0.5845.228","26.6.6":"116.0.5845.228","26.6.7":"116.0.5845.228","26.6.8":"116.0.5845.228","27.0.0-alpha.1":"118.0.5949.0","27.0.0-alpha.2":"118.0.5949.0","27.0.0-alpha.3":"118.0.5949.0","27.0.0-alpha.4":"118.0.5949.0","27.0.0-alpha.5":"118.0.5949.0","27.0.0-alpha.6":"118.0.5949.0","27.0.0-beta.1":"118.0.5993.5","27.0.0-beta.2":"118.0.5993.5","27.0.0-beta.3":"118.0.5993.5","27.0.0-beta.4":"118.0.5993.11","27.0.0-beta.5":"118.0.5993.18","27.0.0-beta.6":"118.0.5993.18","27.0.0-beta.7":"118.0.5993.18","27.0.0-beta.8":"118.0.5993.18","27.0.0-beta.9":"118.0.5993.18","27.0.0-nightly.20230601":"116.0.5791.0","27.0.0-nightly.20230602":"116.0.5791.0","27.0.0-nightly.20230605":"116.0.5791.0","27.0.0-nightly.20230606":"116.0.5791.0","27.0.0-nightly.20230607":"116.0.5791.0","27.0.0-nightly.20230609":"116.0.5791.0","27.0.0-nightly.20230612":"116.0.5815.0","27.0.0-nightly.20230613":"116.0.5815.0","27.0.0-nightly.20230614":"116.0.5829.0","27.0.0-nightly.20230615":"116.0.5831.0","27.0.0-nightly.20230616":"116.0.5833.0","27.0.0-nightly.20230619":"116.0.5833.0","27.0.0-nightly.20230620":"116.0.5833.0","27.0.0-nightly.20230621":"116.0.5833.0","27.0.0-nightly.20230622":"116.0.5845.0","27.0.0-nightly.20230623":"116.0.5845.0","27.0.0-nightly.20230626":"116.0.5845.0","27.0.0-nightly.20230627":"116.0.5845.0","27.0.0-nightly.20230628":"116.0.5845.0","27.0.0-nightly.20230629":"116.0.5845.0","27.0.0-nightly.20230630":"116.0.5845.0","27.0.0-nightly.20230703":"117.0.5852.0","27.0.0-nightly.20230704":"117.0.5852.0","27.0.0-nightly.20230705":"117.0.5852.0","27.0.0-nightly.20230706":"117.0.5852.0","27.0.0-nightly.20230707":"117.0.5852.0","27.0.0-nightly.20230710":"117.0.5852.0","27.0.0-nightly.20230711":"117.0.5852.0","27.0.0-nightly.20230712":"117.0.5852.0","27.0.0-nightly.20230713":"117.0.5852.0","27.0.0-nightly.20230714":"117.0.5852.0","27.0.0-nightly.20230717":"117.0.5884.1","27.0.0-nightly.20230718":"117.0.5884.1","27.0.0-nightly.20230719":"117.0.5892.0","27.0.0-nightly.20230720":"117.0.5897.0","27.0.0-nightly.20230721":"117.0.5897.0","27.0.0-nightly.20230724":"117.0.5897.0","27.0.0-nightly.20230725":"117.0.5897.0","27.0.0-nightly.20230726":"117.0.5897.0","27.0.0-nightly.20230727":"117.0.5897.0","27.0.0-nightly.20230728":"117.0.5897.0","27.0.0-nightly.20230731":"117.0.5897.0","27.0.0-nightly.20230801":"117.0.5911.0","27.0.0-nightly.20230802":"117.0.5911.0","27.0.0-nightly.20230803":"117.0.5911.0","27.0.0-nightly.20230804":"117.0.5921.0","27.0.0-nightly.20230807":"117.0.5921.0","27.0.0-nightly.20230808":"117.0.5921.0","27.0.0-nightly.20230814":"117.0.5921.0","27.0.0-nightly.20230815":"117.0.5921.0","27.0.0-nightly.20230816":"118.0.5949.0","27.0.0":"118.0.5993.54","27.0.1":"118.0.5993.89","27.0.2":"118.0.5993.89","27.0.3":"118.0.5993.120","27.0.4":"118.0.5993.129","27.1.0":"118.0.5993.144","27.1.2":"118.0.5993.144","27.1.3":"118.0.5993.159","27.2.0":"118.0.5993.159","27.2.1":"118.0.5993.159","27.2.2":"118.0.5993.159","27.2.3":"118.0.5993.159","27.2.4":"118.0.5993.159","27.3.0":"118.0.5993.159","27.3.1":"118.0.5993.159","28.0.0-alpha.1":"119.0.6045.0","28.0.0-alpha.2":"119.0.6045.0","28.0.0-alpha.3":"119.0.6045.21","28.0.0-alpha.4":"119.0.6045.21","28.0.0-alpha.5":"119.0.6045.33","28.0.0-alpha.6":"119.0.6045.33","28.0.0-alpha.7":"119.0.6045.33","28.0.0-beta.1":"119.0.6045.33","28.0.0-beta.2":"120.0.6099.0","28.0.0-beta.3":"120.0.6099.5","28.0.0-beta.4":"120.0.6099.5","28.0.0-beta.5":"120.0.6099.18","28.0.0-beta.6":"120.0.6099.18","28.0.0-beta.7":"120.0.6099.18","28.0.0-beta.8":"120.0.6099.18","28.0.0-beta.9":"120.0.6099.18","28.0.0-beta.10":"120.0.6099.18","28.0.0-beta.11":"120.0.6099.35","28.0.0-nightly.20230817":"118.0.5949.0","28.0.0-nightly.20230818":"118.0.5949.0","28.0.0-nightly.20230821":"118.0.5949.0","28.0.0-nightly.20230822":"118.0.5949.0","28.0.0-nightly.20230823":"118.0.5949.0","28.0.0-nightly.20230824":"118.0.5949.0","28.0.0-nightly.20230825":"118.0.5949.0","28.0.0-nightly.20230828":"118.0.5949.0","28.0.0-nightly.20230829":"118.0.5949.0","28.0.0-nightly.20230830":"118.0.5949.0","28.0.0-nightly.20230831":"118.0.5949.0","28.0.0-nightly.20230906":"118.0.5991.0","28.0.0-nightly.20230907":"118.0.5993.0","28.0.0-nightly.20230908":"118.0.5993.0","28.0.0-nightly.20230911":"118.0.5993.0","28.0.0-nightly.20230912":"118.0.5993.0","28.0.0-nightly.20230913":"118.0.5993.0","28.0.0-nightly.20230914":"118.0.5993.0","28.0.0-nightly.20230915":"118.0.5993.0","28.0.0-nightly.20230919":"119.0.6006.0","28.0.0-nightly.20230920":"119.0.6017.0","28.0.0-nightly.20230921":"119.0.6019.2","28.0.0-nightly.20230925":"119.0.6019.2","28.0.0-nightly.20230926":"119.0.6019.2","28.0.0-nightly.20230927":"119.0.6019.2","28.0.0-nightly.20230928":"119.0.6019.2","28.0.0-nightly.20230929":"119.0.6029.0","28.0.0-nightly.20231002":"119.0.6029.0","28.0.0-nightly.20231003":"119.0.6043.0","28.0.0-nightly.20231004":"119.0.6043.0","28.0.0-nightly.20231005":"119.0.6043.0","28.0.0-nightly.20231006":"119.0.6045.0","28.0.0-nightly.20231009":"119.0.6045.0","28.0.0-nightly.20231010":"119.0.6045.0","28.0.0-nightly.20231011":"119.0.6045.0","28.0.0":"120.0.6099.56","28.1.0":"120.0.6099.109","28.1.1":"120.0.6099.109","28.1.2":"120.0.6099.199","28.1.3":"120.0.6099.199","28.1.4":"120.0.6099.216","28.2.0":"120.0.6099.227","28.2.1":"120.0.6099.268","29.0.0-alpha.1":"121.0.6147.0","29.0.0-alpha.2":"121.0.6147.0","29.0.0-alpha.3":"121.0.6147.0","29.0.0-alpha.4":"121.0.6159.0","29.0.0-alpha.5":"121.0.6159.0","29.0.0-alpha.6":"121.0.6159.0","29.0.0-alpha.7":"121.0.6159.0","29.0.0-alpha.8":"122.0.6194.0","29.0.0-alpha.9":"122.0.6236.2","29.0.0-alpha.10":"122.0.6236.2","29.0.0-alpha.11":"122.0.6236.2","29.0.0-beta.1":"122.0.6236.2","29.0.0-beta.2":"122.0.6236.2","29.0.0-beta.3":"122.0.6261.6","29.0.0-beta.4":"122.0.6261.6","29.0.0-beta.5":"122.0.6261.18","29.0.0-nightly.20231012":"119.0.6045.0","29.0.0-nightly.20231013":"119.0.6045.0","29.0.0-nightly.20231016":"119.0.6045.0","29.0.0-nightly.20231017":"119.0.6045.0","29.0.0-nightly.20231018":"119.0.6045.0","29.0.0-nightly.20231019":"119.0.6045.0","29.0.0-nightly.20231020":"119.0.6045.0","29.0.0-nightly.20231023":"119.0.6045.0","29.0.0-nightly.20231024":"119.0.6045.0","29.0.0-nightly.20231025":"120.0.6078.0","29.0.0-nightly.20231026":"120.0.6078.0","29.0.0-nightly.20231027":"120.0.6078.0","29.0.0-nightly.20231030":"120.0.6078.0","29.0.0-nightly.20231031":"120.0.6078.0","29.0.0-nightly.20231101":"120.0.6078.0","29.0.0-nightly.20231102":"121.0.6100.0","29.0.0-nightly.20231103":"121.0.6100.0","29.0.0-nightly.20231106":"121.0.6104.0","29.0.0-nightly.20231107":"121.0.6110.0","29.0.0-nightly.20231108":"121.0.6110.0","29.0.0-nightly.20231109":"121.0.6110.0","29.0.0-nightly.20231110":"121.0.6110.0","29.0.0-nightly.20231113":"121.0.6110.0","29.0.0-nightly.20231114":"121.0.6110.0","29.0.0-nightly.20231115":"121.0.6116.0","29.0.0-nightly.20231116":"121.0.6116.0","29.0.0-nightly.20231117":"121.0.6116.0","29.0.0-nightly.20231120":"121.0.6116.0","29.0.0-nightly.20231121":"121.0.6116.0","29.0.0-nightly.20231122":"121.0.6116.0","29.0.0-nightly.20231123":"121.0.6116.0","29.0.0-nightly.20231124":"121.0.6116.0","29.0.0-nightly.20231127":"121.0.6116.0","29.0.0-nightly.20231128":"121.0.6116.0","29.0.0-nightly.20231129":"121.0.6147.0","29.0.0-nightly.20231130":"121.0.6147.0","29.0.0-nightly.20231201":"121.0.6147.0","29.0.0-nightly.20231204":"121.0.6147.0","29.0.0-nightly.20231205":"121.0.6147.0","29.0.0-nightly.20231206":"121.0.6147.0","30.0.0-nightly.20231207":"121.0.6147.0","30.0.0-nightly.20231208":"121.0.6147.0","30.0.0-nightly.20231211":"121.0.6147.0","30.0.0-nightly.20231212":"121.0.6159.0","30.0.0-nightly.20231213":"121.0.6159.0","30.0.0-nightly.20231214":"121.0.6159.0","30.0.0-nightly.20231215":"121.0.6159.0","30.0.0-nightly.20231218":"121.0.6159.0","30.0.0-nightly.20240102":"121.0.6159.0","30.0.0-nightly.20240103":"122.0.6194.0","30.0.0-nightly.20240104":"122.0.6194.0","30.0.0-nightly.20240105":"122.0.6194.0","30.0.0-nightly.20240108":"122.0.6194.0","30.0.0-nightly.20240109":"122.0.6194.0","30.0.0-nightly.20240110":"122.0.6194.0","30.0.0-nightly.20240111":"122.0.6236.2","30.0.0-nightly.20240112":"122.0.6236.2","30.0.0-nightly.20240115":"122.0.6236.2","30.0.0-nightly.20240116":"122.0.6236.2","30.0.0-nightly.20240117":"122.0.6236.2","30.0.0-nightly.20240118":"122.0.6236.2","30.0.0-nightly.20240119":"122.0.6236.2","30.0.0-nightly.20240122":"122.0.6236.2","30.0.0-nightly.20240123":"122.0.6236.2","30.0.0-nightly.20240124":"122.0.6236.2","30.0.0-nightly.20240125":"122.0.6236.2","30.0.0-nightly.20240126":"123.0.6264.0","30.0.0-nightly.20240129":"123.0.6264.0","30.0.0-nightly.20240130":"123.0.6264.0","30.0.0-nightly.20240131":"123.0.6264.0","30.0.0-nightly.20240201":"123.0.6272.0","30.0.0-nightly.20240202":"123.0.6272.0","30.0.0-nightly.20240205":"123.0.6272.0"} \ No newline at end of file diff --git a/node_modules/electron-to-chromium/index.js b/node_modules/electron-to-chromium/index.js deleted file mode 100644 index 1818281..0000000 --- a/node_modules/electron-to-chromium/index.js +++ /dev/null @@ -1,36 +0,0 @@ -var versions = require('./versions'); -var fullVersions = require('./full-versions'); -var chromiumVersions = require('./chromium-versions'); -var fullChromiumVersions = require('./full-chromium-versions'); - -var electronToChromium = function (query) { - var number = getQueryString(query); - return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined; -}; - -var chromiumToElectron = function (query) { - var number = getQueryString(query); - return number.split('.').length > 2 ? fullChromiumVersions[number] : chromiumVersions[number] || undefined; -}; - -var electronToBrowserList = function (query) { - var number = getQueryString(query); - return versions[number] ? "Chrome >= " + versions[number] : undefined; -}; - -var getQueryString = function (query) { - var number = query; - if (query === 1) { number = "1.0" } - if (typeof query === 'number') { number += ''; } - return number; -}; - -module.exports = { - versions: versions, - fullVersions: fullVersions, - chromiumVersions: chromiumVersions, - fullChromiumVersions: fullChromiumVersions, - electronToChromium: electronToChromium, - electronToBrowserList: electronToBrowserList, - chromiumToElectron: chromiumToElectron -}; diff --git a/node_modules/electron-to-chromium/package.json b/node_modules/electron-to-chromium/package.json deleted file mode 100644 index 6eddbed..0000000 --- a/node_modules/electron-to-chromium/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "electron-to-chromium", - "version": "1.4.657", - "description": "Provides a list of electron-to-chromium version mappings", - "main": "index.js", - "files": [ - "versions.js", - "full-versions.js", - "chromium-versions.js", - "full-chromium-versions.js", - "versions.json", - "full-versions.json", - "chromium-versions.json", - "full-chromium-versions.json", - "LICENSE" - ], - "scripts": { - "build": "node build.mjs", - "update": "node automated-update.js", - "test": "nyc ava --verbose", - "report": "nyc report --reporter=text-lcov > coverage.lcov && codecov" - }, - "repository": { - "type": "git", - "url": "https://github.com/kilian/electron-to-chromium/" - }, - "keywords": [ - "electron", - "chrome", - "chromium", - "browserslist", - "browserlist" - ], - "author": "Kilian Valkhof", - "license": "ISC", - "devDependencies": { - "ava": "^5.1.1", - "codecov": "^3.8.2", - "compare-versions": "^6.0.0-rc.1", - "node-fetch": "^3.3.0", - "nyc": "^15.1.0", - "shelljs": "^0.8.5" - } -} diff --git a/node_modules/electron-to-chromium/versions.js b/node_modules/electron-to-chromium/versions.js deleted file mode 100644 index a5699ca..0000000 --- a/node_modules/electron-to-chromium/versions.js +++ /dev/null @@ -1,149 +0,0 @@ -module.exports = { - "0.20": "39", - "0.21": "41", - "0.22": "41", - "0.23": "41", - "0.24": "41", - "0.25": "42", - "0.26": "42", - "0.27": "43", - "0.28": "43", - "0.29": "43", - "0.30": "44", - "0.31": "45", - "0.32": "45", - "0.33": "45", - "0.34": "45", - "0.35": "45", - "0.36": "47", - "0.37": "49", - "1.0": "49", - "1.1": "50", - "1.2": "51", - "1.3": "52", - "1.4": "53", - "1.5": "54", - "1.6": "56", - "1.7": "58", - "1.8": "59", - "2.0": "61", - "2.1": "61", - "3.0": "66", - "3.1": "66", - "4.0": "69", - "4.1": "69", - "4.2": "69", - "5.0": "73", - "6.0": "76", - "6.1": "76", - "7.0": "78", - "7.1": "78", - "7.2": "78", - "7.3": "78", - "8.0": "80", - "8.1": "80", - "8.2": "80", - "8.3": "80", - "8.4": "80", - "8.5": "80", - "9.0": "83", - "9.1": "83", - "9.2": "83", - "9.3": "83", - "9.4": "83", - "10.0": "85", - "10.1": "85", - "10.2": "85", - "10.3": "85", - "10.4": "85", - "11.0": "87", - "11.1": "87", - "11.2": "87", - "11.3": "87", - "11.4": "87", - "11.5": "87", - "12.0": "89", - "12.1": "89", - "12.2": "89", - "13.0": "91", - "13.1": "91", - "13.2": "91", - "13.3": "91", - "13.4": "91", - "13.5": "91", - "13.6": "91", - "14.0": "93", - "14.1": "93", - "14.2": "93", - "15.0": "94", - "15.1": "94", - "15.2": "94", - "15.3": "94", - "15.4": "94", - "15.5": "94", - "16.0": "96", - "16.1": "96", - "16.2": "96", - "17.0": "98", - "17.1": "98", - "17.2": "98", - "17.3": "98", - "17.4": "98", - "18.0": "100", - "18.1": "100", - "18.2": "100", - "18.3": "100", - "19.0": "102", - "19.1": "102", - "20.0": "104", - "20.1": "104", - "20.2": "104", - "20.3": "104", - "21.0": "106", - "21.1": "106", - "21.2": "106", - "21.3": "106", - "21.4": "106", - "22.0": "108", - "22.1": "108", - "22.2": "108", - "22.3": "108", - "23.0": "110", - "23.1": "110", - "23.2": "110", - "23.3": "110", - "24.0": "112", - "24.1": "112", - "24.2": "112", - "24.3": "112", - "24.4": "112", - "24.5": "112", - "24.6": "112", - "24.7": "112", - "24.8": "112", - "25.0": "114", - "25.1": "114", - "25.2": "114", - "25.3": "114", - "25.4": "114", - "25.5": "114", - "25.6": "114", - "25.7": "114", - "25.8": "114", - "25.9": "114", - "26.0": "116", - "26.1": "116", - "26.2": "116", - "26.3": "116", - "26.4": "116", - "26.5": "116", - "26.6": "116", - "27.0": "118", - "27.1": "118", - "27.2": "118", - "27.3": "118", - "28.0": "120", - "28.1": "120", - "28.2": "120", - "29.0": "122" -}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/versions.json b/node_modules/electron-to-chromium/versions.json deleted file mode 100644 index 5f4aa7d..0000000 --- a/node_modules/electron-to-chromium/versions.json +++ /dev/null @@ -1 +0,0 @@ -{"0.20":"39","0.21":"41","0.22":"41","0.23":"41","0.24":"41","0.25":"42","0.26":"42","0.27":"43","0.28":"43","0.29":"43","0.30":"44","0.31":"45","0.32":"45","0.33":"45","0.34":"45","0.35":"45","0.36":"47","0.37":"49","1.0":"49","1.1":"50","1.2":"51","1.3":"52","1.4":"53","1.5":"54","1.6":"56","1.7":"58","1.8":"59","2.0":"61","2.1":"61","3.0":"66","3.1":"66","4.0":"69","4.1":"69","4.2":"69","5.0":"73","6.0":"76","6.1":"76","7.0":"78","7.1":"78","7.2":"78","7.3":"78","8.0":"80","8.1":"80","8.2":"80","8.3":"80","8.4":"80","8.5":"80","9.0":"83","9.1":"83","9.2":"83","9.3":"83","9.4":"83","10.0":"85","10.1":"85","10.2":"85","10.3":"85","10.4":"85","11.0":"87","11.1":"87","11.2":"87","11.3":"87","11.4":"87","11.5":"87","12.0":"89","12.1":"89","12.2":"89","13.0":"91","13.1":"91","13.2":"91","13.3":"91","13.4":"91","13.5":"91","13.6":"91","14.0":"93","14.1":"93","14.2":"93","15.0":"94","15.1":"94","15.2":"94","15.3":"94","15.4":"94","15.5":"94","16.0":"96","16.1":"96","16.2":"96","17.0":"98","17.1":"98","17.2":"98","17.3":"98","17.4":"98","18.0":"100","18.1":"100","18.2":"100","18.3":"100","19.0":"102","19.1":"102","20.0":"104","20.1":"104","20.2":"104","20.3":"104","21.0":"106","21.1":"106","21.2":"106","21.3":"106","21.4":"106","22.0":"108","22.1":"108","22.2":"108","22.3":"108","23.0":"110","23.1":"110","23.2":"110","23.3":"110","24.0":"112","24.1":"112","24.2":"112","24.3":"112","24.4":"112","24.5":"112","24.6":"112","24.7":"112","24.8":"112","25.0":"114","25.1":"114","25.2":"114","25.3":"114","25.4":"114","25.5":"114","25.6":"114","25.7":"114","25.8":"114","25.9":"114","26.0":"116","26.1":"116","26.2":"116","26.3":"116","26.4":"116","26.5":"116","26.6":"116","27.0":"118","27.1":"118","27.2":"118","27.3":"118","28.0":"120","28.1":"120","28.2":"120","29.0":"122"} \ No newline at end of file diff --git a/node_modules/enhanced-resolve/LICENSE b/node_modules/enhanced-resolve/LICENSE deleted file mode 100644 index 8c11fc7..0000000 --- a/node_modules/enhanced-resolve/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/enhanced-resolve/README.md b/node_modules/enhanced-resolve/README.md deleted file mode 100644 index 887590e..0000000 --- a/node_modules/enhanced-resolve/README.md +++ /dev/null @@ -1,183 +0,0 @@ -# enhanced-resolve - -[![npm][npm]][npm-url] -[![Build Status][build-status]][build-status-url] -[![codecov][codecov-badge]][codecov-url] -[![Install Size][size]][size-url] -[![GitHub Discussions][discussion]][discussion-url] - -Offers an async require.resolve function. It's highly configurable. - -## Features - -- plugin system -- provide a custom filesystem -- sync and async node.js filesystems included - -## Getting Started - -### Install - -```sh -# npm -npm install enhanced-resolve -# or Yarn -yarn add enhanced-resolve -``` - -### Resolve - -There is a Node.js API which allows to resolve requests according to the Node.js resolving rules. -Sync and async APIs are offered. A `create` method allows to create a custom resolve function. - -```js -const resolve = require("enhanced-resolve"); - -resolve("/some/path/to/folder", "module/dir", (err, result) => { - result; // === "/some/path/node_modules/module/dir/index.js" -}); - -resolve.sync("/some/path/to/folder", "../../dir"); -// === "/some/path/dir/index.js" - -const myResolve = resolve.create({ - // or resolve.create.sync - extensions: [".ts", ".js"] - // see more options below -}); - -myResolve("/some/path/to/folder", "ts-module", (err, result) => { - result; // === "/some/node_modules/ts-module/index.ts" -}); -``` - -### Creating a Resolver - -The easiest way to create a resolver is to use the `createResolver` function on `ResolveFactory`, along with one of the supplied File System implementations. - -```js -const fs = require("fs"); -const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); - -// create a resolver -const myResolver = ResolverFactory.createResolver({ - // Typical usage will consume the `fs` + `CachedInputFileSystem`, which wraps Node.js `fs` to add caching. - fileSystem: new CachedInputFileSystem(fs, 4000), - extensions: [".js", ".json"] - /* any other resolver options here. Options/defaults can be seen below */ -}); - -// resolve a file with the new resolver -const context = {}; -const lookupStartPath = "/Users/webpack/some/root/dir"; -const request = "./path/to-look-up.js"; -const resolveContext = {}; -myResolver.resolve(context, lookupStartPath, request, resolveContext, ( - err /*Error*/, - filepath /*string*/ -) => { - // Do something with the path -}); -``` - -#### Resolver Options - -| Field | Default | Description | -|------------------|-----------------------------| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| alias | [] | A list of module alias configurations or an object which maps key to value | -| aliasFields | [] | A list of alias fields in description files | -| extensionAlias | {} | An object which maps extension to extension aliases | -| cachePredicate | function() { return true }; | A function which decides whether a request should be cached or not. An object is passed to the function with `path` and `request` properties. | -| cacheWithContext | true | If unsafe cache is enabled, includes `request.context` in the cache key | -| conditionNames | [] | A list of exports field condition names | -| descriptionFiles | ["package.json"] | A list of description files to read from | -| enforceExtension | false | Enforce that a extension from extensions must be used | -| exportsFields | ["exports"] | A list of exports fields in description files | -| extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files | -| fallback | [] | Same as `alias`, but only used if default resolving fails | -| fileSystem | | The file system which should be used | -| fullySpecified | false | Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests) | -| mainFields | ["main"] | A list of main fields in description files | -| mainFiles | ["index"] | A list of main files in directories | -| modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name | -| plugins | [] | A list of additional resolve plugins which should be applied | -| resolver | undefined | A prepared Resolver to which the plugins are attached | -| resolveToContext | false | Resolve to a context instead of a file | -| preferRelative | false | Prefer to resolve module requests as relative request and fallback to resolving as module | -| preferAbsolute | false | Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots | -| restrictions | [] | A list of resolve restrictions | -| roots | [] | A list of root paths | -| symlinks | true | Whether to resolve symlinks to their symlinked location | -| unsafeCache | false | Use this cache object to unsafely cache the successful requests | - -## Plugins - -Similar to `webpack`, the core of `enhanced-resolve` functionality is implemented as individual plugins that are executed using [`tapable`](https://github.com/webpack/tapable). -These plugins can extend the functionality of the library, adding other ways for files/contexts to be resolved. - -A plugin should be a `class` (or its ES5 equivalent) with an `apply` method. The `apply` method will receive a `resolver` instance, that can be used to hook in to the event system. - -### Plugin Boilerplate - -```js -class MyResolverPlugin { - constructor(source, target) { - this.source = source; - this.target = target; - } - - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("MyResolverPlugin", (request, resolveContext, callback) => { - // Any logic you need to create a new `request` can go here - resolver.doResolve(target, request, null, resolveContext, callback); - }); - } -} -``` - -Plugins are executed in a pipeline, and register which event they should be executed before/after. In the example above, `source` is the name of the event that starts the pipeline, and `target` is what event this plugin should fire, which is what continues the execution of the pipeline. For an example of how these different plugin events create a chain, see `lib/ResolverFactory.js`, in the `//// pipeline ////` section. - -## Escaping - -It's allowed to escape `#` as `\0#` to avoid parsing it as fragment. - -enhanced-resolve will try to resolve requests containing `#` as path and as fragment, so it will automatically figure out if `./some#thing` means `.../some.js#thing` or `.../some#thing.js`. When a `#` is resolved as path it will be escaped in the result. Here: `.../some\0#thing.js`. - -## Tests - -```javascript -yarn test -``` - -## Passing options from webpack - -If you are using `webpack`, and you want to pass custom options to `enhanced-resolve`, the options are passed from the `resolve` key of your webpack configuration e.g.: - -``` -resolve: { - extensions: ['.js', '.jsx'], - modules: [path.resolve(__dirname, 'src'), 'node_modules'], - plugins: [new DirectoryNamedWebpackPlugin()] - ... -}, -``` - -## License - -Copyright (c) 2012-2019 JS Foundation and other contributors - -MIT (http://www.opensource.org/licenses/mit-license.php) - -[npm]: https://img.shields.io/npm/v/enhanced-resolve.svg -[npm-url]: https://www.npmjs.com/package/enhanced-resolve -[build-status]: https://github.com/webpack/enhanced-resolve/actions/workflows/test.yml/badge.svg?branch=master -[build-status-url]: https://github.com/webpack/enhanced-resolve/actions -[codecov-badge]: https://codecov.io/gh/webpack/enhanced-resolve/branch/main/graph/badge.svg?token=6B6NxtsZc3 -[codecov-url]: https://codecov.io/gh/webpack/enhanced-resolve -[size]: https://packagephobia.com/badge?p=enhanced-resolve -[size-url]: https://packagephobia.com/result?p=enhanced-resolve -[discussion]: https://img.shields.io/github/discussions/webpack/webpack -[discussion-url]: https://github.com/webpack/webpack/discussions diff --git a/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js b/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js deleted file mode 100644 index 765c835..0000000 --- a/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const DescriptionFileUtils = require("./DescriptionFileUtils"); -const getInnerRequest = require("./getInnerRequest"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class AliasFieldPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | Array} field field - * @param {string | ResolveStepHook} target target - */ - constructor(source, field, target) { - this.source = source; - this.field = field; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("AliasFieldPlugin", (request, resolveContext, callback) => { - if (!request.descriptionFileData) return callback(); - const innerRequest = getInnerRequest(resolver, request); - if (!innerRequest) return callback(); - const fieldData = DescriptionFileUtils.getField( - request.descriptionFileData, - this.field - ); - if (fieldData === null || typeof fieldData !== "object") { - if (resolveContext.log) - resolveContext.log( - "Field '" + - this.field + - "' doesn't contain a valid alias configuration" - ); - return callback(); - } - /** @type {JsonPrimitive | undefined} */ - const data = Object.prototype.hasOwnProperty.call( - fieldData, - innerRequest - ) - ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ - innerRequest - ] - : innerRequest.startsWith("./") - ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ - innerRequest.slice(2) - ] - : undefined; - if (data === innerRequest) return callback(); - if (data === undefined) return callback(); - if (data === false) { - /** @type {ResolveRequest} */ - const ignoreObj = { - ...request, - path: false - }; - if (typeof resolveContext.yield === "function") { - resolveContext.yield(ignoreObj); - return callback(null, null); - } - return callback(null, ignoreObj); - } - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: /** @type {string} */ (request.descriptionFileRoot), - request: /** @type {string} */ (data), - fullySpecified: false - }; - resolver.doResolve( - target, - obj, - "aliased from description file " + - request.descriptionFilePath + - " with mapping '" + - innerRequest + - "' to '" + - /** @type {string} */ (data) + - "'", - resolveContext, - (err, result) => { - if (err) return callback(err); - - // Don't allow other aliasing or raw request - if (result === undefined) return callback(null, null); - callback(null, result); - } - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/AliasPlugin.js b/node_modules/enhanced-resolve/lib/AliasPlugin.js deleted file mode 100644 index bbe9724..0000000 --- a/node_modules/enhanced-resolve/lib/AliasPlugin.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const forEachBail = require("./forEachBail"); -const { PathType, getType } = require("./util/path"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {string | Array | false} Alias */ -/** @typedef {{alias: Alias, name: string, onlyModule?: boolean}} AliasOption */ - -module.exports = class AliasPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {AliasOption | Array} options options - * @param {string | ResolveStepHook} target target - */ - constructor(source, options, target) { - this.source = source; - this.options = Array.isArray(options) ? options : [options]; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - /** - * @param {string} maybeAbsolutePath path - * @returns {null|string} absolute path with slash ending - */ - const getAbsolutePathWithSlashEnding = maybeAbsolutePath => { - const type = getType(maybeAbsolutePath); - if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) { - return resolver.join(maybeAbsolutePath, "_").slice(0, -1); - } - return null; - }; - /** - * @param {string} path path - * @param {string} maybeSubPath sub path - * @returns {boolean} true, if path is sub path - */ - const isSubPath = (path, maybeSubPath) => { - const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath); - if (!absolutePath) return false; - return path.startsWith(absolutePath); - }; - resolver - .getHook(this.source) - .tapAsync("AliasPlugin", (request, resolveContext, callback) => { - const innerRequest = request.request || request.path; - if (!innerRequest) return callback(); - forEachBail( - this.options, - (item, callback) => { - /** @type {boolean} */ - let shouldStop = false; - if ( - innerRequest === item.name || - (!item.onlyModule && - (request.request - ? innerRequest.startsWith(`${item.name}/`) - : isSubPath(innerRequest, item.name))) - ) { - /** @type {string} */ - const remainingRequest = innerRequest.slice(item.name.length); - /** - * @param {Alias} alias alias - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @returns {void} - */ - const resolveWithAlias = (alias, callback) => { - if (alias === false) { - /** @type {ResolveRequest} */ - const ignoreObj = { - ...request, - path: false - }; - if (typeof resolveContext.yield === "function") { - resolveContext.yield(ignoreObj); - return callback(null, null); - } - return callback(null, ignoreObj); - } - if ( - innerRequest !== alias && - !innerRequest.startsWith(alias + "/") - ) { - shouldStop = true; - const newRequestStr = alias + remainingRequest; - /** @type {ResolveRequest} */ - const obj = { - ...request, - request: newRequestStr, - fullySpecified: false - }; - return resolver.doResolve( - target, - obj, - "aliased with mapping '" + - item.name + - "': '" + - alias + - "' to '" + - newRequestStr + - "'", - resolveContext, - (err, result) => { - if (err) return callback(err); - if (result) return callback(null, result); - return callback(); - } - ); - } - return callback(); - }; - /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result - * @returns {void} - */ - const stoppingCallback = (err, result) => { - if (err) return callback(err); - - if (result) return callback(null, result); - // Don't allow other aliasing or raw request - if (shouldStop) return callback(null, null); - return callback(); - }; - if (Array.isArray(item.alias)) { - return forEachBail( - item.alias, - resolveWithAlias, - stoppingCallback - ); - } else { - return resolveWithAlias(item.alias, stoppingCallback); - } - } - return callback(); - }, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/AppendPlugin.js b/node_modules/enhanced-resolve/lib/AppendPlugin.js deleted file mode 100644 index 45ad052..0000000 --- a/node_modules/enhanced-resolve/lib/AppendPlugin.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class AppendPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string} appending appending - * @param {string | ResolveStepHook} target target - */ - constructor(source, appending, target) { - this.source = source; - this.appending = appending; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("AppendPlugin", (request, resolveContext, callback) => { - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: request.path + this.appending, - relativePath: - request.relativePath && request.relativePath + this.appending - }; - resolver.doResolve( - target, - obj, - this.appending, - resolveContext, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js deleted file mode 100644 index 022e72c..0000000 --- a/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js +++ /dev/null @@ -1,593 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const nextTick = require("process").nextTick; - -/** @typedef {import("./Resolver").FileSystem} FileSystem */ -/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ -/** @typedef {any} BaseFileSystem */ - -/** - * @template T - * @typedef {import("./Resolver").FileSystemCallback} FileSystemCallback - */ - -/** - * @param {string} path path - * @returns {string} dirname - */ -const dirname = path => { - let idx = path.length - 1; - while (idx >= 0) { - const c = path.charCodeAt(idx); - // slash or backslash - if (c === 47 || c === 92) break; - idx--; - } - if (idx < 0) return ""; - return path.slice(0, idx); -}; - -/** - * @template T - * @param {FileSystemCallback[]} callbacks callbacks - * @param {Error | undefined} err error - * @param {T} result result - */ -const runCallbacks = (callbacks, err, result) => { - if (callbacks.length === 1) { - callbacks[0](err, result); - callbacks.length = 0; - return; - } - let error; - for (const callback of callbacks) { - try { - callback(err, result); - } catch (e) { - if (!error) error = e; - } - } - callbacks.length = 0; - if (error) throw error; -}; - -class OperationMergerBackend { - /** - * @param {function} provider async method in filesystem - * @param {function} syncProvider sync method in filesystem - * @param {BaseFileSystem} providerContext call context for the provider methods - */ - constructor(provider, syncProvider, providerContext) { - this._provider = provider; - this._syncProvider = syncProvider; - this._providerContext = providerContext; - this._activeAsyncOperations = new Map(); - - this.provide = this._provider - ? /** - * @param {string} path path - * @param {any} options options - * @param {function} callback callback - * @returns {any} result - */ - (path, options, callback) => { - if (typeof options === "function") { - callback = options; - options = undefined; - } - if (options) { - return this._provider.call( - this._providerContext, - path, - options, - callback - ); - } - if (typeof path !== "string") { - callback(new TypeError("path must be a string")); - return; - } - let callbacks = this._activeAsyncOperations.get(path); - if (callbacks) { - callbacks.push(callback); - return; - } - this._activeAsyncOperations.set(path, (callbacks = [callback])); - provider( - path, - /** - * @param {Error} err error - * @param {any} result result - */ - (err, result) => { - this._activeAsyncOperations.delete(path); - runCallbacks(callbacks, err, result); - } - ); - } - : null; - this.provideSync = this._syncProvider - ? /** - * @param {string} path path - * @param {any} options options - * @returns {any} result - */ - (path, options) => { - return this._syncProvider.call(this._providerContext, path, options); - } - : null; - } - - purge() {} - purgeParent() {} -} - -/* - -IDLE: - insert data: goto SYNC - -SYNC: - before provide: run ticks - event loop tick: goto ASYNC_ACTIVE - -ASYNC: - timeout: run tick, goto ASYNC_PASSIVE - -ASYNC_PASSIVE: - before provide: run ticks - -IDLE --[insert data]--> SYNC --[event loop tick]--> ASYNC_ACTIVE --[interval tick]-> ASYNC_PASSIVE - ^ | - +---------[insert data]-------+ -*/ - -const STORAGE_MODE_IDLE = 0; -const STORAGE_MODE_SYNC = 1; -const STORAGE_MODE_ASYNC = 2; - -class CacheBackend { - /** - * @param {number} duration max cache duration of items - * @param {function} provider async method - * @param {function} syncProvider sync method - * @param {BaseFileSystem} providerContext call context for the provider methods - */ - constructor(duration, provider, syncProvider, providerContext) { - this._duration = duration; - this._provider = provider; - this._syncProvider = syncProvider; - this._providerContext = providerContext; - /** @type {Map[]>} */ - this._activeAsyncOperations = new Map(); - /** @type {Map }>} */ - this._data = new Map(); - /** @type {Set[]} */ - this._levels = []; - for (let i = 0; i < 10; i++) this._levels.push(new Set()); - for (let i = 5000; i < duration; i += 500) this._levels.push(new Set()); - this._currentLevel = 0; - this._tickInterval = Math.floor(duration / this._levels.length); - /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ - this._mode = STORAGE_MODE_IDLE; - - /** @type {NodeJS.Timeout | undefined} */ - this._timeout = undefined; - /** @type {number | undefined} */ - this._nextDecay = undefined; - - // @ts-ignore - this.provide = provider ? this.provide.bind(this) : null; - // @ts-ignore - this.provideSync = syncProvider ? this.provideSync.bind(this) : null; - } - - /** - * @param {string} path path - * @param {any} options options - * @param {FileSystemCallback} callback callback - * @returns {void} - */ - provide(path, options, callback) { - if (typeof options === "function") { - callback = options; - options = undefined; - } - if (typeof path !== "string") { - callback(new TypeError("path must be a string")); - return; - } - if (options) { - return this._provider.call( - this._providerContext, - path, - options, - callback - ); - } - - // When in sync mode we can move to async mode - if (this._mode === STORAGE_MODE_SYNC) { - this._enterAsyncMode(); - } - - // Check in cache - let cacheEntry = this._data.get(path); - if (cacheEntry !== undefined) { - if (cacheEntry.err) return nextTick(callback, cacheEntry.err); - return nextTick(callback, null, cacheEntry.result); - } - - // Check if there is already the same operation running - let callbacks = this._activeAsyncOperations.get(path); - if (callbacks !== undefined) { - callbacks.push(callback); - return; - } - this._activeAsyncOperations.set(path, (callbacks = [callback])); - - // Run the operation - this._provider.call( - this._providerContext, - path, - /** - * @param {Error} [err] error - * @param {any} [result] result - */ - (err, result) => { - this._activeAsyncOperations.delete(path); - this._storeResult(path, err, result); - - // Enter async mode if not yet done - this._enterAsyncMode(); - - runCallbacks( - /** @type {FileSystemCallback[]} */ (callbacks), - err, - result - ); - } - ); - } - - /** - * @param {string} path path - * @param {any} options options - * @returns {any} result - */ - provideSync(path, options) { - if (typeof path !== "string") { - throw new TypeError("path must be a string"); - } - if (options) { - return this._syncProvider.call(this._providerContext, path, options); - } - - // In sync mode we may have to decay some cache items - if (this._mode === STORAGE_MODE_SYNC) { - this._runDecays(); - } - - // Check in cache - let cacheEntry = this._data.get(path); - if (cacheEntry !== undefined) { - if (cacheEntry.err) throw cacheEntry.err; - return cacheEntry.result; - } - - // Get all active async operations - // This sync operation will also complete them - const callbacks = this._activeAsyncOperations.get(path); - this._activeAsyncOperations.delete(path); - - // Run the operation - // When in idle mode, we will enter sync mode - let result; - try { - result = this._syncProvider.call(this._providerContext, path); - } catch (err) { - this._storeResult(path, /** @type {Error} */ (err), undefined); - this._enterSyncModeWhenIdle(); - if (callbacks) { - runCallbacks(callbacks, /** @type {Error} */ (err), undefined); - } - throw err; - } - this._storeResult(path, undefined, result); - this._enterSyncModeWhenIdle(); - if (callbacks) { - runCallbacks(callbacks, undefined, result); - } - return result; - } - - /** - * @param {string|string[]|Set} [what] what to purge - */ - purge(what) { - if (!what) { - if (this._mode !== STORAGE_MODE_IDLE) { - this._data.clear(); - for (const level of this._levels) { - level.clear(); - } - this._enterIdleMode(); - } - } else if (typeof what === "string") { - for (let [key, data] of this._data) { - if (key.startsWith(what)) { - this._data.delete(key); - data.level.delete(key); - } - } - if (this._data.size === 0) { - this._enterIdleMode(); - } - } else { - for (let [key, data] of this._data) { - for (const item of what) { - if (key.startsWith(item)) { - this._data.delete(key); - data.level.delete(key); - break; - } - } - } - if (this._data.size === 0) { - this._enterIdleMode(); - } - } - } - - /** - * @param {string|string[]|Set} [what] what to purge - */ - purgeParent(what) { - if (!what) { - this.purge(); - } else if (typeof what === "string") { - this.purge(dirname(what)); - } else { - const set = new Set(); - for (const item of what) { - set.add(dirname(item)); - } - this.purge(set); - } - } - - /** - * @param {string} path path - * @param {undefined | Error} err error - * @param {any} result result - */ - _storeResult(path, err, result) { - if (this._data.has(path)) return; - const level = this._levels[this._currentLevel]; - this._data.set(path, { err, result, level }); - level.add(path); - } - - _decayLevel() { - const nextLevel = (this._currentLevel + 1) % this._levels.length; - const decay = this._levels[nextLevel]; - this._currentLevel = nextLevel; - for (let item of decay) { - this._data.delete(item); - } - decay.clear(); - if (this._data.size === 0) { - this._enterIdleMode(); - } else { - /** @type {number} */ - (this._nextDecay) += this._tickInterval; - } - } - - _runDecays() { - while ( - /** @type {number} */ (this._nextDecay) <= Date.now() && - this._mode !== STORAGE_MODE_IDLE - ) { - this._decayLevel(); - } - } - - _enterAsyncMode() { - let timeout = 0; - switch (this._mode) { - case STORAGE_MODE_ASYNC: - return; - case STORAGE_MODE_IDLE: - this._nextDecay = Date.now() + this._tickInterval; - timeout = this._tickInterval; - break; - case STORAGE_MODE_SYNC: - this._runDecays(); - // _runDecays may change the mode - if ( - /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC}*/ - (this._mode) === STORAGE_MODE_IDLE - ) - return; - timeout = Math.max( - 0, - /** @type {number} */ (this._nextDecay) - Date.now() - ); - break; - } - this._mode = STORAGE_MODE_ASYNC; - const ref = setTimeout(() => { - this._mode = STORAGE_MODE_SYNC; - this._runDecays(); - }, timeout); - if (ref.unref) ref.unref(); - this._timeout = ref; - } - - _enterSyncModeWhenIdle() { - if (this._mode === STORAGE_MODE_IDLE) { - this._mode = STORAGE_MODE_SYNC; - this._nextDecay = Date.now() + this._tickInterval; - } - } - - _enterIdleMode() { - this._mode = STORAGE_MODE_IDLE; - this._nextDecay = undefined; - if (this._timeout) clearTimeout(this._timeout); - } -} - -/** - * @template {function} Provider - * @template {function} AsyncProvider - * @template FileSystem - * @param {number} duration duration in ms files are cached - * @param {Provider} provider provider - * @param {AsyncProvider} syncProvider sync provider - * @param {FileSystem} providerContext provider context - * @returns {OperationMergerBackend | CacheBackend} backend - */ -const createBackend = (duration, provider, syncProvider, providerContext) => { - if (duration > 0) { - return new CacheBackend(duration, provider, syncProvider, providerContext); - } - return new OperationMergerBackend(provider, syncProvider, providerContext); -}; - -module.exports = class CachedInputFileSystem { - /** - * @param {BaseFileSystem} fileSystem file system - * @param {number} duration duration in ms files are cached - */ - constructor(fileSystem, duration) { - this.fileSystem = fileSystem; - - this._lstatBackend = createBackend( - duration, - this.fileSystem.lstat, - this.fileSystem.lstatSync, - this.fileSystem - ); - const lstat = this._lstatBackend.provide; - this.lstat = /** @type {FileSystem["lstat"]} */ (lstat); - const lstatSync = this._lstatBackend.provideSync; - this.lstatSync = /** @type {SyncFileSystem["lstatSync"]} */ (lstatSync); - - this._statBackend = createBackend( - duration, - this.fileSystem.stat, - this.fileSystem.statSync, - this.fileSystem - ); - const stat = this._statBackend.provide; - this.stat = /** @type {FileSystem["stat"]} */ (stat); - const statSync = this._statBackend.provideSync; - this.statSync = /** @type {SyncFileSystem["statSync"]} */ (statSync); - - this._readdirBackend = createBackend( - duration, - this.fileSystem.readdir, - this.fileSystem.readdirSync, - this.fileSystem - ); - const readdir = this._readdirBackend.provide; - this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); - const readdirSync = this._readdirBackend.provideSync; - this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ ( - readdirSync - ); - - this._readFileBackend = createBackend( - duration, - this.fileSystem.readFile, - this.fileSystem.readFileSync, - this.fileSystem - ); - const readFile = this._readFileBackend.provide; - this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); - const readFileSync = this._readFileBackend.provideSync; - this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ ( - readFileSync - ); - - this._readJsonBackend = createBackend( - duration, - // prettier-ignore - this.fileSystem.readJson || - (this.readFile && - ( - /** - * @param {string} path path - * @param {FileSystemCallback} callback - */ - (path, callback) => { - this.readFile(path, (err, buffer) => { - if (err) return callback(err); - if (!buffer || buffer.length === 0) - return callback(new Error("No file content")); - let data; - try { - data = JSON.parse(buffer.toString("utf-8")); - } catch (e) { - return callback(/** @type {Error} */ (e)); - } - callback(null, data); - }); - }) - ), - // prettier-ignore - this.fileSystem.readJsonSync || - (this.readFileSync && - ( - /** - * @param {string} path path - * @returns {any} result - */ - (path) => { - const buffer = this.readFileSync(path); - const data = JSON.parse(buffer.toString("utf-8")); - return data; - } - )), - this.fileSystem - ); - const readJson = this._readJsonBackend.provide; - this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); - const readJsonSync = this._readJsonBackend.provideSync; - this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ ( - readJsonSync - ); - - this._readlinkBackend = createBackend( - duration, - this.fileSystem.readlink, - this.fileSystem.readlinkSync, - this.fileSystem - ); - const readlink = this._readlinkBackend.provide; - this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); - const readlinkSync = this._readlinkBackend.provideSync; - this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ ( - readlinkSync - ); - } - - /** - * @param {string|string[]|Set} [what] what to purge - */ - purge(what) { - this._statBackend.purge(what); - this._lstatBackend.purge(what); - this._readdirBackend.purgeParent(what); - this._readFileBackend.purge(what); - this._readlinkBackend.purge(what); - this._readJsonBackend.purge(what); - } -}; diff --git a/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js b/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js deleted file mode 100644 index cc193f5..0000000 --- a/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const basename = require("./getPaths").basename; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class CloneBasenamePlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { - const requestPath = /** @type {string} */ (request.path); - const filename = /** @type {string} */ (basename(requestPath)); - const filePath = resolver.join(requestPath, filename); - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: filePath, - relativePath: - request.relativePath && - resolver.join(request.relativePath, filename) - }; - resolver.doResolve( - target, - obj, - "using path: " + filePath, - resolveContext, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ConditionalPlugin.js b/node_modules/enhanced-resolve/lib/ConditionalPlugin.js deleted file mode 100644 index 0e66107..0000000 --- a/node_modules/enhanced-resolve/lib/ConditionalPlugin.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class ConditionalPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {Partial} test compare object - * @param {string | null} message log message - * @param {boolean} allowAlternatives when false, do not continue with the current step when "test" matches - * @param {string | ResolveStepHook} target target - */ - constructor(source, test, message, allowAlternatives, target) { - this.source = source; - this.test = test; - this.message = message; - this.allowAlternatives = allowAlternatives; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - const { test, message, allowAlternatives } = this; - const keys = /** @type {(keyof ResolveRequest)[]} */ (Object.keys(test)); - resolver - .getHook(this.source) - .tapAsync("ConditionalPlugin", (request, resolveContext, callback) => { - for (const prop of keys) { - if (request[prop] !== test[prop]) return callback(); - } - resolver.doResolve( - target, - request, - message, - resolveContext, - allowAlternatives - ? callback - : (err, result) => { - if (err) return callback(err); - - // Don't allow other alternatives - if (result === undefined) return callback(null, null); - callback(null, result); - } - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js b/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js deleted file mode 100644 index 8bbdb72..0000000 --- a/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const DescriptionFileUtils = require("./DescriptionFileUtils"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class DescriptionFilePlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string[]} filenames filenames - * @param {boolean} pathIsFile pathIsFile - * @param {string | ResolveStepHook} target target - */ - constructor(source, filenames, pathIsFile, target) { - this.source = source; - this.filenames = filenames; - this.pathIsFile = pathIsFile; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync( - "DescriptionFilePlugin", - (request, resolveContext, callback) => { - const path = request.path; - if (!path) return callback(); - const directory = this.pathIsFile - ? DescriptionFileUtils.cdUp(path) - : path; - if (!directory) return callback(); - DescriptionFileUtils.loadDescriptionFile( - resolver, - directory, - this.filenames, - request.descriptionFilePath - ? { - path: request.descriptionFilePath, - content: request.descriptionFileData, - directory: /** @type {string} */ (request.descriptionFileRoot) - } - : undefined, - resolveContext, - (err, result) => { - if (err) return callback(err); - if (!result) { - if (resolveContext.log) - resolveContext.log( - `No description file found in ${directory} or above` - ); - return callback(); - } - const relativePath = - "." + path.slice(result.directory.length).replace(/\\/g, "/"); - /** @type {ResolveRequest} */ - const obj = { - ...request, - descriptionFilePath: result.path, - descriptionFileData: result.content, - descriptionFileRoot: result.directory, - relativePath: relativePath - }; - resolver.doResolve( - target, - obj, - "using description file: " + - result.path + - " (relative path: " + - relativePath + - ")", - resolveContext, - (err, result) => { - if (err) return callback(err); - - // Don't allow other processing - if (result === undefined) return callback(null, null); - callback(null, result); - } - ); - } - ); - } - ); - } -}; diff --git a/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js b/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js deleted file mode 100644 index cfa970b..0000000 --- a/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js +++ /dev/null @@ -1,198 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const forEachBail = require("./forEachBail"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").JsonObject} JsonObject */ -/** @typedef {import("./Resolver").JsonValue} JsonValue */ -/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ - -/** - * @typedef {Object} DescriptionFileInfo - * @property {JsonObject=} content - * @property {string} path - * @property {string} directory - */ - -/** - * @callback ErrorFirstCallback - * @param {Error|null=} error - * @param {DescriptionFileInfo=} result - */ - -/** - * @typedef {Object} Result - * @property {string} path path to description file - * @property {string} directory directory of description file - * @property {JsonObject} content content of description file - */ - -/** - * @param {Resolver} resolver resolver - * @param {string} directory directory - * @param {string[]} filenames filenames - * @param {DescriptionFileInfo|undefined} oldInfo oldInfo - * @param {ResolveContext} resolveContext resolveContext - * @param {ErrorFirstCallback} callback callback - */ -function loadDescriptionFile( - resolver, - directory, - filenames, - oldInfo, - resolveContext, - callback -) { - (function findDescriptionFile() { - if (oldInfo && oldInfo.directory === directory) { - // We already have info for this directory and can reuse it - return callback(null, oldInfo); - } - forEachBail( - filenames, - /** - * @param {string} filename filename - * @param {(err?: null|Error, result?: null|Result) => void} callback callback - * @returns {void} - */ - (filename, callback) => { - const descriptionFilePath = resolver.join(directory, filename); - if (resolver.fileSystem.readJson) { - resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { - if (err) { - if (typeof err.code !== "undefined") { - if (resolveContext.missingDependencies) { - resolveContext.missingDependencies.add(descriptionFilePath); - } - return callback(); - } - if (resolveContext.fileDependencies) { - resolveContext.fileDependencies.add(descriptionFilePath); - } - return onJson(err); - } - if (resolveContext.fileDependencies) { - resolveContext.fileDependencies.add(descriptionFilePath); - } - onJson(null, /** @type {JsonObject} */ (content)); - }); - } else { - resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { - if (err) { - if (resolveContext.missingDependencies) { - resolveContext.missingDependencies.add(descriptionFilePath); - } - return callback(); - } - if (resolveContext.fileDependencies) { - resolveContext.fileDependencies.add(descriptionFilePath); - } - - /** @type {JsonObject | undefined} */ - let json; - - if (content) { - try { - json = JSON.parse(content.toString()); - } catch (/** @type {unknown} */ e) { - return onJson(/** @type {Error} */ (e)); - } - } else { - return onJson(new Error("No content in file")); - } - - onJson(null, json); - }); - } - - /** - * @param {null|Error} [err] error - * @param {JsonObject} [content] content - * @returns {void} - */ - function onJson(err, content) { - if (err) { - if (resolveContext.log) - resolveContext.log( - descriptionFilePath + " (directory description file): " + err - ); - else - err.message = - descriptionFilePath + " (directory description file): " + err; - return callback(err); - } - callback(null, { - content: /** @type {JsonObject} */ (content), - directory, - path: descriptionFilePath - }); - } - }, - /** - * @param {null|Error} [err] error - * @param {null|Result} [result] result - * @returns {void} - */ - (err, result) => { - if (err) return callback(err); - if (result) { - return callback(null, result); - } else { - const dir = cdUp(directory); - if (!dir) { - return callback(); - } else { - directory = dir; - return findDescriptionFile(); - } - } - } - ); - })(); -} - -/** - * @param {JsonObject} content content - * @param {string|string[]} field field - * @returns {JsonValue | undefined} field data - */ -function getField(content, field) { - if (!content) return undefined; - if (Array.isArray(field)) { - /** @type {JsonValue} */ - let current = content; - for (let j = 0; j < field.length; j++) { - if (current === null || typeof current !== "object") { - current = null; - break; - } - current = /** @type {JsonObject} */ (current)[field[j]]; - } - return current; - } else { - return content[field]; - } -} - -/** - * @param {string} directory directory - * @returns {string|null} parent directory or null - */ -function cdUp(directory) { - if (directory === "/") return null; - const i = directory.lastIndexOf("/"), - j = directory.lastIndexOf("\\"); - const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; - if (p < 0) return null; - return directory.slice(0, p || 1); -} - -exports.loadDescriptionFile = loadDescriptionFile; -exports.getField = getField; -exports.cdUp = cdUp; diff --git a/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js b/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js deleted file mode 100644 index 80c9409..0000000 --- a/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class DirectoryExistsPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync( - "DirectoryExistsPlugin", - (request, resolveContext, callback) => { - const fs = resolver.fileSystem; - const directory = request.path; - if (!directory) return callback(); - fs.stat(directory, (err, stat) => { - if (err || !stat) { - if (resolveContext.missingDependencies) - resolveContext.missingDependencies.add(directory); - if (resolveContext.log) - resolveContext.log(directory + " doesn't exist"); - return callback(); - } - if (!stat.isDirectory()) { - if (resolveContext.missingDependencies) - resolveContext.missingDependencies.add(directory); - if (resolveContext.log) - resolveContext.log(directory + " is not a directory"); - return callback(); - } - if (resolveContext.fileDependencies) - resolveContext.fileDependencies.add(directory); - resolver.doResolve( - target, - request, - `existing directory ${directory}`, - resolveContext, - callback - ); - }); - } - ); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js b/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js deleted file mode 100644 index a164e88..0000000 --- a/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -const path = require("path"); -const DescriptionFileUtils = require("./DescriptionFileUtils"); -const forEachBail = require("./forEachBail"); -const { processExportsField } = require("./util/entrypoints"); -const { parseIdentifier } = require("./util/identifier"); -const { checkImportsExportsFieldTarget } = require("./util/path"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").JsonObject} JsonObject */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {import("./util/entrypoints").ExportsField} ExportsField */ -/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ - -module.exports = class ExportsFieldPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {Set} conditionNames condition names - * @param {string | string[]} fieldNamePath name path - * @param {string | ResolveStepHook} target target - */ - constructor(source, conditionNames, fieldNamePath, target) { - this.source = source; - this.target = target; - this.conditionNames = conditionNames; - this.fieldName = fieldNamePath; - /** @type {WeakMap} */ - this.fieldProcessorCache = new WeakMap(); - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("ExportsFieldPlugin", (request, resolveContext, callback) => { - // When there is no description file, abort - if (!request.descriptionFilePath) return callback(); - if ( - // When the description file is inherited from parent, abort - // (There is no description file inside of this package) - request.relativePath !== "." || - request.request === undefined - ) - return callback(); - - const remainingRequest = - request.query || request.fragment - ? (request.request === "." ? "./" : request.request) + - request.query + - request.fragment - : request.request; - const exportsField = - /** @type {ExportsField|null|undefined} */ - ( - DescriptionFileUtils.getField( - /** @type {JsonObject} */ (request.descriptionFileData), - this.fieldName - ) - ); - if (!exportsField) return callback(); - - if (request.directory) { - return callback( - new Error( - `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)` - ) - ); - } - - /** @type {string[]} */ - let paths; - - try { - // We attach the cache to the description file instead of the exportsField value - // because we use a WeakMap and the exportsField could be a string too. - // Description file is always an object when exports field can be accessed. - let fieldProcessor = this.fieldProcessorCache.get( - /** @type {JsonObject} */ (request.descriptionFileData) - ); - if (fieldProcessor === undefined) { - fieldProcessor = processExportsField(exportsField); - this.fieldProcessorCache.set( - /** @type {JsonObject} */ (request.descriptionFileData), - fieldProcessor - ); - } - paths = fieldProcessor(remainingRequest, this.conditionNames); - } catch (/** @type {unknown} */ err) { - if (resolveContext.log) { - resolveContext.log( - `Exports field in ${request.descriptionFilePath} can't be processed: ${err}` - ); - } - return callback(/** @type {Error} */ (err)); - } - - if (paths.length === 0) { - return callback( - new Error( - `Package path ${remainingRequest} is not exported from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})` - ) - ); - } - - forEachBail( - paths, - /** - * @param {string} p path - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @returns {void} - */ - (p, callback) => { - const parsedIdentifier = parseIdentifier(p); - - if (!parsedIdentifier) return callback(); - - const [relativePath, query, fragment] = parsedIdentifier; - - const error = checkImportsExportsFieldTarget(relativePath); - - if (error) { - return callback(error); - } - - /** @type {ResolveRequest} */ - const obj = { - ...request, - request: undefined, - path: path.join( - /** @type {string} */ (request.descriptionFileRoot), - relativePath - ), - relativePath, - query, - fragment - }; - - resolver.doResolve( - target, - obj, - "using exports field: " + p, - resolveContext, - callback - ); - }, - /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result - * @returns {void} - */ - (err, result) => callback(err, result || null) - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js b/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js deleted file mode 100644 index a947990..0000000 --- a/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -const forEachBail = require("./forEachBail"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {{ alias: string|string[], extension: string }} ExtensionAliasOption */ - -module.exports = class ExtensionAliasPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {ExtensionAliasOption} options options - * @param {string | ResolveStepHook} target target - */ - constructor(source, options, target) { - this.source = source; - this.options = options; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - const { extension, alias } = this.options; - resolver - .getHook(this.source) - .tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => { - const requestPath = request.request; - if (!requestPath || !requestPath.endsWith(extension)) return callback(); - const isAliasString = typeof alias === "string"; - /** - * @param {string} alias extension alias - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @param {number} [index] index - * @returns {void} - */ - const resolve = (alias, callback, index) => { - const newRequest = `${requestPath.slice( - 0, - -extension.length - )}${alias}`; - - return resolver.doResolve( - target, - { - ...request, - request: newRequest, - fullySpecified: true - }, - `aliased from extension alias with mapping '${extension}' to '${alias}'`, - resolveContext, - (err, result) => { - // Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias - if (!isAliasString && index) { - if (index !== this.options.alias.length) { - if (resolveContext.log) { - resolveContext.log( - `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}` - ); - } - - return callback(null, result); - } - - return callback(err, result); - } else { - callback(err, result); - } - } - ); - }; - /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result - * @returns {void} - */ - const stoppingCallback = (err, result) => { - if (err) return callback(err); - if (result) return callback(null, result); - // Don't allow other aliasing or raw request - return callback(null, null); - }; - if (isAliasString) { - resolve(alias, stoppingCallback); - } else if (alias.length > 1) { - forEachBail(alias, resolve, stoppingCallback); - } else { - resolve(alias[0], stoppingCallback); - } - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/FileExistsPlugin.js b/node_modules/enhanced-resolve/lib/FileExistsPlugin.js deleted file mode 100644 index 2dd33e3..0000000 --- a/node_modules/enhanced-resolve/lib/FileExistsPlugin.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class FileExistsPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - const fs = resolver.fileSystem; - resolver - .getHook(this.source) - .tapAsync("FileExistsPlugin", (request, resolveContext, callback) => { - const file = request.path; - if (!file) return callback(); - fs.stat(file, (err, stat) => { - if (err || !stat) { - if (resolveContext.missingDependencies) - resolveContext.missingDependencies.add(file); - if (resolveContext.log) resolveContext.log(file + " doesn't exist"); - return callback(); - } - if (!stat.isFile()) { - if (resolveContext.missingDependencies) - resolveContext.missingDependencies.add(file); - if (resolveContext.log) resolveContext.log(file + " is not a file"); - return callback(); - } - if (resolveContext.fileDependencies) - resolveContext.fileDependencies.add(file); - resolver.doResolve( - target, - request, - "existing file: " + file, - resolveContext, - callback - ); - }); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js b/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js deleted file mode 100644 index d106960..0000000 --- a/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js +++ /dev/null @@ -1,196 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -const path = require("path"); -const DescriptionFileUtils = require("./DescriptionFileUtils"); -const forEachBail = require("./forEachBail"); -const { processImportsField } = require("./util/entrypoints"); -const { parseIdentifier } = require("./util/identifier"); -const { checkImportsExportsFieldTarget } = require("./util/path"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").JsonObject} JsonObject */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ -/** @typedef {import("./util/entrypoints").ImportsField} ImportsField */ - -const dotCode = ".".charCodeAt(0); - -module.exports = class ImportsFieldPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {Set} conditionNames condition names - * @param {string | string[]} fieldNamePath name path - * @param {string | ResolveStepHook} targetFile target file - * @param {string | ResolveStepHook} targetPackage target package - */ - constructor( - source, - conditionNames, - fieldNamePath, - targetFile, - targetPackage - ) { - this.source = source; - this.targetFile = targetFile; - this.targetPackage = targetPackage; - this.conditionNames = conditionNames; - this.fieldName = fieldNamePath; - /** @type {WeakMap} */ - this.fieldProcessorCache = new WeakMap(); - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const targetFile = resolver.ensureHook(this.targetFile); - const targetPackage = resolver.ensureHook(this.targetPackage); - - resolver - .getHook(this.source) - .tapAsync("ImportsFieldPlugin", (request, resolveContext, callback) => { - // When there is no description file, abort - if (!request.descriptionFilePath || request.request === undefined) { - return callback(); - } - - const remainingRequest = - request.request + request.query + request.fragment; - const importsField = - /** @type {ImportsField|null|undefined} */ - ( - DescriptionFileUtils.getField( - /** @type {JsonObject} */ (request.descriptionFileData), - this.fieldName - ) - ); - if (!importsField) return callback(); - - if (request.directory) { - return callback( - new Error( - `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)` - ) - ); - } - - /** @type {string[]} */ - let paths; - - try { - // We attach the cache to the description file instead of the importsField value - // because we use a WeakMap and the importsField could be a string too. - // Description file is always an object when exports field can be accessed. - let fieldProcessor = this.fieldProcessorCache.get( - /** @type {JsonObject} */ (request.descriptionFileData) - ); - if (fieldProcessor === undefined) { - fieldProcessor = processImportsField(importsField); - this.fieldProcessorCache.set( - /** @type {JsonObject} */ (request.descriptionFileData), - fieldProcessor - ); - } - paths = fieldProcessor(remainingRequest, this.conditionNames); - } catch (/** @type {unknown} */ err) { - if (resolveContext.log) { - resolveContext.log( - `Imports field in ${request.descriptionFilePath} can't be processed: ${err}` - ); - } - return callback(/** @type {Error} */ (err)); - } - - if (paths.length === 0) { - return callback( - new Error( - `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})` - ) - ); - } - - forEachBail( - paths, - /** - * @param {string} p path - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @returns {void} - */ - (p, callback) => { - const parsedIdentifier = parseIdentifier(p); - - if (!parsedIdentifier) return callback(); - - const [path_, query, fragment] = parsedIdentifier; - - const error = checkImportsExportsFieldTarget(path_); - - if (error) { - return callback(error); - } - - switch (path_.charCodeAt(0)) { - // should be relative - case dotCode: { - /** @type {ResolveRequest} */ - const obj = { - ...request, - request: undefined, - path: path.join( - /** @type {string} */ (request.descriptionFileRoot), - path_ - ), - relativePath: path_, - query, - fragment - }; - - resolver.doResolve( - targetFile, - obj, - "using imports field: " + p, - resolveContext, - callback - ); - break; - } - - // package resolving - default: { - /** @type {ResolveRequest} */ - const obj = { - ...request, - request: path_, - relativePath: path_, - fullySpecified: true, - query, - fragment - }; - - resolver.doResolve( - targetPackage, - obj, - "using imports field: " + p, - resolveContext, - callback - ); - } - } - }, - /** - * @param {null|Error} [err] error - * @param {null|ResolveRequest} [result] result - * @returns {void} - */ - (err, result) => callback(err, result || null) - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js b/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js deleted file mode 100644 index 21c2cae..0000000 --- a/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -const namespaceStartCharCode = "@".charCodeAt(0); - -module.exports = class JoinRequestPartPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync( - "JoinRequestPartPlugin", - (request, resolveContext, callback) => { - const req = request.request || ""; - let i = req.indexOf("/", 3); - - if (i >= 0 && req.charCodeAt(2) === namespaceStartCharCode) { - i = req.indexOf("/", i + 1); - } - - /** @type {string} */ - let moduleName; - /** @type {string} */ - let remainingRequest; - /** @type {boolean} */ - let fullySpecified; - if (i < 0) { - moduleName = req; - remainingRequest = "."; - fullySpecified = false; - } else { - moduleName = req.slice(0, i); - remainingRequest = "." + req.slice(i); - fullySpecified = /** @type {boolean} */ (request.fullySpecified); - } - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: resolver.join( - /** @type {string} */ - (request.path), - moduleName - ), - relativePath: - request.relativePath && - resolver.join(request.relativePath, moduleName), - request: remainingRequest, - fullySpecified - }; - resolver.doResolve(target, obj, null, resolveContext, callback); - } - ); - } -}; diff --git a/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js b/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js deleted file mode 100644 index 2ac99e9..0000000 --- a/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class JoinRequestPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { - const requestPath = /** @type {string} */ (request.path); - const requestRequest = /** @type {string} */ (request.request); - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: resolver.join(requestPath, requestRequest), - relativePath: - request.relativePath && - resolver.join(request.relativePath, requestRequest), - request: undefined - }; - resolver.doResolve(target, obj, null, resolveContext, callback); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/LogInfoPlugin.js b/node_modules/enhanced-resolve/lib/LogInfoPlugin.js deleted file mode 100644 index d8b9207..0000000 --- a/node_modules/enhanced-resolve/lib/LogInfoPlugin.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class LogInfoPlugin { - /** - * @param {string | ResolveStepHook} source source - */ - constructor(source) { - this.source = source; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const source = this.source; - resolver - .getHook(this.source) - .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { - if (!resolveContext.log) return callback(); - const log = resolveContext.log; - const prefix = "[" + source + "] "; - if (request.path) - log(prefix + "Resolving in directory: " + request.path); - if (request.request) - log(prefix + "Resolving request: " + request.request); - if (request.module) log(prefix + "Request is an module request."); - if (request.directory) log(prefix + "Request is a directory request."); - if (request.query) - log(prefix + "Resolving request query: " + request.query); - if (request.fragment) - log(prefix + "Resolving request fragment: " + request.fragment); - if (request.descriptionFilePath) - log( - prefix + "Has description data from " + request.descriptionFilePath - ); - if (request.relativePath) - log( - prefix + - "Relative path from description file is: " + - request.relativePath - ); - callback(); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/MainFieldPlugin.js b/node_modules/enhanced-resolve/lib/MainFieldPlugin.js deleted file mode 100644 index 645b7df..0000000 --- a/node_modules/enhanced-resolve/lib/MainFieldPlugin.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const path = require("path"); -const DescriptionFileUtils = require("./DescriptionFileUtils"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").JsonObject} JsonObject */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -/** @typedef {{name: string|Array, forceRelative: boolean}} MainFieldOptions */ - -const alreadyTriedMainField = Symbol("alreadyTriedMainField"); - -module.exports = class MainFieldPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {MainFieldOptions} options options - * @param {string | ResolveStepHook} target target - */ - constructor(source, options, target) { - this.source = source; - this.options = options; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { - if ( - request.path !== request.descriptionFileRoot || - /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ - (request)[alreadyTriedMainField] === request.descriptionFilePath || - !request.descriptionFilePath - ) - return callback(); - const filename = path.basename(request.descriptionFilePath); - let mainModule = - /** @type {string|null|undefined} */ - ( - DescriptionFileUtils.getField( - /** @type {JsonObject} */ (request.descriptionFileData), - this.options.name - ) - ); - - if ( - !mainModule || - typeof mainModule !== "string" || - mainModule === "." || - mainModule === "./" - ) { - return callback(); - } - if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) - mainModule = "./" + mainModule; - /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ - const obj = { - ...request, - request: mainModule, - module: false, - directory: mainModule.endsWith("/"), - [alreadyTriedMainField]: request.descriptionFilePath - }; - return resolver.doResolve( - target, - obj, - "use " + - mainModule + - " from " + - this.options.name + - " in " + - filename, - resolveContext, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js deleted file mode 100644 index 06065e8..0000000 --- a/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -// TODO remove in next major -module.exports = require("./ModulesInHierarchicalDirectoriesPlugin"); diff --git a/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js deleted file mode 100644 index 651377b..0000000 --- a/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const forEachBail = require("./forEachBail"); -const getPaths = require("./getPaths"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class ModulesInHierarchicalDirectoriesPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | Array} directories directories - * @param {string | ResolveStepHook} target target - */ - constructor(source, directories, target) { - this.source = source; - this.directories = /** @type {Array} */ ([]).concat(directories); - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync( - "ModulesInHierarchicalDirectoriesPlugin", - (request, resolveContext, callback) => { - const fs = resolver.fileSystem; - const addrs = getPaths(/** @type {string} */ (request.path)) - .paths.map(p => { - return this.directories.map(d => resolver.join(p, d)); - }) - .reduce((array, p) => { - array.push.apply(array, p); - return array; - }, []); - forEachBail( - addrs, - /** - * @param {string} addr addr - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @returns {void} - */ - (addr, callback) => { - fs.stat(addr, (err, stat) => { - if (!err && stat && stat.isDirectory()) { - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: addr, - request: "./" + request.request, - module: false - }; - const message = "looking for modules in " + addr; - return resolver.doResolve( - target, - obj, - message, - resolveContext, - callback - ); - } - if (resolveContext.log) - resolveContext.log( - addr + " doesn't exist or is not a directory" - ); - if (resolveContext.missingDependencies) - resolveContext.missingDependencies.add(addr); - return callback(); - }); - }, - callback - ); - } - ); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js deleted file mode 100644 index b7e5168..0000000 --- a/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class ModulesInRootPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string} path path - * @param {string | ResolveStepHook} target target - */ - constructor(source, path, target) { - this.source = source; - this.path = path; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: this.path, - request: "./" + request.request, - module: false - }; - resolver.doResolve( - target, - obj, - "looking for modules in " + this.path, - resolveContext, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/NextPlugin.js b/node_modules/enhanced-resolve/lib/NextPlugin.js deleted file mode 100644 index e59c56b..0000000 --- a/node_modules/enhanced-resolve/lib/NextPlugin.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class NextPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("NextPlugin", (request, resolveContext, callback) => { - resolver.doResolve(target, request, null, resolveContext, callback); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ParsePlugin.js b/node_modules/enhanced-resolve/lib/ParsePlugin.js deleted file mode 100644 index b7db0b0..0000000 --- a/node_modules/enhanced-resolve/lib/ParsePlugin.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class ParsePlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {Partial} requestOptions request options - * @param {string | ResolveStepHook} target target - */ - constructor(source, requestOptions, target) { - this.source = source; - this.requestOptions = requestOptions; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("ParsePlugin", (request, resolveContext, callback) => { - const parsed = resolver.parse(/** @type {string} */ (request.request)); - /** @type {ResolveRequest} */ - const obj = { ...request, ...parsed, ...this.requestOptions }; - if (request.query && !parsed.query) { - obj.query = request.query; - } - if (request.fragment && !parsed.fragment) { - obj.fragment = request.fragment; - } - if (parsed && resolveContext.log) { - if (parsed.module) resolveContext.log("Parsed request is a module"); - if (parsed.directory) - resolveContext.log("Parsed request is a directory"); - } - // There is an edge-case where a request with # can be a path or a fragment -> try both - if (obj.request && !obj.query && obj.fragment) { - const directory = obj.fragment.endsWith("/"); - /** @type {ResolveRequest} */ - const alternative = { - ...obj, - directory, - request: - obj.request + - (obj.directory ? "/" : "") + - (directory ? obj.fragment.slice(0, -1) : obj.fragment), - fragment: "" - }; - resolver.doResolve( - target, - alternative, - null, - resolveContext, - (err, result) => { - if (err) return callback(err); - if (result) return callback(null, result); - resolver.doResolve(target, obj, null, resolveContext, callback); - } - ); - return; - } - resolver.doResolve(target, obj, null, resolveContext, callback); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/PnpPlugin.js b/node_modules/enhanced-resolve/lib/PnpPlugin.js deleted file mode 100644 index 36f4e3d..0000000 --- a/node_modules/enhanced-resolve/lib/PnpPlugin.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Maël Nison @arcanis -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** - * @typedef {Object} PnpApiImpl - * @property {function(string, string, object): string} resolveToUnqualified - */ - -module.exports = class PnpPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {PnpApiImpl} pnpApi pnpApi - * @param {string | ResolveStepHook} target target - */ - constructor(source, pnpApi, target) { - this.source = source; - this.pnpApi = pnpApi; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - /** @type {ResolveStepHook} */ - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("PnpPlugin", (request, resolveContext, callback) => { - const req = request.request; - if (!req) return callback(); - - // The trailing slash indicates to PnP that this value is a folder rather than a file - const issuer = `${request.path}/`; - - const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); - if (!packageMatch) return callback(); - - const packageName = packageMatch[0]; - const innerRequest = `.${req.slice(packageName.length)}`; - - /** @type {string|undefined} */ - let resolution; - /** @type {string|undefined} */ - let apiResolution; - try { - resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { - considerBuiltins: false - }); - if (resolveContext.fileDependencies) { - apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, { - considerBuiltins: false - }); - } - } catch (/** @type {unknown} */ error) { - if ( - /** @type {Error & { code: string }} */ - (error).code === "MODULE_NOT_FOUND" && - /** @type {Error & { pnpCode: string }} */ - (error).pnpCode === "UNDECLARED_DEPENDENCY" - ) { - // This is not a PnP managed dependency. - // Try to continue resolving with our alternatives - if (resolveContext.log) { - resolveContext.log(`request is not managed by the pnpapi`); - for (const line of /** @type {Error} */ (error).message - .split("\n") - .filter(Boolean)) - resolveContext.log(` ${line}`); - } - return callback(); - } - return callback(/** @type {Error} */ (error)); - } - - if (resolution === packageName) return callback(); - - if (apiResolution && resolveContext.fileDependencies) { - resolveContext.fileDependencies.add(apiResolution); - } - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: resolution, - request: innerRequest, - ignoreSymlinks: true, - fullySpecified: request.fullySpecified && innerRequest !== "." - }; - resolver.doResolve( - target, - obj, - `resolved by pnp to ${resolution}`, - resolveContext, - (err, result) => { - if (err) return callback(err); - if (result) return callback(null, result); - // Skip alternatives - return callback(null, null); - } - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/Resolver.js b/node_modules/enhanced-resolve/lib/Resolver.js deleted file mode 100644 index 8806bb1..0000000 --- a/node_modules/enhanced-resolve/lib/Resolver.js +++ /dev/null @@ -1,601 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = require("tapable"); -const createInnerContext = require("./createInnerContext"); -const { parseIdentifier } = require("./util/identifier"); -const { - normalize, - cachedJoin: join, - getType, - PathType -} = require("./util/path"); - -/** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ - -/** @typedef {Error & {details?: string}} ErrorWithDetail */ - -/** @typedef {(err: ErrorWithDetail|null, res?: string|false, req?: ResolveRequest) => void} ResolveCallback */ - -/** - * @typedef {Object} FileSystemStats - * @property {function(): boolean} isDirectory - * @property {function(): boolean} isFile - */ - -/** - * @typedef {Object} FileSystemDirent - * @property {Buffer | string} name - * @property {function(): boolean} isDirectory - * @property {function(): boolean} isFile - */ - -/** - * @typedef {Object} PossibleFileSystemError - * @property {string=} code - * @property {number=} errno - * @property {string=} path - * @property {string=} syscall - */ - -/** - * @template T - * @callback FileSystemCallback - * @param {PossibleFileSystemError & Error | null | undefined} err - * @param {T=} result - */ - -/** @typedef {function((NodeJS.ErrnoException | null)=, (string | Buffer)[] | import("fs").Dirent[]=): void} DirentArrayCallback */ - -/** - * @typedef {Object} ReaddirOptions - * @property {BufferEncoding | null | 'buffer'} [encoding] - * @property {boolean | undefined} [withFileTypes=false] - */ - -/** - * @typedef {Object} FileSystem - * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} readFile - * @property {function(string, (ReaddirOptions | BufferEncoding | null | undefined | 'buffer' | DirentArrayCallback)=, DirentArrayCallback=): void} readdir - * @property {((function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void)=} readJson - * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} readlink - * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void=} lstat - * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} stat - */ - -/** - * @typedef {Object} SyncFileSystem - * @property {function(string, object=): Buffer | string} readFileSync - * @property {function(string, object=): (Buffer | string)[] | FileSystemDirent[]} readdirSync - * @property {(function(string, object=): object)=} readJsonSync - * @property {function(string, object=): Buffer | string} readlinkSync - * @property {function(string, object=): FileSystemStats=} lstatSync - * @property {function(string, object=): FileSystemStats} statSync - */ - -/** - * @typedef {Object} ParsedIdentifier - * @property {string} request - * @property {string} query - * @property {string} fragment - * @property {boolean} directory - * @property {boolean} module - * @property {boolean} file - * @property {boolean} internal - */ - -/** @typedef {string | number | boolean | null} JsonPrimitive */ -/** @typedef {JsonValue[]} JsonArray */ -/** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ -/** @typedef {{[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined}} JsonObject */ - -/** - * @typedef {Object} BaseResolveRequest - * @property {string | false} path - * @property {object=} context - * @property {string=} descriptionFilePath - * @property {string=} descriptionFileRoot - * @property {JsonObject=} descriptionFileData - * @property {string=} relativePath - * @property {boolean=} ignoreSymlinks - * @property {boolean=} fullySpecified - * @property {string=} __innerRequest - * @property {string=} __innerRequest_request - * @property {string=} __innerRequest_relativePath - */ - -/** @typedef {BaseResolveRequest & Partial} ResolveRequest */ - -/** - * String with special formatting - * @typedef {string} StackEntry - */ - -/** - * @template T - * @typedef {{ add: (item: T) => void }} WriteOnlySet - */ - -/** @typedef {(function (ResolveRequest): void)} ResolveContextYield */ - -/** - * Resolve context - * @typedef {Object} ResolveContext - * @property {WriteOnlySet=} contextDependencies - * @property {WriteOnlySet=} fileDependencies files that was found on file system - * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system - * @property {Set=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, - * @property {(function(string): void)=} log log function - * @property {ResolveContextYield=} yield yield result, if provided plugins can return several results - */ - -/** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ - -/** - * @typedef {Object} KnownHooks - * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep - * @property {SyncHook<[ResolveRequest, Error]>} noResolve - * @property {ResolveStepHook} resolve - * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result - */ - -/** - * @typedef {{[key: string]: ResolveStepHook}} EnsuredHooks - */ - -/** - * @param {string} str input string - * @returns {string} in camel case - */ -function toCamelCase(str) { - return str.replace(/-([a-z])/g, str => str.slice(1).toUpperCase()); -} - -class Resolver { - /** - * @param {ResolveStepHook} hook hook - * @param {ResolveRequest} request request - * @returns {StackEntry} stack entry - */ - static createStackEntry(hook, request) { - return ( - hook.name + - ": (" + - request.path + - ") " + - (request.request || "") + - (request.query || "") + - (request.fragment || "") + - (request.directory ? " directory" : "") + - (request.module ? " module" : "") - ); - } - - /** - * @param {FileSystem} fileSystem a filesystem - * @param {ResolveOptions} options options - */ - constructor(fileSystem, options) { - this.fileSystem = fileSystem; - this.options = options; - /** @type {KnownHooks} */ - this.hooks = { - resolveStep: new SyncHook(["hook", "request"], "resolveStep"), - noResolve: new SyncHook(["request", "error"], "noResolve"), - resolve: new AsyncSeriesBailHook( - ["request", "resolveContext"], - "resolve" - ), - result: new AsyncSeriesHook(["result", "resolveContext"], "result") - }; - } - - /** - * @param {string | ResolveStepHook} name hook name or hook itself - * @returns {ResolveStepHook} the hook - */ - ensureHook(name) { - if (typeof name !== "string") { - return name; - } - name = toCamelCase(name); - if (/^before/.test(name)) { - return /** @type {ResolveStepHook} */ ( - this.ensureHook(name[6].toLowerCase() + name.slice(7)).withOptions({ - stage: -10 - }) - ); - } - if (/^after/.test(name)) { - return /** @type {ResolveStepHook} */ ( - this.ensureHook(name[5].toLowerCase() + name.slice(6)).withOptions({ - stage: 10 - }) - ); - } - /** @type {ResolveStepHook} */ - const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; - if (!hook) { - /** @type {KnownHooks & EnsuredHooks} */ - (this.hooks)[name] = new AsyncSeriesBailHook( - ["request", "resolveContext"], - name - ); - - return /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; - } - return hook; - } - - /** - * @param {string | ResolveStepHook} name hook name or hook itself - * @returns {ResolveStepHook} the hook - */ - getHook(name) { - if (typeof name !== "string") { - return name; - } - name = toCamelCase(name); - if (/^before/.test(name)) { - return /** @type {ResolveStepHook} */ ( - this.getHook(name[6].toLowerCase() + name.slice(7)).withOptions({ - stage: -10 - }) - ); - } - if (/^after/.test(name)) { - return /** @type {ResolveStepHook} */ ( - this.getHook(name[5].toLowerCase() + name.slice(6)).withOptions({ - stage: 10 - }) - ); - } - /** @type {ResolveStepHook} */ - const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; - if (!hook) { - throw new Error(`Hook ${name} doesn't exist`); - } - return hook; - } - - /** - * @param {object} context context information object - * @param {string} path context path - * @param {string} request request string - * @returns {string | false} result - */ - resolveSync(context, path, request) { - /** @type {Error | null | undefined} */ - let err = undefined; - /** @type {string | false | undefined} */ - let result = undefined; - let sync = false; - this.resolve(context, path, request, {}, (e, r) => { - err = e; - result = r; - sync = true; - }); - if (!sync) { - throw new Error( - "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!" - ); - } - if (err) throw err; - if (result === undefined) throw new Error("No result"); - return result; - } - - /** - * @param {object} context context information object - * @param {string} path context path - * @param {string} request request string - * @param {ResolveContext} resolveContext resolve context - * @param {ResolveCallback} callback callback function - * @returns {void} - */ - resolve(context, path, request, resolveContext, callback) { - if (!context || typeof context !== "object") - return callback(new Error("context argument is not an object")); - if (typeof path !== "string") - return callback(new Error("path argument is not a string")); - if (typeof request !== "string") - return callback(new Error("request argument is not a string")); - if (!resolveContext) - return callback(new Error("resolveContext argument is not set")); - - /** @type {ResolveRequest} */ - const obj = { - context: context, - path: path, - request: request - }; - - /** @type {ResolveContextYield | undefined} */ - let yield_; - let yieldCalled = false; - /** @type {ResolveContextYield | undefined} */ - let finishYield; - if (typeof resolveContext.yield === "function") { - const old = resolveContext.yield; - /** - * @param {ResolveRequest} obj object - */ - yield_ = obj => { - old(obj); - yieldCalled = true; - }; - /** - * @param {ResolveRequest} result result - * @returns {void} - */ - finishYield = result => { - if (result) { - /** @type {ResolveContextYield} */ (yield_)(result); - } - callback(null); - }; - } - - const message = `resolve '${request}' in '${path}'`; - - /** - * @param {ResolveRequest} result result - * @returns {void} - */ - const finishResolved = result => { - return callback( - null, - result.path === false - ? false - : `${result.path.replace(/#/g, "\0#")}${ - result.query ? result.query.replace(/#/g, "\0#") : "" - }${result.fragment || ""}`, - result - ); - }; - - /** - * @param {string[]} log logs - * @returns {void} - */ - const finishWithoutResolve = log => { - /** - * @type {ErrorWithDetail} - */ - const error = new Error("Can't " + message); - error.details = log.join("\n"); - this.hooks.noResolve.call(obj, error); - return callback(error); - }; - - if (resolveContext.log) { - // We need log anyway to capture it in case of an error - const parentLog = resolveContext.log; - /** @type {string[]} */ - const log = []; - return this.doResolve( - this.hooks.resolve, - obj, - message, - { - log: msg => { - parentLog(msg); - log.push(msg); - }, - yield: yield_, - fileDependencies: resolveContext.fileDependencies, - contextDependencies: resolveContext.contextDependencies, - missingDependencies: resolveContext.missingDependencies, - stack: resolveContext.stack - }, - (err, result) => { - if (err) return callback(err); - - if (yieldCalled || (result && yield_)) { - return /** @type {ResolveContextYield} */ (finishYield)( - /** @type {ResolveRequest} */ (result) - ); - } - - if (result) return finishResolved(result); - - return finishWithoutResolve(log); - } - ); - } else { - // Try to resolve assuming there is no error - // We don't log stuff in this case - return this.doResolve( - this.hooks.resolve, - obj, - message, - { - log: undefined, - yield: yield_, - fileDependencies: resolveContext.fileDependencies, - contextDependencies: resolveContext.contextDependencies, - missingDependencies: resolveContext.missingDependencies, - stack: resolveContext.stack - }, - (err, result) => { - if (err) return callback(err); - - if (yieldCalled || (result && yield_)) { - return /** @type {ResolveContextYield} */ (finishYield)( - /** @type {ResolveRequest} */ (result) - ); - } - - if (result) return finishResolved(result); - - // log is missing for the error details - // so we redo the resolving for the log info - // this is more expensive to the success case - // is assumed by default - /** @type {string[]} */ - const log = []; - - return this.doResolve( - this.hooks.resolve, - obj, - message, - { - log: msg => log.push(msg), - yield: yield_, - stack: resolveContext.stack - }, - (err, result) => { - if (err) return callback(err); - - // In a case that there is a race condition and yield will be called - if (yieldCalled || (result && yield_)) { - return /** @type {ResolveContextYield} */ (finishYield)( - /** @type {ResolveRequest} */ (result) - ); - } - - return finishWithoutResolve(log); - } - ); - } - ); - } - } - - /** - * @param {ResolveStepHook} hook hook - * @param {ResolveRequest} request request - * @param {null|string} message string - * @param {ResolveContext} resolveContext resolver context - * @param {(err?: null|Error, result?: ResolveRequest) => void} callback callback - * @returns {void} - */ - doResolve(hook, request, message, resolveContext, callback) { - const stackEntry = Resolver.createStackEntry(hook, request); - - /** @type {Set | undefined} */ - let newStack; - if (resolveContext.stack) { - newStack = new Set(resolveContext.stack); - if (resolveContext.stack.has(stackEntry)) { - /** - * Prevent recursion - * @type {Error & {recursion?: boolean}} - */ - const recursionError = new Error( - "Recursion in resolving\nStack:\n " + - Array.from(newStack).join("\n ") - ); - recursionError.recursion = true; - if (resolveContext.log) - resolveContext.log("abort resolving because of recursion"); - return callback(recursionError); - } - newStack.add(stackEntry); - } else { - newStack = new Set([stackEntry]); - } - this.hooks.resolveStep.call(hook, request); - - if (hook.isUsed()) { - const innerContext = createInnerContext( - { - log: resolveContext.log, - yield: resolveContext.yield, - fileDependencies: resolveContext.fileDependencies, - contextDependencies: resolveContext.contextDependencies, - missingDependencies: resolveContext.missingDependencies, - stack: newStack - }, - message - ); - return hook.callAsync(request, innerContext, (err, result) => { - if (err) return callback(err); - if (result) return callback(null, result); - callback(); - }); - } else { - callback(); - } - } - - /** - * @param {string} identifier identifier - * @returns {ParsedIdentifier} parsed identifier - */ - parse(identifier) { - const part = { - request: "", - query: "", - fragment: "", - module: false, - directory: false, - file: false, - internal: false - }; - - const parsedIdentifier = parseIdentifier(identifier); - - if (!parsedIdentifier) return part; - - [part.request, part.query, part.fragment] = parsedIdentifier; - - if (part.request.length > 0) { - part.internal = this.isPrivate(identifier); - part.module = this.isModule(part.request); - part.directory = this.isDirectory(part.request); - if (part.directory) { - part.request = part.request.slice(0, -1); - } - } - - return part; - } - - /** - * @param {string} path path - * @returns {boolean} true, if the path is a module - */ - isModule(path) { - return getType(path) === PathType.Normal; - } - - /** - * @param {string} path path - * @returns {boolean} true, if the path is private - */ - isPrivate(path) { - return getType(path) === PathType.Internal; - } - - /** - * @param {string} path a path - * @returns {boolean} true, if the path is a directory path - */ - isDirectory(path) { - return path.endsWith("/"); - } - - /** - * @param {string} path path - * @param {string} request request - * @returns {string} joined path - */ - join(path, request) { - return join(path, request); - } - - /** - * @param {string} path path - * @returns {string} normalized path - */ - normalize(path) { - return normalize(path); - } -} - -module.exports = Resolver; diff --git a/node_modules/enhanced-resolve/lib/ResolverFactory.js b/node_modules/enhanced-resolve/lib/ResolverFactory.js deleted file mode 100644 index 037567b..0000000 --- a/node_modules/enhanced-resolve/lib/ResolverFactory.js +++ /dev/null @@ -1,695 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const versions = require("process").versions; -const Resolver = require("./Resolver"); -const { getType, PathType } = require("./util/path"); - -const SyncAsyncFileSystemDecorator = require("./SyncAsyncFileSystemDecorator"); - -const AliasFieldPlugin = require("./AliasFieldPlugin"); -const AliasPlugin = require("./AliasPlugin"); -const AppendPlugin = require("./AppendPlugin"); -const ConditionalPlugin = require("./ConditionalPlugin"); -const DescriptionFilePlugin = require("./DescriptionFilePlugin"); -const DirectoryExistsPlugin = require("./DirectoryExistsPlugin"); -const ExportsFieldPlugin = require("./ExportsFieldPlugin"); -const ExtensionAliasPlugin = require("./ExtensionAliasPlugin"); -const FileExistsPlugin = require("./FileExistsPlugin"); -const ImportsFieldPlugin = require("./ImportsFieldPlugin"); -const JoinRequestPartPlugin = require("./JoinRequestPartPlugin"); -const JoinRequestPlugin = require("./JoinRequestPlugin"); -const MainFieldPlugin = require("./MainFieldPlugin"); -const ModulesInHierarchicalDirectoriesPlugin = require("./ModulesInHierarchicalDirectoriesPlugin"); -const ModulesInRootPlugin = require("./ModulesInRootPlugin"); -const NextPlugin = require("./NextPlugin"); -const ParsePlugin = require("./ParsePlugin"); -const PnpPlugin = require("./PnpPlugin"); -const RestrictionsPlugin = require("./RestrictionsPlugin"); -const ResultPlugin = require("./ResultPlugin"); -const RootsPlugin = require("./RootsPlugin"); -const SelfReferencePlugin = require("./SelfReferencePlugin"); -const SymlinkPlugin = require("./SymlinkPlugin"); -const TryNextPlugin = require("./TryNextPlugin"); -const UnsafeCachePlugin = require("./UnsafeCachePlugin"); -const UseFilePlugin = require("./UseFilePlugin"); - -/** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */ -/** @typedef {import("./ExtensionAliasPlugin").ExtensionAliasOption} ExtensionAliasOption */ -/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ -/** @typedef {import("./Resolver").EnsuredHooks} EnsuredHooks */ -/** @typedef {import("./Resolver").FileSystem} FileSystem */ -/** @typedef {import("./Resolver").KnownHooks} KnownHooks */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ - -/** @typedef {string|string[]|false} AliasOptionNewRequest */ -/** @typedef {{[k: string]: AliasOptionNewRequest}} AliasOptions */ -/** @typedef {{[k: string]: string|string[] }} ExtensionAliasOptions */ -/** @typedef {false | 0 | "" | null | undefined} Falsy */ -/** @typedef {{apply: function(Resolver): void} | (function(this: Resolver, Resolver): void) | Falsy} Plugin */ - -/** - * @typedef {Object} UserResolveOptions - * @property {(AliasOptions | AliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value - * @property {(AliasOptions | AliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option - * @property {ExtensionAliasOptions=} extensionAlias An object which maps extension to extension aliases - * @property {(string | string[])[]=} aliasFields A list of alias fields in description files - * @property {(function(ResolveRequest): boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. - * @property {boolean=} cacheWithContext Whether or not the unsafeCache should include request context as part of the cache key. - * @property {string[]=} descriptionFiles A list of description files to read from - * @property {string[]=} conditionNames A list of exports field condition names. - * @property {boolean=} enforceExtension Enforce that a extension from extensions must be used - * @property {(string | string[])[]=} exportsFields A list of exports fields in description files - * @property {(string | string[])[]=} importsFields A list of imports fields in description files - * @property {string[]=} extensions A list of extensions which should be tried for files - * @property {FileSystem} fileSystem The file system which should be used - * @property {(object | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests - * @property {boolean=} symlinks Resolve symlinks to their symlinked location - * @property {Resolver=} resolver A prepared Resolver to which the plugins are attached - * @property {string[] | string=} modules A list of directories to resolve modules from, can be absolute path or folder name - * @property {(string | string[] | {name: string | string[], forceRelative: boolean})[]=} mainFields A list of main fields in description files - * @property {string[]=} mainFiles A list of main files in directories - * @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied - * @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto" - * @property {string[]=} roots A list of root paths - * @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it - * @property {boolean=} resolveToContext Resolve to a context instead of a file - * @property {(string|RegExp)[]=} restrictions A list of resolve restrictions - * @property {boolean=} useSyncFileSystemCalls Use only the sync constraints of the file system calls - * @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules - * @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots - */ - -/** - * @typedef {Object} ResolveOptions - * @property {AliasOptionEntry[]} alias - * @property {AliasOptionEntry[]} fallback - * @property {Set} aliasFields - * @property {ExtensionAliasOption[]} extensionAlias - * @property {(function(ResolveRequest): boolean)} cachePredicate - * @property {boolean} cacheWithContext - * @property {Set} conditionNames A list of exports field condition names. - * @property {string[]} descriptionFiles - * @property {boolean} enforceExtension - * @property {Set} exportsFields - * @property {Set} importsFields - * @property {Set} extensions - * @property {FileSystem} fileSystem - * @property {object | false} unsafeCache - * @property {boolean} symlinks - * @property {Resolver=} resolver - * @property {Array} modules - * @property {{name: string[], forceRelative: boolean}[]} mainFields - * @property {Set} mainFiles - * @property {Plugin[]} plugins - * @property {PnpApi | null} pnpApi - * @property {Set} roots - * @property {boolean} fullySpecified - * @property {boolean} resolveToContext - * @property {Set} restrictions - * @property {boolean} preferRelative - * @property {boolean} preferAbsolute - */ - -/** - * @param {PnpApi | null=} option option - * @returns {PnpApi | null} processed option - */ -function processPnpApiOption(option) { - if ( - option === undefined && - /** @type {NodeJS.ProcessVersions & {pnp: string}} */ versions.pnp - ) { - // @ts-ignore - return require("pnpapi"); // eslint-disable-line node/no-missing-require - } - - return option || null; -} - -/** - * @param {AliasOptions | AliasOptionEntry[] | undefined} alias alias - * @returns {AliasOptionEntry[]} normalized aliases - */ -function normalizeAlias(alias) { - return typeof alias === "object" && !Array.isArray(alias) && alias !== null - ? Object.keys(alias).map(key => { - /** @type {AliasOptionEntry} */ - const obj = { name: key, onlyModule: false, alias: alias[key] }; - - if (/\$$/.test(key)) { - obj.onlyModule = true; - obj.name = key.slice(0, -1); - } - - return obj; - }) - : /** @type {Array} */ (alias) || []; -} - -/** - * @param {UserResolveOptions} options input options - * @returns {ResolveOptions} output options - */ -function createOptions(options) { - const mainFieldsSet = new Set(options.mainFields || ["main"]); - /** @type {ResolveOptions["mainFields"]} */ - const mainFields = []; - - for (const item of mainFieldsSet) { - if (typeof item === "string") { - mainFields.push({ - name: [item], - forceRelative: true - }); - } else if (Array.isArray(item)) { - mainFields.push({ - name: item, - forceRelative: true - }); - } else { - mainFields.push({ - name: Array.isArray(item.name) ? item.name : [item.name], - forceRelative: item.forceRelative - }); - } - } - - return { - alias: normalizeAlias(options.alias), - fallback: normalizeAlias(options.fallback), - aliasFields: new Set(options.aliasFields), - cachePredicate: - options.cachePredicate || - function () { - return true; - }, - cacheWithContext: - typeof options.cacheWithContext !== "undefined" - ? options.cacheWithContext - : true, - exportsFields: new Set(options.exportsFields || ["exports"]), - importsFields: new Set(options.importsFields || ["imports"]), - conditionNames: new Set(options.conditionNames), - descriptionFiles: Array.from( - new Set(options.descriptionFiles || ["package.json"]) - ), - enforceExtension: - options.enforceExtension === undefined - ? options.extensions && options.extensions.includes("") - ? true - : false - : options.enforceExtension, - extensions: new Set(options.extensions || [".js", ".json", ".node"]), - extensionAlias: options.extensionAlias - ? Object.keys(options.extensionAlias).map(k => ({ - extension: k, - alias: /** @type {ExtensionAliasOptions} */ (options.extensionAlias)[ - k - ] - })) - : [], - fileSystem: options.useSyncFileSystemCalls - ? new SyncAsyncFileSystemDecorator( - /** @type {SyncFileSystem} */ ( - /** @type {unknown} */ (options.fileSystem) - ) - ) - : options.fileSystem, - unsafeCache: - options.unsafeCache && typeof options.unsafeCache !== "object" - ? {} - : options.unsafeCache || false, - symlinks: typeof options.symlinks !== "undefined" ? options.symlinks : true, - resolver: options.resolver, - modules: mergeFilteredToArray( - Array.isArray(options.modules) - ? options.modules - : options.modules - ? [options.modules] - : ["node_modules"], - item => { - const type = getType(item); - return type === PathType.Normal || type === PathType.Relative; - } - ), - mainFields, - mainFiles: new Set(options.mainFiles || ["index"]), - plugins: options.plugins || [], - pnpApi: processPnpApiOption(options.pnpApi), - roots: new Set(options.roots || undefined), - fullySpecified: options.fullySpecified || false, - resolveToContext: options.resolveToContext || false, - preferRelative: options.preferRelative || false, - preferAbsolute: options.preferAbsolute || false, - restrictions: new Set(options.restrictions) - }; -} - -/** - * @param {UserResolveOptions} options resolve options - * @returns {Resolver} created resolver - */ -exports.createResolver = function (options) { - const normalizedOptions = createOptions(options); - - const { - alias, - fallback, - aliasFields, - cachePredicate, - cacheWithContext, - conditionNames, - descriptionFiles, - enforceExtension, - exportsFields, - extensionAlias, - importsFields, - extensions, - fileSystem, - fullySpecified, - mainFields, - mainFiles, - modules, - plugins: userPlugins, - pnpApi, - resolveToContext, - preferRelative, - preferAbsolute, - symlinks, - unsafeCache, - resolver: customResolver, - restrictions, - roots - } = normalizedOptions; - - const plugins = userPlugins.slice(); - - const resolver = customResolver - ? customResolver - : new Resolver(fileSystem, normalizedOptions); - - //// pipeline //// - - resolver.ensureHook("resolve"); - resolver.ensureHook("internalResolve"); - resolver.ensureHook("newInternalResolve"); - resolver.ensureHook("parsedResolve"); - resolver.ensureHook("describedResolve"); - resolver.ensureHook("rawResolve"); - resolver.ensureHook("normalResolve"); - resolver.ensureHook("internal"); - resolver.ensureHook("rawModule"); - resolver.ensureHook("module"); - resolver.ensureHook("resolveAsModule"); - resolver.ensureHook("undescribedResolveInPackage"); - resolver.ensureHook("resolveInPackage"); - resolver.ensureHook("resolveInExistingDirectory"); - resolver.ensureHook("relative"); - resolver.ensureHook("describedRelative"); - resolver.ensureHook("directory"); - resolver.ensureHook("undescribedExistingDirectory"); - resolver.ensureHook("existingDirectory"); - resolver.ensureHook("undescribedRawFile"); - resolver.ensureHook("rawFile"); - resolver.ensureHook("file"); - resolver.ensureHook("finalFile"); - resolver.ensureHook("existingFile"); - resolver.ensureHook("resolved"); - - // TODO remove in next major - // cspell:word Interal - // Backward-compat - // @ts-ignore - resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve; - - // resolve - for (const { source, resolveOptions } of [ - { source: "resolve", resolveOptions: { fullySpecified } }, - { source: "internal-resolve", resolveOptions: { fullySpecified: false } } - ]) { - if (unsafeCache) { - plugins.push( - new UnsafeCachePlugin( - source, - cachePredicate, - /** @type {import("./UnsafeCachePlugin").Cache} */ (unsafeCache), - cacheWithContext, - `new-${source}` - ) - ); - plugins.push( - new ParsePlugin(`new-${source}`, resolveOptions, "parsed-resolve") - ); - } else { - plugins.push(new ParsePlugin(source, resolveOptions, "parsed-resolve")); - } - } - - // parsed-resolve - plugins.push( - new DescriptionFilePlugin( - "parsed-resolve", - descriptionFiles, - false, - "described-resolve" - ) - ); - plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); - - // described-resolve - plugins.push(new NextPlugin("described-resolve", "raw-resolve")); - if (fallback.length > 0) { - plugins.push( - new AliasPlugin("described-resolve", fallback, "internal-resolve") - ); - } - - // raw-resolve - if (alias.length > 0) { - plugins.push(new AliasPlugin("raw-resolve", alias, "internal-resolve")); - } - aliasFields.forEach(item => { - plugins.push(new AliasFieldPlugin("raw-resolve", item, "internal-resolve")); - }); - extensionAlias.forEach(item => - plugins.push( - new ExtensionAliasPlugin("raw-resolve", item, "normal-resolve") - ) - ); - plugins.push(new NextPlugin("raw-resolve", "normal-resolve")); - - // normal-resolve - if (preferRelative) { - plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); - } - plugins.push( - new ConditionalPlugin( - "after-normal-resolve", - { module: true }, - "resolve as module", - false, - "raw-module" - ) - ); - plugins.push( - new ConditionalPlugin( - "after-normal-resolve", - { internal: true }, - "resolve as internal import", - false, - "internal" - ) - ); - if (preferAbsolute) { - plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); - } - if (roots.size > 0) { - plugins.push(new RootsPlugin("after-normal-resolve", roots, "relative")); - } - if (!preferRelative && !preferAbsolute) { - plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); - } - - // internal - importsFields.forEach(importsField => { - plugins.push( - new ImportsFieldPlugin( - "internal", - conditionNames, - importsField, - "relative", - "internal-resolve" - ) - ); - }); - - // raw-module - exportsFields.forEach(exportsField => { - plugins.push( - new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module") - ); - }); - modules.forEach(item => { - if (Array.isArray(item)) { - if (item.includes("node_modules") && pnpApi) { - plugins.push( - new ModulesInHierarchicalDirectoriesPlugin( - "raw-module", - item.filter(i => i !== "node_modules"), - "module" - ) - ); - plugins.push( - new PnpPlugin("raw-module", pnpApi, "undescribed-resolve-in-package") - ); - } else { - plugins.push( - new ModulesInHierarchicalDirectoriesPlugin( - "raw-module", - item, - "module" - ) - ); - } - } else { - plugins.push(new ModulesInRootPlugin("raw-module", item, "module")); - } - }); - - // module - plugins.push(new JoinRequestPartPlugin("module", "resolve-as-module")); - - // resolve-as-module - if (!resolveToContext) { - plugins.push( - new ConditionalPlugin( - "resolve-as-module", - { directory: false, request: "." }, - "single file module", - true, - "undescribed-raw-file" - ) - ); - } - plugins.push( - new DirectoryExistsPlugin( - "resolve-as-module", - "undescribed-resolve-in-package" - ) - ); - - // undescribed-resolve-in-package - plugins.push( - new DescriptionFilePlugin( - "undescribed-resolve-in-package", - descriptionFiles, - false, - "resolve-in-package" - ) - ); - plugins.push( - new NextPlugin("after-undescribed-resolve-in-package", "resolve-in-package") - ); - - // resolve-in-package - exportsFields.forEach(exportsField => { - plugins.push( - new ExportsFieldPlugin( - "resolve-in-package", - conditionNames, - exportsField, - "relative" - ) - ); - }); - plugins.push( - new NextPlugin("resolve-in-package", "resolve-in-existing-directory") - ); - - // resolve-in-existing-directory - plugins.push( - new JoinRequestPlugin("resolve-in-existing-directory", "relative") - ); - - // relative - plugins.push( - new DescriptionFilePlugin( - "relative", - descriptionFiles, - true, - "described-relative" - ) - ); - plugins.push(new NextPlugin("after-relative", "described-relative")); - - // described-relative - if (resolveToContext) { - plugins.push(new NextPlugin("described-relative", "directory")); - } else { - plugins.push( - new ConditionalPlugin( - "described-relative", - { directory: false }, - null, - true, - "raw-file" - ) - ); - plugins.push( - new ConditionalPlugin( - "described-relative", - { fullySpecified: false }, - "as directory", - true, - "directory" - ) - ); - } - - // directory - plugins.push( - new DirectoryExistsPlugin("directory", "undescribed-existing-directory") - ); - - if (resolveToContext) { - // undescribed-existing-directory - plugins.push(new NextPlugin("undescribed-existing-directory", "resolved")); - } else { - // undescribed-existing-directory - plugins.push( - new DescriptionFilePlugin( - "undescribed-existing-directory", - descriptionFiles, - false, - "existing-directory" - ) - ); - mainFiles.forEach(item => { - plugins.push( - new UseFilePlugin( - "undescribed-existing-directory", - item, - "undescribed-raw-file" - ) - ); - }); - - // described-existing-directory - mainFields.forEach(item => { - plugins.push( - new MainFieldPlugin( - "existing-directory", - item, - "resolve-in-existing-directory" - ) - ); - }); - mainFiles.forEach(item => { - plugins.push( - new UseFilePlugin("existing-directory", item, "undescribed-raw-file") - ); - }); - - // undescribed-raw-file - plugins.push( - new DescriptionFilePlugin( - "undescribed-raw-file", - descriptionFiles, - true, - "raw-file" - ) - ); - plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); - - // raw-file - plugins.push( - new ConditionalPlugin( - "raw-file", - { fullySpecified: true }, - null, - false, - "file" - ) - ); - if (!enforceExtension) { - plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); - } - extensions.forEach(item => { - plugins.push(new AppendPlugin("raw-file", item, "file")); - }); - - // file - if (alias.length > 0) - plugins.push(new AliasPlugin("file", alias, "internal-resolve")); - aliasFields.forEach(item => { - plugins.push(new AliasFieldPlugin("file", item, "internal-resolve")); - }); - plugins.push(new NextPlugin("file", "final-file")); - - // final-file - plugins.push(new FileExistsPlugin("final-file", "existing-file")); - - // existing-file - if (symlinks) - plugins.push(new SymlinkPlugin("existing-file", "existing-file")); - plugins.push(new NextPlugin("existing-file", "resolved")); - } - - const resolved = - /** @type {KnownHooks & EnsuredHooks} */ - (resolver.hooks).resolved; - - // resolved - if (restrictions.size > 0) { - plugins.push(new RestrictionsPlugin(resolved, restrictions)); - } - - plugins.push(new ResultPlugin(resolved)); - - //// RESOLVER //// - - for (const plugin of plugins) { - if (typeof plugin === "function") { - /** @type {function(this: Resolver, Resolver): void} */ - (plugin).call(resolver, resolver); - } else if (plugin) { - plugin.apply(resolver); - } - } - - return resolver; -}; - -/** - * Merging filtered elements - * @param {string[]} array source array - * @param {function(string): boolean} filter predicate - * @returns {Array} merge result - */ -function mergeFilteredToArray(array, filter) { - /** @type {Array} */ - const result = []; - const set = new Set(array); - - for (const item of set) { - if (filter(item)) { - const lastElement = - result.length > 0 ? result[result.length - 1] : undefined; - if (Array.isArray(lastElement)) { - lastElement.push(item); - } else { - result.push([item]); - } - } else { - result.push(item); - } - } - - return result; -} diff --git a/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js b/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js deleted file mode 100644 index e52ca9d..0000000 --- a/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -const slashCode = "/".charCodeAt(0); -const backslashCode = "\\".charCodeAt(0); - -/** - * @param {string} path path - * @param {string} parent parent path - * @returns {boolean} true, if path is inside of parent - */ -const isInside = (path, parent) => { - if (!path.startsWith(parent)) return false; - if (path.length === parent.length) return true; - const charCode = path.charCodeAt(parent.length); - return charCode === slashCode || charCode === backslashCode; -}; - -module.exports = class RestrictionsPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {Set} restrictions restrictions - */ - constructor(source, restrictions) { - this.source = source; - this.restrictions = restrictions; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - resolver - .getHook(this.source) - .tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => { - if (typeof request.path === "string") { - const path = request.path; - for (const rule of this.restrictions) { - if (typeof rule === "string") { - if (!isInside(path, rule)) { - if (resolveContext.log) { - resolveContext.log( - `${path} is not inside of the restriction ${rule}` - ); - } - return callback(null, null); - } - } else if (!rule.test(path)) { - if (resolveContext.log) { - resolveContext.log( - `${path} doesn't match the restriction ${rule}` - ); - } - return callback(null, null); - } - } - } - - callback(); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/ResultPlugin.js b/node_modules/enhanced-resolve/lib/ResultPlugin.js deleted file mode 100644 index e25c43f..0000000 --- a/node_modules/enhanced-resolve/lib/ResultPlugin.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class ResultPlugin { - /** - * @param {ResolveStepHook} source source - */ - constructor(source) { - this.source = source; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - this.source.tapAsync( - "ResultPlugin", - (request, resolverContext, callback) => { - const obj = { ...request }; - if (resolverContext.log) - resolverContext.log("reporting result " + obj.path); - resolver.hooks.result.callAsync(obj, resolverContext, err => { - if (err) return callback(err); - if (typeof resolverContext.yield === "function") { - resolverContext.yield(obj); - callback(null, null); - } else { - callback(null, obj); - } - }); - } - ); - } -}; diff --git a/node_modules/enhanced-resolve/lib/RootsPlugin.js b/node_modules/enhanced-resolve/lib/RootsPlugin.js deleted file mode 100644 index 1d29911..0000000 --- a/node_modules/enhanced-resolve/lib/RootsPlugin.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -const forEachBail = require("./forEachBail"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -class RootsPlugin { - /** - * @param {string | ResolveStepHook} source source hook - * @param {Set} roots roots - * @param {string | ResolveStepHook} target target hook - */ - constructor(source, roots, target) { - this.roots = Array.from(roots); - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - - resolver - .getHook(this.source) - .tapAsync("RootsPlugin", (request, resolveContext, callback) => { - const req = request.request; - if (!req) return callback(); - if (!req.startsWith("/")) return callback(); - - forEachBail( - this.roots, - /** - * @param {string} root root - * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback - * @returns {void} - */ - (root, callback) => { - const path = resolver.join(root, req.slice(1)); - /** @type {ResolveRequest} */ - const obj = { - ...request, - path, - relativePath: request.relativePath && path - }; - resolver.doResolve( - target, - obj, - `root path ${root}`, - resolveContext, - callback - ); - }, - callback - ); - }); - } -} - -module.exports = RootsPlugin; diff --git a/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js b/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js deleted file mode 100644 index a8dc148..0000000 --- a/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const DescriptionFileUtils = require("./DescriptionFileUtils"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").JsonObject} JsonObject */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -const slashCode = "/".charCodeAt(0); - -module.exports = class SelfReferencePlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | string[]} fieldNamePath name path - * @param {string | ResolveStepHook} target target - */ - constructor(source, fieldNamePath, target) { - this.source = source; - this.target = target; - this.fieldName = fieldNamePath; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("SelfReferencePlugin", (request, resolveContext, callback) => { - if (!request.descriptionFilePath) return callback(); - - const req = request.request; - if (!req) return callback(); - - // Feature is only enabled when an exports field is present - const exportsField = DescriptionFileUtils.getField( - /** @type {JsonObject} */ (request.descriptionFileData), - this.fieldName - ); - if (!exportsField) return callback(); - - const name = DescriptionFileUtils.getField( - /** @type {JsonObject} */ (request.descriptionFileData), - "name" - ); - if (typeof name !== "string") return callback(); - - if ( - req.startsWith(name) && - (req.length === name.length || - req.charCodeAt(name.length) === slashCode) - ) { - const remainingRequest = `.${req.slice(name.length)}`; - /** @type {ResolveRequest} */ - const obj = { - ...request, - request: remainingRequest, - path: /** @type {string} */ (request.descriptionFileRoot), - relativePath: "." - }; - - resolver.doResolve( - target, - obj, - "self reference", - resolveContext, - callback - ); - } else { - return callback(); - } - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/SymlinkPlugin.js b/node_modules/enhanced-resolve/lib/SymlinkPlugin.js deleted file mode 100644 index 7adab54..0000000 --- a/node_modules/enhanced-resolve/lib/SymlinkPlugin.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const forEachBail = require("./forEachBail"); -const getPaths = require("./getPaths"); -const { getType, PathType } = require("./util/path"); - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class SymlinkPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string | ResolveStepHook} target target - */ - constructor(source, target) { - this.source = source; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - const fs = resolver.fileSystem; - resolver - .getHook(this.source) - .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { - if (request.ignoreSymlinks) return callback(); - const pathsResult = getPaths(/** @type {string} */ (request.path)); - const pathSegments = pathsResult.segments; - const paths = pathsResult.paths; - - let containsSymlink = false; - let idx = -1; - forEachBail( - paths, - /** - * @param {string} path path - * @param {(err?: null|Error, result?: null|number) => void} callback callback - * @returns {void} - */ - (path, callback) => { - idx++; - if (resolveContext.fileDependencies) - resolveContext.fileDependencies.add(path); - fs.readlink(path, (err, result) => { - if (!err && result) { - pathSegments[idx] = /** @type {string} */ (result); - containsSymlink = true; - // Shortcut when absolute symlink found - const resultType = getType(result.toString()); - if ( - resultType === PathType.AbsoluteWin || - resultType === PathType.AbsolutePosix - ) { - return callback(null, idx); - } - } - callback(); - }); - }, - /** - * @param {null|Error} [err] error - * @param {null|number} [idx] result - * @returns {void} - */ - (err, idx) => { - if (!containsSymlink) return callback(); - const resultSegments = - typeof idx === "number" - ? pathSegments.slice(0, idx + 1) - : pathSegments.slice(); - const result = resultSegments.reduceRight((a, b) => { - return resolver.join(a, b); - }); - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: result - }; - resolver.doResolve( - target, - obj, - "resolved symlink to " + result, - resolveContext, - callback - ); - } - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js b/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js deleted file mode 100644 index 12f8d38..0000000 --- a/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver").FileSystem} FileSystem */ -/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ - -/** - * @param {SyncFileSystem} fs file system implementation - * @constructor - */ -function SyncAsyncFileSystemDecorator(fs) { - this.fs = fs; - - /** @type {FileSystem["lstat"] | undefined} */ - this.lstat = undefined; - /** @type {SyncFileSystem["lstatSync"] | undefined} */ - this.lstatSync = undefined; - const lstatSync = fs.lstatSync; - if (lstatSync) { - this.lstat = (arg, options, callback) => { - let result; - try { - result = lstatSync.call(fs, arg); - } catch (e) { - // @ts-ignore - return (callback || options)(e); - } - // @ts-ignore - (callback || options)(null, result); - }; - this.lstatSync = (arg, options) => lstatSync.call(fs, arg, options); - } - // @ts-ignore - this.stat = (arg, options, callback) => { - let result; - try { - result = callback ? fs.statSync(arg, options) : fs.statSync(arg); - } catch (e) { - return (callback || options)(e); - } - (callback || options)(null, result); - }; - /** @type {SyncFileSystem["statSync"]} */ - this.statSync = (arg, options) => fs.statSync(arg, options); - // @ts-ignore - this.readdir = (arg, options, callback) => { - let result; - try { - result = fs.readdirSync(arg); - } catch (e) { - return (callback || options)(e); - } - (callback || options)(null, result); - }; - /** @type {SyncFileSystem["readdirSync"]} */ - this.readdirSync = (arg, options) => fs.readdirSync(arg, options); - // @ts-ignore - this.readFile = (arg, options, callback) => { - let result; - try { - result = fs.readFileSync(arg); - } catch (e) { - return (callback || options)(e); - } - (callback || options)(null, result); - }; - /** @type {SyncFileSystem["readFileSync"]} */ - this.readFileSync = (arg, options) => fs.readFileSync(arg, options); - // @ts-ignore - this.readlink = (arg, options, callback) => { - let result; - try { - result = fs.readlinkSync(arg); - } catch (e) { - return (callback || options)(e); - } - (callback || options)(null, result); - }; - /** @type {SyncFileSystem["readlinkSync"]} */ - this.readlinkSync = (arg, options) => fs.readlinkSync(arg, options); - /** @type {FileSystem["readJson"] | undefined} */ - this.readJson = undefined; - /** @type {SyncFileSystem["readJsonSync"] | undefined} */ - this.readJsonSync = undefined; - const readJsonSync = fs.readJsonSync; - if (readJsonSync) { - this.readJson = (arg, options, callback) => { - let result; - try { - result = readJsonSync.call(fs, arg); - } catch (e) { - // @ts-ignore - return (callback || options)(e); - } - (callback || options)(null, result); - }; - this.readJsonSync = (arg, options) => readJsonSync.call(fs, arg, options); - } -} -module.exports = SyncAsyncFileSystemDecorator; diff --git a/node_modules/enhanced-resolve/lib/TryNextPlugin.js b/node_modules/enhanced-resolve/lib/TryNextPlugin.js deleted file mode 100644 index 1b70bef..0000000 --- a/node_modules/enhanced-resolve/lib/TryNextPlugin.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class TryNextPlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string} message message - * @param {string | ResolveStepHook} target target - */ - constructor(source, message, target) { - this.source = source; - this.message = message; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("TryNextPlugin", (request, resolveContext, callback) => { - resolver.doResolve( - target, - request, - this.message, - resolveContext, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js deleted file mode 100644 index e6c0149..0000000 --- a/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */ -/** @typedef {{[k: string]: ResolveRequest | ResolveRequest[] | undefined}} Cache */ - -/** - * @param {string} type type of cache - * @param {ResolveRequest} request request - * @param {boolean} withContext cache with context? - * @returns {string} cache id - */ -function getCacheId(type, request, withContext) { - return JSON.stringify({ - type, - context: withContext ? request.context : "", - path: request.path, - query: request.query, - fragment: request.fragment, - request: request.request - }); -} - -module.exports = class UnsafeCachePlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {function(ResolveRequest): boolean} filterPredicate filterPredicate - * @param {Cache} cache cache - * @param {boolean} withContext withContext - * @param {string | ResolveStepHook} target target - */ - constructor(source, filterPredicate, cache, withContext, target) { - this.source = source; - this.filterPredicate = filterPredicate; - this.withContext = withContext; - this.cache = cache; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => { - if (!this.filterPredicate(request)) return callback(); - const isYield = typeof resolveContext.yield === "function"; - const cacheId = getCacheId( - isYield ? "yield" : "default", - request, - this.withContext - ); - const cacheEntry = this.cache[cacheId]; - if (cacheEntry) { - if (isYield) { - const yield_ = /** @type {Function} */ (resolveContext.yield); - if (Array.isArray(cacheEntry)) { - for (const result of cacheEntry) yield_(result); - } else { - yield_(cacheEntry); - } - return callback(null, null); - } - return callback(null, /** @type {ResolveRequest} */ (cacheEntry)); - } - - /** @type {ResolveContextYield|undefined} */ - let yieldFn; - /** @type {ResolveContextYield|undefined} */ - let yield_; - /** @type {ResolveRequest[]} */ - const yieldResult = []; - if (isYield) { - yieldFn = resolveContext.yield; - yield_ = result => { - yieldResult.push(result); - }; - } - - resolver.doResolve( - target, - request, - null, - yield_ ? { ...resolveContext, yield: yield_ } : resolveContext, - (err, result) => { - if (err) return callback(err); - if (isYield) { - if (result) yieldResult.push(result); - for (const result of yieldResult) { - /** @type {ResolveContextYield} */ - (yieldFn)(result); - } - this.cache[cacheId] = yieldResult; - return callback(null, null); - } - if (result) return callback(null, (this.cache[cacheId] = result)); - callback(); - } - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/UseFilePlugin.js b/node_modules/enhanced-resolve/lib/UseFilePlugin.js deleted file mode 100644 index 14aebdd..0000000 --- a/node_modules/enhanced-resolve/lib/UseFilePlugin.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ - -module.exports = class UseFilePlugin { - /** - * @param {string | ResolveStepHook} source source - * @param {string} filename filename - * @param {string | ResolveStepHook} target target - */ - constructor(source, filename, target) { - this.source = source; - this.filename = filename; - this.target = target; - } - - /** - * @param {Resolver} resolver the resolver - * @returns {void} - */ - apply(resolver) { - const target = resolver.ensureHook(this.target); - resolver - .getHook(this.source) - .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { - const filePath = resolver.join( - /** @type {string} */ (request.path), - this.filename - ); - - /** @type {ResolveRequest} */ - const obj = { - ...request, - path: filePath, - relativePath: - request.relativePath && - resolver.join(request.relativePath, this.filename) - }; - resolver.doResolve( - target, - obj, - "using path: " + filePath, - resolveContext, - callback - ); - }); - } -}; diff --git a/node_modules/enhanced-resolve/lib/createInnerContext.js b/node_modules/enhanced-resolve/lib/createInnerContext.js deleted file mode 100644 index 88c7a58..0000000 --- a/node_modules/enhanced-resolve/lib/createInnerContext.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ - -/** - * @param {ResolveContext} options options for inner context - * @param {null|string} message message to log - * @returns {ResolveContext} inner context - */ -module.exports = function createInnerContext(options, message) { - let messageReported = false; - let innerLog = undefined; - if (options.log) { - if (message) { - /** - * @param {string} msg message - */ - innerLog = msg => { - if (!messageReported) { - /** @type {(function(string): void)} */ - (options.log)(message); - messageReported = true; - } - - /** @type {(function(string): void)} */ - (options.log)(" " + msg); - }; - } else { - innerLog = options.log; - } - } - - return { - log: innerLog, - yield: options.yield, - fileDependencies: options.fileDependencies, - contextDependencies: options.contextDependencies, - missingDependencies: options.missingDependencies, - stack: options.stack - }; -}; diff --git a/node_modules/enhanced-resolve/lib/forEachBail.js b/node_modules/enhanced-resolve/lib/forEachBail.js deleted file mode 100644 index 273afff..0000000 --- a/node_modules/enhanced-resolve/lib/forEachBail.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ - -/** - * @template T - * @template Z - * @callback Iterator - * @param {T} item item - * @param {(err?: null|Error, result?: null|Z) => void} callback callback - * @param {number} i index - * @returns {void} - */ - -/** - * @template T - * @template Z - * @param {T[]} array array - * @param {Iterator} iterator iterator - * @param {(err?: null|Error, result?: null|Z) => void} callback callback after all items are iterated - * @returns {void} - */ -module.exports = function forEachBail(array, iterator, callback) { - if (array.length === 0) return callback(); - - let i = 0; - const next = () => { - /** @type {boolean|undefined} */ - let loop = undefined; - iterator( - array[i++], - (err, result) => { - if (err || result !== undefined || i >= array.length) { - return callback(err, result); - } - if (loop === false) while (next()); - loop = true; - }, - i - ); - if (!loop) loop = false; - return loop; - }; - while (next()); -}; diff --git a/node_modules/enhanced-resolve/lib/getInnerRequest.js b/node_modules/enhanced-resolve/lib/getInnerRequest.js deleted file mode 100644 index c34c10f..0000000 --- a/node_modules/enhanced-resolve/lib/getInnerRequest.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ - -/** - * @param {Resolver} resolver resolver - * @param {ResolveRequest} request string - * @returns {string} inner request - */ -module.exports = function getInnerRequest(resolver, request) { - if ( - typeof request.__innerRequest === "string" && - request.__innerRequest_request === request.request && - request.__innerRequest_relativePath === request.relativePath - ) - return request.__innerRequest; - /** @type {string|undefined} */ - let innerRequest; - if (request.request) { - innerRequest = request.request; - if (/^\.\.?(?:\/|$)/.test(innerRequest) && request.relativePath) { - innerRequest = resolver.join(request.relativePath, innerRequest); - } - } else { - innerRequest = request.relativePath; - } - request.__innerRequest_request = request.request; - request.__innerRequest_relativePath = request.relativePath; - return (request.__innerRequest = /** @type {string} */ (innerRequest)); -}; diff --git a/node_modules/enhanced-resolve/lib/getPaths.js b/node_modules/enhanced-resolve/lib/getPaths.js deleted file mode 100644 index d5835b0..0000000 --- a/node_modules/enhanced-resolve/lib/getPaths.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -/** - * @param {string} path path - * @returns {{paths: string[], segments: string[]}}} paths and segments - */ -module.exports = function getPaths(path) { - if (path === "/") return { paths: ["/"], segments: [""] }; - const parts = path.split(/(.*?[\\/]+)/); - const paths = [path]; - const segments = [parts[parts.length - 1]]; - let part = parts[parts.length - 1]; - path = path.substring(0, path.length - part.length - 1); - for (let i = parts.length - 2; i > 2; i -= 2) { - paths.push(path); - part = parts[i]; - path = path.substring(0, path.length - part.length) || "/"; - segments.push(part.slice(0, -1)); - } - part = parts[1]; - segments.push(part); - paths.push(part); - return { - paths: paths, - segments: segments - }; -}; - -/** - * @param {string} path path - * @returns {string|null} basename or null - */ -module.exports.basename = function basename(path) { - const i = path.lastIndexOf("/"), - j = path.lastIndexOf("\\"); - const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; - if (p < 0) return null; - const s = path.slice(p + 1); - return s; -}; diff --git a/node_modules/enhanced-resolve/lib/index.js b/node_modules/enhanced-resolve/lib/index.js deleted file mode 100644 index ab02cfa..0000000 --- a/node_modules/enhanced-resolve/lib/index.js +++ /dev/null @@ -1,203 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const fs = require("graceful-fs"); -const CachedInputFileSystem = require("./CachedInputFileSystem"); -const ResolverFactory = require("./ResolverFactory"); - -/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ -/** @typedef {import("./Resolver")} Resolver */ -/** @typedef {import("./Resolver").FileSystem} FileSystem */ -/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ -/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ -/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ -/** @typedef {import("./ResolverFactory").Plugin} Plugin */ -/** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ -/** @typedef {{ - * (context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; - * (context: object, path: string, request: string, callback: ResolveCallback): void; - * (path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; - * (path: string, request: string, callback: ResolveCallback): void; - * }} ResolveFunctionAsync - */ -/** @typedef {{ - * (context: object, path: string, request: string): string|false; - * (path: string, request: string): string|false; - * }} ResolveFunction - */ - -const nodeFileSystem = new CachedInputFileSystem(fs, 4000); - -const nodeContext = { - environments: ["node+es3+es5+process+native"] -}; - -const asyncResolver = ResolverFactory.createResolver({ - conditionNames: ["node"], - extensions: [".js", ".json", ".node"], - fileSystem: nodeFileSystem -}); - -/** - * @type {ResolveFunctionAsync} - */ -const resolve = - /** - * @param {object|string} context - * @param {string} path - * @param {string|ResolveContext|ResolveCallback} request - * @param {ResolveContext|ResolveCallback=} resolveContext - * @param {ResolveCallback=} callback - */ - (context, path, request, resolveContext, callback) => { - if (typeof context === "string") { - callback = /** @type {ResolveCallback} */ (resolveContext); - resolveContext = /** @type {ResolveContext} */ (request); - request = path; - path = context; - context = nodeContext; - } - if (typeof callback !== "function") { - callback = /** @type {ResolveCallback} */ (resolveContext); - } - asyncResolver.resolve( - context, - path, - /** @type {string} */ (request), - /** @type {ResolveContext} */ (resolveContext), - /** @type {ResolveCallback} */ (callback) - ); - }; - -const syncResolver = ResolverFactory.createResolver({ - conditionNames: ["node"], - extensions: [".js", ".json", ".node"], - useSyncFileSystemCalls: true, - fileSystem: nodeFileSystem -}); - -/** - * @type {ResolveFunction} - */ -const resolveSync = - /** - * @param {object|string} context - * @param {string} path - * @param {string=} request - */ - (context, path, request) => { - if (typeof context === "string") { - request = path; - path = context; - context = nodeContext; - } - return syncResolver.resolveSync( - context, - path, - /** @type {string} */ (request) - ); - }; - -/** @typedef {Omit & Partial>} ResolveOptionsOptionalFS */ - -/** - * @param {ResolveOptionsOptionalFS} options Resolver options - * @returns {ResolveFunctionAsync} Resolver function - */ -function create(options) { - const resolver = ResolverFactory.createResolver({ - fileSystem: nodeFileSystem, - ...options - }); - /** - * @param {object|string} context Custom context - * @param {string} path Base path - * @param {string|ResolveContext|ResolveCallback} request String to resolve - * @param {ResolveContext|ResolveCallback=} resolveContext Resolve context - * @param {ResolveCallback=} callback Result callback - */ - return function (context, path, request, resolveContext, callback) { - if (typeof context === "string") { - callback = /** @type {ResolveCallback} */ (resolveContext); - resolveContext = /** @type {ResolveContext} */ (request); - request = path; - path = context; - context = nodeContext; - } - if (typeof callback !== "function") { - callback = /** @type {ResolveCallback} */ (resolveContext); - } - resolver.resolve( - context, - path, - /** @type {string} */ (request), - /** @type {ResolveContext} */ (resolveContext), - callback - ); - }; -} - -/** - * @param {ResolveOptionsOptionalFS} options Resolver options - * @returns {ResolveFunction} Resolver function - */ -function createSync(options) { - const resolver = ResolverFactory.createResolver({ - useSyncFileSystemCalls: true, - fileSystem: nodeFileSystem, - ...options - }); - /** - * @param {object|string} context custom context - * @param {string} path base path - * @param {string=} request request to resolve - * @returns {string|false} Resolved path or false - */ - return function (context, path, request) { - if (typeof context === "string") { - request = path; - path = context; - context = nodeContext; - } - return resolver.resolveSync(context, path, /** @type {string} */ (request)); - }; -} - -/** - * @template A - * @template B - * @param {A} obj input a - * @param {B} exports input b - * @returns {A & B} merged - */ -const mergeExports = (obj, exports) => { - const descriptors = Object.getOwnPropertyDescriptors(exports); - Object.defineProperties(obj, descriptors); - return /** @type {A & B} */ (Object.freeze(obj)); -}; - -module.exports = mergeExports(resolve, { - get sync() { - return resolveSync; - }, - create: mergeExports(create, { - get sync() { - return createSync; - } - }), - ResolverFactory, - CachedInputFileSystem, - get CloneBasenamePlugin() { - return require("./CloneBasenamePlugin"); - }, - get LogInfoPlugin() { - return require("./LogInfoPlugin"); - }, - get forEachBail() { - return require("./forEachBail"); - } -}); diff --git a/node_modules/enhanced-resolve/lib/util/entrypoints.js b/node_modules/enhanced-resolve/lib/util/entrypoints.js deleted file mode 100644 index 392898c..0000000 --- a/node_modules/enhanced-resolve/lib/util/entrypoints.js +++ /dev/null @@ -1,604 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -/** @typedef {string|(string|ConditionalMapping)[]} DirectMapping */ -/** @typedef {{[k: string]: MappingValue}} ConditionalMapping */ -/** @typedef {ConditionalMapping|DirectMapping|null} MappingValue */ -/** @typedef {Record|ConditionalMapping|DirectMapping} ExportsField */ -/** @typedef {Record} ImportsField */ - -/** - * Processing exports/imports field - * @callback FieldProcessor - * @param {string} request request - * @param {Set} conditionNames condition names - * @returns {string[]} resolved paths - */ - -/* -Example exports field: -{ - ".": "./main.js", - "./feature": { - "browser": "./feature-browser.js", - "default": "./feature.js" - } -} -Terminology: - -Enhanced-resolve name keys ("." and "./feature") as exports field keys. - -If value is string or string[], mapping is called as a direct mapping -and value called as a direct export. - -If value is key-value object, mapping is called as a conditional mapping -and value called as a conditional export. - -Key in conditional mapping is called condition name. - -Conditional mapping nested in another conditional mapping is called nested mapping. - ----------- - -Example imports field: -{ - "#a": "./main.js", - "#moment": { - "browser": "./moment/index.js", - "default": "moment" - }, - "#moment/": { - "browser": "./moment/", - "default": "moment/" - } -} -Terminology: - -Enhanced-resolve name keys ("#a" and "#moment/", "#moment") as imports field keys. - -If value is string or string[], mapping is called as a direct mapping -and value called as a direct export. - -If value is key-value object, mapping is called as a conditional mapping -and value called as a conditional export. - -Key in conditional mapping is called condition name. - -Conditional mapping nested in another conditional mapping is called nested mapping. - -*/ - -const slashCode = "/".charCodeAt(0); -const dotCode = ".".charCodeAt(0); -const hashCode = "#".charCodeAt(0); -const patternRegEx = /\*/g; - -/** - * @param {ExportsField} exportsField the exports field - * @returns {FieldProcessor} process callback - */ -module.exports.processExportsField = function processExportsField( - exportsField -) { - return createFieldProcessor( - buildExportsField(exportsField), - request => (request.length === 0 ? "." : "./" + request), - assertExportsFieldRequest, - assertExportTarget - ); -}; - -/** - * @param {ImportsField} importsField the exports field - * @returns {FieldProcessor} process callback - */ -module.exports.processImportsField = function processImportsField( - importsField -) { - return createFieldProcessor( - buildImportsField(importsField), - request => "#" + request, - assertImportsFieldRequest, - assertImportTarget - ); -}; - -/** - * @param {ExportsField | ImportsField} field root - * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` - * @param {(s: string) => string} assertRequest assertRequest - * @param {(s: string, f: boolean) => void} assertTarget assertTarget - * @returns {FieldProcessor} field processor - */ -function createFieldProcessor( - field, - normalizeRequest, - assertRequest, - assertTarget -) { - return function fieldProcessor(request, conditionNames) { - request = assertRequest(request); - - const match = findMatch(normalizeRequest(request), field); - - if (match === null) return []; - - const [mapping, remainingRequest, isSubpathMapping, isPattern] = match; - - /** @type {DirectMapping|null} */ - let direct = null; - - if (isConditionalMapping(mapping)) { - direct = conditionalMapping( - /** @type {ConditionalMapping} */ (mapping), - conditionNames - ); - - // matching not found - if (direct === null) return []; - } else { - direct = /** @type {DirectMapping} */ (mapping); - } - - return directMapping( - remainingRequest, - isPattern, - isSubpathMapping, - direct, - conditionNames, - assertTarget - ); - }; -} - -/** - * @param {string} request request - * @returns {string} updated request - */ -function assertExportsFieldRequest(request) { - if (request.charCodeAt(0) !== dotCode) { - throw new Error('Request should be relative path and start with "."'); - } - if (request.length === 1) return ""; - if (request.charCodeAt(1) !== slashCode) { - throw new Error('Request should be relative path and start with "./"'); - } - if (request.charCodeAt(request.length - 1) === slashCode) { - throw new Error("Only requesting file allowed"); - } - - return request.slice(2); -} - -/** - * @param {string} request request - * @returns {string} updated request - */ -function assertImportsFieldRequest(request) { - if (request.charCodeAt(0) !== hashCode) { - throw new Error('Request should start with "#"'); - } - if (request.length === 1) { - throw new Error("Request should have at least 2 characters"); - } - if (request.charCodeAt(1) === slashCode) { - throw new Error('Request should not start with "#/"'); - } - if (request.charCodeAt(request.length - 1) === slashCode) { - throw new Error("Only requesting file allowed"); - } - - return request.slice(1); -} - -/** - * @param {string} exp export target - * @param {boolean} expectFolder is folder expected - */ -function assertExportTarget(exp, expectFolder) { - if ( - exp.charCodeAt(0) === slashCode || - (exp.charCodeAt(0) === dotCode && exp.charCodeAt(1) !== slashCode) - ) { - throw new Error( - `Export should be relative path and start with "./", got ${JSON.stringify( - exp - )}.` - ); - } - - const isFolder = exp.charCodeAt(exp.length - 1) === slashCode; - - if (isFolder !== expectFolder) { - throw new Error( - expectFolder - ? `Expecting folder to folder mapping. ${JSON.stringify( - exp - )} should end with "/"` - : `Expecting file to file mapping. ${JSON.stringify( - exp - )} should not end with "/"` - ); - } -} - -/** - * @param {string} imp import target - * @param {boolean} expectFolder is folder expected - */ -function assertImportTarget(imp, expectFolder) { - const isFolder = imp.charCodeAt(imp.length - 1) === slashCode; - - if (isFolder !== expectFolder) { - throw new Error( - expectFolder - ? `Expecting folder to folder mapping. ${JSON.stringify( - imp - )} should end with "/"` - : `Expecting file to file mapping. ${JSON.stringify( - imp - )} should not end with "/"` - ); - } -} - -/** - * @param {string} a first string - * @param {string} b second string - * @returns {number} compare result - */ -function patternKeyCompare(a, b) { - const aPatternIndex = a.indexOf("*"); - const bPatternIndex = b.indexOf("*"); - const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; - const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - - if (baseLenA > baseLenB) return -1; - if (baseLenB > baseLenA) return 1; - if (aPatternIndex === -1) return 1; - if (bPatternIndex === -1) return -1; - if (a.length > b.length) return -1; - if (b.length > a.length) return 1; - - return 0; -} - -/** - * Trying to match request to field - * @param {string} request request - * @param {ExportsField | ImportsField} field exports or import field - * @returns {[MappingValue, string, boolean, boolean]|null} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings - */ -function findMatch(request, field) { - if ( - Object.prototype.hasOwnProperty.call(field, request) && - !request.includes("*") && - !request.endsWith("/") - ) { - const target = /** @type {{[k: string]: MappingValue}} */ (field)[request]; - - return [target, "", false, false]; - } - - /** @type {string} */ - let bestMatch = ""; - /** @type {string|undefined} */ - let bestMatchSubpath; - - const keys = Object.getOwnPropertyNames(field); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = key.indexOf("*"); - - if (patternIndex !== -1 && request.startsWith(key.slice(0, patternIndex))) { - const patternTrailer = key.slice(patternIndex + 1); - - if ( - request.length >= key.length && - request.endsWith(patternTrailer) && - patternKeyCompare(bestMatch, key) === 1 && - key.lastIndexOf("*") === patternIndex - ) { - bestMatch = key; - bestMatchSubpath = request.slice( - patternIndex, - request.length - patternTrailer.length - ); - } - } - // For legacy `./foo/` - else if ( - key[key.length - 1] === "/" && - request.startsWith(key) && - patternKeyCompare(bestMatch, key) === 1 - ) { - bestMatch = key; - bestMatchSubpath = request.slice(key.length); - } - } - - if (bestMatch === "") return null; - - const target = /** @type {{[k: string]: MappingValue}} */ (field)[bestMatch]; - const isSubpathMapping = bestMatch.endsWith("/"); - const isPattern = bestMatch.includes("*"); - - return [ - target, - /** @type {string} */ (bestMatchSubpath), - isSubpathMapping, - isPattern - ]; -} - -/** - * @param {ConditionalMapping|DirectMapping|null} mapping mapping - * @returns {boolean} is conditional mapping - */ -function isConditionalMapping(mapping) { - return ( - mapping !== null && typeof mapping === "object" && !Array.isArray(mapping) - ); -} - -/** - * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings - * @param {boolean} isPattern true, if mapping is a pattern (contains "*") - * @param {boolean} isSubpathMapping true, for subpath mappings - * @param {DirectMapping|null} mappingTarget direct export - * @param {Set} conditionNames condition names - * @param {(d: string, f: boolean) => void} assert asserting direct value - * @returns {string[]} mapping result - */ -function directMapping( - remainingRequest, - isPattern, - isSubpathMapping, - mappingTarget, - conditionNames, - assert -) { - if (mappingTarget === null) return []; - - if (typeof mappingTarget === "string") { - return [ - targetMapping( - remainingRequest, - isPattern, - isSubpathMapping, - mappingTarget, - assert - ) - ]; - } - - /** @type {string[]} */ - const targets = []; - - for (const exp of mappingTarget) { - if (typeof exp === "string") { - targets.push( - targetMapping( - remainingRequest, - isPattern, - isSubpathMapping, - exp, - assert - ) - ); - continue; - } - - const mapping = conditionalMapping(exp, conditionNames); - if (!mapping) continue; - const innerExports = directMapping( - remainingRequest, - isPattern, - isSubpathMapping, - mapping, - conditionNames, - assert - ); - for (const innerExport of innerExports) { - targets.push(innerExport); - } - } - - return targets; -} - -/** - * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings - * @param {boolean} isPattern true, if mapping is a pattern (contains "*") - * @param {boolean} isSubpathMapping true, for subpath mappings - * @param {string} mappingTarget direct export - * @param {(d: string, f: boolean) => void} assert asserting direct value - * @returns {string} mapping result - */ -function targetMapping( - remainingRequest, - isPattern, - isSubpathMapping, - mappingTarget, - assert -) { - if (remainingRequest === undefined) { - assert(mappingTarget, false); - - return mappingTarget; - } - - if (isSubpathMapping) { - assert(mappingTarget, true); - - return mappingTarget + remainingRequest; - } - - assert(mappingTarget, false); - - let result = mappingTarget; - - if (isPattern) { - result = result.replace( - patternRegEx, - remainingRequest.replace(/\$/g, "$$") - ); - } - - return result; -} - -/** - * @param {ConditionalMapping} conditionalMapping_ conditional mapping - * @param {Set} conditionNames condition names - * @returns {DirectMapping|null} direct mapping if found - */ -function conditionalMapping(conditionalMapping_, conditionNames) { - /** @type {[ConditionalMapping, string[], number][]} */ - let lookup = [[conditionalMapping_, Object.keys(conditionalMapping_), 0]]; - - loop: while (lookup.length > 0) { - const [mapping, conditions, j] = lookup[lookup.length - 1]; - const last = conditions.length - 1; - - for (let i = j; i < conditions.length; i++) { - const condition = conditions[i]; - - // assert default. Could be last only - if (i !== last) { - if (condition === "default") { - throw new Error("Default condition should be last one"); - } - } else if (condition === "default") { - const innerMapping = mapping[condition]; - // is nested - if (isConditionalMapping(innerMapping)) { - const conditionalMapping = /** @type {ConditionalMapping} */ ( - innerMapping - ); - lookup[lookup.length - 1][2] = i + 1; - lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); - continue loop; - } - - return /** @type {DirectMapping} */ (innerMapping); - } - - if (conditionNames.has(condition)) { - const innerMapping = mapping[condition]; - // is nested - if (isConditionalMapping(innerMapping)) { - const conditionalMapping = /** @type {ConditionalMapping} */ ( - innerMapping - ); - lookup[lookup.length - 1][2] = i + 1; - lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); - continue loop; - } - - return /** @type {DirectMapping} */ (innerMapping); - } - } - - lookup.pop(); - } - - return null; -} - -/** - * @param {ExportsField} field exports field - * @returns {ExportsField} normalized exports field - */ -function buildExportsField(field) { - // handle syntax sugar, if exports field is direct mapping for "." - if (typeof field === "string" || Array.isArray(field)) { - return { ".": field }; - } - - const keys = Object.keys(field); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (key.charCodeAt(0) !== dotCode) { - // handle syntax sugar, if exports field is conditional mapping for "." - if (i === 0) { - while (i < keys.length) { - const charCode = keys[i].charCodeAt(0); - if (charCode === dotCode || charCode === slashCode) { - throw new Error( - `Exports field key should be relative path and start with "." (key: ${JSON.stringify( - key - )})` - ); - } - i++; - } - - return { ".": field }; - } - - throw new Error( - `Exports field key should be relative path and start with "." (key: ${JSON.stringify( - key - )})` - ); - } - - if (key.length === 1) { - continue; - } - - if (key.charCodeAt(1) !== slashCode) { - throw new Error( - `Exports field key should be relative path and start with "./" (key: ${JSON.stringify( - key - )})` - ); - } - } - - return field; -} - -/** - * @param {ImportsField} field imports field - * @returns {ImportsField} normalized imports field - */ -function buildImportsField(field) { - const keys = Object.keys(field); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (key.charCodeAt(0) !== hashCode) { - throw new Error( - `Imports field key should start with "#" (key: ${JSON.stringify(key)})` - ); - } - - if (key.length === 1) { - throw new Error( - `Imports field key should have at least 2 characters (key: ${JSON.stringify( - key - )})` - ); - } - - if (key.charCodeAt(1) === slashCode) { - throw new Error( - `Imports field key should not start with "#/" (key: ${JSON.stringify( - key - )})` - ); - } - } - - return field; -} diff --git a/node_modules/enhanced-resolve/lib/util/identifier.js b/node_modules/enhanced-resolve/lib/util/identifier.js deleted file mode 100644 index d38cc39..0000000 --- a/node_modules/enhanced-resolve/lib/util/identifier.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -const PATH_QUERY_FRAGMENT_REGEXP = - /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; - -/** - * @param {string} identifier identifier - * @returns {[string, string, string]|null} parsed identifier - */ -function parseIdentifier(identifier) { - const match = PATH_QUERY_FRAGMENT_REGEXP.exec(identifier); - - if (!match) return null; - - return [ - match[1].replace(/\0(.)/g, "$1"), - match[2] ? match[2].replace(/\0(.)/g, "$1") : "", - match[3] || "" - ]; -} - -module.exports.parseIdentifier = parseIdentifier; diff --git a/node_modules/enhanced-resolve/lib/util/path.js b/node_modules/enhanced-resolve/lib/util/path.js deleted file mode 100644 index 4a65c6e..0000000 --- a/node_modules/enhanced-resolve/lib/util/path.js +++ /dev/null @@ -1,229 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const path = require("path"); - -const CHAR_HASH = "#".charCodeAt(0); -const CHAR_SLASH = "/".charCodeAt(0); -const CHAR_BACKSLASH = "\\".charCodeAt(0); -const CHAR_A = "A".charCodeAt(0); -const CHAR_Z = "Z".charCodeAt(0); -const CHAR_LOWER_A = "a".charCodeAt(0); -const CHAR_LOWER_Z = "z".charCodeAt(0); -const CHAR_DOT = ".".charCodeAt(0); -const CHAR_COLON = ":".charCodeAt(0); - -const posixNormalize = path.posix.normalize; -const winNormalize = path.win32.normalize; - -/** - * @enum {number} - */ -const PathType = Object.freeze({ - Empty: 0, - Normal: 1, - Relative: 2, - AbsoluteWin: 3, - AbsolutePosix: 4, - Internal: 5 -}); -exports.PathType = PathType; - -/** - * @param {string} p a path - * @returns {PathType} type of path - */ -const getType = p => { - switch (p.length) { - case 0: - return PathType.Empty; - case 1: { - const c0 = p.charCodeAt(0); - switch (c0) { - case CHAR_DOT: - return PathType.Relative; - case CHAR_SLASH: - return PathType.AbsolutePosix; - case CHAR_HASH: - return PathType.Internal; - } - return PathType.Normal; - } - case 2: { - const c0 = p.charCodeAt(0); - switch (c0) { - case CHAR_DOT: { - const c1 = p.charCodeAt(1); - switch (c1) { - case CHAR_DOT: - case CHAR_SLASH: - return PathType.Relative; - } - return PathType.Normal; - } - case CHAR_SLASH: - return PathType.AbsolutePosix; - case CHAR_HASH: - return PathType.Internal; - } - const c1 = p.charCodeAt(1); - if (c1 === CHAR_COLON) { - if ( - (c0 >= CHAR_A && c0 <= CHAR_Z) || - (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z) - ) { - return PathType.AbsoluteWin; - } - } - return PathType.Normal; - } - } - const c0 = p.charCodeAt(0); - switch (c0) { - case CHAR_DOT: { - const c1 = p.charCodeAt(1); - switch (c1) { - case CHAR_SLASH: - return PathType.Relative; - case CHAR_DOT: { - const c2 = p.charCodeAt(2); - if (c2 === CHAR_SLASH) return PathType.Relative; - return PathType.Normal; - } - } - return PathType.Normal; - } - case CHAR_SLASH: - return PathType.AbsolutePosix; - case CHAR_HASH: - return PathType.Internal; - } - const c1 = p.charCodeAt(1); - if (c1 === CHAR_COLON) { - const c2 = p.charCodeAt(2); - if ( - (c2 === CHAR_BACKSLASH || c2 === CHAR_SLASH) && - ((c0 >= CHAR_A && c0 <= CHAR_Z) || - (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) - ) { - return PathType.AbsoluteWin; - } - } - return PathType.Normal; -}; -exports.getType = getType; - -/** - * @param {string} p a path - * @returns {string} the normalized path - */ -const normalize = p => { - switch (getType(p)) { - case PathType.Empty: - return p; - case PathType.AbsoluteWin: - return winNormalize(p); - case PathType.Relative: { - const r = posixNormalize(p); - return getType(r) === PathType.Relative ? r : `./${r}`; - } - } - return posixNormalize(p); -}; -exports.normalize = normalize; - -/** - * @param {string} rootPath the root path - * @param {string | undefined} request the request path - * @returns {string} the joined path - */ -const join = (rootPath, request) => { - if (!request) return normalize(rootPath); - const requestType = getType(request); - switch (requestType) { - case PathType.AbsolutePosix: - return posixNormalize(request); - case PathType.AbsoluteWin: - return winNormalize(request); - } - switch (getType(rootPath)) { - case PathType.Normal: - case PathType.Relative: - case PathType.AbsolutePosix: - return posixNormalize(`${rootPath}/${request}`); - case PathType.AbsoluteWin: - return winNormalize(`${rootPath}\\${request}`); - } - switch (requestType) { - case PathType.Empty: - return rootPath; - case PathType.Relative: { - const r = posixNormalize(rootPath); - return getType(r) === PathType.Relative ? r : `./${r}`; - } - } - return posixNormalize(rootPath); -}; -exports.join = join; - -/** @type {Map>} */ -const joinCache = new Map(); - -/** - * @param {string} rootPath the root path - * @param {string} request the request path - * @returns {string} the joined path - */ -const cachedJoin = (rootPath, request) => { - /** @type {string | undefined} */ - let cacheEntry; - let cache = joinCache.get(rootPath); - if (cache === undefined) { - joinCache.set(rootPath, (cache = new Map())); - } else { - cacheEntry = cache.get(request); - if (cacheEntry !== undefined) return cacheEntry; - } - cacheEntry = join(rootPath, request); - cache.set(request, cacheEntry); - return cacheEntry; -}; -exports.cachedJoin = cachedJoin; - -/** - * @param {string} relativePath relative path - * @returns {undefined|Error} nothing or an error - */ -const checkImportsExportsFieldTarget = relativePath => { - let lastNonSlashIndex = 0; - let slashIndex = relativePath.indexOf("/", 1); - let cd = 0; - - while (slashIndex !== -1) { - const folder = relativePath.slice(lastNonSlashIndex, slashIndex); - - switch (folder) { - case "..": { - cd--; - if (cd < 0) - return new Error( - `Trying to access out of package scope. Requesting ${relativePath}` - ); - break; - } - case ".": - break; - default: - cd++; - break; - } - - lastNonSlashIndex = slashIndex + 1; - slashIndex = relativePath.indexOf("/", lastNonSlashIndex); - } -}; -exports.checkImportsExportsFieldTarget = checkImportsExportsFieldTarget; diff --git a/node_modules/enhanced-resolve/lib/util/process-browser.js b/node_modules/enhanced-resolve/lib/util/process-browser.js deleted file mode 100644 index a99141f..0000000 --- a/node_modules/enhanced-resolve/lib/util/process-browser.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -module.exports = { - /** - * @type {Record} - */ - versions: {}, - /** - * @param {function} fn function - */ - nextTick(fn) { - const args = Array.prototype.slice.call(arguments, 1); - Promise.resolve().then(function () { - fn.apply(null, args); - }); - } -}; diff --git a/node_modules/enhanced-resolve/package.json b/node_modules/enhanced-resolve/package.json deleted file mode 100644 index c08417c..0000000 --- a/node_modules/enhanced-resolve/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "enhanced-resolve", - "version": "5.15.0", - "author": "Tobias Koppers @sokra", - "description": "Offers a async require.resolve function. It's highly configurable.", - "files": [ - "lib", - "types.d.ts", - "LICENSE" - ], - "browser": { - "pnpapi": false, - "process": "./lib/util/process-browser.js" - }, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "license": "MIT", - "devDependencies": { - "@types/graceful-fs": "^4.1.6", - "@types/jest": "^27.5.1", - "@types/node": "^14.11.1", - "cspell": "4.2.8", - "eslint": "^7.9.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-jsdoc": "^30.5.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.1.4", - "husky": "^6.0.0", - "jest": "^27.5.1", - "lint-staged": "^10.4.0", - "memfs": "^3.2.0", - "prettier": "^2.1.2", - "tooling": "webpack/tooling#v1.14.0", - "typescript": "^5.0.4" - }, - "engines": { - "node": ">=10.13.0" - }, - "main": "lib/index.js", - "types": "types.d.ts", - "homepage": "http://github.com/webpack/enhanced-resolve", - "scripts": { - "lint": "yarn run code-lint && yarn run type-lint && yarn typings-test && yarn run special-lint && yarn run spelling", - "fix": "yarn run code-lint-fix && yarn run special-lint-fix", - "code-lint": "eslint --cache lib test", - "code-lint-fix": "eslint --cache lib test --fix", - "type-lint": "tsc", - "typings-test": "tsc -p tsconfig.types.test.json", - "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html", - "special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-file-header && node node_modules/tooling/generate-types", - "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/generate-types --write", - "pretty": "prettier --loglevel warn --write \"lib/**/*.{js,json}\" \"test/*.js\"", - "pretest": "yarn lint", - "spelling": "cspell \"**\"", - "test:only": "jest", - "test:watch": "yarn test:only -- --watch", - "test:coverage": "yarn test:only -- --collectCoverageFrom=\"lib/**/*.js\" --coverage", - "test": "yarn test:coverage", - "precover": "yarn lint", - "prepare": "husky install" - }, - "lint-staged": { - "*": "cspell --no-must-find-files", - "*.js": "eslint --cache" - }, - "repository": { - "type": "git", - "url": "git://github.com/webpack/enhanced-resolve.git" - } -} diff --git a/node_modules/enhanced-resolve/types.d.ts b/node_modules/enhanced-resolve/types.d.ts deleted file mode 100644 index e88d59c..0000000 --- a/node_modules/enhanced-resolve/types.d.ts +++ /dev/null @@ -1,712 +0,0 @@ -/* - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - -import { Dirent } from "fs"; -import { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } from "tapable"; - -type Alias = string | false | string[]; -declare interface AliasOption { - alias: Alias; - name: string; - onlyModule?: boolean; -} -type AliasOptionNewRequest = string | false | string[]; -declare interface AliasOptions { - [index: string]: AliasOptionNewRequest; -} -declare interface BaseResolveRequest { - path: string | false; - context?: object; - descriptionFilePath?: string; - descriptionFileRoot?: string; - descriptionFileData?: JsonObject; - relativePath?: string; - ignoreSymlinks?: boolean; - fullySpecified?: boolean; - __innerRequest?: string; - __innerRequest_request?: string; - __innerRequest_relativePath?: string; -} -declare class CachedInputFileSystem { - constructor(fileSystem: any, duration: number); - fileSystem: any; - lstat?: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - lstatSync?: (arg0: string, arg1?: object) => FileSystemStats; - stat: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - statSync: (arg0: string, arg1?: object) => FileSystemStats; - readdir: ( - arg0: string, - arg1?: - | null - | (( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | Dirent[] - ) => void) - | ReaddirOptions - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex" - | "buffer", - arg2?: ( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | Dirent[] - ) => void - ) => void; - readdirSync: ( - arg0: string, - arg1?: object - ) => (string | Buffer)[] | FileSystemDirent[]; - readFile: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - readFileSync: (arg0: string, arg1?: object) => string | Buffer; - readJson?: { - (arg0: string, arg1: FileSystemCallback): void; - (arg0: string, arg1: object, arg2: FileSystemCallback): void; - }; - readJsonSync?: (arg0: string, arg1?: object) => object; - readlink: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - readlinkSync: (arg0: string, arg1?: object) => string | Buffer; - purge(what?: string | Set | string[]): void; -} -declare class CloneBasenamePlugin { - constructor( - source: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >, - target: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - > - ); - source: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >; - target: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >; - apply(resolver: Resolver): void; -} -type ErrorWithDetail = Error & { details?: string }; -declare interface ExtensionAliasOption { - alias: string | string[]; - extension: string; -} -declare interface ExtensionAliasOptions { - [index: string]: string | string[]; -} -declare interface FileSystem { - readFile: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - readdir: ( - arg0: string, - arg1?: - | null - | (( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | Dirent[] - ) => void) - | ReaddirOptions - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex" - | "buffer", - arg2?: ( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | Dirent[] - ) => void - ) => void; - readJson?: { - (arg0: string, arg1: FileSystemCallback): void; - (arg0: string, arg1: object, arg2: FileSystemCallback): void; - }; - readlink: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - lstat?: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - stat: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; -} -declare interface FileSystemCallback { - (err?: null | (PossibleFileSystemError & Error), result?: T): any; -} -declare interface FileSystemDirent { - name: string | Buffer; - isDirectory: () => boolean; - isFile: () => boolean; -} -declare interface FileSystemStats { - isDirectory: () => boolean; - isFile: () => boolean; -} -declare interface Iterator { - ( - item: T, - callback: (err?: null | Error, result?: null | Z) => void, - i: number - ): void; -} -type JsonObject = { [index: string]: JsonValue } & { - [index: string]: - | undefined - | null - | string - | number - | boolean - | JsonObject - | JsonValue[]; -}; -type JsonValue = null | string | number | boolean | JsonObject | JsonValue[]; -declare interface KnownHooks { - resolveStep: SyncHook< - [ - AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >, - ResolveRequest - ] - >; - noResolve: SyncHook<[ResolveRequest, Error]>; - resolve: AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >; - result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>; -} -declare class LogInfoPlugin { - constructor( - source: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - > - ); - source: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >; - apply(resolver: Resolver): void; -} -declare interface ParsedIdentifier { - request: string; - query: string; - fragment: string; - directory: boolean; - module: boolean; - file: boolean; - internal: boolean; -} -type Plugin = - | undefined - | null - | false - | "" - | 0 - | { apply: (arg0: Resolver) => void } - | ((this: Resolver, arg1: Resolver) => void); -declare interface PnpApiImpl { - resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string; -} -declare interface PossibleFileSystemError { - code?: string; - errno?: number; - path?: string; - syscall?: string; -} -declare interface ReaddirOptions { - encoding?: - | null - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex" - | "buffer"; - withFileTypes?: boolean; -} - -/** - * Resolve context - */ -declare interface ResolveContext { - contextDependencies?: WriteOnlySet; - - /** - * files that was found on file system - */ - fileDependencies?: WriteOnlySet; - - /** - * dependencies that was not found on file system - */ - missingDependencies?: WriteOnlySet; - - /** - * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, - */ - stack?: Set; - - /** - * log function - */ - log?: (arg0: string) => void; - - /** - * yield result, if provided plugins can return several results - */ - yield?: (arg0: ResolveRequest) => void; -} -declare interface ResolveFunction { - (context: object, path: string, request: string): string | false; - (path: string, request: string): string | false; -} -declare interface ResolveFunctionAsync { - ( - context: object, - path: string, - request: string, - resolveContext: ResolveContext, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void - ): void; - ( - context: object, - path: string, - request: string, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void - ): void; - ( - path: string, - request: string, - resolveContext: ResolveContext, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void - ): void; - ( - path: string, - request: string, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void - ): void; -} -declare interface ResolveOptions { - alias: AliasOption[]; - fallback: AliasOption[]; - aliasFields: Set; - extensionAlias: ExtensionAliasOption[]; - cachePredicate: (arg0: ResolveRequest) => boolean; - cacheWithContext: boolean; - - /** - * A list of exports field condition names. - */ - conditionNames: Set; - descriptionFiles: string[]; - enforceExtension: boolean; - exportsFields: Set; - importsFields: Set; - extensions: Set; - fileSystem: FileSystem; - unsafeCache: false | object; - symlinks: boolean; - resolver?: Resolver; - modules: (string | string[])[]; - mainFields: { name: string[]; forceRelative: boolean }[]; - mainFiles: Set; - plugins: Plugin[]; - pnpApi: null | PnpApiImpl; - roots: Set; - fullySpecified: boolean; - resolveToContext: boolean; - restrictions: Set; - preferRelative: boolean; - preferAbsolute: boolean; -} -type ResolveOptionsOptionalFS = Omit & - Partial>; -type ResolveRequest = BaseResolveRequest & Partial; -declare abstract class Resolver { - fileSystem: FileSystem; - options: ResolveOptions; - hooks: KnownHooks; - ensureHook( - name: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - > - ): AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >; - getHook( - name: - | string - | AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - > - ): AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >; - resolveSync(context: object, path: string, request: string): string | false; - resolve( - context: object, - path: string, - request: string, - resolveContext: ResolveContext, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void - ): void; - doResolve( - hook: AsyncSeriesBailHook< - [ResolveRequest, ResolveContext], - null | ResolveRequest - >, - request: ResolveRequest, - message: null | string, - resolveContext: ResolveContext, - callback: (err?: null | Error, result?: ResolveRequest) => void - ): void; - parse(identifier: string): ParsedIdentifier; - isModule(path: string): boolean; - isPrivate(path: string): boolean; - isDirectory(path: string): boolean; - join(path: string, request: string): string; - normalize(path: string): string; -} -declare interface UserResolveOptions { - /** - * A list of module alias configurations or an object which maps key to value - */ - alias?: AliasOptions | AliasOption[]; - - /** - * A list of module alias configurations or an object which maps key to value, applied only after modules option - */ - fallback?: AliasOptions | AliasOption[]; - - /** - * An object which maps extension to extension aliases - */ - extensionAlias?: ExtensionAliasOptions; - - /** - * A list of alias fields in description files - */ - aliasFields?: (string | string[])[]; - - /** - * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. - */ - cachePredicate?: (arg0: ResolveRequest) => boolean; - - /** - * Whether or not the unsafeCache should include request context as part of the cache key. - */ - cacheWithContext?: boolean; - - /** - * A list of description files to read from - */ - descriptionFiles?: string[]; - - /** - * A list of exports field condition names. - */ - conditionNames?: string[]; - - /** - * Enforce that a extension from extensions must be used - */ - enforceExtension?: boolean; - - /** - * A list of exports fields in description files - */ - exportsFields?: (string | string[])[]; - - /** - * A list of imports fields in description files - */ - importsFields?: (string | string[])[]; - - /** - * A list of extensions which should be tried for files - */ - extensions?: string[]; - - /** - * The file system which should be used - */ - fileSystem: FileSystem; - - /** - * Use this cache object to unsafely cache the successful requests - */ - unsafeCache?: boolean | object; - - /** - * Resolve symlinks to their symlinked location - */ - symlinks?: boolean; - - /** - * A prepared Resolver to which the plugins are attached - */ - resolver?: Resolver; - - /** - * A list of directories to resolve modules from, can be absolute path or folder name - */ - modules?: string | string[]; - - /** - * A list of main fields in description files - */ - mainFields?: ( - | string - | string[] - | { name: string | string[]; forceRelative: boolean } - )[]; - - /** - * A list of main files in directories - */ - mainFiles?: string[]; - - /** - * A list of additional resolve plugins which should be applied - */ - plugins?: Plugin[]; - - /** - * A PnP API that should be used - null is "never", undefined is "auto" - */ - pnpApi?: null | PnpApiImpl; - - /** - * A list of root paths - */ - roots?: string[]; - - /** - * The request is already fully specified and no extensions or directories are resolved for it - */ - fullySpecified?: boolean; - - /** - * Resolve to a context instead of a file - */ - resolveToContext?: boolean; - - /** - * A list of resolve restrictions - */ - restrictions?: (string | RegExp)[]; - - /** - * Use only the sync constraints of the file system calls - */ - useSyncFileSystemCalls?: boolean; - - /** - * Prefer to resolve module requests as relative requests before falling back to modules - */ - preferRelative?: boolean; - - /** - * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots - */ - preferAbsolute?: boolean; -} -declare interface WriteOnlySet { - add: (item: T) => void; -} -declare function exports( - context: object, - path: string, - request: string, - resolveContext: ResolveContext, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void -): void; -declare function exports( - context: object, - path: string, - request: string, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void -): void; -declare function exports( - path: string, - request: string, - resolveContext: ResolveContext, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void -): void; -declare function exports( - path: string, - request: string, - callback: ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void -): void; -declare namespace exports { - export const sync: ResolveFunction; - export function create( - options: ResolveOptionsOptionalFS - ): ResolveFunctionAsync; - export namespace create { - export const sync: (options: ResolveOptionsOptionalFS) => ResolveFunction; - } - export namespace ResolverFactory { - export let createResolver: (options: UserResolveOptions) => Resolver; - } - export const forEachBail: ( - array: T[], - iterator: Iterator, - callback: (err?: null | Error, result?: null | Z) => void - ) => void; - export type ResolveCallback = ( - err: null | ErrorWithDetail, - res?: string | false, - req?: ResolveRequest - ) => void; - export { - CachedInputFileSystem, - CloneBasenamePlugin, - LogInfoPlugin, - ResolveOptionsOptionalFS, - PnpApiImpl as PnpApi, - Resolver, - FileSystem, - ResolveContext, - ResolveRequest, - Plugin, - UserResolveOptions as ResolveOptions, - ResolveFunctionAsync, - ResolveFunction - }; -} - -export = exports; diff --git a/node_modules/envinfo/LICENSE b/node_modules/envinfo/LICENSE deleted file mode 100644 index 1bc5440..0000000 --- a/node_modules/envinfo/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Trevor Brindle - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/envinfo/README.md b/node_modules/envinfo/README.md deleted file mode 100644 index 9811aa1..0000000 --- a/node_modules/envinfo/README.md +++ /dev/null @@ -1,286 +0,0 @@ -

- -

envinfo generates a report of the common details needed when troubleshooting software issues, such as your operating system, binary versions, browsers, installed languages, and more

-
-

- -[![CircleCI](https://circleci.com/gh/tabrindle/envinfo/tree/master.svg?style=svg)](https://circleci.com/gh/tabrindle/envinfo/tree/master) [![Build Status](https://travis-ci.org/tabrindle/envinfo.svg?branch=master)](https://travis-ci.org/tabrindle/envinfo) [![npm version](https://badge.fury.io/js/envinfo.svg)](https://badge.fury.io/js/envinfo) [![npm downloads per month](https://img.shields.io/npm/dm/envinfo.svg?maxAge=86400)](https://www.npmjs.com/package/envinfo) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors) - -## The problem - -- It works on my computer -- "command not found" -- what version of "command" are you running? -- what version of "different command" are you running? -- do you have "insert obscure android sdk version"? -- every github issue reporting template ever: - -**Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.** - -## This solution - -- Gather all of this information in one spot, quickly, and painlessly. - -## Installation - -To use as a CLI tool, install this package globally: - -```sh -npm install -g envinfo || yarn global add envinfo -``` - -Or, use without installing with npx: - -`npx envinfo` - -To use as a library in another project: - -```sh -npm install envinfo || yarn add envinfo -``` - -## CLI Usage - -`envinfo` || `npx envinfo` - -```bash - System: - OS: macOS Mojave 10.14.5 - CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz - Memory: 2.97 GB / 16.00 GB - Shell: 5.3 - /bin/zsh - Binaries: - Node: 8.16.0 - ~/.nvm/versions/node/v8.16.0/bin/node - Yarn: 1.15.2 - ~/.yarn/bin/yarn - npm: 6.9.0 - ~/.nvm/versions/node/v8.16.0/bin/npm - pnpm: 8.7.6 - /usr/local/bin/pnpm - bun: 1.0.2 - /usr/local/bin/bun - Watchman: 4.9.0 - /usr/local/bin/watchman - Managers: - Cargo: 1.31.0 - ~/.cargo/bin/cargo - CocoaPods: 1.7.3 - /usr/local/bin/pod - Composer: 1.8.6 - /usr/local/bin/composer - Gradle: 5.5 - /usr/local/bin/gradle - Homebrew: 2.1.7 - /usr/local/bin/brew - Maven: 3.6.1 - /usr/local/bin/mvn - pip2: 19.0.3 - /usr/local/bin/pip2 - pip3: 19.0.2 - /usr/local/bin/pip3 - RubyGems: 2.5.2.3 - /usr/bin/gem - Utilities: - CMake: 3.13.3 - /usr/local/bin/cmake - Make: 3.81 - /usr/bin/make - GCC: 10.14. - /usr/bin/gcc - Git: 2.20.0 - /usr/local/bin/git - Mercurial: 4.5.3 - /usr/bin/hg - Clang: 1001.0.46.4 - /usr/bin/clang - Subversion: 1.10.3 - /usr/bin/svn - Servers: - Apache: 2.4.34 - /usr/sbin/apachectl - Nginx: 1.13.12 - /usr/local/bin/nginx - Virtualization: - Docker: 18.09.1 - /usr/local/bin/docker - Parallels: 13.3.0 - /usr/local/bin/prlctl - VirtualBox: 5.2.20 - /usr/local/bin/vboxmanage - SDKs: - iOS SDK: - Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2 - Android SDK: - API Levels: 28 - Build Tools: 28.0.3 - System Images: android-28 | Google Play Intel x86 Atom - IDEs: - Android Studio: 3.2 AI-181.5540.7.32.5056338 - Atom: 1.23.3 - Emacs: 22.1.1 - /usr/bin/emacs - Nano: 2.0.6 - /usr/bin/nano - VSCode: 1.36.0 - /usr/local/bin/code - Vim: 8.0 - /usr/bin/vim - Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild - Languages: - Bash: 4.4.23 - /usr/local/bin/bash - Elixir: 1.6.2 - /usr/local/bin/elixir - Go: 1.11.1 - /usr/local/bin/go - Java: 1.8.0_192 - /usr/bin/javac - Perl: 5.18.4 - /usr/bin/perl - PHP: 7.1.23 - /usr/bin/php - Python: 2.7.16 - /usr/local/bin/python - Python3: 3.7.2 - /usr/local/bin/python3 - R: 3.6.0 - /usr/local/bin/R - Ruby: 2.3.7 - /usr/bin/ruby - Rust: 1.16.0 - /Users/tabrindle/.cargo/bin/rustup - Databases: - MongoDB: 3.6.4 - /usr/local/bin/mongo - MySQL: 10.3.10 (MariaDB) - /usr/local/bin/mysql - PostgreSQL: 10.3 - /usr/local/bin/postgres - SQLite: 3.24.0 - /usr/bin/sqlite3 - Browsers: - Chrome: 75.0.3770.100 - Chrome Canary: 77.0.3847.0 - Firefox: 68.0 - Firefox Developer Edition: 69.0 - Firefox Nightly: 69.0a1 - Safari: 12.1.1 - Safari Technology Preview: 13.0 - npmPackages: - apollo-client: ^2.3.1 => 2.3.1 - jest: ^22.2.1 => 22.2.1 - ... - react: ^16.3.2 => 16.3.2 - react-apollo: ^2.1.4 => 2.1.4 - run4staged: ^1.1.1 => 1.1.1 - solidarity: 2.0.5 => 2.0.5 - styled-components: ^3.1.6 => 3.1.6 - npmGlobalPackages: - create-react-app: 1.5.2 - create-react-native-app: 1.0.0 - envinfo: 5.10.0 - exp: 49.2.2 - gatsby-cli: 1.1.52 - npm: 5.6.0 - react-native-cli: 2.0.1 - solidarity: 2.1.0 - typescript: 2.8.1 -``` - -## Programmatic Usage - -Envinfo takes a configuration object and returns a Promise that resolves a string (optionally yaml, json or markdown) - -```javascript -import envinfo from 'envinfo'; - -envinfo.run( - { - System: ['OS', 'CPU'], - Binaries: ['Node', 'Yarn', 'npm'], - Browsers: ['Chrome', 'Firefox', 'Safari'], - npmPackages: ['styled-components', 'babel-plugin-styled-components'], - }, - { json: true, showNotFound: true } -).then(env => console.log(env)); -``` - -logs: - -```json -{ - "System": { - "OS": "macOS High Sierra 10.13", - "CPU": "x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz" - }, - "Binaries": { - "Node": { - "version": "8.11.0", - "path": "~/.nvm/versions/node/v8.11.0/bin/node" - }, - "Yarn": { - "version": "1.5.1", - "path": "~/.yarn/bin/yarn" - }, - "npm": { - "version": "5.6.0", - "path": "~/.nvm/versions/node/v8.11.0/bin/npm" - } - }, - "Browsers": { - "Chrome": { - "version": "67.0.3396.62" - }, - "Firefox": { - "version": "59.0.2" - }, - "Safari": { - "version": "11.0" - } - }, - "npmPackages": { - "styled-components": { - "wanted": "^3.2.1", - "installed": "3.2.1" - }, - "babel-plugin-styled-components": "Not Found" - } -} -``` - -All of envinfo's helpers are also exported for use. You can use envinfo as a whole, or just the parts that you need, like this: - -```javascript -const envinfo = require('envinfo'); - -// each helper returns a promise -const node = await envinfo.helpers.getNodeInfo(); - -// The promises resolve to an array of values: ["Name", "Version", "Path"] -// e.g. ["Node", "10.9.0", "/usr/local/bin/node"] - -console.log(`Node: ${node[1]} - ${node[2]}`); // "Node: 10.9.0 - ~/.nvm/versions/node/v8.14.0/bin/node" -``` - -## CLI Options - -``` - --system Print general system info such as OS, CPU, Memory and Shell - --browsers Get version numbers of installed web browsers - --SDKs Get platforms, build tools and SDKs of iOS and Android - --IDEs Get version numbers of installed IDEs - --languages Get version numbers of installed languages such as Java, Python, PHP, etc - --binaries Get version numbers of node, npm, watchman, etc - --npmPackages Get version numbers of locally installed npm packages - glob, string, or comma delimited list - --npmGlobalPackages Get version numbers of globally installed npm packages - - --duplicates Mark duplicate npm packages inside parentheses eg. (2.1.4) - --fullTree Traverse entire node_modules dependency tree, not just top level - - --markdown Print output in markdown format - --json Print output in JSON format - --console Print to console (defaults to on for CLI usage, off for programmatic usage) -``` - -## Integration - -envinfo is live in: - -- [React Native](https://github.com/facebook/react-native) (`react-native info`) -- [Create React App](https://github.com/facebook/create-react-app) (`create-react-app --info`) -- [Expo Environment Info](https://github.com/expo/expo-cli/tree/main/packages/expo-env-info) (`npx expo-env-info`) -- [Webpack](https://github.com/webpack/webpack-cli) (`webpack-cli info`) -- [Solidarity](https://github.com/infinitered/solidarity) (`solidarity report`) -- [Gatsby](https://github.com/gatsbyjs/gatsby) (`gatsby info`) - -envinfo is used in the ISSUE_TEMPLATE of: - -- [styled-components](https://github.com/styled-components/styled-components) -- [Jest](https://github.com/facebook/jest) -- [Apollo Client](https://github.com/apollographql/apollo-client) - -## Alternatives - -- type `command -v` until you smash your computer -- [screenfetch](https://github.com/KittyKatt/screenFetch) - fetch system and terminal information, and display a pretty ascii logo -- [Solidarity](https://github.com/infinitered/solidarity) - a project based environment checker -- write your own - -## License - -MIT - -## Contributing - -PRs for additional features are welcome! Run `npm run lint && npm run format` before committing. - -This project came out of a [PR](https://github.com/facebook/react-native/pull/14428) to the React Native CLI tool - issues are reported frequently without important environment information, like Node/npm versions. - -## Contributors - -Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): - - - -| [
Trevor Brindle](http://trevorbrindle.com)
[💬](#question-tabrindle "Answering Questions") [📝](#blog-tabrindle "Blogposts") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Atabrindle "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=tabrindle "Code") [📖](https://github.com/tabrindle/envinfo/commits?author=tabrindle "Documentation") [💡](#example-tabrindle "Examples") [🤔](#ideas-tabrindle "Ideas, Planning, & Feedback") [👀](#review-tabrindle "Reviewed Pull Requests") [📢](#talk-tabrindle "Talks") [⚠️](https://github.com/tabrindle/envinfo/commits?author=tabrindle "Tests") | [
Gant Laborde](http://gantlaborde.com/)
[📝](#blog-GantMan "Blogposts") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3AGantMan "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=GantMan "Code") [🤔](#ideas-GantMan "Ideas, Planning, & Feedback") | [
Anton Fisher](http://antonfisher.com)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aantonfisher "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=antonfisher "Code") | [
Ahmad Awais ⚡️](https://AhmadAwais.com/)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aahmadawais "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ahmadawais "Code") | [
Hasan](https://github.com/LEQADA)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3ALEQADA "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=LEQADA "Code") | [
Ernesto Ramírez](http://twitter.com/_ErnestoR)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3AErnestoR "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ErnestoR "Code") | [
Jiawen Geng](https://www.gengjiawen.com)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Agengjiawen "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=gengjiawen "Code") [🤔](#ideas-gengjiawen "Ideas, Planning, & Feedback") [⚠️](https://github.com/tabrindle/envinfo/commits?author=gengjiawen "Tests") | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| [
Zac Anger](https://zacanger.com)
[💻](https://github.com/tabrindle/envinfo/commits?author=zacanger "Code") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Azacanger "Bug reports") | [
Ville Immonen](https://twitter.com/VilleImmonen)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Afson "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=fson "Code") | [
Olmo Maldonado](http://ibolmo.com)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aibolmo "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ibolmo "Code") | [
Rishabh Chawla](https://rishabhchawla.co)
[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Arishabh3112 "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=rishabh3112 "Code") | - - -This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! diff --git a/node_modules/envinfo/dist/cli.js b/node_modules/envinfo/dist/cli.js deleted file mode 100644 index be7e491..0000000 --- a/node_modules/envinfo/dist/cli.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -"use strict";module.exports=function(n){var e={};function o(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return n[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=n,o.c=e,o.d=function(n,e,t){o.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:t})},o.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},o.t=function(n,e){if(1&e&&(n=o(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)o.d(t,r,function(e){return n[e]}.bind(null,r));return t},o.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(e,"a",e),e},o.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},o.p="",o(o.s=171)}({171:function(n,e,o){var t=o(172)(process.argv.slice(2));t.console=!0,t.help||t._.indexOf("help")>-1?console.log("\n ,,', ,, ,,,,,, ,',,\n ,,, ,,, ,,,\n ,, ,,,,, ,,,,,, ,,, ,, ,, .,,,,,, ,,,,,,, ,,,,, ,,\n ,, ,, ,, ,,, ,,, ,, ,,, ,, ,,, ,,, ,, ,,, ,,, ,,\n ,,, ,, .,, ,,, ,, ,,, ,, ,, ,,, ,, ,, ,, ,, ,,,\n ,, ,,,,,,,,,, ,,, ,, ,, ,, ,, ,,, ,, ,, ,, ,, ,,\n ,, ,,, ,,, ,, ,,,,, ,, ,,, ,, ,, ,,, ,,, ,,\n ,, ,,,,,,, ,,, ,, ,,, ,, ,,, ,, ,, ,,,,,,, ,,\n ,,, ,,,\n ,,,' ',,,\n\n VERSION: 7.11.1\n\n USAGE:\n\n `envinfo` || `npx envinfo`\n\n OPTIONS:\n\n --system Print general system info such as OS, CPU, Memory and Shell\n --browsers Get version numbers of installed web browsers\n --SDKs Get platforms, build tools and SDKs of iOS and Android\n --IDEs Get version numbers of installed IDEs\n --languages Get version numbers of installed languages such as Java, Python, PHP, etc\n --managers Get version numbers of installed package/dependency managers\n --monorepos Get monorepo tools\n --binaries Get version numbers of node, npm, watchman, etc\n --npmPackages Get version numbers of locally installed npm packages - glob, string, or comma delimited list\n --npmGlobalPackages Get version numbers of globally installed npm packages\n\n --duplicates Mark duplicate npm packages inside parentheses eg. (2.1.4)\n --fullTree Traverse entire node_modules dependency tree, not just top level\n\n --markdown Print output in markdown format\n --json Print output in JSON format\n --console Print to console (defaults to on for CLI usage, off for programmatic usage)\n --showNotFound Don't filter out values marked 'Not Found'\n --title Give your report a top level title ie 'Environment Report'\n\n --clipboard *Removed - use clipboardy or clipboard-cli directly*\n "):t.version||t.v||t._.indexOf("version")>-1?console.log("7.11.1"):o(173).cli(t)},172:function(n,e){function o(n){return"number"==typeof n||(!!/^0x[0-9a-f]+$/i.test(n)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n))}n.exports=function(n,e){e||(e={});var t={bools:{},strings:{},unknownFn:null};"function"==typeof e.unknown&&(t.unknownFn=e.unknown),"boolean"==typeof e.boolean&&e.boolean?t.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(n){t.bools[n]=!0});var r={};Object.keys(e.alias||{}).forEach(function(n){r[n]=[].concat(e.alias[n]),r[n].forEach(function(e){r[e]=[n].concat(r[n].filter(function(n){return e!==n}))})}),[].concat(e.string).filter(Boolean).forEach(function(n){t.strings[n]=!0,r[n]&&(t.strings[r[n]]=!0)});var s=e.default||{},i={_:[]};Object.keys(t.bools).forEach(function(n){a(n,void 0!==s[n]&&s[n])});var l=[];function a(n,e,s){if(!s||!t.unknownFn||function(n,e){return t.allBools&&/^--[^=]+$/.test(e)||t.strings[n]||t.bools[n]||r[n]}(n,s)||!1!==t.unknownFn(s)){var l=!t.strings[n]&&o(e)?Number(e):e;u(i,n.split("."),l),(r[n]||[]).forEach(function(n){u(i,n.split("."),l)})}}function u(n,e,o){for(var r=n,s=0;s1&&void 0!==arguments[1]?arguments[1]:{}).unify,n=void 0!==t&&t;return new Promise(function(t){s.exec(e,{stdio:[0,"pipe","ignore"]},function(e,r,o){var i="";i=n?r.toString()+o.toString():r.toString(),t((e?"":i).trim())})})},f=function(e){var t=Object.values(Array.prototype.slice.call(arguments).slice(1));(process.env.ENVINFO_DEBUG||"").toLowerCase()===e&&console.log(e,JSON.stringify(t))},p=function(e){return new Promise(function(t){o.readFile(e,"utf8",function(e,n){return t(n||null)})})},h=function(e){return p(e).then(function(e){return e?JSON.parse(e):null})},d=/\d+\.[\d+|.]+/g,m=function(e){f("trace","findDarwinApplication",e);var t=`mdfind "kMDItemCFBundleIdentifier=='${e}'"`;return f("trace",t),l(t).then(function(e){return e.replace(/(\s)/g,"\\ ")})},g=function(e,t){var n=(t||["CFBundleShortVersionString"]).map(function(e){return"-c Print:"+e});return["/usr/libexec/PlistBuddy"].concat(n).concat([e]).join(" ")},v=function(e,t){for(var n=[],r=null;null!==(r=e.exec(t));)n.push(r);return n};e.exports={run:l,log:f,fileExists:function(e){return new Promise(function(t){o.stat(e,function(n){return t(n?null:e)})})},windowsExeExists:function(e){return new Promise(function(t){var n;o.access(n=r.join(process.env.ProgramFiles,`${e}`),o.constants.R_OK,function(i){i?o.access(n=r.join(process.env["ProgramFiles(x86)"],`${e}`),o.constants.X_OK,function(e){t(e?null:n)}):t(n)})})},readFile:p,requireJson:h,versionRegex:d,findDarwinApplication:m,generatePlistBuddyCommand:g,matchAll:v,parseSDKManagerOutput:function(e){var t=e.split("Available")[0];return{apiLevels:v(u.androidAPILevels,t).map(function(e){return e[1]}),buildTools:v(u.androidBuildTools,t).map(function(e){return e[1]}),systemImages:v(u.androidSystemImages,t).map(function(e){return e[1].split("|").map(function(e){return e.trim()})}).map(function(e){return e[0].split(";")[0]+" | "+e[2].split(" System Image")[0]})}},isLinux:"linux"===process.platform,isMacOS:"darwin"===process.platform,NA:"N/A",NotFound:"Not Found",isWindows:process.platform.startsWith("win"),isObject:function(e){return"object"==typeof e&&!Array.isArray(e)},noop:function(e){return e},pipe:function(e){return function(t){return e.reduce(function(e,t){return t(e)},t)}},browserBundleIdentifiers:{"Brave Browser":"com.brave.Browser",Chrome:"com.google.Chrome","Chrome Canary":"com.google.Chrome.canary",Firefox:"org.mozilla.firefox","Firefox Developer Edition":"org.mozilla.firefoxdeveloperedition","Firefox Nightly":"org.mozilla.nightly","Microsoft Edge":"com.microsoft.edgemac",Safari:"com.apple.Safari","Safari Technology Preview":"com.apple.SafariTechnologyPreview"},ideBundleIdentifiers:{Atom:"com.github.atom",IntelliJ:"com.jetbrains.intellij",PhpStorm:"com.jetbrains.PhpStorm","Sublime Text":"com.sublimetext.3",WebStorm:"com.jetbrains.WebStorm"},runSync:function(e){return(s.execSync(e,{stdio:[0,"pipe","ignore"]}).toString()||"").trim()},which:function(e){return new Promise(function(t){return c(e,function(e,n){return t(n)})})},getDarwinApplicationVersion:function(e){var t;return f("trace","getDarwinApplicationVersion",e),t="darwin"!==process.platform?"N/A":m(e).then(function(e){return l(g(r.join(e,"Contents","Info.plist"),["CFBundleShortVersionString"]))}),Promise.resolve(t)},uniq:function(e){return Array.from(new Set(e))},toReadableBytes:function(e){var t=Math.floor(Math.log(e)/Math.log(1024));return e?(e/Math.pow(1024,t)).toFixed(2)+" "+["B","KB","MB","GB","TB","PB"][t]:"0 Bytes"},omit:function(e,t){return Object.keys(e).filter(function(e){return t.indexOf(e)<0}).reduce(function(t,n){return Object.assign(t,{[n]:e[n]})},{})},pick:function(e,t){return Object.keys(e).filter(function(e){return t.indexOf(e)>=0}).reduce(function(t,n){return Object.assign(t,{[n]:e[n]})},{})},getPackageJsonByName:function(e){return h(r.join(process.cwd(),"node_modules",e,"package.json"))},getPackageJsonByPath:function(e){return h(r.join(process.cwd(),e))},getPackageJsonByFullPath:function(e){return f("trace","getPackageJsonByFullPath",e),h(e)},getAllPackageJsonPaths:function(e){return f("trace","getAllPackageJsonPaths",e),new Promise(function(t){var n=function(e,n){return t(n.map(r.normalize)||[])};return a(e?r.join("node_modules",e,"package.json"):r.join("node_modules","**","package.json"),n)})},sortObject:function(e){return Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})},findVersion:function(e,t,n){f("trace","findVersion",e,t,n);var r=n||0,o=t||d,i=e.match(o);return i?i[r]:e},condensePath:function(e){return(e||"").replace(i.homedir(),"~")},determineFound:function(e,t,n){return f("trace","determineFound",e,t,n),"N/A"===t?Promise.resolve([e,"N/A"]):t&&0!==Object.keys(t).length?n?Promise.resolve([e,t,n]):Promise.resolve([e,t]):Promise.resolve([e,"Not Found"])}}},function(e,t,n){"use strict";var r,o,i,s,c=n(36),a=n(4),u=n(12),l=n(56),f=n(8),p=n(6),h=n(19),d=n(37),m=n(38),g=n(81),v=n(60).set,y=n(83)(),b=n(62),w=n(84),x=n(85),S=n(86),P=a.TypeError,O=a.process,I=O&&O.versions,E=I&&I.v8||"",j=a.Promise,_="process"==l(O),A=function(){},k=o=b.f,N=!!function(){try{var e=j.resolve(1),t=(e.constructor={})[n(3)("species")]=function(e){e(A,A)};return(_||"function"==typeof PromiseRejectionEvent)&&e.then(A)instanceof t&&0!==E.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),F=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},C=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,s=function(t){var n,i,s,c=o?t.ok:t.fail,a=t.resolve,u=t.reject,l=t.domain;try{c?(o||(2==e._h&&T(e),e._h=1),!0===c?n=r:(l&&l.enter(),n=c(r),l&&(l.exit(),s=!0)),n===t.promise?u(P("Promise-chain cycle")):(i=F(n))?i.call(n,a,u):a(n)):u(r)}catch(e){l&&!s&&l.exit(),u(e)}};n.length>i;)s(n[i++]);e._c=[],e._n=!1,t&&!e._h&&M(e)})}},M=function(e){v.call(a,function(){var t,n,r,o=e._v,i=V(e);if(i&&(t=w(function(){_?O.emit("unhandledRejection",o,e):(n=a.onunhandledrejection)?n({promise:e,reason:o}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=_||V(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},V=function(e){return 1!==e._h&&0===(e._a||e._c).length},T=function(e){v.call(a,function(){var t;_?O.emit("rejectionHandled",e):(t=a.onrejectionhandled)&&t({promise:e,reason:e._v})})},$=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),C(t,!0))},D=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw P("Promise can't be resolved itself");(t=F(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,u(D,r,1),u($,r,1))}catch(e){$.call(r,e)}}):(n._v=e,n._s=1,C(n,!1))}catch(e){$.call({_w:n,_d:!1},e)}}};N||(j=function(e){d(this,j,"Promise","_h"),h(e),r.call(this);try{e(u(D,this,1),u($,this,1))}catch(e){$.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(40)(j.prototype,{then:function(e,t){var n=k(g(this,j));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=_?O.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=u(D,e,1),this.reject=u($,e,1)},b.f=k=function(e){return e===j||e===s?new i(e):o(e)}),f(f.G+f.W+f.F*!N,{Promise:j}),n(26)(j,"Promise"),n(63)("Promise"),s=n(18).Promise,f(f.S+f.F*!N,"Promise",{reject:function(e){var t=k(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(c||!N),"Promise",{resolve:function(e){return S(c&&this===s?j:this,e)}}),f(f.S+f.F*!(N&&n(41)(function(e){j.all(e).catch(A)})),"Promise",{all:function(e){var t=this,n=k(t),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,s=1;m(e,!1,function(e){var c=i++,a=!1;n.push(void 0),s++,t.resolve(e).then(function(e){a||(a=!0,n[c]=e,--s||r(n))},o)}),--s||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=k(t),r=n.reject,o=w(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){var r=n(55)("wks"),o=n(24),i=n(4).Symbol,s="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=require("fs")},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(6);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(4),o=n(18),i=n(14),s=n(15),c=n(12),a=function(e,t,n){var u,l,f,p,h=e&a.F,d=e&a.G,m=e&a.S,g=e&a.P,v=e&a.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,b=d?o:o[t]||(o[t]={}),w=b.prototype||(b.prototype={});for(u in d&&(n=t),n)f=((l=!h&&y&&void 0!==y[u])?y:n)[u],p=v&&l?c(f,r):g&&"function"==typeof f?c(Function.call,f):f,y&&s(y,u,f,e&a.U),b[u]!=f&&i(b,u,p),g&&w[u]!=f&&(w[u]=f)};r.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,e.exports=a},function(e,t,n){e.exports=!n(10)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(7),o=n(50),i=n(51),s=Object.defineProperty;t.f=n(9)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(19);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){n(28)("split",2,function(e,t,r){"use strict";var o=n(92),i=r,s=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var c=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!o(e))return i.call(n,e,t);var r,a,u,l,f,p=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,m=void 0===t?4294967295:t>>>0,g=new RegExp(e.source,h+"g");for(c||(r=new RegExp("^"+g.source+"$(?!\\s)",h));(a=g.exec(n))&&!((u=a.index+a[0].length)>d&&(p.push(n.slice(d,a.index)),!c&&a.length>1&&a[0].replace(r,function(){for(f=1;f1&&a.index=m));)g.lastIndex===a.index&&g.lastIndex++;return d===n.length?!l&&g.test("")||p.push(""):p.push(n.slice(d)),p.length>m?p.slice(0,m):p}}else"0".split(void 0,0).length&&(r=function(e,t){return void 0===e&&0===t?[]:i.call(this,e,t)});return[function(n,o){var i=e(this),s=null==n?void 0:n[t];return void 0!==s?s.call(n,i,o):r.call(String(i),n,o)},r]})},function(e,t,n){var r=n(11),o=n(23);e.exports=n(9)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(4),o=n(14),i=n(16),s=n(24)("src"),c=Function.toString,a=(""+c).split("toString");n(18).inspectSource=function(e){return c.call(e)},(e.exports=function(e,t,n,c){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(i(n,s)||o(n,s,e[t]?""+e[t]:a.join(String(t)))),e===r?e[t]=n:c?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||c.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=require("os")},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(8);r(r.S+r.F,"Object",{assign:n(88)})},function(e,t,n){n(28)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(53),o=n(34);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(11).f,o=n(16),i=n(3)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){n(28)("replace",2,function(e,t,n){return[function(r,o){"use strict";var i=e(this),s=null==r?void 0:r[t];return void 0!==s?s.call(r,i,o):n.call(String(i),r,o)},n]})},function(e,t,n){"use strict";var r=n(14),o=n(15),i=n(10),s=n(34),c=n(3);e.exports=function(e,t,n){var a=c(e),u=n(s,a,""[e]),l=u[0],f=u[1];i(function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,l),r(RegExp.prototype,a,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(34);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=require("util")},function(e,t,n){var r=n(70);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(o),e.exports.strict=r(i),o.proto=o(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})})},function(e,t,n){"use strict";var r=n(8),o=n(52)(!0);r(r.P,"Array",{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(80)("includes")},function(e,t,n){var r=n(6),o=n(4).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(54),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){e.exports=!1},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(12),o=n(57),i=n(58),s=n(7),c=n(35),a=n(59),u={},l={};(t=e.exports=function(e,t,n,f,p){var h,d,m,g,v=p?function(){return e}:a(e),y=r(n,f,t?2:1),b=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(i(v)){for(h=c(e.length);h>b;b++)if((g=t?y(s(d=e[b])[0],d[1]):y(e[b]))===u||g===l)return g}else for(m=v.call(e);!(d=m.next()).done;)if((g=o(m,y,d.value,t))===u||g===l)return g}).BREAK=u,t.RETURN=l},function(e,t){e.exports={}},function(e,t,n){var r=n(15);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){var r=n(3)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},e(i)}catch(e){}return n}},function(e,t,n){var r=n(87),o=n(66);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(55)("keys"),o=n(24);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){e.exports=b;var r=n(5),o=n(67),i=n(46),s=(i.Minimatch,n(97)),c=n(68).EventEmitter,a=n(0),u=n(47),l=n(48),f=n(99),p=n(69),h=(p.alphasort,p.alphasorti,p.setopts),d=p.ownProp,m=n(100),g=(n(30),p.childrenIgnored),v=p.isIgnored,y=n(31);function b(e,t,n){if("function"==typeof t&&(n=t,t={}),t||(t={}),t.sync){if(n)throw new TypeError("callback provided to sync glob");return f(e,t)}return new x(e,t,n)}b.sync=f;var w=b.GlobSync=f.GlobSync;function x(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new w(e,t)}if(!(this instanceof x))return new x(e,t,n);h(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),"function"==typeof n&&(n=y(n),this.on("error",n),this.on("end",function(e){n(null,e)}));var o=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===r)return c();for(var i=!0,s=0;s1)return!0;for(var o=0;othis.maxLength)return t();if(!this.stat&&d(this.cache,n)){var i=this.cache[n];if(Array.isArray(i)&&(i="DIR"),!o||"DIR"===i)return t(null,i);if(o&&"FILE"===i)return t()}var s=this.statCache[n];if(void 0!==s){if(!1===s)return t(null,s);var c=s.isDirectory()?"DIR":"FILE";return o&&"FILE"===c?t():t(null,c,s)}var a=this,u=m("stat\0"+n,function(o,i){if(i&&i.isSymbolicLink())return r.stat(n,function(r,o){r?a._stat2(e,n,null,i,t):a._stat2(e,n,r,o,t)});a._stat2(e,n,o,i,t)});u&&r.lstat(n,u)},x.prototype._stat2=function(e,t,n,r,o){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,o();var i="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return o(null,!1,r);var s=!0;return r&&(s=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,i&&"FILE"===s?o():o(null,s,r)}},function(e,t,n){e.exports=d,d.Minimatch=m;var r={sep:"/"};try{r=n(0)}catch(e){}var o=d.GLOBSTAR=m.GLOBSTAR={},i=n(94),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},c="[^/]",a=c+"*?",u="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",l="(?:(?!(?:\\/|^)\\.).)*?",f="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var p=/\/+/;function h(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function d(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new m(t,n).match(e))}function m(e,t){if(!(this instanceof m))return new m(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==r.sep&&(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function g(e,t){if(t||(t=this instanceof m?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}d.filter=function(e,t){return t=t||{},function(n,r,o){return d(n,e,t)}},d.defaults=function(e){if(!e||!Object.keys(e).length)return d;var t=d,n=function(n,r,o){return t.minimatch(n,r,h(e,o))};return n.Minimatch=function(n,r){return new t.Minimatch(n,h(e,r))},n},m.defaults=function(e){return e&&Object.keys(e).length?d.defaults(e).Minimatch:m},m.prototype.debug=function(){},m.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(p)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,n),this.set=n},m.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=this.options,r=0;if(n.nonegate)return;for(var o=0,i=e.length;o65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return o;if(""===e)return"";var r,i="",u=!!n.nocase,l=!1,p=[],h=[],d=!1,m=-1,g=-1,y="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function w(){if(r){switch(r){case"*":i+=a,u=!0;break;case"?":i+=c,u=!0;break;default:i+="\\"+r}b.debug("clearStateChar %j %j",r,i),r=!1}}for(var x,S=0,P=e.length;S-1;k--){var N=h[k],F=i.slice(0,N.reStart),C=i.slice(N.reStart,N.reEnd-8),M=i.slice(N.reEnd-8,N.reEnd),V=i.slice(N.reEnd);M+=V;var T=F.split("(").length-1,$=V;for(S=0;S=0&&!(o=e[i]);i--);for(i=0;i>> no match, partial?",e,p,t,h),p!==c))}if("string"==typeof l?(u=r.nocase?f.toLowerCase()===l.toLowerCase():f===l,this.debug("string match",l,f,u)):(u=f.match(l),this.debug("pattern match",l,f,u)),!u)return!1}if(i===c&&s===a)return!0;if(i===c)return n;if(s===a)return i===c-1&&""===e[i];throw new Error("wtf?")}},function(e,t){e.exports=require("assert")},function(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function o(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||"",r=Boolean(n&&":"!==n.charAt(1));return Boolean(t[2]||r)}e.exports="win32"===process.platform?o:r,e.exports.posix=r,e.exports.win32=o},function(e,t){e.exports=require("child_process")},function(e,t,n){e.exports=!n(9)&&!n(10)(function(){return 7!=Object.defineProperty(n(33)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(6);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(25),o=n(35),i=n(79);e.exports=function(e){return function(t,n,s){var c,a=r(t),u=o(a.length),l=i(s,u);if(e&&n!=n){for(;u>l;)if((c=a[l++])!=c)return!0}else for(;u>l;l++)if((e||l in a)&&a[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(20);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(18),o=n(4),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(36)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(20),o=n(3)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){var r=n(7);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(39),o=n(3)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(56),o=n(3)("iterator"),i=n(39);e.exports=n(18).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r,o,i,s=n(12),c=n(82),a=n(61),u=n(33),l=n(4),f=l.process,p=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,g=0,v={},y=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},b=function(e){y.call(e.data)};p&&h||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++g]=function(){c("function"==typeof e?e:Function(e),t)},r(g),g},h=function(e){delete v[e]},"process"==n(20)(f)?r=function(e){f.nextTick(s(y,e,1))}:m&&m.now?r=function(e){m.now(s(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=s(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in u("script")?function(e){a.appendChild(u("script")).onreadystatechange=function(){a.removeChild(this),y.call(e)}}:function(e){setTimeout(s(y,e,1),0)}),e.exports={set:p,clear:h}},function(e,t,n){var r=n(4).document;e.exports=r&&r.documentElement},function(e,t,n){"use strict";var r=n(19);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){"use strict";var r=n(4),o=n(11),i=n(9),s=n(3)("species");e.exports=function(e){var t=r[e];i&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(8),o=n(65)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){var r=n(42),o=n(25),i=n(44).f;e.exports=function(e){return function(t){for(var n,s=o(t),c=r(s),a=c.length,u=0,l=[];a>u;)i.call(s,n=c[u++])&&l.push(e?[n,s[n]]:s[n]);return l}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){e.exports=l,l.realpath=l,l.sync=f,l.realpathSync=f,l.monkeypatch=function(){r.realpath=l,r.realpathSync=f},l.unmonkeypatch=function(){r.realpath=o,r.realpathSync=i};var r=n(5),o=r.realpath,i=r.realpathSync,s=process.version,c=/^v[0-5]\./.test(s),a=n(93);function u(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function l(e,t,n){if(c)return o(e,t,n);"function"==typeof t&&(n=t,t=null),o(e,t,function(r,o){u(r)?a.realpath(e,t,n):n(r,o)})}function f(e,t){if(c)return i(e,t);try{return i(e,t)}catch(n){if(u(n))return a.realpathSync(e,t);throw n}}},function(e,t){e.exports=require("events")},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.alphasort=u,t.alphasorti=a,t.setopts=function(e,t,n){n||(n={});if(n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0);e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(l))}(e,n),e.changedCwd=!1;var i=process.cwd();r(n,"cwd")?(e.cwd=o.resolve(n.cwd),e.changedCwd=e.cwd!==i):e.cwd=i;e.root=n.root||o.resolve(e.cwd,"/"),e.root=o.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=s(e.cwd)?e.cwd:f(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,e.minimatch=new c(t,n),e.options=e.minimatch.options},t.ownProp=r,t.makeAbs=f,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,o=e.matches.length;rdocument.F=Object<\/script>"),e.close(),a=e.F;r--;)delete a.prototype[i[r]];return a()};e.exports=Object.create||function(e,t){var n;return null!==e?(c.prototype=r(e),n=new c,c.prototype=null,n[s]=e):n=a(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(24)("meta"),o=n(6),i=n(16),s=n(11).f,c=0,a=Object.isExtensible||function(){return!0},u=!n(10)(function(){return a(Object.preventExtensions({}))}),l=function(e){s(e,r,{value:{i:"O"+ ++c,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!a(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!a(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return u&&f.NEED&&a(e)&&!i(e,r)&&l(e),e}}},function(e,t,n){var r=n(6);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(8),o=n(65)(!1);r(r.S,"Object",{values:function(e){return o(e)}})},function(e,t,n){"use strict";var r=n(7);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){e.exports=u,u.sync=function(e,t){for(var n=a(e,t=t||{}),r=n.env,i=n.ext,u=n.extExe,l=[],f=0,p=r.length;f{const t=(e=e||{}).env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).find(e=>"PATH"===e.toUpperCase())||"Path"})},function(e,t,n){"use strict";n(32),n(2),n(27),n(64),n(21);var r=n(90),o=n(161),i=n(170),s=n(1);function c(e,t){(t=t||{}).clipboard&&console.log("\n*** Clipboard option removed - use clipboardy or clipboard-cli directly ***\n");var n=Object.keys(e).length>0?e:i.defaults,s=Object.entries(n).reduce(function(e,n){var o=n[0],i=n[1],s=r[`get${o}`];return s?(i&&e.push(s(i,t)),e):e=e.concat((i||[]).map(function(e){var t=r[`get${e.replace(/\s/g,"")}Info`];return t?t():Promise.resolve(["Unknown"])}))},[]);return Promise.all(s).then(function(e){var n=e.reduce(function(e,t){return t&&t[0]&&Object.assign(e,{[t[0]]:t}),e},{});return function(e,t){var n=t.json?o.json:t.markdown?o.markdown:o.yaml;if(t.console){var r=!1;process.stdout.isTTY&&(r=!0),console.log(n(e,Object.assign({},t,{console:r})))}return n(e,Object.assign({},t,{console:!1}))}(Object.entries(i.defaults).reduce(function(e,t){var r=t[0],o=t[1];return n[r]?Object.assign(e,{[r]:n[r][1]}):Object.assign(e,{[r]:(o||[]).reduce(function(e,t){return n[t]?(n[t].shift(),1===n[t].length?Object.assign(e,{[t]:n[t][0]}):Object.assign(e,{[t]:{version:n[t][0],path:n[t][1]}})):e},{})})},{}),t)})}e.exports={cli:function(e){if(e.all)return c(Object.assign({},i.defaults,{npmPackages:!0,npmGlobalPackages:!0}),e);if(e.raw)return c(JSON.parse(e.raw),e);if(e.helper){var t=r[`get${e.helper}`]||r[`get${e.helper}Info`]||r[e.helper];return t?t().then(console.log):console.error("Not Found")}var n=function(e,t){return e.toLowerCase().includes(t.toLowerCase())},o=Object.keys(e).filter(function(e){return Object.keys(i.defaults).some(function(t){return n(t,e)})}),a=Object.entries(i.defaults).reduce(function(t,r){return o.some(function(e){return n(e,r[0])})?Object.assign(t,{[r[0]]:r[1]||e[r[0]]}):t},{});return e.preset?i[e.preset]?c(Object.assign({},s.omit(i[e.preset],["options"]),a),Object.assign({},i[e.preset].options,s.pick(e,["duplicates","fullTree","json","markdown","console"]))):console.error(`\nNo "${e.preset}" preset found.`):c(a,e)},helpers:r,main:c,run:function(e,t){return"string"==typeof e.preset?c(i[e.preset],t):c(e,t)}}},function(e,t,n){var r=n(54),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(3)("unscopables"),o=Array.prototype;null==o[r]&&n(14)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){var r=n(7),o=n(19),i=n(3)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||null==(n=r(s)[i])?t:o(n)}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(4),o=n(60).set,i=r.MutationObserver||r.WebKitMutationObserver,s=r.process,c=r.Promise,a="process"==n(20)(s);e.exports=function(){var e,t,n,u=function(){var r,o;for(a&&(r=s.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(a)n=function(){s.nextTick(u)};else if(!i||r.navigator&&r.navigator.standalone)if(c&&c.resolve){var l=c.resolve(void 0);n=function(){l.then(u)}}else n=function(){o.call(r,u)};else{var f=!0,p=document.createTextNode("");new i(u).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(4).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(7),o=n(6),i=n(62);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(16),o=n(25),i=n(52)(!1),s=n(43)("IE_PROTO");e.exports=function(e,t){var n,c=o(e),a=0,u=[];for(n in c)n!=s&&r(c,n)&&u.push(n);for(;t.length>a;)r(c,n=t[a++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){"use strict";var r=n(42),o=n(89),i=n(44),s=n(29),c=n(53),a=Object.assign;e.exports=!a||n(10)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=a({},e)[n]||Object.keys(a({},t)).join("")!=r})?function(e,t){for(var n=s(e),a=arguments.length,u=1,l=o.f,f=i.f;a>u;)for(var p,h=c(arguments[u++]),d=l?r(h).concat(l(h)):r(h),m=d.length,g=0;m>g;)f.call(h,p=d[g++])&&(n[p]=h[p]);return n}:a},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n(21);var o=n(91),i=n(1),s=n(122),c=n(123),a=n(124),u=n(125),l=n(126),f=n(127),p=n(128),h=n(129),d=n(130),m=n(131),g=n(159),v=n(160);e.exports=Object.assign({},i,o,function(e){for(var t=1;t=e.length)return t&&(t[h]=e),n(null,e);a.lastIndex=s;var r=a.exec(e);return p=l,l+=r[0],f=p+r[1],s=a.lastIndex,m[f]||t&&t[f]===f?process.nextTick(v):t&&Object.prototype.hasOwnProperty.call(t,f)?w(t[f]):i.lstat(f,y)}function y(e,r){if(e)return n(e);if(!r.isSymbolicLink())return m[f]=!0,t&&(t[f]=f),process.nextTick(v);if(!o){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(d.hasOwnProperty(s))return b(null,d[s],f)}i.stat(f,function(e){if(e)return n(e);i.readlink(f,function(e,t){o||(d[s]=t),b(e,t)})})}function b(e,o,i){if(e)return n(e);var s=r.resolve(p,o);t&&(t[i]=s),w(s)}function w(t){e=r.resolve(t,e.slice(s)),g()}g()}},function(e,t,n){var r=n(95),o=n(96);e.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function e(t,n){var i=[];var s=o("{","}",t);if(!s||/\$$/.test(s.pre))return[t];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body);var u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body);var f=a||u;var g=s.body.indexOf(",")>=0;if(!f&&!g)return s.post.match(/,.*\}/)?(t=s.pre+"{"+s.body+c+s.post,e(t)):[t];var v;if(f)v=s.body.split(/\.\./);else if(1===(v=function e(t){if(!t)return[""];var n=[];var r=o("{","}",t);if(!r)return t.split(",");var i=r.pre;var s=r.body;var c=r.post;var a=i.split(",");a[a.length-1]+="{"+s+"}";var u=e(c);c.length&&(a[a.length-1]+=u.shift(),a.push.apply(a,u));n.push.apply(n,a);return n}(s.body)).length&&1===(v=e(v[0],!1).map(p)).length){var y=s.post.length?e(s.post,!1):[""];return y.map(function(e){return s.pre+v[0]+e})}var b=s.pre;var y=s.post.length?e(s.post,!1):[""];var w;if(f){var x=l(v[0]),S=l(v[1]),P=Math.max(v[0].length,v[1].length),O=3==v.length?Math.abs(l(v[2])):1,I=d,E=S0){var N=new Array(k+1).join("0");A=_<0?"-"+N+A.slice(1):N+A}}w.push(A)}}else w=r(v,function(t){return e(t,!1)});for(var F=0;F=t}},function(e,t){e.exports=function(e,t){for(var r=[],o=0;o=0&&u>0){for(r=[],i=n.length;l>=0&&!c;)l==a?(r.push(l),a=n.indexOf(e,l+1)):1==r.length?c=[r.pop(),u]:((o=r.pop())=0?a:u;r.length&&(c=[i,s])}return c}e.exports=r,r.range=i},function(e,t,n){try{var r=n(30);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(98)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=d,d.GlobSync=m;var r=n(5),o=n(67),i=n(46),s=(i.Minimatch,n(45).Glob,n(30),n(0)),c=n(47),a=n(48),u=n(69),l=(u.alphasort,u.alphasorti,u.setopts),f=u.ownProp,p=u.childrenIgnored,h=u.isIgnored;function d(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new m(e,t).found}function m(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof m))return new m(e,t);if(l(this,e,t),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var r=0;rthis.maxLength)return!1;if(!this.stat&&f(this.cache,t)){var o=this.cache[t];if(Array.isArray(o)&&(o="DIR"),!n||"DIR"===o)return o;if(n&&"FILE"===o)return!1}var i=this.statCache[t];if(!i){var s;try{s=r.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(s&&s.isSymbolicLink())try{i=r.statSync(t)}catch(e){i=s}else i=s}this.statCache[t]=i;o=!0;return i&&(o=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,(!n||"FILE"!==o)&&o},m.prototype._mark=function(e){return u.mark(this,e)},m.prototype._makeAbs=function(e){return u.makeAbs(this,e)}},function(e,t,n){var r=n(70),o=Object.create(null),i=n(31);e.exports=r(function(e,t){return o[e]?(o[e].push(t),null):(o[e]=[t],function(e){return i(function t(){var n=o[e],r=n.length,i=function(e){for(var t=e.length,n=[],r=0;rr?(n.splice(0,r),process.nextTick(function(){t.apply(null,i)})):delete o[e]}})}(e))})},function(e,t,n){"use strict";var r=n(8),o=n(19),i=n(29),s=n(10),c=[].sort,a=[1,2,3];r(r.P+r.F*(s(function(){a.sort(void 0)})||!s(function(){a.sort(null)})||!n(102)(c)),"Array",{sort:function(e){return void 0===e?c.call(i(this)):c.call(i(this),o(e))}})},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){"use strict";var r=n(104),o=n(73);e.exports=n(110)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(o(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r=n(11).f,o=n(71),i=n(40),s=n(12),c=n(37),a=n(38),u=n(106),l=n(109),f=n(63),p=n(9),h=n(72).fastKey,d=n(73),m=p?"_s":"size",g=function(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var l=e(function(e,r){c(e,l,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,null!=r&&a(r,n,e[u],e)});return i(l.prototype,{clear:function(){for(var e=d(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=d(this,t),r=g(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){d(this,t);for(var n,r=s(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(d(this,t),e)}}),p&&r(l.prototype,"size",{get:function(){return d(this,t)[m]}}),l},def:function(e,t,n){var r,o,i=g(e,t);return i?i.v=n:(e._l=i={i:o=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:g,setStrong:function(e,t,n){u(e,t,function(e,n){this._t=d(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?l(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,l(1))},n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){var r=n(11),o=n(7),i=n(42);e.exports=n(9)?Object.defineProperties:function(e,t){o(e);for(var n,s=i(t),c=s.length,a=0;c>a;)r.f(e,n=s[a++],t[n]);return e}},function(e,t,n){"use strict";var r=n(36),o=n(8),i=n(15),s=n(14),c=n(39),a=n(107),u=n(26),l=n(108),f=n(3)("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,g,v){a(n,t,d);var y,b,w,x=function(e){if(!p&&e in I)return I[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+" Iterator",P="values"==m,O=!1,I=e.prototype,E=I[f]||I["@@iterator"]||m&&I[m],j=E||x(m),_=m?P?x("entries"):j:void 0,A="Array"==t&&I.entries||E;if(A&&(w=l(A.call(new e)))!==Object.prototype&&w.next&&(u(w,S,!0),r||"function"==typeof w[f]||s(w,f,h)),P&&E&&"values"!==E.name&&(O=!0,j=function(){return E.call(this)}),r&&!v||!p&&!O&&I[f]||s(I,f,j),c[t]=j,c[S]=h,m)if(y={values:P?j:x("values"),keys:g?j:x("keys"),entries:_},v)for(b in y)b in I||i(I,b,y[b]);else o(o.P+o.F*(p||O),t,y);return y}},function(e,t,n){"use strict";var r=n(71),o=n(23),i=n(26),s={};n(14)(s,n(3)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(16),o=n(29),i=n(43)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(4),o=n(8),i=n(15),s=n(40),c=n(72),a=n(38),u=n(37),l=n(6),f=n(10),p=n(41),h=n(26),d=n(111);e.exports=function(e,t,n,m,g,v){var y=r[e],b=y,w=g?"set":"add",x=b&&b.prototype,S={},P=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return v&&!l(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(v||x.forEach&&!f(function(){(new b).entries().next()}))){var O=new b,I=O[w](v?{}:-0,1)!=O,E=f(function(){O.has(1)}),j=p(function(e){new b(e)}),_=!v&&f(function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)});j||((b=t(function(t,n){u(t,b,e);var r=d(new y,t,b);return null!=n&&a(n,g,r[w],r),r})).prototype=x,x.constructor=b),(E||_)&&(P("delete"),P("has"),g&&P("get")),(_||I)&&P(w),v&&x.clear&&delete x.clear}else b=m.getConstructor(t,e,g,w),s(b.prototype,n),c.NEED=!0;return h(b,e),S[e]=b,o(o.G+o.W+o.F*(b!=y),S),v||m.setStrong(b,e,g),b}},function(e,t,n){var r=n(6),o=n(112).set;e.exports=function(e,t,n){var i,s=t.constructor;return s!==n&&"function"==typeof s&&(i=s.prototype)!==n.prototype&&r(i)&&o&&o(e,i),e}},function(e,t,n){var r=n(6),o=n(7),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(12)(Function.call,n(113).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){var r=n(44),o=n(23),i=n(25),s=n(51),c=n(16),a=n(50),u=Object.getOwnPropertyDescriptor;t.f=n(9)?u:function(e,t){if(e=i(e),t=s(t,!0),a)try{return u(e,t)}catch(e){}if(c(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){"use strict";var r=n(12),o=n(8),i=n(29),s=n(57),c=n(58),a=n(35),u=n(115),l=n(59);o(o.S+o.F*!n(41)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,f,p=i(e),h="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,g=void 0!==m,v=0,y=l(p);if(g&&(m=r(m,d>2?arguments[2]:void 0,2)),null==y||h==Array&&c(y))for(n=new h(t=a(p.length));t>v;v++)u(n,v,g?m(p[v],v):p[v]);else for(f=y.call(p),n=new h;!(o=f.next()).done;v++)u(n,v,g?s(f,m,[o.value,v],!0):o.value);return n.length=v,n}})},function(e,t,n){"use strict";var r=n(11),o=n(23);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){"use strict";n(117);var r=n(7),o=n(75),i=n(9),s=/./.toString,c=function(e){n(15)(RegExp.prototype,"toString",e,!0)};n(10)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?c(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!i&&e instanceof RegExp?o.call(e):void 0)}):"toString"!=s.name&&c(function(){return s.call(this)})},function(e,t,n){n(9)&&"g"!=/./g.flags&&n(11).f(RegExp.prototype,"flags",{configurable:!0,get:n(75)})},function(e,t,n){var r;n(5);function o(e,t,n){if("function"==typeof t&&(n=t,t={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise(function(n,r){o(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}r="win32"===process.platform||global.TESTING_WINDOWS?n(119):n(120),e.exports=o,o.sync=function(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},function(e,t,n){e.exports=i,i.sync=function(e,t){return o(r.statSync(e),e,t)};var r=n(5);function o(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var r=0;r&1").then(r.findVersion),r.run("which python")]).then(function(e){return r.determineFound("Python",e[0],e[1])})},getPython3Info:function(){return r.log("trace","getPython3Info"),Promise.all([r.run("python3 -V 2>&1").then(r.findVersion),r.run("which python3")]).then(function(e){return r.determineFound("Python3",e[0],e[1])})},getRInfo:function(){return r.log("trace","getRInfo"),Promise.all([r.run("R --version",{unify:!0}).then(r.findVersion),r.which("R")]).then(function(e){return r.determineFound("R",e[0],e[1])})},getRubyInfo:function(){return r.log("trace","getRubyInfo"),Promise.all([r.run("ruby -v").then(r.findVersion),r.which("ruby")]).then(function(e){return r.determineFound("Ruby",e[0],e[1])})},getRustInfo:function(){return r.log("trace","getRustInfo"),Promise.all([r.run("rustc --version").then(r.findVersion),r.run("which rustc")]).then(function(e){return r.determineFound("Rust",e[0],e[1])})},getScalaInfo:function(){return r.log("trace","getScalaInfo"),r.isMacOS||r.isLinux?Promise.all([r.run("scalac -version").then(r.findVersion),r.run("which scalac")]).then(function(e){return r.determineFound("Scala",e[0],e[1])}):Promise.resolve(["Scala","N/A"])}}},function(e,t,n){"use strict";n(2);var r=n(1);e.exports={getAptInfo:function(){return r.log("trace","getAptInfo"),r.isLinux?Promise.all([r.run("apt --version").then(r.findVersion),r.which("apt")]).then(function(e){return r.determineFound("Apt",e[0],e[1])}):Promise.all(["Apt","N/A"])},getCargoInfo:function(){return r.log("trace","getCargoInfo"),Promise.all([r.run("cargo --version").then(r.findVersion),r.which("cargo").then(r.condensePath)]).then(function(e){return r.determineFound("Cargo",e[0],e[1])})},getCocoaPodsInfo:function(){return r.log("trace","getCocoaPodsInfo"),r.isMacOS?Promise.all([r.run("pod --version").then(r.findVersion),r.which("pod")]).then(function(e){return r.determineFound("CocoaPods",e[0],e[1])}):Promise.all(["CocoaPods","N/A"])},getComposerInfo:function(){return r.log("trace","getComposerInfo"),Promise.all([r.run("composer --version").then(r.findVersion),r.which("composer").then(r.condensePath)]).then(function(e){return r.determineFound("Composer",e[0],e[1])})},getGradleInfo:function(){return r.log("trace","getGradleInfo"),Promise.all([r.run("gradle --version").then(r.findVersion),r.which("gradle").then(r.condensePath)]).then(function(e){return r.determineFound("Gradle",e[0],e[1])})},getHomebrewInfo:function(){return r.log("trace","getHomebrewInfo"),r.isMacOS||r.isLinux?Promise.all([r.run("brew --version").then(r.findVersion),r.which("brew")]).then(function(e){return r.determineFound("Homebrew",e[0],e[1])}):Promise.all(["Homebrew","N/A"])},getMavenInfo:function(){return r.log("trace","getMavenInfo"),Promise.all([r.run("mvn --version").then(r.findVersion),r.which("mvn").then(r.condensePath)]).then(function(e){return r.determineFound("Maven",e[0],e[1])})},getpip2Info:function(){return r.log("trace","getpip2Info"),Promise.all([r.run("pip2 --version").then(r.findVersion),r.which("pip2").then(r.condensePath)]).then(function(e){return r.determineFound("pip2",e[0],e[1])})},getpip3Info:function(){return r.log("trace","getpip3Info"),Promise.all([r.run("pip3 --version").then(r.findVersion),r.which("pip3").then(r.condensePath)]).then(function(e){return r.determineFound("pip3",e[0],e[1])})},getRubyGemsInfo:function(){return r.log("trace","getRubyGemsInfo"),Promise.all([r.run("gem --version").then(r.findVersion),r.which("gem")]).then(function(e){return r.determineFound("RubyGems",e[0],e[1])})},getYumInfo:function(){return r.log("trace","getYumInfo"),r.isLinux?Promise.all([r.run("yum --version").then(r.findVersion),r.which("yum")]).then(function(e){return r.determineFound("Yum",e[0],e[1])}):Promise.all(["Yum","N/A"])}}},function(e,t,n){"use strict";n(2);var r=n(1),o=n(0);e.exports={getYarnWorkspacesInfo:function(){return r.log("trace","getYarnWorkspacesInfo"),Promise.all([r.run("yarn -v"),r.getPackageJsonByPath("package.json").then(function(e){return e&&"workspaces"in e})]).then(function(e){var t="Yarn Workspaces";return e[0]&&e[1]?Promise.resolve([t,e[0]]):Promise.resolve([t,"Not Found"])})},getLernaInfo:function(){return r.log("trace","getLernaInfo"),Promise.all([r.getPackageJsonByName("lerna").then(function(e){return e&&e.version}),r.fileExists(o.join(process.cwd(),"lerna.json"))]).then(function(e){return e[0]&&e[1]?Promise.resolve(["Lerna",e[0]]):Promise.resolve(["Lerna","Not Found"])})}}},function(e,t,n){"use strict";n(22),n(2),n(13);var r=n(5),o=n(0),i=n(1);e.exports={getAndroidSDKInfo:function(){return i.run("sdkmanager --list").then(function(e){return!e&&process.env.ANDROID_HOME?i.run(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager --list`):e}).then(function(e){return!e&&process.env.ANDROID_HOME?i.run(`${process.env.ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --list`):e}).then(function(e){return!e&&i.isMacOS?i.run("~/Library/Android/sdk/tools/bin/sdkmanager --list"):e}).then(function(e){var t=i.parseSDKManagerOutput(e),n=function(e){var t,n=o.join(e,"source.properties");try{t=r.readFileSync(n,"utf8")}catch(e){if("ENOENT"===e.code)return;throw e}for(var i=t.split("\n"),s=0;s&1").then(r.findVersion),r.run("which nginx")]).then(function(e){return r.determineFound("Nginx",e[0],e[1])}):Promise.resolve(["Nginx","N/A"])}}},function(e,t,n){"use strict";n(13),n(22),n(2);var r=n(132),o=n(1),i=n(17);e.exports={getContainerInfo:function(){return o.log("trace","getContainerInfo"),o.isLinux?Promise.all([o.fileExists("/.dockerenv"),o.readFile("/proc/self/cgroup")]).then(function(e){return o.log("trace","getContainerInfoThen",e),Promise.resolve(["Container",e[0]||e[1]?"Yes":"N/A"])}).catch(function(e){return o.log("trace","getContainerInfoCatch",e)}):Promise.resolve(["Container","N/A"])},getCPUInfo:function(){var e;o.log("trace","getCPUInfo");try{var t=i.cpus();e="("+t.length+") "+i.arch()+" "+t[0].model}catch(t){e="Unknown"}return Promise.all(["CPU",e])},getMemoryInfo:function(){return o.log("trace","getMemoryInfo"),Promise.all(["Memory",`${o.toReadableBytes(i.freemem())} / ${o.toReadableBytes(i.totalmem())}`])},getOSInfo:function(){var e,t;if(o.log("trace","getOSInfo"),o.isMacOS)e=o.run("sw_vers -productVersion ");else if(o.isLinux)e=o.run("cat /etc/os-release").then(function(e){var t=(e||"").match(/NAME="(.+)"/)||"",n=(e||"").match(/VERSION="(.+)"/)||["",""],r=null!==n?n[1]:"";return`${t[1]} ${r}`.trim()||""});else if(o.isWindows){e=Promise.resolve(i.release());var n=i.release().split(".");"10"===n[0]&&"0"===n[1]&&n[2]>=22e3&&(t="Windows 11")}else e=Promise.resolve();return e.then(function(e){return t=t||r(i.platform(),i.release()),e&&(t+=` ${e}`),["OS",t]})},getShellInfo:function(){if(o.log("trace","getShellInfo",process.env),o.isMacOS||o.isLinux){var e=process.env.SHELL||o.runSync("getent passwd $LOGNAME | cut -d: -f7 | head -1"),t=`${e} --version 2>&1`;return e.match("/bin/ash")&&(t=`${e} --help 2>&1`),Promise.all([o.run(t).then(o.findVersion),o.which(e)]).then(function(e){return o.determineFound("Shell",e[0]||"Unknown",e[1])})}return Promise.resolve(["Shell","N/A"])},getGLibcInfo:function(){return o.log("trace","getGLibc"),o.isLinux?Promise.all([o.run("ldd --version").then(o.findVersion)]).then(function(e){return o.determineFound("GLibc",e[0]||"Unknown")}):Promise.resolve(["GLibc","N/A"])}}},function(e,t,n){"use strict";const r=n(17),o=n(133),i=n(134);e.exports=((e,t)=>{if(!e&&t)throw new Error("You can't specify a `release` without specifying `platform`");let n;if("darwin"===(e=e||r.platform()))return t||"darwin"!==r.platform()||(t=r.release()),(t?Number(t.split(".")[0])>15?"macOS":"OS X":"macOS")+((n=t?o(t).name:"")?" "+n:"");return"linux"===e?(t||"linux"!==r.platform()||(t=r.release()),"Linux"+((n=t?t.replace(/^(\d+\.\d+).*/,"$1"):"")?" "+n:"")):"win32"===e?(t||"win32"!==r.platform()||(t=r.release()),"Windows"+((n=t?i(t):"")?" "+n:"")):e})},function(e,t,n){"use strict";const r=n(17),o=new Map([[18,"Mojave"],[17,"High Sierra"],[16,"Sierra"],[15,"El Capitan"],[14,"Yosemite"],[13,"Mavericks"],[12,"Mountain Lion"],[11,"Lion"],[10,"Snow Leopard"],[9,"Leopard"],[8,"Tiger"],[7,"Panther"],[6,"Jaguar"],[5,"Puma"]]),i=e=>(e=Number((e||r.release()).split(".")[0]),{name:o.get(e),version:"10."+(e-4)});e.exports=i,e.exports.default=i},function(e,t,n){"use strict";const r=n(17),o=n(135),i=new Map([["10.0","10"],["6.3","8.1"],["6.2","8"],["6.1","7"],["6.0","Vista"],["5.2","Server 2003"],["5.1","XP"],["5.0","2000"],["4.9","ME"],["4.1","98"],["4.0","95"]]);e.exports=(e=>{const t=/\d+\.\d/.exec(e||r.release());if(e&&!t)throw new Error("`release` argument doesn't match `n.n`");const n=(t||[])[0];if((!e||e===r.release())&&["6.1","6.2","6.3","10.0"].includes(n)){const e=((o.sync("wmic",["os","get","Caption"]).stdout||"").match(/2008|2012|2016/)||[])[0];if(e)return`Server ${e}`}return i.get(n)})},function(e,t,n){"use strict";const r=n(0),o=n(49),i=n(136),s=n(146),c=n(147),a=n(148),u=n(149),l=n(154),f=n(155),p=n(157),h=n(158),d=1e7;function m(e,t,n){let o;return(n=Object.assign({extendEnv:!0,env:{}},n)).extendEnv&&(n.env=Object.assign({},process.env,n.env)),!0===n.__winShell?(delete n.__winShell,o={command:e,args:t,options:n,file:e,original:{cmd:e,args:t}}):o=i._parse(e,t,n),(n=Object.assign({maxBuffer:d,buffer:!0,stripEof:!0,preferLocal:!0,localDir:o.options.cwd||process.cwd(),encoding:"utf8",reject:!0,cleanup:!0},o.options)).stdio=h(n),n.preferLocal&&(n.env=c.env(Object.assign({},n,{cwd:n.localDir}))),n.detached&&(n.cleanup=!1),"win32"===process.platform&&"cmd.exe"===r.basename(o.command)&&o.args.unshift("/q"),{cmd:o.command,args:o.args,opts:n,parsed:o}}function g(e,t){return t&&e.stripEof&&(t=s(t)),t}function v(e,t,n){let r="/bin/sh",o=["-c",t];return n=Object.assign({},n),"win32"===process.platform&&(n.__winShell=!0,r=process.env.comspec||"cmd.exe",o=["/s","/c",`"${t}"`],n.windowsVerbatimArguments=!0),n.shell&&(r=n.shell,delete n.shell),e(r,o,n)}function y(e,t,{encoding:n,buffer:r,maxBuffer:o}){if(!e[t])return null;let i;return(i=r?n?u(e[t],{encoding:n,maxBuffer:o}):u.buffer(e[t],{maxBuffer:o}):new Promise((n,r)=>{e[t].once("end",n).once("error",r)})).catch(e=>{throw e.stream=t,e.message=`${t} ${e.message}`,e})}function b(e,t){const{stdout:n,stderr:r}=e;let o=e.error;const{code:i,signal:s}=e,{parsed:c,joinedCmd:a}=t,u=t.timedOut||!1;if(!o){let e="";Array.isArray(c.opts.stdio)?("inherit"!==c.opts.stdio[2]&&(e+=e.length>0?r:`\n${r}`),"inherit"!==c.opts.stdio[1]&&(e+=`\n${n}`)):"inherit"!==c.opts.stdio&&(e=`\n${r}${n}`),(o=new Error(`Command failed: ${a}${e}`)).code=i<0?p(i):i}return o.stdout=n,o.stderr=r,o.failed=!0,o.signal=s||null,o.cmd=a,o.timedOut=u,o}function w(e,t){let n=e;return Array.isArray(t)&&t.length>0&&(n+=" "+t.join(" ")),n}e.exports=((e,t,n)=>{const r=m(e,t,n),{encoding:s,buffer:c,maxBuffer:u}=r.opts,p=w(e,t);let h,d;try{h=o.spawn(r.cmd,r.args,r.opts)}catch(e){return Promise.reject(e)}r.opts.cleanup&&(d=f(()=>{h.kill()}));let v=null,x=!1;const S=()=>{v&&(clearTimeout(v),v=null),d&&d()};r.opts.timeout>0&&(v=setTimeout(()=>{v=null,x=!0,h.kill(r.opts.killSignal)},r.opts.timeout));const P=new Promise(e=>{h.on("exit",(t,n)=>{S(),e({code:t,signal:n})}),h.on("error",t=>{S(),e({error:t})}),h.stdin&&h.stdin.on("error",t=>{S(),e({error:t})})});function O(){h.stdout&&h.stdout.destroy(),h.stderr&&h.stderr.destroy()}const I=()=>l(Promise.all([P,y(h,"stdout",{encoding:s,buffer:c,maxBuffer:u}),y(h,"stderr",{encoding:s,buffer:c,maxBuffer:u})]).then(e=>{const t=e[0];if(t.stdout=e[1],t.stderr=e[2],t.error||0!==t.code||null!==t.signal){const e=b(t,{joinedCmd:p,parsed:r,timedOut:x});if(e.killed=e.killed||h.killed,!r.opts.reject)return e;throw e}return{stdout:g(r.opts,t.stdout),stderr:g(r.opts,t.stderr),code:0,failed:!1,killed:!1,signal:null,cmd:p,timedOut:!1}}),O);return i._enoent.hookChildProcess(h,r.parsed),function(e,t){null!=t&&(a(t)?t.pipe(e.stdin):e.stdin.end(t))}(h,r.opts.input),h.then=((e,t)=>I().then(e,t)),h.catch=(e=>I().catch(e)),h}),e.exports.stdout=((...t)=>e.exports(...t).then(e=>e.stdout)),e.exports.stderr=((...t)=>e.exports(...t).then(e=>e.stderr)),e.exports.shell=((t,n)=>v(e.exports,t,n)),e.exports.sync=((e,t,n)=>{const r=m(e,t,n),i=w(e,t);if(a(r.opts.input))throw new TypeError("The `input` option cannot be a stream in sync mode");const s=o.spawnSync(r.cmd,r.args,r.opts);if(s.code=s.status,s.error||0!==s.status||null!==s.signal){const e=b(s,{joinedCmd:i,parsed:r});if(!r.opts.reject)return e;throw e}return{stdout:g(r.opts,s.stdout),stderr:g(r.opts,s.stderr),code:0,failed:!1,signal:null,cmd:i,timedOut:!1}}),e.exports.shellSync=((t,n)=>v(e.exports.sync,t,n))},function(e,t,n){"use strict";const r=n(49),o=n(137),i=n(145);function s(e,t,n){const s=o(e,t,n),c=r.spawn(s.command,s.args,s.options);return i.hookChildProcess(c,s),c}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,n){const s=o(e,t,n),c=r.spawnSync(s.command,s.args,s.options);return c.error=c.error||i.verifyENOENTSync(c.status,s),c},e.exports._parse=o,e.exports._enoent=i},function(e,t,n){"use strict";const r=n(0),o=n(138),i=n(139),s=n(140),c=n(141),a=n(144),u="win32"===process.platform,l=/\.(?:com|exe)$/i,f=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i,p=o(()=>a.satisfies(process.version,"^4.8.0 || ^5.7.0 || >= 6.0.0",!0))||!1;function h(e){if(!u)return e;const t=function(e){e.file=i(e);const t=e.file&&c(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}(e),n=!l.test(t);if(e.options.forceShell||n){const n=f.test(t);e.command=r.normalize(e.command),e.command=s.command(e.command),e.args=e.args.map(e=>s.argument(e,n));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}e.exports=function(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null);const r={command:e,args:t=t?t.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:e,args:t}};return n.shell?function(e){if(p)return e;const t=[e.command].concat(e.args).join(" ");return u?(e.command="string"==typeof e.options.shell?e.options.shell:process.env.comspec||"cmd.exe",e.args=["/d","/s","/c",`"${t}"`],e.options.windowsVerbatimArguments=!0):("string"==typeof e.options.shell?e.command=e.options.shell:"android"===process.platform?e.command="/system/bin/sh":e.command="/bin/sh",e.args=["-c",t]),e}(r):h(r)}},function(e,t,n){"use strict";e.exports=function(e){try{return e()}catch(e){}}},function(e,t,n){"use strict";const r=n(0),o=n(76),i=n(77)();function s(e,t){const n=process.cwd(),s=null!=e.options.cwd;if(s)try{process.chdir(e.options.cwd)}catch(e){}let c;try{c=o.sync(e.command,{path:(e.options.env||process.env)[i],pathExt:t?r.delimiter:void 0})}catch(e){}finally{process.chdir(n)}return c&&(c=r.resolve(s?e.options.cwd:"",c)),c}e.exports=function(e){return s(e)||s(e,!0)}},function(e,t,n){"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e=e.replace(r,"^$1")},e.exports.argument=function(e,t){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(r,"^$1"),t&&(e=e.replace(r,"^$1")),e}},function(e,t,n){"use strict";const r=n(5),o=n(142);e.exports=function(e){let t,n;Buffer.alloc?t=Buffer.alloc(150):(t=new Buffer(150)).fill(0);try{n=r.openSync(e,"r"),r.readSync(n,t,0,150,0),r.closeSync(n)}catch(e){}return o(t.toString())}},function(e,t,n){"use strict";var r=n(143);e.exports=function(e){var t=e.match(r);if(!t)return null;var n=t[0].replace(/#! ?/,"").split(" "),o=n[0].split("/").pop(),i=n[1];return"env"===o?i:o+(i?" "+i:"")}},function(e,t,n){"use strict";e.exports=/^#!.*/},function(e,t){var n;t=e.exports=Y,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=t.re=[],s=t.src=[],c=0,a=c++;s[a]="0|[1-9]\\d*";var u=c++;s[u]="[0-9]+";var l=c++;s[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var f=c++;s[f]="("+s[a]+")\\.("+s[a]+")\\.("+s[a]+")";var p=c++;s[p]="("+s[u]+")\\.("+s[u]+")\\.("+s[u]+")";var h=c++;s[h]="(?:"+s[a]+"|"+s[l]+")";var d=c++;s[d]="(?:"+s[u]+"|"+s[l]+")";var m=c++;s[m]="(?:-("+s[h]+"(?:\\."+s[h]+")*))";var g=c++;s[g]="(?:-?("+s[d]+"(?:\\."+s[d]+")*))";var v=c++;s[v]="[0-9A-Za-z-]+";var y=c++;s[y]="(?:\\+("+s[v]+"(?:\\."+s[v]+")*))";var b=c++,w="v?"+s[f]+s[m]+"?"+s[y]+"?";s[b]="^"+w+"$";var x="[v=\\s]*"+s[p]+s[g]+"?"+s[y]+"?",S=c++;s[S]="^"+x+"$";var P=c++;s[P]="((?:<|>)?=?)";var O=c++;s[O]=s[u]+"|x|X|\\*";var I=c++;s[I]=s[a]+"|x|X|\\*";var E=c++;s[E]="[v=\\s]*("+s[I]+")(?:\\.("+s[I]+")(?:\\.("+s[I]+")(?:"+s[m]+")?"+s[y]+"?)?)?";var j=c++;s[j]="[v=\\s]*("+s[O]+")(?:\\.("+s[O]+")(?:\\.("+s[O]+")(?:"+s[g]+")?"+s[y]+"?)?)?";var _=c++;s[_]="^"+s[P]+"\\s*"+s[E]+"$";var A=c++;s[A]="^"+s[P]+"\\s*"+s[j]+"$";var k=c++;s[k]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var N=c++;s[N]="(?:~>?)";var F=c++;s[F]="(\\s*)"+s[N]+"\\s+",i[F]=new RegExp(s[F],"g");var C=c++;s[C]="^"+s[N]+s[E]+"$";var M=c++;s[M]="^"+s[N]+s[j]+"$";var V=c++;s[V]="(?:\\^)";var T=c++;s[T]="(\\s*)"+s[V]+"\\s+",i[T]=new RegExp(s[T],"g");var $=c++;s[$]="^"+s[V]+s[E]+"$";var D=c++;s[D]="^"+s[V]+s[j]+"$";var B=c++;s[B]="^"+s[P]+"\\s*("+x+")$|^$";var L=c++;s[L]="^"+s[P]+"\\s*("+w+")$|^$";var R=c++;s[R]="(\\s*)"+s[P]+"\\s*("+x+"|"+s[E]+")",i[R]=new RegExp(s[R],"g");var G=c++;s[G]="^\\s*("+s[E]+")\\s+-\\s+("+s[E]+")\\s*$";var W=c++;s[W]="^\\s*("+s[j]+")\\s+-\\s+("+s[j]+")\\s*$";var U=c++;s[U]="(<|>)?=?\\s*\\*";for(var K=0;K<35;K++)n(K,s[K]),i[K]||(i[K]=new RegExp(s[K]));function q(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Y)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?i[S]:i[b]).test(e))return null;try{return new Y(e,t)}catch(e){return null}}function Y(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Y){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof Y))return new Y(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var s=e.trim().match(t.loose?i[S]:i[b]);if(!s)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new Y(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Z(e,t))return null;var n=q(e),r=q(t);if(n.prerelease.length||r.prerelease.length){for(var o in n)if(("major"===o||"minor"===o||"patch"===o)&&n[o]!==r[o])return"pre"+o;return"prerelease"}for(var o in n)if(("major"===o||"minor"===o||"patch"===o)&&n[o]!==r[o])return o},t.compareIdentifiers=J;var H=/^[0-9]+$/;function J(e,t){var n=H.test(e),r=H.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:et?1:0}function z(e,t,n){return new Y(e,n).compare(new Y(t,n))}function Q(e,t,n){return z(e,t,n)>0}function X(e,t,n){return z(e,t,n)<0}function Z(e,t,n){return 0===z(e,t,n)}function ee(e,t,n){return 0!==z(e,t,n)}function te(e,t,n){return z(e,t,n)>=0}function ne(e,t,n){return z(e,t,n)<=0}function re(e,t,n,r){var o;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),o=e===n;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),o=e!==n;break;case"":case"=":case"==":o=Z(e,n,r);break;case"!=":o=ee(e,n,r);break;case">":o=Q(e,n,r);break;case">=":o=te(e,n,r);break;case"<":o=X(e,n,r);break;case"<=":o=ne(e,n,r);break;default:throw new TypeError("Invalid operator: "+t)}return o}function oe(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof oe){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof oe))return new oe(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ie?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return J(t,e)},t.major=function(e,t){return new Y(e,t).major},t.minor=function(e,t){return new Y(e,t).minor},t.patch=function(e,t){return new Y(e,t).patch},t.compare=z,t.compareLoose=function(e,t){return z(e,t,!0)},t.rcompare=function(e,t,n){return z(t,e,n)},t.sort=function(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})},t.rsort=function(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})},t.gt=Q,t.lt=X,t.eq=Z,t.neq=ee,t.gte=te,t.lte=ne,t.cmp=re,t.Comparator=oe;var ie={};function se(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof se)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new se(e.raw,t);if(e instanceof oe)return new se(e.value,t);if(!(this instanceof se))return new se(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function ce(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,c,a,u,l,f,p){return((t=ce(n)?"":ce(r)?">="+n+".0.0":ce(o)?">="+n+"."+r+".0":">="+t)+" "+(c=ce(a)?"":ce(u)?"<"+(+a+1)+".0.0":ce(l)?"<"+a+"."+(+u+1)+".0":f?"<="+a+"."+u+"."+l+"-"+f:"<="+c)).trim()}function ue(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new se(t,n)}catch(e){return!1}return t.test(e)}function fe(e,t,n,r){var o,i,s,c,a;switch(e=new Y(e,r),t=new se(t,r),n){case">":o=Q,i=ne,s=X,c=">",a=">=";break;case"<":o=X,i=te,s=Q,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var u=0;u=0.0.0")),f=f||e,p=p||e,o(e.semver,f.semver,r)?f=e:s(e.semver,p.semver,r)&&(p=e)}),f.operator===c||f.operator===a)return!1;if((!p.operator||p.operator===c)&&i(e,p.semver))return!1;if(p.operator===a&&s(e,p.semver))return!1}return!0}oe.prototype.parse=function(e){var t=this.options.loose?i[B]:i[L],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new Y(n[2],this.options.loose):this.semver=ie},oe.prototype.toString=function(){return this.value},oe.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===ie||("string"==typeof e&&(e=new Y(e,this.options)),re(e,this.operator,this.semver,this.options))},oe.prototype.intersects=function(e,t){if(!(e instanceof oe))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new se(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new se(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),c=re(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=re(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||c||a},t.Range=se,se.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},se.prototype.toString=function(){return this.range},se.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?i[W]:i[G];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(i[R],"$1$2$3"),n("comparator trim",e,i[R]),e=(e=(e=e.replace(i[F],"$1~")).replace(i[T],"$1^")).split(/\s+/).join(" ");var o=t?i[B]:i[L],s=e.split(" ").map(function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){n("caret",e,t),t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1});var r=t.loose?i[D]:i[$];return e.replace(r,function(t,r,o,i,s){var c;return n("caret",e,t,r,o,i,s),ce(r)?c="":ce(o)?c=">="+r+".0.0 <"+(+r+1)+".0.0":ce(i)?c="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),"-"!==s.charAt(0)&&(s="-"+s),c="0"===r?"0"===o?">="+r+"."+o+"."+i+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+s+" <"+(+r+1)+".0.0"):(n("no pr"),c="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",c),c})}(e,t)}).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1});var r=t.loose?i[M]:i[C];return e.replace(r,function(t,r,o,i,s){var c;return n("tilde",e,t,r,o,i,s),ce(r)?c="":ce(o)?c=">="+r+".0.0 <"+(+r+1)+".0.0":ce(i)?c=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),"-"!==s.charAt(0)&&(s="-"+s),c=">="+r+"."+o+"."+i+s+" <"+r+"."+(+o+1)+".0"):c=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",c),c})}(e,t)}).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim(),t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1});var r=t.loose?i[A]:i[_];return e.replace(r,function(t,r,o,i,s,c){n("xRange",e,t,r,o,i,s,c);var a=ce(o),u=a||ce(i),l=u||ce(s),f=l;return"="===r&&f&&(r=""),a?t=">"===r||"<"===r?"<0.0.0":"*":r&&f?(u&&(i=0),l&&(s=0),">"===r?(r=">=",u?(o=+o+1,i=0,s=0):l&&(i=+i+1,s=0)):"<="===r&&(r="<",u?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):u?t=">="+o+".0.0 <"+(+o+1)+".0.0":l&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t})}(e,t)}).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(i[U],"")}(e,t),n("stars",e),e}(e,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter(function(e){return!!e.match(o)})),s=s.map(function(e){return new oe(e,this.options)},this)},se.prototype.intersects=function(e,t){if(!(e instanceof se))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=function(e,t){return new se(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},se.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new Y(e,this.options));for(var t=0;t",n)},t.outside=fe,t.prerelease=function(e,t){var n=q(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new se(e,n),t=new se(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof Y)return e;if("string"!=typeof e)return null;var t=e.match(i[k]);return null==t?null:q((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}},function(e,t,n){"use strict";const r="win32"===process.platform;function o(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){return r&&1===e&&!t.file?o(t.original,"spawn"):null}e.exports={hookChildProcess:function(e,t){if(!r)return;const n=e.emit;e.emit=function(r,o){if("exit"===r){const r=i(o,t);if(r)return n.call(e,"error",r)}return n.apply(e,arguments)}},verifyENOENT:i,verifyENOENTSync:function(e,t){return r&&1===e&&!t.file?o(t.original,"spawnSync"):null},notFoundError:o}},function(e,t,n){"use strict";e.exports=function(e){var t="string"==typeof e?"\n":"\n".charCodeAt(),n="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}},function(e,t,n){"use strict";const r=n(0),o=n(77);e.exports=(e=>{let t;e=Object.assign({cwd:process.cwd(),path:process.env[o()]},e);let n=r.resolve(e.cwd);const i=[];for(;t!==n;)i.push(r.join(n,"node_modules/.bin")),t=n,n=r.resolve(n,"..");return i.push(r.dirname(process.execPath)),i.concat(e.path).join(r.delimiter)}),e.exports.env=(t=>{t=Object.assign({env:process.env},t);const n=Object.assign({},t.env),r=o({env:n});return t.path=n[r],n[r]=e.exports(t),n})},function(e,t,n){"use strict";var r=e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe};r.writable=function(e){return r(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState},r.readable=function(e){return r(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState},r.duplex=function(e){return r.writable(e)&&r.readable(e)},r.transform=function(e){return r.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState}},function(e,t,n){"use strict";const r=n(150),o=n(152);class i extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}function s(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));t=Object.assign({maxBuffer:1/0},t);const{maxBuffer:n}=t;let s;return new Promise((c,a)=>{const u=e=>{e&&(e.bufferedData=s.getBufferedValue()),a(e)};(s=r(e,o(t),e=>{e?u(e):c()})).on("data",()=>{s.getBufferedLength()>n&&u(new i)})}).then(()=>s.getBufferedValue())}e.exports=s,e.exports.buffer=((e,t)=>s(e,Object.assign({},t,{encoding:"buffer"}))),e.exports.array=((e,t)=>s(e,Object.assign({},t,{array:!0}))),e.exports.MaxBufferError=i},function(e,t,n){var r=n(31),o=n(151),i=n(5),s=function(){},c=/^v?\.0/.test(process.version),a=function(e){return"function"==typeof e},u=function(e,t,n,u){u=r(u);var l=!1;e.on("close",function(){l=!0}),o(e,{readable:t,writable:n},function(e){if(e)return u(e);l=!0,u()});var f=!1;return function(t){if(!l&&!f)return f=!0,function(e){return!!c&&!!i&&(e instanceof(i.ReadStream||s)||e instanceof(i.WriteStream||s))&&a(e.close)}(e)?e.close(s):function(e){return e.setHeader&&a(e.abort)}(e)?e.abort():a(e.destroy)?e.destroy():void u(t||new Error("stream was destroyed"))}},l=function(e){e()},f=function(e,t){return e.pipe(t)};e.exports=function(){var e,t=Array.prototype.slice.call(arguments),n=a(t[t.length-1]||s)&&t.pop()||s;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r=t.map(function(o,i){var s=i0,function(t){e||(e=t),t&&r.forEach(l),s||(r.forEach(l),n(e))})});return t.reduce(f)}},function(e,t,n){var r=n(31),o=function(){},i=function(e,t,n){if("function"==typeof t)return i(e,null,t);t||(t={}),n=r(n||o);var s=e._writableState,c=e._readableState,a=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=function(){e.writable||f()},f=function(){u=!1,a||n.call(e)},p=function(){a=!1,u||n.call(e)},h=function(t){n.call(e,t?new Error("exited with error code: "+t):null)},d=function(t){n.call(e,t)},m=function(){return(!a||c&&c.ended)&&(!u||s&&s.ended)?void 0:n.call(e,new Error("premature close"))},g=function(){e.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!s&&(e.on("end",l),e.on("close",l)):(e.on("complete",f),e.on("abort",m),e.req?g():e.on("request",g)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",h),e.on("end",p),e.on("finish",f),!1!==t.error&&e.on("error",d),e.on("close",m),function(){e.removeListener("complete",f),e.removeListener("abort",m),e.removeListener("request",g),e.req&&e.req.removeListener("finish",f),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",f),e.removeListener("exit",h),e.removeListener("end",p),e.removeListener("error",d),e.removeListener("close",m)}};e.exports=i},function(e,t,n){"use strict";const{PassThrough:r}=n(153);e.exports=(e=>{e=Object.assign({},e);const{array:t}=e;let{encoding:n}=e;const o="buffer"===n;let i=!1;t?i=!(n||o):n=n||"utf8",o&&(n=null);let s=0;const c=[],a=new r({objectMode:i});return n&&a.setEncoding(n),a.on("data",e=>{c.push(e),i?s=c.length:s+=e.length}),a.getBufferedValue=(()=>t?c:o?Buffer.concat(c,s):c.join("")),a.getBufferedLength=(()=>s),a})},function(e,t){e.exports=require("stream")},function(e,t,n){"use strict";e.exports=((e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e}))))},function(e,t,n){var r,o=n(47),i=n(156),s=n(68);function c(){l&&(l=!1,i.forEach(function(e){try{process.removeListener(e,u[e])}catch(e){}}),process.emit=d,process.reallyExit=p,r.count-=1)}function a(e,t,n){r.emitted[e]||(r.emitted[e]=!0,r.emit(e,t,n))}"function"!=typeof s&&(s=s.EventEmitter),process.__signal_exit_emitter__?r=process.__signal_exit_emitter__:((r=process.__signal_exit_emitter__=new s).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),e.exports=function(e,t){o.equal(typeof e,"function","a callback must be provided for exit handler"),!1===l&&f();var n="exit";t&&t.alwaysLast&&(n="afterexit");return r.on(n,e),function(){r.removeListener(n,e),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&c()}},e.exports.unload=c;var u={};i.forEach(function(e){u[e]=function(){process.listeners(e).length===r.count&&(c(),a("exit",null,e),a("afterexit",null,e),process.kill(process.pid,e))}}),e.exports.signals=function(){return i},e.exports.load=f;var l=!1;function f(){l||(l=!0,r.count+=1,i=i.filter(function(e){try{return process.on(e,u[e]),!0}catch(e){return!1}}),process.emit=m,process.reallyExit=h)}var p=process.reallyExit;function h(e){process.exitCode=e||0,a("exit",process.exitCode,null),a("afterexit",process.exitCode,null),p.call(process,process.exitCode)}var d=process.emit;function m(e,t){if("exit"===e){void 0!==t&&(process.exitCode=t);var n=d.apply(this,arguments);return a("exit",process.exitCode,null),a("afterexit",process.exitCode,null),n}return d.apply(this,arguments)}},function(e,t){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},function(e,t,n){"use strict";const r=n(30);let o;if("function"==typeof r.getSystemErrorName)e.exports=r.getSystemErrorName;else{try{if("function"!=typeof(o=process.binding("uv")).errname)throw new TypeError("uv.errname is not a function")}catch(e){console.error("execa/lib/errname: unable to establish process.binding('uv')",e),o=null}e.exports=(e=>i(o,e))}function i(e,t){if(e)return e.errname(t);if(!(t<0))throw new Error("err >= 0");return`Unknown system error ${t}`}e.exports.__test__=i},function(e,t,n){"use strict";const r=["stdin","stdout","stderr"];e.exports=(e=>{if(!e)return null;if(e.stdio&&(e=>r.some(t=>Boolean(e[t])))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${r.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof e.stdio)return e.stdio;const t=e.stdio||[];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=[],o=Math.max(t.length,r.length);for(let i=0;i&1").then(r.findVersion),r.run("which gcc")]).then(function(e){return r.determineFound("GCC",e[0],e[1])}):Promise.resolve(["GCC","N/A"])},getClangInfo:function(){return r.log("trace","getClangInfo"),Promise.all([r.run("clang --version").then(r.findVersion),r.which("clang")]).then(function(e){return r.determineFound("Clang",e[0],e[1])})},getGitInfo:function(){return r.log("trace","getGitInfo"),Promise.all([r.run("git --version").then(r.findVersion),r.run("which git")]).then(function(e){return r.determineFound("Git",e[0],e[1])})},getMakeInfo:function(){return r.log("trace","getMakeInfo"),r.isMacOS||r.isLinux?Promise.all([r.run("make --version").then(r.findVersion),r.run("which make")]).then(function(e){return r.determineFound("Make",e[0],e[1])}):Promise.resolve(["Make","N/A"])},getNinjaInfo:function(){return r.log("trace","getNinjaInfo"),Promise.all([r.run("ninja --version").then(r.findVersion),r.run("which ninja")]).then(function(e){return r.determineFound("Ninja",e[0],e[1])})},getMercurialInfo:function(){return r.log("trace","getMercurialInfo"),r.isMacOS||r.isLinux?Promise.all([r.run("hg --version").then(r.findVersion),r.run("which hg")]).then(function(e){return r.determineFound("Mercurial",e[0],e[1])}):Promise.resolve(["Mercurial","N/A"])},getSubversionInfo:function(){return r.log("trace","getSubversionInfo"),r.isMacOS||r.isLinux?Promise.all([r.run("svn --version").then(r.findVersion),r.run("which svn")]).then(function(e){return r.determineFound("Subversion",e[0],e[1])}):Promise.resolve(["Subversion","N/A"])},getFFmpegInfo:function(){return r.log("trace","getFFmpegInfo"),Promise.all([r.run("ffmpeg -version").then(r.findVersion),r.which("ffmpeg")]).then(function(e){return r.determineFound("FFmpeg",e[0],e[1])})},getCurlInfo:function(){return r.log("trace","getCurlInfo"),Promise.all([r.run("curl --version").then(r.findVersion),r.which("curl")]).then(function(e){return r.determineFound("Curl",e[0],e[1])})}}},function(e,t,n){"use strict";n(2);var r=n(1);e.exports={getDockerInfo:function(){return r.log("trace","getDockerInfo"),Promise.all([r.run("docker --version").then(r.findVersion),r.which("docker")]).then(function(e){return r.determineFound("Docker",e[0],e[1])})},getParallelsInfo:function(){return r.log("trace","getParallelsInfo"),Promise.all([r.run("prlctl --version").then(r.findVersion),r.which("prlctl")]).then(function(e){return r.determineFound("Parallels",e[0],e[1])})},getPodmanInfo:function(){return r.log("trace","getPodmanInfo"),Promise.all([r.run("podman --version").then(r.findVersion),r.which("podman")]).then(function(e){return r.determineFound("Podman",e[0],e[1])})},getVirtualBoxInfo:function(){return r.log("trace","getVirtualBoxInfo"),Promise.all([r.run("vboxmanage --version").then(r.findVersion),r.which("vboxmanage")]).then(function(e){return r.determineFound("VirtualBox",e[0],e[1])})},getVMwareFusionInfo:function(){return r.log("trace","getVMwareFusionInfo"),r.getDarwinApplicationVersion("com.vmware.fusion").then(function(e){return r.determineFound("VMWare Fusion",e,"N/A")})}}},function(e,t,n){"use strict";n(162),n(64),n(22),n(13),n(21),n(74);var r=n(163),o=n(1);function i(e,t){return o.log("trace","clean",e),Object.keys(e).reduce(function(n,r){return!t.showNotFound&&"Not Found"===e[r]||"N/A"===e[r]||void 0===e[r]||0===Object.keys(e[r]).length?n:o.isObject(e[r])?Object.values(e[r]).every(function(e){return"N/A"===e||!t.showNotFound&&"Not Found"===e})?n:Object.assign(n,{[r]:i(e[r],t)}):Object.assign(n,{[r]:e[r]})},{})}function s(e,t){o.log("trace","formatHeaders"),t||(t={type:"underline"});var n={underline:["",""]};return e.slice().split("\n").map(function(e){if(":"===e.slice("-1")){var r=e.match(/^[\s]*/g)[0];return`${r}${n[t.type][0]}${e.slice(r.length)}${n[t.type][1]}`}return e}).join("\n")}function c(e){return o.log("trace","formatPackages"),e.npmPackages?Object.assign(e,{npmPackages:Object.entries(e.npmPackages||{}).reduce(function(e,t){var n=t[0],r=t[1];if("Not Found"===r)return Object.assign(e,{[n]:r});var o=r.wanted?`${r.wanted} =>`:"",i=Array.isArray(r.installed)?r.installed.join(", "):r.installed,s=r.duplicates?`(${r.duplicates.join(", ")})`:"";return Object.assign(e,{[n]:`${o} ${i} ${s}`})},{})}):e}function a(e,t,n){return n||(n={emptyMessage:"None"}),Array.isArray(t)&&(t=t.length>0?t.join(", "):n.emptyMessage),{[e]:t}}function u(e){return o.log("trace","serializeArrays"),function e(t,n){return Object.entries(t).reduce(function(t,r){var i=r[0],s=r[1];return o.isObject(s)?Object.assign(t,{[i]:e(s,n)}):Object.assign(t,n(i,s))},{})}(e,a)}function l(e){return o.log("trace","serializeVersionsAndPaths"),Object.entries(e).reduce(function(e,t){return Object.assign(e,{[t[0]]:Object.entries(t[1]).reduce(function(e,t){var n=t[0],r=t[1];return r.version?Object.assign(e,{[n]:[r.version,r.path].filter(Boolean).join(" - ")}):Object.assign(e,{[n]:[r][0]})},{})},{})},{})}function f(e){return r(e,{indent:" ",prefix:"\n",postfix:"\n"})}function p(e){return e.slice().split("\n").map(function(e){if(""!==e){var t=":"===e.slice("-1"),n=e.search(/\S|$/);return t?`${"#".repeat(n/2+1)} `+e.slice(n):" - "+e.slice(n)}return""}).join("\n")}function h(e,t){return t||(t={indent:" "}),JSON.stringify(e,null,t.indent)}e.exports={json:function(e,t){return o.log("trace","formatToJson"),t||(t={}),e=o.pipe([function(){return i(e,t)},t.title?function(e){return{[t.title]:e}}:o.noop,h])(e),e=t.console?`\n${e}\n`:e},markdown:function(e,t){return o.log("trace","formatToMarkdown"),o.pipe([function(){return i(e,t)},c,u,l,f,p,t.title?function(e){return`\n# ${t.title}${e}`}:o.noop])(e,t)},yaml:function(e,t){return o.log("trace","formatToYaml",t),o.pipe([function(){return i(e,t)},c,u,l,t.title?function(e){return{[t.title]:e}}:o.noop,f,t.console?s:o.noop])(e,t)}}},function(e,t,n){n(28)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){"use strict";var r=n(164),o=n(165),i=n(169),s=["object","array"];e.exports=function(e,t){var n=o(t),c=n.colors,a=n.prefix,u=n.postfix,l=n.dateToString,f=n.errorToString,p=n.indent,h=new Map;function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===Object.keys(e).length)return" {}";var o="\n",c=i(t,p);return Object.keys(e).forEach(function(a){var u=e[a],l=r(u),f=i(n," "),p=-1!==s.indexOf(l)?"":" ",h=v(u)?" [Circular]":g(l,u,t+1,n);o+=`${f}${c}${a}:${p}${h}\n`}),o.substring(0,o.length-1)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===e.length)return" []";var o="\n",s=i(t,p);return e.forEach(function(e){var c=r(e),a=i(n," "),u=v(e)?"[Circular]":g(c,e,t,n+1).toString().trimLeft();o+=`${a}${s}- ${u}\n`}),o.substring(0,o.length-1)}function g(e,t,n,r){switch(e){case"array":return m(t,n,r);case"object":return d(t,n,r);case"string":return c.string(t);case"symbol":return c.symbol(t.toString());case"number":return c.number(t);case"boolean":return c.boolean(t);case"null":return c.null("null");case"undefined":return c.undefined("undefined");case"date":return c.date(l(t));case"error":return c.error(f(t));default:return t&&t.toString?t.toString():Object.prototype.toString.call(t)}}function v(e){return-1!==["object","array"].indexOf(r(e))&&(!!h.has(e)||(h.set(e),!1))}var y="";return h.set(e),"object"===r(e)&&Object.keys(e).length>0?y=d(e):"array"===r(e)&&e.length>0&&(y=m(e)),0===y.length?"":`${a}${y.slice(1)}${u}`}},function(e,t,n){"use strict";e.exports=function(e){return Array.isArray(e)?"array":e instanceof Date?"date":e instanceof Error?"error":null===e?"null":"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)?"object":typeof e}},function(e,t,n){"use strict";var r=n(166),o=n(167),i=n(168),s=" ",c="\n",a="";function u(e,t){return void 0===e?t:e}e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{indent:u(e.indent,s),prefix:u(e.prefix,c),postfix:u(e.postfix,a),errorToString:e.errorToString||r,dateToString:e.dateToString||o,colors:Object.assign({},i,e.colors)}}},function(e,t,n){"use strict";e.exports=function(e){return Error.prototype.toString.call(e)}},function(e,t,n){"use strict";e.exports=function(e){return`new Date(${Date.prototype.toISOString.call(e)})`}},function(e,t,n){"use strict";function r(e){return e}e.exports={date:r,error:r,symbol:r,string:r,number:r,boolean:r,null:r,undefined:r}},function(e,t,n){"use strict";e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n="",r=0;r=4" - }, - "scripts": { - "build": "webpack --progress", - "check:format": "prettier -l src/**/*.js --verbose", - "compress": "gzexe envinfo-* && upx envinfo-win.exe", - "contributors:add": "all-contributors add", - "contributors:generate": "all-contributors generate", - "postcompress": "tar -czvf envinfo-linux.tar.gz envinfo-linux && tar -czvf envinfo-macos.tar.gz envinfo-macos && zip -r -X envinfo-win.zip envinfo-win.exe", - "executable": "pkg package.json", - "format": "prettier --write src/**/*.js", - "lint": "eslint src", - "lint-fix": "eslint src --fix", - "preversion": "npm run test && webpack && git add .", - "postversion": "npm run executable && npm run compress && npm run release", - "release": "github-release upload --owner=tabrindle --repo=envinfo --tag=${npm_package_version} 'envinfo-linux.tar.gz' 'envinfo-macos.tar.gz' 'envinfo-win.zip'", - "start": "node -r esm src/cli.js", - "test": "jest --env=node && eslint src && prettier -l src/**/*.js" - }, - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS && npm run lint" - } - }, - "keywords": [ - "development", - "env", - "environment", - "info", - "issues", - "reporting", - "diagnostics" - ], - "pkg": { - "scripts": "dist/*.js", - "targets": [ - "linux", - "macos", - "win" - ] - }, - "jest": { - "testEnvironment": "node" - }, - "dependencies": {}, - "devDependencies": { - "@babel/core": "^7.2.2", - "@babel/plugin-proposal-optional-chaining": "^7.2.0", - "@babel/polyfill": "^7.2.5", - "@babel/preset-env": "^7.3.1", - "@commitlint/cli": "^8.3.5", - "@commitlint/config-conventional": "^8.3.4", - "all-contributors-cli": "^4.11.1", - "babel-core": "7.0.0-bridge.0", - "babel-eslint": "^10.0.1", - "babel-jest": "23.6.0", - "babel-loader": "^8.0.5", - "eslint": "^5.13.0", - "eslint-config-airbnb-base": "^12.1.0", - "eslint-config-prettier": "^2.7.0", - "eslint-plugin-import": "^2.8.0", - "eslint-plugin-prettier": "^2.3.1", - "esm": "^3.2.22", - "github-release-cli": "^0.4.1", - "glob": "^7.1.6", - "husky": "^4.2.5", - "jest": "^22.4.3", - "minimist": "^1.2.5", - "os-name": "^3.1.0", - "pkg": "^4.5.1", - "prettier": "^1.19.1", - "prettier-eslint-cli": "^4.1.1", - "webpack": "^4.29.6", - "webpack-cli": "^3.1.2", - "which": "^1.2.14", - "yamlify-object": "^0.5.1" - }, - "resolutions": { - "lodash": "4.17.15" - } -} diff --git a/node_modules/es-module-lexer/LICENSE b/node_modules/es-module-lexer/LICENSE deleted file mode 100644 index 013561a..0000000 --- a/node_modules/es-module-lexer/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -MIT License ------------ - -Copyright (C) 2018-2022 Guy Bedford - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/es-module-lexer/README.md b/node_modules/es-module-lexer/README.md deleted file mode 100644 index 3fe3dfa..0000000 --- a/node_modules/es-module-lexer/README.md +++ /dev/null @@ -1,323 +0,0 @@ -# ES Module Lexer - -[![Build Status][actions-image]][actions-url] - -A JS module syntax lexer used in [es-module-shims](https://github.com/guybedford/es-module-shims). - -Outputs the list of exports and locations of import specifiers, including dynamic import and import meta handling. - -A very small single JS file (4KiB gzipped) that includes inlined Web Assembly for very fast source analysis of ECMAScript module syntax only. - -For an example of the performance, Angular 1 (720KiB) is fully parsed in 5ms, in comparison to the fastest JS parser, Acorn which takes over 100ms. - -_Comprehensively handles the JS language grammar while remaining small and fast. - ~10ms per MB of JS cold and ~5ms per MB of JS warm, [see benchmarks](#benchmarks) for more info._ - -> [Built with](https://github.com/guybedford/es-module-lexer/blob/main/chompfile.toml) [Chomp](https://chompbuild.com/) - -### Usage - -``` -npm install es-module-lexer -``` - -For use in CommonJS: - -```js -const { init, parse } = require('es-module-lexer'); - -(async () => { - // either await init, or call parse asynchronously - // this is necessary for the Web Assembly boot - await init; - - const source = 'export var p = 5'; - const [imports, exports] = parse(source); - - // Returns "p" - source.slice(exports[0].s, exports[0].e); - // Returns "p" - source.slice(exports[0].ls, exports[0].le); -})(); -``` - -An ES module version is also available: - -```js -import { init, parse } from 'es-module-lexer'; - -(async () => { - await init; - - const source = ` - import { name } from 'mod\\u1011'; - import json from './json.json' assert { type: 'json' } - export var p = 5; - export function q () { - - }; - export { x as 'external name' } from 'external'; - - // Comments provided to demonstrate edge cases - import /*comment!*/ ( 'asdf', { assert: { type: 'json' }}); - import /*comment!*/.meta.asdf; - `; - - const [imports, exports] = parse(source, 'optional-sourcename'); - - // Returns "modထ" - imports[0].n - // Returns "mod\u1011" - source.slice(imports[0].s, imports[0].e); - // "s" = start - // "e" = end - - // Returns "import { name } from 'mod'" - source.slice(imports[0].ss, imports[0].se); - // "ss" = statement start - // "se" = statement end - - // Returns "{ type: 'json' }" - source.slice(imports[1].a, imports[1].se); - // "a" = assert, -1 for no assertion - - // Returns "external" - source.slice(imports[2].s, imports[2].e); - - // Returns "p" - source.slice(exports[0].s, exports[0].e); - // Returns "p" - source.slice(exports[0].ls, exports[0].le); - // Returns "q" - source.slice(exports[1].s, exports[1].e); - // Returns "q" - source.slice(exports[1].ls, exports[1].le); - // Returns "'external name'" - source.slice(exports[2].s, exports[2].e); - // Returns -1 - exports[2].ls; - // Returns -1 - exports[2].le; - - // Dynamic imports are indicated by imports[2].d > -1 - // In this case the "d" index is the start of the dynamic import bracket - // Returns true - imports[2].d > -1; - - // Returns "asdf" (only for string literal dynamic imports) - imports[2].n - // Returns "import /*comment!*/ ( 'asdf', { assert: { type: 'json' } })" - source.slice(imports[3].ss, imports[3].se); - // Returns "'asdf'" - source.slice(imports[3].s, imports[3].e); - // Returns "( 'asdf', { assert: { type: 'json' } })" - source.slice(imports[3].d, imports[3].se); - // Returns "{ assert: { type: 'json' } }" - source.slice(imports[3].a, imports[3].se - 1); - - // For non-string dynamic import expressions: - // - n will be undefined - // - a is currently -1 even if there is an assertion - // - e is currently the character before the closing ) - - // For nested dynamic imports, the se value of the outer import is -1 as end tracking does not - // currently support nested dynamic immports - - // import.meta is indicated by imports[3].d === -2 - // Returns true - imports[4].d === -2; - // Returns "import /*comment!*/.meta" - source.slice(imports[4].s, imports[4].e); - // ss and se are the same for import meta -})(); -``` - -### CSP asm.js Build - -The default version of the library uses Wasm and (safe) eval usage for performance and a minimal footprint. - -Neither of these represent security escalation possibilities since there are no execution string injection vectors, but that can still violate existing CSP policies for applications. - -For a version that works with CSP eval disabled, use the `es-module-lexer/js` build: - -```js -import { parse } from 'es-module-lexer/js'; -``` - -Instead of Web Assembly, this uses an asm.js build which is almost as fast as the Wasm version ([see benchmarks below](#benchmarks)). - -### Escape Sequences - -To handle escape sequences in specifier strings, the `.n` field of imported specifiers will be provided where possible. - -For dynamic import expressions, this field will be empty if not a valid JS string. - -### Facade Detection - -Facade modules that only use import / export syntax can be detected via the third return value: - -```js -const [,, facade] = parse(` - export * from 'external'; - import * as ns from 'external2'; - export { a as b } from 'external3'; - export { ns }; -`); -facade === true; -``` - -### ESM Detection - -Modules that uses ESM syntaxes can be detected via the fourth return value: - -```js -const [,,, hasModuleSyntax] = parse(` - export {} -`); -hasModuleSyntax === true; -``` - -Dynamic imports are ignored since they can be used in Non-ESM files. - -```js -const [,,, hasModuleSyntax] = parse(` - import('./foo.js') -`); -hasModuleSyntax === false; -``` - -### Environment Support - -Node.js 10+, and [all browsers with Web Assembly support](https://caniuse.com/#feat=wasm). - -### Grammar Support - -* Token state parses all line comments, block comments, strings, template strings, blocks, parens and punctuators. -* Division operator / regex token ambiguity is handled via backtracking checks against punctuator prefixes, including closing brace or paren backtracking. -* Always correctly parses valid JS source, but may parse invalid JS source without errors. - -### Limitations - -The lexing approach is designed to deal with the full language grammar including RegEx / division operator ambiguity through backtracking and paren / brace tracking. - -The only limitation to the reduced parser is that the "exports" list may not correctly gather all export identifiers in the following edge cases: - -```js -// Only "a" is detected as an export, "q" isn't -export var a = 'asdf', q = z; - -// "b" is not detected as an export -export var { a: b } = asdf; -``` - -The above cases are handled gracefully in that the lexer will keep going fine, it will just not properly detect the export names above. - -### Benchmarks - -Benchmarks can be run with `npm run bench`. - -Current results for a high spec machine: - -#### Wasm Build - -``` -Module load time -> 5ms -Cold Run, All Samples -test/samples/*.js (3123 KiB) -> 18ms - -Warm Runs (average of 25 runs) -test/samples/angular.js (739 KiB) -> 3ms -test/samples/angular.min.js (188 KiB) -> 1ms -test/samples/d3.js (508 KiB) -> 3ms -test/samples/d3.min.js (274 KiB) -> 2ms -test/samples/magic-string.js (35 KiB) -> 0ms -test/samples/magic-string.min.js (20 KiB) -> 0ms -test/samples/rollup.js (929 KiB) -> 4.32ms -test/samples/rollup.min.js (429 KiB) -> 2.16ms - -Warm Runs, All Samples (average of 25 runs) -test/samples/*.js (3123 KiB) -> 14.16ms -``` - -#### JS Build (asm.js) - -``` -Module load time -> 2ms -Cold Run, All Samples -test/samples/*.js (3123 KiB) -> 34ms - -Warm Runs (average of 25 runs) -test/samples/angular.js (739 KiB) -> 3ms -test/samples/angular.min.js (188 KiB) -> 1ms -test/samples/d3.js (508 KiB) -> 3ms -test/samples/d3.min.js (274 KiB) -> 2ms -test/samples/magic-string.js (35 KiB) -> 0ms -test/samples/magic-string.min.js (20 KiB) -> 0ms -test/samples/rollup.js (929 KiB) -> 5ms -test/samples/rollup.min.js (429 KiB) -> 3.04ms - -Warm Runs, All Samples (average of 25 runs) -test/samples/*.js (3123 KiB) -> 17.12ms -``` - -### Building - -This project uses [Chomp](https://chompbuild.com) for building. - -With Chomp installed, download the WASI SDK 12.0 from https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-12. - -- [Linux](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz) -- [Windows (MinGW)](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-mingw.tar.gz) -- [macOS](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz) - -Locate the WASI-SDK as a sibling folder, or customize the path via the `WASI_PATH` environment variable. - -Emscripten emsdk is also assumed to be a sibling folder or via the `EMSDK_PATH` environment variable. - -Example setup: - -``` -git clone https://github.com:guybedford/es-module-lexer -git clone https://github.com/emscripten-core/emsdk -cd emsdk -git checkout 1.40.1-fastcomp -./emsdk install 1.40.1-fastcomp -cd .. -wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz -gunzip wasi-sdk-12.0-linux.tar.gz -tar -xf wasi-sdk-12.0-linux.tar -mv wasi-sdk-12.0-linux.tar wasi-sdk-12.0 -cargo install chompbuild -cd es-module-lexer -chomp test -``` - -For the `asm.js` build, git clone `emsdk` from is assumed to be a sibling folder as well. - -### License - -MIT - -[actions-image]: https://github.com/guybedford/es-module-lexer/actions/workflows/build.yml/badge.svg -[actions-url]: https://github.com/guybedford/es-module-lexer/actions/workflows/build.yml diff --git a/node_modules/es-module-lexer/dist/lexer.asm.js b/node_modules/es-module-lexer/dist/lexer.asm.js deleted file mode 100644 index f098332..0000000 --- a/node_modules/es-module-lexer/dist/lexer.asm.js +++ /dev/null @@ -1,2 +0,0 @@ -/* es-module-lexer 1.4.1 */ -let e,a,r,i=2<<19;const s=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,a){const r=e.length;let i=0;for(;i>>8}},t="xportmportlassetaromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileforifcatcfinallels";let f,c,n;export function parse(l,k="@"){f=l,c=k;const u=2*f.length+(2<<18);if(u>i||!e){for(;u>i;)i*=2;a=new ArrayBuffer(i),s(t,new Uint16Array(a,16,105)),e=function(e,a,r){"use asm";var i=new e.Int8Array(r),s=new e.Int16Array(r),t=new e.Int32Array(r),f=new e.Uint8Array(r),c=new e.Uint16Array(r),n=1024;function b(){var e=0,a=0,r=0,f=0,b=0,u=0;u=n;n=n+10240|0;i[796]=1;i[795]=0;s[395]=0;s[396]=0;t[67]=t[2];i[797]=0;t[66]=0;i[794]=0;t[68]=u+2048;t[69]=u;i[798]=0;e=(t[3]|0)+-2|0;t[70]=e;a=e+(t[64]<<1)|0;t[71]=a;e:while(1){r=e+2|0;t[70]=r;if(e>>>0>=a>>>0){b=18;break}a:do{switch(s[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((s[396]|0)==0?H(r)|0:0)?(m(e+4|0,16,10)|0)==0:0)?(l(),(i[796]|0)==0):0){b=9;break e}else b=17;break}case 105:{if(H(r)|0?(m(e+4|0,26,10)|0)==0:0){k();b=17}else b=17;break}case 59:{b=17;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{b=16;break e}}default:{b=16;break e}}}while(0);if((b|0)==17){b=0;t[67]=t[70]}e=t[70]|0;a=t[71]|0}if((b|0)==9){e=t[70]|0;t[67]=e;b=19}else if((b|0)==16){i[796]=0;t[70]=e;b=19}else if((b|0)==18)if(!(i[794]|0)){e=r;b=19}else e=0;do{if((b|0)==19){e:while(1){a=e+2|0;t[70]=a;if(e>>>0>=(t[71]|0)>>>0){b=82;break}a:do{switch(s[a>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((s[396]|0)==0?H(a)|0:0)?(m(e+4|0,16,10)|0)==0:0){l();b=81}else b=81;break}case 105:{if(H(a)|0?(m(e+4|0,26,10)|0)==0:0){k();b=81}else b=81;break}case 99:{if((H(a)|0?(m(e+4|0,36,8)|0)==0:0)?V(s[e+12>>1]|0)|0:0){i[798]=1;b=81}else b=81;break}case 40:{f=t[68]|0;a=s[396]|0;b=a&65535;t[f+(b<<3)>>2]=1;r=t[67]|0;s[396]=a+1<<16>>16;t[f+(b<<3)+4>>2]=r;b=81;break}case 41:{a=s[396]|0;if(!(a<<16>>16)){b=36;break e}b=a+-1<<16>>16;s[396]=b;f=s[395]|0;a=f&65535;if(f<<16>>16!=0?(t[(t[68]|0)+((b&65535)<<3)>>2]|0)==5:0){a=t[(t[69]|0)+(a+-1<<2)>>2]|0;r=a+4|0;if(!(t[r>>2]|0))t[r>>2]=(t[67]|0)+2;t[a+12>>2]=e+4;s[395]=f+-1<<16>>16;b=81}else b=81;break}case 123:{b=t[67]|0;f=t[61]|0;e=b;do{if((s[b>>1]|0)==41&(f|0)!=0?(t[f+4>>2]|0)==(b|0):0){a=t[62]|0;t[61]=a;if(!a){t[57]=0;break}else{t[a+28>>2]=0;break}}}while(0);f=t[68]|0;r=s[396]|0;b=r&65535;t[f+(b<<3)>>2]=(i[798]|0)==0?2:6;s[396]=r+1<<16>>16;t[f+(b<<3)+4>>2]=e;i[798]=0;b=81;break}case 125:{e=s[396]|0;if(!(e<<16>>16)){b=49;break e}f=t[68]|0;b=e+-1<<16>>16;s[396]=b;if((t[f+((b&65535)<<3)>>2]|0)==4){h();b=81}else b=81;break}case 39:{d(39);b=81;break}case 34:{d(34);b=81;break}case 47:switch(s[e+4>>1]|0){case 47:{P();break a}case 42:{y(1);break a}default:{e=t[67]|0;f=s[e>>1]|0;r:do{if(!(U(f)|0)){switch(f<<16>>16){case 41:if(D(t[(t[68]|0)+(c[396]<<3)+4>>2]|0)|0){b=69;break r}else{b=66;break r}case 125:break;default:{b=66;break r}}a=t[68]|0;r=c[396]|0;if(!(p(t[a+(r<<3)+4>>2]|0)|0)?(t[a+(r<<3)>>2]|0)!=6:0)b=66;else b=69}else switch(f<<16>>16){case 46:if(((s[e+-2>>1]|0)+-48&65535)<10){b=66;break r}else{b=69;break r}case 43:if((s[e+-2>>1]|0)==43){b=66;break r}else{b=69;break r}case 45:if((s[e+-2>>1]|0)==45){b=66;break r}else{b=69;break r}default:{b=69;break r}}}while(0);r:do{if((b|0)==66){b=0;if(!(o(e)|0)){switch(f<<16>>16){case 0:{b=69;break r}case 47:{if(i[797]|0){b=69;break r}break}default:{}}r=t[3]|0;a=f;do{if(e>>>0<=r>>>0)break;e=e+-2|0;t[67]=e;a=s[e>>1]|0}while(!(E(a)|0));if(F(a)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;t[67]=e}while(F(s[e>>1]|0)|0);if(j(e)|0){g();i[797]=0;b=81;break a}else e=1}else e=1}else b=69}}while(0);if((b|0)==69){g();e=0}i[797]=e;b=81;break a}}case 96:{f=t[68]|0;r=s[396]|0;b=r&65535;t[f+(b<<3)+4>>2]=t[67];s[396]=r+1<<16>>16;t[f+(b<<3)>>2]=3;h();b=81;break}default:b=81}}while(0);if((b|0)==81){b=0;t[67]=t[70]}e=t[70]|0}if((b|0)==36){T();e=0;break}else if((b|0)==49){T();e=0;break}else if((b|0)==82){e=(i[794]|0)==0?(s[395]|s[396])<<16>>16==0:0;break}}}while(0);n=u;return e|0}function l(){var e=0,a=0,r=0,f=0,c=0,n=0,b=0,l=0,k=0,o=0,h=0,v=0,C=0,g=0;l=t[70]|0;k=t[63]|0;g=l+12|0;t[70]=g;r=w(1)|0;e=t[70]|0;if(!((e|0)==(g|0)?!(I(r)|0):0))C=3;e:do{if((C|0)==3){a:do{switch(r<<16>>16){case 123:{t[70]=e+2;e=w(1)|0;a=t[70]|0;while(1){if(W(e)|0){d(e);e=(t[70]|0)+2|0;t[70]=e}else{q(e)|0;e=t[70]|0}w(1)|0;e=A(a,e)|0;if(e<<16>>16==44){t[70]=(t[70]|0)+2;e=w(1)|0}if(e<<16>>16==125){C=15;break}g=a;a=t[70]|0;if((a|0)==(g|0)){C=12;break}if(a>>>0>(t[71]|0)>>>0){C=14;break}}if((C|0)==12){T();break e}else if((C|0)==14){T();break e}else if((C|0)==15){i[795]=1;t[70]=(t[70]|0)+2;break a}break}case 42:{t[70]=e+2;w(1)|0;g=t[70]|0;A(g,g)|0;break}default:{i[796]=0;switch(r<<16>>16){case 100:{l=e+14|0;t[70]=l;switch((w(1)|0)<<16>>16){case 97:{a=t[70]|0;if((m(a+2|0,56,8)|0)==0?(c=a+10|0,F(s[c>>1]|0)|0):0){t[70]=c;w(0)|0;C=22}break}case 102:{C=22;break}case 99:{a=t[70]|0;if(((m(a+2|0,36,8)|0)==0?(f=a+10|0,g=s[f>>1]|0,V(g)|0|g<<16>>16==123):0)?(t[70]=f,n=w(1)|0,n<<16>>16!=123):0){v=n;C=31}break}default:{}}r:do{if((C|0)==22?(b=t[70]|0,(m(b+2|0,64,14)|0)==0):0){r=b+16|0;a=s[r>>1]|0;if(!(V(a)|0))switch(a<<16>>16){case 40:case 42:break;default:break r}t[70]=r;a=w(1)|0;if(a<<16>>16==42){t[70]=(t[70]|0)+2;a=w(1)|0}if(a<<16>>16!=40){v=a;C=31}}}while(0);if((C|0)==31?(o=t[70]|0,q(v)|0,h=t[70]|0,h>>>0>o>>>0):0){O(e,l,o,h);t[70]=(t[70]|0)+-2;break e}O(e,l,0,0);t[70]=e+12;break e}case 97:{t[70]=e+10;w(0)|0;e=t[70]|0;C=35;break}case 102:{C=35;break}case 99:{if((m(e+2|0,36,8)|0)==0?(a=e+10|0,E(s[a>>1]|0)|0):0){t[70]=a;g=w(1)|0;C=t[70]|0;q(g)|0;g=t[70]|0;O(C,g,C,g);t[70]=(t[70]|0)+-2;break e}e=e+4|0;t[70]=e;break}case 108:case 118:break;default:break e}if((C|0)==35){t[70]=e+16;e=w(1)|0;if(e<<16>>16==42){t[70]=(t[70]|0)+2;e=w(1)|0}C=t[70]|0;q(e)|0;g=t[70]|0;O(C,g,C,g);t[70]=(t[70]|0)+-2;break e}t[70]=e+6;i[796]=0;r=w(1)|0;e=t[70]|0;r=(q(r)|0|32)<<16>>16==123;f=t[70]|0;if(r){t[70]=f+2;g=w(1)|0;e=t[70]|0;q(g)|0}r:while(1){a=t[70]|0;if((a|0)==(e|0))break;O(e,a,e,a);a=w(1)|0;if(r)switch(a<<16>>16){case 93:case 125:break e;default:{}}e=t[70]|0;if(a<<16>>16!=44){C=51;break}t[70]=e+2;a=w(1)|0;e=t[70]|0;switch(a<<16>>16){case 91:case 123:{C=51;break r}default:{}}q(a)|0}if((C|0)==51)t[70]=e+-2;if(!r)break e;t[70]=f+-2;break e}}}while(0);g=(w(1)|0)<<16>>16==102;e=t[70]|0;if(g?(m(e+2|0,50,6)|0)==0:0){t[70]=e+8;u(l,w(1)|0);e=(k|0)==0?232:k+16|0;while(1){e=t[e>>2]|0;if(!e)break e;t[e+12>>2]=0;t[e+8>>2]=0;e=e+16|0}}t[70]=e+-2}}while(0);return}function k(){var e=0,a=0,r=0,f=0,c=0,n=0;c=t[70]|0;e=c+12|0;t[70]=e;e:do{switch((w(1)|0)<<16>>16){case 40:{a=t[68]|0;n=s[396]|0;r=n&65535;t[a+(r<<3)>>2]=5;e=t[70]|0;s[396]=n+1<<16>>16;t[a+(r<<3)+4>>2]=e;if((s[t[67]>>1]|0)!=46){t[70]=e+2;n=w(1)|0;v(c,t[70]|0,0,e);a=t[61]|0;r=t[69]|0;c=s[395]|0;s[395]=c+1<<16>>16;t[r+((c&65535)<<2)>>2]=a;switch(n<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{t[70]=(t[70]|0)+-2;break e}}e=(t[70]|0)+2|0;t[70]=e;switch((w(1)|0)<<16>>16){case 44:{t[70]=(t[70]|0)+2;w(1)|0;c=t[61]|0;t[c+4>>2]=e;n=t[70]|0;t[c+16>>2]=n;i[c+24>>0]=1;t[70]=n+-2;break e}case 41:{s[396]=(s[396]|0)+-1<<16>>16;n=t[61]|0;t[n+4>>2]=e;t[n+12>>2]=(t[70]|0)+2;i[n+24>>0]=1;s[395]=(s[395]|0)+-1<<16>>16;break e}default:{t[70]=(t[70]|0)+-2;break e}}}break}case 46:{t[70]=(t[70]|0)+2;if((w(1)|0)<<16>>16==109?(a=t[70]|0,(m(a+2|0,44,6)|0)==0):0){e=t[67]|0;if(!(G(e)|0)?(s[e>>1]|0)==46:0)break e;v(c,c,a+8|0,2)}break}case 42:case 39:case 34:{f=18;break}case 123:{e=t[70]|0;if(s[396]|0){t[70]=e+-2;break e}while(1){if(e>>>0>=(t[71]|0)>>>0)break;e=w(1)|0;if(!(W(e)|0)){if(e<<16>>16==125){f=33;break}}else d(e);e=(t[70]|0)+2|0;t[70]=e}if((f|0)==33)t[70]=(t[70]|0)+2;n=(w(1)|0)<<16>>16==102;e=t[70]|0;if(n?m(e+2|0,50,6)|0:0){T();break e}t[70]=e+8;e=w(1)|0;if(W(e)|0){u(c,e);break e}else{T();break e}}default:if((t[70]|0)==(e|0))t[70]=c+10;else f=18}}while(0);do{if((f|0)==18){if(s[396]|0){t[70]=(t[70]|0)+-2;break}e=t[71]|0;a=t[70]|0;while(1){if(a>>>0>=e>>>0){f=25;break}r=s[a>>1]|0;if(W(r)|0){f=23;break}n=a+2|0;t[70]=n;a=n}if((f|0)==23){u(c,r);break}else if((f|0)==25){T();break}}}while(0);return}function u(e,a){e=e|0;a=a|0;var r=0,i=0;r=(t[70]|0)+2|0;switch(a<<16>>16){case 39:{d(39);i=5;break}case 34:{d(34);i=5;break}default:T()}do{if((i|0)==5){v(e,r,t[70]|0,1);t[70]=(t[70]|0)+2;a=w(0)|0;e=a<<16>>16==97;if(e){r=t[70]|0;if(m(r+2|0,78,10)|0)i=11}else{r=t[70]|0;if(!(((a<<16>>16==119?(s[r+2>>1]|0)==105:0)?(s[r+4>>1]|0)==116:0)?(s[r+6>>1]|0)==104:0))i=11}if((i|0)==11){t[70]=r+-2;break}t[70]=r+((e?6:4)<<1);if((w(1)|0)<<16>>16!=123){t[70]=r;break}e=t[70]|0;a=e;e:while(1){t[70]=a+2;a=w(1)|0;switch(a<<16>>16){case 39:{d(39);t[70]=(t[70]|0)+2;a=w(1)|0;break}case 34:{d(34);t[70]=(t[70]|0)+2;a=w(1)|0;break}default:a=q(a)|0}if(a<<16>>16!=58){i=20;break}t[70]=(t[70]|0)+2;switch((w(1)|0)<<16>>16){case 39:{d(39);break}case 34:{d(34);break}default:{i=24;break e}}t[70]=(t[70]|0)+2;switch((w(1)|0)<<16>>16){case 125:{i=29;break e}case 44:break;default:{i=28;break e}}t[70]=(t[70]|0)+2;if((w(1)|0)<<16>>16==125){i=29;break}a=t[70]|0}if((i|0)==20){t[70]=r;break}else if((i|0)==24){t[70]=r;break}else if((i|0)==28){t[70]=r;break}else if((i|0)==29){i=t[61]|0;t[i+16>>2]=e;t[i+12>>2]=(t[70]|0)+2;break}}}while(0);return}function o(e){e=e|0;e:do{switch(s[e>>1]|0){case 100:switch(s[e+-2>>1]|0){case 105:{e=$(e+-4|0,88,2)|0;break e}case 108:{e=$(e+-4|0,92,3)|0;break e}default:{e=0;break e}}case 101:switch(s[e+-2>>1]|0){case 115:switch(s[e+-4>>1]|0){case 108:{e=B(e+-6|0,101)|0;break e}case 97:{e=B(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=$(e+-4|0,98,4)|0;break e}case 117:{e=$(e+-4|0,106,6)|0;break e}default:{e=0;break e}}case 102:{if((s[e+-2>>1]|0)==111?(s[e+-4>>1]|0)==101:0)switch(s[e+-6>>1]|0){case 99:{e=$(e+-8|0,118,6)|0;break e}case 112:{e=$(e+-8|0,130,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=$(e+-2|0,134,4)|0;break}case 110:{e=e+-2|0;if(B(e,105)|0)e=1;else e=$(e,142,5)|0;break}case 111:{e=B(e+-2|0,100)|0;break}case 114:{e=$(e+-2|0,152,7)|0;break}case 116:{e=$(e+-2|0,166,4)|0;break}case 119:switch(s[e+-2>>1]|0){case 101:{e=B(e+-4|0,110)|0;break e}case 111:{e=$(e+-4|0,174,3)|0;break e}default:{e=0;break e}}default:e=0}}while(0);return e|0}function h(){var e=0,a=0,r=0,i=0;a=t[71]|0;r=t[70]|0;e:while(1){e=r+2|0;if(r>>>0>=a>>>0){a=10;break}switch(s[e>>1]|0){case 96:{a=7;break e}case 36:{if((s[r+4>>1]|0)==123){a=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e}if((a|0)==6){e=r+4|0;t[70]=e;a=t[68]|0;i=s[396]|0;r=i&65535;t[a+(r<<3)>>2]=4;s[396]=i+1<<16>>16;t[a+(r<<3)+4>>2]=e}else if((a|0)==7){t[70]=e;r=t[68]|0;i=(s[396]|0)+-1<<16>>16;s[396]=i;if((t[r+((i&65535)<<3)>>2]|0)!=3)T()}else if((a|0)==10){t[70]=e;T()}return}function w(e){e=e|0;var a=0,r=0,i=0;r=t[70]|0;e:do{a=s[r>>1]|0;a:do{if(a<<16>>16!=47)if(e)if(V(a)|0)break;else break e;else if(F(a)|0)break;else break e;else switch(s[r+2>>1]|0){case 47:{P();break a}case 42:{y(e);break a}default:{a=47;break e}}}while(0);i=t[70]|0;r=i+2|0;t[70]=r}while(i>>>0<(t[71]|0)>>>0);return a|0}function d(e){e=e|0;var a=0,r=0,i=0,f=0;f=t[71]|0;a=t[70]|0;while(1){i=a+2|0;if(a>>>0>=f>>>0){a=9;break}r=s[i>>1]|0;if(r<<16>>16==e<<16>>16){a=10;break}if(r<<16>>16==92){r=a+4|0;if((s[r>>1]|0)==13){a=a+6|0;a=(s[a>>1]|0)==10?a:r}else a=r}else if(Z(r)|0){a=9;break}else a=i}if((a|0)==9){t[70]=i;T()}else if((a|0)==10)t[70]=i;return}function v(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var f=0,c=0;f=t[65]|0;t[65]=f+32;c=t[61]|0;t[((c|0)==0?228:c+28|0)>>2]=f;t[62]=c;t[61]=f;t[f+8>>2]=e;if(2==(s|0))e=r;else e=1==(s|0)?r+2|0:0;t[f+12>>2]=e;t[f>>2]=a;t[f+4>>2]=r;t[f+16>>2]=0;t[f+20>>2]=s;c=1==(s|0);i[f+24>>0]=c&1;t[f+28>>2]=0;if(c|2==(s|0))i[795]=1;return}function A(e,a){e=e|0;a=a|0;var r=0,i=0,f=0,c=0;r=t[70]|0;i=s[r>>1]|0;c=(e|0)==(a|0);f=c?0:e;c=c?0:a;if(i<<16>>16==97){t[70]=r+4;r=w(1)|0;e=t[70]|0;if(W(r)|0){d(r);a=(t[70]|0)+2|0;t[70]=a}else{q(r)|0;a=t[70]|0}i=w(1)|0;r=t[70]|0}if((r|0)!=(e|0))O(e,a,f,c);return i|0}function C(){var e=0,a=0,r=0;r=t[71]|0;a=t[70]|0;e:while(1){e=a+2|0;if(a>>>0>=r>>>0){a=6;break}switch(s[e>>1]|0){case 13:case 10:{a=6;break e}case 93:{a=7;break e}case 92:{e=a+4|0;break}default:{}}a=e}if((a|0)==6){t[70]=e;T();e=0}else if((a|0)==7){t[70]=e;e=93}return e|0}function g(){var e=0,a=0,r=0;e:while(1){e=t[70]|0;a=e+2|0;t[70]=a;if(e>>>0>=(t[71]|0)>>>0){r=7;break}switch(s[a>>1]|0){case 13:case 10:{r=7;break e}case 47:break e;case 91:{C()|0;break}case 92:{t[70]=e+4;break}default:{}}}if((r|0)==7)T();return}function p(e){e=e|0;switch(s[e>>1]|0){case 62:{e=(s[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=$(e+-2|0,200,4)|0;break}case 121:{e=$(e+-2|0,208,6)|0;break}case 101:{e=$(e+-2|0,220,3)|0;break}default:e=0}return e|0}function y(e){e=e|0;var a=0,r=0,i=0,f=0,c=0;f=(t[70]|0)+2|0;t[70]=f;r=t[71]|0;while(1){a=f+2|0;if(f>>>0>=r>>>0)break;i=s[a>>1]|0;if(!e?Z(i)|0:0)break;if(i<<16>>16==42?(s[f+4>>1]|0)==47:0){c=8;break}f=a}if((c|0)==8){t[70]=a;a=f+4|0}t[70]=a;return}function m(e,a,r){e=e|0;a=a|0;r=r|0;var s=0,t=0;e:do{if(!r)e=0;else{while(1){s=i[e>>0]|0;t=i[a>>0]|0;if(s<<24>>24!=t<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else{e=e+1|0;a=a+1|0}}e=(s&255)-(t&255)|0}}while(0);return e|0}function I(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else{switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4}}}while(0);return e|0}function U(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function x(e){e=e|0;var a=0;a=s[e>>1]|0;e:do{if((a+-9&65535)>=5){switch(a<<16>>16){case 160:case 32:{a=1;break e}default:{}}if(I(a)|0)return a<<16>>16!=46|(G(e)|0)|0;else a=0}else a=1}while(0);return a|0}function S(e){e=e|0;var a=0,r=0,i=0,f=0;r=n;n=n+16|0;i=r;t[i>>2]=0;t[64]=e;a=t[3]|0;f=a+(e<<1)|0;e=f+2|0;s[f>>1]=0;t[i>>2]=e;t[65]=e;t[57]=0;t[61]=0;t[59]=0;t[58]=0;t[63]=0;t[60]=0;n=r;return a|0}function O(e,a,r,s){e=e|0;a=a|0;r=r|0;s=s|0;var f=0,c=0;f=t[65]|0;t[65]=f+20;c=t[63]|0;t[((c|0)==0?232:c+16|0)>>2]=f;t[63]=f;t[f>>2]=e;t[f+4>>2]=a;t[f+8>>2]=r;t[f+12>>2]=s;t[f+16>>2]=0;i[795]=1;return}function $(e,a,r){e=e|0;a=a|0;r=r|0;var i=0,s=0;i=e+(0-r<<1)|0;s=i+2|0;e=t[3]|0;if(s>>>0>=e>>>0?(m(s,a,r<<1)|0)==0:0)if((s|0)==(e|0))e=1;else e=x(i)|0;else e=0;return e|0}function j(e){e=e|0;switch(s[e>>1]|0){case 107:{e=$(e+-2|0,134,4)|0;break}case 101:{if((s[e+-2>>1]|0)==117)e=$(e+-4|0,106,6)|0;else e=0;break}default:e=0}return e|0}function B(e,a){e=e|0;a=a|0;var r=0;r=t[3]|0;if(r>>>0<=e>>>0?(s[e>>1]|0)==a<<16>>16:0)if((r|0)==(e|0))r=1;else r=E(s[e+-2>>1]|0)|0;else r=0;return r|0}function E(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else{switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(I(e)|0)}}while(0);return e|0}function P(){var e=0,a=0,r=0;e=t[71]|0;r=t[70]|0;e:while(1){a=r+2|0;if(r>>>0>=e>>>0)break;switch(s[a>>1]|0){case 13:case 10:break e;default:r=a}}t[70]=a;return}function q(e){e=e|0;while(1){if(V(e)|0)break;if(I(e)|0)break;e=(t[70]|0)+2|0;t[70]=e;e=s[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function z(){var e=0;e=t[(t[59]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(t[3]|0)>>1}return e|0}function D(e){e=e|0;if(!($(e,180,5)|0)?!($(e,190,3)|0):0)e=$(e,196,2)|0;else e=1;return e|0}function F(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0}return e|0}function G(e){e=e|0;if((s[e>>1]|0)==46?(s[e+-2>>1]|0)==46:0)e=(s[e+-4>>1]|0)==46;else e=0;return e|0}function H(e){e=e|0;if((t[3]|0)==(e|0))e=1;else e=x(e+-2|0)|0;return e|0}function J(){var e=0;e=t[(t[60]|0)+12>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function K(){var e=0;e=t[(t[59]|0)+12>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function L(){var e=0;e=t[(t[60]|0)+8>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function M(){var e=0;e=t[(t[59]|0)+16>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function N(){var e=0;e=t[(t[59]|0)+4>>2]|0;if(!e)e=-1;else e=e-(t[3]|0)>>1;return e|0}function Q(){var e=0;e=t[59]|0;e=t[((e|0)==0?228:e+28|0)>>2]|0;t[59]=e;return(e|0)!=0|0}function R(){var e=0;e=t[60]|0;e=t[((e|0)==0?232:e+16|0)>>2]|0;t[60]=e;return(e|0)!=0|0}function T(){i[794]=1;t[66]=(t[70]|0)-(t[3]|0)>>1;t[70]=(t[71]|0)+2;return}function V(e){e=e|0;return(e|128)<<16>>16==160|(e+-9&65535)<5|0}function W(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function X(){return(t[(t[59]|0)+8>>2]|0)-(t[3]|0)>>1|0}function Y(){return(t[(t[60]|0)+4>>2]|0)-(t[3]|0)>>1|0}function Z(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function _(){return(t[t[59]>>2]|0)-(t[3]|0)>>1|0}function ee(){return(t[t[60]>>2]|0)-(t[3]|0)>>1|0}function ae(){return f[(t[59]|0)+24>>0]|0|0}function re(e){e=e|0;t[3]=e;return}function ie(){return(i[795]|0)!=0|0}function se(){return(i[796]|0)!=0|0}function te(){return t[66]|0}function fe(e){e=e|0;n=e+992+15&-16;return 992}return{su:fe,ai:M,e:te,ee:Y,ele:J,els:L,es:ee,f:se,id:z,ie:N,ip:ae,is:_,ms:ie,p:b,re:R,ri:Q,sa:S,se:K,ses:re,ss:X}}("undefined"!=typeof self?self:global,{},a),r=e.su(i-(2<<17))}const h=f.length+1;e.ses(r),e.sa(h-1),s(f,new Uint16Array(a,r,h)),e.p()||(n=e.e(),o());const w=[],d=[];for(;e.ri();){const a=e.is(),r=e.ie(),i=e.ai(),s=e.id(),t=e.ss(),c=e.se();let n;e.ip()&&(n=b(-1===s?a:a+1,f.charCodeAt(-1===s?a-1:a))),w.push({n:n,s:a,e:r,ss:t,se:c,d:s,a:i})}for(;e.re();){const a=e.es(),r=e.ee(),i=e.els(),s=e.ele(),t=f.charCodeAt(a),c=i>=0?f.charCodeAt(i):-1;d.push({s:a,e:r,ls:i,le:s,n:34===t||39===t?b(a+1,t):f.slice(a,r),ln:i<0?void 0:34===c||39===c?b(i+1,c):f.slice(i,s)})}return[w,d,!!e.f(),!!e.ms()]}function b(e,a){n=e;let r="",i=n;for(;;){n>=f.length&&o();const e=f.charCodeAt(n);if(e===a)break;92===e?(r+=f.slice(i,n),r+=l(),i=n):(8232===e||8233===e||u(e)&&o(),++n)}return r+=f.slice(i,n++),r}function l(){let e=f.charCodeAt(++n);switch(++n,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(k(2));case 117:return function(){const e=f.charCodeAt(n);let a;123===e?(++n,a=k(f.indexOf("}",n)-n),++n,a>1114111&&o()):a=k(4);return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode(55296+(a>>10),56320+(1023&a)))}();case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===f.charCodeAt(n)&&++n;case 10:return"";case 56:case 57:o();default:if(e>=48&&e<=55){let a=f.substr(n-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),n+=a.length-1,e=f.charCodeAt(n),"0"===a&&56!==e&&57!==e||o(),String.fromCharCode(r)}return u(e)?"":String.fromCharCode(e)}}function k(e){const a=n;let r=0,i=0;for(let a=0;a=97)e=s-97+10;else if(s>=65)e=s-65+10;else{if(!(s>=48&&s<=57))break;e=s-48}if(e>=16)break;i=s,r=16*r+e}else 95!==i&&0!==a||o(),i=s}return 95!==i&&n-a===e||o(),r}function u(e){return 13===e||10===e}function o(){throw Object.assign(Error(`Parse error ${c}:${f.slice(0,n).split("\n").length}:${n-f.lastIndexOf("\n",n-1)}`),{idx:n})} \ No newline at end of file diff --git a/node_modules/es-module-lexer/dist/lexer.cjs b/node_modules/es-module-lexer/dist/lexer.cjs deleted file mode 100644 index a4d81f3..0000000 --- a/node_modules/es-module-lexer/dist/lexer.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";exports.init=void 0,exports.parse=parse;const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse(E,g="@"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,k=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;k>0&&C.memory.grow(Math.ceil(k/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),k=C.se();let K;C.ip()&&(K=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),o.push({n:K,s:A,e:Q,ss:I,se:k,d:g,a:B})}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),k=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===k||"'"===k?w(I):I,ln:'"'===o||"'"===o?w(K):K})}function w(A){try{return(0,eval)(A)}catch(A){}}return[o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const C=A.length;let B=0;for(;B>>8}}function B(A,Q){const C=A.length;let B=0;for(;BA.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A}));var E;exports.init=init; \ No newline at end of file diff --git a/node_modules/es-module-lexer/dist/lexer.js b/node_modules/es-module-lexer/dist/lexer.js deleted file mode 100644 index cf08435..0000000 --- a/node_modules/es-module-lexer/dist/lexer.js +++ /dev/null @@ -1,2 +0,0 @@ -/* es-module-lexer 1.4.1 */ -const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];export function parse(E,g="@"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,k=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;k>0&&C.memory.grow(Math.ceil(k/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),k=C.se();let K;C.ip()&&(K=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),o.push({n:K,s:A,e:Q,ss:I,se:k,d:g,a:B})}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),k=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===k||"'"===k?w(I):I,ln:'"'===o||"'"===o?w(K):K})}function w(A){try{return(0,eval)(A)}catch(A){}}return[o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C>>8}}function B(A,Q){const B=A.length;let C=0;for(;CA.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A}));var E; \ No newline at end of file diff --git a/node_modules/es-module-lexer/lexer.js b/node_modules/es-module-lexer/lexer.js deleted file mode 100644 index a8b0592..0000000 --- a/node_modules/es-module-lexer/lexer.js +++ /dev/null @@ -1,919 +0,0 @@ -let source, pos, end, - openTokenDepth, - lastTokenPos, - openTokenPosStack, - openClassPosStack, - curDynamicImport, - templateStackDepth, - facade, - lastSlashWasDivision, - nextBraceIsClass, - templateDepth, - templateStack, - imports, - exports, - name; - -function addImport (ss, s, e, d) { - const impt = { ss, se: d === -2 ? e : d === -1 ? e + 1 : 0, s, e, d, a: -1, n: undefined }; - imports.push(impt); - return impt; -} - -function addExport (s, e, ls, le) { - exports.push({ - s, - e, - ls, - le, - n: s[0] === '"' ? readString(s, '"') : s[0] === "'" ? readString(s, "'") : source.slice(s, e), - ln: ls[0] === '"' ? readString(ls, '"') : ls[0] === "'" ? readString(ls, "'") : source.slice(ls, le) - }); -} - -function readName (impt) { - let { d, s } = impt; - if (d !== -1) - s++; - impt.n = readString(s, source.charCodeAt(s - 1)); -} - -// Note: parsing is based on the _assumption_ that the source is already valid -export function parse (_source, _name) { - openTokenDepth = 0; - curDynamicImport = null; - templateDepth = -1; - lastTokenPos = -1; - lastSlashWasDivision = false; - templateStack = Array(1024); - templateStackDepth = 0; - openTokenPosStack = Array(1024); - openClassPosStack = Array(1024); - nextBraceIsClass = false; - facade = true; - name = _name || '@'; - - imports = []; - exports = []; - - source = _source; - pos = -1; - end = source.length - 1; - let ch = 0; - - // start with a pure "module-only" parser - m: while (pos++ < end) { - ch = source.charCodeAt(pos); - - if (ch === 32 || ch < 14 && ch > 8) - continue; - - switch (ch) { - case 101/*e*/: - if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1)) { - tryParseExportStatement(); - // export might have been a non-pure declaration - if (!facade) { - lastTokenPos = pos; - break m; - } - } - break; - case 105/*i*/: - if (keywordStart(pos) && source.startsWith('mport', pos + 1)) - tryParseImportStatement(); - break; - case 59/*;*/: - break; - case 47/*/*/: { - const next_ch = source.charCodeAt(pos + 1); - if (next_ch === 47/*/*/) { - lineComment(); - // dont update lastToken - continue; - } - else if (next_ch === 42/***/) { - blockComment(true); - // dont update lastToken - continue; - } - // fallthrough - } - default: - // as soon as we hit a non-module token, we go to main parser - facade = false; - pos--; - break m; - } - lastTokenPos = pos; - } - - while (pos++ < end) { - ch = source.charCodeAt(pos); - - if (ch === 32 || ch < 14 && ch > 8) - continue; - - switch (ch) { - case 101/*e*/: - if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1)) - tryParseExportStatement(); - break; - case 105/*i*/: - if (keywordStart(pos) && source.startsWith('mport', pos + 1)) - tryParseImportStatement(); - break; - case 99/*c*/: - if (keywordStart(pos) && source.startsWith('lass', pos + 1) && isBrOrWs(source.charCodeAt(pos + 5))) - nextBraceIsClass = true; - break; - case 40/*(*/: - openTokenPosStack[openTokenDepth++] = lastTokenPos; - break; - case 41/*)*/: - if (openTokenDepth === 0) - syntaxError(); - openTokenDepth--; - if (curDynamicImport && curDynamicImport.d === openTokenPosStack[openTokenDepth]) { - if (curDynamicImport.e === 0) - curDynamicImport.e = pos; - curDynamicImport.se = pos; - curDynamicImport = null; - } - break; - case 123/*{*/: - // dynamic import followed by { is not a dynamic import (so remove) - // this is a sneaky way to get around { import () {} } v { import () } - // block / object ambiguity without a parser (assuming source is valid) - if (source.charCodeAt(lastTokenPos) === 41/*)*/ && imports.length && imports[imports.length - 1].e === lastTokenPos) { - imports.pop(); - } - openClassPosStack[openTokenDepth] = nextBraceIsClass; - nextBraceIsClass = false; - openTokenPosStack[openTokenDepth++] = lastTokenPos; - break; - case 125/*}*/: - if (openTokenDepth === 0) - syntaxError(); - if (openTokenDepth-- === templateDepth) { - templateDepth = templateStack[--templateStackDepth]; - templateString(); - } - else { - if (templateDepth !== -1 && openTokenDepth < templateDepth) - syntaxError(); - } - break; - case 39/*'*/: - case 34/*"*/: - stringLiteral(ch); - break; - case 47/*/*/: { - const next_ch = source.charCodeAt(pos + 1); - if (next_ch === 47/*/*/) { - lineComment(); - // dont update lastToken - continue; - } - else if (next_ch === 42/***/) { - blockComment(true); - // dont update lastToken - continue; - } - else { - // Division / regex ambiguity handling based on checking backtrack analysis of: - // - what token came previously (lastToken) - // - if a closing brace or paren, what token came before the corresponding - // opening brace or paren (lastOpenTokenIndex) - const lastToken = source.charCodeAt(lastTokenPos); - if (isExpressionPunctuator(lastToken) && - !(lastToken === 46/*.*/ && (source.charCodeAt(lastTokenPos - 1) >= 48/*0*/ && source.charCodeAt(lastTokenPos - 1) <= 57/*9*/)) && - !(lastToken === 43/*+*/ && source.charCodeAt(lastTokenPos - 1) === 43/*+*/) && !(lastToken === 45/*-*/ && source.charCodeAt(lastTokenPos - 1) === 45/*-*/) || - lastToken === 41/*)*/ && isParenKeyword(openTokenPosStack[openTokenDepth]) || - lastToken === 125/*}*/ && (isExpressionTerminator(openTokenPosStack[openTokenDepth]) || openClassPosStack[openTokenDepth]) || - lastToken === 47/*/*/ && lastSlashWasDivision || - isExpressionKeyword(lastTokenPos) || - !lastToken) { - regularExpression(); - lastSlashWasDivision = false; - } - else { - lastSlashWasDivision = true; - } - } - break; - } - case 96/*`*/: - templateString(); - break; - } - lastTokenPos = pos; - } - - if (templateDepth !== -1 || openTokenDepth) - syntaxError(); - - return [imports, exports, facade]; -} - -function tryParseImportStatement () { - const startPos = pos; - - pos += 6; - - let ch = commentWhitespace(true); - - switch (ch) { - // dynamic import - case 40/*(*/: - openTokenPosStack[openTokenDepth++] = startPos; - if (source.charCodeAt(lastTokenPos) === 46/*.*/) - return; - // dynamic import indicated by positive d - const impt = addImport(startPos, pos + 1, 0, startPos); - curDynamicImport = impt; - // try parse a string, to record a safe dynamic import string - pos++; - ch = commentWhitespace(true); - if (ch === 39/*'*/ || ch === 34/*"*/) { - stringLiteral(ch); - } - else { - pos--; - return; - } - pos++; - ch = commentWhitespace(true); - if (ch === 44/*,*/) { - impt.e = pos; - pos++; - ch = commentWhitespace(true); - impt.a = pos; - readName(impt); - pos--; - } - else if (ch === 41/*)*/) { - openTokenDepth--; - impt.e = pos; - impt.se = pos; - readName(impt); - } - else { - pos--; - } - return; - // import.meta - case 46/*.*/: - pos++; - ch = commentWhitespace(true); - // import.meta indicated by d === -2 - if (ch === 109/*m*/ && source.startsWith('eta', pos + 1) && source.charCodeAt(lastTokenPos) !== 46/*.*/) - addImport(startPos, startPos, pos + 4, -2); - return; - - default: - // no space after "import" -> not an import keyword - if (pos === startPos + 6) - break; - case 34/*"*/: - case 39/*'*/: - case 123/*{*/: - case 42/***/: - // import statement only permitted at base-level - if (openTokenDepth !== 0) { - pos--; - return; - } - while (pos < end) { - ch = source.charCodeAt(pos); - if (ch === 39/*'*/ || ch === 34/*"*/) { - readImportString(startPos, ch); - return; - } - pos++; - } - syntaxError(); - } -} - -function tryParseExportStatement () { - const sStartPos = pos; - const prevExport = exports.length; - - pos += 6; - - const curPos = pos; - - let ch = commentWhitespace(true); - - if (pos === curPos && !isPunctuator(ch)) - return; - - switch (ch) { - // export default ... - case 100/*d*/: - addExport(pos, pos + 7, -1, -1); - return; - - // export async? function*? name () { - case 97/*a*/: - pos += 5; - commentWhitespace(true); - // fallthrough - case 102/*f*/: - pos += 8; - ch = commentWhitespace(true); - if (ch === 42/***/) { - pos++; - ch = commentWhitespace(true); - } - const startPos = pos; - ch = readToWsOrPunctuator(ch); - addExport(startPos, pos, startPos, pos); - pos--; - return; - - // export class name ... - case 99/*c*/: - if (source.startsWith('lass', pos + 1) && isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos + 5))) { - pos += 5; - ch = commentWhitespace(true); - const startPos = pos; - ch = readToWsOrPunctuator(ch); - addExport(startPos, pos, startPos, pos); - pos--; - return; - } - pos += 2; - // fallthrough - - // export var/let/const name = ...(, name = ...)+ - case 118/*v*/: - case 109/*l*/: - // destructured initializations not currently supported (skipped for { or [) - // also, lexing names after variable equals is skipped (export var p = function () { ... }, q = 5 skips "q") - pos += 2; - facade = false; - do { - pos++; - ch = commentWhitespace(true); - const startPos = pos; - ch = readToWsOrPunctuator(ch); - // dont yet handle [ { destructurings - if (ch === 123/*{*/ || ch === 91/*[*/) { - pos--; - return; - } - if (pos === startPos) - return; - addExport(startPos, pos, startPos, pos); - ch = commentWhitespace(true); - if (ch === 61/*=*/) { - pos--; - return; - } - } while (ch === 44/*,*/); - pos--; - return; - - - // export {...} - case 123/*{*/: - pos++; - ch = commentWhitespace(true); - while (true) { - const startPos = pos; - readToWsOrPunctuator(ch); - const endPos = pos; - commentWhitespace(true); - ch = readExportAs(startPos, endPos); - // , - if (ch === 44/*,*/) { - pos++; - ch = commentWhitespace(true); - } - if (ch === 125/*}*/) - break; - if (pos === startPos) - return syntaxError(); - if (pos > end) - return syntaxError(); - } - pos++; - ch = commentWhitespace(true); - break; - - // export * - // export * as X - case 42/***/: - pos++; - commentWhitespace(true); - ch = readExportAs(pos, pos); - ch = commentWhitespace(true); - break; - } - - // from ... - if (ch === 102/*f*/ && source.startsWith('rom', pos + 1)) { - pos += 4; - readImportString(sStartPos, commentWhitespace(true)); - - // There were no local names. - for (let i = prevExport; i < exports.length; ++i) { - exports[i].ls = exports[i].le = -1; - exports[i].ln = undefined; - } - } - else { - pos--; - } -} - -/* - * Ported from Acorn - * - * MIT License - - * Copyright (C) 2012-2020 by various contributors (see AUTHORS) - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -let acornPos; -function readString (start, quote) { - acornPos = start; - let out = '', chunkStart = acornPos; - for (;;) { - if (acornPos >= source.length) syntaxError(); - const ch = source.charCodeAt(acornPos); - if (ch === quote) break; - if (ch === 92) { // '\' - out += source.slice(chunkStart, acornPos); - out += readEscapedChar(); - chunkStart = acornPos; - } - else if (ch === 0x2028 || ch === 0x2029) { - ++acornPos; - } - else { - if (isBr(ch)) syntaxError(); - ++acornPos; - } - } - out += source.slice(chunkStart, acornPos++); - return out; -} - -// Used to read escaped characters - -function readEscapedChar () { - let ch = source.charCodeAt(++acornPos); - ++acornPos; - switch (ch) { - case 110: return '\n'; // 'n' -> '\n' - case 114: return '\r'; // 'r' -> '\r' - case 120: return String.fromCharCode(readHexChar(2)); // 'x' - case 117: return readCodePointToString(); // 'u' - case 116: return '\t'; // 't' -> '\t' - case 98: return '\b'; // 'b' -> '\b' - case 118: return '\u000b'; // 'v' -> '\u000b' - case 102: return '\f'; // 'f' -> '\f' - case 13: if (source.charCodeAt(acornPos) === 10) ++acornPos; // '\r\n' - case 10: // ' \n' - return ''; - case 56: - case 57: - syntaxError(); - default: - if (ch >= 48 && ch <= 55) { - let octalStr = source.substr(acornPos - 1, 3).match(/^[0-7]+/)[0]; - let octal = parseInt(octalStr, 8); - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - acornPos += octalStr.length - 1; - ch = source.charCodeAt(acornPos); - if (octalStr !== '0' || ch === 56 || ch === 57) - syntaxError(); - return String.fromCharCode(octal); - } - if (isBr(ch)) { - // Unicode new line characters after \ get removed from output in both - // template literals and strings - return ''; - } - return String.fromCharCode(ch); - } -} - -// Used to read character escape sequences ('\x', '\u', '\U'). - -function readHexChar (len) { - const start = acornPos; - let total = 0, lastCode = 0; - for (let i = 0; i < len; ++i, ++acornPos) { - let code = source.charCodeAt(acornPos), val; - - if (code === 95) { - if (lastCode === 95 || i === 0) syntaxError(); - lastCode = code; - continue; - } - - if (code >= 97) val = code - 97 + 10; // a - else if (code >= 65) val = code - 65 + 10; // A - else if (code >= 48 && code <= 57) val = code - 48; // 0-9 - else break; - if (val >= 16) break; - lastCode = code; - total = total * 16 + val; - } - - if (lastCode === 95 || acornPos - start !== len) syntaxError(); - - return total; -} - -// Read a string value, interpreting backslash-escapes. - -function readCodePointToString () { - const ch = source.charCodeAt(acornPos); - let code; - if (ch === 123) { // '{' - ++acornPos; - code = readHexChar(source.indexOf('}', acornPos) - acornPos); - ++acornPos; - if (code > 0x10FFFF) syntaxError(); - } else { - code = readHexChar(4); - } - // UTF-16 Decoding - if (code <= 0xFFFF) return String.fromCharCode(code); - code -= 0x10000; - return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00); -} - -/* - * - */ - -function readExportAs (startPos, endPos) { - let ch = source.charCodeAt(pos); - let ls = startPos, le = endPos; - if (ch === 97 /*a*/) { - pos += 2; - ch = commentWhitespace(true); - startPos = pos; - readToWsOrPunctuator(ch); - endPos = pos; - ch = commentWhitespace(true); - } - if (pos !== startPos) - addExport(startPos, endPos, ls, le); - return ch; -} - -function readImportString (ss, ch) { - const startPos = pos + 1; - if (ch === 39/*'*/ || ch === 34/*"*/) { - stringLiteral(ch); - } - else { - syntaxError(); - return; - } - const impt = addImport(ss, startPos, pos, -1); - readName(impt); - pos++; - ch = commentWhitespace(false); - if (ch !== 97/*a*/ || !source.startsWith('ssert', pos + 1)) { - pos--; - return; - } - const assertIndex = pos; - - pos += 6; - ch = commentWhitespace(true); - if (ch !== 123/*{*/) { - pos = assertIndex; - return; - } - const assertStart = pos; - do { - pos++; - ch = commentWhitespace(true); - if (ch === 39/*'*/ || ch === 34/*"*/) { - stringLiteral(ch); - pos++; - ch = commentWhitespace(true); - } - else { - ch = readToWsOrPunctuator(ch); - } - if (ch !== 58/*:*/) { - pos = assertIndex; - return; - } - pos++; - ch = commentWhitespace(true); - if (ch === 39/*'*/ || ch === 34/*"*/) { - stringLiteral(ch); - } - else { - pos = assertIndex; - return; - } - pos++; - ch = commentWhitespace(true); - if (ch === 44/*,*/) { - pos++; - ch = commentWhitespace(true); - if (ch === 125/*}*/) - break; - continue; - } - if (ch === 125/*}*/) - break; - pos = assertIndex; - return; - } while (true); - impt.a = assertStart; - impt.se = pos + 1; -} - -function commentWhitespace (br) { - let ch; - do { - ch = source.charCodeAt(pos); - if (ch === 47/*/*/) { - const next_ch = source.charCodeAt(pos + 1); - if (next_ch === 47/*/*/) - lineComment(); - else if (next_ch === 42/***/) - blockComment(br); - else - return ch; - } - else if (br ? !isBrOrWs(ch): !isWsNotBr(ch)) { - return ch; - } - } while (pos++ < end); - return ch; -} - -function templateString () { - while (pos++ < end) { - const ch = source.charCodeAt(pos); - if (ch === 36/*$*/ && source.charCodeAt(pos + 1) === 123/*{*/) { - pos++; - templateStack[templateStackDepth++] = templateDepth; - templateDepth = ++openTokenDepth; - return; - } - if (ch === 96/*`*/) - return; - if (ch === 92/*\*/) - pos++; - } - syntaxError(); -} - -function blockComment (br) { - pos++; - while (pos++ < end) { - const ch = source.charCodeAt(pos); - if (!br && isBr(ch)) - return; - if (ch === 42/***/ && source.charCodeAt(pos + 1) === 47/*/*/) { - pos++; - return; - } - } -} - -function lineComment () { - while (pos++ < end) { - const ch = source.charCodeAt(pos); - if (ch === 10/*\n*/ || ch === 13/*\r*/) - return; - } -} - -function stringLiteral (quote) { - while (pos++ < end) { - let ch = source.charCodeAt(pos); - if (ch === quote) - return; - if (ch === 92/*\*/) { - ch = source.charCodeAt(++pos); - if (ch === 13/*\r*/ && source.charCodeAt(pos + 1) === 10/*\n*/) - pos++; - } - else if (isBr(ch)) - break; - } - syntaxError(); -} - -function regexCharacterClass () { - while (pos++ < end) { - let ch = source.charCodeAt(pos); - if (ch === 93/*]*/) - return ch; - if (ch === 92/*\*/) - pos++; - else if (ch === 10/*\n*/ || ch === 13/*\r*/) - break; - } - syntaxError(); -} - -function regularExpression () { - while (pos++ < end) { - let ch = source.charCodeAt(pos); - if (ch === 47/*/*/) - return; - if (ch === 91/*[*/) - ch = regexCharacterClass(); - else if (ch === 92/*\*/) - pos++; - else if (ch === 10/*\n*/ || ch === 13/*\r*/) - break; - } - syntaxError(); -} - -function readToWsOrPunctuator (ch) { - do { - if (isBrOrWs(ch) || isPunctuator(ch)) - return ch; - } while (ch = source.charCodeAt(++pos)); - return ch; -} - -// Note: non-asii BR and whitespace checks omitted for perf / footprint -// if there is a significant user need this can be reconsidered -function isBr (c) { - return c === 13/*\r*/ || c === 10/*\n*/; -} - -function isWsNotBr (c) { - return c === 9 || c === 11 || c === 12 || c === 32 || c === 160; -} - -function isBrOrWs (c) { - return c > 8 && c < 14 || c === 32 || c === 160; -} - -function isBrOrWsOrPunctuatorNotDot (c) { - return c > 8 && c < 14 || c === 32 || c === 160 || isPunctuator(c) && c !== 46/*.*/; -} - -function keywordStart (pos) { - return pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - 1)); -} - -function readPrecedingKeyword (pos, match) { - if (pos < match.length - 1) - return false; - return source.startsWith(match, pos - match.length + 1) && (pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - match.length))); -} - -function readPrecedingKeyword1 (pos, ch) { - return source.charCodeAt(pos) === ch && (pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - 1))); -} - -// Detects one of case, debugger, delete, do, else, in, instanceof, new, -// return, throw, typeof, void, yield, await -function isExpressionKeyword (pos) { - switch (source.charCodeAt(pos)) { - case 100/*d*/: - switch (source.charCodeAt(pos - 1)) { - case 105/*i*/: - // void - return readPrecedingKeyword(pos - 2, 'vo'); - case 108/*l*/: - // yield - return readPrecedingKeyword(pos - 2, 'yie'); - default: - return false; - } - case 101/*e*/: - switch (source.charCodeAt(pos - 1)) { - case 115/*s*/: - switch (source.charCodeAt(pos - 2)) { - case 108/*l*/: - // else - return readPrecedingKeyword1(pos - 3, 101/*e*/); - case 97/*a*/: - // case - return readPrecedingKeyword1(pos - 3, 99/*c*/); - default: - return false; - } - case 116/*t*/: - // delete - return readPrecedingKeyword(pos - 2, 'dele'); - default: - return false; - } - case 102/*f*/: - if (source.charCodeAt(pos - 1) !== 111/*o*/ || source.charCodeAt(pos - 2) !== 101/*e*/) - return false; - switch (source.charCodeAt(pos - 3)) { - case 99/*c*/: - // instanceof - return readPrecedingKeyword(pos - 4, 'instan'); - case 112/*p*/: - // typeof - return readPrecedingKeyword(pos - 4, 'ty'); - default: - return false; - } - case 110/*n*/: - // in, return - return readPrecedingKeyword1(pos - 1, 105/*i*/) || readPrecedingKeyword(pos - 1, 'retur'); - case 111/*o*/: - // do - return readPrecedingKeyword1(pos - 1, 100/*d*/); - case 114/*r*/: - // debugger - return readPrecedingKeyword(pos - 1, 'debugge'); - case 116/*t*/: - // await - return readPrecedingKeyword(pos - 1, 'awai'); - case 119/*w*/: - switch (source.charCodeAt(pos - 1)) { - case 101/*e*/: - // new - return readPrecedingKeyword1(pos - 2, 110/*n*/); - case 111/*o*/: - // throw - return readPrecedingKeyword(pos - 2, 'thr'); - default: - return false; - } - } - return false; -} - -function isParenKeyword (curPos) { - return source.charCodeAt(curPos) === 101/*e*/ && source.startsWith('whil', curPos - 4) || - source.charCodeAt(curPos) === 114/*r*/ && source.startsWith('fo', curPos - 2) || - source.charCodeAt(curPos - 1) === 105/*i*/ && source.charCodeAt(curPos) === 102/*f*/; -} - -function isPunctuator (ch) { - // 23 possible punctuator endings: !%&()*+,-./:;<=>?[]^{}|~ - return ch === 33/*!*/ || ch === 37/*%*/ || ch === 38/*&*/ || - ch > 39 && ch < 48 || ch > 57 && ch < 64 || - ch === 91/*[*/ || ch === 93/*]*/ || ch === 94/*^*/ || - ch > 122 && ch < 127; -} - -function isExpressionPunctuator (ch) { - // 20 possible expression endings: !%&(*+,-.:;<=>?[^{|~ - return ch === 33/*!*/ || ch === 37/*%*/ || ch === 38/*&*/ || - ch > 39 && ch < 47 && ch !== 41 || ch > 57 && ch < 64 || - ch === 91/*[*/ || ch === 94/*^*/ || ch > 122 && ch < 127 && ch !== 125/*}*/; -} - -function isExpressionTerminator (curPos) { - // detects: - // => ; ) finally catch else - // as all of these followed by a { will indicate a statement brace - switch (source.charCodeAt(curPos)) { - case 62/*>*/: - return source.charCodeAt(curPos - 1) === 61/*=*/; - case 59/*;*/: - case 41/*)*/: - return true; - case 104/*h*/: - return source.startsWith('catc', curPos - 4); - case 121/*y*/: - return source.startsWith('finall', curPos - 6); - case 101/*e*/: - return source.startsWith('els', curPos - 3); - } - return false; -} - -function syntaxError () { - throw Object.assign(new Error(`Parse error ${name}:${source.slice(0, pos).split('\n').length}:${pos - source.lastIndexOf('\n', pos - 1)}`), { idx: pos }); -} \ No newline at end of file diff --git a/node_modules/es-module-lexer/package.json b/node_modules/es-module-lexer/package.json deleted file mode 100644 index 2fd6317..0000000 --- a/node_modules/es-module-lexer/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "es-module-lexer", - "version": "1.4.1", - "description": "Lexes ES modules returning their import/export metadata", - "main": "dist/lexer.cjs", - "module": "dist/lexer.js", - "types": "types/lexer.d.ts", - "exports": { - ".": { - "types": "./types/lexer.d.ts", - "module": "./dist/lexer.js", - "import": "./dist/lexer.js", - "require": "./dist/lexer.cjs" - }, - "./js": "./dist/lexer.asm.js" - }, - "scripts": { - "build": "npm install -g chomp ; chomp build", - "test": "npm install -g chomp ; chomp test" - }, - "author": "Guy Bedford", - "license": "MIT", - "devDependencies": { - "@babel/cli": "^7.5.5", - "@babel/core": "^7.5.5", - "@babel/plugin-transform-modules-commonjs": "^7.5.0", - "@swc/cli": "^0.1.57", - "@swc/core": "^1.2.224", - "@types/node": "^18.7.1", - "kleur": "^2.0.2", - "mocha": "^5.2.0", - "terser": "^5.19.4", - "typescript": "^4.7.4" - }, - "files": [ - "dist", - "types", - "lexer.js" - ], - "type": "module", - "repository": { - "type": "git", - "url": "git+https://github.com/guybedford/es-module-lexer.git" - }, - "bugs": { - "url": "https://github.com/guybedford/es-module-lexer/issues" - }, - "homepage": "https://github.com/guybedford/es-module-lexer#readme", - "directories": { - "lib": "lib", - "test": "test" - }, - "keywords": [] -} diff --git a/node_modules/es-module-lexer/types/lexer.d.ts b/node_modules/es-module-lexer/types/lexer.d.ts deleted file mode 100644 index 4341a2a..0000000 --- a/node_modules/es-module-lexer/types/lexer.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -export interface ImportSpecifier { - /** - * Module name - * - * To handle escape sequences in specifier strings, the .n field of imported specifiers will be provided where possible. - * - * For dynamic import expressions, this field will be empty if not a valid JS string. - * - * @example - * const [imports1, exports1] = parse(String.raw`import './\u0061\u0062.js'`); - * imports1[0].n; - * // Returns "./ab.js" - * - * const [imports2, exports2] = parse(`import("./ab.js")`); - * imports2[0].n; - * // Returns "./ab.js" - * - * const [imports3, exports3] = parse(`import("./" + "ab.js")`); - * imports3[0].n; - * // Returns undefined - */ - readonly n: string | undefined; - /** - * Start of module specifier - * - * @example - * const source = `import { a } from 'asdf'`; - * const [imports, exports] = parse(source); - * source.substring(imports[0].s, imports[0].e); - * // Returns "asdf" - */ - readonly s: number; - /** - * End of module specifier - */ - readonly e: number; - /** - * Start of import statement - * - * @example - * const source = `import { a } from 'asdf'`; - * const [imports, exports] = parse(source); - * source.substring(imports[0].ss, imports[0].se); - * // Returns "import { a } from 'asdf';" - */ - readonly ss: number; - /** - * End of import statement - */ - readonly se: number; - /** - * If this import keyword is a dynamic import, this is the start value. - * If this import keyword is a static import, this is -1. - * If this import keyword is an import.meta expresion, this is -2. - */ - readonly d: number; - /** - * If this import has an import assertion, this is the start value. - * Otherwise this is `-1`. - */ - readonly a: number; -} -export interface ExportSpecifier { - /** - * Exported name - * - * @example - * const source = `export default []`; - * const [imports, exports] = parse(source); - * exports[0].n; - * // Returns "default" - * - * @example - * const source = `export const asdf = 42`; - * const [imports, exports] = parse(source); - * exports[0].n; - * // Returns "asdf" - */ - readonly n: string; - /** - * Local name, or undefined. - * - * @example - * const source = `export default []`; - * const [imports, exports] = parse(source); - * exports[0].ln; - * // Returns undefined - * - * @example - * const asdf = 42; - * const source = `export { asdf as a }`; - * const [imports, exports] = parse(source); - * exports[0].ln; - * // Returns "asdf" - */ - readonly ln: string | undefined; - /** - * Start of exported name - * - * @example - * const source = `export default []`; - * const [imports, exports] = parse(source); - * source.substring(exports[0].s, exports[0].e); - * // Returns "default" - * - * @example - * const source = `export { 42 as asdf }`; - * const [imports, exports] = parse(source); - * source.substring(exports[0].s, exports[0].e); - * // Returns "asdf" - */ - readonly s: number; - /** - * End of exported name - */ - readonly e: number; - /** - * Start of local name, or -1. - * - * @example - * const asdf = 42; - * const source = `export { asdf as a }`; - * const [imports, exports] = parse(source); - * source.substring(exports[0].ls, exports[0].le); - * // Returns "asdf" - */ - readonly ls: number; - /** - * End of local name, or -1. - */ - readonly le: number; -} -export interface ParseError extends Error { - idx: number; -} -/** - * Outputs the list of exports and locations of import specifiers, - * including dynamic import and import meta handling. - * - * @param source Source code to parser - * @param name Optional sourcename - * @returns Tuple contaning imports list and exports list. - */ -export declare function parse(source: string, name?: string): readonly [ - imports: ReadonlyArray, - exports: ReadonlyArray, - facade: boolean, - hasModuleSyntax: boolean -]; -/** - * Wait for init to resolve before calling `parse`. - */ -export declare const init: Promise; diff --git a/node_modules/escalade/dist/index.js b/node_modules/escalade/dist/index.js deleted file mode 100644 index ad236c4..0000000 --- a/node_modules/escalade/dist/index.js +++ /dev/null @@ -1,22 +0,0 @@ -const { dirname, resolve } = require('path'); -const { readdir, stat } = require('fs'); -const { promisify } = require('util'); - -const toStats = promisify(stat); -const toRead = promisify(readdir); - -module.exports = async function (start, callback) { - let dir = resolve('.', start); - let tmp, stats = await toStats(dir); - - if (!stats.isDirectory()) { - dir = dirname(dir); - } - - while (true) { - tmp = await callback(dir, await toRead(dir)); - if (tmp) return resolve(dir, tmp); - dir = dirname(tmp = dir); - if (tmp === dir) break; - } -} diff --git a/node_modules/escalade/dist/index.mjs b/node_modules/escalade/dist/index.mjs deleted file mode 100644 index bf95be0..0000000 --- a/node_modules/escalade/dist/index.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { dirname, resolve } from 'path'; -import { readdir, stat } from 'fs'; -import { promisify } from 'util'; - -const toStats = promisify(stat); -const toRead = promisify(readdir); - -export default async function (start, callback) { - let dir = resolve('.', start); - let tmp, stats = await toStats(dir); - - if (!stats.isDirectory()) { - dir = dirname(dir); - } - - while (true) { - tmp = await callback(dir, await toRead(dir)); - if (tmp) return resolve(dir, tmp); - dir = dirname(tmp = dir); - if (tmp === dir) break; - } -} diff --git a/node_modules/escalade/index.d.ts b/node_modules/escalade/index.d.ts deleted file mode 100644 index 283e398..0000000 --- a/node_modules/escalade/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -type Promisable = T | Promise; -export type Callback = (directory: string, files: string[]) => Promisable; -export default function (directory: string, callback: Callback): Promise; diff --git a/node_modules/escalade/license b/node_modules/escalade/license deleted file mode 100644 index fa6089f..0000000 --- a/node_modules/escalade/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Luke Edwards (lukeed.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escalade/package.json b/node_modules/escalade/package.json deleted file mode 100644 index e0f5271..0000000 --- a/node_modules/escalade/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "escalade", - "version": "3.1.2", - "repository": "lukeed/escalade", - "description": "A tiny (183B to 210B) and fast utility to ascend parent directories", - "module": "dist/index.mjs", - "main": "dist/index.js", - "types": "index.d.ts", - "license": "MIT", - "author": { - "name": "Luke Edwards", - "email": "luke.edwards05@gmail.com", - "url": "https://lukeed.com" - }, - "exports": { - ".": [ - { - "types": "./index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" - }, - "./dist/index.js" - ], - "./sync": [ - { - "types": "./sync/index.d.ts", - "import": "./sync/index.mjs", - "require": "./sync/index.js" - }, - "./sync/index.js" - ] - }, - "files": [ - "*.d.ts", - "dist", - "sync" - ], - "modes": { - "sync": "src/sync.js", - "default": "src/async.js" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "build": "bundt", - "pretest": "npm run build", - "test": "uvu -r esm test -i fixtures" - }, - "keywords": [ - "find", - "parent", - "parents", - "directory", - "search", - "walk" - ], - "devDependencies": { - "bundt": "1.1.1", - "esm": "3.2.25", - "uvu": "0.3.3" - } -} diff --git a/node_modules/escalade/readme.md b/node_modules/escalade/readme.md deleted file mode 100644 index e07ee0d..0000000 --- a/node_modules/escalade/readme.md +++ /dev/null @@ -1,211 +0,0 @@ -# escalade [![CI](https://github.com/lukeed/escalade/workflows/CI/badge.svg)](https://github.com/lukeed/escalade/actions) [![licenses](https://licenses.dev/b/npm/escalade)](https://licenses.dev/npm/escalade) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/escalade)](https://codecov.io/gh/lukeed/escalade) - -> A tiny (183B to 210B) and [fast](#benchmarks) utility to ascend parent directories - -With [escalade](https://en.wikipedia.org/wiki/Escalade), you can scale parent directories until you've found what you're looking for.
Given an input file or directory, `escalade` will continue executing your callback function until either: - -1) the callback returns a truthy value -2) `escalade` has reached the system root directory (eg, `/`) - -> **Important:**
Please note that `escalade` only deals with direct ancestry – it will not dive into parents' sibling directories. - ---- - -**Notice:** As of v3.1.0, `escalade` now includes [Deno support](http://deno.land/x/escalade)! Please see [Deno Usage](#deno) below. - ---- - -## Install - -``` -$ npm install --save escalade -``` - - -## Modes - -There are two "versions" of `escalade` available: - -#### "async" -> **Node.js:** >= 8.x
-> **Size (gzip):** 210 bytes
-> **Availability:** [CommonJS](https://unpkg.com/escalade/dist/index.js), [ES Module](https://unpkg.com/escalade/dist/index.mjs) - -This is the primary/default mode. It makes use of `async`/`await` and [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original). - -#### "sync" -> **Node.js:** >= 6.x
-> **Size (gzip):** 183 bytes
-> **Availability:** [CommonJS](https://unpkg.com/escalade/sync/index.js), [ES Module](https://unpkg.com/escalade/sync/index.mjs) - -This is the opt-in mode, ideal for scenarios where `async` usage cannot be supported. - - -## Usage - -***Example Structure*** - -``` -/Users/lukeed - └── oss - ├── license - └── escalade - ├── package.json - └── test - └── fixtures - ├── index.js - └── foobar - └── demo.js -``` - -***Example Usage*** - -```js -//~> demo.js -import { join } from 'path'; -import escalade from 'escalade'; - -const input = join(__dirname, 'demo.js'); -// or: const input = __dirname; - -const pkg = await escalade(input, (dir, names) => { - console.log('~> dir:', dir); - console.log('~> names:', names); - console.log('---'); - - if (names.includes('package.json')) { - // will be resolved into absolute - return 'package.json'; - } -}); - -//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar -//~> names: ['demo.js'] -//--- -//~> dir: /Users/lukeed/oss/escalade/test/fixtures -//~> names: ['index.js', 'foobar'] -//--- -//~> dir: /Users/lukeed/oss/escalade/test -//~> names: ['fixtures'] -//--- -//~> dir: /Users/lukeed/oss/escalade -//~> names: ['package.json', 'test'] -//--- - -console.log(pkg); -//=> /Users/lukeed/oss/escalade/package.json - -// Now search for "missing123.txt" -// (Assume it doesn't exist anywhere!) -const missing = await escalade(input, (dir, names) => { - console.log('~> dir:', dir); - return names.includes('missing123.txt') && 'missing123.txt'; -}); - -//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar -//~> dir: /Users/lukeed/oss/escalade/test/fixtures -//~> dir: /Users/lukeed/oss/escalade/test -//~> dir: /Users/lukeed/oss/escalade -//~> dir: /Users/lukeed/oss -//~> dir: /Users/lukeed -//~> dir: /Users -//~> dir: / - -console.log(missing); -//=> undefined -``` - -> **Note:** To run the above example with "sync" mode, import from `escalade/sync` and remove the `await` keyword. - - -## API - -### escalade(input, callback) -Returns: `string|void` or `Promise` - -When your `callback` locates a file, `escalade` will resolve/return with an absolute path.
-If your `callback` was never satisfied, then `escalade` will resolve/return with nothing (undefined). - -> **Important:**
The `sync` and `async` versions share the same API.
The **only** difference is that `sync` is not Promise-based. - -#### input -Type: `string` - -The path from which to start ascending. - -This may be a file or a directory path.
However, when `input` is a file, `escalade` will begin with its parent directory. - -> **Important:** Unless given an absolute path, `input` will be resolved from `process.cwd()` location. - -#### callback -Type: `Function` - -The callback to execute for each ancestry level. It always is given two arguments: - -1) `dir` - an absolute path of the current parent directory -2) `names` - a list (`string[]`) of contents _relative to_ the `dir` parent - -> **Note:** The `names` list can contain names of files _and_ directories. - -When your callback returns a _falsey_ value, then `escalade` will continue with `dir`'s parent directory, re-invoking your callback with new argument values. - -When your callback returns a string, then `escalade` stops iteration immediately.
-If the string is an absolute path, then it's left as is. Otherwise, the string is resolved into an absolute path _from_ the `dir` that housed the satisfying condition. - -> **Important:** Your `callback` can be a `Promise/AsyncFunction` when using the "async" version of `escalade`. - -## Benchmarks - -> Running on Node.js v10.13.0 - -``` -# Load Time - find-up 3.891ms - escalade 0.485ms - escalade/sync 0.309ms - -# Levels: 6 (target = "foo.txt"): - find-up x 24,856 ops/sec ±6.46% (55 runs sampled) - escalade x 73,084 ops/sec ±4.23% (73 runs sampled) - find-up.sync x 3,663 ops/sec ±1.12% (83 runs sampled) - escalade/sync x 9,360 ops/sec ±0.62% (88 runs sampled) - -# Levels: 12 (target = "package.json"): - find-up x 29,300 ops/sec ±10.68% (70 runs sampled) - escalade x 73,685 ops/sec ± 5.66% (66 runs sampled) - find-up.sync x 1,707 ops/sec ± 0.58% (91 runs sampled) - escalade/sync x 4,667 ops/sec ± 0.68% (94 runs sampled) - -# Levels: 18 (target = "missing123.txt"): - find-up x 21,818 ops/sec ±17.37% (14 runs sampled) - escalade x 67,101 ops/sec ±21.60% (20 runs sampled) - find-up.sync x 1,037 ops/sec ± 2.86% (88 runs sampled) - escalade/sync x 1,248 ops/sec ± 0.50% (93 runs sampled) -``` - -## Deno - -As of v3.1.0, `escalade` is available on the Deno registry. - -Please note that the [API](#api) is identical and that there are still [two modes](#modes) from which to choose: - -```ts -// Choose "async" mode -import escalade from 'https://deno.land/escalade/async.ts'; - -// Choose "sync" mode -import escalade from 'https://deno.land/escalade/sync.ts'; -``` - -> **Important:** The `allow-read` permission is required! - - -## Related - -- [premove](https://github.com/lukeed/premove) - A tiny (247B) utility to remove items recursively -- [totalist](https://github.com/lukeed/totalist) - A tiny (195B to 224B) utility to recursively list all (total) files in a directory -- [mk-dirs](https://github.com/lukeed/mk-dirs) - A tiny (420B) utility to make a directory and its parents, recursively - -## License - -MIT © [Luke Edwards](https://lukeed.com) diff --git a/node_modules/escalade/sync/index.d.ts b/node_modules/escalade/sync/index.d.ts deleted file mode 100644 index 746ddd3..0000000 --- a/node_modules/escalade/sync/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type Callback = (directory: string, files: string[]) => string | false | void; -export default function (directory: string, callback: Callback): string | void; diff --git a/node_modules/escalade/sync/index.js b/node_modules/escalade/sync/index.js deleted file mode 100644 index 902cc46..0000000 --- a/node_modules/escalade/sync/index.js +++ /dev/null @@ -1,18 +0,0 @@ -const { dirname, resolve } = require('path'); -const { readdirSync, statSync } = require('fs'); - -module.exports = function (start, callback) { - let dir = resolve('.', start); - let tmp, stats = statSync(dir); - - if (!stats.isDirectory()) { - dir = dirname(dir); - } - - while (true) { - tmp = callback(dir, readdirSync(dir)); - if (tmp) return resolve(dir, tmp); - dir = dirname(tmp = dir); - if (tmp === dir) break; - } -} diff --git a/node_modules/escalade/sync/index.mjs b/node_modules/escalade/sync/index.mjs deleted file mode 100644 index 3cdc5bd..0000000 --- a/node_modules/escalade/sync/index.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { dirname, resolve } from 'path'; -import { readdirSync, statSync } from 'fs'; - -export default function (start, callback) { - let dir = resolve('.', start); - let tmp, stats = statSync(dir); - - if (!stats.isDirectory()) { - dir = dirname(dir); - } - - while (true) { - tmp = callback(dir, readdirSync(dir)); - if (tmp) return resolve(dir, tmp); - dir = dirname(tmp = dir); - if (tmp === dir) break; - } -} diff --git a/node_modules/eslint-scope/CHANGELOG.md b/node_modules/eslint-scope/CHANGELOG.md deleted file mode 100644 index cc07de0..0000000 --- a/node_modules/eslint-scope/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -v5.1.1 - September 12, 2020 - -* [`9b528d7`](https://github.com/eslint/eslint-scope/commit/9b528d778c381718c12dabfb7f1c0e0dc6b36e49) Upgrade: esrecurse version to ^4.3.0 (#64) (Timofey Kachalov) -* [`f758bbc`](https://github.com/eslint/eslint-scope/commit/f758bbc3d49b9b9ea2289a5d6a6bba8dcf2c4903) Chore: fix definiton -> definition typo in comments (#63) (Kevin Kirsche) -* [`7513734`](https://github.com/eslint/eslint-scope/commit/751373473375b3f2edc4eaf1c8d2763d8435bb72) Chore: move to GitHub Actions (#62) (Kai Cataldo) - -v5.1.0 - June 4, 2020 - -* [`d4a3764`](https://github.com/eslint/eslint-scope/commit/d4a376434b16289c1a428d7e304576e997520873) Update: support new export syntax (#56) (Toru Nagashima) - -v5.0.0 - July 20, 2019 - -* [`e9fa22e`](https://github.com/eslint/eslint-scope/commit/e9fa22ea412c26cf2761fa98af7e715644bdb464) Upgrade: update dependencies after dropping support for Node <8 (#53) (Kai Cataldo) -* [`ee9f7c1`](https://github.com/eslint/eslint-scope/commit/ee9f7c12721aa195ba7e0e69551f49bfdb479951) Breaking: drop support for Node v6 (#54) (Kai Cataldo) - -v4.0.3 - March 15, 2019 - -* [`299df64`](https://github.com/eslint/eslint-scope/commit/299df64bdafb30b4d9372e4b7af0cf51a3818c4a) Fix: arrow function scope strictness (take 2) (#52) (futpib) - -v4.0.2 - March 1, 2019 - -* [`c925600`](https://github.com/eslint/eslint-scope/commit/c925600a684ae0f71b96f85339437a43b4d50d99) Revert "Fix: Arrow function scope strictness (fixes #49) (#50)" (#51) (Teddy Katz) - -v4.0.1 - March 1, 2019 - -* [`2533966`](https://github.com/eslint/eslint-scope/commit/2533966faf317df5a3847fab937ba462c16808b8) Fix: Arrow function scope strictness (fixes #49) (#50) (futpib) -* [`0cbeea5`](https://github.com/eslint/eslint-scope/commit/0cbeea51dfb66ab88ea34b0e3b4ad5e6cc210f2f) Chore: add supported Node.js versions to CI (#47) (Kai Cataldo) -* [`b423057`](https://github.com/eslint/eslint-scope/commit/b42305760638b8edf4667acf1445e450869bd983) Upgrade: eslint-release@1.0.0 (#46) (Teddy Katz) - -v4.0.0 - June 21, 2018 - - - -v4.0.0-rc.0 - June 9, 2018 - -* 3b919b8 Build: Adding rc release script to package.json (#38) (Kevin Partington) -* 137732a Chore: avoid creating package-lock.json files (#37) (Teddy Katz) - -v4.0.0-alpha.0 - April 27, 2018 - -* 7cc3769 Upgrade: eslint-release ^0.11.1 (#36) (Teddy Katz) -* c9f6967 Breaking: remove TDZScope (refs eslint/eslint#10245) (#35) (Toru Nagashima) -* 982a71f Fix: wrong resolution about default parameters (#33) (Toru Nagashima) -* 57889f1 Docs: Remove extra header line from LICENSE (#32) (Gyandeep Singh) - -v3.7.1 - April 12, 2017 - -* ced6262 Fix: restore previous Scope API exports from escope (#31) (Vitor Balocco) -* 5c3d966 Fix: Remove and Modify tests that contain invalid ES6 syntax (#29) (Reyad Attiyat) - -v3.7.0 - March 17, 2017 - -* 9e27835 Chore: Add files section to package.json (#24) (Ilya Volodin) -* 3e4d123 Upgrade: eslint-config-eslint to 4.0.0 (#21) (Teddy Katz) -* 38c50fb Chore: Rename src to lib and test to tests (#20) (Corbin Uselton) -* f4cd920 Chore: Remove esprima (#19) (Corbin Uselton) -* f81fad5 Revert "Chore: Remove esprima" (#18) (James Henry) -* 31b0085 Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (#13) (Corbin Uselton) -* 12a1ca1 Add Makefile.js and eslint (#15) (Reyad Attiyat) -* 7d23f8e Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (Corbin Uselton) -* 019441e Chore: Convert to ES6 that is supported on Node 4, commonjs modules and remove Babel (#14) (Corbin Uselton) -* c647f65 Update: Add check for node.body in referencer (#2) (Corbin Uselton) -* eb5c9db Remove browserify and jsdoc (#12) (Corbin Uselton) -* cf38df0 Chore: Update README.md (#3) (James Henry) -* 8a142ca Chore: Add eslint-release scripts (#6) (James Henry) -* e60d8cb Chore: Remove unused bower.json (#5) (James Henry) -* 049c545 Chore: Fix tests for eslint-scope (#4) (James Henry) -* f026aab Chore: Update package.json for eslint fork (#1) (James Henry) -* a94d281 Chore: Update license with JSF copyright (Nicholas C. Zakas) - diff --git a/node_modules/eslint-scope/LICENSE b/node_modules/eslint-scope/LICENSE deleted file mode 100644 index d36a526..0000000 --- a/node_modules/eslint-scope/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright JS Foundation and other contributors, https://js.foundation -Copyright (C) 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint-scope/README.md b/node_modules/eslint-scope/README.md deleted file mode 100644 index 7e7ce0d..0000000 --- a/node_modules/eslint-scope/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# ESLint Scope - -ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). - -## Usage - -Install: - -``` -npm i eslint-scope --save -``` - -Example: - -```js -var eslintScope = require('eslint-scope'); -var espree = require('espree'); -var estraverse = require('estraverse'); - -var ast = espree.parse(code); -var scopeManager = eslintScope.analyze(ast); - -var currentScope = scopeManager.acquire(ast); // global scope - -estraverse.traverse(ast, { - enter: function(node, parent) { - // do stuff - - if (/Function/.test(node.type)) { - currentScope = scopeManager.acquire(node); // get current function scope - } - }, - leave: function(node, parent) { - if (/Function/.test(node.type)) { - currentScope = currentScope.upper; // set to parent scope - } - - // do stuff - } -}); -``` - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). - -## Build Commands - -* `npm test` - run all linting and tests -* `npm run lint` - run all linting - -## License - -ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/node_modules/eslint-scope/lib/definition.js b/node_modules/eslint-scope/lib/definition.js deleted file mode 100644 index 172bfe2..0000000 --- a/node_modules/eslint-scope/lib/definition.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -const Variable = require("./variable"); - -/** - * @class Definition - */ -class Definition { - constructor(type, name, node, parent, index, kind) { - - /** - * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). - */ - this.type = type; - - /** - * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. - */ - this.name = name; - - /** - * @member {espree.Node} Definition#node - the enclosing node of the identifier. - */ - this.node = node; - - /** - * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. - */ - this.parent = parent; - - /** - * @member {Number?} Definition#index - the index in the declaration statement. - */ - this.index = index; - - /** - * @member {String?} Definition#kind - the kind of the declaration statement. - */ - this.kind = kind; - } -} - -/** - * @class ParameterDefinition - */ -class ParameterDefinition extends Definition { - constructor(name, node, index, rest) { - super(Variable.Parameter, name, node, null, index, null); - - /** - * Whether the parameter definition is a part of a rest parameter. - * @member {boolean} ParameterDefinition#rest - */ - this.rest = rest; - } -} - -module.exports = { - ParameterDefinition, - Definition -}; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/index.js b/node_modules/eslint-scope/lib/index.js deleted file mode 100644 index 0f16fa4..0000000 --- a/node_modules/eslint-scope/lib/index.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2013 Alex Seville - Copyright (C) 2014 Thiago de Arruda - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * Escope (escope) is an ECMAScript - * scope analyzer extracted from the esmangle project. - *

- * escope finds lexical scopes in a source program, i.e. areas of that - * program where different occurrences of the same identifier refer to the same - * variable. With each scope the contained variables are collected, and each - * identifier reference in code is linked to its corresponding variable (if - * possible). - *

- * escope works on a syntax tree of the parsed source code which has - * to adhere to the - * Mozilla Parser API. E.g. espree is a parser - * that produces such syntax trees. - *

- * The main interface is the {@link analyze} function. - * @module escope - */ -"use strict"; - -/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ - -const assert = require("assert"); - -const ScopeManager = require("./scope-manager"); -const Referencer = require("./referencer"); -const Reference = require("./reference"); -const Variable = require("./variable"); -const Scope = require("./scope").Scope; -const version = require("../package.json").version; - -/** - * Set the default options - * @returns {Object} options - */ -function defaultOptions() { - return { - optimistic: false, - directive: false, - nodejsScope: false, - impliedStrict: false, - sourceType: "script", // one of ['script', 'module'] - ecmaVersion: 5, - childVisitorKeys: null, - fallback: "iteration" - }; -} - -/** - * Preform deep update on option object - * @param {Object} target - Options - * @param {Object} override - Updates - * @returns {Object} Updated options - */ -function updateDeeply(target, override) { - - /** - * Is hash object - * @param {Object} value - Test value - * @returns {boolean} Result - */ - function isHashObject(value) { - return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); - } - - for (const key in override) { - if (Object.prototype.hasOwnProperty.call(override, key)) { - const val = override[key]; - - if (isHashObject(val)) { - if (isHashObject(target[key])) { - updateDeeply(target[key], val); - } else { - target[key] = updateDeeply({}, val); - } - } else { - target[key] = val; - } - } - } - return target; -} - -/** - * Main interface function. Takes an Espree syntax tree and returns the - * analyzed scopes. - * @function analyze - * @param {espree.Tree} tree - Abstract Syntax Tree - * @param {Object} providedOptions - Options that tailor the scope analysis - * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag - * @param {boolean} [providedOptions.directive=false]- the directive flag - * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls - * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole - * script is executed under node.js environment. When enabled, escope adds - * a function scope immediately following the global scope. - * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode - * (if ecmaVersion >= 5). - * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' - * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered - * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. - * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. - * @returns {ScopeManager} ScopeManager - */ -function analyze(tree, providedOptions) { - const options = updateDeeply(defaultOptions(), providedOptions); - const scopeManager = new ScopeManager(options); - const referencer = new Referencer(options, scopeManager); - - referencer.visit(tree); - - assert(scopeManager.__currentScope === null, "currentScope should be null."); - - return scopeManager; -} - -module.exports = { - - /** @name module:escope.version */ - version, - - /** @name module:escope.Reference */ - Reference, - - /** @name module:escope.Variable */ - Variable, - - /** @name module:escope.Scope */ - Scope, - - /** @name module:escope.ScopeManager */ - ScopeManager, - analyze -}; - - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/pattern-visitor.js b/node_modules/eslint-scope/lib/pattern-visitor.js deleted file mode 100644 index afa6291..0000000 --- a/node_modules/eslint-scope/lib/pattern-visitor.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -/* eslint-disable no-undefined */ - -const Syntax = require("estraverse").Syntax; -const esrecurse = require("esrecurse"); - -/** - * Get last array element - * @param {array} xs - array - * @returns {any} Last elment - */ -function getLast(xs) { - return xs[xs.length - 1] || null; -} - -class PatternVisitor extends esrecurse.Visitor { - static isPattern(node) { - const nodeType = node.type; - - return ( - nodeType === Syntax.Identifier || - nodeType === Syntax.ObjectPattern || - nodeType === Syntax.ArrayPattern || - nodeType === Syntax.SpreadElement || - nodeType === Syntax.RestElement || - nodeType === Syntax.AssignmentPattern - ); - } - - constructor(options, rootPattern, callback) { - super(null, options); - this.rootPattern = rootPattern; - this.callback = callback; - this.assignments = []; - this.rightHandNodes = []; - this.restElements = []; - } - - Identifier(pattern) { - const lastRestElement = getLast(this.restElements); - - this.callback(pattern, { - topLevel: pattern === this.rootPattern, - rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, - assignments: this.assignments - }); - } - - Property(property) { - - // Computed property's key is a right hand node. - if (property.computed) { - this.rightHandNodes.push(property.key); - } - - // If it's shorthand, its key is same as its value. - // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). - // If it's not shorthand, the name of new variable is its value's. - this.visit(property.value); - } - - ArrayPattern(pattern) { - for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { - const element = pattern.elements[i]; - - this.visit(element); - } - } - - AssignmentPattern(pattern) { - this.assignments.push(pattern); - this.visit(pattern.left); - this.rightHandNodes.push(pattern.right); - this.assignments.pop(); - } - - RestElement(pattern) { - this.restElements.push(pattern); - this.visit(pattern.argument); - this.restElements.pop(); - } - - MemberExpression(node) { - - // Computed property's key is a right hand node. - if (node.computed) { - this.rightHandNodes.push(node.property); - } - - // the object is only read, write to its property. - this.rightHandNodes.push(node.object); - } - - // - // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. - // By spec, LeftHandSideExpression is Pattern or MemberExpression. - // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) - // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... - // - - SpreadElement(node) { - this.visit(node.argument); - } - - ArrayExpression(node) { - node.elements.forEach(this.visit, this); - } - - AssignmentExpression(node) { - this.assignments.push(node); - this.visit(node.left); - this.rightHandNodes.push(node.right); - this.assignments.pop(); - } - - CallExpression(node) { - - // arguments are right hand nodes. - node.arguments.forEach(a => { - this.rightHandNodes.push(a); - }); - this.visit(node.callee); - } -} - -module.exports = PatternVisitor; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/reference.js b/node_modules/eslint-scope/lib/reference.js deleted file mode 100644 index 9529827..0000000 --- a/node_modules/eslint-scope/lib/reference.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -const READ = 0x1; -const WRITE = 0x2; -const RW = READ | WRITE; - -/** - * A Reference represents a single occurrence of an identifier in code. - * @class Reference - */ -class Reference { - constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { - - /** - * Identifier syntax node. - * @member {espreeIdentifier} Reference#identifier - */ - this.identifier = ident; - - /** - * Reference to the enclosing Scope. - * @member {Scope} Reference#from - */ - this.from = scope; - - /** - * Whether the reference comes from a dynamic scope (such as 'eval', - * 'with', etc.), and may be trapped by dynamic scopes. - * @member {boolean} Reference#tainted - */ - this.tainted = false; - - /** - * The variable this reference is resolved with. - * @member {Variable} Reference#resolved - */ - this.resolved = null; - - /** - * The read-write mode of the reference. (Value is one of {@link - * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). - * @member {number} Reference#flag - * @private - */ - this.flag = flag; - if (this.isWrite()) { - - /** - * If reference is writeable, this is the tree being written to it. - * @member {espreeNode} Reference#writeExpr - */ - this.writeExpr = writeExpr; - - /** - * Whether the Reference might refer to a partial value of writeExpr. - * @member {boolean} Reference#partial - */ - this.partial = partial; - - /** - * Whether the Reference is to write of initialization. - * @member {boolean} Reference#init - */ - this.init = init; - } - this.__maybeImplicitGlobal = maybeImplicitGlobal; - } - - /** - * Whether the reference is static. - * @method Reference#isStatic - * @returns {boolean} static - */ - isStatic() { - return !this.tainted && this.resolved && this.resolved.scope.isStatic(); - } - - /** - * Whether the reference is writeable. - * @method Reference#isWrite - * @returns {boolean} write - */ - isWrite() { - return !!(this.flag & Reference.WRITE); - } - - /** - * Whether the reference is readable. - * @method Reference#isRead - * @returns {boolean} read - */ - isRead() { - return !!(this.flag & Reference.READ); - } - - /** - * Whether the reference is read-only. - * @method Reference#isReadOnly - * @returns {boolean} read only - */ - isReadOnly() { - return this.flag === Reference.READ; - } - - /** - * Whether the reference is write-only. - * @method Reference#isWriteOnly - * @returns {boolean} write only - */ - isWriteOnly() { - return this.flag === Reference.WRITE; - } - - /** - * Whether the reference is read-write. - * @method Reference#isReadWrite - * @returns {boolean} read write - */ - isReadWrite() { - return this.flag === Reference.RW; - } -} - -/** - * @constant Reference.READ - * @private - */ -Reference.READ = READ; - -/** - * @constant Reference.WRITE - * @private - */ -Reference.WRITE = WRITE; - -/** - * @constant Reference.RW - * @private - */ -Reference.RW = RW; - -module.exports = Reference; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/referencer.js b/node_modules/eslint-scope/lib/referencer.js deleted file mode 100644 index 63d1935..0000000 --- a/node_modules/eslint-scope/lib/referencer.js +++ /dev/null @@ -1,629 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -/* eslint-disable no-underscore-dangle */ -/* eslint-disable no-undefined */ - -const Syntax = require("estraverse").Syntax; -const esrecurse = require("esrecurse"); -const Reference = require("./reference"); -const Variable = require("./variable"); -const PatternVisitor = require("./pattern-visitor"); -const definition = require("./definition"); -const assert = require("assert"); - -const ParameterDefinition = definition.ParameterDefinition; -const Definition = definition.Definition; - -/** - * Traverse identifier in pattern - * @param {Object} options - options - * @param {pattern} rootPattern - root pattern - * @param {Refencer} referencer - referencer - * @param {callback} callback - callback - * @returns {void} - */ -function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { - - // Call the callback at left hand identifier nodes, and Collect right hand nodes. - const visitor = new PatternVisitor(options, rootPattern, callback); - - visitor.visit(rootPattern); - - // Process the right hand nodes recursively. - if (referencer !== null && referencer !== undefined) { - visitor.rightHandNodes.forEach(referencer.visit, referencer); - } -} - -// Importing ImportDeclaration. -// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation -// https://github.com/estree/estree/blob/master/es6.md#importdeclaration -// FIXME: Now, we don't create module environment, because the context is -// implementation dependent. - -class Importer extends esrecurse.Visitor { - constructor(declaration, referencer) { - super(null, referencer.options); - this.declaration = declaration; - this.referencer = referencer; - } - - visitImport(id, specifier) { - this.referencer.visitPattern(id, pattern => { - this.referencer.currentScope().__define(pattern, - new Definition( - Variable.ImportBinding, - pattern, - specifier, - this.declaration, - null, - null - )); - }); - } - - ImportNamespaceSpecifier(node) { - const local = (node.local || node.id); - - if (local) { - this.visitImport(local, node); - } - } - - ImportDefaultSpecifier(node) { - const local = (node.local || node.id); - - this.visitImport(local, node); - } - - ImportSpecifier(node) { - const local = (node.local || node.id); - - if (node.name) { - this.visitImport(node.name, node); - } else { - this.visitImport(local, node); - } - } -} - -// Referencing variables and creating bindings. -class Referencer extends esrecurse.Visitor { - constructor(options, scopeManager) { - super(null, options); - this.options = options; - this.scopeManager = scopeManager; - this.parent = null; - this.isInnerMethodDefinition = false; - } - - currentScope() { - return this.scopeManager.__currentScope; - } - - close(node) { - while (this.currentScope() && node === this.currentScope().block) { - this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); - } - } - - pushInnerMethodDefinition(isInnerMethodDefinition) { - const previous = this.isInnerMethodDefinition; - - this.isInnerMethodDefinition = isInnerMethodDefinition; - return previous; - } - - popInnerMethodDefinition(isInnerMethodDefinition) { - this.isInnerMethodDefinition = isInnerMethodDefinition; - } - - referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { - const scope = this.currentScope(); - - assignments.forEach(assignment => { - scope.__referencing( - pattern, - Reference.WRITE, - assignment.right, - maybeImplicitGlobal, - pattern !== assignment.left, - init - ); - }); - } - - visitPattern(node, options, callback) { - let visitPatternOptions = options; - let visitPatternCallback = callback; - - if (typeof options === "function") { - visitPatternCallback = options; - visitPatternOptions = { processRightHandNodes: false }; - } - - traverseIdentifierInPattern( - this.options, - node, - visitPatternOptions.processRightHandNodes ? this : null, - visitPatternCallback - ); - } - - visitFunction(node) { - let i, iz; - - // FunctionDeclaration name is defined in upper scope - // NOTE: Not referring variableScope. It is intended. - // Since - // in ES5, FunctionDeclaration should be in FunctionBody. - // in ES6, FunctionDeclaration should be block scoped. - - if (node.type === Syntax.FunctionDeclaration) { - - // id is defined in upper scope - this.currentScope().__define(node.id, - new Definition( - Variable.FunctionName, - node.id, - node, - null, - null, - null - )); - } - - // FunctionExpression with name creates its special scope; - // FunctionExpressionNameScope. - if (node.type === Syntax.FunctionExpression && node.id) { - this.scopeManager.__nestFunctionExpressionNameScope(node); - } - - // Consider this function is in the MethodDefinition. - this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); - - const that = this; - - /** - * Visit pattern callback - * @param {pattern} pattern - pattern - * @param {Object} info - info - * @returns {void} - */ - function visitPatternCallback(pattern, info) { - that.currentScope().__define(pattern, - new ParameterDefinition( - pattern, - node, - i, - info.rest - )); - - that.referencingDefaultValue(pattern, info.assignments, null, true); - } - - // Process parameter declarations. - for (i = 0, iz = node.params.length; i < iz; ++i) { - this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); - } - - // if there's a rest argument, add that - if (node.rest) { - this.visitPattern({ - type: "RestElement", - argument: node.rest - }, pattern => { - this.currentScope().__define(pattern, - new ParameterDefinition( - pattern, - node, - node.params.length, - true - )); - }); - } - - // In TypeScript there are a number of function-like constructs which have no body, - // so check it exists before traversing - if (node.body) { - - // Skip BlockStatement to prevent creating BlockStatement scope. - if (node.body.type === Syntax.BlockStatement) { - this.visitChildren(node.body); - } else { - this.visit(node.body); - } - } - - this.close(node); - } - - visitClass(node) { - if (node.type === Syntax.ClassDeclaration) { - this.currentScope().__define(node.id, - new Definition( - Variable.ClassName, - node.id, - node, - null, - null, - null - )); - } - - this.visit(node.superClass); - - this.scopeManager.__nestClassScope(node); - - if (node.id) { - this.currentScope().__define(node.id, - new Definition( - Variable.ClassName, - node.id, - node - )); - } - this.visit(node.body); - - this.close(node); - } - - visitProperty(node) { - let previous; - - if (node.computed) { - this.visit(node.key); - } - - const isMethodDefinition = node.type === Syntax.MethodDefinition; - - if (isMethodDefinition) { - previous = this.pushInnerMethodDefinition(true); - } - this.visit(node.value); - if (isMethodDefinition) { - this.popInnerMethodDefinition(previous); - } - } - - visitForIn(node) { - if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { - this.scopeManager.__nestForScope(node); - } - - if (node.left.type === Syntax.VariableDeclaration) { - this.visit(node.left); - this.visitPattern(node.left.declarations[0].id, pattern => { - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); - }); - } else { - this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { - let maybeImplicitGlobal = null; - - if (!this.currentScope().isStrict) { - maybeImplicitGlobal = { - pattern, - node - }; - } - this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); - }); - } - this.visit(node.right); - this.visit(node.body); - - this.close(node); - } - - visitVariableDeclaration(variableTargetScope, type, node, index) { - - const decl = node.declarations[index]; - const init = decl.init; - - this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { - variableTargetScope.__define( - pattern, - new Definition( - type, - pattern, - decl, - node, - index, - node.kind - ) - ); - - this.referencingDefaultValue(pattern, info.assignments, null, true); - if (init) { - this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); - } - }); - } - - AssignmentExpression(node) { - if (PatternVisitor.isPattern(node.left)) { - if (node.operator === "=") { - this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { - let maybeImplicitGlobal = null; - - if (!this.currentScope().isStrict) { - maybeImplicitGlobal = { - pattern, - node - }; - } - this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); - }); - } else { - this.currentScope().__referencing(node.left, Reference.RW, node.right); - } - } else { - this.visit(node.left); - } - this.visit(node.right); - } - - CatchClause(node) { - this.scopeManager.__nestCatchScope(node); - - this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { - this.currentScope().__define(pattern, - new Definition( - Variable.CatchClause, - node.param, - node, - null, - null, - null - )); - this.referencingDefaultValue(pattern, info.assignments, null, true); - }); - this.visit(node.body); - - this.close(node); - } - - Program(node) { - this.scopeManager.__nestGlobalScope(node); - - if (this.scopeManager.__isNodejsScope()) { - - // Force strictness of GlobalScope to false when using node.js scope. - this.currentScope().isStrict = false; - this.scopeManager.__nestFunctionScope(node, false); - } - - if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { - this.scopeManager.__nestModuleScope(node); - } - - if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { - this.currentScope().isStrict = true; - } - - this.visitChildren(node); - this.close(node); - } - - Identifier(node) { - this.currentScope().__referencing(node); - } - - UpdateExpression(node) { - if (PatternVisitor.isPattern(node.argument)) { - this.currentScope().__referencing(node.argument, Reference.RW, null); - } else { - this.visitChildren(node); - } - } - - MemberExpression(node) { - this.visit(node.object); - if (node.computed) { - this.visit(node.property); - } - } - - Property(node) { - this.visitProperty(node); - } - - MethodDefinition(node) { - this.visitProperty(node); - } - - BreakStatement() {} // eslint-disable-line class-methods-use-this - - ContinueStatement() {} // eslint-disable-line class-methods-use-this - - LabeledStatement(node) { - this.visit(node.body); - } - - ForStatement(node) { - - // Create ForStatement declaration. - // NOTE: In ES6, ForStatement dynamically generates - // per iteration environment. However, escope is - // a static analyzer, we only generate one scope for ForStatement. - if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { - this.scopeManager.__nestForScope(node); - } - - this.visitChildren(node); - - this.close(node); - } - - ClassExpression(node) { - this.visitClass(node); - } - - ClassDeclaration(node) { - this.visitClass(node); - } - - CallExpression(node) { - - // Check this is direct call to eval - if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { - - // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and - // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. - this.currentScope().variableScope.__detectEval(); - } - this.visitChildren(node); - } - - BlockStatement(node) { - if (this.scopeManager.__isES6()) { - this.scopeManager.__nestBlockScope(node); - } - - this.visitChildren(node); - - this.close(node); - } - - ThisExpression() { - this.currentScope().variableScope.__detectThis(); - } - - WithStatement(node) { - this.visit(node.object); - - // Then nest scope for WithStatement. - this.scopeManager.__nestWithScope(node); - - this.visit(node.body); - - this.close(node); - } - - VariableDeclaration(node) { - const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); - - for (let i = 0, iz = node.declarations.length; i < iz; ++i) { - const decl = node.declarations[i]; - - this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); - if (decl.init) { - this.visit(decl.init); - } - } - } - - // sec 13.11.8 - SwitchStatement(node) { - this.visit(node.discriminant); - - if (this.scopeManager.__isES6()) { - this.scopeManager.__nestSwitchScope(node); - } - - for (let i = 0, iz = node.cases.length; i < iz; ++i) { - this.visit(node.cases[i]); - } - - this.close(node); - } - - FunctionDeclaration(node) { - this.visitFunction(node); - } - - FunctionExpression(node) { - this.visitFunction(node); - } - - ForOfStatement(node) { - this.visitForIn(node); - } - - ForInStatement(node) { - this.visitForIn(node); - } - - ArrowFunctionExpression(node) { - this.visitFunction(node); - } - - ImportDeclaration(node) { - assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); - - const importer = new Importer(node, this); - - importer.visit(node); - } - - visitExportDeclaration(node) { - if (node.source) { - return; - } - if (node.declaration) { - this.visit(node.declaration); - return; - } - - this.visitChildren(node); - } - - // TODO: ExportDeclaration doesn't exist. for bc? - ExportDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportAllDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportDefaultDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportNamedDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportSpecifier(node) { - - // TODO: `node.id` doesn't exist. for bc? - const local = (node.id || node.local); - - this.visit(local); - } - - MetaProperty() { // eslint-disable-line class-methods-use-this - - // do nothing. - } -} - -module.exports = Referencer; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope-manager.js b/node_modules/eslint-scope/lib/scope-manager.js deleted file mode 100644 index c192799..0000000 --- a/node_modules/eslint-scope/lib/scope-manager.js +++ /dev/null @@ -1,247 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -/* eslint-disable no-underscore-dangle */ - -const Scope = require("./scope"); -const assert = require("assert"); - -const GlobalScope = Scope.GlobalScope; -const CatchScope = Scope.CatchScope; -const WithScope = Scope.WithScope; -const ModuleScope = Scope.ModuleScope; -const ClassScope = Scope.ClassScope; -const SwitchScope = Scope.SwitchScope; -const FunctionScope = Scope.FunctionScope; -const ForScope = Scope.ForScope; -const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; -const BlockScope = Scope.BlockScope; - -/** - * @class ScopeManager - */ -class ScopeManager { - constructor(options) { - this.scopes = []; - this.globalScope = null; - this.__nodeToScope = new WeakMap(); - this.__currentScope = null; - this.__options = options; - this.__declaredVariables = new WeakMap(); - } - - __useDirective() { - return this.__options.directive; - } - - __isOptimistic() { - return this.__options.optimistic; - } - - __ignoreEval() { - return this.__options.ignoreEval; - } - - __isNodejsScope() { - return this.__options.nodejsScope; - } - - isModule() { - return this.__options.sourceType === "module"; - } - - isImpliedStrict() { - return this.__options.impliedStrict; - } - - isStrictModeSupported() { - return this.__options.ecmaVersion >= 5; - } - - // Returns appropriate scope for this node. - __get(node) { - return this.__nodeToScope.get(node); - } - - /** - * Get variables that are declared by the node. - * - * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. - * If the node declares nothing, this method returns an empty array. - * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. - * - * @param {Espree.Node} node - a node to get. - * @returns {Variable[]} variables that declared by the node. - */ - getDeclaredVariables(node) { - return this.__declaredVariables.get(node) || []; - } - - /** - * acquire scope from node. - * @method ScopeManager#acquire - * @param {Espree.Node} node - node for the acquired scope. - * @param {boolean=} inner - look up the most inner scope, default value is false. - * @returns {Scope?} Scope from node - */ - acquire(node, inner) { - - /** - * predicate - * @param {Scope} testScope - scope to test - * @returns {boolean} predicate - */ - function predicate(testScope) { - if (testScope.type === "function" && testScope.functionExpressionScope) { - return false; - } - return true; - } - - const scopes = this.__get(node); - - if (!scopes || scopes.length === 0) { - return null; - } - - // Heuristic selection from all scopes. - // If you would like to get all scopes, please use ScopeManager#acquireAll. - if (scopes.length === 1) { - return scopes[0]; - } - - if (inner) { - for (let i = scopes.length - 1; i >= 0; --i) { - const scope = scopes[i]; - - if (predicate(scope)) { - return scope; - } - } - } else { - for (let i = 0, iz = scopes.length; i < iz; ++i) { - const scope = scopes[i]; - - if (predicate(scope)) { - return scope; - } - } - } - - return null; - } - - /** - * acquire all scopes from node. - * @method ScopeManager#acquireAll - * @param {Espree.Node} node - node for the acquired scope. - * @returns {Scopes?} Scope array - */ - acquireAll(node) { - return this.__get(node); - } - - /** - * release the node. - * @method ScopeManager#release - * @param {Espree.Node} node - releasing node. - * @param {boolean=} inner - look up the most inner scope, default value is false. - * @returns {Scope?} upper scope for the node. - */ - release(node, inner) { - const scopes = this.__get(node); - - if (scopes && scopes.length) { - const scope = scopes[0].upper; - - if (!scope) { - return null; - } - return this.acquire(scope.block, inner); - } - return null; - } - - attach() { } // eslint-disable-line class-methods-use-this - - detach() { } // eslint-disable-line class-methods-use-this - - __nestScope(scope) { - if (scope instanceof GlobalScope) { - assert(this.__currentScope === null); - this.globalScope = scope; - } - this.__currentScope = scope; - return scope; - } - - __nestGlobalScope(node) { - return this.__nestScope(new GlobalScope(this, node)); - } - - __nestBlockScope(node) { - return this.__nestScope(new BlockScope(this, this.__currentScope, node)); - } - - __nestFunctionScope(node, isMethodDefinition) { - return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); - } - - __nestForScope(node) { - return this.__nestScope(new ForScope(this, this.__currentScope, node)); - } - - __nestCatchScope(node) { - return this.__nestScope(new CatchScope(this, this.__currentScope, node)); - } - - __nestWithScope(node) { - return this.__nestScope(new WithScope(this, this.__currentScope, node)); - } - - __nestClassScope(node) { - return this.__nestScope(new ClassScope(this, this.__currentScope, node)); - } - - __nestSwitchScope(node) { - return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); - } - - __nestModuleScope(node) { - return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); - } - - __nestFunctionExpressionNameScope(node) { - return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); - } - - __isES6() { - return this.__options.ecmaVersion >= 6; - } -} - -module.exports = ScopeManager; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope.js b/node_modules/eslint-scope/lib/scope.js deleted file mode 100644 index bdb5f63..0000000 --- a/node_modules/eslint-scope/lib/scope.js +++ /dev/null @@ -1,748 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -/* eslint-disable no-underscore-dangle */ -/* eslint-disable no-undefined */ - -const Syntax = require("estraverse").Syntax; - -const Reference = require("./reference"); -const Variable = require("./variable"); -const Definition = require("./definition").Definition; -const assert = require("assert"); - -/** - * Test if scope is struct - * @param {Scope} scope - scope - * @param {Block} block - block - * @param {boolean} isMethodDefinition - is method definition - * @param {boolean} useDirective - use directive - * @returns {boolean} is strict scope - */ -function isStrictScope(scope, block, isMethodDefinition, useDirective) { - let body; - - // When upper scope is exists and strict, inner scope is also strict. - if (scope.upper && scope.upper.isStrict) { - return true; - } - - if (isMethodDefinition) { - return true; - } - - if (scope.type === "class" || scope.type === "module") { - return true; - } - - if (scope.type === "block" || scope.type === "switch") { - return false; - } - - if (scope.type === "function") { - if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { - return false; - } - - if (block.type === Syntax.Program) { - body = block; - } else { - body = block.body; - } - - if (!body) { - return false; - } - } else if (scope.type === "global") { - body = block; - } else { - return false; - } - - // Search 'use strict' directive. - if (useDirective) { - for (let i = 0, iz = body.body.length; i < iz; ++i) { - const stmt = body.body[i]; - - if (stmt.type !== Syntax.DirectiveStatement) { - break; - } - if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { - return true; - } - } - } else { - for (let i = 0, iz = body.body.length; i < iz; ++i) { - const stmt = body.body[i]; - - if (stmt.type !== Syntax.ExpressionStatement) { - break; - } - const expr = stmt.expression; - - if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { - break; - } - if (expr.raw !== null && expr.raw !== undefined) { - if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { - return true; - } - } else { - if (expr.value === "use strict") { - return true; - } - } - } - } - return false; -} - -/** - * Register scope - * @param {ScopeManager} scopeManager - scope manager - * @param {Scope} scope - scope - * @returns {void} - */ -function registerScope(scopeManager, scope) { - scopeManager.scopes.push(scope); - - const scopes = scopeManager.__nodeToScope.get(scope.block); - - if (scopes) { - scopes.push(scope); - } else { - scopeManager.__nodeToScope.set(scope.block, [scope]); - } -} - -/** - * Should be statically - * @param {Object} def - def - * @returns {boolean} should be statically - */ -function shouldBeStatically(def) { - return ( - (def.type === Variable.ClassName) || - (def.type === Variable.Variable && def.parent.kind !== "var") - ); -} - -/** - * @class Scope - */ -class Scope { - constructor(scopeManager, type, upperScope, block, isMethodDefinition) { - - /** - * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. - * @member {String} Scope#type - */ - this.type = type; - - /** - * The scoped {@link Variable}s of this scope, as { Variable.name - * : Variable }. - * @member {Map} Scope#set - */ - this.set = new Map(); - - /** - * The tainted variables of this scope, as { Variable.name : - * boolean }. - * @member {Map} Scope#taints */ - this.taints = new Map(); - - /** - * Generally, through the lexical scoping of JS you can always know - * which variable an identifier in the source code refers to. There are - * a few exceptions to this rule. With 'global' and 'with' scopes you - * can only decide at runtime which variable a reference refers to. - * Moreover, if 'eval()' is used in a scope, it might introduce new - * bindings in this or its parent scopes. - * All those scopes are considered 'dynamic'. - * @member {boolean} Scope#dynamic - */ - this.dynamic = this.type === "global" || this.type === "with"; - - /** - * A reference to the scope-defining syntax node. - * @member {espree.Node} Scope#block - */ - this.block = block; - - /** - * The {@link Reference|references} that are not resolved with this scope. - * @member {Reference[]} Scope#through - */ - this.through = []; - - /** - * The scoped {@link Variable}s of this scope. In the case of a - * 'function' scope this includes the automatic argument arguments as - * its first element, as well as all further formal arguments. - * @member {Variable[]} Scope#variables - */ - this.variables = []; - - /** - * Any variable {@link Reference|reference} found in this scope. This - * includes occurrences of local variables as well as variables from - * parent scopes (including the global scope). For local variables - * this also includes defining occurrences (like in a 'var' statement). - * In a 'function' scope this does not include the occurrences of the - * formal parameter in the parameter list. - * @member {Reference[]} Scope#references - */ - this.references = []; - - /** - * For 'global' and 'function' scopes, this is a self-reference. For - * other scope types this is the variableScope value of the - * parent scope. - * @member {Scope} Scope#variableScope - */ - this.variableScope = - (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; - - /** - * Whether this scope is created by a FunctionExpression. - * @member {boolean} Scope#functionExpressionScope - */ - this.functionExpressionScope = false; - - /** - * Whether this is a scope that contains an 'eval()' invocation. - * @member {boolean} Scope#directCallToEvalScope - */ - this.directCallToEvalScope = false; - - /** - * @member {boolean} Scope#thisFound - */ - this.thisFound = false; - - this.__left = []; - - /** - * Reference to the parent {@link Scope|scope}. - * @member {Scope} Scope#upper - */ - this.upper = upperScope; - - /** - * Whether 'use strict' is in effect in this scope. - * @member {boolean} Scope#isStrict - */ - this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); - - /** - * List of nested {@link Scope}s. - * @member {Scope[]} Scope#childScopes - */ - this.childScopes = []; - if (this.upper) { - this.upper.childScopes.push(this); - } - - this.__declaredVariables = scopeManager.__declaredVariables; - - registerScope(scopeManager, this); - } - - __shouldStaticallyClose(scopeManager) { - return (!this.dynamic || scopeManager.__isOptimistic()); - } - - __shouldStaticallyCloseForGlobal(ref) { - - // On global scope, let/const/class declarations should be resolved statically. - const name = ref.identifier.name; - - if (!this.set.has(name)) { - return false; - } - - const variable = this.set.get(name); - const defs = variable.defs; - - return defs.length > 0 && defs.every(shouldBeStatically); - } - - __staticCloseRef(ref) { - if (!this.__resolve(ref)) { - this.__delegateToUpperScope(ref); - } - } - - __dynamicCloseRef(ref) { - - // notify all names are through to global - let current = this; - - do { - current.through.push(ref); - current = current.upper; - } while (current); - } - - __globalCloseRef(ref) { - - // let/const/class declarations should be resolved statically. - // others should be resolved dynamically. - if (this.__shouldStaticallyCloseForGlobal(ref)) { - this.__staticCloseRef(ref); - } else { - this.__dynamicCloseRef(ref); - } - } - - __close(scopeManager) { - let closeRef; - - if (this.__shouldStaticallyClose(scopeManager)) { - closeRef = this.__staticCloseRef; - } else if (this.type !== "global") { - closeRef = this.__dynamicCloseRef; - } else { - closeRef = this.__globalCloseRef; - } - - // Try Resolving all references in this scope. - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - closeRef.call(this, ref); - } - this.__left = null; - - return this.upper; - } - - // To override by function scopes. - // References in default parameters isn't resolved to variables which are in their function body. - __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars - return true; - } - - __resolve(ref) { - const name = ref.identifier.name; - - if (!this.set.has(name)) { - return false; - } - const variable = this.set.get(name); - - if (!this.__isValidResolution(ref, variable)) { - return false; - } - variable.references.push(ref); - variable.stack = variable.stack && ref.from.variableScope === this.variableScope; - if (ref.tainted) { - variable.tainted = true; - this.taints.set(variable.name, true); - } - ref.resolved = variable; - - return true; - } - - __delegateToUpperScope(ref) { - if (this.upper) { - this.upper.__left.push(ref); - } - this.through.push(ref); - } - - __addDeclaredVariablesOfNode(variable, node) { - if (node === null || node === undefined) { - return; - } - - let variables = this.__declaredVariables.get(node); - - if (variables === null || variables === undefined) { - variables = []; - this.__declaredVariables.set(node, variables); - } - if (variables.indexOf(variable) === -1) { - variables.push(variable); - } - } - - __defineGeneric(name, set, variables, node, def) { - let variable; - - variable = set.get(name); - if (!variable) { - variable = new Variable(name, this); - set.set(name, variable); - variables.push(variable); - } - - if (def) { - variable.defs.push(def); - this.__addDeclaredVariablesOfNode(variable, def.node); - this.__addDeclaredVariablesOfNode(variable, def.parent); - } - if (node) { - variable.identifiers.push(node); - } - } - - __define(node, def) { - if (node && node.type === Syntax.Identifier) { - this.__defineGeneric( - node.name, - this.set, - this.variables, - node, - def - ); - } - } - - __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { - - // because Array element may be null - if (!node || node.type !== Syntax.Identifier) { - return; - } - - // Specially handle like `this`. - if (node.name === "super") { - return; - } - - const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); - - this.references.push(ref); - this.__left.push(ref); - } - - __detectEval() { - let current = this; - - this.directCallToEvalScope = true; - do { - current.dynamic = true; - current = current.upper; - } while (current); - } - - __detectThis() { - this.thisFound = true; - } - - __isClosed() { - return this.__left === null; - } - - /** - * returns resolved {Reference} - * @method Scope#resolve - * @param {Espree.Identifier} ident - identifier to be resolved. - * @returns {Reference} reference - */ - resolve(ident) { - let ref, i, iz; - - assert(this.__isClosed(), "Scope should be closed."); - assert(ident.type === Syntax.Identifier, "Target should be identifier."); - for (i = 0, iz = this.references.length; i < iz; ++i) { - ref = this.references[i]; - if (ref.identifier === ident) { - return ref; - } - } - return null; - } - - /** - * returns this scope is static - * @method Scope#isStatic - * @returns {boolean} static - */ - isStatic() { - return !this.dynamic; - } - - /** - * returns this scope has materialized arguments - * @method Scope#isArgumentsMaterialized - * @returns {boolean} arguemnts materialized - */ - isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this - return true; - } - - /** - * returns this scope has materialized `this` reference - * @method Scope#isThisMaterialized - * @returns {boolean} this materialized - */ - isThisMaterialized() { // eslint-disable-line class-methods-use-this - return true; - } - - isUsedName(name) { - if (this.set.has(name)) { - return true; - } - for (let i = 0, iz = this.through.length; i < iz; ++i) { - if (this.through[i].identifier.name === name) { - return true; - } - } - return false; - } -} - -class GlobalScope extends Scope { - constructor(scopeManager, block) { - super(scopeManager, "global", null, block, false); - this.implicit = { - set: new Map(), - variables: [], - - /** - * List of {@link Reference}s that are left to be resolved (i.e. which - * need to be linked to the variable they refer to). - * @member {Reference[]} Scope#implicit#left - */ - left: [] - }; - } - - __close(scopeManager) { - const implicit = []; - - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { - implicit.push(ref.__maybeImplicitGlobal); - } - } - - // create an implicit global variable from assignment expression - for (let i = 0, iz = implicit.length; i < iz; ++i) { - const info = implicit[i]; - - this.__defineImplicit(info.pattern, - new Definition( - Variable.ImplicitGlobalVariable, - info.pattern, - info.node, - null, - null, - null - )); - - } - - this.implicit.left = this.__left; - - return super.__close(scopeManager); - } - - __defineImplicit(node, def) { - if (node && node.type === Syntax.Identifier) { - this.__defineGeneric( - node.name, - this.implicit.set, - this.implicit.variables, - node, - def - ); - } - } -} - -class ModuleScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "module", upperScope, block, false); - } -} - -class FunctionExpressionNameScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "function-expression-name", upperScope, block, false); - this.__define(block.id, - new Definition( - Variable.FunctionName, - block.id, - block, - null, - null, - null - )); - this.functionExpressionScope = true; - } -} - -class CatchScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "catch", upperScope, block, false); - } -} - -class WithScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "with", upperScope, block, false); - } - - __close(scopeManager) { - if (this.__shouldStaticallyClose(scopeManager)) { - return super.__close(scopeManager); - } - - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - ref.tainted = true; - this.__delegateToUpperScope(ref); - } - this.__left = null; - - return this.upper; - } -} - -class BlockScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "block", upperScope, block, false); - } -} - -class SwitchScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "switch", upperScope, block, false); - } -} - -class FunctionScope extends Scope { - constructor(scopeManager, upperScope, block, isMethodDefinition) { - super(scopeManager, "function", upperScope, block, isMethodDefinition); - - // section 9.2.13, FunctionDeclarationInstantiation. - // NOTE Arrow functions never have an arguments objects. - if (this.block.type !== Syntax.ArrowFunctionExpression) { - this.__defineArguments(); - } - } - - isArgumentsMaterialized() { - - // TODO(Constellation) - // We can more aggressive on this condition like this. - // - // function t() { - // // arguments of t is always hidden. - // function arguments() { - // } - // } - if (this.block.type === Syntax.ArrowFunctionExpression) { - return false; - } - - if (!this.isStatic()) { - return true; - } - - const variable = this.set.get("arguments"); - - assert(variable, "Always have arguments variable."); - return variable.tainted || variable.references.length !== 0; - } - - isThisMaterialized() { - if (!this.isStatic()) { - return true; - } - return this.thisFound; - } - - __defineArguments() { - this.__defineGeneric( - "arguments", - this.set, - this.variables, - null, - null - ); - this.taints.set("arguments", true); - } - - // References in default parameters isn't resolved to variables which are in their function body. - // const x = 1 - // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. - // const x = 2 - // console.log(a) - // } - __isValidResolution(ref, variable) { - - // If `options.nodejsScope` is true, `this.block` becomes a Program node. - if (this.block.type === "Program") { - return true; - } - - const bodyStart = this.block.body.range[0]; - - // It's invalid resolution in the following case: - return !( - variable.scope === this && - ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. - variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. - ); - } -} - -class ForScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "for", upperScope, block, false); - } -} - -class ClassScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "class", upperScope, block, false); - } -} - -module.exports = { - Scope, - GlobalScope, - ModuleScope, - FunctionExpressionNameScope, - CatchScope, - WithScope, - BlockScope, - SwitchScope, - FunctionScope, - ForScope, - ClassScope -}; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/variable.js b/node_modules/eslint-scope/lib/variable.js deleted file mode 100644 index 702c478..0000000 --- a/node_modules/eslint-scope/lib/variable.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -"use strict"; - -/** - * A Variable represents a locally scoped identifier. These include arguments to - * functions. - * @class Variable - */ -class Variable { - constructor(name, scope) { - - /** - * The variable name, as given in the source code. - * @member {String} Variable#name - */ - this.name = name; - - /** - * List of defining occurrences of this variable (like in 'var ...' - * statements or as parameter), as AST nodes. - * @member {espree.Identifier[]} Variable#identifiers - */ - this.identifiers = []; - - /** - * List of {@link Reference|references} of this variable (excluding parameter entries) - * in its defining scope and all nested scopes. For defining - * occurrences only see {@link Variable#defs}. - * @member {Reference[]} Variable#references - */ - this.references = []; - - /** - * List of defining occurrences of this variable (like in 'var ...' - * statements or as parameter), as custom objects. - * @member {Definition[]} Variable#defs - */ - this.defs = []; - - this.tainted = false; - - /** - * Whether this is a stack variable. - * @member {boolean} Variable#stack - */ - this.stack = true; - - /** - * Reference to the enclosing Scope. - * @member {Scope} Variable#scope - */ - this.scope = scope; - } -} - -Variable.CatchClause = "CatchClause"; -Variable.Parameter = "Parameter"; -Variable.FunctionName = "FunctionName"; -Variable.ClassName = "ClassName"; -Variable.Variable = "Variable"; -Variable.ImportBinding = "ImportBinding"; -Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; - -module.exports = Variable; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/package.json b/node_modules/eslint-scope/package.json deleted file mode 100644 index b700b92..0000000 --- a/node_modules/eslint-scope/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "eslint-scope", - "description": "ECMAScript scope analyzer for ESLint", - "homepage": "http://github.com/eslint/eslint-scope", - "main": "lib/index.js", - "version": "5.1.1", - "engines": { - "node": ">=8.0.0" - }, - "repository": "eslint/eslint-scope", - "bugs": { - "url": "https://github.com/eslint/eslint-scope/issues" - }, - "license": "BSD-2-Clause", - "scripts": { - "test": "node Makefile.js test", - "lint": "node Makefile.js lint", - "generate-release": "eslint-generate-release", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "publish-release": "eslint-publish-release" - }, - "files": [ - "LICENSE", - "README.md", - "lib" - ], - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "devDependencies": { - "@typescript-eslint/parser": "^1.11.0", - "chai": "^4.2.0", - "eslint": "^6.0.1", - "eslint-config-eslint": "^5.0.1", - "eslint-plugin-node": "^9.1.0", - "eslint-release": "^1.0.0", - "eslint-visitor-keys": "^1.2.0", - "espree": "^7.1.0", - "istanbul": "^0.4.5", - "mocha": "^6.1.4", - "npm-license": "^0.3.3", - "shelljs": "^0.8.3", - "typescript": "^3.5.2" - } -} diff --git a/node_modules/esrecurse/.babelrc b/node_modules/esrecurse/.babelrc deleted file mode 100644 index a0765e1..0000000 --- a/node_modules/esrecurse/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015"] -} diff --git a/node_modules/esrecurse/README.md b/node_modules/esrecurse/README.md deleted file mode 100644 index ffea6b4..0000000 --- a/node_modules/esrecurse/README.md +++ /dev/null @@ -1,171 +0,0 @@ -### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) - -Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is -[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) -recursive traversing functionality. - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -esrecurse.visit(ast, { - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); -``` - -We can use `Visitor` instance. - -```javascript -var visitor = new esrecurse.Visitor({ - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); - -visitor.visit(ast); -``` - -We can inherit `Visitor` instance easily. - -```javascript -class Derived extends esrecurse.Visitor { - constructor() - { - super(null); - } - - XXXStatement(node) { - } -} -``` - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); -}; -``` - -And you can invoke default visiting operation inside custom visit operation. - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - // do something... - this.visitChildren(node); -}; -``` - -The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. -We can use user-defined node types. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - // Extending the existing traversing rules. - childVisitorKeys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } - } -); -``` - -We can use the `fallback` option as well. -If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. -Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). - -```javascript -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - fallback: 'iteration' - } -); -``` - -If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. -Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). - -```javascript -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - fallback: function (node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument' - }); - } - } -); -``` - -### License - -Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) - (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esrecurse/esrecurse.js b/node_modules/esrecurse/esrecurse.js deleted file mode 100644 index 15d57df..0000000 --- a/node_modules/esrecurse/esrecurse.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -(function () { - 'use strict'; - - var estraverse = require('estraverse'); - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; - } - - function Visitor(visitor, options) { - options = options || {}; - - this.__visitor = visitor || this; - this.__childVisitorKeys = options.childVisitorKeys - ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) - : estraverse.VisitorKeys; - if (options.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof options.fallback === 'function') { - this.__fallback = options.fallback; - } - } - - /* Default method for visiting children. - * When you need to call default visiting operation inside custom visiting - * operation, you can use it with `this.visitChildren(node)`. - */ - Visitor.prototype.visitChildren = function (node) { - var type, children, i, iz, j, jz, child; - - if (node == null) { - return; - } - - type = node.type || estraverse.Syntax.Property; - - children = this.__childVisitorKeys[type]; - if (!children) { - if (this.__fallback) { - children = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + type + '.'); - } - } - - for (i = 0, iz = children.length; i < iz; ++i) { - child = node[children[i]]; - if (child) { - if (Array.isArray(child)) { - for (j = 0, jz = child.length; j < jz; ++j) { - if (child[j]) { - if (isNode(child[j]) || isProperty(type, children[i])) { - this.visit(child[j]); - } - } - } - } else if (isNode(child)) { - this.visit(child); - } - } - } - }; - - /* Dispatching node. */ - Visitor.prototype.visit = function (node) { - var type; - - if (node == null) { - return; - } - - type = node.type || estraverse.Syntax.Property; - if (this.__visitor[type]) { - this.__visitor[type].call(this, node); - return; - } - this.visitChildren(node); - }; - - exports.version = require('./package.json').version; - exports.Visitor = Visitor; - exports.visit = function (node, visitor, options) { - var v = new Visitor(visitor, options); - v.visit(node); - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esrecurse/gulpfile.babel.js b/node_modules/esrecurse/gulpfile.babel.js deleted file mode 100644 index aa881c9..0000000 --- a/node_modules/esrecurse/gulpfile.babel.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (C) 2014 Yusuke Suzuki -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import gulp from 'gulp'; -import mocha from 'gulp-mocha'; -import eslint from 'gulp-eslint'; -import minimist from 'minimist'; -import git from 'gulp-git'; -import bump from 'gulp-bump'; -import filter from 'gulp-filter'; -import tagVersion from 'gulp-tag-version'; -import 'babel-register'; - -const SOURCE = [ - '*.js' -]; - -let ESLINT_OPTION = { - parser: 'babel-eslint', - parserOptions: { - 'sourceType': 'module' - }, - rules: { - 'quotes': 0, - 'eqeqeq': 0, - 'no-use-before-define': 0, - 'no-shadow': 0, - 'no-new': 0, - 'no-underscore-dangle': 0, - 'no-multi-spaces': 0, - 'no-native-reassign': 0, - 'no-loop-func': 0 - }, - env: { - 'node': true - } -}; - -gulp.task('test', function() { - let options = minimist(process.argv.slice(2), { - string: 'test', - default: { - test: 'test/*.js' - } - } - ); - return gulp.src(options.test).pipe(mocha({reporter: 'spec'})); -}); - -gulp.task('lint', () => - gulp.src(SOURCE) - .pipe(eslint(ESLINT_OPTION)) - .pipe(eslint.formatEach('stylish', process.stderr)) - .pipe(eslint.failOnError()) -); - -let inc = importance => - gulp.src(['./package.json']) - .pipe(bump({type: importance})) - .pipe(gulp.dest('./')) - .pipe(git.commit('Bumps package version')) - .pipe(filter('package.json')) - .pipe(tagVersion({ - prefix: '' - })) -; - -gulp.task('travis', [ 'lint', 'test' ]); -gulp.task('default', [ 'travis' ]); - -gulp.task('patch', [ ], () => inc('patch')); -gulp.task('minor', [ ], () => inc('minor')); -gulp.task('major', [ ], () => inc('major')); diff --git a/node_modules/esrecurse/node_modules/estraverse/.jshintrc b/node_modules/esrecurse/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae..0000000 --- a/node_modules/esrecurse/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD b/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD deleted file mode 100644 index 3e580c3..0000000 --- a/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD +++ /dev/null @@ -1,19 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esrecurse/node_modules/estraverse/README.md b/node_modules/esrecurse/node_modules/estraverse/README.md deleted file mode 100644 index ccd3377..0000000 --- a/node_modules/esrecurse/node_modules/estraverse/README.md +++ /dev/null @@ -1,153 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -When `visitor.fallback` is a function, we can determine which keys to visit on each node. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Skip the `argument` property of each node - fallback: function(node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument'; - }); - } -}); -``` - -### License - -Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esrecurse/node_modules/estraverse/estraverse.js b/node_modules/esrecurse/node_modules/estraverse/estraverse.js deleted file mode 100644 index f0d9af9..0000000 --- a/node_modules/esrecurse/node_modules/estraverse/estraverse.js +++ /dev/null @@ -1,805 +0,0 @@ -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ChainExpression: 'ChainExpression', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - PrivateIdentifier: 'PrivateIdentifier', - Program: 'Program', - Property: 'Property', - PropertyDefinition: 'PropertyDefinition', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ChainExpression: ['expression'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - PrivateIdentifier: [], - Program: ['body'], - Property: ['key', 'value'], - PropertyDefinition: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - function candidateExistsInLeaveList(leavelist, candidate) { - for (var i = leavelist.length - 1; i >= 0; --i) { - if (leavelist[i].node === candidate) { - return true; - } - } - return false; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - - if (candidateExistsInLeaveList(leavelist, candidate[current2])) { - continue; - } - - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - if (candidateExistsInLeaveList(leavelist, candidate)) { - continue; - } - - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esrecurse/node_modules/estraverse/gulpfile.js b/node_modules/esrecurse/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbc..0000000 --- a/node_modules/esrecurse/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/node_modules/esrecurse/node_modules/estraverse/package.json b/node_modules/esrecurse/node_modules/estraverse/package.json deleted file mode 100644 index a863218..0000000 --- a/node_modules/esrecurse/node_modules/estraverse/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "5.3.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/estraverse.git" - }, - "devDependencies": { - "babel-preset-env": "^1.6.1", - "babel-register": "^6.3.13", - "chai": "^2.1.1", - "espree": "^1.11.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.2.2", - "gulp-filter": "^2.0.0", - "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.3.0", - "jshint": "^2.5.6", - "mocha": "^2.1.0" - }, - "license": "BSD-2-Clause", - "scripts": { - "test": "npm run-script lint && npm run-script unit-test", - "lint": "jshint estraverse.js", - "unit-test": "mocha --compilers js:babel-register" - } -} diff --git a/node_modules/esrecurse/package.json b/node_modules/esrecurse/package.json deleted file mode 100644 index dec5b1b..0000000 --- a/node_modules/esrecurse/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "esrecurse", - "description": "ECMAScript AST recursive visitor", - "homepage": "https://github.com/estools/esrecurse", - "main": "esrecurse.js", - "version": "4.3.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "https://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/estools/esrecurse.git" - }, - "dependencies": { - "estraverse": "^5.2.0" - }, - "devDependencies": { - "babel-cli": "^6.24.1", - "babel-eslint": "^7.2.3", - "babel-preset-es2015": "^6.24.1", - "babel-register": "^6.24.1", - "chai": "^4.0.2", - "esprima": "^4.0.0", - "gulp": "^3.9.0", - "gulp-bump": "^2.7.0", - "gulp-eslint": "^4.0.0", - "gulp-filter": "^5.0.0", - "gulp-git": "^2.4.1", - "gulp-mocha": "^4.3.1", - "gulp-tag-version": "^1.2.1", - "jsdoc": "^3.3.0-alpha10", - "minimist": "^1.1.0" - }, - "license": "BSD-2-Clause", - "scripts": { - "test": "gulp travis", - "unit-test": "gulp test", - "lint": "gulp lint" - }, - "babel": { - "presets": [ - "es2015" - ] - } -} diff --git a/node_modules/estraverse/.jshintrc b/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae..0000000 --- a/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/node_modules/estraverse/LICENSE.BSD b/node_modules/estraverse/LICENSE.BSD deleted file mode 100644 index 3e580c3..0000000 --- a/node_modules/estraverse/LICENSE.BSD +++ /dev/null @@ -1,19 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/estraverse/README.md b/node_modules/estraverse/README.md deleted file mode 100644 index ccd3377..0000000 --- a/node_modules/estraverse/README.md +++ /dev/null @@ -1,153 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -When `visitor.fallback` is a function, we can determine which keys to visit on each node. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Skip the `argument` property of each node - fallback: function(node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument'; - }); - } -}); -``` - -### License - -Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/estraverse/estraverse.js b/node_modules/estraverse/estraverse.js deleted file mode 100644 index b106d38..0000000 --- a/node_modules/estraverse/estraverse.js +++ /dev/null @@ -1,782 +0,0 @@ -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - Program: ['body'], - Property: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.version = require('./package.json').version; - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/estraverse/gulpfile.js b/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbc..0000000 --- a/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/node_modules/estraverse/package.json b/node_modules/estraverse/package.json deleted file mode 100644 index 1138238..0000000 --- a/node_modules/estraverse/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "4.3.0", - "engines": { - "node": ">=4.0" - }, - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/estools/estraverse.git" - }, - "devDependencies": { - "babel-preset-env": "^1.6.1", - "babel-register": "^6.3.13", - "chai": "^2.1.1", - "espree": "^1.11.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.2.2", - "gulp-filter": "^2.0.0", - "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.3.0", - "jshint": "^2.5.6", - "mocha": "^2.1.0" - }, - "license": "BSD-2-Clause", - "scripts": { - "test": "npm run-script lint && npm run-script unit-test", - "lint": "jshint estraverse.js", - "unit-test": "mocha --compilers js:babel-register" - } -} diff --git a/node_modules/events/.airtap.yml b/node_modules/events/.airtap.yml deleted file mode 100644 index c7a8a87..0000000 --- a/node_modules/events/.airtap.yml +++ /dev/null @@ -1,15 +0,0 @@ -sauce_connect: true -loopback: airtap.local -browsers: - - name: chrome - version: latest - - name: firefox - version: latest - - name: safari - version: 9..latest - - name: iphone - version: latest - - name: ie - version: 9..latest - - name: microsoftedge - version: 13..latest diff --git a/node_modules/events/.github/FUNDING.yml b/node_modules/events/.github/FUNDING.yml deleted file mode 100644 index 8b8cb78..0000000 --- a/node_modules/events/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/events -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/events/.travis.yml b/node_modules/events/.travis.yml deleted file mode 100644 index 486dc3c..0000000 --- a/node_modules/events/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -dist: xenial -os: linux -language: node_js -node_js: - - 'stable' - - 'lts/*' - - '0.12' -script: - - npm test - - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_NODE_VERSION}" = "stable" ]; then npm run test:browsers; fi -addons: - sauce_connect: true - hosts: - - airtap.local -env: - global: - - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= - - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/events/History.md b/node_modules/events/History.md deleted file mode 100644 index f48bf21..0000000 --- a/node_modules/events/History.md +++ /dev/null @@ -1,118 +0,0 @@ -# 3.3.0 - - - Support EventTarget emitters in `events.once` from Node.js 12.11.0. - - Now you can use the `events.once` function with objects that implement the EventTarget interface. This interface is used widely in - the DOM and other web APIs. - - ```js - var events = require('events'); - var assert = require('assert'); - - async function connect() { - var ws = new WebSocket('wss://example.com'); - await events.once(ws, 'open'); - assert(ws.readyState === WebSocket.OPEN); - } - - async function onClick() { - await events.once(document.body, 'click'); - alert('you clicked the page!'); - } - ``` - -# 3.2.0 - - - Add `events.once` from Node.js 11.13.0. - - To use this function, Promises must be supported in the environment. Use a polyfill like `es6-promise` if you support older browsers. - -# 3.1.0 (2020-01-08) - -`events` now matches the Node.js 11.12.0 API. - - - pass through return value in wrapped `emitter.once()` listeners - - Now, this works: - ```js - emitter.once('myevent', function () { return 1; }); - var listener = emitter.rawListeners('myevent')[0] - assert(listener() === 1); - ``` - Previously, `listener()` would return undefined regardless of the implementation. - - Ported from https://github.com/nodejs/node/commit/acc506c2d2771dab8d7bba6d3452bc5180dff7cf - - - Reduce code duplication in listener type check ([#67](https://github.com/Gozala/events/pull/67) by [@friederbluemle](https://github.com/friederbluemle)). - - Improve `emitter.once()` performance in some engines - -# 3.0.0 (2018-05-25) - -**This version drops support for IE8.** `events` no longer includes polyfills -for ES5 features. If you need to support older environments, use an ES5 shim -like [es5-shim](https://npmjs.com/package/es5-shim). Both the shim and sham -versions of es5-shim are necessary. - - - Update to events code from Node.js 10.x - - (semver major) Adds `off()` method - - Port more tests from Node.js - - Switch browser tests to airtap, making things more reliable - -# 2.1.0 (2018-05-25) - - - add Emitter#rawListeners from Node.js v9.4 - -# 2.0.0 (2018-02-02) - - - Update to events code from node.js 8.x - - Adds `prependListener()` and `prependOnceListener()` - - Adds `eventNames()` method - - (semver major) Unwrap `once()` listeners in `listeners()` - - copy tests from node.js - -Note that this version doubles the gzipped size, jumping from 1.1KB to 2.1KB, -due to new methods and runtime performance improvements. Be aware of that when -upgrading. - -# 1.1.1 (2016-06-22) - - - add more context to errors if they are not instanceof Error - -# 1.1.0 (2015-09-29) - - - add Emitter#listerCount (to match node v4 api) - -# 1.0.2 (2014-08-28) - - - remove un-reachable code - - update devDeps - -## 1.0.1 / 2014-05-11 - - - check for console.trace before using it - -## 1.0.0 / 2013-12-10 - - - Update to latest events code from node.js 0.10 - - copy tests from node.js - -## 0.4.0 / 2011-07-03 ## - - - Switching to graphquire@0.8.0 - -## 0.3.0 / 2011-07-03 ## - - - Switching to URL based module require. - -## 0.2.0 / 2011-06-10 ## - - - Simplified package structure. - - Graphquire for dependency management. - -## 0.1.1 / 2011-05-16 ## - - - Unhandled errors are logged via console.error - -## 0.1.0 / 2011-04-22 ## - - - Initial release diff --git a/node_modules/events/LICENSE b/node_modules/events/LICENSE deleted file mode 100644 index 52ed3b0..0000000 --- a/node_modules/events/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT - -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/events/Readme.md b/node_modules/events/Readme.md deleted file mode 100644 index 80849c0..0000000 --- a/node_modules/events/Readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) - -> Node's event emitter for all engines. - -This implements the Node.js [`events`][node.js docs] module for environments that do not have it, like browsers. - -> `events` currently matches the **Node.js 11.13.0** API. - -Note that the `events` module uses ES5 features. If you need to support very old browsers like IE8, use a shim like [`es5-shim`](https://www.npmjs.com/package/es5-shim). You need both the shim and the sham versions of `es5-shim`. - -This module is maintained, but only by very few people. If you'd like to help, let us know in the [Maintainer Needed](https://github.com/Gozala/events/issues/43) issue! - -## Install - -You usually do not have to install `events` yourself! If your code runs in Node.js, `events` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `events` module. - -But if none of those apply, with npm do: - -``` -npm install events -``` - -## Usage - -```javascript -var EventEmitter = require('events') - -var ee = new EventEmitter() -ee.on('message', function (text) { - console.log(text) -}) -ee.emit('message', 'hello world') -``` - -## API - -See the [Node.js EventEmitter docs][node.js docs]. `events` currently matches the Node.js 11.13.0 API. - -## Contributing - -PRs are very welcome! The main way to contribute to `events` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js. -This module intends to provide exactly the same API as Node.js, so features that are not available in the core `events` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js. - -If there is a difference in behaviour between Node.js's `events` module and this module, please open an issue! - -## License - -[MIT](./LICENSE) - -[node.js docs]: https://nodejs.org/dist/v11.13.0/docs/api/events.html diff --git a/node_modules/events/events.js b/node_modules/events/events.js deleted file mode 100644 index 34b69a0..0000000 --- a/node_modules/events/events.js +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -var R = typeof Reflect === 'object' ? Reflect : null -var ReflectApply = R && typeof R.apply === 'function' - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - } - -var ReflectOwnKeys -if (R && typeof R.ownKeys === 'function') { - ReflectOwnKeys = R.ownKeys -} else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target) - .concat(Object.getOwnPropertySymbols(target)); - }; -} else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; -} - -function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); -} - -var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { - return value !== value; -} - -function EventEmitter() { - EventEmitter.init.call(this); -} -module.exports = EventEmitter; -module.exports.once = once; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._eventsCount = 0; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -var defaultMaxListeners = 10; - -function checkListener(listener) { - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } -} - -Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); - } - defaultMaxListeners = arg; - } -}); - -EventEmitter.init = function() { - - if (this._events === undefined || - this._events === Object.getPrototypeOf(this)._events) { - this._events = Object.create(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; -}; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); - } - this._maxListeners = n; - return this; -}; - -function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} - -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); -}; - -EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = (type === 'error'); - - var events = this._events; - if (events !== undefined) - doError = (doError && events.error === undefined); - else if (!doError) - return false; - - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) - er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event - } - // At least give some kind of context to the user - var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); - err.context = er; - throw err; // Unhandled 'error' event - } - - var handler = events[type]; - - if (handler === undefined) - return false; - - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); - } - - return true; -}; - -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - checkListener(listener); - - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + String(type) + ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } - - return target; -} - -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) - return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); - } -} - -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} - -EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; -}; - -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - checkListener(listener); - - events = this._events; - if (events === undefined) - return this; - - list = events[type]; - if (list === undefined) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } - - if (list.length === 1) - events[type] = list[0]; - - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (events === undefined) - return this; - - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - -function _listeners(target, type, unwrap) { - var events = target._events; - - if (events === undefined) - return []; - - var evlistener = events[type]; - if (evlistener === undefined) - return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap ? - unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} - -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; - -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; - -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } -}; - -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; - - if (events !== undefined) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; - } - } - - return 0; -} - -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; -}; - -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} - -function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); -} - -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; -} - -function once(emitter, name) { - return new Promise(function (resolve, reject) { - function errorListener(err) { - emitter.removeListener(name, resolver); - reject(err); - } - - function resolver() { - if (typeof emitter.removeListener === 'function') { - emitter.removeListener('error', errorListener); - } - resolve([].slice.call(arguments)); - }; - - eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); - if (name !== 'error') { - addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); - } - }); -} - -function addErrorHandlerIfEventEmitter(emitter, handler, flags) { - if (typeof emitter.on === 'function') { - eventTargetAgnosticAddListener(emitter, 'error', handler, flags); - } -} - -function eventTargetAgnosticAddListener(emitter, name, listener, flags) { - if (typeof emitter.on === 'function') { - if (flags.once) { - emitter.once(name, listener); - } else { - emitter.on(name, listener); - } - } else if (typeof emitter.addEventListener === 'function') { - // EventTarget does not have `error` event semantics like Node - // EventEmitters, we do not listen for `error` events here. - emitter.addEventListener(name, function wrapListener(arg) { - // IE does not have builtin `{ once: true }` support so we - // have to do it manually. - if (flags.once) { - emitter.removeEventListener(name, wrapListener); - } - listener(arg); - }); - } else { - throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); - } -} diff --git a/node_modules/events/package.json b/node_modules/events/package.json deleted file mode 100644 index b9580d8..0000000 --- a/node_modules/events/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "events", - "version": "3.3.0", - "description": "Node's event emitter for all engines.", - "keywords": [ - "events", - "eventEmitter", - "eventDispatcher", - "listeners" - ], - "author": "Irakli Gozalishvili (http://jeditoolkit.com)", - "repository": { - "type": "git", - "url": "git://github.com/Gozala/events.git", - "web": "https://github.com/Gozala/events" - }, - "bugs": { - "url": "http://github.com/Gozala/events/issues/" - }, - "main": "./events.js", - "engines": { - "node": ">=0.8.x" - }, - "devDependencies": { - "airtap": "^1.0.0", - "functions-have-names": "^1.2.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "isarray": "^2.0.5", - "tape": "^5.0.0" - }, - "scripts": { - "test": "node tests/index.js", - "test:browsers": "airtap -- tests/index.js" - }, - "license": "MIT" -} diff --git a/node_modules/events/security.md b/node_modules/events/security.md deleted file mode 100644 index a14ace6..0000000 --- a/node_modules/events/security.md +++ /dev/null @@ -1,10 +0,0 @@ -# Security Policy - -## Supported Versions -Only the latest major version is supported at any given time. - -## Reporting a Vulnerability - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. diff --git a/node_modules/events/tests/add-listeners.js b/node_modules/events/tests/add-listeners.js deleted file mode 100644 index 9b57827..0000000 --- a/node_modules/events/tests/add-listeners.js +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('./common'); -var assert = require('assert'); -var EventEmitter = require('../'); - -{ - var ee = new EventEmitter(); - var events_new_listener_emitted = []; - var listeners_new_listener_emitted = []; - - // Sanity check - assert.strictEqual(ee.addListener, ee.on); - - ee.on('newListener', function(event, listener) { - // Don't track newListener listeners. - if (event === 'newListener') - return; - - events_new_listener_emitted.push(event); - listeners_new_listener_emitted.push(listener); - }); - - var hello = common.mustCall(function(a, b) { - assert.strictEqual('a', a); - assert.strictEqual('b', b); - }); - - ee.once('newListener', function(name, listener) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(listener, hello); - - var listeners = this.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - }); - - ee.on('hello', hello); - ee.once('foo', assert.fail); - - assert.ok(Array.isArray(events_new_listener_emitted)); - assert.strictEqual(events_new_listener_emitted.length, 2); - assert.strictEqual(events_new_listener_emitted[0], 'hello'); - assert.strictEqual(events_new_listener_emitted[1], 'foo'); - - assert.ok(Array.isArray(listeners_new_listener_emitted)); - assert.strictEqual(listeners_new_listener_emitted.length, 2); - assert.strictEqual(listeners_new_listener_emitted[0], hello); - assert.strictEqual(listeners_new_listener_emitted[1], assert.fail); - - ee.emit('hello', 'a', 'b'); -} - -// just make sure that this doesn't throw: -{ - var f = new EventEmitter(); - - f.setMaxListeners(0); -} - -{ - var listen1 = function() {}; - var listen2 = function() {}; - var ee = new EventEmitter(); - - ee.once('newListener', function() { - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - ee.once('newListener', function() { - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - }); - ee.on('hello', listen2); - }); - ee.on('hello', listen1); - // The order of listeners on an event is not always the order in which the - // listeners were added. - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 2); - assert.strictEqual(listeners[0], listen2); - assert.strictEqual(listeners[1], listen1); -} - -// Verify that the listener must be a function -assert.throws(function() { - var ee = new EventEmitter(); - - ee.on('foo', null); -}, /^TypeError: The "listener" argument must be of type Function. Received type object$/); diff --git a/node_modules/events/tests/check-listener-leaks.js b/node_modules/events/tests/check-listener-leaks.js deleted file mode 100644 index 7fce48f..0000000 --- a/node_modules/events/tests/check-listener-leaks.js +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('./common'); -var assert = require('assert'); -var events = require('../'); - -// Redirect warning output to tape. -var consoleWarn = console.warn; -console.warn = common.test.comment; - -common.test.on('end', function () { - console.warn = consoleWarn; -}); - -// default -{ - var e = new events.EventEmitter(); - - for (var i = 0; i < 10; i++) { - e.on('default', common.mustNotCall()); - } - assert.ok(!e._events['default'].hasOwnProperty('warned')); - e.on('default', common.mustNotCall()); - assert.ok(e._events['default'].warned); - - // specific - e.setMaxListeners(5); - for (var i = 0; i < 5; i++) { - e.on('specific', common.mustNotCall()); - } - assert.ok(!e._events['specific'].hasOwnProperty('warned')); - e.on('specific', common.mustNotCall()); - assert.ok(e._events['specific'].warned); - - // only one - e.setMaxListeners(1); - e.on('only one', common.mustNotCall()); - assert.ok(!e._events['only one'].hasOwnProperty('warned')); - e.on('only one', common.mustNotCall()); - assert.ok(e._events['only one'].hasOwnProperty('warned')); - - // unlimited - e.setMaxListeners(0); - for (var i = 0; i < 1000; i++) { - e.on('unlimited', common.mustNotCall()); - } - assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); -} - -// process-wide -{ - events.EventEmitter.defaultMaxListeners = 42; - var e = new events.EventEmitter(); - - for (var i = 0; i < 42; ++i) { - e.on('fortytwo', common.mustNotCall()); - } - assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); - e.on('fortytwo', common.mustNotCall()); - assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); - delete e._events['fortytwo'].warned; - - events.EventEmitter.defaultMaxListeners = 44; - e.on('fortytwo', common.mustNotCall()); - assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); - e.on('fortytwo', common.mustNotCall()); - assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); -} - -// but _maxListeners still has precedence over defaultMaxListeners -{ - events.EventEmitter.defaultMaxListeners = 42; - var e = new events.EventEmitter(); - e.setMaxListeners(1); - e.on('uno', common.mustNotCall()); - assert.ok(!e._events['uno'].hasOwnProperty('warned')); - e.on('uno', common.mustNotCall()); - assert.ok(e._events['uno'].hasOwnProperty('warned')); - - // chainable - assert.strictEqual(e, e.setMaxListeners(1)); -} diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js deleted file mode 100644 index 49569b0..0000000 --- a/node_modules/events/tests/common.js +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var test = require('tape'); -var assert = require('assert'); - -var noop = function() {}; - -var mustCallChecks = []; - -function runCallChecks(exitCode) { - if (exitCode !== 0) return; - - var failed = filter(mustCallChecks, function(context) { - if ('minimum' in context) { - context.messageSegment = 'at least ' + context.minimum; - return context.actual < context.minimum; - } else { - context.messageSegment = 'exactly ' + context.exact; - return context.actual !== context.exact; - } - }); - - for (var i = 0; i < failed.length; i++) { - var context = failed[i]; - console.log('Mismatched %s function calls. Expected %s, actual %d.', - context.name, - context.messageSegment, - context.actual); - // IE8 has no .stack - if (context.stack) console.log(context.stack.split('\n').slice(2).join('\n')); - } - - assert.strictEqual(failed.length, 0); -} - -exports.mustCall = function(fn, exact) { - return _mustCallInner(fn, exact, 'exact'); -}; - -function _mustCallInner(fn, criteria, field) { - if (typeof criteria == 'undefined') criteria = 1; - - if (typeof fn === 'number') { - criteria = fn; - fn = noop; - } else if (fn === undefined) { - fn = noop; - } - - if (typeof criteria !== 'number') - throw new TypeError('Invalid ' + field + ' value: ' + criteria); - - var context = { - actual: 0, - stack: (new Error()).stack, - name: fn.name || '' - }; - - context[field] = criteria; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) test.onFinish(function() { runCallChecks(0); }); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -} - -exports.mustNotCall = function(msg) { - return function mustNotCall() { - assert.fail(msg || 'function should not have been called'); - }; -}; - -function filter(arr, fn) { - if (arr.filter) return arr.filter(fn); - var filtered = []; - for (var i = 0; i < arr.length; i++) { - if (fn(arr[i], i, arr)) filtered.push(arr[i]); - } - return filtered -} diff --git a/node_modules/events/tests/errors.js b/node_modules/events/tests/errors.js deleted file mode 100644 index a23df43..0000000 --- a/node_modules/events/tests/errors.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -var assert = require('assert'); -var EventEmitter = require('../'); - -var EE = new EventEmitter(); - -assert.throws(function () { - EE.emit('error', 'Accepts a string'); -}, 'Error: Unhandled error. (Accepts a string)'); - -assert.throws(function () { - EE.emit('error', { message: 'Error!' }); -}, 'Unhandled error. ([object Object])'); diff --git a/node_modules/events/tests/events-list.js b/node_modules/events/tests/events-list.js deleted file mode 100644 index 08aa621..0000000 --- a/node_modules/events/tests/events-list.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var EventEmitter = require('../'); -var assert = require('assert'); - -var EE = new EventEmitter(); -var m = function() {}; -EE.on('foo', function() {}); -assert.equal(1, EE.eventNames().length); -assert.equal('foo', EE.eventNames()[0]); -EE.on('bar', m); -assert.equal(2, EE.eventNames().length); -assert.equal('foo', EE.eventNames()[0]); -assert.equal('bar', EE.eventNames()[1]); -EE.removeListener('bar', m); -assert.equal(1, EE.eventNames().length); -assert.equal('foo', EE.eventNames()[0]); - -if (typeof Symbol !== 'undefined') { - var s = Symbol('s'); - EE.on(s, m); - assert.equal(2, EE.eventNames().length); - assert.equal('foo', EE.eventNames()[0]); - assert.equal(s, EE.eventNames()[1]); - EE.removeListener(s, m); - assert.equal(1, EE.eventNames().length); - assert.equal('foo', EE.eventNames()[0]); -} diff --git a/node_modules/events/tests/events-once.js b/node_modules/events/tests/events-once.js deleted file mode 100644 index dae8649..0000000 --- a/node_modules/events/tests/events-once.js +++ /dev/null @@ -1,234 +0,0 @@ -'use strict'; - -var common = require('./common'); -var EventEmitter = require('../').EventEmitter; -var once = require('../').once; -var has = require('has'); -var assert = require('assert'); - -function Event(type) { - this.type = type; -} - -function EventTargetMock() { - this.events = {}; - - this.addEventListener = common.mustCall(this.addEventListener); - this.removeEventListener = common.mustCall(this.removeEventListener); -} - -EventTargetMock.prototype.addEventListener = function addEventListener(name, listener, options) { - if (!(name in this.events)) { - this.events[name] = { listeners: [], options: options || {} } - } - this.events[name].listeners.push(listener); -}; - -EventTargetMock.prototype.removeEventListener = function removeEventListener(name, callback) { - if (!(name in this.events)) { - return; - } - var event = this.events[name]; - var stack = event.listeners; - - for (var i = 0, l = stack.length; i < l; i++) { - if (stack[i] === callback) { - stack.splice(i, 1); - if (stack.length === 0) { - delete this.events[name]; - } - return; - } - } -}; - -EventTargetMock.prototype.dispatchEvent = function dispatchEvent(arg) { - if (!(arg.type in this.events)) { - return true; - } - - var event = this.events[arg.type]; - var stack = event.listeners.slice(); - - for (var i = 0, l = stack.length; i < l; i++) { - stack[i].call(null, arg); - if (event.options.once) { - this.removeEventListener(arg.type, stack[i]); - } - } - return !arg.defaultPrevented; -}; - -function onceAnEvent() { - var ee = new EventEmitter(); - - process.nextTick(function () { - ee.emit('myevent', 42); - }); - - return once(ee, 'myevent').then(function (args) { - var value = args[0] - assert.strictEqual(value, 42); - assert.strictEqual(ee.listenerCount('error'), 0); - assert.strictEqual(ee.listenerCount('myevent'), 0); - }); -} - -function onceAnEventWithTwoArgs() { - var ee = new EventEmitter(); - - process.nextTick(function () { - ee.emit('myevent', 42, 24); - }); - - return once(ee, 'myevent').then(function (value) { - assert.strictEqual(value.length, 2); - assert.strictEqual(value[0], 42); - assert.strictEqual(value[1], 24); - }); -} - -function catchesErrors() { - var ee = new EventEmitter(); - - var expected = new Error('kaboom'); - var err; - process.nextTick(function () { - ee.emit('error', expected); - }); - - return once(ee, 'myevent').then(function () { - throw new Error('should reject') - }, function (err) { - assert.strictEqual(err, expected); - assert.strictEqual(ee.listenerCount('error'), 0); - assert.strictEqual(ee.listenerCount('myevent'), 0); - }); -} - -function stopListeningAfterCatchingError() { - var ee = new EventEmitter(); - - var expected = new Error('kaboom'); - var err; - process.nextTick(function () { - ee.emit('error', expected); - ee.emit('myevent', 42, 24); - }); - - // process.on('multipleResolves', common.mustNotCall()); - - return once(ee, 'myevent').then(common.mustNotCall, function (err) { - // process.removeAllListeners('multipleResolves'); - assert.strictEqual(err, expected); - assert.strictEqual(ee.listenerCount('error'), 0); - assert.strictEqual(ee.listenerCount('myevent'), 0); - }); -} - -function onceError() { - var ee = new EventEmitter(); - - var expected = new Error('kaboom'); - process.nextTick(function () { - ee.emit('error', expected); - }); - - var promise = once(ee, 'error'); - assert.strictEqual(ee.listenerCount('error'), 1); - return promise.then(function (args) { - var err = args[0] - assert.strictEqual(err, expected); - assert.strictEqual(ee.listenerCount('error'), 0); - assert.strictEqual(ee.listenerCount('myevent'), 0); - }); -} - -function onceWithEventTarget() { - var et = new EventTargetMock(); - var event = new Event('myevent'); - process.nextTick(function () { - et.dispatchEvent(event); - }); - return once(et, 'myevent').then(function (args) { - var value = args[0]; - assert.strictEqual(value, event); - assert.strictEqual(has(et.events, 'myevent'), false); - }); -} - -function onceWithEventTargetError() { - var et = new EventTargetMock(); - var error = new Event('error'); - process.nextTick(function () { - et.dispatchEvent(error); - }); - return once(et, 'error').then(function (args) { - var err = args[0]; - assert.strictEqual(err, error); - assert.strictEqual(has(et.events, 'error'), false); - }); -} - -function prioritizesEventEmitter() { - var ee = new EventEmitter(); - ee.addEventListener = assert.fail; - ee.removeAllListeners = assert.fail; - process.nextTick(function () { - ee.emit('foo'); - }); - return once(ee, 'foo'); -} - -var allTests = [ - onceAnEvent(), - onceAnEventWithTwoArgs(), - catchesErrors(), - stopListeningAfterCatchingError(), - onceError(), - onceWithEventTarget(), - onceWithEventTargetError(), - prioritizesEventEmitter() -]; - -var hasBrowserEventTarget = false; -try { - hasBrowserEventTarget = typeof (new window.EventTarget().addEventListener) === 'function' && - new window.Event('xyz').type === 'xyz'; -} catch (err) {} - -if (hasBrowserEventTarget) { - var onceWithBrowserEventTarget = function onceWithBrowserEventTarget() { - var et = new window.EventTarget(); - var event = new window.Event('myevent'); - process.nextTick(function () { - et.dispatchEvent(event); - }); - return once(et, 'myevent').then(function (args) { - var value = args[0]; - assert.strictEqual(value, event); - assert.strictEqual(has(et.events, 'myevent'), false); - }); - } - - var onceWithBrowserEventTargetError = function onceWithBrowserEventTargetError() { - var et = new window.EventTarget(); - var error = new window.Event('error'); - process.nextTick(function () { - et.dispatchEvent(error); - }); - return once(et, 'error').then(function (args) { - var err = args[0]; - assert.strictEqual(err, error); - assert.strictEqual(has(et.events, 'error'), false); - }); - } - - common.test.comment('Testing with browser built-in EventTarget'); - allTests.push([ - onceWithBrowserEventTarget(), - onceWithBrowserEventTargetError() - ]); -} - -module.exports = Promise.all(allTests); diff --git a/node_modules/events/tests/index.js b/node_modules/events/tests/index.js deleted file mode 100644 index 2d739e6..0000000 --- a/node_modules/events/tests/index.js +++ /dev/null @@ -1,64 +0,0 @@ -var test = require('tape'); -var functionsHaveNames = require('functions-have-names'); -var hasSymbols = require('has-symbols'); - -require('./legacy-compat'); -var common = require('./common'); - -// we do this to easily wrap each file in a mocha test -// and also have browserify be able to statically analyze this file -var orig_require = require; -var require = function(file) { - test(file, function(t) { - // Store the tape object so tests can access it. - t.on('end', function () { delete common.test; }); - common.test = t; - - try { - var exp = orig_require(file); - if (exp && exp.then) { - exp.then(function () { t.end(); }, t.fail); - return; - } - } catch (err) { - t.fail(err); - } - t.end(); - }); -}; - -require('./add-listeners.js'); -require('./check-listener-leaks.js'); -require('./errors.js'); -require('./events-list.js'); -if (typeof Promise === 'function') { - require('./events-once.js'); -} else { - // Promise support is not available. - test('./events-once.js', { skip: true }, function () {}); -} -require('./listener-count.js'); -require('./listeners-side-effects.js'); -require('./listeners.js'); -require('./max-listeners.js'); -if (functionsHaveNames()) { - require('./method-names.js'); -} else { - // Function.name is not supported in IE - test('./method-names.js', { skip: true }, function () {}); -} -require('./modify-in-emit.js'); -require('./num-args.js'); -require('./once.js'); -require('./prepend.js'); -require('./set-max-listeners-side-effects.js'); -require('./special-event-names.js'); -require('./subclass.js'); -if (hasSymbols()) { - require('./symbols.js'); -} else { - // Symbol is not available. - test('./symbols.js', { skip: true }, function () {}); -} -require('./remove-all-listeners.js'); -require('./remove-listeners.js'); diff --git a/node_modules/events/tests/legacy-compat.js b/node_modules/events/tests/legacy-compat.js deleted file mode 100644 index a402be6..0000000 --- a/node_modules/events/tests/legacy-compat.js +++ /dev/null @@ -1,16 +0,0 @@ -// sigh... life is hard -if (!global.console) { - console = {} -} - -var fns = ['log', 'error', 'trace']; -for (var i=0 ; ifoo should not be emitted'); -} - -e.once('foo', remove); -e.removeListener('foo', remove); -e.emit('foo'); - -e.once('e', common.mustCall(function() { - e.emit('e'); -})); - -e.once('e', common.mustCall()); - -e.emit('e'); - -// Verify that the listener must be a function -assert.throws(function() { - var ee = new EventEmitter(); - - ee.once('foo', null); -}, /^TypeError: The "listener" argument must be of type Function. Received type object$/); - -{ - // once() has different code paths based on the number of arguments being - // emitted. Verify that all of the cases are covered. - var maxArgs = 4; - - for (var i = 0; i <= maxArgs; ++i) { - var ee = new EventEmitter(); - var args = ['foo']; - - for (var j = 0; j < i; ++j) - args.push(j); - - ee.once('foo', common.mustCall(function() { - var params = Array.prototype.slice.call(arguments); - var restArgs = args.slice(1); - assert.ok(Array.isArray(params)); - assert.strictEqual(params.length, restArgs.length); - for (var index = 0; index < params.length; index++) { - var param = params[index]; - assert.strictEqual(param, restArgs[index]); - } - })); - - EventEmitter.prototype.emit.apply(ee, args); - } -} diff --git a/node_modules/events/tests/prepend.js b/node_modules/events/tests/prepend.js deleted file mode 100644 index 79afde0..0000000 --- a/node_modules/events/tests/prepend.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var common = require('./common'); -var EventEmitter = require('../'); -var assert = require('assert'); - -var myEE = new EventEmitter(); -var m = 0; -// This one comes last. -myEE.on('foo', common.mustCall(function () { - assert.strictEqual(m, 2); -})); - -// This one comes second. -myEE.prependListener('foo', common.mustCall(function () { - assert.strictEqual(m++, 1); -})); - -// This one comes first. -myEE.prependOnceListener('foo', - common.mustCall(function () { - assert.strictEqual(m++, 0); - })); - -myEE.emit('foo'); - -// Verify that the listener must be a function -assert.throws(function () { - var ee = new EventEmitter(); - ee.prependOnceListener('foo', null); -}, 'TypeError: The "listener" argument must be of type Function. Received type object'); diff --git a/node_modules/events/tests/remove-all-listeners.js b/node_modules/events/tests/remove-all-listeners.js deleted file mode 100644 index 622941c..0000000 --- a/node_modules/events/tests/remove-all-listeners.js +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('./common'); -var assert = require('assert'); -var events = require('../'); -var test = require('tape'); - -function expect(expected) { - var actual = []; - test.onFinish(function() { - var sortedActual = actual.sort(); - var sortedExpected = expected.sort(); - assert.strictEqual(sortedActual.length, sortedExpected.length); - for (var index = 0; index < sortedActual.length; index++) { - var value = sortedActual[index]; - assert.strictEqual(value, sortedExpected[index]); - } - }); - function listener(name) { - actual.push(name); - } - return common.mustCall(listener, expected.length); -} - -{ - var ee = new events.EventEmitter(); - var noop = common.mustNotCall(); - ee.on('foo', noop); - ee.on('bar', noop); - ee.on('baz', noop); - ee.on('baz', noop); - var fooListeners = ee.listeners('foo'); - var barListeners = ee.listeners('bar'); - var bazListeners = ee.listeners('baz'); - ee.on('removeListener', expect(['bar', 'baz', 'baz'])); - ee.removeAllListeners('bar'); - ee.removeAllListeners('baz'); - - var listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], noop); - - listeners = ee.listeners('bar'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - listeners = ee.listeners('baz'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - // After calling removeAllListeners(), - // the old listeners array should stay unchanged. - assert.strictEqual(fooListeners.length, 1); - assert.strictEqual(fooListeners[0], noop); - assert.strictEqual(barListeners.length, 1); - assert.strictEqual(barListeners[0], noop); - assert.strictEqual(bazListeners.length, 2); - assert.strictEqual(bazListeners[0], noop); - assert.strictEqual(bazListeners[1], noop); - // After calling removeAllListeners(), - // new listeners arrays is different from the old. - assert.notStrictEqual(ee.listeners('bar'), barListeners); - assert.notStrictEqual(ee.listeners('baz'), bazListeners); -} - -{ - var ee = new events.EventEmitter(); - ee.on('foo', common.mustNotCall()); - ee.on('bar', common.mustNotCall()); - // Expect LIFO order - ee.on('removeListener', expect(['foo', 'bar', 'removeListener'])); - ee.on('removeListener', expect(['foo', 'bar'])); - ee.removeAllListeners(); - - var listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - listeners = ee.listeners('bar'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new events.EventEmitter(); - ee.on('removeListener', common.mustNotCall()); - // Check for regression where removeAllListeners() throws when - // there exists a 'removeListener' listener, but there exists - // no listeners for the provided event type. - assert.doesNotThrow(function () { ee.removeAllListeners(ee, 'foo') }); -} - -{ - var ee = new events.EventEmitter(); - var expectLength = 2; - ee.on('removeListener', function() { - assert.strictEqual(expectLength--, this.listeners('baz').length); - }); - ee.on('baz', common.mustNotCall()); - ee.on('baz', common.mustNotCall()); - ee.on('baz', common.mustNotCall()); - assert.strictEqual(ee.listeners('baz').length, expectLength + 1); - ee.removeAllListeners('baz'); - assert.strictEqual(ee.listeners('baz').length, 0); -} - -{ - var ee = new events.EventEmitter(); - assert.strictEqual(ee, ee.removeAllListeners()); -} - -{ - var ee = new events.EventEmitter(); - ee._events = undefined; - assert.strictEqual(ee, ee.removeAllListeners()); -} diff --git a/node_modules/events/tests/remove-listeners.js b/node_modules/events/tests/remove-listeners.js deleted file mode 100644 index 18e4d16..0000000 --- a/node_modules/events/tests/remove-listeners.js +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('./common'); -var assert = require('assert'); -var EventEmitter = require('../'); - -var listener1 = function listener1() {}; -var listener2 = function listener2() {}; - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener1); - })); - ee.removeListener('hello', listener1); - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('removeListener', common.mustNotCall()); - ee.removeListener('hello', listener2); - - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener1); -} - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('hello', listener2); - - var listeners; - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener2); - })); - ee.removeListener('hello', listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener2); - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - })); - ee.removeListener('hello', listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new EventEmitter(); - - function remove1() { - assert.fail('remove1 should not have been called'); - } - - function remove2() { - assert.fail('remove2 should not have been called'); - } - - ee.on('removeListener', common.mustCall(function(name, cb) { - if (cb !== remove1) return; - this.removeListener('quux', remove2); - this.emit('quux'); - }, 2)); - ee.on('quux', remove1); - ee.on('quux', remove2); - ee.removeListener('quux', remove1); -} - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('hello', listener2); - - var listeners; - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener2); - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - })); - ee.removeListener('hello', listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - })); - ee.removeListener('hello', listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new EventEmitter(); - var listener3 = common.mustCall(function() { - ee.removeListener('hello', listener4); - }, 2); - var listener4 = common.mustCall(); - - ee.on('hello', listener3); - ee.on('hello', listener4); - - // listener4 will still be called although it is removed by listener 3. - ee.emit('hello'); - // This is so because the interal listener array at time of emit - // was [listener3,listener4] - - // Interal listener array [listener3] - ee.emit('hello'); -} - -{ - var ee = new EventEmitter(); - - ee.once('hello', listener1); - ee.on('removeListener', common.mustCall(function(eventName, listener) { - assert.strictEqual(eventName, 'hello'); - assert.strictEqual(listener, listener1); - })); - ee.emit('hello'); -} - -{ - var ee = new EventEmitter(); - - assert.strictEqual(ee, ee.removeListener('foo', function() {})); -} - -// Verify that the removed listener must be a function -assert.throws(function() { - var ee = new EventEmitter(); - - ee.removeListener('foo', null); -}, /^TypeError: The "listener" argument must be of type Function\. Received type object$/); - -{ - var ee = new EventEmitter(); - var listener = function() {}; - ee._events = undefined; - var e = ee.removeListener('foo', listener); - assert.strictEqual(e, ee); -} - -{ - var ee = new EventEmitter(); - - ee.on('foo', listener1); - ee.on('foo', listener2); - var listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 2); - assert.strictEqual(listeners[0], listener1); - assert.strictEqual(listeners[1], listener2); - - ee.removeListener('foo', listener1); - assert.strictEqual(ee._events.foo, listener2); - - ee.on('foo', listener1); - listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 2); - assert.strictEqual(listeners[0], listener2); - assert.strictEqual(listeners[1], listener1); - - ee.removeListener('foo', listener1); - assert.strictEqual(ee._events.foo, listener2); -} diff --git a/node_modules/events/tests/set-max-listeners-side-effects.js b/node_modules/events/tests/set-max-listeners-side-effects.js deleted file mode 100644 index 13dbb67..0000000 --- a/node_modules/events/tests/set-max-listeners-side-effects.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -require('./common'); -var assert = require('assert'); -var events = require('../'); - -var e = new events.EventEmitter(); - -if (Object.create) assert.ok(!(e._events instanceof Object)); -assert.strictEqual(Object.keys(e._events).length, 0); -e.setMaxListeners(5); -assert.strictEqual(Object.keys(e._events).length, 0); diff --git a/node_modules/events/tests/special-event-names.js b/node_modules/events/tests/special-event-names.js deleted file mode 100644 index a2f0b74..0000000 --- a/node_modules/events/tests/special-event-names.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var common = require('./common'); -var EventEmitter = require('../'); -var assert = require('assert'); - -var ee = new EventEmitter(); -var handler = function() {}; - -assert.strictEqual(ee.eventNames().length, 0); - -assert.strictEqual(ee._events.hasOwnProperty, undefined); -assert.strictEqual(ee._events.toString, undefined); - -ee.on('__defineGetter__', handler); -ee.on('toString', handler); -ee.on('__proto__', handler); - -assert.strictEqual(ee.eventNames()[0], '__defineGetter__'); -assert.strictEqual(ee.eventNames()[1], 'toString'); - -assert.strictEqual(ee.listeners('__defineGetter__').length, 1); -assert.strictEqual(ee.listeners('__defineGetter__')[0], handler); -assert.strictEqual(ee.listeners('toString').length, 1); -assert.strictEqual(ee.listeners('toString')[0], handler); - -// Only run __proto__ tests if that property can actually be set -if ({ __proto__: 'ok' }.__proto__ === 'ok') { - assert.strictEqual(ee.eventNames().length, 3); - assert.strictEqual(ee.eventNames()[2], '__proto__'); - assert.strictEqual(ee.listeners('__proto__').length, 1); - assert.strictEqual(ee.listeners('__proto__')[0], handler); - - ee.on('__proto__', common.mustCall(function(val) { - assert.strictEqual(val, 1); - })); - ee.emit('__proto__', 1); - - process.on('__proto__', common.mustCall(function(val) { - assert.strictEqual(val, 1); - })); - process.emit('__proto__', 1); -} else { - console.log('# skipped __proto__') -} diff --git a/node_modules/events/tests/subclass.js b/node_modules/events/tests/subclass.js deleted file mode 100644 index bd033ff..0000000 --- a/node_modules/events/tests/subclass.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('./common'); -var test = require('tape'); -var assert = require('assert'); -var EventEmitter = require('../').EventEmitter; -var util = require('util'); - -util.inherits(MyEE, EventEmitter); - -function MyEE(cb) { - this.once(1, cb); - this.emit(1); - this.removeAllListeners(); - EventEmitter.call(this); -} - -var myee = new MyEE(common.mustCall()); - - -util.inherits(ErrorEE, EventEmitter); -function ErrorEE() { - this.emit('error', new Error('blerg')); -} - -assert.throws(function() { - new ErrorEE(); -}, /blerg/); - -test.onFinish(function() { - assert.ok(!(myee._events instanceof Object)); - assert.strictEqual(Object.keys(myee._events).length, 0); -}); - - -function MyEE2() { - EventEmitter.call(this); -} - -MyEE2.prototype = new EventEmitter(); - -var ee1 = new MyEE2(); -var ee2 = new MyEE2(); - -ee1.on('x', function() {}); - -assert.strictEqual(ee2.listenerCount('x'), 0); diff --git a/node_modules/events/tests/symbols.js b/node_modules/events/tests/symbols.js deleted file mode 100644 index 0721f0e..0000000 --- a/node_modules/events/tests/symbols.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var common = require('./common'); -var EventEmitter = require('../'); -var assert = require('assert'); - -var ee = new EventEmitter(); -var foo = Symbol('foo'); -var listener = common.mustCall(); - -ee.on(foo, listener); -assert.strictEqual(ee.listeners(foo).length, 1); -assert.strictEqual(ee.listeners(foo)[0], listener); - -ee.emit(foo); - -ee.removeAllListeners(); -assert.strictEqual(ee.listeners(foo).length, 0); - -ee.on(foo, listener); -assert.strictEqual(ee.listeners(foo).length, 1); -assert.strictEqual(ee.listeners(foo)[0], listener); - -ee.removeListener(foo, listener); -assert.strictEqual(ee.listeners(foo).length, 0); diff --git a/node_modules/fast-deep-equal/LICENSE b/node_modules/fast-deep-equal/LICENSE deleted file mode 100644 index 7f15435..0000000 --- a/node_modules/fast-deep-equal/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/fast-deep-equal/README.md b/node_modules/fast-deep-equal/README.md deleted file mode 100644 index d3f4ffc..0000000 --- a/node_modules/fast-deep-equal/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# fast-deep-equal -The fastest deep equal with ES6 Map, Set and Typed arrays support. - -[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) -[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) -[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) - - -## Install - -```bash -npm install fast-deep-equal -``` - - -## Features - -- ES5 compatible -- works in node.js (8+) and browsers (IE9+) -- checks equality of Date and RegExp objects by value. - -ES6 equal (`require('fast-deep-equal/es6')`) also supports: -- Maps -- Sets -- Typed arrays - - -## Usage - -```javascript -var equal = require('fast-deep-equal'); -console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true -``` - -To support ES6 Maps, Sets and Typed arrays equality use: - -```javascript -var equal = require('fast-deep-equal/es6'); -console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true -``` - -To use with React (avoiding the traversal of React elements' _owner -property that contains circular references and is not needed when -comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): - -```javascript -var equal = require('fast-deep-equal/react'); -var equal = require('fast-deep-equal/es6/react'); -``` - - -## Performance benchmark - -Node.js v12.6.0: - -``` -fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) -fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) -fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) -nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) -shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) -underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) -lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) -deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) -deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) -ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) -util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) -assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) - -The fastest is fast-deep-equal -``` - -To run benchmark (requires node.js 6+): - -```bash -npm run benchmark -``` - -__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. - - -## Enterprise support - -fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -## License - -[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE) diff --git a/node_modules/fast-deep-equal/es6/index.d.ts b/node_modules/fast-deep-equal/es6/index.d.ts deleted file mode 100644 index c7eb9c7..0000000 --- a/node_modules/fast-deep-equal/es6/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const equal: (a: any, b: any) => boolean; -export = equal; diff --git a/node_modules/fast-deep-equal/es6/index.js b/node_modules/fast-deep-equal/es6/index.js deleted file mode 100644 index d980be2..0000000 --- a/node_modules/fast-deep-equal/es6/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -// do not edit .js files directly - edit src/index.jst - - - var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; - - -module.exports = function equal(a, b) { - if (a === b) return true; - - if (a && b && typeof a == 'object' && typeof b == 'object') { - if (a.constructor !== b.constructor) return false; - - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (!equal(a[i], b[i])) return false; - return true; - } - - - if ((a instanceof Map) && (b instanceof Map)) { - if (a.size !== b.size) return false; - for (i of a.entries()) - if (!b.has(i[0])) return false; - for (i of a.entries()) - if (!equal(i[1], b.get(i[0]))) return false; - return true; - } - - if ((a instanceof Set) && (b instanceof Set)) { - if (a.size !== b.size) return false; - for (i of a.entries()) - if (!b.has(i[0])) return false; - return true; - } - - if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (a[i] !== b[i]) return false; - return true; - } - - - if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); - - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) return false; - - for (i = length; i-- !== 0;) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - - for (i = length; i-- !== 0;) { - var key = keys[i]; - - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - // true if both NaN, false otherwise - return a!==a && b!==b; -}; diff --git a/node_modules/fast-deep-equal/es6/react.d.ts b/node_modules/fast-deep-equal/es6/react.d.ts deleted file mode 100644 index c7eb9c7..0000000 --- a/node_modules/fast-deep-equal/es6/react.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const equal: (a: any, b: any) => boolean; -export = equal; diff --git a/node_modules/fast-deep-equal/es6/react.js b/node_modules/fast-deep-equal/es6/react.js deleted file mode 100644 index 98e2f9b..0000000 --- a/node_modules/fast-deep-equal/es6/react.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -// do not edit .js files directly - edit src/index.jst - - - var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; - - -module.exports = function equal(a, b) { - if (a === b) return true; - - if (a && b && typeof a == 'object' && typeof b == 'object') { - if (a.constructor !== b.constructor) return false; - - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (!equal(a[i], b[i])) return false; - return true; - } - - - if ((a instanceof Map) && (b instanceof Map)) { - if (a.size !== b.size) return false; - for (i of a.entries()) - if (!b.has(i[0])) return false; - for (i of a.entries()) - if (!equal(i[1], b.get(i[0]))) return false; - return true; - } - - if ((a instanceof Set) && (b instanceof Set)) { - if (a.size !== b.size) return false; - for (i of a.entries()) - if (!b.has(i[0])) return false; - return true; - } - - if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (a[i] !== b[i]) return false; - return true; - } - - - if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); - - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) return false; - - for (i = length; i-- !== 0;) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - - for (i = length; i-- !== 0;) { - var key = keys[i]; - - if (key === '_owner' && a.$$typeof) { - // React-specific: avoid traversing React elements' _owner. - // _owner contains circular references - // and is not needed when comparing the actual elements (and not their owners) - continue; - } - - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - // true if both NaN, false otherwise - return a!==a && b!==b; -}; diff --git a/node_modules/fast-deep-equal/index.d.ts b/node_modules/fast-deep-equal/index.d.ts deleted file mode 100644 index 3c042ca..0000000 --- a/node_modules/fast-deep-equal/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'fast-deep-equal' { - const equal: (a: any, b: any) => boolean; - export = equal; -} diff --git a/node_modules/fast-deep-equal/index.js b/node_modules/fast-deep-equal/index.js deleted file mode 100644 index 30dd1ba..0000000 --- a/node_modules/fast-deep-equal/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -// do not edit .js files directly - edit src/index.jst - - - -module.exports = function equal(a, b) { - if (a === b) return true; - - if (a && b && typeof a == 'object' && typeof b == 'object') { - if (a.constructor !== b.constructor) return false; - - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (!equal(a[i], b[i])) return false; - return true; - } - - - - if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); - - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) return false; - - for (i = length; i-- !== 0;) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - - for (i = length; i-- !== 0;) { - var key = keys[i]; - - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - // true if both NaN, false otherwise - return a!==a && b!==b; -}; diff --git a/node_modules/fast-deep-equal/package.json b/node_modules/fast-deep-equal/package.json deleted file mode 100644 index 3cfe66c..0000000 --- a/node_modules/fast-deep-equal/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "fast-deep-equal", - "version": "3.1.3", - "description": "Fast deep equal", - "main": "index.js", - "scripts": { - "eslint": "eslint *.js benchmark/*.js spec/*.js", - "build": "node build", - "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", - "test-spec": "mocha spec/*.spec.js -R spec", - "test-cov": "nyc npm run test-spec", - "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts", - "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", - "prepublish": "npm run build" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" - }, - "keywords": [ - "fast", - "equal", - "deep-equal" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", - "bugs": { - "url": "https://github.com/epoberezkin/fast-deep-equal/issues" - }, - "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", - "devDependencies": { - "coveralls": "^3.1.0", - "dot": "^1.1.2", - "eslint": "^7.2.0", - "mocha": "^7.2.0", - "nyc": "^15.1.0", - "pre-commit": "^1.2.2", - "react": "^16.12.0", - "react-test-renderer": "^16.12.0", - "sinon": "^9.0.2", - "typescript": "^3.9.5" - }, - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "files": [ - "index.js", - "index.d.ts", - "react.js", - "react.d.ts", - "es6/" - ], - "types": "index.d.ts" -} diff --git a/node_modules/fast-deep-equal/react.d.ts b/node_modules/fast-deep-equal/react.d.ts deleted file mode 100644 index c7eb9c7..0000000 --- a/node_modules/fast-deep-equal/react.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const equal: (a: any, b: any) => boolean; -export = equal; diff --git a/node_modules/fast-deep-equal/react.js b/node_modules/fast-deep-equal/react.js deleted file mode 100644 index 3489b98..0000000 --- a/node_modules/fast-deep-equal/react.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -// do not edit .js files directly - edit src/index.jst - - - -module.exports = function equal(a, b) { - if (a === b) return true; - - if (a && b && typeof a == 'object' && typeof b == 'object') { - if (a.constructor !== b.constructor) return false; - - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (!equal(a[i], b[i])) return false; - return true; - } - - - - if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); - - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) return false; - - for (i = length; i-- !== 0;) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - - for (i = length; i-- !== 0;) { - var key = keys[i]; - - if (key === '_owner' && a.$$typeof) { - // React-specific: avoid traversing React elements' _owner. - // _owner contains circular references - // and is not needed when comparing the actual elements (and not their owners) - continue; - } - - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - // true if both NaN, false otherwise - return a!==a && b!==b; -}; diff --git a/node_modules/fast-json-stable-stringify/.eslintrc.yml b/node_modules/fast-json-stable-stringify/.eslintrc.yml deleted file mode 100644 index 1c77b0d..0000000 --- a/node_modules/fast-json-stable-stringify/.eslintrc.yml +++ /dev/null @@ -1,26 +0,0 @@ -extends: eslint:recommended -env: - node: true - browser: true -rules: - block-scoped-var: 2 - callback-return: 2 - dot-notation: 2 - indent: 2 - linebreak-style: [2, unix] - new-cap: 2 - no-console: [2, allow: [warn, error]] - no-else-return: 2 - no-eq-null: 2 - no-fallthrough: 2 - no-invalid-this: 2 - no-return-assign: 2 - no-shadow: 1 - no-trailing-spaces: 2 - no-use-before-define: [2, nofunc] - quotes: [2, single, avoid-escape] - semi: [2, always] - strict: [2, global] - valid-jsdoc: [2, requireReturn: false] - no-control-regex: 0 - no-useless-escape: 2 diff --git a/node_modules/fast-json-stable-stringify/.github/FUNDING.yml b/node_modules/fast-json-stable-stringify/.github/FUNDING.yml deleted file mode 100644 index 61f9daa..0000000 --- a/node_modules/fast-json-stable-stringify/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -tidelift: "npm/fast-json-stable-stringify" diff --git a/node_modules/fast-json-stable-stringify/.travis.yml b/node_modules/fast-json-stable-stringify/.travis.yml deleted file mode 100644 index b61e8f0..0000000 --- a/node_modules/fast-json-stable-stringify/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "8" - - "10" - - "12" - - "13" -after_script: - - coveralls < coverage/lcov.info diff --git a/node_modules/fast-json-stable-stringify/LICENSE b/node_modules/fast-json-stable-stringify/LICENSE deleted file mode 100644 index c932223..0000000 --- a/node_modules/fast-json-stable-stringify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -This software is released under the MIT license: - -Copyright (c) 2017 Evgeny Poberezkin -Copyright (c) 2013 James Halliday - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fast-json-stable-stringify/README.md b/node_modules/fast-json-stable-stringify/README.md deleted file mode 100644 index 02cf49f..0000000 --- a/node_modules/fast-json-stable-stringify/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# fast-json-stable-stringify - -Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify). - -You can also pass in a custom comparison function. - -[![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify) -[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master) - -# example - -``` js -var stringify = require('fast-json-stable-stringify'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); -``` - -output: - -``` -{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} -``` - - -# methods - -``` js -var stringify = require('fast-json-stable-stringify') -``` - -## var str = stringify(obj, opts) - -Return a deterministic stringified string `str` from the object `obj`. - - -## options - -### cmp - -If `opts` is given, you can supply an `opts.cmp` to have a custom comparison -function for object keys. Your function `opts.cmp` is called with these -parameters: - -``` js -opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) -``` - -For example, to sort on the object key names in reverse order you could write: - -``` js -var stringify = require('fast-json-stable-stringify'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); -``` - -which results in the output string: - -``` -{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} -``` - -Or if you wanted to sort on the object values in reverse order, you could write: - -``` -var stringify = require('fast-json-stable-stringify'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); -``` - -which outputs: - -``` -{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} -``` - -### cycles - -Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case. - -TypeError will be thrown in case of circular object without this option. - - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install fast-json-stable-stringify -``` - - -# benchmark - -To run benchmark (requires Node.js 6+): -``` -node benchmark -``` - -Results: -``` -fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled) -json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled) -fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled) -faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled) -The fastest is fast-stable-stringify -``` - - -## Enterprise support - -fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -# license - -[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/node_modules/fast-json-stable-stringify/benchmark/index.js b/node_modules/fast-json-stable-stringify/benchmark/index.js deleted file mode 100644 index e725f9f..0000000 --- a/node_modules/fast-json-stable-stringify/benchmark/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const Benchmark = require('benchmark'); -const suite = new Benchmark.Suite; -const testData = require('./test.json'); - - -const stringifyPackages = { - // 'JSON.stringify': JSON.stringify, - 'fast-json-stable-stringify': require('../index'), - 'json-stable-stringify': true, - 'fast-stable-stringify': true, - 'faster-stable-stringify': true -}; - - -for (const name in stringifyPackages) { - let func = stringifyPackages[name]; - if (func === true) func = require(name); - - suite.add(name, function() { - func(testData); - }); -} - -suite - .on('cycle', (event) => console.log(String(event.target))) - .on('complete', function () { - console.log('The fastest is ' + this.filter('fastest').map('name')); - }) - .run({async: true}); diff --git a/node_modules/fast-json-stable-stringify/benchmark/test.json b/node_modules/fast-json-stable-stringify/benchmark/test.json deleted file mode 100644 index c9118c1..0000000 --- a/node_modules/fast-json-stable-stringify/benchmark/test.json +++ /dev/null @@ -1,137 +0,0 @@ -[ - { - "_id": "59ef4a83ee8364808d761beb", - "index": 0, - "guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d", - "isActive": false, - "balance": "$2,341.81", - "picture": "http://placehold.it/32x32", - "age": 28, - "eyeColor": "brown", - "name": "Carey Savage", - "gender": "female", - "company": "VERAQ", - "email": "careysavage@veraq.com", - "phone": "+1 (897) 574-3014", - "address": "458 Willow Street, Henrietta, California, 7234", - "about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n", - "registered": "2014-05-21T01:56:51 -01:00", - "latitude": 63.89502, - "longitude": 62.369807, - "tags": [ - "nostrud", - "nisi", - "consectetur", - "ullamco", - "cupidatat", - "culpa", - "commodo" - ], - "friends": [ - { - "id": 0, - "name": "Henry Walls" - }, - { - "id": 1, - "name": "Janice Baker" - }, - { - "id": 2, - "name": "Russell Bush" - } - ], - "greeting": "Hello, Carey Savage! You have 4 unread messages.", - "favoriteFruit": "banana" - }, - { - "_id": "59ef4a83ff5774a691454e89", - "index": 1, - "guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d", - "isActive": true, - "balance": "$1,618.15", - "picture": "http://placehold.it/32x32", - "age": 35, - "eyeColor": "blue", - "name": "Elinor Pearson", - "gender": "female", - "company": "FLEXIGEN", - "email": "elinorpearson@flexigen.com", - "phone": "+1 (923) 548-3751", - "address": "600 Bayview Avenue, Draper, Montana, 3088", - "about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n", - "registered": "2017-04-22T07:58:41 -01:00", - "latitude": -87.824919, - "longitude": 69.538927, - "tags": [ - "fugiat", - "labore", - "proident", - "quis", - "eiusmod", - "qui", - "est" - ], - "friends": [ - { - "id": 0, - "name": "Massey Wagner" - }, - { - "id": 1, - "name": "Marcella Ferrell" - }, - { - "id": 2, - "name": "Evans Mckee" - } - ], - "greeting": "Hello, Elinor Pearson! You have 3 unread messages.", - "favoriteFruit": "strawberry" - }, - { - "_id": "59ef4a839ec8a4be4430b36b", - "index": 2, - "guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809", - "isActive": false, - "balance": "$2,046.95", - "picture": "http://placehold.it/32x32", - "age": 40, - "eyeColor": "green", - "name": "Irwin Davidson", - "gender": "male", - "company": "DANJA", - "email": "irwindavidson@danja.com", - "phone": "+1 (883) 537-2041", - "address": "439 Cook Street, Chapin, Kentucky, 7398", - "about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n", - "registered": "2016-09-01T07:49:08 -01:00", - "latitude": -49.803812, - "longitude": 104.93279, - "tags": [ - "consequat", - "enim", - "quis", - "magna", - "est", - "culpa", - "tempor" - ], - "friends": [ - { - "id": 0, - "name": "Ruth Hansen" - }, - { - "id": 1, - "name": "Kathrine Austin" - }, - { - "id": 2, - "name": "Rivera Munoz" - } - ], - "greeting": "Hello, Irwin Davidson! You have 2 unread messages.", - "favoriteFruit": "banana" - } -] diff --git a/node_modules/fast-json-stable-stringify/example/key_cmp.js b/node_modules/fast-json-stable-stringify/example/key_cmp.js deleted file mode 100644 index d5f6675..0000000 --- a/node_modules/fast-json-stable-stringify/example/key_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); diff --git a/node_modules/fast-json-stable-stringify/example/nested.js b/node_modules/fast-json-stable-stringify/example/nested.js deleted file mode 100644 index 9a672fc..0000000 --- a/node_modules/fast-json-stable-stringify/example/nested.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/str.js b/node_modules/fast-json-stable-stringify/example/str.js deleted file mode 100644 index 9b4b3cd..0000000 --- a/node_modules/fast-json-stable-stringify/example/str.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 6, b: [4,5], a: 3 }; -console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/value_cmp.js b/node_modules/fast-json-stable-stringify/example/value_cmp.js deleted file mode 100644 index 09f1c5f..0000000 --- a/node_modules/fast-json-stable-stringify/example/value_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); diff --git a/node_modules/fast-json-stable-stringify/index.d.ts b/node_modules/fast-json-stable-stringify/index.d.ts deleted file mode 100644 index 23e46ca..0000000 --- a/node_modules/fast-json-stable-stringify/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'fast-json-stable-stringify' { - function stringify(obj: any): string; - export = stringify; -} diff --git a/node_modules/fast-json-stable-stringify/index.js b/node_modules/fast-json-stable-stringify/index.js deleted file mode 100644 index c44e6a4..0000000 --- a/node_modules/fast-json-stable-stringify/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -module.exports = function (data, opts) { - if (!opts) opts = {}; - if (typeof opts === 'function') opts = { cmp: opts }; - var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; - - var cmp = opts.cmp && (function (f) { - return function (node) { - return function (a, b) { - var aobj = { key: a, value: node[a] }; - var bobj = { key: b, value: node[b] }; - return f(aobj, bobj); - }; - }; - })(opts.cmp); - - var seen = []; - return (function stringify (node) { - if (node && node.toJSON && typeof node.toJSON === 'function') { - node = node.toJSON(); - } - - if (node === undefined) return; - if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; - if (typeof node !== 'object') return JSON.stringify(node); - - var i, out; - if (Array.isArray(node)) { - out = '['; - for (i = 0; i < node.length; i++) { - if (i) out += ','; - out += stringify(node[i]) || 'null'; - } - return out + ']'; - } - - if (node === null) return 'null'; - - if (seen.indexOf(node) !== -1) { - if (cycles) return JSON.stringify('__cycle__'); - throw new TypeError('Converting circular structure to JSON'); - } - - var seenIndex = seen.push(node) - 1; - var keys = Object.keys(node).sort(cmp && cmp(node)); - out = ''; - for (i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = stringify(node[key]); - - if (!value) continue; - if (out) out += ','; - out += JSON.stringify(key) + ':' + value; - } - seen.splice(seenIndex, 1); - return '{' + out + '}'; - })(data); -}; diff --git a/node_modules/fast-json-stable-stringify/package.json b/node_modules/fast-json-stable-stringify/package.json deleted file mode 100644 index ad2c8bf..0000000 --- a/node_modules/fast-json-stable-stringify/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "fast-json-stable-stringify", - "version": "2.1.0", - "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", - "main": "index.js", - "types": "index.d.ts", - "dependencies": {}, - "devDependencies": { - "benchmark": "^2.1.4", - "coveralls": "^3.0.0", - "eslint": "^6.7.0", - "fast-stable-stringify": "latest", - "faster-stable-stringify": "latest", - "json-stable-stringify": "latest", - "nyc": "^14.1.0", - "pre-commit": "^1.2.2", - "tape": "^4.11.0" - }, - "scripts": { - "eslint": "eslint index.js test", - "test-spec": "tape test/*.js", - "test": "npm run eslint && nyc npm run test-spec" - }, - "repository": { - "type": "git", - "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" - }, - "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify", - "keywords": [ - "json", - "stringify", - "deterministic", - "hash", - "stable" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "nyc": { - "exclude": [ - "test", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - } -} diff --git a/node_modules/fast-json-stable-stringify/test/cmp.js b/node_modules/fast-json-stable-stringify/test/cmp.js deleted file mode 100644 index 4efd6b5..0000000 --- a/node_modules/fast-json-stable-stringify/test/cmp.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var test = require('tape'); -var stringify = require('../'); - -test('custom comparison function', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; - }); - t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); -}); diff --git a/node_modules/fast-json-stable-stringify/test/nested.js b/node_modules/fast-json-stable-stringify/test/nested.js deleted file mode 100644 index 167a358..0000000 --- a/node_modules/fast-json-stable-stringify/test/nested.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var test = require('tape'); -var stringify = require('../'); - -test('nested', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); -}); - -test('cyclic (default)', function (t) { - t.plan(1); - var one = { a: 1 }; - var two = { a: 2, one: one }; - one.two = two; - try { - stringify(one); - } catch (ex) { - t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); - } -}); - -test('cyclic (specifically allowed)', function (t) { - t.plan(1); - var one = { a: 1 }; - var two = { a: 2, one: one }; - one.two = two; - t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); -}); - -test('repeated non-cyclic value', function(t) { - t.plan(1); - var one = { x: 1 }; - var two = { a: one, b: one }; - t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); -}); - -test('acyclic but with reused obj-property pointers', function (t) { - t.plan(1); - var x = { a: 1 }; - var y = { b: x, c: x }; - t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); -}); diff --git a/node_modules/fast-json-stable-stringify/test/str.js b/node_modules/fast-json-stable-stringify/test/str.js deleted file mode 100644 index 99a9ade..0000000 --- a/node_modules/fast-json-stable-stringify/test/str.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var test = require('tape'); -var stringify = require('../'); - -test('simple object', function (t) { - t.plan(1); - var obj = { c: 6, b: [4,5], a: 3, z: null }; - t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); -}); - -test('object with undefined', function (t) { - t.plan(1); - var obj = { a: 3, z: undefined }; - t.equal(stringify(obj), '{"a":3}'); -}); - -test('object with null', function (t) { - t.plan(1); - var obj = { a: 3, z: null }; - t.equal(stringify(obj), '{"a":3,"z":null}'); -}); - -test('object with NaN and Infinity', function (t) { - t.plan(1); - var obj = { a: 3, b: NaN, c: Infinity }; - t.equal(stringify(obj), '{"a":3,"b":null,"c":null}'); -}); - -test('array with undefined', function (t) { - t.plan(1); - var obj = [4, undefined, 6]; - t.equal(stringify(obj), '[4,null,6]'); -}); - -test('object with empty string', function (t) { - t.plan(1); - var obj = { a: 3, z: '' }; - t.equal(stringify(obj), '{"a":3,"z":""}'); -}); - -test('array with empty string', function (t) { - t.plan(1); - var obj = [4, '', 6]; - t.equal(stringify(obj), '[4,"",6]'); -}); diff --git a/node_modules/fast-json-stable-stringify/test/to-json.js b/node_modules/fast-json-stable-stringify/test/to-json.js deleted file mode 100644 index 2fb2cfa..0000000 --- a/node_modules/fast-json-stable-stringify/test/to-json.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var test = require('tape'); -var stringify = require('../'); - -test('toJSON function', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; - t.equal(stringify(obj), '{"one":1}' ); -}); - -test('toJSON returns string', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; - t.equal(stringify(obj), '"one"'); -}); - -test('toJSON returns array', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; - t.equal(stringify(obj), '["one"]'); -}); diff --git a/node_modules/fastest-levenshtein/.eslintrc.json b/node_modules/fastest-levenshtein/.eslintrc.json deleted file mode 100644 index 691f81b..0000000 --- a/node_modules/fastest-levenshtein/.eslintrc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 2020 - }, - "extends": [ - "eslint:all", - "prettier", - "plugin:node/recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], - "rules": { - "capitalized-comments": "off", - "camelcase": "off", - "curly": ["error", "all"], - "id-length": "off", - "max-lines-per-function": "off", - "max-statements": "off", - "multiline-comment-style": "off", - "no-bitwise": "off", - "no-magic-numbers": "off", - "no-param-reassign": "off", - "no-plusplus": "off", - "node/no-unsupported-features/es-syntax": "off", - "one-var": "off", - "padded-blocks": "off" - } -} diff --git a/node_modules/fastest-levenshtein/.prettierrc b/node_modules/fastest-levenshtein/.prettierrc deleted file mode 100644 index 222861c..0000000 --- a/node_modules/fastest-levenshtein/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "tabWidth": 2, - "useTabs": false -} diff --git a/node_modules/fastest-levenshtein/.travis.yml b/node_modules/fastest-levenshtein/.travis.yml deleted file mode 100644 index 7b2f12d..0000000 --- a/node_modules/fastest-levenshtein/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false - -language: node_js - -os: - - linux - - osx - - windows - -arch: amd64 - -node_js: - - 14 - - 13 - - 12 - - 11 - - 10 - -script: - - npm test - - npm run test:coveralls \ No newline at end of file diff --git a/node_modules/fastest-levenshtein/LICENSE.md b/node_modules/fastest-levenshtein/LICENSE.md deleted file mode 100644 index 0e62da3..0000000 --- a/node_modules/fastest-levenshtein/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Kasper Unn Weihe - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/node_modules/fastest-levenshtein/README.md b/node_modules/fastest-levenshtein/README.md deleted file mode 100644 index 4d19e88..0000000 --- a/node_modules/fastest-levenshtein/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# fastest-levenshtein :rocket: -> Fastest JS/TS implemenation of [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance).
-> Measure the difference between two strings. - -[![Build Status](https://travis-ci.org/ka-weihe/fastest-levenshtein.svg?branch=master)](https://travis-ci.org/ka-weihe/fastest-levenshtein) -[![Coverage Status](https://coveralls.io/repos/github/ka-weihe/node-levenshtein/badge.svg?branch=master)](https://coveralls.io/github/ka-weihe/node-levenshtein?branch=master) -[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ka-weihe/fastest-levenshtein.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ka-weihe/fastest-levenshtein/context:javascript) -![npm](https://img.shields.io/npm/dm/fastest-levenshtein) -```bash -$ npm i fastest-levenshtein -``` - -## Usage -### Node -```javascript -const {distance, closest} = require('fastest-levenshtein') - -// Print levenshtein-distance between 'fast' and 'faster' -console.log(distance('fast', 'faster')) -//=> 2 - -// Print string from array with lowest edit-distance to 'fast' -console.log(closest('fast', ['slow', 'faster', 'fastest'])) -//=> 'faster' -``` - -### Deno -```javascript -import {distance, closest} from 'https://deno.land/x/fastest_levenshtein/mod.ts' - -// Print levenshtein-distance between 'fast' and 'faster' -console.log(distance('fast', 'faster')) -//=> 2 - -// Print string from array with lowest edit-distance to 'fast' -console.log(closest('fast', ['slow', 'faster', 'fastest'])) -//=> 'faster' -``` - -## Benchmark -I generated 500 pairs of strings with length N. I measured the ops/sec each library achieves to process all the given pairs. Higher is better. - -| Test Target | N=4 | N=8 | N=16 | N=32 | N=64 | N=128 | N=256 | N=512 | N=1024 | -|---------------------------|-------|-------|-------|------|-------|-------|-------|-------|--------| -| fastest-levenshtein | 44423 | 23702 | 10764 | 4595 | 1049 | 291.5 | 86.64 | 22.24 | 5.473 | -| js-levenshtein | 21261 | 10030 | 2939 | 824 | 223 | 57.62 | 14.77 | 3.717 | 0.934 | -| leven | 19688 | 6884 | 1606 | 436 | 117 | 30.34 | 7.604 | 1.929 | 0.478 | -| fast-levenshtein | 18577 | 6112 | 1265 | 345 | 89.41 | 22.70 | 5.676 | 1.428 | 0.348 | -| levenshtein-edit-distance | 22968 | 7445 | 1493 | 409 | 109 | 28.07 | 7.095 | 1.789 | 0.445 | - -### Relative Performance -This image shows the relative performance between `fastest-levenshtein` and `js-levenshtein` (the 2nd fastest). `fastest-levenshtein` is always a lot faster. y-axis shows "times faster". - -![Benchmark](/images/relaperf.png) - -## License -This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details diff --git a/node_modules/fastest-levenshtein/bench.js b/node_modules/fastest-levenshtein/bench.js deleted file mode 100644 index 1fd420b..0000000 --- a/node_modules/fastest-levenshtein/bench.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -exports.__esModule = true; -/* eslint-disable @typescript-eslint/no-var-requires */ -/* eslint-disable no-console */ -var Benchmark = require("benchmark"); -var mod_js_1 = require("./mod.js"); -var fast_levenshtein_1 = require("fast-levenshtein"); -var fs = require("fs"); -var jslevenshtein = require("js-levenshtein"); -var leven = require("leven"); -var levenshteinEditDistance = require("levenshtein-edit-distance"); -var suite = new Benchmark.Suite(); -var randomstring = function (length) { - var result = ""; - var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - var charactersLength = characters.length; - for (var i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; -var randomstringArr = function (stringSize, arraySize) { - var i = 0; - var arr = []; - for (i = 0; i < arraySize; i++) { - arr.push(randomstring(stringSize)); - } - return arr; -}; -var arrSize = 1000; -if (!fs.existsSync("data.json")) { - var data_1 = [ - randomstringArr(4, arrSize), - randomstringArr(8, arrSize), - randomstringArr(16, arrSize), - randomstringArr(32, arrSize), - randomstringArr(64, arrSize), - randomstringArr(128, arrSize), - randomstringArr(256, arrSize), - randomstringArr(512, arrSize), - randomstringArr(1024, arrSize), - ]; - fs.writeFileSync("data.json", JSON.stringify(data_1)); -} -var data = JSON.parse(fs.readFileSync("data.json", "utf8")); -var _loop_1 = function (i) { - var datapick = data[i]; - if (process.argv[2] !== "no") { - suite - .add("".concat(i, " - js-levenshtein"), function () { - for (var j = 0; j < arrSize - 1; j += 2) { - jslevenshtein(datapick[j], datapick[j + 1]); - } - }) - .add("".concat(i, " - leven"), function () { - for (var j = 0; j < arrSize - 1; j += 2) { - leven(datapick[j], datapick[j + 1]); - } - }) - .add("".concat(i, " - fast-levenshtein"), function () { - for (var j = 0; j < arrSize - 1; j += 2) { - (0, fast_levenshtein_1.get)(datapick[j], datapick[j + 1]); - } - }) - .add("".concat(i, " - levenshtein-edit-distance"), function () { - for (var j = 0; j < arrSize - 1; j += 2) { - levenshteinEditDistance(datapick[j], datapick[j + 1]); - } - }); - } - suite.add("".concat(i, " - fastest-levenshtein"), function () { - for (var j = 0; j < arrSize - 1; j += 2) { - (0, mod_js_1.distance)(datapick[j], datapick[j + 1]); - } - }); -}; -// BENCHMARKS -for (var i = 0; i < 9; i++) { - _loop_1(i); -} -var results = new Map(); -suite - .on("cycle", function (event) { - console.log(String(event.target)); - if (results.has(event.target.name[0])) { - results.get(event.target.name[0]).push(event.target.hz); - } - else { - results.set(event.target.name[0], [event.target.hz]); - } -}) - .on("complete", function () { - console.log(results); -}) - // run async - .run({ async: true }); diff --git a/node_modules/fastest-levenshtein/esm/mod.d.ts b/node_modules/fastest-levenshtein/esm/mod.d.ts deleted file mode 100644 index 50927ef..0000000 --- a/node_modules/fastest-levenshtein/esm/mod.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const distance: (a: string, b: string) => number; -declare const closest: (str: string, arr: readonly string[]) => string; -export { closest, distance }; -//# sourceMappingURL=mod.d.ts.map \ No newline at end of file diff --git a/node_modules/fastest-levenshtein/esm/mod.d.ts.map b/node_modules/fastest-levenshtein/esm/mod.d.ts.map deleted file mode 100644 index 7fd5c17..0000000 --- a/node_modules/fastest-levenshtein/esm/mod.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAiHA,QAAA,MAAM,QAAQ,MAAO,MAAM,KAAK,MAAM,KAAG,MAaxC,CAAC;AAEF,QAAA,MAAM,OAAO,QAAS,MAAM,OAAO,SAAS,MAAM,EAAE,KAAG,MAWtD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/fastest-levenshtein/esm/mod.js b/node_modules/fastest-levenshtein/esm/mod.js deleted file mode 100644 index 719f2b8..0000000 --- a/node_modules/fastest-levenshtein/esm/mod.js +++ /dev/null @@ -1,138 +0,0 @@ -const peq = new Uint32Array(0x10000); -const myers_32 = (a, b) => { - const n = a.length; - const m = b.length; - const lst = 1 << (n - 1); - let pv = -1; - let mv = 0; - let sc = n; - let i = n; - while (i--) { - peq[a.charCodeAt(i)] |= 1 << i; - } - for (i = 0; i < m; i++) { - let eq = peq[b.charCodeAt(i)]; - const xv = eq | mv; - eq |= ((eq & pv) + pv) ^ pv; - mv |= ~(eq | pv); - pv &= eq; - if (mv & lst) { - sc++; - } - if (pv & lst) { - sc--; - } - mv = (mv << 1) | 1; - pv = (pv << 1) | ~(xv | mv); - mv &= xv; - } - i = n; - while (i--) { - peq[a.charCodeAt(i)] = 0; - } - return sc; -}; -const myers_x = (b, a) => { - const n = a.length; - const m = b.length; - const mhc = []; - const phc = []; - const hsize = Math.ceil(n / 32); - const vsize = Math.ceil(m / 32); - for (let i = 0; i < hsize; i++) { - phc[i] = -1; - mhc[i] = 0; - } - let j = 0; - for (; j < vsize - 1; j++) { - let mv = 0; - let pv = -1; - const start = j * 32; - const vlen = Math.min(32, m) + start; - for (let k = start; k < vlen; k++) { - peq[b.charCodeAt(k)] |= 1 << k; - } - for (let i = 0; i < n; i++) { - const eq = peq[a.charCodeAt(i)]; - const pb = (phc[(i / 32) | 0] >>> i) & 1; - const mb = (mhc[(i / 32) | 0] >>> i) & 1; - const xv = eq | mv; - const xh = ((((eq | mb) & pv) + pv) ^ pv) | eq | mb; - let ph = mv | ~(xh | pv); - let mh = pv & xh; - if ((ph >>> 31) ^ pb) { - phc[(i / 32) | 0] ^= 1 << i; - } - if ((mh >>> 31) ^ mb) { - mhc[(i / 32) | 0] ^= 1 << i; - } - ph = (ph << 1) | pb; - mh = (mh << 1) | mb; - pv = mh | ~(xv | ph); - mv = ph & xv; - } - for (let k = start; k < vlen; k++) { - peq[b.charCodeAt(k)] = 0; - } - } - let mv = 0; - let pv = -1; - const start = j * 32; - const vlen = Math.min(32, m - start) + start; - for (let k = start; k < vlen; k++) { - peq[b.charCodeAt(k)] |= 1 << k; - } - let score = m; - for (let i = 0; i < n; i++) { - const eq = peq[a.charCodeAt(i)]; - const pb = (phc[(i / 32) | 0] >>> i) & 1; - const mb = (mhc[(i / 32) | 0] >>> i) & 1; - const xv = eq | mv; - const xh = ((((eq | mb) & pv) + pv) ^ pv) | eq | mb; - let ph = mv | ~(xh | pv); - let mh = pv & xh; - score += (ph >>> (m - 1)) & 1; - score -= (mh >>> (m - 1)) & 1; - if ((ph >>> 31) ^ pb) { - phc[(i / 32) | 0] ^= 1 << i; - } - if ((mh >>> 31) ^ mb) { - mhc[(i / 32) | 0] ^= 1 << i; - } - ph = (ph << 1) | pb; - mh = (mh << 1) | mb; - pv = mh | ~(xv | ph); - mv = ph & xv; - } - for (let k = start; k < vlen; k++) { - peq[b.charCodeAt(k)] = 0; - } - return score; -}; -const distance = (a, b) => { - if (a.length < b.length) { - const tmp = b; - b = a; - a = tmp; - } - if (b.length === 0) { - return a.length; - } - if (a.length <= 32) { - return myers_32(a, b); - } - return myers_x(a, b); -}; -const closest = (str, arr) => { - let min_distance = Infinity; - let min_index = 0; - for (let i = 0; i < arr.length; i++) { - const dist = distance(str, arr[i]); - if (dist < min_distance) { - min_distance = dist; - min_index = i; - } - } - return arr[min_index]; -}; -export { closest, distance }; diff --git a/node_modules/fastest-levenshtein/mod.d.ts b/node_modules/fastest-levenshtein/mod.d.ts deleted file mode 100644 index b1b5ce7..0000000 --- a/node_modules/fastest-levenshtein/mod.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const distance: (a: string, b: string) => number; -declare const closest: (str: string, arr: readonly string[]) => string; -export { closest, distance }; diff --git a/node_modules/fastest-levenshtein/mod.js b/node_modules/fastest-levenshtein/mod.js deleted file mode 100644 index 6bc2745..0000000 --- a/node_modules/fastest-levenshtein/mod.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.distance = exports.closest = void 0; -var peq = new Uint32Array(0x10000); -var myers_32 = function (a, b) { - var n = a.length; - var m = b.length; - var lst = 1 << (n - 1); - var pv = -1; - var mv = 0; - var sc = n; - var i = n; - while (i--) { - peq[a.charCodeAt(i)] |= 1 << i; - } - for (i = 0; i < m; i++) { - var eq = peq[b.charCodeAt(i)]; - var xv = eq | mv; - eq |= ((eq & pv) + pv) ^ pv; - mv |= ~(eq | pv); - pv &= eq; - if (mv & lst) { - sc++; - } - if (pv & lst) { - sc--; - } - mv = (mv << 1) | 1; - pv = (pv << 1) | ~(xv | mv); - mv &= xv; - } - i = n; - while (i--) { - peq[a.charCodeAt(i)] = 0; - } - return sc; -}; -var myers_x = function (b, a) { - var n = a.length; - var m = b.length; - var mhc = []; - var phc = []; - var hsize = Math.ceil(n / 32); - var vsize = Math.ceil(m / 32); - for (var i = 0; i < hsize; i++) { - phc[i] = -1; - mhc[i] = 0; - } - var j = 0; - for (; j < vsize - 1; j++) { - var mv_1 = 0; - var pv_1 = -1; - var start_1 = j * 32; - var vlen_1 = Math.min(32, m) + start_1; - for (var k = start_1; k < vlen_1; k++) { - peq[b.charCodeAt(k)] |= 1 << k; - } - for (var i = 0; i < n; i++) { - var eq = peq[a.charCodeAt(i)]; - var pb = (phc[(i / 32) | 0] >>> i) & 1; - var mb = (mhc[(i / 32) | 0] >>> i) & 1; - var xv = eq | mv_1; - var xh = ((((eq | mb) & pv_1) + pv_1) ^ pv_1) | eq | mb; - var ph = mv_1 | ~(xh | pv_1); - var mh = pv_1 & xh; - if ((ph >>> 31) ^ pb) { - phc[(i / 32) | 0] ^= 1 << i; - } - if ((mh >>> 31) ^ mb) { - mhc[(i / 32) | 0] ^= 1 << i; - } - ph = (ph << 1) | pb; - mh = (mh << 1) | mb; - pv_1 = mh | ~(xv | ph); - mv_1 = ph & xv; - } - for (var k = start_1; k < vlen_1; k++) { - peq[b.charCodeAt(k)] = 0; - } - } - var mv = 0; - var pv = -1; - var start = j * 32; - var vlen = Math.min(32, m - start) + start; - for (var k = start; k < vlen; k++) { - peq[b.charCodeAt(k)] |= 1 << k; - } - var score = m; - for (var i = 0; i < n; i++) { - var eq = peq[a.charCodeAt(i)]; - var pb = (phc[(i / 32) | 0] >>> i) & 1; - var mb = (mhc[(i / 32) | 0] >>> i) & 1; - var xv = eq | mv; - var xh = ((((eq | mb) & pv) + pv) ^ pv) | eq | mb; - var ph = mv | ~(xh | pv); - var mh = pv & xh; - score += (ph >>> (m - 1)) & 1; - score -= (mh >>> (m - 1)) & 1; - if ((ph >>> 31) ^ pb) { - phc[(i / 32) | 0] ^= 1 << i; - } - if ((mh >>> 31) ^ mb) { - mhc[(i / 32) | 0] ^= 1 << i; - } - ph = (ph << 1) | pb; - mh = (mh << 1) | mb; - pv = mh | ~(xv | ph); - mv = ph & xv; - } - for (var k = start; k < vlen; k++) { - peq[b.charCodeAt(k)] = 0; - } - return score; -}; -var distance = function (a, b) { - if (a.length < b.length) { - var tmp = b; - b = a; - a = tmp; - } - if (b.length === 0) { - return a.length; - } - if (a.length <= 32) { - return myers_32(a, b); - } - return myers_x(a, b); -}; -exports.distance = distance; -var closest = function (str, arr) { - var min_distance = Infinity; - var min_index = 0; - for (var i = 0; i < arr.length; i++) { - var dist = distance(str, arr[i]); - if (dist < min_distance) { - min_distance = dist; - min_index = i; - } - } - return arr[min_index]; -}; -exports.closest = closest; diff --git a/node_modules/fastest-levenshtein/package.json b/node_modules/fastest-levenshtein/package.json deleted file mode 100644 index c395b85..0000000 --- a/node_modules/fastest-levenshtein/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "fastest-levenshtein", - "version": "1.0.16", - "description": "Fastest Levenshtein distance implementation in JS.", - "main": "mod.js", - "types": "mod.d.ts", - "module": "./esm/mod.js", - "repository": { - "type": "git", - "url": "git+https://github.com/ka-weihe/fastest-levenshtein.git" - }, - "keywords": [ - "levenshtein", - "distance", - "fast", - "fastest", - "edit", - "string", - "similarity", - "algorithm", - "match", - "comparison", - "fuzzy", - "search", - "string", - "matching", - "similar", - "node", - "difference" - ], - "author": "Kasper U. Weihe", - "license": "MIT", - "bugs": { - "url": "https://github.com/ka-weihe/fastest-levenshtein/issues" - }, - "homepage": "https://github.com/ka-weihe/fastest-levenshtein#README", - "scripts": { - "build": "tsc mod.ts --declaration", - "build:esm": "tsc --declaration -p tsconfig.esm.json", - "prepare": "npm run build && npm run build:esm", - "bench": "npm run build && tsc bench.ts && node bench.js", - "test": "npm run build && tsc test.ts && jest test.js", - "test:coverage": "npm run build && jest --coverage", - "test:coveralls": "npm run build && jest --coverage --coverageReporters=text-lcov | coveralls" - }, - "devDependencies": { - "@types/benchmark": "^1.0.33", - "@types/jest": "^26.0.15", - "@typescript-eslint/eslint-plugin": "^4.7.0", - "@typescript-eslint/parser": "^4.7.0", - "benchmark": "^2.1.4", - "coveralls": "^3.1.0", - "eslint": "^7.13.0", - "eslint-config-node": "^4.1.0", - "eslint-config-prettier": "^6.15.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.1.4", - "fast-levenshtein": "^2.0.6", - "jest": "^26.6.3", - "js-levenshtein": "^1.1.6", - "leven": "^3.1.0", - "levenshtein-edit-distance": "^2.0.5", - "natural": "^2.1.5", - "prettier": "^2.1.2", - "talisman": "^1.1.3", - "typescript": "^4.0.5" - }, - "engines": { - "node": ">= 4.9.1" - } -} diff --git a/node_modules/fastest-levenshtein/test.js b/node_modules/fastest-levenshtein/test.js deleted file mode 100644 index 4750633..0000000 --- a/node_modules/fastest-levenshtein/test.js +++ /dev/null @@ -1,55 +0,0 @@ -var _a = require("./mod.js"), closest = _a.closest, distance = _a.distance; -var levenshtein = function (a, b) { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - if (a.length > b.length) { - var tmp = a; - a = b; - b = tmp; - } - var row = []; - for (var i = 0; i <= a.length; i++) { - row[i] = i; - } - for (var i = 1; i <= b.length; i++) { - var prev = i; - for (var j = 1; j <= a.length; j++) { - var val = 0; - if (b.charAt(i - 1) === a.charAt(j - 1)) { - val = row[j - 1]; - } - else { - val = Math.min(row[j - 1] + 1, prev + 1, row[j] + 1); - } - row[j - 1] = prev; - prev = val; - } - row[a.length] = prev; - } - return row[a.length]; -}; -var makeid = function (length) { - var result = ""; - var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - var charactersLength = characters.length; - for (var i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; -for (var i = 0; i < 10000; i++) { - var rnd_num1 = (Math.random() * 1000) | 0; - var rnd_num2 = (Math.random() * 1000) | 0; - var rnd_string1 = makeid(rnd_num1); - var rnd_string2 = makeid(rnd_num2); - var actual = distance(rnd_string1, rnd_string2); - var expected = levenshtein(rnd_string1, rnd_string2); - console.log(i); - if (actual !== expected) { - console.log("fail"); - } -} diff --git a/node_modules/fastest-levenshtein/test.ts b/node_modules/fastest-levenshtein/test.ts deleted file mode 100644 index 41939bc..0000000 --- a/node_modules/fastest-levenshtein/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -const { closest, distance } = require("./mod.js"); - -const levenshtein = (a, b) => { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - - if (a.length > b.length) { - const tmp = a; - a = b; - b = tmp; - } - - const row = []; - for (let i = 0; i <= a.length; i++) { - row[i] = i; - } - - for (let i = 1; i <= b.length; i++) { - let prev = i; - for (let j = 1; j <= a.length; j++) { - let val = 0; - if (b.charAt(i - 1) === a.charAt(j - 1)) { - val = row[j - 1]; - } else { - val = Math.min(row[j - 1] + 1, prev + 1, row[j] + 1); - } - row[j - 1] = prev; - prev = val; - } - row[a.length] = prev; - } - - return row[a.length]; -}; - -const makeid = (length) => { - let result = ""; - const characters = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - const charactersLength = characters.length; - for (let i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; - -test("test compare", () => { - for (let i = 0; i < 1000; i++) { - const rnd_num1 = (Math.random() * 1000) | 0; - const rnd_num2 = (Math.random() * 1000) | 0; - const rnd_string1 = makeid(rnd_num1); - const rnd_string2 = makeid(rnd_num2); - const actual = distance(rnd_string1, rnd_string2); - const expected = levenshtein(rnd_string1, rnd_string2); - expect(actual).toBe(expected); - } -}); - -test("test find", () => { - const actual = closest("fast", ["slow", "faster", "fastest"]); - const expected = "faster"; - expect(actual).toBe(expected); -}); diff --git a/node_modules/find-up/index.d.ts b/node_modules/find-up/index.d.ts deleted file mode 100644 index 41e3192..0000000 --- a/node_modules/find-up/index.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -import {Options as LocatePathOptions} from 'locate-path'; - -declare const stop: unique symbol; - -declare namespace findUp { - interface Options extends LocatePathOptions {} - - type StopSymbol = typeof stop; - - type Match = string | StopSymbol | undefined; -} - -declare const findUp: { - /** - Find a file or directory by walking up parent directories. - - @param name - Name of the file or directory to find. Can be multiple. - @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. - - @example - ``` - // / - // └── Users - // └── sindresorhus - // ├── unicorn.png - // └── foo - // └── bar - // ├── baz - // └── example.js - - // example.js - import findUp = require('find-up'); - - (async () => { - console.log(await findUp('unicorn.png')); - //=> '/Users/sindresorhus/unicorn.png' - - console.log(await findUp(['rainbow.png', 'unicorn.png'])); - //=> '/Users/sindresorhus/unicorn.png' - })(); - ``` - */ - (name: string | string[], options?: findUp.Options): Promise; - - /** - Find a file or directory by walking up parent directories. - - @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. - @returns The first path found or `undefined` if none could be found. - - @example - ``` - import path = require('path'); - import findUp = require('find-up'); - - (async () => { - console.log(await findUp(async directory => { - const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); - return hasUnicorns && directory; - }, {type: 'directory'})); - //=> '/Users/sindresorhus' - })(); - ``` - */ - (matcher: (directory: string) => (findUp.Match | Promise), options?: findUp.Options): Promise; - - sync: { - /** - Synchronously find a file or directory by walking up parent directories. - - @param name - Name of the file or directory to find. Can be multiple. - @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. - */ - (name: string | string[], options?: findUp.Options): string | undefined; - - /** - Synchronously find a file or directory by walking up parent directories. - - @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. - @returns The first path found or `undefined` if none could be found. - - @example - ``` - import path = require('path'); - import findUp = require('find-up'); - - console.log(findUp.sync(directory => { - const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png')); - return hasUnicorns && directory; - }, {type: 'directory'})); - //=> '/Users/sindresorhus' - ``` - */ - (matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined; - - /** - Synchronously check if a path exists. - - @param path - Path to the file or directory. - @returns Whether the path exists. - - @example - ``` - import findUp = require('find-up'); - - console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png')); - //=> true - ``` - */ - exists(path: string): boolean; - } - - /** - Check if a path exists. - - @param path - Path to a file or directory. - @returns Whether the path exists. - - @example - ``` - import findUp = require('find-up'); - - (async () => { - console.log(await findUp.exists('/Users/sindresorhus/unicorn.png')); - //=> true - })(); - ``` - */ - exists(path: string): Promise; - - /** - Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`. - */ - readonly stop: findUp.StopSymbol; -}; - -export = findUp; diff --git a/node_modules/find-up/index.js b/node_modules/find-up/index.js deleted file mode 100644 index ce564e5..0000000 --- a/node_modules/find-up/index.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; -const path = require('path'); -const locatePath = require('locate-path'); -const pathExists = require('path-exists'); - -const stop = Symbol('findUp.stop'); - -module.exports = async (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); - - const runMatcher = async locateOptions => { - if (typeof name !== 'function') { - return locatePath(paths, locateOptions); - } - - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath([foundPath], locateOptions); - } - - return foundPath; - }; - - // eslint-disable-next-line no-constant-condition - while (true) { - // eslint-disable-next-line no-await-in-loop - const foundPath = await runMatcher({...options, cwd: directory}); - - if (foundPath === stop) { - return; - } - - if (foundPath) { - return path.resolve(directory, foundPath); - } - - if (directory === root) { - return; - } - - directory = path.dirname(directory); - } -}; - -module.exports.sync = (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); - - const runMatcher = locateOptions => { - if (typeof name !== 'function') { - return locatePath.sync(paths, locateOptions); - } - - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath.sync([foundPath], locateOptions); - } - - return foundPath; - }; - - // eslint-disable-next-line no-constant-condition - while (true) { - const foundPath = runMatcher({...options, cwd: directory}); - - if (foundPath === stop) { - return; - } - - if (foundPath) { - return path.resolve(directory, foundPath); - } - - if (directory === root) { - return; - } - - directory = path.dirname(directory); - } -}; - -module.exports.exists = pathExists; - -module.exports.sync.exists = pathExists.sync; - -module.exports.stop = stop; diff --git a/node_modules/find-up/license b/node_modules/find-up/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/find-up/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/find-up/package.json b/node_modules/find-up/package.json deleted file mode 100644 index cd50281..0000000 --- a/node_modules/find-up/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "find-up", - "version": "4.1.0", - "description": "Find a file or directory by walking up parent directories", - "license": "MIT", - "repository": "sindresorhus/find-up", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "find", - "up", - "find-up", - "findup", - "look-up", - "look", - "file", - "search", - "match", - "package", - "resolve", - "parent", - "parents", - "folder", - "directory", - "walk", - "walking", - "path" - ], - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "devDependencies": { - "ava": "^2.1.0", - "is-path-inside": "^2.1.0", - "tempy": "^0.3.0", - "tsd": "^0.7.3", - "xo": "^0.24.0" - } -} diff --git a/node_modules/find-up/readme.md b/node_modules/find-up/readme.md deleted file mode 100644 index d6a21e5..0000000 --- a/node_modules/find-up/readme.md +++ /dev/null @@ -1,156 +0,0 @@ -# find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) - -> Find a file or directory by walking up parent directories - - -## Install - -``` -$ npm install find-up -``` - - -## Usage - -``` -/ -└── Users - └── sindresorhus - ├── unicorn.png - └── foo - └── bar - ├── baz - └── example.js -``` - -`example.js` - -```js -const path = require('path'); -const findUp = require('find-up'); - -(async () => { - console.log(await findUp('unicorn.png')); - //=> '/Users/sindresorhus/unicorn.png' - - console.log(await findUp(['rainbow.png', 'unicorn.png'])); - //=> '/Users/sindresorhus/unicorn.png' - - console.log(await findUp(async directory => { - const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); - return hasUnicorns && directory; - }, {type: 'directory'})); - //=> '/Users/sindresorhus' -})(); -``` - - -## API - -### findUp(name, options?) -### findUp(matcher, options?) - -Returns a `Promise` for either the path or `undefined` if it couldn't be found. - -### findUp([...name], options?) - -Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found. - -### findUp.sync(name, options?) -### findUp.sync(matcher, options?) - -Returns a path or `undefined` if it couldn't be found. - -### findUp.sync([...name], options?) - -Returns the first path found (by respecting the order of the array) or `undefined` if none could be found. - -#### name - -Type: `string` - -Name of the file or directory to find. - -#### matcher - -Type: `Function` - -A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases. - -When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path. - -#### options - -Type: `object` - -##### cwd - -Type: `string`
-Default: `process.cwd()` - -Directory to start from. - -##### type - -Type: `string`
-Default: `'file'`
-Values: `'file'` `'directory'` - -The type of paths that can match. - -##### allowSymlinks - -Type: `boolean`
-Default: `true` - -Allow symbolic links to match if they point to the chosen path type. - -### findUp.exists(path) - -Returns a `Promise` of whether the path exists. - -### findUp.sync.exists(path) - -Returns a `boolean` of whether the path exists. - -#### path - -Type: `string` - -Path to a file or directory. - -### findUp.stop - -A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem. - -```js -const path = require('path'); -const findUp = require('find-up'); - -(async () => { - await findUp(directory => { - return path.basename(directory) === 'work' ? findUp.stop : 'logo.png'; - }); -})(); -``` - - -## Related - -- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module -- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file -- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package -- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path - - ---- - -

- - Get professional support for 'find-up' with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/flat/.travis.yml b/node_modules/flat/.travis.yml deleted file mode 100644 index f35768a..0000000 --- a/node_modules/flat/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "6" - - "7" - - "8" - - "10" - - "12" - - "14" diff --git a/node_modules/flat/LICENSE b/node_modules/flat/LICENSE deleted file mode 100644 index d99b655..0000000 --- a/node_modules/flat/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2014, Hugh Kennedy -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/flat/README.md b/node_modules/flat/README.md deleted file mode 100644 index a036a9f..0000000 --- a/node_modules/flat/README.md +++ /dev/null @@ -1,236 +0,0 @@ -# flat [![Build Status](https://secure.travis-ci.org/hughsk/flat.png?branch=master)](http://travis-ci.org/hughsk/flat) - -Take a nested Javascript object and flatten it, or unflatten an object with -delimited keys. - -## Installation - -``` bash -$ npm install flat -``` - -## Methods - -### flatten(original, options) - -Flattens the object - it'll return an object one level deep, regardless of how -nested the original object was: - -``` javascript -var flatten = require('flat') - -flatten({ - key1: { - keyA: 'valueI' - }, - key2: { - keyB: 'valueII' - }, - key3: { a: { b: { c: 2 } } } -}) - -// { -// 'key1.keyA': 'valueI', -// 'key2.keyB': 'valueII', -// 'key3.a.b.c': 2 -// } -``` - -### unflatten(original, options) - -Flattening is reversible too, you can call `flatten.unflatten()` on an object: - -``` javascript -var unflatten = require('flat').unflatten - -unflatten({ - 'three.levels.deep': 42, - 'three.levels': { - nested: true - } -}) - -// { -// three: { -// levels: { -// deep: 42, -// nested: true -// } -// } -// } -``` - -## Options - -### delimiter - -Use a custom delimiter for (un)flattening your objects, instead of `.`. - -### safe - -When enabled, both `flat` and `unflatten` will preserve arrays and their -contents. This is disabled by default. - -``` javascript -var flatten = require('flat') - -flatten({ - this: [ - { contains: 'arrays' }, - { preserving: { - them: 'for you' - }} - ] -}, { - safe: true -}) - -// { -// 'this': [ -// { contains: 'arrays' }, -// { preserving: { -// them: 'for you' -// }} -// ] -// } -``` - -### object - -When enabled, arrays will not be created automatically when calling unflatten, like so: - -``` javascript -unflatten({ - 'hello.you.0': 'ipsum', - 'hello.you.1': 'lorem', - 'hello.other.world': 'foo' -}, { object: true }) - -// hello: { -// you: { -// 0: 'ipsum', -// 1: 'lorem', -// }, -// other: { world: 'foo' } -// } -``` - -### overwrite - -When enabled, existing keys in the unflattened object may be overwritten if they cannot hold a newly encountered nested value: - -```javascript -unflatten({ - 'TRAVIS': 'true', - 'TRAVIS.DIR': '/home/travis/build/kvz/environmental' -}, { overwrite: true }) - -// TRAVIS: { -// DIR: '/home/travis/build/kvz/environmental' -// } -``` - -Without `overwrite` set to `true`, the `TRAVIS` key would already have been set to a string, thus could not accept the nested `DIR` element. - -This only makes sense on ordered arrays, and since we're overwriting data, should be used with care. - - -### maxDepth - -Maximum number of nested objects to flatten. - -``` javascript -var flatten = require('flat') - -flatten({ - key1: { - keyA: 'valueI' - }, - key2: { - keyB: 'valueII' - }, - key3: { a: { b: { c: 2 } } } -}, { maxDepth: 2 }) - -// { -// 'key1.keyA': 'valueI', -// 'key2.keyB': 'valueII', -// 'key3.a': { b: { c: 2 } } -// } -``` - -### transformKey - -Transform each part of a flat key before and after flattening. - -```javascript -var flatten = require('flat') -var unflatten = require('flat').unflatten - -flatten({ - key1: { - keyA: 'valueI' - }, - key2: { - keyB: 'valueII' - }, - key3: { a: { b: { c: 2 } } } -}, { - transformKey: function(key){ - return '__' + key + '__'; - } -}) - -// { -// '__key1__.__keyA__': 'valueI', -// '__key2__.__keyB__': 'valueII', -// '__key3__.__a__.__b__.__c__': 2 -// } - -unflatten({ - '__key1__.__keyA__': 'valueI', - '__key2__.__keyB__': 'valueII', - '__key3__.__a__.__b__.__c__': 2 -}, { - transformKey: function(key){ - return key.substring(2, key.length - 2) - } -}) - -// { -// key1: { -// keyA: 'valueI' -// }, -// key2: { -// keyB: 'valueII' -// }, -// key3: { a: { b: { c: 2 } } } -// } -``` - -## Command Line Usage - -`flat` is also available as a command line tool. You can run it with -[`npx`](https://ghub.io/npx): - -```sh -npx flat foo.json -``` - -Or install the `flat` command globally: - -```sh -npm i -g flat && flat foo.json -``` - -Accepts a filename as an argument: - -```sh -flat foo.json -``` - -Also accepts JSON on stdin: - -```sh -cat foo.json | flat -``` diff --git a/node_modules/flat/cli.js b/node_modules/flat/cli.js deleted file mode 100644 index e4f96b3..0000000 --- a/node_modules/flat/cli.js +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs') -const path = require('path') -const readline = require('readline') - -const flat = require('./index') - -const filepath = process.argv.slice(2)[0] -if (filepath) { - // Read from file - const file = path.resolve(process.cwd(), filepath) - fs.accessSync(file, fs.constants.R_OK) // allow to throw if not readable - out(require(file)) -} else if (process.stdin.isTTY) { - usage(0) -} else { - // Read from newline-delimited STDIN - const lines = [] - readline.createInterface({ - input: process.stdin, - output: process.stdout, - terminal: false - }) - .on('line', line => lines.push(line)) - .on('close', () => out(JSON.parse(lines.join('\n')))) -} - -function out (data) { - process.stdout.write(JSON.stringify(flat(data), null, 2)) -} - -function usage (code) { - console.log(` -Usage: - -flat foo.json -cat foo.json | flat -`) - - process.exit(code || 0) -} diff --git a/node_modules/flat/index.js b/node_modules/flat/index.js deleted file mode 100644 index 2a5d7ca..0000000 --- a/node_modules/flat/index.js +++ /dev/null @@ -1,158 +0,0 @@ -module.exports = flatten -flatten.flatten = flatten -flatten.unflatten = unflatten - -function isBuffer (obj) { - return obj && - obj.constructor && - (typeof obj.constructor.isBuffer === 'function') && - obj.constructor.isBuffer(obj) -} - -function keyIdentity (key) { - return key -} - -function flatten (target, opts) { - opts = opts || {} - - const delimiter = opts.delimiter || '.' - const maxDepth = opts.maxDepth - const transformKey = opts.transformKey || keyIdentity - const output = {} - - function step (object, prev, currentDepth) { - currentDepth = currentDepth || 1 - Object.keys(object).forEach(function (key) { - const value = object[key] - const isarray = opts.safe && Array.isArray(value) - const type = Object.prototype.toString.call(value) - const isbuffer = isBuffer(value) - const isobject = ( - type === '[object Object]' || - type === '[object Array]' - ) - - const newKey = prev - ? prev + delimiter + transformKey(key) - : transformKey(key) - - if (!isarray && !isbuffer && isobject && Object.keys(value).length && - (!opts.maxDepth || currentDepth < maxDepth)) { - return step(value, newKey, currentDepth + 1) - } - - output[newKey] = value - }) - } - - step(target) - - return output -} - -function unflatten (target, opts) { - opts = opts || {} - - const delimiter = opts.delimiter || '.' - const overwrite = opts.overwrite || false - const transformKey = opts.transformKey || keyIdentity - const result = {} - - const isbuffer = isBuffer(target) - if (isbuffer || Object.prototype.toString.call(target) !== '[object Object]') { - return target - } - - // safely ensure that the key is - // an integer. - function getkey (key) { - const parsedKey = Number(key) - - return ( - isNaN(parsedKey) || - key.indexOf('.') !== -1 || - opts.object - ) ? key - : parsedKey - } - - function addKeys (keyPrefix, recipient, target) { - return Object.keys(target).reduce(function (result, key) { - result[keyPrefix + delimiter + key] = target[key] - - return result - }, recipient) - } - - function isEmpty (val) { - const type = Object.prototype.toString.call(val) - const isArray = type === '[object Array]' - const isObject = type === '[object Object]' - - if (!val) { - return true - } else if (isArray) { - return !val.length - } else if (isObject) { - return !Object.keys(val).length - } - } - - target = Object.keys(target).reduce(function (result, key) { - const type = Object.prototype.toString.call(target[key]) - const isObject = (type === '[object Object]' || type === '[object Array]') - if (!isObject || isEmpty(target[key])) { - result[key] = target[key] - return result - } else { - return addKeys( - key, - result, - flatten(target[key], opts) - ) - } - }, {}) - - Object.keys(target).forEach(function (key) { - const split = key.split(delimiter).map(transformKey) - let key1 = getkey(split.shift()) - let key2 = getkey(split[0]) - let recipient = result - - while (key2 !== undefined) { - if (key1 === '__proto__') { - return - } - - const type = Object.prototype.toString.call(recipient[key1]) - const isobject = ( - type === '[object Object]' || - type === '[object Array]' - ) - - // do not write over falsey, non-undefined values if overwrite is false - if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') { - return - } - - if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) { - recipient[key1] = ( - typeof key2 === 'number' && - !opts.object ? [] : {} - ) - } - - recipient = recipient[key1] - if (split.length > 0) { - key1 = getkey(split.shift()) - key2 = getkey(split[0]) - } - } - - // unflatten again for 'messy objects' - recipient[key1] = unflatten(target[key], opts) - }) - - return result -} diff --git a/node_modules/flat/package.json b/node_modules/flat/package.json deleted file mode 100644 index c2fbc96..0000000 --- a/node_modules/flat/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "flat", - "version": "5.0.2", - "main": "index.js", - "bin": "cli.js", - "scripts": { - "test": "mocha -u tdd --reporter spec && standard cli.js index.js test/index.js" - }, - "license": "BSD-3-Clause", - "description": "Take a nested Javascript object and flatten it, or unflatten an object with delimited keys", - "devDependencies": { - "mocha": "~8.1.1", - "standard": "^14.3.4" - }, - "directories": { - "test": "test" - }, - "dependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/hughsk/flat.git" - }, - "keywords": [ - "flat", - "json", - "flatten", - "unflatten", - "split", - "object", - "nested" - ], - "author": "Hugh Kennedy (http://hughskennedy.com)", - "bugs": { - "url": "https://github.com/hughsk/flat/issues" - }, - "homepage": "https://github.com/hughsk/flat" -} diff --git a/node_modules/flat/test/test.js b/node_modules/flat/test/test.js deleted file mode 100644 index 7f4ee3d..0000000 --- a/node_modules/flat/test/test.js +++ /dev/null @@ -1,643 +0,0 @@ -/* globals suite test */ - -const assert = require('assert') -const path = require('path') -const { exec } = require('child_process') -const pkg = require('../package.json') -const flat = require('../index') - -const flatten = flat.flatten -const unflatten = flat.unflatten - -const primitives = { - String: 'good morning', - Number: 1234.99, - Boolean: true, - Date: new Date(), - null: null, - undefined: undefined -} - -suite('Flatten Primitives', function () { - Object.keys(primitives).forEach(function (key) { - const value = primitives[key] - - test(key, function () { - assert.deepStrictEqual(flatten({ - hello: { - world: value - } - }), { - 'hello.world': value - }) - }) - }) -}) - -suite('Unflatten Primitives', function () { - Object.keys(primitives).forEach(function (key) { - const value = primitives[key] - - test(key, function () { - assert.deepStrictEqual(unflatten({ - 'hello.world': value - }), { - hello: { - world: value - } - }) - }) - }) -}) - -suite('Flatten', function () { - test('Nested once', function () { - assert.deepStrictEqual(flatten({ - hello: { - world: 'good morning' - } - }), { - 'hello.world': 'good morning' - }) - }) - - test('Nested twice', function () { - assert.deepStrictEqual(flatten({ - hello: { - world: { - again: 'good morning' - } - } - }), { - 'hello.world.again': 'good morning' - }) - }) - - test('Multiple Keys', function () { - assert.deepStrictEqual(flatten({ - hello: { - lorem: { - ipsum: 'again', - dolor: 'sit' - } - }, - world: { - lorem: { - ipsum: 'again', - dolor: 'sit' - } - } - }), { - 'hello.lorem.ipsum': 'again', - 'hello.lorem.dolor': 'sit', - 'world.lorem.ipsum': 'again', - 'world.lorem.dolor': 'sit' - }) - }) - - test('Custom Delimiter', function () { - assert.deepStrictEqual(flatten({ - hello: { - world: { - again: 'good morning' - } - } - }, { - delimiter: ':' - }), { - 'hello:world:again': 'good morning' - }) - }) - - test('Empty Objects', function () { - assert.deepStrictEqual(flatten({ - hello: { - empty: { - nested: {} - } - } - }), { - 'hello.empty.nested': {} - }) - }) - - if (typeof Buffer !== 'undefined') { - test('Buffer', function () { - assert.deepStrictEqual(flatten({ - hello: { - empty: { - nested: Buffer.from('test') - } - } - }), { - 'hello.empty.nested': Buffer.from('test') - }) - }) - } - - if (typeof Uint8Array !== 'undefined') { - test('typed arrays', function () { - assert.deepStrictEqual(flatten({ - hello: { - empty: { - nested: new Uint8Array([1, 2, 3, 4]) - } - } - }), { - 'hello.empty.nested': new Uint8Array([1, 2, 3, 4]) - }) - }) - } - - test('Custom Depth', function () { - assert.deepStrictEqual(flatten({ - hello: { - world: { - again: 'good morning' - } - }, - lorem: { - ipsum: { - dolor: 'good evening' - } - } - }, { - maxDepth: 2 - }), { - 'hello.world': { - again: 'good morning' - }, - 'lorem.ipsum': { - dolor: 'good evening' - } - }) - }) - - test('Transformed Keys', function () { - assert.deepStrictEqual(flatten({ - hello: { - world: { - again: 'good morning' - } - }, - lorem: { - ipsum: { - dolor: 'good evening' - } - } - }, { - transformKey: function (key) { - return '__' + key + '__' - } - }), { - '__hello__.__world__.__again__': 'good morning', - '__lorem__.__ipsum__.__dolor__': 'good evening' - }) - }) - - test('Should keep number in the left when object', function () { - assert.deepStrictEqual(flatten({ - hello: { - '0200': 'world', - '0500': 'darkness my old friend' - } - }), { - 'hello.0200': 'world', - 'hello.0500': 'darkness my old friend' - }) - }) -}) - -suite('Unflatten', function () { - test('Nested once', function () { - assert.deepStrictEqual({ - hello: { - world: 'good morning' - } - }, unflatten({ - 'hello.world': 'good morning' - })) - }) - - test('Nested twice', function () { - assert.deepStrictEqual({ - hello: { - world: { - again: 'good morning' - } - } - }, unflatten({ - 'hello.world.again': 'good morning' - })) - }) - - test('Multiple Keys', function () { - assert.deepStrictEqual({ - hello: { - lorem: { - ipsum: 'again', - dolor: 'sit' - } - }, - world: { - greet: 'hello', - lorem: { - ipsum: 'again', - dolor: 'sit' - } - } - }, unflatten({ - 'hello.lorem.ipsum': 'again', - 'hello.lorem.dolor': 'sit', - 'world.lorem.ipsum': 'again', - 'world.lorem.dolor': 'sit', - world: { greet: 'hello' } - })) - }) - - test('nested objects do not clobber each other when a.b inserted before a', function () { - const x = {} - x['foo.bar'] = { t: 123 } - x.foo = { p: 333 } - assert.deepStrictEqual(unflatten(x), { - foo: { - bar: { - t: 123 - }, - p: 333 - } - }) - }) - - test('Custom Delimiter', function () { - assert.deepStrictEqual({ - hello: { - world: { - again: 'good morning' - } - } - }, unflatten({ - 'hello world again': 'good morning' - }, { - delimiter: ' ' - })) - }) - - test('Overwrite', function () { - assert.deepStrictEqual({ - travis: { - build: { - dir: '/home/travis/build/kvz/environmental' - } - } - }, unflatten({ - travis: 'true', - travis_build_dir: '/home/travis/build/kvz/environmental' - }, { - delimiter: '_', - overwrite: true - })) - }) - - test('Transformed Keys', function () { - assert.deepStrictEqual(unflatten({ - '__hello__.__world__.__again__': 'good morning', - '__lorem__.__ipsum__.__dolor__': 'good evening' - }, { - transformKey: function (key) { - return key.substring(2, key.length - 2) - } - }), { - hello: { - world: { - again: 'good morning' - } - }, - lorem: { - ipsum: { - dolor: 'good evening' - } - } - }) - }) - - test('Messy', function () { - assert.deepStrictEqual({ - hello: { world: 'again' }, - lorem: { ipsum: 'another' }, - good: { - morning: { - hash: { - key: { - nested: { - deep: { - and: { - even: { - deeper: { still: 'hello' } - } - } - } - } - } - }, - again: { testing: { this: 'out' } } - } - } - }, unflatten({ - 'hello.world': 'again', - 'lorem.ipsum': 'another', - 'good.morning': { - 'hash.key': { - 'nested.deep': { - 'and.even.deeper.still': 'hello' - } - } - }, - 'good.morning.again': { - 'testing.this': 'out' - } - })) - }) - - suite('Overwrite + non-object values in key positions', function () { - test('non-object keys + overwrite should be overwritten', function () { - assert.deepStrictEqual(flat.unflatten({ a: null, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) - assert.deepStrictEqual(flat.unflatten({ a: 0, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) - assert.deepStrictEqual(flat.unflatten({ a: 1, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) - assert.deepStrictEqual(flat.unflatten({ a: '', 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) - }) - - test('overwrite value should not affect undefined keys', function () { - assert.deepStrictEqual(flat.unflatten({ a: undefined, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) - assert.deepStrictEqual(flat.unflatten({ a: undefined, 'a.b': 'c' }, { overwrite: false }), { a: { b: 'c' } }) - }) - - test('if no overwrite, should ignore nested values under non-object key', function () { - assert.deepStrictEqual(flat.unflatten({ a: null, 'a.b': 'c' }), { a: null }) - assert.deepStrictEqual(flat.unflatten({ a: 0, 'a.b': 'c' }), { a: 0 }) - assert.deepStrictEqual(flat.unflatten({ a: 1, 'a.b': 'c' }), { a: 1 }) - assert.deepStrictEqual(flat.unflatten({ a: '', 'a.b': 'c' }), { a: '' }) - }) - }) - - suite('.safe', function () { - test('Should protect arrays when true', function () { - assert.deepStrictEqual(flatten({ - hello: [ - { world: { again: 'foo' } }, - { lorem: 'ipsum' } - ], - another: { - nested: [{ array: { too: 'deep' } }] - }, - lorem: { - ipsum: 'whoop' - } - }, { - safe: true - }), { - hello: [ - { world: { again: 'foo' } }, - { lorem: 'ipsum' } - ], - 'lorem.ipsum': 'whoop', - 'another.nested': [{ array: { too: 'deep' } }] - }) - }) - - test('Should not protect arrays when false', function () { - assert.deepStrictEqual(flatten({ - hello: [ - { world: { again: 'foo' } }, - { lorem: 'ipsum' } - ] - }, { - safe: false - }), { - 'hello.0.world.again': 'foo', - 'hello.1.lorem': 'ipsum' - }) - }) - - test('Empty objects should not be removed', function () { - assert.deepStrictEqual(unflatten({ - foo: [], - bar: {} - }), { foo: [], bar: {} }) - }) - }) - - suite('.object', function () { - test('Should create object instead of array when true', function () { - const unflattened = unflatten({ - 'hello.you.0': 'ipsum', - 'hello.you.1': 'lorem', - 'hello.other.world': 'foo' - }, { - object: true - }) - assert.deepStrictEqual({ - hello: { - you: { - 0: 'ipsum', - 1: 'lorem' - }, - other: { world: 'foo' } - } - }, unflattened) - assert(!Array.isArray(unflattened.hello.you)) - }) - - test('Should create object instead of array when nested', function () { - const unflattened = unflatten({ - hello: { - 'you.0': 'ipsum', - 'you.1': 'lorem', - 'other.world': 'foo' - } - }, { - object: true - }) - assert.deepStrictEqual({ - hello: { - you: { - 0: 'ipsum', - 1: 'lorem' - }, - other: { world: 'foo' } - } - }, unflattened) - assert(!Array.isArray(unflattened.hello.you)) - }) - - test('Should keep the zero in the left when object is true', function () { - const unflattened = unflatten({ - 'hello.0200': 'world', - 'hello.0500': 'darkness my old friend' - }, { - object: true - }) - - assert.deepStrictEqual({ - hello: { - '0200': 'world', - '0500': 'darkness my old friend' - } - }, unflattened) - }) - - test('Should not create object when false', function () { - const unflattened = unflatten({ - 'hello.you.0': 'ipsum', - 'hello.you.1': 'lorem', - 'hello.other.world': 'foo' - }, { - object: false - }) - assert.deepStrictEqual({ - hello: { - you: ['ipsum', 'lorem'], - other: { world: 'foo' } - } - }, unflattened) - assert(Array.isArray(unflattened.hello.you)) - }) - }) - - if (typeof Buffer !== 'undefined') { - test('Buffer', function () { - assert.deepStrictEqual(unflatten({ - 'hello.empty.nested': Buffer.from('test') - }), { - hello: { - empty: { - nested: Buffer.from('test') - } - } - }) - }) - } - - if (typeof Uint8Array !== 'undefined') { - test('typed arrays', function () { - assert.deepStrictEqual(unflatten({ - 'hello.empty.nested': new Uint8Array([1, 2, 3, 4]) - }), { - hello: { - empty: { - nested: new Uint8Array([1, 2, 3, 4]) - } - } - }) - }) - } - - test('should not pollute prototype', function () { - unflatten({ - '__proto__.polluted': true - }) - unflatten({ - 'prefix.__proto__.polluted': true - }) - unflatten({ - 'prefix.0.__proto__.polluted': true - }) - - assert.notStrictEqual({}.polluted, true) - }) -}) - -suite('Arrays', function () { - test('Should be able to flatten arrays properly', function () { - assert.deepStrictEqual({ - 'a.0': 'foo', - 'a.1': 'bar' - }, flatten({ - a: ['foo', 'bar'] - })) - }) - - test('Should be able to revert and reverse array serialization via unflatten', function () { - assert.deepStrictEqual({ - a: ['foo', 'bar'] - }, unflatten({ - 'a.0': 'foo', - 'a.1': 'bar' - })) - }) - - test('Array typed objects should be restored by unflatten', function () { - assert.strictEqual( - Object.prototype.toString.call(['foo', 'bar']) - , Object.prototype.toString.call(unflatten({ - 'a.0': 'foo', - 'a.1': 'bar' - }).a) - ) - }) - - test('Do not include keys with numbers inside them', function () { - assert.deepStrictEqual(unflatten({ - '1key.2_key': 'ok' - }), { - '1key': { - '2_key': 'ok' - } - }) - }) -}) - -suite('Order of Keys', function () { - test('Order of keys should not be changed after round trip flatten/unflatten', function () { - const obj = { - b: 1, - abc: { - c: [{ - d: 1, - bca: 1, - a: 1 - }] - }, - a: 1 - } - const result = unflatten( - flatten(obj) - ) - - assert.deepStrictEqual(Object.keys(obj), Object.keys(result)) - assert.deepStrictEqual(Object.keys(obj.abc), Object.keys(result.abc)) - assert.deepStrictEqual(Object.keys(obj.abc.c[0]), Object.keys(result.abc.c[0])) - }) -}) - -suite('CLI', function () { - test('can take filename', function (done) { - const cli = path.resolve(__dirname, '..', pkg.bin) - const pkgJSON = path.resolve(__dirname, '..', 'package.json') - exec(`${cli} ${pkgJSON}`, (err, stdout, stderr) => { - assert.ifError(err) - assert.strictEqual(stdout.trim(), JSON.stringify(flatten(pkg), null, 2)) - done() - }) - }) - - test('exits with usage if no file', function (done) { - const cli = path.resolve(__dirname, '..', pkg.bin) - const pkgJSON = path.resolve(__dirname, '..', 'package.json') - exec(`${cli} ${pkgJSON}`, (err, stdout, stderr) => { - assert.ifError(err) - assert.strictEqual(stdout.trim(), JSON.stringify(flatten(pkg), null, 2)) - done() - }) - }) - - test('can take piped file', function (done) { - const cli = path.resolve(__dirname, '..', pkg.bin) - const pkgJSON = path.resolve(__dirname, '..', 'package.json') - exec(`cat ${pkgJSON} | ${cli}`, (err, stdout, stderr) => { - assert.ifError(err) - assert.strictEqual(stdout.trim(), JSON.stringify(flatten(pkg), null, 2)) - done() - }) - }) -}) diff --git a/node_modules/function-bind/.eslintrc b/node_modules/function-bind/.eslintrc deleted file mode 100644 index 71a054f..0000000 --- a/node_modules/function-bind/.eslintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "indent": [2, 4], - "no-new-func": [1], - }, - - "overrides": [ - { - "files": "test/**", - "rules": { - "max-lines-per-function": 0, - "strict": [0] - }, - }, - ], -} diff --git a/node_modules/function-bind/.github/FUNDING.yml b/node_modules/function-bind/.github/FUNDING.yml deleted file mode 100644 index 7448219..0000000 --- a/node_modules/function-bind/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/function-bind -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/function-bind/.github/SECURITY.md b/node_modules/function-bind/.github/SECURITY.md deleted file mode 100644 index 82e4285..0000000 --- a/node_modules/function-bind/.github/SECURITY.md +++ /dev/null @@ -1,3 +0,0 @@ -# Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. diff --git a/node_modules/function-bind/.nycrc b/node_modules/function-bind/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/function-bind/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/function-bind/CHANGELOG.md b/node_modules/function-bind/CHANGELOG.md deleted file mode 100644 index f9e6cc0..0000000 --- a/node_modules/function-bind/CHANGELOG.md +++ /dev/null @@ -1,136 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.1.2](https://github.com/ljharb/function-bind/compare/v1.1.1...v1.1.2) - 2023-10-12 - -### Merged - -- Point to the correct file [`#16`](https://github.com/ljharb/function-bind/pull/16) - -### Commits - -- [Tests] migrate tests to Github Actions [`4f8b57c`](https://github.com/ljharb/function-bind/commit/4f8b57c02f2011fe9ae353d5e74e8745f0988af8) -- [Tests] remove `jscs` [`90eb2ed`](https://github.com/ljharb/function-bind/commit/90eb2edbeefd5b76cd6c3a482ea3454db169b31f) -- [meta] update `.gitignore` [`53fcdc3`](https://github.com/ljharb/function-bind/commit/53fcdc371cd66634d6e9b71c836a50f437e89fed) -- [Tests] up to `node` `v11.10`, `v10.15`, `v9.11`, `v8.15`, `v6.16`, `v4.9`; use `nvm install-latest-npm`; run audit script in tests [`1fe8f6e`](https://github.com/ljharb/function-bind/commit/1fe8f6e9aed0dfa8d8b3cdbd00c7f5ea0cd2b36e) -- [meta] add `auto-changelog` [`1921fcb`](https://github.com/ljharb/function-bind/commit/1921fcb5b416b63ffc4acad051b6aad5722f777d) -- [Robustness] remove runtime dependency on all builtins except `.apply` [`f743e61`](https://github.com/ljharb/function-bind/commit/f743e61aa6bb2360358c04d4884c9db853d118b7) -- Docs: enable badges; update wording [`503cb12`](https://github.com/ljharb/function-bind/commit/503cb12d998b5f91822776c73332c7adcd6355dd) -- [readme] update badges [`290c5db`](https://github.com/ljharb/function-bind/commit/290c5dbbbda7264efaeb886552a374b869a4bb48) -- [Tests] switch to nyc for coverage [`ea360ba`](https://github.com/ljharb/function-bind/commit/ea360ba907fc2601ed18d01a3827fa2d3533cdf8) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`cae5e9e`](https://github.com/ljharb/function-bind/commit/cae5e9e07a5578dc6df26c03ee22851ce05b943c) -- [meta] add `funding` field; create FUNDING.yml [`c9f4274`](https://github.com/ljharb/function-bind/commit/c9f4274aa80ea3aae9657a3938fdba41a3b04ca6) -- [Tests] fix eslint errors from #15 [`f69aaa2`](https://github.com/ljharb/function-bind/commit/f69aaa2beb2fdab4415bfb885760a699d0b9c964) -- [actions] fix permissions [`99a0cd9`](https://github.com/ljharb/function-bind/commit/99a0cd9f3b5bac223a0d572f081834cd73314be7) -- [meta] use `npmignore` to autogenerate an npmignore file [`f03b524`](https://github.com/ljharb/function-bind/commit/f03b524ca91f75a109a5d062f029122c86ecd1ae) -- [Dev Deps] update `@ljharb/eslint‑config`, `eslint`, `tape` [`7af9300`](https://github.com/ljharb/function-bind/commit/7af930023ae2ce7645489532821e4fbbcd7a2280) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`64a9127`](https://github.com/ljharb/function-bind/commit/64a9127ab0bd331b93d6572eaf6e9971967fc08c) -- [Tests] use `aud` instead of `npm audit` [`e75069c`](https://github.com/ljharb/function-bind/commit/e75069c50010a8fcce2a9ce2324934c35fdb4386) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`d03555c`](https://github.com/ljharb/function-bind/commit/d03555ca59dea3b71ce710045e4303b9e2619e28) -- [meta] add `safe-publish-latest` [`9c8f809`](https://github.com/ljharb/function-bind/commit/9c8f8092aed027d7e80c94f517aa892385b64f09) -- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`baf6893`](https://github.com/ljharb/function-bind/commit/baf6893e27f5b59abe88bc1995e6f6ed1e527397) -- [meta] create SECURITY.md [`4db1779`](https://github.com/ljharb/function-bind/commit/4db17799f1f28ae294cb95e0081ca2b591c3911b) -- [Tests] add `npm run audit` [`c8b38ec`](https://github.com/ljharb/function-bind/commit/c8b38ec40ed3f85dabdee40ed4148f1748375bc2) -- Revert "Point to the correct file" [`05cdf0f`](https://github.com/ljharb/function-bind/commit/05cdf0fa205c6a3c5ba40bbedd1dfa9874f915c9) - -## [v1.1.1](https://github.com/ljharb/function-bind/compare/v1.1.0...v1.1.1) - 2017-08-28 - -### Commits - -- [Tests] up to `node` `v8`; newer npm breaks on older node; fix scripts [`817f7d2`](https://github.com/ljharb/function-bind/commit/817f7d28470fdbff8ef608d4d565dd4d1430bc5e) -- [Dev Deps] update `eslint`, `jscs`, `tape`, `@ljharb/eslint-config` [`854288b`](https://github.com/ljharb/function-bind/commit/854288b1b6f5c555f89aceb9eff1152510262084) -- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`83e639f`](https://github.com/ljharb/function-bind/commit/83e639ff74e6cd6921285bccec22c1bcf72311bd) -- Only apps should have lockfiles [`5ed97f5`](https://github.com/ljharb/function-bind/commit/5ed97f51235c17774e0832e122abda0f3229c908) -- Use a SPDX-compliant “license” field. [`5feefea`](https://github.com/ljharb/function-bind/commit/5feefea0dc0193993e83e5df01ded424403a5381) - -## [v1.1.0](https://github.com/ljharb/function-bind/compare/v1.0.2...v1.1.0) - 2016-02-14 - -### Commits - -- Update `eslint`, `tape`; use my personal shared `eslint` config [`9c9062a`](https://github.com/ljharb/function-bind/commit/9c9062abbe9dd70b59ea2c3a3c3a81f29b457097) -- Add `npm run eslint` [`dd96c56`](https://github.com/ljharb/function-bind/commit/dd96c56720034a3c1ffee10b8a59a6f7c53e24ad) -- [New] return the native `bind` when available. [`82186e0`](https://github.com/ljharb/function-bind/commit/82186e03d73e580f95ff167e03f3582bed90ed72) -- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`a3dd767`](https://github.com/ljharb/function-bind/commit/a3dd76720c795cb7f4586b0544efabf8aa107b8b) -- Update `eslint` [`3dae2f7`](https://github.com/ljharb/function-bind/commit/3dae2f7423de30a2d20313ddb1edc19660142fe9) -- Update `tape`, `covert`, `jscs` [`a181eee`](https://github.com/ljharb/function-bind/commit/a181eee0cfa24eb229c6e843a971f36e060a2f6a) -- [Tests] up to `node` `v5.6`, `v4.3` [`964929a`](https://github.com/ljharb/function-bind/commit/964929a6a4ddb36fb128de2bcc20af5e4f22e1ed) -- Test up to `io.js` `v2.1` [`2be7310`](https://github.com/ljharb/function-bind/commit/2be7310f2f74886a7124ca925be411117d41d5ea) -- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`45f3d68`](https://github.com/ljharb/function-bind/commit/45f3d6865c6ca93726abcef54febe009087af101) -- [Dev Deps] update `tape`, `jscs` [`6e1340d`](https://github.com/ljharb/function-bind/commit/6e1340d94642deaecad3e717825db641af4f8b1f) -- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`d9bad2b`](https://github.com/ljharb/function-bind/commit/d9bad2b778b1b3a6dd2876087b88b3acf319f8cc) -- Update `eslint` [`935590c`](https://github.com/ljharb/function-bind/commit/935590caa024ab356102e4858e8fc315b2ccc446) -- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`8c9a1ef`](https://github.com/ljharb/function-bind/commit/8c9a1efd848e5167887aa8501857a0940a480c57) -- Test on `io.js` `v2.2` [`9a3a38c`](https://github.com/ljharb/function-bind/commit/9a3a38c92013aed6e108666e7bd40969b84ac86e) -- Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. [`69afc26`](https://github.com/ljharb/function-bind/commit/69afc2617405b147dd2a8d8ae73ca9e9283f18b4) -- [Dev Deps] Update `tape`, `eslint` [`36c1be0`](https://github.com/ljharb/function-bind/commit/36c1be0ab12b45fe5df6b0fdb01a5d5137fd0115) -- Update `tape`, `jscs` [`98d8303`](https://github.com/ljharb/function-bind/commit/98d8303cd5ca1c6b8f985469f86b0d44d7d45f6e) -- Update `jscs` [`9633a4e`](https://github.com/ljharb/function-bind/commit/9633a4e9fbf82051c240855166e468ba8ba0846f) -- Update `tape`, `jscs` [`c80ef0f`](https://github.com/ljharb/function-bind/commit/c80ef0f46efc9791e76fa50de4414092ac147831) -- Test up to `io.js` `v3.0` [`7e2c853`](https://github.com/ljharb/function-bind/commit/7e2c8537d52ab9cf5a655755561d8917684c0df4) -- Test on `io.js` `v2.4` [`5a199a2`](https://github.com/ljharb/function-bind/commit/5a199a27ba46795ba5eaf0845d07d4b8232895c9) -- Test on `io.js` `v2.3` [`a511b88`](https://github.com/ljharb/function-bind/commit/a511b8896de0bddf3b56862daa416c701f4d0453) -- Fixing a typo from 822b4e1938db02dc9584aa434fd3a45cb20caf43 [`732d6b6`](https://github.com/ljharb/function-bind/commit/732d6b63a9b33b45230e630dbcac7a10855d3266) -- Update `jscs` [`da52a48`](https://github.com/ljharb/function-bind/commit/da52a4886c06d6490f46ae30b15e4163ba08905d) -- Lock covert to v1.0.0. [`d6150fd`](https://github.com/ljharb/function-bind/commit/d6150fda1e6f486718ebdeff823333d9e48e7430) - -## [v1.0.2](https://github.com/ljharb/function-bind/compare/v1.0.1...v1.0.2) - 2014-10-04 - -## [v1.0.1](https://github.com/ljharb/function-bind/compare/v1.0.0...v1.0.1) - 2014-10-03 - -### Merged - -- make CI build faster [`#3`](https://github.com/ljharb/function-bind/pull/3) - -### Commits - -- Using my standard jscs.json [`d8ee94c`](https://github.com/ljharb/function-bind/commit/d8ee94c993eff0a84cf5744fe6a29627f5cffa1a) -- Adding `npm run lint` [`7571ab7`](https://github.com/ljharb/function-bind/commit/7571ab7dfdbd99b25a1dbb2d232622bd6f4f9c10) -- Using consistent indentation [`e91a1b1`](https://github.com/ljharb/function-bind/commit/e91a1b13a61e99ec1e530e299b55508f74218a95) -- Updating jscs [`7e17892`](https://github.com/ljharb/function-bind/commit/7e1789284bc629bc9c1547a61c9b227bbd8c7a65) -- Using consistent quotes [`c50b57f`](https://github.com/ljharb/function-bind/commit/c50b57fcd1c5ec38320979c837006069ebe02b77) -- Adding keywords [`cb94631`](https://github.com/ljharb/function-bind/commit/cb946314eed35f21186a25fb42fc118772f9ee00) -- Directly export a function expression instead of using a declaration, and relying on hoisting. [`5a33c5f`](https://github.com/ljharb/function-bind/commit/5a33c5f45642de180e0d207110bf7d1843ceb87c) -- Naming npm URL and badge in README; use SVG [`2aef8fc`](https://github.com/ljharb/function-bind/commit/2aef8fcb79d54e63a58ae557c4e60949e05d5e16) -- Naming deps URLs in README [`04228d7`](https://github.com/ljharb/function-bind/commit/04228d766670ee45ca24e98345c1f6a7621065b5) -- Naming travis-ci URLs in README; using SVG [`62c810c`](https://github.com/ljharb/function-bind/commit/62c810c2f54ced956cd4d4ab7b793055addfe36e) -- Make sure functions are invoked correctly (also passing coverage tests) [`2b289b4`](https://github.com/ljharb/function-bind/commit/2b289b4dfbf037ffcfa4dc95eb540f6165e9e43a) -- Removing the strict mode pragmas; they make tests fail. [`1aa701d`](https://github.com/ljharb/function-bind/commit/1aa701d199ddc3782476e8f7eef82679be97b845) -- Adding myself as a contributor [`85fd57b`](https://github.com/ljharb/function-bind/commit/85fd57b0860e5a7af42de9a287f3f265fc6d72fc) -- Adding strict mode pragmas [`915b08e`](https://github.com/ljharb/function-bind/commit/915b08e084c86a722eafe7245e21db74aa21ca4c) -- Adding devDeps URLs to README [`4ccc731`](https://github.com/ljharb/function-bind/commit/4ccc73112c1769859e4ca3076caf4086b3cba2cd) -- Fixing the description. [`a7a472c`](https://github.com/ljharb/function-bind/commit/a7a472cf649af515c635cf560fc478fbe48999c8) -- Using a function expression instead of a function declaration. [`b5d3e4e`](https://github.com/ljharb/function-bind/commit/b5d3e4ea6aaffc63888953eeb1fbc7ff45f1fa14) -- Updating tape [`f086be6`](https://github.com/ljharb/function-bind/commit/f086be6029fb56dde61a258c1340600fa174d1e0) -- Updating jscs [`5f9bdb3`](https://github.com/ljharb/function-bind/commit/5f9bdb375ab13ba48f30852aab94029520c54d71) -- Updating jscs [`9b409ba`](https://github.com/ljharb/function-bind/commit/9b409ba6118e23395a4e5d83ef39152aab9d3bfc) -- Run coverage as part of tests. [`8e1b6d4`](https://github.com/ljharb/function-bind/commit/8e1b6d459f047d1bd4fee814e01247c984c80bd0) -- Run linter as part of tests [`c1ca83f`](https://github.com/ljharb/function-bind/commit/c1ca83f832df94587d09e621beba682fabfaa987) -- Updating covert [`701e837`](https://github.com/ljharb/function-bind/commit/701e83774b57b4d3ef631e1948143f43a72f4bb9) - -## [v1.0.0](https://github.com/ljharb/function-bind/compare/v0.2.0...v1.0.0) - 2014-08-09 - -### Commits - -- Make sure old and unstable nodes don't fail Travis [`27adca3`](https://github.com/ljharb/function-bind/commit/27adca34a4ab6ad67b6dfde43942a1b103ce4d75) -- Fixing an issue when the bound function is called as a constructor in ES3. [`e20122d`](https://github.com/ljharb/function-bind/commit/e20122d267d92ce553859b280cbbea5d27c07731) -- Adding `npm run coverage` [`a2e29c4`](https://github.com/ljharb/function-bind/commit/a2e29c4ecaef9e2f6cd1603e868c139073375502) -- Updating tape [`b741168`](https://github.com/ljharb/function-bind/commit/b741168b12b235b1717ff696087645526b69213c) -- Upgrading tape [`63631a0`](https://github.com/ljharb/function-bind/commit/63631a04c7fbe97cc2fa61829cc27246d6986f74) -- Updating tape [`363cb46`](https://github.com/ljharb/function-bind/commit/363cb46dafb23cb3e347729a22f9448051d78464) - -## v0.2.0 - 2014-03-23 - -### Commits - -- Updating test coverage to match es5-shim. [`aa94d44`](https://github.com/ljharb/function-bind/commit/aa94d44b8f9d7f69f10e060db7709aa7a694e5d4) -- initial [`942ee07`](https://github.com/ljharb/function-bind/commit/942ee07e94e542d91798137bc4b80b926137e066) -- Setting the bound function's length properly. [`079f46a`](https://github.com/ljharb/function-bind/commit/079f46a2d3515b7c0b308c2c13fceb641f97ca25) -- Ensuring that some older browsers will throw when given a regex. [`36ac55b`](https://github.com/ljharb/function-bind/commit/36ac55b87f460d4330253c92870aa26fbfe8227f) -- Removing npm scripts that don't have dependencies [`9d2be60`](https://github.com/ljharb/function-bind/commit/9d2be600002cb8bc8606f8f3585ad3e05868c750) -- Updating tape [`297a4ac`](https://github.com/ljharb/function-bind/commit/297a4acc5464db381940aafb194d1c88f4e678f3) -- Skipping length tests for now. [`d9891ea`](https://github.com/ljharb/function-bind/commit/d9891ea4d2aaffa69f408339cdd61ff740f70565) -- don't take my tea [`dccd930`](https://github.com/ljharb/function-bind/commit/dccd930bfd60ea10cb178d28c97550c3bc8c1e07) diff --git a/node_modules/function-bind/LICENSE b/node_modules/function-bind/LICENSE deleted file mode 100644 index 62d6d23..0000000 --- a/node_modules/function-bind/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/node_modules/function-bind/README.md b/node_modules/function-bind/README.md deleted file mode 100644 index 814c20b..0000000 --- a/node_modules/function-bind/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# function-bind [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] - -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Implementation of function.prototype.bind - -Old versions of phantomjs, Internet Explorer < 9, and node < 0.6 don't support `Function.prototype.bind`. - -## Example - -```js -Function.prototype.bind = require("function-bind") -``` - -## Installation - -`npm install function-bind` - -## Contributors - - - Raynos - -## MIT Licenced - -[package-url]: https://npmjs.org/package/function-bind -[npm-version-svg]: https://versionbadg.es/Raynos/function-bind.svg -[deps-svg]: https://david-dm.org/Raynos/function-bind.svg -[deps-url]: https://david-dm.org/Raynos/function-bind -[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg -[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/function-bind.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/function-bind.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/function-bind.svg -[downloads-url]: https://npm-stat.com/charts.html?package=function-bind -[codecov-image]: https://codecov.io/gh/Raynos/function-bind/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/Raynos/function-bind/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/Raynos/function-bind -[actions-url]: https://github.com/Raynos/function-bind/actions diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js deleted file mode 100644 index fd4384c..0000000 --- a/node_modules/function-bind/implementation.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var toStr = Object.prototype.toString; -var max = Math.max; -var funcType = '[object Function]'; - -var concatty = function concatty(a, b) { - var arr = []; - - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } - - return arr; -}; - -var slicy = function slicy(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; -}; - -var joiny = function (arr, joiner) { - var str = ''; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; -}; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - - }; - - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = '$' + i; - } - - bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js deleted file mode 100644 index 3bb6b96..0000000 --- a/node_modules/function-bind/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json deleted file mode 100644 index 6185963..0000000 --- a/node_modules/function-bind/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "function-bind", - "version": "1.1.2", - "description": "Implementation of Function.prototype.bind", - "keywords": [ - "function", - "bind", - "shim", - "es5" - ], - "author": "Raynos ", - "repository": { - "type": "git", - "url": "https://github.com/Raynos/function-bind.git" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "main": "index", - "homepage": "https://github.com/Raynos/function-bind", - "contributors": [ - { - "name": "Raynos" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "bugs": { - "url": "https://github.com/Raynos/function-bind/issues", - "email": "raynos2@gmail.com" - }, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", - "aud": "^2.0.3", - "auto-changelog": "^2.4.0", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "npmignore": "^0.3.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.7.1" - }, - "license": "MIT", - "scripts": { - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepack": "npmignore --auto --commentLines=autogenerated", - "pretest": "npm run lint", - "test": "npm run tests-only", - "posttest": "aud --production", - "tests-only": "nyc tape 'test/**/*.js'", - "lint": "eslint --ext=js,mjs .", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - } -} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc deleted file mode 100644 index 8a56d5b..0000000 --- a/node_modules/function-bind/test/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "rules": { - "array-bracket-newline": 0, - "array-element-newline": 0, - "max-statements-per-line": [2, { "max": 2 }], - "no-invalid-this": 0, - "no-magic-numbers": 0, - } -} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js deleted file mode 100644 index 2edecce..0000000 --- a/node_modules/function-bind/test/index.js +++ /dev/null @@ -1,252 +0,0 @@ -// jscs:disable requireUseStrict - -var test = require('tape'); - -var functionBind = require('../implementation'); -var getCurrentContext = function () { return this; }; - -test('functionBind is a function', function (t) { - t.equal(typeof functionBind, 'function'); - t.end(); -}); - -test('non-functions', function (t) { - var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; - t.plan(nonFunctions.length); - for (var i = 0; i < nonFunctions.length; ++i) { - try { functionBind.call(nonFunctions[i]); } catch (ex) { - t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); - } - } - t.end(); -}); - -test('without a context', function (t) { - t.test('binds properly', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }) - }; - namespace.func(1, 2, 3); - st.deepEqual(args, [1, 2, 3]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('binds properly, and still supplies bound arguments', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, undefined, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.deepEqual(args, [1, 2, 3, 4, 5, 6]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('returns properly', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('called as a constructor', function (st) { - var thunkify = function (value) { - return function () { return value; }; - }; - st.test('returns object value', function (sst) { - var expectedReturnValue = [1, 2, 3]; - var Constructor = functionBind.call(thunkify(expectedReturnValue), null); - var result = new Constructor(); - sst.equal(result, expectedReturnValue); - sst.end(); - }); - - st.test('does not return primitive value', function (sst) { - var Constructor = functionBind.call(thunkify(42), null); - var result = new Constructor(); - sst.notEqual(result, 42); - sst.end(); - }); - - st.test('object from bound constructor is instance of original and bound constructor', function (sst) { - var A = function (x) { - this.name = x || 'A'; - }; - var B = functionBind.call(A, null, 'B'); - - var result = new B(); - sst.ok(result instanceof B, 'result is instance of bound constructor'); - sst.ok(result instanceof A, 'result is instance of original constructor'); - sst.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('with a context', function (t) { - t.test('with no bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext) - }; - namespace.func(1, 2, 3); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); - st.end(); - }); - - t.test('with bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); - st.end(); - }); - - t.test('returns properly', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('passes the correct arguments when called as a constructor', function (st) { - var expected = { name: 'Correct' }; - var namespace = { - Func: functionBind.call(function (arg) { - return arg; - }, { name: 'Incorrect' }) - }; - var returned = new namespace.Func(expected); - st.equal(returned, expected, 'returns the right arg when called as a constructor'); - st.end(); - }); - - t.test('has the new instance\'s context when called as a constructor', function (st) { - var actualContext; - var expectedContext = { foo: 'bar' }; - var namespace = { - Func: functionBind.call(function () { - actualContext = this; - }, expectedContext) - }; - var result = new namespace.Func(); - st.equal(result instanceof namespace.Func, true); - st.notEqual(actualContext, expectedContext); - st.end(); - }); - - t.end(); -}); - -test('bound function length', function (t) { - t.test('sets a correct length without thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); -}); diff --git a/node_modules/glob-to-regexp/.travis.yml b/node_modules/glob-to-regexp/.travis.yml deleted file mode 100644 index ddc9c4f..0000000 --- a/node_modules/glob-to-regexp/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" \ No newline at end of file diff --git a/node_modules/glob-to-regexp/README.md b/node_modules/glob-to-regexp/README.md deleted file mode 100644 index afb4114..0000000 --- a/node_modules/glob-to-regexp/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Glob To Regular Expression - -[![Build Status](https://travis-ci.org/fitzgen/glob-to-regexp.png?branch=master)](https://travis-ci.org/fitzgen/glob-to-regexp) - -Turn a \*-wildcard style glob (`"*.min.js"`) into a regular expression -(`/^.*\.min\.js$/`)! - -To match bash-like globs, eg. `?` for any single-character match, `[a-z]` for -character ranges, and `{*.html, *.js}` for multiple alternatives, call with -`{ extended: true }`. - -To obey [globstars `**`](https://github.com/isaacs/node-glob#glob-primer) rules set option `{globstar: true}`. -NOTE: This changes the behavior of `*` when `globstar` is `true` as shown below: -When `{globstar: true}`: `/foo/**` will match any string that starts with `/foo/` -like `/foo/index.htm`, `/foo/bar/baz.txt`, etc. Also, `/foo/**/*.txt` will match -any string that starts with `/foo/` and ends with `.txt` like `/foo/bar.txt`, -`/foo/bar/baz.txt`, etc. -Whereas `/foo/*` (single `*`, not a globstar) will match strings that start with -`/foo/` like `/foo/index.htm`, `/foo/baz.txt` but will not match strings that -contain a `/` to the right like `/foo/bar/baz.txt`, `/foo/bar/baz/qux.dat`, etc. - -Set flags on the resulting `RegExp` object by adding the `flags` property to the option object, eg `{ flags: "i" }` for ignoring case. - -## Install - - npm install glob-to-regexp - -## Usage -```js -var globToRegExp = require('glob-to-regexp'); -var re = globToRegExp("p*uck"); -re.test("pot luck"); // true -re.test("pluck"); // true -re.test("puck"); // true - -re = globToRegExp("*.min.js"); -re.test("http://example.com/jquery.min.js"); // true -re.test("http://example.com/jquery.min.js.map"); // false - -re = globToRegExp("*/www/*.js"); -re.test("http://example.com/www/app.js"); // true -re.test("http://example.com/www/lib/factory-proxy-model-observer.js"); // true - -// Extended globs -re = globToRegExp("*/www/{*.js,*.html}", { extended: true }); -re.test("http://example.com/www/app.js"); // true -re.test("http://example.com/www/index.html"); // true -``` - -## License - -Copyright (c) 2013, Nick Fitzgerald - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/glob-to-regexp/index.js b/node_modules/glob-to-regexp/index.js deleted file mode 100644 index 365cf22..0000000 --- a/node_modules/glob-to-regexp/index.js +++ /dev/null @@ -1,130 +0,0 @@ -module.exports = function (glob, opts) { - if (typeof glob !== 'string') { - throw new TypeError('Expected a string'); - } - - var str = String(glob); - - // The regexp we are building, as a string. - var reStr = ""; - - // Whether we are matching so called "extended" globs (like bash) and should - // support single character matching, matching ranges of characters, group - // matching, etc. - var extended = opts ? !!opts.extended : false; - - // When globstar is _false_ (default), '/foo/*' is translated a regexp like - // '^\/foo\/.*$' which will match any string beginning with '/foo/' - // When globstar is _true_, '/foo/*' is translated to regexp like - // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT - // which does not have a '/' to the right of it. - // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but - // these will not '/foo/bar/baz', '/foo/bar/baz.txt' - // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when - // globstar is _false_ - var globstar = opts ? !!opts.globstar : false; - - // If we are doing extended matching, this boolean is true when we are inside - // a group (eg {*.html,*.js}), and false otherwise. - var inGroup = false; - - // RegExp flags (eg "i" ) to pass in to RegExp constructor. - var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : ""; - - var c; - for (var i = 0, len = str.length; i < len; i++) { - c = str[i]; - - switch (c) { - case "/": - case "$": - case "^": - case "+": - case ".": - case "(": - case ")": - case "=": - case "!": - case "|": - reStr += "\\" + c; - break; - - case "?": - if (extended) { - reStr += "."; - break; - } - - case "[": - case "]": - if (extended) { - reStr += c; - break; - } - - case "{": - if (extended) { - inGroup = true; - reStr += "("; - break; - } - - case "}": - if (extended) { - inGroup = false; - reStr += ")"; - break; - } - - case ",": - if (inGroup) { - reStr += "|"; - break; - } - reStr += "\\" + c; - break; - - case "*": - // Move over all consecutive "*"'s. - // Also store the previous and next characters - var prevChar = str[i - 1]; - var starCount = 1; - while(str[i + 1] === "*") { - starCount++; - i++; - } - var nextChar = str[i + 1]; - - if (!globstar) { - // globstar is disabled, so treat any number of "*" as one - reStr += ".*"; - } else { - // globstar is enabled, so determine if this is a globstar segment - var isGlobstar = starCount > 1 // multiple "*"'s - && (prevChar === "/" || prevChar === undefined) // from the start of the segment - && (nextChar === "/" || nextChar === undefined) // to the end of the segment - - if (isGlobstar) { - // it's a globstar, so match zero or more path segments - reStr += "((?:[^/]*(?:\/|$))*)"; - i++; // move over the "/" - } else { - // it's not a globstar, so only match one path segment - reStr += "([^/]*)"; - } - } - break; - - default: - reStr += c; - } - } - - // When regexp 'g' flag is specified don't - // constrain the regular expression with ^ & $ - if (!flags || !~flags.indexOf('g')) { - reStr = "^" + reStr + "$"; - } - - return new RegExp(reStr, flags); -}; diff --git a/node_modules/glob-to-regexp/package.json b/node_modules/glob-to-regexp/package.json deleted file mode 100644 index 467daf3..0000000 --- a/node_modules/glob-to-regexp/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "glob-to-regexp", - "version": "0.4.1", - "description": "Convert globs to regular expressions", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/fitzgen/glob-to-regexp.git" - }, - "keywords": [ - "regexp", - "glob", - "regexps", - "regular expressions", - "regular expression", - "wildcard" - ], - "author": "Nick Fitzgerald ", - "license": "BSD-2-Clause" -} diff --git a/node_modules/glob-to-regexp/test.js b/node_modules/glob-to-regexp/test.js deleted file mode 100644 index 58ee622..0000000 --- a/node_modules/glob-to-regexp/test.js +++ /dev/null @@ -1,235 +0,0 @@ -var globToRegexp = require("./index.js"); -var assert = require("assert"); - -function assertMatch(glob, str, opts) { - //console.log(glob, globToRegexp(glob, opts)); - assert.ok(globToRegexp(glob, opts).test(str)); -} - -function assertNotMatch(glob, str, opts) { - //console.log(glob, globToRegexp(glob, opts)); - assert.equal(false, globToRegexp(glob, opts).test(str)); -} - -function test(globstar) { - // Match everything - assertMatch("*", "foo"); - assertMatch("*", "foo", { flags: 'g' }); - - // Match the end - assertMatch("f*", "foo"); - assertMatch("f*", "foo", { flags: 'g' }); - - // Match the start - assertMatch("*o", "foo"); - assertMatch("*o", "foo", { flags: 'g' }); - - // Match the middle - assertMatch("f*uck", "firetruck"); - assertMatch("f*uck", "firetruck", { flags: 'g' }); - - // Don't match without Regexp 'g' - assertNotMatch("uc", "firetruck"); - // Match anywhere with RegExp 'g' - assertMatch("uc", "firetruck", { flags: 'g' }); - - // Match zero characters - assertMatch("f*uck", "fuck"); - assertMatch("f*uck", "fuck", { flags: 'g' }); - - // More complex matches - assertMatch("*.min.js", "http://example.com/jquery.min.js", {globstar: false}); - assertMatch("*.min.*", "http://example.com/jquery.min.js", {globstar: false}); - assertMatch("*/js/*.js", "http://example.com/js/jquery.min.js", {globstar: false}); - - // More complex matches with RegExp 'g' flag (complex regression) - assertMatch("*.min.*", "http://example.com/jquery.min.js", { flags: 'g' }); - assertMatch("*.min.js", "http://example.com/jquery.min.js", { flags: 'g' }); - assertMatch("*/js/*.js", "http://example.com/js/jquery.min.js", { flags: 'g' }); - - // Test string "\\\\/$^+?.()=!|{},[].*" represents \\/$^+?.()=!|{},[].* - // The equivalent regex is: /^\\\/\$\^\+\?\.\(\)\=\!\|\{\}\,\[\]\..*$/ - // Both glob and regex match: \/$^+?.()=!|{},[].* - var testStr = "\\\\/$^+?.()=!|{},[].*"; - var targetStr = "\\/$^+?.()=!|{},[].*"; - assertMatch(testStr, targetStr); - assertMatch(testStr, targetStr, { flags: 'g' }); - - // Equivalent matches without/with using RegExp 'g' - assertNotMatch(".min.", "http://example.com/jquery.min.js"); - assertMatch("*.min.*", "http://example.com/jquery.min.js"); - assertMatch(".min.", "http://example.com/jquery.min.js", { flags: 'g' }); - - assertNotMatch("http:", "http://example.com/jquery.min.js"); - assertMatch("http:*", "http://example.com/jquery.min.js"); - assertMatch("http:", "http://example.com/jquery.min.js", { flags: 'g' }); - - assertNotMatch("min.js", "http://example.com/jquery.min.js"); - assertMatch("*.min.js", "http://example.com/jquery.min.js"); - assertMatch("min.js", "http://example.com/jquery.min.js", { flags: 'g' }); - - // Match anywhere (globally) using RegExp 'g' - assertMatch("min", "http://example.com/jquery.min.js", { flags: 'g' }); - assertMatch("/js/", "http://example.com/js/jquery.min.js", { flags: 'g' }); - - assertNotMatch("/js*jq*.js", "http://example.com/js/jquery.min.js"); - assertMatch("/js*jq*.js", "http://example.com/js/jquery.min.js", { flags: 'g' }); - - // Extended mode - - // ?: Match one character, no more and no less - assertMatch("f?o", "foo", { extended: true }); - assertNotMatch("f?o", "fooo", { extended: true }); - assertNotMatch("f?oo", "foo", { extended: true }); - - // ?: Match one character with RegExp 'g' - assertMatch("f?o", "foo", { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("f?o", "fooo", { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("f?o?", "fooo", { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("?fo", "fooo", { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("f?oo", "foo", { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("foo?", "foo", { extended: true, globstar: globstar, flags: 'g' }); - - // []: Match a character range - assertMatch("fo[oz]", "foo", { extended: true }); - assertMatch("fo[oz]", "foz", { extended: true }); - assertNotMatch("fo[oz]", "fog", { extended: true }); - - // []: Match a character range and RegExp 'g' (regresion) - assertMatch("fo[oz]", "foo", { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("fo[oz]", "foz", { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("fo[oz]", "fog", { extended: true, globstar: globstar, flags: 'g' }); - - // {}: Match a choice of different substrings - assertMatch("foo{bar,baaz}", "foobaaz", { extended: true }); - assertMatch("foo{bar,baaz}", "foobar", { extended: true }); - assertNotMatch("foo{bar,baaz}", "foobuzz", { extended: true }); - assertMatch("foo{bar,b*z}", "foobuzz", { extended: true }); - - // {}: Match a choice of different substrings and RegExp 'g' (regression) - assertMatch("foo{bar,baaz}", "foobaaz", { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("foo{bar,baaz}", "foobar", { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("foo{bar,baaz}", "foobuzz", { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("foo{bar,b*z}", "foobuzz", { extended: true, globstar: globstar, flags: 'g' }); - - // More complex extended matches - assertMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://foo.baaz.com/jquery.min.js", - { extended: true }); - assertMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://moz.buzz.com/index.html", - { extended: true }); - assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://moz.buzz.com/index.htm", - { extended: true }); - assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://moz.bar.com/index.html", - { extended: true }); - assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://flozz.buzz.com/index.html", - { extended: true }); - - // More complex extended matches and RegExp 'g' (regresion) - assertMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://foo.baaz.com/jquery.min.js", - { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://moz.buzz.com/index.html", - { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://moz.buzz.com/index.htm", - { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://moz.bar.com/index.html", - { extended: true, globstar: globstar, flags: 'g' }); - assertNotMatch("http://?o[oz].b*z.com/{*.js,*.html}", - "http://flozz.buzz.com/index.html", - { extended: true, globstar: globstar, flags: 'g' }); - - // globstar - assertMatch("http://foo.com/**/{*.js,*.html}", - "http://foo.com/bar/jquery.min.js", - { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("http://foo.com/**/{*.js,*.html}", - "http://foo.com/bar/baz/jquery.min.js", - { extended: true, globstar: globstar, flags: 'g' }); - assertMatch("http://foo.com/**", - "http://foo.com/bar/baz/jquery.min.js", - { extended: true, globstar: globstar, flags: 'g' }); - - // Remaining special chars should still match themselves - // Test string "\\\\/$^+.()=!|,.*" represents \\/$^+.()=!|,.* - // The equivalent regex is: /^\\\/\$\^\+\.\(\)\=\!\|\,\..*$/ - // Both glob and regex match: \/$^+.()=!|,.* - var testExtStr = "\\\\/$^+.()=!|,.*"; - var targetExtStr = "\\/$^+.()=!|,.*"; - assertMatch(testExtStr, targetExtStr, { extended: true }); - assertMatch(testExtStr, targetExtStr, { extended: true, globstar: globstar, flags: 'g' }); -} - -// regression -// globstar false -test(false) -// globstar true -test(true); - -// globstar specific tests -assertMatch("/foo/*", "/foo/bar.txt", {globstar: true }); -assertMatch("/foo/**", "/foo/baz.txt", {globstar: true }); -assertMatch("/foo/**", "/foo/bar/baz.txt", {globstar: true }); -assertMatch("/foo/*/*.txt", "/foo/bar/baz.txt", {globstar: true }); -assertMatch("/foo/**/*.txt", "/foo/bar/baz.txt", {globstar: true }); -assertMatch("/foo/**/*.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertMatch("/foo/**/bar.txt", "/foo/bar.txt", {globstar: true }); -assertMatch("/foo/**/**/bar.txt", "/foo/bar.txt", {globstar: true }); -assertMatch("/foo/**/*/baz.txt", "/foo/bar/baz.txt", {globstar: true }); -assertMatch("/foo/**/*.txt", "/foo/bar.txt", {globstar: true }); -assertMatch("/foo/**/**/*.txt", "/foo/bar.txt", {globstar: true }); -assertMatch("/foo/**/*/*.txt", "/foo/bar/baz.txt", {globstar: true }); -assertMatch("**/*.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertMatch("**/foo.txt", "foo.txt", {globstar: true }); -assertMatch("**/*.txt", "foo.txt", {globstar: true }); - -assertNotMatch("/foo/*", "/foo/bar/baz.txt", {globstar: true }); -assertNotMatch("/foo/*.txt", "/foo/bar/baz.txt", {globstar: true }); -assertNotMatch("/foo/*/*.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertNotMatch("/foo/*/bar.txt", "/foo/bar.txt", {globstar: true }); -assertNotMatch("/foo/*/*/baz.txt", "/foo/bar/baz.txt", {globstar: true }); -assertNotMatch("/foo/**.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertNotMatch("/foo/bar**/*.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertNotMatch("/foo/bar**", "/foo/bar/baz.txt", {globstar: true }); -assertNotMatch("**/.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertNotMatch("*/*.txt", "/foo/bar/baz/qux.txt", {globstar: true }); -assertNotMatch("*/*.txt", "foo.txt", {globstar: true }); - -assertNotMatch("http://foo.com/*", - "http://foo.com/bar/baz/jquery.min.js", - { extended: true, globstar: true }); -assertNotMatch("http://foo.com/*", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: true }); - -assertMatch("http://foo.com/*", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: false }); -assertMatch("http://foo.com/**", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: true }); - -assertMatch("http://foo.com/*/*/jquery.min.js", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: true }); -assertMatch("http://foo.com/**/jquery.min.js", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: true }); -assertMatch("http://foo.com/*/*/jquery.min.js", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: false }); -assertMatch("http://foo.com/*/jquery.min.js", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: false }); -assertNotMatch("http://foo.com/*/jquery.min.js", - "http://foo.com/bar/baz/jquery.min.js", - { globstar: true }); - -console.log("Ok!"); diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE deleted file mode 100644 index e906a25..0000000 --- a/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md deleted file mode 100644 index 82d6e4d..0000000 --- a/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over [fs module](https://nodejs.org/api/fs.html) - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## USAGE - -```javascript -// use just like fs -var fs = require('graceful-fs') - -// now go and do stuff with it... -fs.readFile('some-file-or-whatever', (err, data) => { - // Do stuff here. -}) -``` - -## Sync methods - -This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync -methods. If you use sync methods which open file descriptors then you are -responsible for dealing with any errors. - -This is a known limitation, not a bug. - -## Global Patching - -If you want to patch the global fs module (or any other fs-like -module) you can do this: - -```javascript -// Make sure to read the caveat below. -var realFs = require('fs') -var gracefulFs = require('graceful-fs') -gracefulFs.gracefulify(realFs) -``` - -This should only ever be done at the top-level application layer, in -order to delay on EMFILE errors from any fs-using dependencies. You -should **not** do this in a library, because it can cause unexpected -delays in other parts of the program. - -## Changes - -This module is fairly stable at this point, and used by a lot of -things. That being said, because it implements a subtle behavior -change in a core part of the node API, even modest changes can be -extremely breaking, and the versioning is thus biased towards -bumping the major when in doubt. - -The main change between major versions has been switching between -providing a fully-patched `fs` module vs monkey-patching the node core -builtin, and the approach by which a non-monkey-patched `fs` was -created. - -The goal is to trade `EMFILE` errors for slower fs operations. So, if -you try to open a zillion files, rather than crashing, `open` -operations will be queued up and wait for something else to `close`. - -There are advantages to each approach. Monkey-patching the fs means -that no `EMFILE` errors can possibly occur anywhere in your -application, because everything is using the same core `fs` module, -which is patched. However, it can also obviously cause undesirable -side-effects, especially if the module is loaded multiple times. - -Implementing a separate-but-identical patched `fs` module is more -surgical (and doesn't run the risk of patching multiple times), but -also imposes the challenge of keeping in sync with the core module. - -The current approach loads the `fs` module, and then creates a -lookalike object that has all the same methods, except a few that are -patched. It is safe to use in all versions of Node from 0.8 through -7.0. - -### v4 - -* Do not monkey-patch the fs module. This module may now be used as a - drop-in dep, and users can opt into monkey-patching the fs builtin - if their app requires it. - -### v3 - -* Monkey-patch fs, because the eval approach no longer works on recent - node. -* fixed possible type-error throw if rename fails on windows -* verify that we *never* get EMFILE errors -* Ignore ENOSYS from chmod/chown -* clarify that graceful-fs must be used as a drop-in - -### v2.1.0 - -* Use eval rather than monkey-patching fs. -* readdir: Always sort the results -* win32: requeue a file if error has an OK status - -### v2.0 - -* A return to monkey patching -* wrap process.cwd - -### v1.1 - -* wrap readFile -* Wrap fs.writeFile. -* readdir protection -* Don't clobber the fs builtin -* Handle fs.read EAGAIN errors by trying again -* Expose the curOpen counter -* No-op lchown/lchmod if not implemented -* fs.rename patch only for win32 -* Patch fs.rename to handle AV software on Windows -* Close #4 Chown should not fail on einval or eperm if non-root -* Fix isaacs/fstream#1 Only wrap fs one time -* Fix #3 Start at 1024 max files, then back off on EMFILE -* lutimes that doens't blow up on Linux -* A full on-rewrite using a queue instead of just swallowing the EMFILE error -* Wrap Read/Write streams as well - -### 1.0 - -* Update engines for node 0.6 -* Be lstat-graceful on Windows -* first diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js deleted file mode 100644 index dff3cc8..0000000 --- a/node_modules/graceful-fs/clone.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict' - -module.exports = clone - -var getPrototypeOf = Object.getPrototypeOf || function (obj) { - return obj.__proto__ -} - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 8d5b89e..0000000 --- a/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,448 +0,0 @@ -var fs = require('fs') -var polyfills = require('./polyfills.js') -var legacy = require('./legacy-streams.js') -var clone = require('./clone.js') - -var util = require('util') - -/* istanbul ignore next - node 0.x polyfill */ -var gracefulQueue -var previousSymbol - -/* istanbul ignore else - node 0.x polyfill */ -if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { - gracefulQueue = Symbol.for('graceful-fs.queue') - // This is used in testing by future versions - previousSymbol = Symbol.for('graceful-fs.previous') -} else { - gracefulQueue = '___graceful-fs.queue' - previousSymbol = '___graceful-fs.previous' -} - -function noop () {} - -function publishQueue(context, queue) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue - } - }) -} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -// Once time initialization -if (!fs[gracefulQueue]) { - // This queue can be shared by multiple loaded instances - var queue = global[gracefulQueue] || [] - publishQueue(fs, queue) - - // Patch fs.close/closeSync to shared queue version, because we need - // to retry() whenever a close happens *anywhere* in the program. - // This is essential when multiple graceful-fs instances are - // in play at the same time. - fs.close = (function (fs$close) { - function close (fd, cb) { - return fs$close.call(fs, fd, function (err) { - // This function uses the graceful-fs shared queue - if (!err) { - resetQueue() - } - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) - } - - Object.defineProperty(close, previousSymbol, { - value: fs$close - }) - return close - })(fs.close) - - fs.closeSync = (function (fs$closeSync) { - function closeSync (fd) { - // This function uses the graceful-fs shared queue - fs$closeSync.apply(fs, arguments) - resetQueue() - } - - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }) - return closeSync - })(fs.closeSync) - - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(fs[gracefulQueue]) - require('assert').equal(fs[gracefulQueue].length, 0) - }) - } -} - -if (!global[gracefulQueue]) { - publishQueue(global, fs[gracefulQueue]); -} - -module.exports = patch(clone(fs)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { - module.exports = patch(fs) - fs.__patched = true; -} - -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb, startTime) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb, startTime) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb, startTime) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } - } - - var fs$copyFile = fs.copyFile - if (fs$copyFile) - fs.copyFile = copyFile - function copyFile (src, dest, flags, cb) { - if (typeof flags === 'function') { - cb = flags - flags = 0 - } - return go$copyFile(src, dest, flags, cb) - - function go$copyFile (src, dest, flags, cb, startTime) { - return fs$copyFile(src, dest, flags, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } - } - - var fs$readdir = fs.readdir - fs.readdir = readdir - var noReaddirOptionVersions = /^v[0-5]\./ - function readdir (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - var go$readdir = noReaddirOptionVersions.test(process.version) - ? function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, fs$readdirCallback( - path, options, cb, startTime - )) - } - : function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, options, fs$readdirCallback( - path, options, cb, startTime - )) - } - - return go$readdir(path, options, cb) - - function fs$readdirCallback (path, options, cb, startTime) { - return function (err, files) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([ - go$readdir, - [path, options, cb], - err, - startTime || Date.now(), - Date.now() - ]) - else { - if (files && files.sort) - files.sort() - - if (typeof cb === 'function') - cb.call(this, err, files) - } - } - } - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - } - - var fs$WriteStream = fs.WriteStream - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - } - - Object.defineProperty(fs, 'ReadStream', { - get: function () { - return ReadStream - }, - set: function (val) { - ReadStream = val - }, - enumerable: true, - configurable: true - }) - Object.defineProperty(fs, 'WriteStream', { - get: function () { - return WriteStream - }, - set: function (val) { - WriteStream = val - }, - enumerable: true, - configurable: true - }) - - // legacy names - var FileReadStream = ReadStream - Object.defineProperty(fs, 'FileReadStream', { - get: function () { - return FileReadStream - }, - set: function (val) { - FileReadStream = val - }, - enumerable: true, - configurable: true - }) - var FileWriteStream = WriteStream - Object.defineProperty(fs, 'FileWriteStream', { - get: function () { - return FileWriteStream - }, - set: function (val) { - FileWriteStream = val - }, - enumerable: true, - configurable: true - }) - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new fs.ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new fs.WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb, startTime) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - fs[gracefulQueue].push(elem) - retry() -} - -// keep track of the timeout between retry() calls -var retryTimer - -// reset the startTime and lastTime to now -// this resets the start of the 60 second overall timeout as well as the -// delay between attempts so that we'll retry these jobs sooner -function resetQueue () { - var now = Date.now() - for (var i = 0; i < fs[gracefulQueue].length; ++i) { - // entries that are only a length of 2 are from an older version, don't - // bother modifying those since they'll be retried anyway. - if (fs[gracefulQueue][i].length > 2) { - fs[gracefulQueue][i][3] = now // startTime - fs[gracefulQueue][i][4] = now // lastTime - } - } - // call retry to make sure we're actively processing the queue - retry() -} - -function retry () { - // clear the timer and remove it to help prevent unintended concurrency - clearTimeout(retryTimer) - retryTimer = undefined - - if (fs[gracefulQueue].length === 0) - return - - var elem = fs[gracefulQueue].shift() - var fn = elem[0] - var args = elem[1] - // these items may be unset if they were added by an older graceful-fs - var err = elem[2] - var startTime = elem[3] - var lastTime = elem[4] - - // if we don't have a startTime we have no way of knowing if we've waited - // long enough, so go ahead and retry this item now - if (startTime === undefined) { - debug('RETRY', fn.name, args) - fn.apply(null, args) - } else if (Date.now() - startTime >= 60000) { - // it's been more than 60 seconds total, bail now - debug('TIMEOUT', fn.name, args) - var cb = args.pop() - if (typeof cb === 'function') - cb.call(null, err) - } else { - // the amount of time between the last attempt and right now - var sinceAttempt = Date.now() - lastTime - // the amount of time between when we first tried, and when we last tried - // rounded up to at least 1 - var sinceStart = Math.max(lastTime - startTime, 1) - // backoff. wait longer than the total time we've been retrying, but only - // up to a maximum of 100ms - var desiredDelay = Math.min(sinceStart * 1.2, 100) - // it's been long enough since the last retry, do it again - if (sinceAttempt >= desiredDelay) { - debug('RETRY', fn.name, args) - fn.apply(null, args.concat([startTime])) - } else { - // if we can't do this job yet, push it to the end of the queue - // and let the next iteration check again - fs[gracefulQueue].push(elem) - } - } - - // schedule our next run if one isn't already scheduled - if (retryTimer === undefined) { - retryTimer = setTimeout(retry, 0) - } -} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js deleted file mode 100644 index d617b50..0000000 --- a/node_modules/graceful-fs/legacy-streams.js +++ /dev/null @@ -1,118 +0,0 @@ -var Stream = require('stream').Stream - -module.exports = legacy - -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } - - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); - - Stream.call(this); - - var self = this; - - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.encoding) this.setEncoding(this.encoding); - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } - - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } - - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); - - Stream.call(this); - - this.path = path; - this.fd = null; - this.writable = true; - - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - this.busy = false; - this._queue = []; - - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json deleted file mode 100644 index 87babf0..0000000 --- a/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "graceful-fs", - "description": "A drop-in replacement for fs, making various improvements.", - "version": "4.2.11", - "repository": { - "type": "git", - "url": "https://github.com/isaacs/node-graceful-fs" - }, - "main": "graceful-fs.js", - "directories": { - "test": "test" - }, - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "nyc --silent node test.js | tap -c -", - "posttest": "nyc report" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "ISC", - "devDependencies": { - "import-fresh": "^2.0.0", - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^16.3.4" - }, - "files": [ - "fs.js", - "graceful-fs.js", - "legacy-streams.js", - "polyfills.js", - "clone.js" - ], - "tap": { - "reporter": "classic" - } -} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 453f1a9..0000000 --- a/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,355 +0,0 @@ -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null - -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} - -// This check is needed until node.js 12 is required -if (typeof process.chdir === 'function') { - var chdir = process.chdir - process.chdir = function (d) { - cwd = null - chdir.call(process, d) - } - if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) -} - -module.exports = patch - -function patch (fs) { - // (re-)implement some things that are known busted or missing. - - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } - - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } - - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. - - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) - - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) - - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) - - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) - - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) - - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) - - // if lchmod/lchown do not exist, then make them no-ops - if (fs.chmod && !fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (fs.chown && !fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } - - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. - - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = typeof fs.rename !== 'function' ? fs.rename - : (function (fs$rename) { - function rename (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - } - if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) - return rename - })(fs.rename) - } - - // if read() returns EAGAIN, then just try it again. - fs.read = typeof fs.read !== 'function' ? fs.read - : (function (fs$read) { - function read (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - - // This ensures `util.promisify` works as it does for native `fs.read`. - if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) - return read - })(fs.read) - - fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync - : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) - - function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - } - - function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - - } else if (fs.futimes) { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } - } - - function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } - - function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } - - - function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } - - function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } - - function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - function callback (er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - if (cb) cb.apply(this, arguments) - } - return options ? orig.call(fs, target, options, callback) - : orig.call(fs, target, callback) - } - } - - function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options) { - var stats = options ? orig.call(fs, target, options) - : orig.call(fs, target) - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - return stats; - } - } - - // ENOSYS means that the fs doesn't support the op. Just ignore - // that, because it doesn't matter. - // - // if there's no getuid, or if getuid() is something other - // than 0, and the error is EINVAL or EPERM, then just ignore - // it. - // - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // - // When running as root, or if other types of errors are - // encountered, then it's strict. - function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false - } -} diff --git a/node_modules/has-flag/index.d.ts b/node_modules/has-flag/index.d.ts deleted file mode 100644 index a0a48c8..0000000 --- a/node_modules/has-flag/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** -Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. - -@param flag - CLI flag to look for. The `--` prefix is optional. -@param argv - CLI arguments. Default: `process.argv`. -@returns Whether the flag exists. - -@example -``` -// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow - -// foo.ts -import hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` -*/ -declare function hasFlag(flag: string, argv?: string[]): boolean; - -export = hasFlag; diff --git a/node_modules/has-flag/index.js b/node_modules/has-flag/index.js deleted file mode 100644 index b6f80b1..0000000 --- a/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; diff --git a/node_modules/has-flag/license b/node_modules/has-flag/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/has-flag/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/has-flag/package.json b/node_modules/has-flag/package.json deleted file mode 100644 index a9cba4b..0000000 --- a/node_modules/has-flag/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "has-flag", - "version": "4.0.0", - "description": "Check if argv has a specific flag", - "license": "MIT", - "repository": "sindresorhus/has-flag", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/has-flag/readme.md b/node_modules/has-flag/readme.md deleted file mode 100644 index 3f72dff..0000000 --- a/node_modules/has-flag/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) - -> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag - -Correctly stops looking after an `--` argument terminator. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - - -## Install - -``` -$ npm install has-flag -``` - - -## Usage - -```js -// foo.js -const hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` - -``` -$ node foo.js -f --unicorn --foo=bar -- --rainbow -``` - - -## API - -### hasFlag(flag, [argv]) - -Returns a boolean for whether the flag exists. - -#### flag - -Type: `string` - -CLI flag to look for. The `--` prefix is optional. - -#### argv - -Type: `string[]`
-Default: `process.argv` - -CLI arguments. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/hasown/.eslintrc b/node_modules/hasown/.eslintrc deleted file mode 100644 index 3b5d9e9..0000000 --- a/node_modules/hasown/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", -} diff --git a/node_modules/hasown/.github/FUNDING.yml b/node_modules/hasown/.github/FUNDING.yml deleted file mode 100644 index d68c8b7..0000000 --- a/node_modules/hasown/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/hasown -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/hasown/.nycrc b/node_modules/hasown/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/hasown/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/hasown/CHANGELOG.md b/node_modules/hasown/CHANGELOG.md deleted file mode 100644 index 1cbd1f5..0000000 --- a/node_modules/hasown/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v2.0.0](https://github.com/inspect-js/hasOwn/compare/v1.0.1...v2.0.0) - 2023-10-19 - -### Commits - -- revamped implementation, tests, readme [`72bf8b3`](https://github.com/inspect-js/hasOwn/commit/72bf8b338e77a638f0a290c63ffaed18339c36b4) -- [meta] revamp package.json [`079775f`](https://github.com/inspect-js/hasOwn/commit/079775fb1ec72c1c6334069593617a0be3847458) -- Only apps should have lockfiles [`6640e23`](https://github.com/inspect-js/hasOwn/commit/6640e233d1bb8b65260880f90787637db157d215) - -## v1.0.1 - 2023-10-10 - -### Commits - -- Initial commit [`8dbfde6`](https://github.com/inspect-js/hasOwn/commit/8dbfde6e8fb0ebb076fab38d138f2984eb340a62) diff --git a/node_modules/hasown/LICENSE b/node_modules/hasown/LICENSE deleted file mode 100644 index 0314929..0000000 --- a/node_modules/hasown/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Jordan Harband and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/hasown/README.md b/node_modules/hasown/README.md deleted file mode 100644 index f759b8a..0000000 --- a/node_modules/hasown/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# hasown [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -A robust, ES3 compatible, "has own property" predicate. - -## Example - -```js -const assert = require('assert'); -const hasOwn = require('hasown'); - -assert.equal(hasOwn({}, 'toString'), false); -assert.equal(hasOwn([], 'length'), true); -assert.equal(hasOwn({ a: 42 }, 'a'), true); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/hasown -[npm-version-svg]: https://versionbadg.es/inspect-js/hasown.svg -[deps-svg]: https://david-dm.org/inspect-js/hasOwn.svg -[deps-url]: https://david-dm.org/inspect-js/hasOwn -[dev-deps-svg]: https://david-dm.org/inspect-js/hasOwn/dev-status.svg -[dev-deps-url]: https://david-dm.org/inspect-js/hasOwn#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/hasown.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/hasown.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/hasown.svg -[downloads-url]: https://npm-stat.com/charts.html?package=hasown -[codecov-image]: https://codecov.io/gh/inspect-js/hasOwn/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/inspect-js/hasOwn/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/hasOwn -[actions-url]: https://github.com/inspect-js/hasOwn/actions diff --git a/node_modules/hasown/index.d.ts b/node_modules/hasown/index.d.ts deleted file mode 100644 index caf4a06..0000000 --- a/node_modules/hasown/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _exports: (o: {}, p: PropertyKey) => p is never; -export = _exports; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/hasown/index.d.ts.map b/node_modules/hasown/index.d.ts.map deleted file mode 100644 index d40068a..0000000 --- a/node_modules/hasown/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"4BAMe,EAAE,KAAK,WAAW"} \ No newline at end of file diff --git a/node_modules/hasown/index.js b/node_modules/hasown/index.js deleted file mode 100644 index 3b91618..0000000 --- a/node_modules/hasown/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var call = Function.prototype.call; -var $hasOwn = Object.prototype.hasOwnProperty; -var bind = require('function-bind'); - -/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ -module.exports = bind.call(call, $hasOwn); diff --git a/node_modules/hasown/package.json b/node_modules/hasown/package.json deleted file mode 100644 index 9545006..0000000 --- a/node_modules/hasown/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "hasown", - "version": "2.0.0", - "description": "A robust, ES3 compatible, \"has own property\" predicate.", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated && npm run emit-types", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "prelint": "evalmd README.md", - "lint": "eslint --ext=js,mjs .", - "postlint": "npm run tsc", - "preemit-types": "rm -f *.ts *.ts.map test/*.ts test/*.ts.map", - "emit-types": "npm run tsc -- --noEmit false --emitDeclarationOnly", - "pretest": "npm run lint", - "tsc": "tsc -p .", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/inspect-js/hasOwn.git" - }, - "keywords": [ - "has", - "hasOwnProperty", - "hasOwn", - "has-own", - "own", - "has", - "property", - "in", - "javascript", - "ecmascript" - ], - "author": "Jordan Harband ", - "license": "MIT", - "bugs": { - "url": "https://github.com/inspect-js/hasOwn/issues" - }, - "homepage": "https://github.com/inspect-js/hasOwn#readme", - "dependencies": { - "function-bind": "^1.1.2" - }, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", - "@types/function-bind": "^1.1.9", - "@types/mock-property": "^1.0.1", - "@types/tape": "^5.6.3", - "aud": "^2.0.3", - "auto-changelog": "^2.4.0", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "in-publish": "^2.0.1", - "mock-property": "^1.0.2", - "npmignore": "^0.3.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.7.1", - "typescript": "^5.3.0-dev.20231019" - }, - "engines": { - "node": ">= 0.4" - }, - "testling": { - "files": "test/index.js" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows", - "test", - "!*.d.ts", - "!*.d.ts.map" - ] - } -} diff --git a/node_modules/hasown/tsconfig.json b/node_modules/hasown/tsconfig.json deleted file mode 100644 index fdab34f..0000000 --- a/node_modules/hasown/tsconfig.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - "declarationMap": true, /* Create sourcemaps for d.ts files. */ - "noEmit": true, /* Disable emitting files from a compilation. */ - - /* Interop Constraints */ - "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - - /* Completeness */ - //"skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "exclude": [ - "coverage" - ] -} diff --git a/node_modules/have/.npmignore b/node_modules/have/.npmignore deleted file mode 100644 index 5222ac8..0000000 --- a/node_modules/have/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ - -.DS_Store - -# node.js standard -node_modules -npm-debug.log -v8.log - -# test artifacts -html-report/ -*-cov.js -coverage/ - diff --git a/node_modules/have/.travis.yml b/node_modules/have/.travis.yml deleted file mode 100644 index eeb77c8..0000000 --- a/node_modules/have/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: -- 0.8 -- "0.10" diff --git a/node_modules/have/Makefile b/node_modules/have/Makefile deleted file mode 100644 index 38a2090..0000000 --- a/node_modules/have/Makefile +++ /dev/null @@ -1,36 +0,0 @@ - -BIN = ./node_modules/.bin -TEST_REPORTER = spec -TEST_OPTS = --timeout 100 --slow 50 --reporter $(TEST_REPORTER) --globals __coverage__ --bail -WATCH_OPTS = -q -e 'js' -w . -n exit -x - -MAIN_FILE := have.js -MAIN_FILE_COV := have-cov.js -TEST_FILE := test.js - -default: test - -clean: - -rm $(MAIN_FILE_COV) - -rm -Rf coverage - -rm -Rf html-report - -node_modules: - npm install - -default: test - -test: node_modules - @$(BIN)/mocha $(TEST_OPTS) $(TEST_FILE) -tdd: node_modules - @$(BIN)/supervisor $(WATCH_OPTS) $(MAKE) test - -html-report: $(MAIN_FILE_COV) - @COVER=1 $(BIN)/mocha $(TEST_OPTS) --reporter mocha-istanbul $(TEST_FILE) - @echo open html-report/index.html to view coverage report. - -$(MAIN_FILE_COV): $(MAIN_FILE) - $(BIN)/istanbul instrument --variable global.__coverage__ --output $(MAIN_FILE_COV) --no-compact $(MAIN_FILE) - -.PHONY: test tdd clean - diff --git a/node_modules/have/README.md b/node_modules/have/README.md deleted file mode 100644 index c8ed7c1..0000000 --- a/node_modules/have/README.md +++ /dev/null @@ -1,183 +0,0 @@ - -[![Build Status](https://travis-ci.org/chakrit/have.png?branch=master)](https://travis-ci.org/chakrit/have) - -# HAVE.js - -Have your arguments, and validate it too: - -```js -var have = require('have'); - -function safeFunc(id, options, callback) { - have(arguments, - { id : 'string or number' - , options : 'optional object' - , callback : 'function' - }); -} -``` - -HAVE.js gives you a mini-DSL to quickly validate your function arguments. - -# MINI-DSL - -In order of precedence: - -* `opt X|optional X` - Optional X -* `X or Y` - Either X or Y -* `X a|X arr|x array` - Array of X -* `s|str|string` - String -* `n|num|number` - Number -* `b|bool|boolean` - Boolean -* `f|fun|func|function` - Function -* `a|arr|array` - Array -* `o|obj|object` - Object -* `r|rx|regex|regexp` - RegExp -* `d|date` - Date - -These matchers can be combined. These are all valid HAVE.js matchers: - -* `str or num array` - String or Array of Number -* `num arr or str arr` - Array of Number or Array of String -* `num a a a a` - Array of Array of Array of Array of Number -* `opt str or num array` - Optional (String or Array of Number) - -Have fun! - -# PARSED ARGUMENTS - -The HAVE.js function also returns any parsed argument collected in a hash keyed to the -same key as was given in the schema. You can inspect the returned object to more easily -obtain the parsed value without having to duplicate the HAVE.js parsing logic in your code -to extract them. - -```js -var have = require('have'); - -function safeFunc(id, options, callback) { - var args = have(arguments, - { id : 'string or number' - , options : 'optional object' - , callback : 'function' - }); - - options = args.options || { some: 'value' }; - - // some stuff - someDb.loadById(args.id, options, args.callback); -}; -``` - -For a more careful argument names parsing you can pass several schema. - -```js -var have = require('have'); - -function safeFunc() { - var args = have(arguments, - [ { id : 'string or number' - , options : 'optional object' - , callback : 'function' - } - , { query : 'object' - , options : 'optional object' - , callback : 'function' - } - ]); - - var options = args.options || { some: 'value' }; - - // some stuff - if (args.id) { - someDb.loadById(args.id, options, args.callback); - } else { - someDb.find(args.query, options, args.callback); - } -}; -``` - -And use "strict" mode to fail for those extra arguments that do not match the schema. - -```js -var have = require('have'); - -function safeFunc(id, options, callback) { - var args = have.strict(arguments, - { id : 'string or number' - , options : 'optional object' - , callback : 'function' - }); - - // some stuff -}; - -// This throws an AssertionError: Wrong argument "foo" -safeFunc('id', { key: 'value' }, cb, 'foo') -``` - -# SOFT ASSERTS - -If you are like me and you write a lot of method preconditions that should be turned off -or atleast, should *not* throws in production, you can replace HAVE.js assert function -like so: - -```js -var have = require('have'); - -have.assert(function(cond, message) { - if (!cond) { - console.log('WARN: assertion failed: ' + message); - } -}); -``` - -This will replace the `assert` function HAVE.js uses internally with your implementation -so if you want to completely turns assertion off, then just give it a no-op function. - -# SHORTERs - -For those who like it short, the above example can also be written like this: - -```js -var have = require('have'); - -function safeFunc(id, options, callback) { - have(arguments, { id: 's or n', options: 'opt o', callback: 'f' }); -} -``` - -This is not very readable, of course. But HAVE.js does not dictate your readability -preference for you. So go wild if you think it is ok : ) - -# LICENSE - -BSD (if you don't like BSD, just contact me) - -# CHANGELOG - -#### v0.3.0 - -* (credit: @wmakeev) The function now returns parsed arguments as a hash object. - -#### v0.2.3 - -* Adds the forgotten `boolean` support. - -#### v0.2.1 - v0.2.2 - -* Eat `null` and `undefined` where optional argument is expected. - -# SUPPORT / CONTRIBUTE - -Test with `npm test` or `make test`. - -Just open a [new GitHub issue](https://github.com/chakrit/have/issues/new) or ping me -[@chakrit](https://twitter.com/chakrit) on Twitter. - -Pull requests and feature suggestions totally welcome. - -``` - 40 Chakrit Wichian - 2 Makeev Vitaliy - 1 Edmond Meinfelder -``` diff --git a/node_modules/have/example-funcname.js b/node_modules/have/example-funcname.js deleted file mode 100644 index 5df191d..0000000 --- a/node_modules/have/example-funcname.js +++ /dev/null @@ -1,24 +0,0 @@ - -var assert = require('assert') - , have = require('./have.js') - , funcName = ""; - -have.assert(function(cond, msg) { - assert(cond, 'inside function: ' + funcName + ', ' + msg); -}); - -have = (function(have_) { - return function(args, schema) { - funcName = args.callee.name; - have_(args, schema); - funcName = ""; - }; -})(have); - - -function test() { - have(arguments, { one: 'string' }); -} - -test(123); - diff --git a/node_modules/have/example.js b/node_modules/have/example.js deleted file mode 100644 index b6af7d6..0000000 --- a/node_modules/have/example.js +++ /dev/null @@ -1,59 +0,0 @@ - -var assert = require('assert') - , have = require('./have.js'); - - -function withHave(id, arr, opts, callback) { - var args = have(arguments, - { id: 'str or num' - , arr: 'str or str array' - , opts: 'optional obj' - , callback: 'func' }); - - if (!(arr instanceof Array)) { arr = [arr]; } - - if (!args.opts) { - opts = { x: 'some default value' }; - callback = args.callback; - } - - // logic... -} - - -function withoutHave(id, arr, opts, callback) { - assert(typeof id === 'string' || typeof id === 'number', - 'id argument not string or number'); - - if (!(arr instanceof Array)) { arr = [arr]; } - for (var i = 0; i < arr.length; i++) { - assert(typeof arr[i] === 'string', 'arr member not a string'); - } - - if (typeof opts === 'function') { - callback = opts; - opts = { x: 'some default value' }; - } - - assert(!opts || typeof opts === 'object', 'options object not a hash'); - assert(typeof callback === 'function', 'callback missing or not a function'); - - // logic... -} - - -test(withHave); -test(withoutHave); - -function test(func) { - // passes - func('123', [], function() { }); - func('123', ['str'], { opts: 123 }, function() { }); - func(123, ['str'], function() { }); - - // fails - try { func(function() { }); } catch (e) { console.error(e); } - try { func(123, 456); } catch (e) { console.error(e); } - try { func(123, [456], function() { }); } catch (e) { console.error(e); } -} - diff --git a/node_modules/have/have-0.4.0.tgz b/node_modules/have/have-0.4.0.tgz deleted file mode 100644 index 7718a6de94a1671adb75ebd0d5e159f69677ee25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8298 zcmV-wAeG-AiwFP!000001MNL)ciT3y`?dTPsCUmwYHZr_Bk8r*+d7HcWVf+%Z1;6s z-I$Unn+-*3Ny?5-?EBmAJOB^?NlA8`bno4;jYZ-y7|aX?gTZSO4BiIk;p&8c{onI6 z`O^bGYinzdH#Y_TK6$)FziaFK4NrHy+ZBK6u0P(`+I#}(HvhEN-B??H0`U)xNZm8d ziy#A3J`@gDM(E%FBhPzJh@~VLhfCXH=_0rcmzFW)GR*QQO)zlH-}KiwbQtD?ESeND z<^?1d*XcA9L3TbJhe?qyiy#?_%OH-1K@p0m5Jj5$Vr4}f$I;+znNX!kGckgHK^!xr z-*YjVCIc)Y_qo(@5G4vbkWUU|L~;nn8bCl1<^`r22X8|`AIlsu$->FBA4mCx9SyO! z1PbEQJOWIv4QSUBqR4rq;Y_nwhHS5{!rzN&-yfvo)xkyZH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j>@*f@>xj+H|N zKYC>0(rm5~b$PM@RMnSM8+b895Q|f-*qMERsN*85pyU_nF&R~Dg9egLE%!1SJXEC3 zfMhAqOuAd*8wuUdr+qfj+R);=TOCN>^8FScwgd?%V5!w4iSI28w(0M(4l60VZM>K9 zs!rSbO&6p7-bz=8^7|OQmO8<=vA>e5+?!RAqle__&R;?vYL~Q*m0PIQiDGD3ogD*9 z>nL*1IyBmJEpdpJdkIzr+XL?o@`@pBt0X8B5(Je_ipe-)(JITRuTx+R0kwmeVHycP zr9W8tf8|v+AH@Yc`~K(kttU?^{@<<5t(CEj?DZK=6S>GCVKTo>Uo&B{}zzxtEd2lOyzb^vcH0ss><(&)-4Q6MlNq zb4eKjd3&8+3Wo2rdI>j|(3NI#v?0v<>_mAdn!Eu|eVa;+?uqn$-@A3`nof)Pq?KA# z+UYpJG5i8})t(ch?xrC8TE;klMmCj0V(vpW!#FamIEbyY-E90J5m~oJ9oRdj4hdpU zkBsVQIwFD+1oOrk@ayZ%N_JqXojdT7N>M!+WhqHpmRMf*p$?vx>% zp1+~GSV_tigxosm?3w0lwBbc(s-$9M&_qC7itHM~DW97Xtn&dmW7{EJX(8{i3u%-_ z7n|7m)jrUB<~-&7NB6+u_K%qGbsnexU%_hN#z^K<+E6p#1x<$>vU0jc&^lXMuq z;bkBBs^5z6--phkG-@W`{pA&EI>O1Uo%$sM2Kj|2G@f_F0$|rBd^E@?qKp~zt zz-g*&?~9de3{|n9b~tq92yag1dXym-#WKEUJgNu}}A~gzKjnG%+V+bz(yNtpsOJouFvD1Zlo zWai(%+N(ZF|NBK2fHe5m b.argIndex) return -1; - if (a.argIndex < b.argIndex) return 1; - return 0 - }); - - for (i = 0; i < ensureResults.length; i++) { - if (!ensureResults[i].fail) return ensureResults[i]; - } - - return ensureResults[0]; - } else { - for (var argName in schema) { - if (schema.hasOwnProperty(argName)) { - var ensured = ensure(argName, schema[argName], args[argIndex], function (cond, fail_) { - if (!cond) fail = fail_; - }); - if (fail) break; - if (ensured) { - parsedArgs[argName] = args[argIndex]; - argIndex++; - } - } - } - - if (strict && !fail && argIndex < args.length) { - var argStr = args[argIndex].toString(); - fail = 'Wrong argument "' + (argStr.length > 15 ? argStr.substring(0, 15) + '..' : argStr) + '"'; - } - - return { - fail: fail, - parsedArgs: parsedArgs, - argIndex: argIndex - } - } - } - - // exports - function have(args, schema, strict) { - var res = ensureArgs(args, schema, strict); - assert(!res.fail, res.fail); - return res.parsedArgs; - } - - // configuration - have.assert = function(assert_) { - return (assert_ === undefined) ? assert : (assert = assert_); - }; - - have.strict = function(args, schema) { - return have(args, schema, true); - }; - - return have; - -})(); - diff --git a/node_modules/have/package.json b/node_modules/have/package.json deleted file mode 100644 index 241968a..0000000 --- a/node_modules/have/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "have", - "version": "0.4.0", - "description": "Have your arguments, and validate it too. -- Slick arguments validator for all your js functions.", - "main": "have.js", - "scripts": { - "test": "make test", - "prepublish": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/chakrit/have" - }, - "keywords": [ - "function", - "validation" - ], - "author": "Chakrit Wichian (http://chakrit.net)", - "license": "BSD", - "devDependencies": { - "mocha-istanbul": "~0.1.0", - "supervisor": "~0.5.2", - "chai": "~1.5.0", - "mocha": "~1.8.1", - "istanbul": "~0.1.31" - } -} diff --git a/node_modules/have/test.js b/node_modules/have/test.js deleted file mode 100644 index 5e5b55e..0000000 --- a/node_modules/have/test.js +++ /dev/null @@ -1,481 +0,0 @@ - -// test.js - Test suites for have.js -(function() { - - var assert = require('chai').assert - , filename = process.env.COVER ? './have-cov.js' : './have.js' - , have = require(filename); - - var NON_ARRS = [null, undefined, 'str', 123, true, { }, function() { }] - , NON_OBJS = [null, undefined, 'str', 123, true]; - - var COMMON_TYPES = ['string', 'number', 'object', 'boolean', 'function'] - , FUNC = function() { }; - - - describe('HAVE module', function() { - it('should exports a function', function() { assert.isFunction(have); }); - - describe('configuration', function() { - describe('assert() function', function() { - it('should be exported', function() { - assert.isFunction(have.assert); - }); - - it('should returns the native assert() function when called normally', function() { - assert.equal(have.assert(), require('assert')); - }); - - it('should use given function as assert() replacement', function() { - var called = false - , spy = function() { called = true; }; - - have.assert(spy); - have([123], { one: 'string' }); - - assert.isTrue(called); - have.assert(require('assert')); - }); - }); - }); - - it('should throws if `args` argument does not looks like an array', function() { - NON_ARRS.forEach(function(thing) { - assert.throws(function() { have(thing); }, /arguments/i); - }); - }); - // TODO: Check arguments object - // - it('should *not* throws if `args` is function `arguments`', function() { - assert.doesNotThrow(function() { - var func = function() { have(arguments, { }); }; - func.call(this); - }); - }); - - it('should throws if `schema` argument does not looks like an options hash or non empty array', function() { - NON_OBJS.concat([[]]).forEach(function(thing) { - assert.throws(function() { have([], thing); }, /schema/i); - }); - }); - - describe('with empty schema', function() { - [ [[], {}] - , [[], [{}]] - , [[], [{}, {}]] - , [[], [[{}], {}]] - ].forEach(function (args) { - it('should *not* throws', function() { - assert.doesNotThrow(function() { have.apply(null, args); }); - }); - - it('should *not* throws (strict mode)', function() { - assert.doesNotThrow(function() { have.strict.apply(null, args); }); - }); - }); - }); // empty schema - - // templated tests - function checkThrows(cases, strict) { - for (var description in cases) (function(description, args) { - it('should throws if ' + description, function() { - assert.throws(function() { - strict - ? have.strict.call(this, args[0], args[1]) - : have.call(this, args[0], args[1]); - }, args[2]); - }); - })(description, cases[description]); - } - - function checkNotThrows(cases, strict) { - for (var description in cases) (function(description, args) { - it('should *not* throws if ' + description, function() { - assert.doesNotThrow(function() { - strict - ? have.strict.call(this, args[0], args[1]) - : have.call(this, args[0], args[1]); - }, args[2]); - }); - })(description, cases[description]); - } - - function checkResult(cases, strict) { - for (var description in cases) (function(description, args) { - describe('resulting object when ' + description, function() { - var result = strict - ? have.strict.call(this, args[0], args[1]) - : have.call(this, args[0], args[1]); - var expected = args[2]; - - for (var key in expected) (function(key) { - assert.strictEqual(result[key], expected[key]) - })(key); - }); - })(description, cases[description]); - } - - // schema tests - describe('with basic schema', function() { - var SCHEMA = - { one : 'string' - , two : 'number' - , three : 'function' - , four : 'object' - , five : 'boolean' }; - - checkThrows( - { 'first argument is missing' : [[], SCHEMA, /one/i] - , 'second argument is missing' : [['str'], SCHEMA, /two/i] - , 'third argument is missing' : [['str', 123], SCHEMA, /three/i] - , 'fourth argument is missing' : [['str', 123, FUNC], SCHEMA, /four/i] - , 'fifth argument is missing' : [['str', 123, FUNC, {}], SCHEMA, /five/i] - , 'first argument is of invalid type' : [[123], SCHEMA, /one/i] - , 'second argument is of invalid type' : [['str', 'str'], SCHEMA, /two/i] - , 'third argument is of invalid type' : [['str', 123, 'str'], SCHEMA, /three/i] - , 'fourth argument is of invalid type' : [['str', 123, FUNC, 123], SCHEMA, /four/i] - , 'fifth argument is of invalid type' : [['str', 123, FUNC, /rx/i, 123], SCHEMA, /five/i] - }); - - var args = ['str', 123, FUNC, { }, true] - , result = - { one : args[0] - , two : args[1] - , three : args[2] - , four : args[3] - , five : args[4] }; - - checkNotThrows({ 'all arguments given correctly': [args, SCHEMA] }); - checkResult({ 'all given arguments': [args, SCHEMA, result]}); - }); // basic schema - - describe('with built-in types schema', function() { - describe('RegExp type', function() { - var SCHEMA = { one: 'regex' }; - - checkThrows( - { 'regex argument is missing' : [[], SCHEMA, /one/i] - , 'regex argument is *not* a RegExp' : [['123'], SCHEMA, /one/i] - }); - - var args = [new RegExp(), /test/i]; - - checkNotThrows( - { 'RegExp instance given as argument' : [[args[0]], SCHEMA] - , 'regular expression literal given as argument' : [[args[1]], SCHEMA] - }); - - checkResult( - { 'RegExp argument' : [[args[0]], SCHEMA, { one: args[0]}] - , 'RegExp literal' : [[args[1]], SCHEMA, { one: args[1]}] - }); - }); - - describe('Date type', function() { - var SCHEMA = { one: 'date' }; - - checkThrows( - { 'date argument is missing' : [[], SCHEMA, /one/i] - , 'date argument is *not* a Date instance' : [[{ }], SCHEMA, /one/i] - , 'date argument is a string' : [['' + new Date()], SCHEMA, /one/i] - }); - - var args = [new Date()] - - checkNotThrows({ 'date argument is given correctly': [args, SCHEMA] }); - checkResult({ 'date argument': [args, SCHEMA, { one: args[0] }] }); - }); - }); - - describe('with array schema', function() { - var SCHEMA = { arr: 'array' }; - - checkThrows( - { 'array argument is missing' : [[], SCHEMA, /arr/i] - , 'array argument is *not* an array' : [['str'], SCHEMA, /arr/i] - }); - - var args = [[123, 456]]; - - checkNotThrows({ 'array argument given correctly': [args, SCHEMA] }); - checkResult({ 'array argument': [args, SCHEMA, { arr: args[0] }] }); - - describe('with member type specified', function() { - var SCHEMA = { nums: 'number array' }; - - checkThrows( - { 'array member is falsy' : [[[null]], SCHEMA, /element/i] - , 'array member is of invalid type' : [[['str']], SCHEMA, /nums/i] - }); - - checkNotThrows({ 'array argument with members given correctly': [args, SCHEMA] }); - checkResult({ 'array argument': [args, SCHEMA, { nums: args[0] }] }); - - }); - }); // array schema - - describe('with OR argument schema', function() { - var SCHEMA = { str: 'string or number' }; - - checkThrows( - { 'argument is missing or falsy' : [[null], SCHEMA, /str/i] - , 'argument is of neither the specified type' : [[FUNC], SCHEMA, /str/i] - }); - - checkNotThrows( - { 'argument is of the first type': [['str'], SCHEMA] - , 'argument is of the second type': [[123], SCHEMA] - }); - - checkResult( - { 'string argument': [['str'], SCHEMA, { str: 'str' }] - , 'number argument': [[123], SCHEMA, { str: 123 }] - }); - - }); // OR schema - - describe('with optional argument schema', function() { - var SCHEMA = - { str : 'string' - , num : 'optional number' - , cb : 'function' }; - - checkThrows( - { 'arguments before the optional arg is missing' : [[], SCHEMA, /str/i] - , 'arguments after the optional arg is missing' : [['str', 123], SCHEMA, /cb/i] - , 'arguments before the optional arg is of invalid type' : [[123], SCHEMA, /str/i] - , 'arguments after the optional arg is of invalid type' : [['str', 123, 'str'], SCHEMA, /cb/i] - }); - - var cases = - [ ['str', FUNC] - , ['str', 123, FUNC] - , ['str', null, FUNC] - , ['str', undefined, FUNC] - ]; - - checkNotThrows( - { 'optional argument omitted but other arguments are given correctly' : [cases[0], SCHEMA] - , 'optional arguments specified and all other arguments are given correctly' : [cases[1], SCHEMA] - , 'optional argument is specified as `null`' : [cases[2], SCHEMA] - , 'optioanl argument is specified as `undefined`' : [cases[3], SCHEMA] - }); - - checkResult( - { 'if optional argument omitted but other arguments are given correctly' : [cases[0], SCHEMA, { str: cases[0][0], cb: cases[0][1]}] - , 'if optional arguments specified and all other arguments are given correctly' : [cases[1], SCHEMA, { str: cases[1][0], num: cases[1][1], cb: cases[1][2]}] - , 'if optional argument is specified as `null`' : [cases[2], SCHEMA, { str: cases[2][0], num: cases[2][1], cb: cases[2][2]}] - , 'if optional argument is specified as `undefined`' : [cases[3], SCHEMA, { str: cases[3][0], num: cases[3][1], cb: cases[3][2]}] - }); - - }); // optional arg schema - - describe('with complex schema', function() { - describe('`string array or number array` type', function() { - var SCHEMA = { arg: 'string array or number array' }; - - it('should throws if non-array is given', function() { - NON_ARRS.forEach(function(thing) { - assert.throws(function() { have([thing], SCHEMA); }, /array/i); - }); - }); - - it('should throws if array given but element is of neither type', function() { - assert.throws(function() { have([{ }], SCHEMA); }, /neither/i); - }); - - it('should *not* throws if element is of string type', function() { - assert.doesNotThrow(function() { have([['string']], SCHEMA); }); - }); - - it('should *not* throws if element is of number type', function() { - assert.doesNotThrow(function() { have([[123]], SCHEMA); }); - }); - - }); - - describe('`opt num, str, opt str, str, opt num` type (ambiguous optionals)', function() { - var SCHEMA = - { one : 'opt num' - , two : 'str' - , three : 'opt str' - , four : 'str' - , five : 'opt num' - , six : 'opt str' - }; - - checkThrows( - { 'nothing is given' : [[], SCHEMA, /two/i] - , 'a single argument is given' : [['two'], SCHEMA, /four/i] - , 'two numbers are given' : [[123, 456], SCHEMA, /two/i] - , 'two strings are given' : [['str', 'abc'], SCHEMA, /four/i] - , 'only the 3rd arg is omitted' : [[123, 'str', 'abc', 456, 'def'], SCHEMA, /four/i] - }); - - checkNotThrows( - { 'three strings are given' : [['str', 'abc', 'def'], SCHEMA] - , 'a number and three strings are given' : [[123, 'a', 'b', 'c'], SCHEMA] - , 'everything is given' : [[123, 'a', 'b', 'c', 456, 'd'], SCHEMA] - }); - - // WARN: explicit check for `undefined` is slippery, better to not rely on this. - var results = - [ { two: 'str', three: 'abc', four: 'def' } - , { one: 123, two: 'a', three: 'b', four: 'c' } - , { one: 123, two: 'a', three: 'b', four: 'c', five: undefined } - , { two: 'a', three: 'b', four: 'c', five: 456 } - , { one: 123, two: 'a', four: 'c', five: 456, six: 'd' } - , { one: 123, two: 'a', three: 'b', four: 'c', five: 456, six: 'd' } - ]; - - checkResult( - { 'three strings are given' : [['str', 'abc', 'def'], SCHEMA, results[0]] - , 'a number and three strings are given' : [[123, 'a', 'b', 'c'], SCHEMA, results[1]] - , 'a number, three strings and undefined are given' : [[123, 'a', 'b', 'c', undefined], SCHEMA, results[2]] - , 'undefined, three strings and number are given' : [[undefined, 'a', 'b', 'c', 456], SCHEMA, results[3]] - , 'only the 3rd argument is undefined' : [[123, 'a', undefined, 'c', 456, 'd'], SCHEMA, results[4]] - , 'everything is given' : [[123, 'a', 'b', 'c', 456, 'd'], SCHEMA, results[5]] - }); - }); - - // actually an invalid type but we're testing it to make sure nonetheless - describe('`str or opt num` type (nested optional)', function() { - var SCHEMA = { one: 'str or opt num' }; - - checkNotThrows( - { 'argument is given but of neither type' : [[{ }], SCHEMA] - , 'string argument is given' : [['str'], SCHEMA] - , 'number argument is given' : [[123], SCHEMA] - }); - }); - - describe('`str or num or arr or func` type (nested ORs)', function() { - var SCHEMA = { one: 'str or num or arr or func' }; - - checkNotThrows( - { 'string is given' : [['str'], SCHEMA] - , 'number is given' : [[123], SCHEMA] - , 'array is given' : [[[]], SCHEMA] - , 'function is given' : [[FUNC], SCHEMA] - }); - - checkThrows({ 'object is given': [[{ }], SCHEMA] }); - }); - - describe('`num arr arr arr` type (nested arrays)', function() { - var SCHEMA = { one: 'num arr arr arr' }; - - checkThrows( - { 'non-array is given at first nesting level' : [[[123]], SCHEMA, /one/i] - , 'non-array is given at second nesting level' : [[[[123]]], SCHEMA, /one/i] - }); - - checkNotThrows( - { 'an empty array is given' : [[[]], SCHEMA] - , 'a nested empty array is given' : [[[[]]], SCHEMA] - , 'deeply nested empty array is given' : [[ [[[]]] ], SCHEMA] - , 'multiple nested empty arrays are given' : [[ [], [[]], [[[]]], [[[[]]]] ], SCHEMA] - , 'number array is given at correct depth' : [[ [[[123]]] ], SCHEMA] - , 'multiple nested number arrays are given' : [[ [[[123], [456]], [[789]]] ], SCHEMA] - }) - }); - }); // complex schema - - describe('with schema matchers variants', function () { - var matchers = - { 's|str|string' : 'str' - , 'n|num|number' : 1 - , 'b|bool|boolean' : true - , 'f|fun|func|function' : function() {} - , 'a|arr|array' : [] - , 'o|obj|object' : {} - , 'r|rx|regex|regexp' : /regex/ - , 'd|date' : new Date - , 'opt str|optional str': 'str' - }; - - for (var m in matchers) { - var variants = m.split(/\|/); - for (var v in variants) { - var SCHEMA = { arg: variants[v] }; - var arg = matchers[m]; - checkResult({ 'given matcher variant': [[arg], SCHEMA, { arg: arg }] }); - } - } - - checkThrows({ 'unknown matcher specified': [['str'], { arg: 'foo' }, /foo/i] }); - }); - - describe('with "strict" mode', function () { - var SCHEMA = { one: 'str', tow: 'num', three: 'opt str' }; - - checkThrows( - { 'wrong optional argument specified': [['str', 1, 777], SCHEMA, /777/i] - , 'extra unnecessary argument specified': [['str', 1, 'str', 'extra'], SCHEMA, /extra/i] - }, true); - }); - - describe('with schema list', function() { - describe('in standard mode', function () { - var SCHEMA = - [ { one1: 'obj', tow1: 'opt bool' } - , { one2: 'str', tow2: 'opt obj', three2: 'opt bool' } - , { one3: 'str', tow3: 'opt str', three3: 'opt bool' } - ]; - - var obj = {}; - var date = new Date; - - checkThrows( - { '[num] arguments not correspond to any schema in list': [[1], SCHEMA, /one1/i] - }); - - var cases = - { '[str, str, boot] arguments correspond to third schema in list': - [['str1', 'str2', true], SCHEMA, { one3: 'str1', tow3: 'str2', three3: true }] - , '[str, obj, bool] arguments correspond to second schema in list': - [['str1', obj, true], SCHEMA, { one2: 'str1', tow2: obj, three2: true }] - , '[str, obj] arguments correspond to second schema in list': - [['str1', obj], SCHEMA, { one2: 'str1', tow2: obj }] - , '[str, date] arguments correspond to second schema in list': - [['str1', date], SCHEMA, { one2: 'str1' }] - }; - - checkNotThrows(cases); - checkResult(cases); - }); - - describe('in strict mode', function () { - var SCHEMA = - [ { one1: 'obj', tow1: 'opt bool' } - , { one2: 'str', tow2: 'opt obj', three2: 'opt bool' } - , { one3: 'str', tow3: 'opt str', three3: 'opt bool' } - ]; - - var obj = {}; - - checkThrows( - { '[num] arguments not correspond to any schema in list': [[1], SCHEMA, /one1/i] - , '[str, num] arguments not correspond to any schema in list': - [['str1', 555], SCHEMA, /\"555\"/i] - , 'long string arguments not correspond to any schema in list': - [['str1', 'str2', 'Whis string argument is longer when 15 simbols'], SCHEMA, /\"Whis string arg\.\.\"/i] - }, true); - - var cases = - { '[str, str, boot] arguments correspond to third schema in list': - [['str1', 'str2', true], SCHEMA, { one3: 'str1', tow3: 'str2', three3: true }] - , '[str, obj, bool] arguments correspond to second schema in list': - [['str1', obj, true], SCHEMA, { one2: 'str1', tow2: obj, three2: true }] - , '[str, obj] arguments correspond to second schema in list': - [['str1', obj], SCHEMA, { one2: 'str1', tow2: obj }] - }; - - checkNotThrows(cases, true); - checkResult(cases, true); - }) - }); // schema list - }); - -})(); - diff --git a/node_modules/import-local/fixtures/cli.js b/node_modules/import-local/fixtures/cli.js deleted file mode 100644 index 46b939f..0000000 --- a/node_modules/import-local/fixtures/cli.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -'use strict'; -const importLocal = require('..'); - -if (importLocal(__filename)) { - console.log('local'); -} diff --git a/node_modules/import-local/index.js b/node_modules/import-local/index.js deleted file mode 100644 index 28c9c60..0000000 --- a/node_modules/import-local/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const path = require('path'); -const {fileURLToPath} = require('url'); -const resolveCwd = require('resolve-cwd'); -const pkgDir = require('pkg-dir'); - -module.exports = filename => { - const normalizedFilename = filename.startsWith('file://') ? fileURLToPath(filename) : filename; - const globalDir = pkgDir.sync(path.dirname(normalizedFilename)); - const relativePath = path.relative(globalDir, normalizedFilename); - const pkg = require(path.join(globalDir, 'package.json')); - const localFile = resolveCwd.silent(path.join(pkg.name, relativePath)); - const localNodeModules = path.join(process.cwd(), 'node_modules'); - - const filenameInLocalNodeModules = !path.relative(localNodeModules, normalizedFilename).startsWith('..') && - // On Windows, if `localNodeModules` and `normalizedFilename` are on different partitions, `path.relative()` returns the value of `normalizedFilename`, resulting in `filenameInLocalNodeModules` incorrectly becoming `true`. - path.parse(localNodeModules).root === path.parse(normalizedFilename).root; - - // Use `path.relative()` to detect local package installation, - // because __filename's case is inconsistent on Windows - // Can use `===` when targeting Node.js 8 - // See https://github.com/nodejs/node/issues/6624 - return !filenameInLocalNodeModules && localFile && path.relative(localFile, normalizedFilename) !== '' && require(localFile); -}; diff --git a/node_modules/import-local/license b/node_modules/import-local/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/import-local/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/import-local/package.json b/node_modules/import-local/package.json deleted file mode 100644 index 0de45f0..0000000 --- a/node_modules/import-local/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "import-local", - "version": "3.1.0", - "description": "Let a globally installed package use a locally installed version of itself if available", - "license": "MIT", - "repository": "sindresorhus/import-local", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "fixtures/cli.js" - ], - "keywords": [ - "import", - "local", - "require", - "resolve", - "global", - "version", - "prefer", - "cli" - ], - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "devDependencies": { - "ava": "2.1.0", - "cpy": "^7.0.1", - "del": "^4.1.1", - "execa": "^2.0.1", - "xo": "^0.24.0" - }, - "xo": { - "ignores": [ - "fixtures" - ] - } -} diff --git a/node_modules/import-local/readme.md b/node_modules/import-local/readme.md deleted file mode 100644 index cc5244f..0000000 --- a/node_modules/import-local/readme.md +++ /dev/null @@ -1,37 +0,0 @@ -# import-local - -> Let a globally installed package use a locally installed version of itself if available - -Useful for CLI tools that want to defer to the user's locally installed version when available, but still work if it's not installed locally. For example, [AVA](https://avajs.dev) and [XO](https://github.com/xojs/xo) uses this method. - -## Install - -```sh -npm install import-local -``` - -## Usage - -```js -import importLocal from 'import-local'; - -if (importLocal(import.meta.url)) { - console.log('Using local version of this package'); -} else { - // Code for both global and local version here… -} -``` - -You can also pass in `__filename` when used in a CommonJS context. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/interpret/LICENSE b/node_modules/interpret/LICENSE deleted file mode 100644 index 1e90780..0000000 --- a/node_modules/interpret/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2018, 2022 Tyler Kellen , Blaine Bublitz , and Eric Schoffstall - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/interpret/README.md b/node_modules/interpret/README.md deleted file mode 100644 index 005f92a..0000000 --- a/node_modules/interpret/README.md +++ /dev/null @@ -1,244 +0,0 @@ -

- - - -

- -# interpret - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] - -A dictionary of file extensions and associated module loaders. - -## What is it - -This is used by [Liftoff] to automatically require dependencies for configuration files, and by [rechoir] for registering module loaders. - -## How to use it - -Consumers should use the exported `extensions` or `jsVariants` object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following: - -1. If the value is null, do nothing. -2. If the value is a string, try to require it. -3. If the value is an object, try to require the `module` property. If successful, the `register` property (a function) should be called with the module passed as the first argument. **Advanced:** An optional second argument can be provided to replace the default configuration for a hook. -4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw. - -## API - -This module provides two top-level properties: `extensions` and `jsVariants`. - -**Note:** This module does not depend on any of the loaders it recommends; instead, end-users are expected to install the hooks they want to use for the file types they want to use. See supported extensions and their hooks in the sections below. - -### `extensions` - -A mapping of file extensions to modules which provide a [require.extensions] loader. - -File extension keys are all in the format of `'.foo'` or `'.foo.bar'` and module loader values are either `null` if the loader should fallthrough to node's loader, -or a string representing the module to be required, an object of `{ module: 'foobar', register: function }`, or an array containing those strings and/or objects. - -A sample of an entry containing multiple hooks would look like: - -```js -{ - '.ts': [ - 'ts-node/register', - 'sucrase/register/ts', - { - module: '@babel/register', - register: function(hook) { - hook({ - extensions: '.ts', - rootMode: 'upward-optional', - ignore: [ignoreNonBabelAndNodeModules], - }); - }, - }, - ], -} -``` - -**Supported extensions and their hooks** - -```yaml file=scripts/extensions.yaml -.babel.js: - - '@babel/register' -.babel.jsx: - - '@babel/register' -.babel.ts: - - '@babel/register' -.babel.tsx: - - '@babel/register' -.cjs: - - interpret/cjs-stub -.coffee: - - coffeescript/register -.coffee.md: - - coffeescript/register -.cts: - - ts-node/register -.esbuild.js: - - esbuild-register/dist/node -.esbuild.jsx: - - esbuild-register/dist/node -.esbuild.ts: - - esbuild-register/dist/node -.esbuild.tsx: - - esbuild-register/dist/node -.esm.js: - - esm -.js: - - built-in node.js loader -.json: - - built-in node.js loader -.json5: - - json5/lib/register -.jsx: - - '@babel/register' - - sucrase/register/jsx -.litcoffee: - - coffeescript/register -.mdx: - - '@mdx-js/register' -.mjs: - - interpret/mjs-stub -.node: - - built-in node.js loader -.sucrase.js: - - sucrase/dist/register -.sucrase.jsx: - - sucrase/dist/register -.sucrase.ts: - - sucrase/dist/register -.sucrase.tsx: - - sucrase/dist/register -.swc.js: - - '@swc/register' -.swc.jsx: - - '@swc/register' -.swc.ts: - - '@swc/register' -.swc.tsx: - - '@swc/register' -.toml: - - toml-require -.ts: - - ts-node/register - - sucrase/register/ts - - '@babel/register' - - esbuild-register/dist/node - - '@swc/register' -.tsx: - - ts-node/register - - sucrase/register/tsx - - '@babel/register' - - esbuild-register/dist/node - - '@swc/register' -.yaml: - - yaml-hook/register -.yml: - - yaml-hook/register -``` - -### `jsVariants` - -The `jsVariants` is the same mapping as above, but only include the extensions which are variants of JavaScript. - -**Supported extensions and their hooks** - -```yaml file=scripts/jsVariants.yaml -.babel.js: - - '@babel/register' -.babel.jsx: - - '@babel/register' -.babel.ts: - - '@babel/register' -.babel.tsx: - - '@babel/register' -.cjs: - - interpret/cjs-stub -.coffee: - - coffeescript/register -.coffee.md: - - coffeescript/register -.esbuild.js: - - esbuild-register/dist/node -.esbuild.jsx: - - esbuild-register/dist/node -.esbuild.ts: - - esbuild-register/dist/node -.esbuild.tsx: - - esbuild-register/dist/node -.esm.js: - - esm -.js: - - built-in node.js loader -.jsx: - - '@babel/register' - - sucrase/register/jsx -.litcoffee: - - coffeescript/register -.mdx: - - '@mdx-js/register' -.mjs: - - interpret/mjs-stub -.sucrase.js: - - sucrase/dist/register -.sucrase.jsx: - - sucrase/dist/register -.sucrase.ts: - - sucrase/dist/register -.sucrase.tsx: - - sucrase/dist/register -.swc.js: - - '@swc/register' -.swc.jsx: - - '@swc/register' -.swc.ts: - - '@swc/register' -.swc.tsx: - - '@swc/register' -.ts: - - ts-node/register - - sucrase/register/ts - - '@babel/register' - - esbuild-register/dist/node - - '@swc/register' -.tsx: - - ts-node/register - - sucrase/register/tsx - - '@babel/register' - - esbuild-register/dist/node - - '@swc/register' -``` - -## License - -MIT - - - -[downloads-image]: https://img.shields.io/npm/dm/interpret.svg?style=flat-square - -[npm-url]: https://www.npmjs.com/package/interpret - -[npm-image]: https://img.shields.io/npm/v/interpret.svg?style=flat-square - -[ci-url]: https://github.com/gulpjs/interpret/actions?query=workflow:dev - -[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/interpret/dev?style=flat-square - -[coveralls-url]: https://coveralls.io/r/gulpjs/interpret - -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/interpret/master.svg?style=flat-square - - - - - -[Liftoff]: http://github.com/gulpjs/liftoff - -[rechoir]: http://github.com/gulpjs/rechoir - -[require.extensions]: https://nodejs.org/api/modules.html#requireextensions - - diff --git a/node_modules/interpret/cjs-stub.js b/node_modules/interpret/cjs-stub.js deleted file mode 100644 index 62afbc6..0000000 --- a/node_modules/interpret/cjs-stub.js +++ /dev/null @@ -1 +0,0 @@ -require.extensions['.cjs'] = null; diff --git a/node_modules/interpret/index.js b/node_modules/interpret/index.js deleted file mode 100644 index b951fd9..0000000 --- a/node_modules/interpret/index.js +++ /dev/null @@ -1,542 +0,0 @@ -var path = require('path'); - -// We only register on the final extension (like `.js`) due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353 -// However, we use these matchers to apply the transform only if the full extension matches -function endsInJsx(filename) { - return filename.endsWith('.jsx'); -} -function endsInTs(filename) { - return filename.endsWith('.ts'); -} -function endsInTsx(filename) { - return filename.endsWith('.tsx'); -} -function endsInBabelJs(filename) { - return filename.endsWith('.babel.js'); -} -function endsInBabelJsx(filename) { - return filename.endsWith('.babel.jsx'); -} -function endsInBabelTs(filename) { - return filename.endsWith('.babel.ts'); -} -function endsInBabelTsx(filename) { - return filename.endsWith('.babel.tsx'); -} -function endsInEsbuildJs(filename) { - return filename.endsWith('.esbuild.js'); -} -function endsInEsbuildJsx(filename) { - return filename.endsWith('.esbuild.jsx'); -} -function endsInEsbuildTs(filename) { - return filename.endsWith('.esbuild.ts'); -} -function endsInEsbuildTsx(filename) { - return filename.endsWith('.esbuild.tsx'); -} -function endsInSucraseJs(filename) { - return filename.endsWith('.sucrase.js'); -} -function endsInSucraseJsx(filename) { - return filename.endsWith('.sucrase.jsx'); -} -function endsInSucraseTs(filename) { - return filename.endsWith('.sucrase.ts'); -} -function endsInSucraseTsx(filename) { - return filename.endsWith('.sucrase.tsx'); -} -function endsInSwcJs(filename) { - return filename.endsWith('.swc.js'); -} -function endsInSwcJsx(filename) { - return filename.endsWith('.swc.jsx'); -} -function endsInSwcTs(filename) { - return filename.endsWith('.swc.ts'); -} -function endsInSwcTsx(filename) { - return filename.endsWith('.swc.tsx'); -} - -var cjsStub = path.join(__dirname, 'cjs-stub'); -var mjsStub = path.join(__dirname, 'mjs-stub'); - -function isNodeModules(file) { - return path.relative(process.cwd(), file).includes('node_modules'); -} - -var extensions = { - '.babel.js': { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [{ only: [endsInBabelJs], presets: ['@babel/preset-env'] }], - }; - - hook(Object.assign({}, config, { extensions: '.js' })); - }, - }, - '.babel.jsx': { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [ - { - only: [endsInBabelJsx], - presets: ['@babel/preset-env', '@babel/preset-react'], - }, - ], - }; - - hook(Object.assign({}, config, { extensions: '.jsx' })); - }, - }, - '.babel.ts': [ - { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [ - { - only: [endsInBabelTs], - presets: ['@babel/preset-env', '@babel/preset-typescript'], - }, - ], - }; - - hook(Object.assign({}, config, { extensions: '.ts' })); - }, - }, - ], - '.babel.tsx': { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [ - { - only: [endsInBabelTsx], - presets: [ - '@babel/preset-env', - '@babel/preset-react', - [ - '@babel/preset-typescript', - { - isTSX: true, - allExtensions: true, - }, - ], - ], - }, - ], - }; - - hook(Object.assign({}, config, { extensions: '.tsx' })); - }, - }, - '.cjs': cjsStub, - '.coffee': 'coffeescript/register', - '.coffee.md': 'coffeescript/register', - '.esbuild.js': { - module: 'esbuild-register/dist/node', - register: function (mod, config) { - config = config || { - target: 'node' + process.version.slice(1), - hookMatcher: endsInEsbuildJs, - }; - - mod.register(Object.assign({}, config, { extensions: ['.js'] })); - }, - }, - '.esbuild.jsx': { - module: 'esbuild-register/dist/node', - register: function (mod, config) { - config = config || { - target: 'node' + process.version.slice(1), - hookMatcher: endsInEsbuildJsx, - }; - - mod.register(Object.assign({}, config, { extensions: ['.jsx'] })); - }, - }, - '.esbuild.ts': { - module: 'esbuild-register/dist/node', - register: function (mod, config) { - config = config || { - target: 'node' + process.version.slice(1), - hookMatcher: endsInEsbuildTs, - }; - - mod.register(Object.assign({}, config, { extensions: ['.ts'] })); - }, - }, - '.esbuild.tsx': { - module: 'esbuild-register/dist/node', - register: function (mod, config) { - config = config || { - target: 'node' + process.version.slice(1), - hookMatcher: endsInEsbuildTsx, - }; - - mod.register(Object.assign({}, config, { extensions: ['.tsx'] })); - }, - }, - '.esm.js': { - module: 'esm', - register: function (hook) { - // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353 - // which only captures the final extension (.esm.js -> .js) - var esmLoader = hook(module); - require.extensions['.js'] = esmLoader('module')._extensions['.js']; - }, - }, - '.js': null, - '.json': null, - '.json5': 'json5/lib/register', - '.jsx': [ - { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [ - { - only: [endsInJsx], - presets: ['@babel/preset-env', '@babel/preset-react'], - }, - ], - }; - - hook(Object.assign({}, config, { extensions: '.jsx' })); - }, - }, - 'sucrase/register/jsx', - ], - '.litcoffee': 'coffeescript/register', - // The mdx loader hooks both `.md` and `.mdx` when it is imported - // but we only install the hook if `.mdx` is the first file - '.mdx': '@mdx-js/register', - '.mjs': mjsStub, - '.node': null, - '.sucrase.js': { - module: 'sucrase/dist/register', - register: function (hook, config) { - config = config || { - matcher: endsInSucraseJs, - }; - - hook.registerJS(config); - }, - }, - '.sucrase.jsx': { - module: 'sucrase/dist/register', - register: function (hook, config) { - config = config || { - matcher: endsInSucraseJsx, - }; - - hook.registerJSX(config); - }, - }, - '.sucrase.ts': { - module: 'sucrase/dist/register', - register: function (hook, config) { - config = config || { - matcher: endsInSucraseTs, - }; - - hook.registerTS(config); - }, - }, - '.sucrase.tsx': { - module: 'sucrase/dist/register', - register: function (hook, config) { - config = config || { - matcher: endsInSucraseTsx, - }; - - hook.registerTSX(config); - }, - }, - '.swc.js': { - module: '@swc/register', - register: function (hook, config) { - config = config || { - only: [endsInSwcJs], - ignore: [isNodeModules], - jsc: { - parser: { - syntax: 'ecmascript', - }, - }, - module: { - type: 'commonjs', - }, - }; - - hook( - Object.assign({}, config, { - extensions: '.js', - }) - ); - }, - }, - '.swc.jsx': { - module: '@swc/register', - register: function (hook, config) { - config = config || { - only: [endsInSwcJsx], - ignore: [isNodeModules], - jsc: { - parser: { - syntax: 'ecmascript', - jsx: true, - }, - }, - module: { - type: 'commonjs', - }, - }; - - hook( - Object.assign({}, config, { - extensions: '.jsx', - }) - ); - }, - }, - '.swc.ts': { - module: '@swc/register', - register: function (hook, config) { - config = config || { - only: [endsInSwcTs], - ignore: [isNodeModules], - jsc: { - parser: { - syntax: 'typescript', - }, - }, - module: { - type: 'commonjs', - }, - }; - - hook( - Object.assign({}, config, { - extensions: '.ts', - }) - ); - }, - }, - '.swc.tsx': { - module: '@swc/register', - register: function (hook, config) { - config = config || { - only: [endsInSwcTsx], - ignore: [isNodeModules], - jsc: { - parser: { - syntax: 'typescript', - tsx: true, - }, - }, - module: { - type: 'commonjs', - }, - }; - - hook( - Object.assign({}, config, { - extensions: '.tsx', - }) - ); - }, - }, - '.toml': { - module: 'toml-require', - register: function (hook, config) { - hook.install(config); - }, - }, - '.ts': [ - 'ts-node/register', - 'sucrase/register/ts', - { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [ - { - only: [endsInTs], - presets: ['@babel/preset-env', '@babel/preset-typescript'], - }, - ], - }; - - hook( - Object.assign({}, config, { - extensions: '.ts', - }) - ); - }, - }, - { - module: 'esbuild-register/dist/node', - register: function (mod, config) { - config = config || { - target: 'node' + process.version.slice(1), - hookMatcher: endsInTs, - }; - - mod.register( - Object.assign({}, config, { - extensions: ['.ts'], - }) - ); - }, - }, - { - module: '@swc/register', - register: function (hook, config) { - config = config || { - only: [endsInTs], - ignore: [isNodeModules], - jsc: { - parser: { - syntax: 'typescript', - }, - }, - module: { - type: 'commonjs', - }, - }; - - hook( - Object.assign({}, config, { - extensions: '.ts', - }) - ); - }, - }, - ], - '.cts': ['ts-node/register'], - '.tsx': [ - 'ts-node/register', - 'sucrase/register/tsx', - { - module: '@babel/register', - register: function (hook, config) { - config = config || { - rootMode: 'upward-optional', - overrides: [ - { - only: [endsInTsx], - presets: [ - '@babel/preset-env', - '@babel/preset-react', - [ - '@babel/preset-typescript', - { - isTSX: true, - allExtensions: true, - }, - ], - ], - }, - ], - }; - - hook( - Object.assign({}, config, { - extensions: '.tsx', - }) - ); - }, - }, - { - module: 'esbuild-register/dist/node', - register: function (mod, config) { - config = config || { - target: 'node' + process.version.slice(1), - hookMatcher: endsInTsx, - }; - - mod.register( - Object.assign({}, config, { - extensions: ['.tsx'], - }) - ); - }, - }, - { - module: '@swc/register', - register: function (hook, config) { - config = config || { - only: [endsInTsx], - ignore: [isNodeModules], - jsc: { - parser: { - syntax: 'typescript', - tsx: true, - }, - }, - module: { - type: 'commonjs', - }, - }; - - hook( - Object.assign({}, config, { - extensions: '.tsx', - }) - ); - }, - }, - ], - '.yaml': 'yaml-hook/register', - '.yml': 'yaml-hook/register', -}; - -var jsVariantExtensions = [ - '.js', - '.babel.js', - '.babel.jsx', - '.babel.ts', - '.babel.tsx', - '.esbuild.js', - '.esbuild.jsx', - '.esbuild.ts', - '.esbuild.tsx', - '.cjs', - '.coffee', - '.coffee.md', - '.esm.js', - '.jsx', - '.litcoffee', - '.mdx', - '.mjs', - '.sucrase.js', - '.sucrase.jsx', - '.sucrase.ts', - '.sucrase.tsx', - '.swc.js', - '.swc.jsx', - '.swc.ts', - '.swc.tsx', - '.ts', - '.tsx', -]; - -module.exports = { - extensions: extensions, - jsVariants: jsVariantExtensions.reduce(function (result, ext) { - result[ext] = extensions[ext]; - return result; - }, {}), -}; diff --git a/node_modules/interpret/mjs-stub.js b/node_modules/interpret/mjs-stub.js deleted file mode 100644 index 6a1af95..0000000 --- a/node_modules/interpret/mjs-stub.js +++ /dev/null @@ -1 +0,0 @@ -require.extensions['.mjs'] = null; diff --git a/node_modules/interpret/package.json b/node_modules/interpret/package.json deleted file mode 100644 index 14027ee..0000000 --- a/node_modules/interpret/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "interpret", - "version": "3.1.1", - "description": "A dictionary of file extensions and associated module loaders.", - "author": "Gulp Team (https://gulpjs.com/)", - "contributors": [ - "Blaine Bublitz ", - "Tyler Kellen (http://goingslowly.com/)" - ], - "repository": "gulpjs/interpret", - "license": "MIT", - "engines": { - "node": ">=10.13.0" - }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js", - "cjs-stub.js", - "mjs-stub.js" - ], - "scripts": { - "readme": "remark README.md --use ./scripts/plugin.mjs --output", - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only" - }, - "devDependencies": { - "eslint": "^7.0.0", - "eslint-config-gulp": "^5.0.0", - "eslint-plugin-node": "^11.1.0", - "expect": "^27.0.0", - "js-yaml": "^4.1.0", - "mocha": "^8.0.0", - "nyc": "^15.0.0", - "parse-node-version": "^2.0.0", - "rechoir": "^0.8.0", - "remark-cli": "^10.0.1", - "remark-code-import": "^1.1.0", - "shelljs": "0.8.5" - }, - "nyc": { - "extension": [ - ".js" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "prettier": { - "singleQuote": true - }, - "keywords": [ - "coffee", - "coffee.md", - "coffeescript", - "es", - "es6", - "js", - "json", - "json5", - "jsx", - "react", - "litcoffee", - "toml", - "ts", - "typescript", - "xml", - "yaml", - "yml" - ] -} diff --git a/node_modules/ip-regex/index.d.ts b/node_modules/ip-regex/index.d.ts deleted file mode 100644 index 0999ed2..0000000 --- a/node_modules/ip-regex/index.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -declare namespace ip { - interface Options { - /** - Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. *(`false` matches any IP address in a string)* - - @default false - */ - readonly exact?: boolean; - - /** - Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). - - @default false - */ - readonly includeBoundaries?: boolean; - } -} - -declare const ip: { - /** - Regular expression for matching IP addresses. - - @returns A regex for matching both IPv4 and IPv6. - - @example - ``` - import ipRegex = require('ip-regex'); - - // Contains an IP address? - ipRegex().test('unicorn 192.168.0.1'); - //=> true - - // Is an IP address? - ipRegex({exact: true}).test('unicorn 192.168.0.1'); - //=> false - - 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); - //=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] - - // Contains an IP address? - ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); - //=> false - - // Matches an IP address? - '192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); - //=> null - ``` - */ - (options?: ip.Options): RegExp; - - /** - @returns A regex for matching IPv4. - */ - v4(options?: ip.Options): RegExp; - - /** - @returns A regex for matching IPv6. - - @example - ``` - import ipRegex = require('ip-regex'); - - ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); - //=> true - ``` - */ - v6(options?: ip.Options): RegExp; -}; - -export = ip; diff --git a/node_modules/ip-regex/index.js b/node_modules/ip-regex/index.js deleted file mode 100644 index ab7a37f..0000000 --- a/node_modules/ip-regex/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const word = '[a-fA-F\\d:]'; -const b = options => options && options.includeBoundaries ? - `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : - ''; - -const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; - -const v6seg = '[a-fA-F\\d]{1,4}'; -const v6 = ` -(?: -(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${v6seg}:){5}(?::${v4}|(?::${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${v6seg}:){4}(?:(?::${v6seg}){0,1}:${v4}|(?::${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${v6seg}:){3}(?:(?::${v6seg}){0,2}:${v4}|(?::${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${v6seg}:){2}(?:(?::${v6seg}){0,3}:${v4}|(?::${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${v6seg}:){1}(?:(?::${v6seg}){0,4}:${v4}|(?::${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::(?:(?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); - -// Pre-compile only the exact regexes because adding a global flag make regexes stateful -const v46Exact = new RegExp(`(?:^${v4}$)|(?:^${v6}$)`); -const v4exact = new RegExp(`^${v4}$`); -const v6exact = new RegExp(`^${v6}$`); - -const ip = options => options && options.exact ? - v46Exact : - new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); - -ip.v4 = options => options && options.exact ? v4exact : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); -ip.v6 = options => options && options.exact ? v6exact : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); - -module.exports = ip; diff --git a/node_modules/ip-regex/license b/node_modules/ip-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/ip-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ip-regex/package.json b/node_modules/ip-regex/package.json deleted file mode 100644 index 2fb8a03..0000000 --- a/node_modules/ip-regex/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "ip-regex", - "version": "4.3.0", - "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", - "license": "MIT", - "repository": "sindresorhus/ip-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ip", - "ipv6", - "ipv4", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "text", - "pattern", - "internet", - "protocol", - "address", - "validate" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/ip-regex/readme.md b/node_modules/ip-regex/readme.md deleted file mode 100644 index 81723a0..0000000 --- a/node_modules/ip-regex/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -# ip-regex - -> Regular expression for matching IP addresses - - -## Install - -``` -$ npm install ip-regex -``` - -This module targets Node.js 8 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, use version 2.1.0: `npm install ip-regex@2.1.0` - - -## Usage - -```js -const ipRegex = require('ip-regex'); - -// Contains an IP address? -ipRegex().test('unicorn 192.168.0.1'); -//=> true - -// Is an IP address? -ipRegex({exact: true}).test('unicorn 192.168.0.1'); -//=> false - -ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); -//=> true - -'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); -//=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] - -// Contains an IP address? -ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); -//=> false - -// Matches an IP address? -'192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); -//=> null -``` - - -## API - -### ipRegex([options]) - -Returns a regex for matching both IPv4 and IPv6. - -### ipRegex.v4([options]) - -Returns a regex for matching IPv4. - -### ipRegex.v6([options]) - -Returns a regex for matching IPv6. - -#### options - -Type: `Object` - -##### exact - -Type: `boolean`
-Default: `false` *(Matches any IP address in a string)* - -Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. - -##### includeBoundaries - -Type: `boolean`
-Default: `false` - -Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). - - -## Related - -- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address -- [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation -- [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/is-core-module/.eslintrc b/node_modules/is-core-module/.eslintrc deleted file mode 100644 index f2e0726..0000000 --- a/node_modules/is-core-module/.eslintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "@ljharb", - "root": true, - "rules": { - "func-style": 1, - }, - "overrides": [ - { - "files": "test/**", - "rules": { - "global-require": 0, - "max-depth": 0, - "max-lines-per-function": 0, - "no-negated-condition": 0, - }, - }, - ], -} diff --git a/node_modules/is-core-module/.nycrc b/node_modules/is-core-module/.nycrc deleted file mode 100644 index bdd626c..0000000 --- a/node_modules/is-core-module/.nycrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/is-core-module/CHANGELOG.md b/node_modules/is-core-module/CHANGELOG.md deleted file mode 100644 index c4db1ac..0000000 --- a/node_modules/is-core-module/CHANGELOG.md +++ /dev/null @@ -1,180 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v2.13.1](https://github.com/inspect-js/is-core-module/compare/v2.13.0...v2.13.1) - 2023-10-20 - -### Commits - -- [Refactor] use `hasown` instead of `has` [`0e52096`](https://github.com/inspect-js/is-core-module/commit/0e520968b0a725276b67420ab4b877486b243ae0) -- [Dev Deps] update `mock-property`, `tape` [`8736b35`](https://github.com/inspect-js/is-core-module/commit/8736b35464d0f297b55da2c6b30deee04b8303c5) - -## [v2.13.0](https://github.com/inspect-js/is-core-module/compare/v2.12.1...v2.13.0) - 2023-08-05 - -### Commits - -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `semver`, `tape` [`c75b263`](https://github.com/inspect-js/is-core-module/commit/c75b263d047cb53430c3970107e5eb64d6cd6c0c) -- [New] `node:test/reporters` and `wasi`/`node:wasi` are in v18.17 [`d76cbf8`](https://github.com/inspect-js/is-core-module/commit/d76cbf8e9b208acfd98913fed5a5f45cb15fe5dc) - -## [v2.12.1](https://github.com/inspect-js/is-core-module/compare/v2.12.0...v2.12.1) - 2023-05-16 - -### Commits - -- [Fix] `test/reporters` now requires the `node:` prefix as of v20.2 [`12183d0`](https://github.com/inspect-js/is-core-module/commit/12183d0d8e4edf56b6ce18a1b3be54bfce10175b) - -## [v2.12.0](https://github.com/inspect-js/is-core-module/compare/v2.11.0...v2.12.0) - 2023-04-10 - -### Commits - -- [actions] update rebase action to use reusable workflow [`c0a7251`](https://github.com/inspect-js/is-core-module/commit/c0a7251f734f3c621932c5fcdfd1bf966b42ca32) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9ae8b7f`](https://github.com/inspect-js/is-core-module/commit/9ae8b7fac03c369861d0991b4a2ce8d4848e6a7d) -- [New] `test/reporters` added in v19.9, `wasi` added in v20 [`9d5341a`](https://github.com/inspect-js/is-core-module/commit/9d5341ab32053f25b7fa7db3c0e18461db24a79c) -- [Dev Deps] add missing `in-publish` dep [`5980245`](https://github.com/inspect-js/is-core-module/commit/59802456e9ac919fa748f53be9d8fbf304a197df) - -## [v2.11.0](https://github.com/inspect-js/is-core-module/compare/v2.10.0...v2.11.0) - 2022-10-18 - -### Commits - -- [meta] use `npmignore` to autogenerate an npmignore file [`3360011`](https://github.com/inspect-js/is-core-module/commit/33600118857b46177178072fba2affcdeb009d12) -- [Dev Deps] update `aud`, `tape` [`651c6b0`](https://github.com/inspect-js/is-core-module/commit/651c6b0cc2799d4130866cf43ad333dcade3d26c) -- [New] `inspector/promises` and `node:inspector/promises` is now available in node 19 [`22d332f`](https://github.com/inspect-js/is-core-module/commit/22d332fe22ac050305444e0781ff85af819abcb0) - -## [v2.10.0](https://github.com/inspect-js/is-core-module/compare/v2.9.0...v2.10.0) - 2022-08-03 - -### Commits - -- [New] `node:test` is now available in node ^16.17 [`e8fd36e`](https://github.com/inspect-js/is-core-module/commit/e8fd36e9b86c917775a07cc473b62a3294f459f2) -- [Tests] improve skip message [`c014a4c`](https://github.com/inspect-js/is-core-module/commit/c014a4c0cd6eb15fff573ae4709191775e70cab4) - -## [v2.9.0](https://github.com/inspect-js/is-core-module/compare/v2.8.1...v2.9.0) - 2022-04-19 - -### Commits - -- [New] add `node:test`, in node 18+ [`f853eca`](https://github.com/inspect-js/is-core-module/commit/f853eca801d0a7d4e1dbb670f1b6d9837d9533c5) -- [Tests] use `mock-property` [`03b3644`](https://github.com/inspect-js/is-core-module/commit/03b3644dff4417f4ba5a7d0aa0138f5f6b3e5c46) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7c0e2d0`](https://github.com/inspect-js/is-core-module/commit/7c0e2d06ed2a89acf53abe2ab34d703ed5b03455) -- [meta] simplify "exports" [`d6ed201`](https://github.com/inspect-js/is-core-module/commit/d6ed201eba7fbba0e59814a9050fc49a6e9878c8) - -## [v2.8.1](https://github.com/inspect-js/is-core-module/compare/v2.8.0...v2.8.1) - 2022-01-05 - -### Commits - -- [actions] reuse common workflows [`cd2cf9b`](https://github.com/inspect-js/is-core-module/commit/cd2cf9b3b66c8d328f65610efe41e9325db7716d) -- [Fix] update node 0.4 results [`062195d`](https://github.com/inspect-js/is-core-module/commit/062195d89f0876a88b95d378b43f7fcc1205bc5b) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0790b62`](https://github.com/inspect-js/is-core-module/commit/0790b6222848c6167132f9f73acc3520fa8d1298) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7d139a6`](https://github.com/inspect-js/is-core-module/commit/7d139a6d767709eabf0a0251e074ec1fb230c06e) -- [Tests] run `nyc` in `tests-only`, not `test` [`780e8a0`](https://github.com/inspect-js/is-core-module/commit/780e8a049951c71cf78b1707f0871c48a28bde14) - -## [v2.8.0](https://github.com/inspect-js/is-core-module/compare/v2.7.0...v2.8.0) - 2021-10-14 - -### Commits - -- [actions] update codecov uploader [`0cfe94e`](https://github.com/inspect-js/is-core-module/commit/0cfe94e106a7d005ea03e008c0a21dec13a77904) -- [New] add `readline/promises` to node v17+ [`4f78c30`](https://github.com/inspect-js/is-core-module/commit/4f78c3008b1b58b4db6dc91d99610b1bc859da7e) -- [Tests] node ^14.18 supports `node:` prefixes for CJS [`43e2f17`](https://github.com/inspect-js/is-core-module/commit/43e2f177452cea2f0eaf34f61b5407217bbdb6f4) - -## [v2.7.0](https://github.com/inspect-js/is-core-module/compare/v2.6.0...v2.7.0) - 2021-09-27 - -### Commits - -- [New] node `v14.18` added `node:`-prefixed core modules to `require` [`6d943ab`](https://github.com/inspect-js/is-core-module/commit/6d943abe81382b9bbe344384d80fbfebe1cc0526) -- [Tests] add coverage for Object.prototype pollution [`c6baf5f`](https://github.com/inspect-js/is-core-module/commit/c6baf5f942311a1945c1af41167bb80b84df2af7) -- [Dev Deps] update `@ljharb/eslint-config` [`6717f00`](https://github.com/inspect-js/is-core-module/commit/6717f000d063ea57beb772bded36c2f056ac404c) -- [eslint] fix linter warning [`594c10b`](https://github.com/inspect-js/is-core-module/commit/594c10bb7d39d7eb00925c90924199ff596184b2) -- [meta] add `sideEffects` flag [`c32cfa5`](https://github.com/inspect-js/is-core-module/commit/c32cfa5195632944c4dd4284a142b8476e75be13) - -## [v2.6.0](https://github.com/inspect-js/is-core-module/compare/v2.5.0...v2.6.0) - 2021-08-17 - -### Commits - -- [Dev Deps] update `eslint`, `tape` [`6cc928f`](https://github.com/inspect-js/is-core-module/commit/6cc928f8a4bba66aeeccc4f6beeac736d4bd3081) -- [New] add `stream/consumers` to node `>= 16.7` [`a1a423e`](https://github.com/inspect-js/is-core-module/commit/a1a423e467e4cc27df180234fad5bab45943e67d) -- [Refactor] Remove duplicated `&&` operand [`86faea7`](https://github.com/inspect-js/is-core-module/commit/86faea738213a2433c62d1098488dc9314dca832) -- [Tests] include prereleases [`a4da7a6`](https://github.com/inspect-js/is-core-module/commit/a4da7a6abf7568e2aa4fd98e69452179f1850963) - -## [v2.5.0](https://github.com/inspect-js/is-core-module/compare/v2.4.0...v2.5.0) - 2021-07-12 - -### Commits - -- [Dev Deps] update `auto-changelog`, `eslint` [`6334cc9`](https://github.com/inspect-js/is-core-module/commit/6334cc94f3af7469685bd8f236740991baaf2705) -- [New] add `stream/web` to node v16.5+ [`17ac59b`](https://github.com/inspect-js/is-core-module/commit/17ac59b662d63e220a2e5728625f005c24f177b2) - -## [v2.4.0](https://github.com/inspect-js/is-core-module/compare/v2.3.0...v2.4.0) - 2021-05-09 - -### Commits - -- [readme] add actions and codecov badges [`82b7faa`](https://github.com/inspect-js/is-core-module/commit/82b7faa12b56dbe47fbea67e1a5b9e447027ba40) -- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8096868`](https://github.com/inspect-js/is-core-module/commit/8096868c024a161ccd4d44110b136763e92eace8) -- [Dev Deps] update `eslint` [`6726824`](https://github.com/inspect-js/is-core-module/commit/67268249b88230018c510f6532a8046d7326346f) -- [New] add `diagnostics_channel` to node `^14.17` [`86c6563`](https://github.com/inspect-js/is-core-module/commit/86c65634201b8ff9b3e48a9a782594579c7f5c3c) -- [meta] fix prepublish script [`697a01e`](https://github.com/inspect-js/is-core-module/commit/697a01e3c9c0be074066520954f30fb28532ec57) - -## [v2.3.0](https://github.com/inspect-js/is-core-module/compare/v2.2.0...v2.3.0) - 2021-04-24 - -### Commits - -- [meta] do not publish github action workflow files [`060d4bb`](https://github.com/inspect-js/is-core-module/commit/060d4bb971a29451c19ff336eb56bee27f9fa95a) -- [New] add support for `node:` prefix, in node 16+ [`7341223`](https://github.com/inspect-js/is-core-module/commit/73412230a769f6e81c05eea50b6520cebf54ed2f) -- [actions] use `node/install` instead of `node/run`; use `codecov` action [`016269a`](https://github.com/inspect-js/is-core-module/commit/016269abae9f6657a5254adfbb813f09a05067f9) -- [patch] remove unneeded `.0` in version ranges [`cb466a6`](https://github.com/inspect-js/is-core-module/commit/cb466a6d89e52b8389e5c12715efcd550c41cea3) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`c9f9c39`](https://github.com/inspect-js/is-core-module/commit/c9f9c396ace60ef81906f98059c064e6452473ed) -- [actions] update workflows [`3ee4a89`](https://github.com/inspect-js/is-core-module/commit/3ee4a89fd5a02fccd43882d905448ea6a98e9a3c) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`dee4fed`](https://github.com/inspect-js/is-core-module/commit/dee4fed79690c1d43a22f7fa9426abebdc6d727f) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`7d046ba`](https://github.com/inspect-js/is-core-module/commit/7d046ba07ae8c9292e43652694ca808d7b309de8) -- [meta] use `prepublishOnly` script for npm 7+ [`149e677`](https://github.com/inspect-js/is-core-module/commit/149e6771a5ede6d097e71785b467a9c4b4977cc7) -- [readme] remove travis badge [`903b51d`](https://github.com/inspect-js/is-core-module/commit/903b51d6b69b98abeabfbc3695c345b02646f19c) - -## [v2.2.0](https://github.com/inspect-js/is-core-module/compare/v2.1.0...v2.2.0) - 2020-11-26 - -### Commits - -- [Tests] migrate tests to Github Actions [`c919f57`](https://github.com/inspect-js/is-core-module/commit/c919f573c0a92d10a0acad0b650b5aecb033d426) -- [patch] `core.json`: %s/ /\t/g [`db3f685`](https://github.com/inspect-js/is-core-module/commit/db3f68581f53e73cc09cd675955eb1bdd6a5a39b) -- [Tests] run `nyc` on all tests [`b2f925f`](https://github.com/inspect-js/is-core-module/commit/b2f925f8866f210ef441f39fcc8cc42692ab89b1) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; add `safe-publish-latest` [`89f02a2`](https://github.com/inspect-js/is-core-module/commit/89f02a2b4162246dea303a6ee31bb9a550b05c72) -- [New] add `path/posix`, `path/win32`, `util/types` [`77f94f1`](https://github.com/inspect-js/is-core-module/commit/77f94f1e90ffd7c0be2a3f1aa8574ebf7fd981b3) - -## [v2.1.0](https://github.com/inspect-js/is-core-module/compare/v2.0.0...v2.1.0) - 2020-11-04 - -### Commits - -- [Dev Deps] update `eslint` [`5e0034e`](https://github.com/inspect-js/is-core-module/commit/5e0034eae57c09c8f1bd769f502486a00f56c6e4) -- [New] Add `diagnostics_channel` [`c2d83d0`](https://github.com/inspect-js/is-core-module/commit/c2d83d0a0225a1a658945d9bab7036ea347d29ec) - -## [v2.0.0](https://github.com/inspect-js/is-core-module/compare/v1.0.2...v2.0.0) - 2020-09-29 - -### Commits - -- v2 implementation [`865aeb5`](https://github.com/inspect-js/is-core-module/commit/865aeb5ca0e90248a3dfff5d7622e4751fdeb9cd) -- Only apps should have lockfiles [`5a5e660`](https://github.com/inspect-js/is-core-module/commit/5a5e660d568e37eb44e17fb1ebb12a105205fc2b) -- Initial commit for v2 [`5a51524`](https://github.com/inspect-js/is-core-module/commit/5a51524e06f92adece5fbb138c69b7b9748a2348) -- Tests [`116eae4`](https://github.com/inspect-js/is-core-module/commit/116eae4fccd01bc72c1fd3cc4b7561c387afc496) -- [meta] add `auto-changelog` [`c24388b`](https://github.com/inspect-js/is-core-module/commit/c24388bee828d223040519d1f5b226ca35beee63) -- [actions] add "Automatic Rebase" and "require allow edits" actions [`34292db`](https://github.com/inspect-js/is-core-module/commit/34292dbcbadae0868aff03c22dbd8b7b8a11558a) -- [Tests] add `npm run lint` [`4f9eeee`](https://github.com/inspect-js/is-core-module/commit/4f9eeee7ddff10698bbf528620f4dc8d4fa3e697) -- [readme] fix travis badges, https all URLs [`e516a73`](https://github.com/inspect-js/is-core-module/commit/e516a73b0dccce20938c432b1ba512eae8eff9e9) -- [meta] create FUNDING.yml [`1aabebc`](https://github.com/inspect-js/is-core-module/commit/1aabebca98d01f8a04e46bc2e2520fa93cf21ac6) -- [Fix] `domain`: domain landed sometime > v0.7.7 and <= v0.7.12 [`2df7d37`](https://github.com/inspect-js/is-core-module/commit/2df7d37595d41b15eeada732b706b926c2771655) -- [Fix] `sys`: worked in 0.6, not 0.7, and 0.8+ [`a75c134`](https://github.com/inspect-js/is-core-module/commit/a75c134229e1e9441801f6b73f6a52489346eb65) - -## [v1.0.2](https://github.com/inspect-js/is-core-module/compare/v1.0.1...v1.0.2) - 2014-09-28 - -### Commits - -- simpler [`66fe90f`](https://github.com/inspect-js/is-core-module/commit/66fe90f9771581b9adc0c3900baa52c21b5baea2) - -## [v1.0.1](https://github.com/inspect-js/is-core-module/compare/v1.0.0...v1.0.1) - 2014-09-28 - -### Commits - -- remove stupid [`f21f906`](https://github.com/inspect-js/is-core-module/commit/f21f906f882c2bd656a5fc5ed6fbe48ddaffb2ac) -- update readme [`1eff0ec`](https://github.com/inspect-js/is-core-module/commit/1eff0ec69798d1ec65771552d1562911e90a8027) - -## v1.0.0 - 2014-09-28 - -### Commits - -- init [`48e5e76`](https://github.com/inspect-js/is-core-module/commit/48e5e76cac378fddb8c1f7d4055b8dfc943d6b96) diff --git a/node_modules/is-core-module/LICENSE b/node_modules/is-core-module/LICENSE deleted file mode 100644 index 2e50287..0000000 --- a/node_modules/is-core-module/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Dave Justice - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/is-core-module/README.md b/node_modules/is-core-module/README.md deleted file mode 100644 index 062d906..0000000 --- a/node_modules/is-core-module/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# is-core-module [![Version Badge][2]][1] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version. - -## Example - -```js -var isCore = require('is-core-module'); -var assert = require('assert'); -assert(isCore('fs')); -assert(!isCore('butts')); -``` - -## Tests -Clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-core-module -[2]: https://versionbadg.es/inspect-js/is-core-module.svg -[5]: https://david-dm.org/inspect-js/is-core-module.svg -[6]: https://david-dm.org/inspect-js/is-core-module -[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg -[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies -[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/is-core-module.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg -[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module -[codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module -[actions-url]: https://github.com/inspect-js/is-core-module/actions diff --git a/node_modules/is-core-module/core.json b/node_modules/is-core-module/core.json deleted file mode 100644 index 3cda693..0000000 --- a/node_modules/is-core-module/core.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "assert": true, - "node:assert": [">= 14.18 && < 15", ">= 16"], - "assert/strict": ">= 15", - "node:assert/strict": ">= 16", - "async_hooks": ">= 8", - "node:async_hooks": [">= 14.18 && < 15", ">= 16"], - "buffer_ieee754": ">= 0.5 && < 0.9.7", - "buffer": true, - "node:buffer": [">= 14.18 && < 15", ">= 16"], - "child_process": true, - "node:child_process": [">= 14.18 && < 15", ">= 16"], - "cluster": ">= 0.5", - "node:cluster": [">= 14.18 && < 15", ">= 16"], - "console": true, - "node:console": [">= 14.18 && < 15", ">= 16"], - "constants": true, - "node:constants": [">= 14.18 && < 15", ">= 16"], - "crypto": true, - "node:crypto": [">= 14.18 && < 15", ">= 16"], - "_debug_agent": ">= 1 && < 8", - "_debugger": "< 8", - "dgram": true, - "node:dgram": [">= 14.18 && < 15", ">= 16"], - "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"], - "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], - "dns": true, - "node:dns": [">= 14.18 && < 15", ">= 16"], - "dns/promises": ">= 15", - "node:dns/promises": ">= 16", - "domain": ">= 0.7.12", - "node:domain": [">= 14.18 && < 15", ">= 16"], - "events": true, - "node:events": [">= 14.18 && < 15", ">= 16"], - "freelist": "< 6", - "fs": true, - "node:fs": [">= 14.18 && < 15", ">= 16"], - "fs/promises": [">= 10 && < 10.1", ">= 14"], - "node:fs/promises": [">= 14.18 && < 15", ">= 16"], - "_http_agent": ">= 0.11.1", - "node:_http_agent": [">= 14.18 && < 15", ">= 16"], - "_http_client": ">= 0.11.1", - "node:_http_client": [">= 14.18 && < 15", ">= 16"], - "_http_common": ">= 0.11.1", - "node:_http_common": [">= 14.18 && < 15", ">= 16"], - "_http_incoming": ">= 0.11.1", - "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], - "_http_outgoing": ">= 0.11.1", - "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], - "_http_server": ">= 0.11.1", - "node:_http_server": [">= 14.18 && < 15", ">= 16"], - "http": true, - "node:http": [">= 14.18 && < 15", ">= 16"], - "http2": ">= 8.8", - "node:http2": [">= 14.18 && < 15", ">= 16"], - "https": true, - "node:https": [">= 14.18 && < 15", ">= 16"], - "inspector": ">= 8", - "node:inspector": [">= 14.18 && < 15", ">= 16"], - "inspector/promises": [">= 19"], - "node:inspector/promises": [">= 19"], - "_linklist": "< 8", - "module": true, - "node:module": [">= 14.18 && < 15", ">= 16"], - "net": true, - "node:net": [">= 14.18 && < 15", ">= 16"], - "node-inspect/lib/_inspect": ">= 7.6 && < 12", - "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", - "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", - "os": true, - "node:os": [">= 14.18 && < 15", ">= 16"], - "path": true, - "node:path": [">= 14.18 && < 15", ">= 16"], - "path/posix": ">= 15.3", - "node:path/posix": ">= 16", - "path/win32": ">= 15.3", - "node:path/win32": ">= 16", - "perf_hooks": ">= 8.5", - "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], - "process": ">= 1", - "node:process": [">= 14.18 && < 15", ">= 16"], - "punycode": ">= 0.5", - "node:punycode": [">= 14.18 && < 15", ">= 16"], - "querystring": true, - "node:querystring": [">= 14.18 && < 15", ">= 16"], - "readline": true, - "node:readline": [">= 14.18 && < 15", ">= 16"], - "readline/promises": ">= 17", - "node:readline/promises": ">= 17", - "repl": true, - "node:repl": [">= 14.18 && < 15", ">= 16"], - "smalloc": ">= 0.11.5 && < 3", - "_stream_duplex": ">= 0.9.4", - "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], - "_stream_transform": ">= 0.9.4", - "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], - "_stream_wrap": ">= 1.4.1", - "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], - "_stream_passthrough": ">= 0.9.4", - "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], - "_stream_readable": ">= 0.9.4", - "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], - "_stream_writable": ">= 0.9.4", - "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], - "stream": true, - "node:stream": [">= 14.18 && < 15", ">= 16"], - "stream/consumers": ">= 16.7", - "node:stream/consumers": ">= 16.7", - "stream/promises": ">= 15", - "node:stream/promises": ">= 16", - "stream/web": ">= 16.5", - "node:stream/web": ">= 16.5", - "string_decoder": true, - "node:string_decoder": [">= 14.18 && < 15", ">= 16"], - "sys": [">= 0.4 && < 0.7", ">= 0.8"], - "node:sys": [">= 14.18 && < 15", ">= 16"], - "test/reporters": ">= 19.9 && < 20.2", - "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], - "node:test": [">= 16.17 && < 17", ">= 18"], - "timers": true, - "node:timers": [">= 14.18 && < 15", ">= 16"], - "timers/promises": ">= 15", - "node:timers/promises": ">= 16", - "_tls_common": ">= 0.11.13", - "node:_tls_common": [">= 14.18 && < 15", ">= 16"], - "_tls_legacy": ">= 0.11.3 && < 10", - "_tls_wrap": ">= 0.11.3", - "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], - "tls": true, - "node:tls": [">= 14.18 && < 15", ">= 16"], - "trace_events": ">= 10", - "node:trace_events": [">= 14.18 && < 15", ">= 16"], - "tty": true, - "node:tty": [">= 14.18 && < 15", ">= 16"], - "url": true, - "node:url": [">= 14.18 && < 15", ">= 16"], - "util": true, - "node:util": [">= 14.18 && < 15", ">= 16"], - "util/types": ">= 15.3", - "node:util/types": ">= 16", - "v8/tools/arguments": ">= 10 && < 12", - "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8": ">= 1", - "node:v8": [">= 14.18 && < 15", ">= 16"], - "vm": true, - "node:vm": [">= 14.18 && < 15", ">= 16"], - "wasi": [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], - "node:wasi": [">= 18.17 && < 19", ">= 20"], - "worker_threads": ">= 11.7", - "node:worker_threads": [">= 14.18 && < 15", ">= 16"], - "zlib": ">= 0.5", - "node:zlib": [">= 14.18 && < 15", ">= 16"] -} diff --git a/node_modules/is-core-module/index.js b/node_modules/is-core-module/index.js deleted file mode 100644 index 423e20c..0000000 --- a/node_modules/is-core-module/index.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -var hasOwn = require('hasown'); - -function specifierIncluded(current, specifier) { - var nodeParts = current.split('.'); - var parts = specifier.split(' '); - var op = parts.length > 1 ? parts[0] : '='; - var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); - - for (var i = 0; i < 3; ++i) { - var cur = parseInt(nodeParts[i] || 0, 10); - var ver = parseInt(versionParts[i] || 0, 10); - if (cur === ver) { - continue; // eslint-disable-line no-restricted-syntax, no-continue - } - if (op === '<') { - return cur < ver; - } - if (op === '>=') { - return cur >= ver; - } - return false; - } - return op === '>='; -} - -function matchesRange(current, range) { - var specifiers = range.split(/ ?&& ?/); - if (specifiers.length === 0) { - return false; - } - for (var i = 0; i < specifiers.length; ++i) { - if (!specifierIncluded(current, specifiers[i])) { - return false; - } - } - return true; -} - -function versionIncluded(nodeVersion, specifierValue) { - if (typeof specifierValue === 'boolean') { - return specifierValue; - } - - var current = typeof nodeVersion === 'undefined' - ? process.versions && process.versions.node - : nodeVersion; - - if (typeof current !== 'string') { - throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); - } - - if (specifierValue && typeof specifierValue === 'object') { - for (var i = 0; i < specifierValue.length; ++i) { - if (matchesRange(current, specifierValue[i])) { - return true; - } - } - return false; - } - return matchesRange(current, specifierValue); -} - -var data = require('./core.json'); - -module.exports = function isCore(x, nodeVersion) { - return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]); -}; diff --git a/node_modules/is-core-module/package.json b/node_modules/is-core-module/package.json deleted file mode 100644 index 1bac585..0000000 --- a/node_modules/is-core-module/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "is-core-module", - "version": "2.13.1", - "description": "Is this specifier a node.js core module?", - "main": "index.js", - "sideEffects": false, - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "lint": "eslint .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/inspect-js/is-core-module.git" - }, - "keywords": [ - "core", - "modules", - "module", - "npm", - "node", - "dependencies" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/inspect-js/is-core-module/issues" - }, - "homepage": "https://github.com/inspect-js/is-core-module", - "dependencies": { - "hasown": "^2.0.0" - }, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", - "aud": "^2.0.3", - "auto-changelog": "^2.4.0", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "mock-property": "^1.0.2", - "npmignore": "^0.3.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "semver": "^6.3.1", - "tape": "^5.7.1" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github" - ] - } -} diff --git a/node_modules/is-core-module/test/index.js b/node_modules/is-core-module/test/index.js deleted file mode 100644 index 912808b..0000000 --- a/node_modules/is-core-module/test/index.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict'; - -var test = require('tape'); -var keys = require('object-keys'); -var semver = require('semver'); -var mockProperty = require('mock-property'); - -var isCore = require('../'); -var data = require('../core.json'); - -var supportsNodePrefix = semver.satisfies(process.versions.node, '^14.18 || >= 16', { includePrerelease: true }); - -test('core modules', function (t) { - t.test('isCore()', function (st) { - st.ok(isCore('fs')); - st.ok(isCore('net')); - st.ok(isCore('http')); - - st.ok(!isCore('seq')); - st.ok(!isCore('../')); - - st.ok(!isCore('toString')); - - st.end(); - }); - - t.test('core list', function (st) { - var cores = keys(data); - st.plan(cores.length); - - for (var i = 0; i < cores.length; ++i) { - var mod = cores[i]; - var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func - if (isCore(mod)) { - st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw'); - } else { - st['throws'](requireFunc, mod + ' not supported; requiring throws'); - } - } - - st.end(); - }); - - t.test('core via repl module', { skip: !data.repl }, function (st) { - var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle - if (!libs) { - st.skip('repl._builtinLibs does not exist'); - } else { - for (var i = 0; i < libs.length; ++i) { - var mod = libs[i]; - st.ok(data[mod], mod + ' is a core module'); - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - if (mod.slice(0, 5) !== 'node:') { - if (supportsNodePrefix) { - st.doesNotThrow( - function () { require('node:' + mod); }, // eslint-disable-line no-loop-func - 'requiring node:' + mod + ' does not throw' - ); - } else { - st['throws']( - function () { require('node:' + mod); }, // eslint-disable-line no-loop-func - 'requiring node:' + mod + ' throws' - ); - } - } - } - } - st.end(); - }); - - t.test('core via builtinModules list', { skip: !data.module }, function (st) { - var libs = require('module').builtinModules; - if (!libs) { - st.skip('module.builtinModules does not exist'); - } else { - var excludeList = [ - '_debug_agent', - 'v8/tools/tickprocessor-driver', - 'v8/tools/SourceMap', - 'v8/tools/tickprocessor', - 'v8/tools/profile' - ]; - // see https://github.com/nodejs/node/issues/42785 - if (semver.satisfies(process.version, '>= 18')) { - libs = libs.concat('node:test'); - } - for (var i = 0; i < libs.length; ++i) { - var mod = libs[i]; - if (excludeList.indexOf(mod) === -1) { - st.ok(data[mod], mod + ' is a core module'); - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - if (mod.slice(0, 5) !== 'node:') { - if (supportsNodePrefix) { - st.doesNotThrow( - function () { require('node:' + mod); }, // eslint-disable-line no-loop-func - 'requiring node:' + mod + ' does not throw' - ); - } else { - st['throws']( - function () { require('node:' + mod); }, // eslint-disable-line no-loop-func - 'requiring node:' + mod + ' throws' - ); - } - } - } - } - } - st.end(); - }); - - t.test('Object.prototype pollution', function (st) { - var nonKey = 'not a core module'; - st.teardown(mockProperty(Object.prototype, 'fs', { value: false })); - st.teardown(mockProperty(Object.prototype, 'path', { value: '>= 999999999' })); - st.teardown(mockProperty(Object.prototype, 'http', { value: data.http })); - st.teardown(mockProperty(Object.prototype, nonKey, { value: true })); - - st.equal(isCore('fs'), true, 'fs is a core module even if Object.prototype lies'); - st.equal(isCore('path'), true, 'path is a core module even if Object.prototype lies'); - st.equal(isCore('http'), true, 'path is a core module even if Object.prototype matches data'); - st.equal(isCore(nonKey), false, '"' + nonKey + '" is not a core module even if Object.prototype lies'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/is-plain-object/LICENSE b/node_modules/is-plain-object/LICENSE deleted file mode 100644 index 3f2eca1..0000000 --- a/node_modules/is-plain-object/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-plain-object/README.md b/node_modules/is-plain-object/README.md deleted file mode 100644 index 1f9d0c8..0000000 --- a/node_modules/is-plain-object/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# is-plain-object [![NPM version](https://img.shields.io/npm/v/is-plain-object.svg?style=flat)](https://www.npmjs.com/package/is-plain-object) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![NPM total downloads](https://img.shields.io/npm/dt/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-plain-object.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-plain-object) - -> Returns true if an object was created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-plain-object -``` - -Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null. - -## Usage - -```js -var isPlainObject = require('is-plain-object'); -``` - -**true** when created by the `Object` constructor. - -```js -isPlainObject(Object.create({})); -//=> true -isPlainObject(Object.create(Object.prototype)); -//=> true -isPlainObject({foo: 'bar'}); -//=> true -isPlainObject({}); -//=> true -``` - -**false** when not created by the `Object` constructor. - -```js -isPlainObject(1); -//=> false -isPlainObject(['foo', 'bar']); -//=> false -isPlainObject([]); -//=> false -isPlainObject(new Foo); -//=> false -isPlainObject(null); -//=> false -isPlainObject(Object.create(null)); -//=> false -``` - -## About - -### Related projects - -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 17 | [jonschlinkert](https://github.com/jonschlinkert) | -| 6 | [stevenvachon](https://github.com/stevenvachon) | -| 3 | [onokumus](https://github.com/onokumus) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._ \ No newline at end of file diff --git a/node_modules/is-plain-object/index.d.ts b/node_modules/is-plain-object/index.d.ts deleted file mode 100644 index 74a44e9..0000000 --- a/node_modules/is-plain-object/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isPlainObject; - -declare function isPlainObject(o: any): boolean; - -declare namespace isPlainObject {} diff --git a/node_modules/is-plain-object/index.js b/node_modules/is-plain-object/index.js deleted file mode 100644 index c328484..0000000 --- a/node_modules/is-plain-object/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); - -function isObjectObject(o) { - return isObject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; -} - -module.exports = function isPlainObject(o) { - var ctor,prot; - - if (isObjectObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; - - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -}; diff --git a/node_modules/is-plain-object/package.json b/node_modules/is-plain-object/package.json deleted file mode 100644 index dd60498..0000000 --- a/node_modules/is-plain-object/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "is-plain-object", - "description": "Returns true if an object was created by the `Object` constructor.", - "version": "2.0.4", - "homepage": "https://github.com/jonschlinkert/is-plain-object", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Osman Nuri Okumuş (http://onokumus.com)", - "Steven Vachon (https://svachon.com)", - "(https://github.com/wtgtybhertgeghgtwtg)" - ], - "repository": "jonschlinkert/is-plain-object", - "bugs": { - "url": "https://github.com/jonschlinkert/is-plain-object/issues" - }, - "license": "MIT", - "files": [ - "index.d.ts", - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "browserify": "browserify index.js --standalone isPlainObject | uglifyjs --compress --mangle -o browser/is-plain-object.js", - "test_browser": "mocha-phantomjs test/browser.html", - "test_node": "mocha", - "test": "npm run test_node && npm run browserify && npm run test_browser" - }, - "dependencies": { - "isobject": "^3.0.1" - }, - "devDependencies": { - "browserify": "^14.4.0", - "chai": "^4.0.2", - "gulp-format-md": "^1.0.0", - "mocha": "^3.4.2", - "mocha-phantomjs": "^4.1.0", - "phantomjs": "^2.1.7", - "uglify-js": "^3.0.24" - }, - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "javascript", - "kind", - "kind-of", - "object", - "plain", - "type", - "typeof", - "value" - ], - "types": "index.d.ts", - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-number", - "isobject", - "kind-of" - ] - }, - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/is-url/.travis.yml b/node_modules/is-url/.travis.yml deleted file mode 100644 index 1a8f06b..0000000 --- a/node_modules/is-url/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 8 \ No newline at end of file diff --git a/node_modules/is-url/History.md b/node_modules/is-url/History.md deleted file mode 100644 index 8b24e02..0000000 --- a/node_modules/is-url/History.md +++ /dev/null @@ -1,25 +0,0 @@ - -1.2.0 - November 25, 2014 -------------------------- -* add support for protocol relative urls - -1.1.0 - February 8, 2013 ------------------------- -* support any protocol -* support paths on localhost - -1.0.0 - January 17, 2013 ------------------------- -* allow localhost to have a port - -0.1.0 - September 8, 2013 -------------------------- -* make regexp match more valid url types - -0.0.2 - August 2, 2013 ----------------------- -* remove loose matching - -0.0.1 - August 2, 2013 ----------------------- -:sparkles: \ No newline at end of file diff --git a/node_modules/is-url/LICENSE-MIT b/node_modules/is-url/LICENSE-MIT deleted file mode 100644 index fe5bb30..0000000 --- a/node_modules/is-url/LICENSE-MIT +++ /dev/null @@ -1,19 +0,0 @@ -MIT LICENSE - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-url/Readme.md b/node_modules/is-url/Readme.md deleted file mode 100644 index 20ed181..0000000 --- a/node_modules/is-url/Readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# is-url - -Check whether a string is a URL. - -## Installation - -```sh -npm install is-url -``` - -## API - -### `isUrl(string)` - -Returns a Boolean indicating whether `string` is a URL. - -## License - -MIT diff --git a/node_modules/is-url/index.js b/node_modules/is-url/index.js deleted file mode 100644 index 3ea3d20..0000000 --- a/node_modules/is-url/index.js +++ /dev/null @@ -1,47 +0,0 @@ - -/** - * Expose `isUrl`. - */ - -module.exports = isUrl; - -/** - * RegExps. - * A URL must match #1 and then at least one of #2/#3. - * Use two levels of REs to avoid REDOS. - */ - -var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/; - -var localhostDomainRE = /^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/ -var nonLocalhostDomainRE = /^[^\s\.]+\.\S{2,}$/; - -/** - * Loosely validate a URL `string`. - * - * @param {String} string - * @return {Boolean} - */ - -function isUrl(string){ - if (typeof string !== 'string') { - return false; - } - - var match = string.match(protocolAndDomainRE); - if (!match) { - return false; - } - - var everythingAfterProtocol = match[1]; - if (!everythingAfterProtocol) { - return false; - } - - if (localhostDomainRE.test(everythingAfterProtocol) || - nonLocalhostDomainRE.test(everythingAfterProtocol)) { - return true; - } - - return false; -} diff --git a/node_modules/is-url/package.json b/node_modules/is-url/package.json deleted file mode 100644 index 34b3ac1..0000000 --- a/node_modules/is-url/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "is-url", - "description": "Check whether a string is a URL.", - "repository": "https://github.com/segmentio/is-url", - "version": "1.2.4", - "scripts": { - "test": "mocha --reporter spec" - }, - "license": "MIT", - "devDependencies": { - "mocha": "*" - } -} diff --git a/node_modules/is-url/test/index.js b/node_modules/is-url/test/index.js deleted file mode 100644 index 404e1b6..0000000 --- a/node_modules/is-url/test/index.js +++ /dev/null @@ -1,149 +0,0 @@ - -try { - var url = require('is-url'); -} catch (e) { - var url = require('..'); -} - -var assert = require('assert'); - -describe('is-url', function () { - describe('valid', function () { - it('http://google.com', function () { - assert(url('http://google.com')); - }); - - it('https://google.com', function () { - assert(url('https://google.com')); - }); - - it('ftp://google.com', function () { - assert(url('ftp://google.com')); - }); - - it('http://www.google.com', function () { - assert(url('http://www.google.com')); - }); - - it('http://google.com/something', function () { - assert(url('http://google.com/something')); - }); - - it('http://google.com?q=query', function () { - assert(url('http://google.com?q=query')); - }); - - it('http://google.com#hash', function () { - assert(url('http://google.com#hash')); - }); - - it('http://google.com/something?q=query#hash', function () { - assert(url('http://google.com/something?q=query#hash')); - }); - - it('http://google.co.uk', function () { - assert(url('http://google.co.uk')); - }); - - it('http://www.google.co.uk', function () { - assert(url('http://www.google.co.uk')); - }); - - it('http://google.cat', function () { - assert(url('http://google.cat')); - }); - - it('https://d1f4470da51b49289906b3d6cbd65074@app.getsentry.com/13176', function () { - assert(url('https://d1f4470da51b49289906b3d6cbd65074@app.getsentry.com/13176')); - }); - - it('http://0.0.0.0', function () { - assert(url('http://0.0.0.0')); - }); - - it('http://localhost', function () { - assert(url('http://localhost')); - }); - - it('postgres://u:p@example.com:5702/db', function () { - assert(url('postgres://u:p@example.com:5702/db')); - }); - - it('redis://:123@174.129.42.52:13271', function () { - assert(url('redis://:123@174.129.42.52:13271')); - }); - - it('mongodb://u:p@example.com:10064/db', function () { - assert(url('mongodb://u:p@example.com:10064/db')); - }); - - it('ws://chat.example.com/games', function () { - assert(url('ws://chat.example.com/games')); - }); - - it('wss://secure.example.com/biz', function () { - assert(url('wss://secure.example.com/biz')); - }); - - it('http://localhost:4000', function () { - assert(url('http://localhost:4000')); - }); - - it('http://localhost:342/a/path', function () { - assert(url('http://localhost:342/a/path')); - }); - - it('//google.com', function () { - assert(url('//google.com')); - }); - }); - - describe('invalid', function () { - it('http://', function () { - assert(!url('http://')); - }); - - it('http://google', function () { - assert(!url('http://google')); - }); - - it('http://google.', function () { - assert(!url('http://google.')); - }); - - it('google', function () { - assert(!url('google')); - }); - - it('google.com', function () { - assert(!url('google.com')); - }); - - it('empty', function () { - assert(!url('')); - }); - - it('undef', function () { - assert(!url(undefined)); - }); - - it('object', function () { - assert(!url({})); - }); - - it('re', function () { - assert(!url(/abc/)); - }); - }); - - describe('redos', function () { - it('redos exploit', function () { - // Invalid. This should be discovered in under 1 second. - var attackString = 'a://localhost' + '9'.repeat(100000) + '\t'; - var before = process.hrtime(); - assert(!url(attackString), 'attackString was valid'); - var elapsed = process.hrtime(before); - assert(elapsed[0] < 1, 'attackString took ' + elapsed[0] + ' > 1 seconds'); - }); - }); -}); diff --git a/node_modules/is2/.jshintrc b/node_modules/is2/.jshintrc deleted file mode 100644 index f39326d..0000000 --- a/node_modules/is2/.jshintrc +++ /dev/null @@ -1,43 +0,0 @@ -{ - "browser" : false, - "curly" : false, - "devel" : false, - "eqeqeq" : true, - "eqnull" : true, - "es5" : true, - "esnext" : true, - "expr" : true, - "forin" : false, - "immed" : false, - "indent" : 4, - "latedef" : false, - "laxcomma" : true, - "maxdepth" : 5, - "maxlen" : 9110, - "maxparams" : 4, - "maxstatements" : 100, - "newcap" : true, - "noarg" : true, - "noempty" : true, - "nonew" : false, - "node" : true, - "onevar" : false, - "plusplus" : false, - "quotmark" : "single", - "regexp" : false, - "undef" : true, - "unused" : true, - "strict" : true, - "trailing" : true, - "undef" : true, - "unused" : true, - "white" : false, - - "globals" : { - "it" : false, - "console" : true, - "describe" : false, - "toString" : false, - "window" : true - } -} diff --git a/node_modules/is2/LICENSE b/node_modules/is2/LICENSE deleted file mode 100644 index 4c05804..0000000 --- a/node_modules/is2/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Edmond Meinfelder - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is2/README.md b/node_modules/is2/README.md deleted file mode 100644 index d27505e..0000000 --- a/node_modules/is2/README.md +++ /dev/null @@ -1,164 +0,0 @@ -is2 -=== -is2 is a type-checking module for JavaScript to test values. Is does not throw -exceptions and every function only returns true or false. Use is2 to validate -types in your node.js code. Every function in is2 returns either true of false. - -## Installation -To install is2, type: - - $ npm install is2 - -## Usage - - const is = require('is2'); - - console.log(`1===1 is: ${is.equal(true, 1===1)}`); - console.log(`10 is a positive number: ${is.positiveNumber(10)}`); - console.log(`11 is an odd number: ${is.oddNumber(11)}`); - -## API - -Each function returns true or false. The names after the '-' are aliases, which -provide brevity. - -Environment: - -* is.browser() -* is.defined(val) - is.def -* is.nodejs() - is.node() -* is.undefined(val) - is.udef, is.undef - -Types: - -* is.array(val) - is.ary, is.arry -* is.arrayLike(val) - is.arryLike, is.aryLike, is.arrLike -* is.arguments(val) - is.args -* is.boolean(val) - is.bool -* is.buffer(val) - is.buf, is.buff -* is.date(val) -* is.error(val) - is.err -* is.false(val) -* is.function(val) - is.funct, is.fun -* is.mongoId - is.objectId, is.objId -* is.null(val) -* is.nullOrUndefined(val) - is.nullOrUndef -* is.number(val) - is.num -* is.object(val) - is.obj -* is.regExp(val) - is.regexp, is.re -* is.string(val) - is.str -* is.true(val) -* is.uuid(val) - -Relationships: - -* is.equal(val, other) - is.eq, is.objEquals -* is.hosted(val, host) -* is.instanceOf(val, constructor) - is.instOf, is.instanceof -* is.matching(val1, val2 [, val3, ...]) - is.match : true if the first arument - is strictly equal to any of the subsequent args. -* is.objectInstanceof(obj, objType) - is.instOf, is.instanceOf, is.objInstOf, is.objectInstanceOf -* is.type(val, type) - is.a -* is.enumerator(val, array) - is.enum, is.inArray - -Object State: - -* is.empty(val) -* is.emptyArguments(val) - is.emptyArgs, is.noArgs -* is.emptyArray(val) - is.emptyArry, is.emptyAry, is.emptyArray -* is.emptyArrayLike(val) - is.emptyArrLike -* is.emptyString(val) - is.emptyStr -* is.nonEmptyArray(val) - is.nonEmptyArry, is.nonEmptyAry -* is.nonEmptyObject(val) - is.nonEmptyObj -* is.emptyObject(val) - is.emptyObj -* is.nonEmptyString(val) - is.nonEmptyStr - -Numeric Types within Number: - -* is.even(val) - is.evenNum, is.evenNumber -* is.decimal(val) - is.decNum, is.dec -* is.integer(val) - is.int -* is.notANumber(val) - is.nan, is.notANum -* is.odd(val) - is.oddNum, is.oddNumber - -Numeric Type and State: - -* is.positiveNumber(val) - is.pos, is.positive, is.posNum, is.positiveNum -* is.negativeNumber(val) - is.neg, is.negNum, is.negativeNum, is.negativeNumber -* is.negativeInteger(val) - is.negativeInt, is.negInt -* is.positiveInteger(val) - is.posInt, is.positiveInt - -Numeric Relationship: - -* is.divisibleBy(val, other) - is.divisBy, is.divBy -* is.greaterOrEqualTo(val, other) - is.ge, is.greaterOrEqual -* is.greaterThan(val, other) - is.gt -* is.lessThanOrEqualTo(val, other) - is.lessThanOrEq, is.lessThanOrEqual, is.le -* is.lessThan(val, other) - is.lt -* is.maximum(val, array) - is.max -* is.minimum(val, array) - is.min -* is.withIn(val, start, finish) - is.within -* is.prettyClose(val, comp, precision) - is.closish, is.near - -Networking: - -* is.dnsAddress(val) - is.dnsAddr, is.dns -* is.emailAddress(val) - is.email, is.emailAddr -* is.ipv4Address(val) - is.ipv4, is.ipv4Addr -* is.ipv6Address(val) - is.ipv6, is.ipv6Addr -* is.ipAddress(val) - is.ip, is.ipAddr -* is.hostAddress(val) - is.host = is.hostIp = is.hostAddr -* is.port(val) -* is.systemPort(val) - is.sysPort -* is.url(val) - is.uri -* is.userPort(val) - -Credit Cards: - -* is.creditCardNumber(str) - is.creditCard, is.creditCardNum -* is.americanExpressCardNumber(str) - is.amexCardNum, is.amexCard -* is.chinaUnionPayCardNumber(str) - is.chinaUnionPayCard, is.chinaUnion -* is.dankortCardNumber(str) - is.dankortCard, is.dankort -* is.dinersClubCarteBlancheCardNumber(str) - is.dinersClubCarteBlancheCard, - is.dinersClubCB -* is.dinersClubInternationalCardNumber(str) - is.dinersClubInternationalCard, - is.dinersClubInt -* is.dinersClubUSACanadaCardNumber(str) - is.dinersClubUSACanCard, is.dinersClub -* is.discoverCardNumber(str) - is.discoverCard, is.discover -* is.instaPaymentCardNumber(str) - is.instaPayment -* is.jcbCardNumber(str) - is.jcbCard, is.jcb -* is.laserCardNumber(str) - is.laserCard, is.laser -* is.maestroCardNumber(str) - is.maestroCard, is.maestro -* is.masterCardCardNumber - is.masterCardCard, is.masterCard -* is.visaCardNumber(str) - is.visaCard, is.visa -* is.visaElectronCardNumber(str) - is.visaElectronCard, is.visaElectron - -Personal information: - -* is.streetAddress(str) - is.street, is.address -* is.zipCode(str) - is.zip -* is.phoneNumber(str) - is.phone - - -## License -The MIT License (MIT) - -Copyright (c) 2013,2014 Edmond Meinfelder -Copyright (c) 2011 Enrico Marino - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is2/index.js b/node_modules/is2/index.js deleted file mode 100644 index 626614f..0000000 --- a/node_modules/is2/index.js +++ /dev/null @@ -1,1310 +0,0 @@ -/** - * @fileOverview - * is2 derived from is by Enrico Marino, adapted for Node.js. - * Slightly modified by Edmond Meinfelder - * - * is - * the definitive JavaScript type testing library - * Copyright(c) 2013,2014 Edmond Meinfelder - * Copyright(c) 2011 Enrico Marino - * MIT license - */ -'use strict'; -const owns = {}.hasOwnProperty; -const toString = {}.toString; -const is = exports; -const deepIs = require('deep-is'); -const ipRegEx = require('ip-regex'); -is.version = require('./package.json').version; - -//////////////////////////////////////////////////////////////////////////////// -// Environment - -/** - * Tests if is is running under a browser. - * @return {Boolean} true if the environment has process, process.version and process.versions. - */ -is.browser = function() { - return (!is.node() && typeof window !== 'undefined' && toString.call(window) === '[object global]'); -}; - -/** - * Test if 'value' is defined. - * Alias: def - * @param {Any} value The value to test. - * @return {Boolean} true if 'value' is defined, false otherwise. - */ -is.defined = function(value) { - return typeof value !== 'undefined'; -}; -is.def = is.defined; - -/** - * Tests if is is running under node.js - * @return {Boolean} true if the environment has process, process.version and process.versions. - */ -is.nodejs = function() { - return (process && process.hasOwnProperty('version') && - process.hasOwnProperty('versions')); -}; -is.node = is.nodejs; - -/** - * Test if 'value' is undefined. - * Aliases: undef, udef - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is undefined, false otherwise. - */ -is.undefined = function(value) { - return value === undefined; -}; -is.udef = is.undef = is.undefined; - - -//////////////////////////////////////////////////////////////////////////////// -// Types - -/** - * Test if 'value' is an array. - * Alias: ary, arry - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an array, false otherwise. - */ -is.array = function(value) { - return '[object Array]' === toString.call(value); -}; -is.arr = is.ary = is.arry = is.array; - -/** - * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value) - * Aliases: arraylike, arryLike, aryLike - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an arguments object, false otherwise. - */ -is.arrayLike = function(value) { - if (is.nullOrUndef(value)) - return false; - return value !== undefined && - owns.call(value, 'length') && - isFinite(value.length); -}; -is.arrLike = is.arryLike = is.aryLike = is.arraylike = is.arrayLike; - -/** - * Test if 'value' is an arguments object. - * Alias: args - * @param {Any} value value to test - * @return {Boolean} true if 'value' is an arguments object, false otherwise - */ -is.arguments = function(value) { - return '[object Arguments]' === toString.call(value); -}; -is.args = is.arguments; - -/** - * Test if 'value' is a boolean. - * Alias: bool - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a boolean, false otherwise. - */ -is.boolean = function(value) { - return '[object Boolean]' === toString.call(value); -}; -is.bool = is.boolean; - -/** - * Test if 'value' is an instance of Buffer. - * Aliases: instOf, instanceof - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an instance of 'constructor'. - */ -is.buffer = function(value) { - return is.nodejs() && Buffer && Buffer.hasOwnProperty('isBuffer') && Buffer.isBuffer(value); -}; -is.buff = is.buf = is.buffer; - -/** - * Test if 'value' is a date. - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a date, false otherwise. - */ -is.date = function(value) { - return '[object Date]' === toString.call(value); -}; - -/** - * Test if 'value' is an error object. - * Alias: err - * @param value value to test. - * @return {Boolean} true if 'value' is an error object, false otherwise. - */ -is.error = function(value) { - return '[object Error]' === toString.call(value); -}; -is.err = is.error; - -/** - * Test if 'value' is false. - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is false, false otherwise - */ -is.false = function(value) { - return value === false; -}; - -/** - * Test if 'value' is a function or async function. - * Alias: func - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a function, false otherwise. - */ -is.function = function(value) { - return is.syncFunction(value) || is.asyncFunction(value) -}; -is.fun = is.func = is.function; - -/** - * Test if 'value' is an async function using `async () => {}` or `async function () {}`. - * Alias: func - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a function, false otherwise. - */ -is.asyncFunction = function(value) { - return '[object AsyncFunction]' === toString.call(value); -} -is.asyncFun = is.asyncFunc = is.asyncFunction; - -/** - * Test if 'value' is a synchronous function. - * Alias: syncFunc - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a function, false otherwise. - */ -is.syncFunction = function (value) { - return '[object Function]' === toString.call(value); -} -is.syncFun = is.syncFunc = is.syncFunction -/** - * Test if 'value' is null. - * @param {Any} value to test. - * @return {Boolean} true if 'value' is null, false otherwise. - */ -is.null = function(value) { - return value === null; -}; - -/** - * Test is 'value' is either null or undefined. - * Alias: nullOrUndef - * @param {Any} value value to test. - * @return {Boolean} True if value is null or undefined, false otherwise. - */ -is.nullOrUndefined = function(value) { - return value === null || typeof value === 'undefined'; -}; -is.nullOrUndef = is.nullOrUndefined; - -/** - * Test if 'value' is a number. - * Alias: num - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a number, false otherwise. - */ -is.number = function(value) { - return '[object Number]' === toString.call(value); -}; -is.num = is.number; - -/** - * Test if 'value' is an object. Note: Arrays, RegExps, Date, Error, etc all return false. - * Alias: obj - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.object = function(value) { - return '[object Object]' === toString.call(value); -}; -is.obj = is.object; - -/** - * Test if 'value' is a regular expression. - * Alias: regexp - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a regexp, false otherwise. - */ -is.regExp = function(value) { - return '[object RegExp]' === toString.call(value); -}; -is.re = is.regexp = is.regExp; - -/** - * Test if 'value' is a string. - * Alias: str - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a string, false otherwise. - */ -is.string = function(value) { - return '[object String]' === toString.call(value); -}; -is.str = is.string; - -/** - * Test if 'value' is true. - * @param {Any} value to test. - * @return {Boolean} true if 'value' is true, false otherwise. - */ -is.true = function(value) { - return value === true; -}; - -/** - * Test if 'value' is a uuid (v1-v5) - * @param {Any} value to test. - * @return {Boolean} true if 'value is a valid RFC4122 UUID. Case non-specific. - */ -var uuidRegExp = new RegExp('[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab]'+ - '[0-9a-f]{3}-[0-9a-f]{12}', 'i'); -is.uuid = function(value) { - return uuidRegExp.test(value); -}; - -//////////////////////////////////////////////////////////////////////////////// -// Object Relationships - -/** - * Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions, - * using recursion. - * Alias: eq - * @param {Any} value value. - * @param {Any} other value to compare with. - * @return {Boolean} true if 'value' is equal to 'other', false otherwise - */ -is.equal = function(value, other) { - var type = toString.call(value); - - if (typeof value !== typeof other) { - return false; - } - - if (type !== toString.call(other)) { - return false; - } - - if ('[object Object]' === type || '[object Array]' === type) { - return deepIs(value, other); - } else if ('[object Function]' === type) { - return value.prototype === other.prototype; - } else if ('[object Date]' === type) { - return value.getTime() === other.getTime(); - } - - return value === other; -}; -is.objEquals = is.eq = is.equal; - -/** - * JS Type definitions which cannot host values. - * @api private - */ -var NON_HOST_TYPES = { - 'boolean': 1, - 'number': 1, - 'string': 1, - 'undefined': 1 -}; - -/** - * Test if 'key' in host is an object. To be hosted means host[value] is an object. - * @param {Any} value The value to test. - * @param {Any} host Host that may contain value. - * @return {Boolean} true if 'value' is hosted by 'host', false otherwise. - */ -is.hosted = function(value, host) { - if (is.nullOrUndef(value)) - return false; - var type = typeof host[value]; - return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type]; -}; - -/** - * Test if 'value' is an instance of 'constructor'. - * Aliases: instOf, instanceof - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an instance of 'constructor'. - */ -is.instanceOf = function(value, constructor) { - if (is.nullOrUndef(value) || is.nullOrUndef(constructor)) - return false; - return (value instanceof constructor); -}; -is.instOf = is.instanceof = is.instanceOf; - -/** - * Test if 'value' is an instance type objType. - * Aliases: objInstOf, objectinstanceof, instOf, instanceOf - * @param {object} objInst an object to testfor type. - * @param {object} objType an object type to compare. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.objectInstanceOf = function(objInst, objType) { - try { - return '[object Object]' === toString.call(objInst) && (objInst instanceof objType); - } catch(err) { - return false; - } -}; -is.instOf = is.instanceOf = is.objInstOf = is.objectInstanceOf; - -/** - * Test if 'value' is a type of 'type'. - * Alias: a - * @param value value to test. - * @param {String} type The name of the type. - * @return {Boolean} true if 'value' is an arguments object, false otherwise. - */ -is.type = function(value, type) { - return typeof value === type; -}; -is.a = is.type; - -//////////////////////////////////////////////////////////////////////////////// -// Object State - -/** - * Test if 'value' is empty. To be empty means to be an array, object or string with nothing contained. - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is empty, false otherwise. - */ -is.empty = function(value) { - var type = toString.call(value); - - if ('[object Array]' === type || '[object Arguments]' === type) { - return value.length === 0; - } - - if ('[object Object]' === type) { - for (var key in value) if (owns.call(value, key)) return false; - return true; - } - - if ('[object String]' === type) { - return value === ''; - } - - return false; -}; - -/** - * Test if 'value' is an arguments object that is empty. - * Alias: args - * @param {Any} value value to test - * @return {Boolean} true if 'value' is an arguments object with no args, false otherwise - */ -is.emptyArguments = function(value) { - return '[object Arguments]' === toString.call(value) && value.length === 0; -}; -is.noArgs = is.emptyArgs = is.emptyArguments; - -/** - * Test if 'value' is an array containing no entries. - * Aliases: emptyArry, emptyAry - * @param {Any} value The value to test. - * @return {Boolean} true if 'value' is an array with no elemnets. - */ -is.emptyArray = function(value) { - return '[object Array]' === toString.call(value) && value.length === 0; -}; -is.emptyArry = is.emptyAry = is.emptyArray; - -/** - * Test if 'value' is an empty array(like) object. - * Aliases: arguents.empty, args.empty, ary.empty, arry.empty - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an empty array(like), false otherwise. - */ -is.emptyArrayLike = function(value) { - return value.length === 0; -}; -is.emptyArrLike = is.emptyArrayLike; - -/** - * Test if 'value' is an empty string. - * Alias: emptyStr - * @param {Any} value to test. - * @return {Boolean} true if 'value' is am empty string, false otherwise. - */ -is.emptyString = function(value) { - return is.string(value) && value.length === 0; -}; -is.emptyStr = is.emptyString; - -/** - * Test if 'value' is an array containing at least 1 entry. - * Aliases: nonEmptyArry, nonEmptyAry - * @param {Any} value The value to test. - * @return {Boolean} true if 'value' is an array with at least 1 value, false otherwise. - */ -is.nonEmptyArray = function(value) { - return '[object Array]' === toString.call(value) && value.length > 0; -}; -is.nonEmptyArr = is.nonEmptyArry = is.nonEmptyAry = is.nonEmptyArray; - -/** - * Test if 'value' is an object with properties. Note: Arrays are objects. - * Alias: nonEmptyObj - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.nonEmptyObject = function(value) { - return '[object Object]' === toString.call(value) && Object.keys(value).length > 0; -}; -is.nonEmptyObj = is.nonEmptyObject; - -/** - * Test if 'value' is an object with no properties. Note: Arrays are objects. - * Alias: nonEmptyObj - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.emptyObject = function(value) { - return '[object Object]' === toString.call(value) && Object.keys(value).length === 0; -}; -is.emptyObj = is.emptyObject; - -/** - * Test if 'value' is a non-empty string. - * Alias: nonEmptyStr - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a non-empty string, false otherwise. - */ -is.nonEmptyString = function(value) { - return is.string(value) && value.length > 0; -}; -is.nonEmptyStr = is.nonEmptyString; - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Types within Number - -/** - * Test if 'value' is an even number. - * @param {Number} value to test. - * @return {Boolean} true if 'value' is an even number, false otherwise. - */ -is.even = function(value) { - return '[object Number]' === toString.call(value) && value % 2 === 0; -}; - -/** - * Test if 'value' is a decimal number. - * Aliases: decimalNumber, decNum - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a decimal number, false otherwise. - */ -is.decimal = function(value) { - return '[object Number]' === toString.call(value) && value % 1 !== 0; -}; -is.dec = is.decNum = is.decimal; - -/** - * Test if 'value' is an integer. - * Alias: integer - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an integer, false otherwise. - */ -is.integer = function(value) { - return '[object Number]' === toString.call(value) && value % 1 === 0; -}; -is.int = is.integer; - -/** - * is.nan - * Test if `value` is not a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is not a number, false otherwise - * @api public - */ -is.notANumber = function(value) { - return !is.num(value) || value !== value; -}; -is.nan = is.notANum = is.notANumber; - -/** - * Test if 'value' is an odd number. - * @param {Number} value to test. - * @return {Boolean} true if 'value' is an odd number, false otherwise. - */ -is.odd = function(value) { - return !is.decimal(value) && '[object Number]' === toString.call(value) && value % 2 !== 0; -}; -is.oddNumber = is.oddNum = is.odd; - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Type & State - -/** - * Test if 'value' is a positive number. - * Alias: positiveNum, posNum - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a number, false otherwise. - */ -is.positiveNumber = function(value) { - return '[object Number]' === toString.call(value) && value > 0; -}; -is.pos = is.positive = is.posNum = is.positiveNum = is.positiveNumber; - -/** - * Test if 'value' is a negative number. - * Aliases: negNum, negativeNum - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a number, false otherwise. - */ -is.negativeNumber = function(value) { - return '[object Number]' === toString.call(value) && value < 0; -}; -is.neg = is.negNum = is.negativeNum = is.negativeNumber; - -/** - * Test if 'value' is a negative integer. - * Aliases: negInt, negativeInteger - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a negative integer, false otherwise. - */ -is.negativeInteger = function(value) { - return '[object Number]' === toString.call(value) && value % 1 === 0 && value < 0; -}; -is.negativeInt = is.negInt = is.negativeInteger; - -/** - * Test if 'value' is a positive integer. - * Alias: posInt - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a positive integer, false otherwise. - */ -is.positiveInteger = function(value) { - return '[object Number]' === toString.call(value) && value % 1 === 0 && value > 0; -}; -is.posInt = is.positiveInt = is.positiveInteger; - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Relationships - -/** - * Test if 'value' is divisible by 'n'. - * Alias: divisBy - * @param {Number} value value to test. - * @param {Number} n dividend. - * @return {Boolean} true if 'value' is divisible by 'n', false otherwise. - */ -is.divisibleBy = function(value, n) { - if (value === 0) - return false; - return '[object Number]' === toString.call(value) && - n !== 0 && - value % n === 0; -}; -is.divBy = is.divisBy = is.divisibleBy; - -/** - * Test if 'value' is greater than or equal to 'other'. - * Aliases: greaterOrEq, greaterOrEqual - * @param {Number} value value to test. - * @param {Number} other value to compare with. - * @return {Boolean} true, if value is greater than or equal to other, false otherwise. - */ -is.greaterOrEqualTo = function(value, other) { - return value >= other; -}; -is.greaterOrEqual = is.ge = is.greaterOrEqualTo; - -/** - * Test if 'value' is greater than 'other'. - * Aliases: greaterThan - * @param {Number} value value to test. - * @param {Number} other value to compare with. - * @return {Boolean} true, if value is greater than other, false otherwise. - */ -is.greaterThan = function(value, other) { - return value > other; -}; -is.gt = is.greaterThan; - -/** - * Test if 'value' is less than or equal to 'other'. - * Alias: lessThanOrEq, lessThanOrEqual - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} true, if 'value' is less than or equal to 'other', false otherwise. - */ -is.lessThanOrEqualTo = function(value, other) { - return value <= other; -}; -is.lessThanOrEq = is.lessThanOrEqual = is.le = is.lessThanOrEqualTo; - -/** - * Test if 'value' is less than 'other'. - * Alias: lessThan - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} true, if 'value' is less than 'other', false otherwise. - */ -is.lessThan = function(value, other) { - return value < other; -}; -is.lt = is.lessThan; - -/** - * Test if 'value' is greater than 'others' values. - * Alias: max - * @param {Number} value value to test. - * @param {Array} others values to compare with. - * @return {Boolean} true if 'value' is greater than 'others' values. - */ -is.maximum = function(value, others) { - if (!is.arrayLike(others) || !is.number(value)) - return false; - - var len = others.length; - while (--len > -1) { - if (value < others[len]) { - return false; - } - } - - return true; -}; -is.max = is.maximum; - -/** - * Test if 'value' is less than 'others' values. - * Alias: min - * @param {Number} value value to test. - * @param {Array} others values to compare with. - * @return {Boolean} true if 'value' is less than 'others' values. - */ -is.minimum = function(value, others) { - if (!is.arrayLike(others) || !is.number(value)) - return false; - - var len = others.length; - while (--len > -1) { - if (value > others[len]) { - return false; - } - } - - return true; -}; -is.min = is.minimum; - -/** - * Test if 'value' is within 'start' and 'finish'. - * Alias: withIn - * @param {Number} value value to test. - * @param {Number} start lower bound. - * @param {Number} finish upper bound. - * @return {Boolean} true if 'value' is is within 'start' and 'finish', false otherwise. - */ -is.within = function(value, start, finish) { - return value >= start && value <= finish; -}; -is.withIn = is.within; - -/** - * Test if 'value' is within 'precision' decimal places from 'comparitor'. - * Alias: closish, near. - * @param {Number} value value to test - * @param {Number} comparitor value to test 'value' against - * @param {Number} precision number of decimals to compare floating points, defaults to 2 - * @return {Boolean} true if 'value' is within 'precision' decimal places from 'comparitor', false otherwise. - */ -is.prettyClose = function(value, comparitor, precision) { - if (!is.number(value) || !is.number(comparitor)) return false; - if (is.defined(precision) && !is.posInt(precision)) return false; - if (is.undefined(precision)) precision = 2; - - return value.toFixed(precision) === comparitor.toFixed(precision); -}; -is.closish = is.near = is.prettyClose; -//////////////////////////////////////////////////////////////////////////////// -// Networking - -/** - * Test if a value is a valid DNS address. eg www.stdarg.com is true while - * 127.0.0.1 is false. - * @param {Any} value to test if a DNS address. - * @return {Boolean} true if a DNS address, false otherwise. - * DNS Address is made up of labels separated by '.' - * Each label must be between 1 and 63 characters long - * The entire hostname (including the delimiting dots) has a maximum of 255 characters. - * Hostname may not contain other characters, such as the underscore character (_) - * other DNS names may contain the underscore. - */ -is.dnsAddress = function(value) { - if (!is.nonEmptyStr(value)) return false; - if (value.length > 255) return false; - if (numbersLabel.test(value)) return false; - if (!dnsLabel.test(value)) return false; - return true; - //var names = value.split('.'); - //if (!is.array(names) || !names.length) return false; - //if (names[0].indexOf('_') > -1) return false; - //for (var i=0; i 15) return false; - var octets = value.split('.'); - if (!is.array(octets) || octets.length !== 4) return false; - for (var i=0; i 255) return false; - } - return true; -}; -is.ipv4 = is.ipv4Addr = is.ipv4Address; - -/** - * Test if a value is either an IPv6 numeric IP address. - * @param {Any} value to test if an ip address. - * @return {Boolean} true if an ip address, false otherwise. - */ -is.ipv6Address = function(value) { - if (!is.nonEmptyStr(value)) return false; - return ipRegEx.v6({extract: true}).test(value); -}; -is.ipv6 = is.ipv6Addr = is.ipv6Address; - -/** - * Test if a value is either an IPv4 or IPv6 numeric IP address. - * @param {Any} value to test if an ip address. - * @return {Boolean} true if an ip address, false otherwise. - */ -is.ipAddress = function(value) { - if (!is.nonEmptyStr(value)) return false; - return is.ipv4Address(value) || is.ipv6Address(value) -}; -is.ip = is.ipAddr = is.ipAddress; - -/** - * Test is a value is a valid ipv4, ipv6 or DNS name. - * Aliases: host, hostAddr, hostAddress. - * @param {Any} value to test if a host address. - * @return {Boolean} true if a host address, false otherwise. - */ -is.hostAddress = function(value) { - if (!is.nonEmptyStr(value)) return false; - return is.dns(value) || is.ipv4(value) || is.ipv6(value); -}; -is.host = is.hostIp = is.hostAddr = is.hostAddress; - -/** - * Test if a number is a valid TCP port - * @param {Any} value to test if its a valid TCP port - */ -is.port = function(value) { - if (!is.num(value) || is.negativeInt(value) || value > 65535) - return false; - return true; -}; - -/** - * Test if a number is a valid TCP port in the range 0-1023. - * Alias: is.sysPort. - * @param {Any} value to test if its a valid TCP port - */ -is.systemPort = function(value) { - if (is.port(value) && value < 1024) - return true; - return false; -}; -is.sysPort = is.systemPort; - -/** - * Test if a number is a valid TCP port in the range 1024-65535. - * @param {Any} value to test if its a valid TCP port - */ -is.userPort = function(value) { - if (is.port(value) && value > 1023) - return true; - return false; -}; - -/* -function sumDigits(num) { - var str = num.toString(); - var sum = 0; - for (var i = 0; i < str.length; i++) - sum += (str[i]-0); - return sum; -} -*/ - -/** - * Test if a string is a credit card. - * From http://en.wikipedia.org/wiki/Luhn_algorithm - * @param {String} value to test if a credit card. - * @return true if the string is the correct format, false otherwise - */ -is.creditCardNumber = function(str) { - if (!is.str(str)) - return false; - - var ary = str.split(''); - var i, cnt; - // From the rightmost digit, which is the check digit, moving left, double - // the value of every second digit; - for (i=ary.length-1, cnt=1; i>-1; i--, cnt++) { - if (cnt%2 === 0) - ary[i] *= 2; - } - - str = ary.join(''); - var sum = 0; - // if the product of the previous doubling operation is greater than 9 - // (e.g., 7 * 2 = 14), then sum the digits of the products (e.g., 10: 1 + 0 - // = 1, 14: 1 + 4 = 5). We do the this by joining the array of numbers and - // add adding the int value of all the characters in the string. - for (i=0; i 19)) - return false; - - var prefix = Math.floor(str.slice(0,2)); - if (prefix !== 62 && prefix !== 88) - return false; - - // no validation for this card - return true; -}; -is.chinaUnion = is.chinaUnionPayCard = is.chinaUnionPayCardNumber; - -/** - * Test if card number is a Diner's Club Carte Blance card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dinersClubCarteBlancheCardNumber = function(str) { - if (!is.str(str) || str.length !== 14) - return false; - - var prefix = Math.floor(str.slice(0,3)); - if (prefix < 300 || prefix > 305) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dinersClubCB = is.dinersClubCarteBlancheCard = - is.dinersClubCarteBlancheCardNumber; - -/** - * Test if card number is a Diner's Club International card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dinersClubInternationalCardNumber = function(str) { - if (!is.str(str) || str.length !== 14) - return false; - var prefix = Math.floor(str.slice(0,3)); - var prefix2 = Math.floor(str.slice(0,2)); - - // 300-305, 309, 36, 38-39 - if ((prefix < 300 || prefix > 305) && prefix !== 309 && prefix2 !== 36 && - (prefix2 < 38 || prefix2 > 39)) { - return false; - } - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dinersClubInt = is.dinersClubInternationalCard = - is.dinersClubInternationalCardNumber; - -/** - * Test if card number is a Diner's Club USA & CA card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dinersClubUSACanadaCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - var prefix = Math.floor(str.slice(0,2)); - - if (prefix !== 54 && prefix !== 55) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dinersClub = is.dinersClubUSACanCard = is.dinersClubUSACanadaCardNumber; - -/** - * Test if card number is a Diner's Club USA/CA card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.discoverCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,6)); - var prefix2 = Math.floor(str.slice(0,3)); - - if (str.slice(0,4) !== '6011' && (prefix < 622126 || prefix > 622925) && - (prefix2 < 644 || prefix2 > 649) && str.slice(0,2) !== '65') { - return false; - } - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.discover = is.discoverCard = is.discoverCardNumber; - -/** - * Test if card number is an InstaPayment card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.instaPaymentCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,3)); - if (prefix < 637 || prefix > 639) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.instaPayment = is.instaPaymentCardNumber; - -/** - * Test if card number is a JCB card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.jcbCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,4)); - if (prefix < 3528 || prefix > 3589) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.jcb = is.jcbCard = is.jcbCardNumber; - -/** - * Test if card number is a Laser card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.laserCardNumber = function(str) { - if (!is.str(str) || (str.length < 16 && str.length > 19)) - return false; - - var prefix = Math.floor(str.slice(0,4)); - var valid = [ 6304, 6706, 6771, 6709 ]; - if (valid.indexOf(prefix) === -1) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.laser = is.laserCard = is.laserCardNumber; - -/** - * Test if card number is a Maestro card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.maestroCardNumber = function(str) { - if (!is.str(str) || str.length < 12 || str.length > 19) - return false; - - var prefix = str.slice(0,4); - var valid = [ '5018', '5020', '5038', '5612', '5893', '6304', '6759', - '6761', '6762', '6763', '0604', '6390' ]; - - if (valid.indexOf(prefix) === -1) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.maestro = is.maestroCard = is.maestroCardNumber; - -/** - * Test if card number is a Dankort card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dankortCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - if (str.slice(0,4) !== '5019') - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dankort = is.dankortCard = is.dankortCardNumber; - -/** - * Test if card number is a MasterCard card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.masterCardCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,2)); - if (prefix < 50 || prefix > 55) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.masterCard = is.masterCardCard = is.masterCardCardNumber; - -/** - * Test if card number is a Visa card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.visaCardNumber = function(str) { - if (!is.str(str) || (str.length !== 13 && str.length !== 16)) - return false; - - if ('4' !== str.slice(0,1)) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; - -is.visa = is.visaCard = is.visaCardNumber; - -/** - * Test if card number is a Visa card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.visaElectronCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,4)); - var valid = [ 4026, 4405, 4508, 4844, 4913, 4917 ]; - if ('417500' !== str.slice(0,6) && valid.indexOf(prefix) === -1) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return false; -}; - -is.visaElectron = is.visaElectronCard = is.visaElectronCardNumber; - -/** - * Test if the input is a valid MongoDB id. - * @param {String|Object} Either a mongodb object id or a string representation. - * @return true if the string is the correct format, false otherwise - * Thanks to Jason Denizac (https://github.com/jden) for pointing this out. - * https://github.com/jden/objectid/blob/master/index.js#L7-L10 - */ -var objIdPattern = /^[0-9a-fA-F]{24}$/; -is.mongoId = is.objectId = is.objId = function(id) { - return (Boolean(id) && !Array.isArray(id) && objIdPattern.test(String(id))); -}; - -/** - * Test is the first argument is structly equal to any of the subsequent args. - * @param Value to test against subsequent arguments. - * @return true if the first value matches any of subsequent values. - */ -is.matching = is.match = is.inArgs = function(val) { - if (arguments.length < 2) - return false; - var result = false; - for (var i=1; i", - "maintainers": "Edmond Meinfelder , Chris Oyler ", - "homepage": "http://github.com/stdarg/is2", - "repository": { - "type": "git", - "url": "git@github.com:stdarg/is2.git" - }, - "bugs": { - "url": "http://github.com/stdarg/is/issues" - }, - "main": "./index.js", - "scripts": { - "test": "./node_modules/.bin/mocha -C --reporter list tests.js" - }, - "engines": { - "node": ">=v0.10.0" - }, - "dependencies": { - "deep-is": "^0.1.3", - "ip-regex": "^4.1.0", - "is-url": "^1.2.4" - }, - "devDependencies": { - "mocha": "6.1.4", - "mongodb": "3.2.4" - } -} diff --git a/node_modules/is2/tests.js b/node_modules/is2/tests.js deleted file mode 100644 index ada2902..0000000 --- a/node_modules/is2/tests.js +++ /dev/null @@ -1,1572 +0,0 @@ -'use strict'; -var assert = require('assert'); -var is = require('./index'); - -// Environment -describe('is.browser()', function() { - it('should return true if window is defined and is an object', function() { - var expected = false; - if (typeof window !== 'undefined' && toString.call(window) === '[object global]') { - expected = true; - } else { - expected = false; - } - assert.ok(expected === is.browser()); - }); -}); - -describe('is.defined()', function() { - it('should return true if value is not undefined', function() { - var val1; - assert.equal(false, is.defined(val1)); - assert.equal(true, is.defined(false)); - assert.equal(false, is.def(val1)); - assert.equal(true, is.def(false)); - }); -}); - -describe('is.nodejs()', function() { - it('should return true if process, process.version & process.versions is defined', function() { - var expected; - if (process && process.hasOwnProperty('version') && - process.hasOwnProperty('versions')) { - expected = true; - } else { - expected = false; - } - assert.ok(expected, is.nodejs()); - assert.ok(expected, is.node()); - }); -}); - -describe('is.undefined', function() { - it('should return true if value is undefined', function() { - assert.equal(true, is.undefined(undefined)); - assert.equal(false, is.undefined(null)); - assert.equal(false, is.undefined(false)); - assert.equal(true, is.undefined()); - assert.equal(true, is.undef(undefined)); - assert.equal(false, is.undef(null)); - assert.equal(false, is.undef(false)); - assert.equal(true, is.undef()); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Types - -describe('is.array', function() { - it('should return true if value is an array', function() { - assert.equal(false, is.array(false)); - assert.equal(true, is.array([1,2,3])); - assert.equal(false, is.array(arguments)); - assert.equal(false, is.array({1: 'a', 2: 'b'})); - assert.equal(false, is.ary({1: 'a', 2: 'b'})); - assert.equal(false, is.arry({1: 'a', 2: 'b'})); - assert.equal(false, is.arr({1: 'a', 2: 'b'})); - }); -}); - -describe('is.arrayLike', function() { - it('should return true if value is an array-like object', function() { - assert.equal(false, is.arrayLike(false)); - assert.equal(false, is.arrayLike(1)); - assert.equal(false, is.arrayLike(new Date())); - assert.equal(false, is.arrayLike(new Error())); - - var f = function(arg1, arg2) { - assert.equal(true, is.arrayLike(arguments)); - }; - f('test1', false); - - assert.equal(true, is.arrayLike(arguments)); - assert.equal(true, is.arrayLike([])); - assert.equal(true, is.arrayLike([1])); - assert.equal(true, is.arrayLike([1,2])); - assert.equal(false, is.arrayLike({})); - assert.equal(false, is.arrayLike({a:1})); - assert.equal(false, is.arrayLike({a:1,b:2})); - assert.equal(false, is.arrLike({a:1,b:2})); - assert.equal(false, is.arryLike({a:1,b:2})); - assert.equal(false, is.aryLike({a:1,b:2})); - assert.equal(false, is.arraylike({a:1,b:2})); - }); -}); - -describe('is.arguments', function() { - it('should return true if value is an arguments object', function() { - assert.equal(true, is.arguments(arguments)); - assert.equal(false, is.arguments(['1', '2', '3', false])); - assert.equal(false, is.args(['1', '2', '3', false])); - }); -}); - -describe('is.boolean', function() { - it('should return true if value is a boolean value', function() { - assert.equal(true, is.boolean(true)); - assert.equal(true, is.boolean(false)); - assert.equal(false, is.boolean({})); - assert.equal(false, is.boolean('bool')); - assert.equal(true, is.bool(true)); - }); -}); - -describe('is.buffer', function() { - it('should return true if value ', function() { - assert.equal(false, is.buffer()); - assert.equal(false, is.buffer(null)); - assert.equal(false, is.buffer('')); - assert.equal(false, is.buffer(8)); - assert.equal(false, is.buffer(new Date())); - assert.equal(false, is.buffer(new Error())); - assert.equal(false, is.buffer(true)); - assert.equal(false, is.buffer(new RegExp('e'))); - assert.equal(true, is.buffer(new Buffer('heya'))); - assert.equal(false, is.buffer('')); - assert.equal(false, is.buffer(String(''))); - assert.equal(true, is.buffer(new Buffer(23))); - assert.equal(true, is.buf(new Buffer(23))); - assert.equal(true, is.buff(new Buffer(23))); - }); -}); - -describe('is.date', function() { - it('should return true if value is a date object', function() { - assert.equal(false, is.date()); - assert.equal(false, is.date(false)); - assert.equal(false, is.date({})); - assert.equal(false, is.date(new Error())); - assert.equal(true, is.date(new Date())); - assert.equal(false, is.date([])); - }); -}); - -describe('is.error', function() { - it('should return true if value is an error object', function() { - assert.equal(false, is.error()); - assert.equal(false, is.error(1)); - assert.equal(false, is.error([])); - assert.equal(false, is.error([1])); - assert.equal(false, is.error([1,2])); - assert.equal(false, is.error({a:1})); - assert.equal(false, is.error({a:1,b:2})); - assert.equal(false, is.error({a:1,b:2,c:3})); - assert.equal(false, is.error(false)); - assert.equal(false, is.error(null)); - assert.equal(false, is.error('error')); - assert.equal(false, is.error(new Date())); - assert.equal(true, is.error(new Error())); - assert.equal(true, is.err(new Error())); - }); -}); - -describe('is.false', function() { - it('should return true if value is false', function() { - assert.equal(false, is.false(1)); - assert.equal(false, is.false(null)); - assert.equal(false, is.false()); - assert.equal(false, is.false('Hello')); - assert.equal(false, is.false([])); - assert.equal(false, is.false({})); - assert.equal(false, is.false(true)); - assert.equal(true, is.false(false)); - assert.equal(true, is.false(1!==1)); - assert.equal(false, is.false(1===1)); - }); -}); - -describe('is.function', function() { - it('should return true if value is a function', function() { - assert.equal(false, is.function()); - assert.equal(false, is.function('a')); - assert.equal(false, is.function(1)); - assert.equal(false, is.function(true)); - assert.equal(false, is.function(null)); - assert.equal(false, is.function(false)); - assert.equal(false, is.function({})); - assert.equal(false, is.function({a:1})); - assert.equal(false, is.function({a:1,b:2})); - assert.equal(false, is.function([])); - assert.equal(false, is.function([1])); - assert.equal(false, is.function([1,2])); - assert.equal(false, is.function(new Error())); - assert.equal(false, is.function(new Date())); - - var f = function() { var a = 1; a++; }; - var fa = () => { let a = 1; a++; }; - var a = async () => Promise.resolve(true); - var af = async function() { await Promise.resolve(true); }; - assert.equal(true, is.function(f)); - assert.equal(true, is.fun(f)); - assert.equal(true, is.func(f)); - assert.equal(true, is.function(fa)); - assert.equal(true, is.fun(fa)); - assert.equal(true, is.func(fa)); - assert.equal(true, is.function(a)); - assert.equal(true, is.fun(a)); - assert.equal(true, is.func(a)); - assert.equal(true, is.function(af)); - assert.equal(true, is.fun(af)); - assert.equal(true, is.func(af)); - }); -}); - -describe('is.syncFunction', function() { - it('should return true if the value is a synchronous function', () => { - var a = async () => Promise.resolve(true); - var af = async function() { await Promise.resolve(true); }; - assert.equal(false, is.syncFunction(a)); - assert.equal(false, is.syncFunction(af)); - assert.equal(false, is.syncFunction()); - assert.equal(false, is.syncFunction('a')); - assert.equal(false, is.syncFunction(1)); - assert.equal(false, is.syncFunction(true)); - assert.equal(false, is.syncFunction(null)); - assert.equal(false, is.syncFunction(false)); - assert.equal(false, is.syncFunction({})); - assert.equal(false, is.syncFunction({a:1})); - assert.equal(false, is.syncFunction({a:1,b:2})); - assert.equal(false, is.syncFunction([])); - assert.equal(false, is.syncFunction([1])); - assert.equal(false, is.syncFunction([1,2])); - assert.equal(false, is.syncFunction(new Error())); - assert.equal(false, is.syncFunction(new Date())); - - var f = function() { var a = 1; a++; }; - var fa = () => { let a = 1; a++; }; - - assert.equal(true, is.syncFunction(f)); - assert.equal(true, is.syncFunc(f)); - assert.equal(true, is.syncFun(f)); - assert.equal(true, is.syncFunction(fa)); - assert.equal(true, is.syncFunc(fa)); - assert.equal(true, is.syncFun(fa)); - - }); -}); -describe('is.asyncFunction', function() { - it('should return true if the value is an asynchronous function', () => { - var f = function() { var a = 1; a++; }; - var fa = () => { let a = 1; a++; }; - assert.equal(false, is.asyncFunction(f)); - assert.equal(false, is.asyncFunction(fa)); - assert.equal(false, is.asyncFunction()); - assert.equal(false, is.asyncFunction('a')); - assert.equal(false, is.asyncFunction(1)); - assert.equal(false, is.asyncFunction(true)); - assert.equal(false, is.asyncFunction(null)); - assert.equal(false, is.asyncFunction(false)); - assert.equal(false, is.asyncFunction({})); - assert.equal(false, is.asyncFunction({a:1})); - assert.equal(false, is.asyncFunction({a:1,b:2})); - assert.equal(false, is.asyncFunction([])); - assert.equal(false, is.asyncFunction([1])); - assert.equal(false, is.asyncFunction([1,2])); - assert.equal(false, is.asyncFunction(new Error())); - assert.equal(false, is.asyncFunction(new Date())); - - var a = async () => Promise.resolve(true); - var af = async function() { await Promise.resolve(true); }; - - - assert.equal(true, is.asyncFunction(a)); - assert.equal(true, is.asyncFunc(a)); - assert.equal(true, is.asyncFun(a)); - assert.equal(true, is.asyncFunction(af)); - assert.equal(true, is.asyncFunc(af)); - assert.equal(true, is.asyncFun(af)); - }); -}); - -describe('is.null', function() { - it('should return true if value is null', function() { - assert.equal(false, is.null(undefined)); - assert.equal(true, is.null(null)); - }); -}); - -describe('is.nullOrUndefined', function() { - it('should return true if the value is either null or undefined', function () { - assert.equal(true, is.nullOrUndefined(null)); - assert.equal(true, is.nullOrUndefined(undefined)); - assert.equal(false, is.nullOrUndefined(true)); - assert.equal(true, is.nullOrUndef(null)); - assert.equal(true, is.nullOrUndef(undefined)); - assert.equal(false, is.nullOrUndef(true)); - }); -}); - -describe('is.number', function() { - it('should return true if value is a number', function() { - assert.equal(false, is.number(false)); - assert.equal(false, is.number({})); - assert.equal(false, is.number([])); - assert.equal(false, is.number(new Error())); - assert.equal(false, is.number(new Date())); - assert.equal(false, is.number('hiya')); - assert.equal(false, is.number(true)); - assert.equal(false, is.number()); - assert.equal(false, is.number(null)); - assert.equal(true, is.number(1)); - assert.equal(true, is.number(0)); - assert.equal(true, is.number(1.0000001)); - assert.equal(true, is.number(-1.0000001)); - assert.equal(true, is.number(-0)); - assert.equal(true, is.number(2/0)); - assert.equal(true, is.number(0/2)); - assert.equal(true, is.num(0/2)); - }); -}); - -describe('is.object', function() { - it('should return true if value is an object', function() { - assert.equal(false, is.object(null)); - assert.equal(false, is.object(3)); - assert.equal(false, is.object(false)); - assert.equal(false, is.object(true)); - assert.equal(false, is.object(0)); - assert.equal(false, is.object('Hello')); - assert.equal(false, is.object([])); - assert.equal(true, is.object({})); - assert.equal(false, is.object(new Error())); - assert.equal(false, is.object(new Date())); - assert.equal(true, is.obj({})); - }); -}); - -describe('is.regExp', function() { - it('should return true if value is a regular expression', function() { - assert.equal(false, is.regExp(null)); - assert.equal(false, is.regExp(false)); - assert.equal(false, is.regExp(778)); - assert.equal(false, is.regExp([])); - assert.equal(false, is.regExp({})); - assert.equal(false, is.regExp('heya')); - assert.equal(true, is.regExp(/is/g)); - assert.equal(true, is.regExp(new RegExp('e'))); - assert.equal(true, is.regexp(new RegExp('e'))); - assert.equal(true, is.re(new RegExp('e'))); - }); -}); - -describe('is.string', function() { - it('should return true if value is a string', function() { - assert.equal(false, is.string(null)); - assert.equal(false, is.string(false)); - assert.equal(false, is.string({})); - assert.equal(false, is.string([])); - assert.equal(false, is.string(9908)); - assert.equal(false, is.string(new RegExp('e'))); - assert.equal(false, is.string(new Date())); - assert.equal(false, is.string(new Error())); - assert.equal(true, is.string('hello')); - assert.equal(true, is.string('')); - assert.equal(true, is.string(String('cow'))); - assert.equal(true, is.str(String('cow'))); - }); -}); - -describe('is.true', function() { - it('should return true if value is true', function() { - assert.equal(false, is.true(1)); - assert.equal(false, is.true(null)); - assert.equal(false, is.true()); - assert.equal(false, is.true('Hello')); - assert.equal(false, is.true([])); - assert.equal(false, is.true({})); - assert.equal(true, is.true(true)); - assert.equal(false, is.true(false)); - assert.equal(false, is.true(1!==1)); - assert.equal(true, is.true(1===1)); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Object Relationships - -describe('is.equal', function() { - it('should return true if value is the same as value1', function() { - assert.equal(true, is.equal(true, true)); - assert.equal(true, is.equal(1, 1)); - assert.equal(true, is.equal('1', '1')); - assert.equal(true, is.equal(['1'], ['1'])); - assert.equal(true, is.equal({a: '1'}, {a: '1'})); - assert.equal(true, is.equal({a: '1', c: {b: true}}, {a: '1', c: {b: true}})); - - assert.equal(false, is.equal(true, false)); - assert.equal(false, is.equal(1, 0)); - assert.equal(false, is.equal('1', '2')); - assert.equal(false, is.equal(['1'], ['0'])); - assert.equal(false, is.equal({a: '1'}, {a: '2'})); - assert.equal(true, is.equal({a: false}, {a: false})); - assert.equal(false, is.equal({a: '1', c: {b: true}}, {a: '1', c: {b: false}})); - assert.equal(true, is.eq({a: false}, {a: false})); - assert.equal(true, is.objEquals({a: false}, {a: false})); - }); -}); - -describe('is.hosted', function() { - it('should return true if value1 is hosted in value2', function() { - assert.equal(false, is.hosted(true, [false, true])); - assert.equal(false, is.hosted(true, [true, true])); - assert.equal(false, is.hosted('a', [false, true, 'a'])); - assert.equal(false, is.hosted('b', [ false, true, 'a'] )); - assert.equal(true, is.hosted(0, [{}, 2, 3])); - assert.equal(true, is.hosted('a', { a: {} } )); - assert.equal(false, is.hosted('b', 'This be a string')); - assert.equal(false, is.hosted('x', 'This be a string')); - assert.equal(true, is.hosted('x', { x: []})); - assert.equal(true, is.hosted('x', { x: {}})); - assert.equal(false, is.hosted('x', { x: true})); - }); -}); - -describe('is.objectInstanceOf', function() { - it('should return true if value is an instance of constructor', function() { - function Circle() { - this.raidius = 3; - this.area = 4; - } - function Polygon() { - this.edges = 8; // octogons are the default - this.regular = false; // sides needn't be all the same - this.area = 1; - } - - function Rectangle(top_len, side_len) { - this.edges = 4; - this.top = top_len; - this.side = side_len; - this.area = top_len*side_len; - } - Rectangle.prototype = new Polygon(); - var box = new Rectangle(8,3); - - assert.equal(true, is.objectInstanceOf(box, Rectangle)); - assert.equal(true, is.objectInstanceOf(box, Polygon)); - assert.equal(false, is.objectInstanceOf(box, Circle)); - assert.equal(false, is.objectInstanceOf(box, undefined)); - assert.equal(true, is.instanceOf(box, Rectangle)); - assert.equal(true, is.instOf(box, Rectangle)); - assert.equal(true, is.objInstOf(box, Rectangle)); - }); -}); - -describe('is.type()', function() { - it('should return true if value is equal to string type', function() { - // is.a is an alias - assert.equal(true, is.a('This is a test', 'string')); - assert.equal(false, is.a('This is also a test', 'number')); - - assert.equal(true, is.type('This is a test', 'string')); - assert.equal(false, is.type('This is also a test', 'number')); - assert.equal(true, is.a('This is a test', 'string')); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Object State - -describe('is.empty', function() { - it('should return true if the value is a string, array or object and contains nothing', function() { - assert.equal(true, is.empty('')); - assert.equal(true, is.empty({})); - assert.equal(true, is.empty([])); - assert.equal(false, is.empty('a')); - assert.equal(false, is.empty({a: true})); - assert.equal(false, is.empty(['a'])); - assert.equal(false, is.empty(false)); - assert.equal(false, is.empty(0)); - assert.equal(false, is.empty(function() {})); - }); -}); - -describe('is.emptyArray', function() { - it('should return true if value is a non-empty array', function() { - assert.equal(true, is.emptyArray([])); - assert.equal(false, is.emptyArray({})); - assert.equal(false, is.emptyArray({a:1})); - assert.equal(false, is.emptyArray([1])); - assert.equal(false, is.emptyArray([1,2])); - assert.equal(false, is.emptyArray([1,2,3])); - }); -}); - -describe('is.emptyArrayLike', function() { - it('should return true if array-like has length == 0', function() { - assert.equal(true, is.emptyArrayLike([])); - assert.equal(true, is.emptyArrayLike('')); - assert.equal(true, is.emptyArrLike('')); - assert.equal(false, is.emptyArrayLike([1])); - assert.equal(false, is.emptyArrayLike('a')); - }); -}); - -describe('is.emptyString', function() { - it('should return true if string has length == 0', function() { - assert.equal(true, is.emptyString('')); - assert.equal(true, is.emptyStr('')); - assert.equal(false, is.emptyStr()); - assert.equal(false, is.emptyStr(false)); - assert.equal(false, is.emptyStr([])); - }); -}); - -describe('is.nonEmptyArray', function() { - it('should return true if value is a non-empty array', function() { - assert.equal(false, is.nonEmptyArray([])); - assert.equal(false, is.nonEmptyArray({})); - assert.equal(false, is.nonEmptyArray({a:1})); - assert.equal(true, is.nonEmptyArray([1])); - assert.equal(true, is.nonEmptyArray([1,2])); - assert.equal(true, is.nonEmptyArray([1,2,3])); - assert.equal(true, is.nonEmptyArry([1,2,3])); - assert.equal(true, is.nonEmptyArr([1,2,3])); - assert.equal(true, is.nonEmptyAry([1,2,3])); - }); -}); - -describe('is.nonEmptyObject', function() { - it('should return true if value is an object with at least 1 property', function() { - assert.equal(false, is.nonEmptyObject()); - assert.equal(false, is.nonEmptyObject(null)); - assert.equal(false, is.nonEmptyObject(7)); - assert.equal(false, is.nonEmptyObject(false)); - assert.equal(false, is.nonEmptyObject('Hello')); - assert.equal(false, is.nonEmptyObject(new Error())); - assert.equal(false, is.nonEmptyObject(new Date())); - assert.equal(false, is.nonEmptyObject({})); - assert.equal(true, is.nonEmptyObject({a:1})); - assert.equal(true, is.nonEmptyObj({a:1})); - }); -}); - -describe('is.nonEmptyString', function() { - it('should return true if value ', function() { - assert.equal(false, is.nonEmptyStr()); - assert.equal(false, is.nonEmptyStr(null)); - assert.equal(false, is.nonEmptyStr(false)); - assert.equal(false, is.nonEmptyStr(8)); - assert.equal(false, is.nonEmptyStr(new Date())); - assert.equal(false, is.nonEmptyStr(new Error())); - assert.equal(false, is.nonEmptyStr(true)); - assert.equal(false, is.nonEmptyStr(new RegExp('e'))); - assert.equal(true, is.nonEmptyStr('heya')); - assert.equal(false, is.nonEmptyStr('')); - assert.equal(false, is.nonEmptyStr(String(''))); - assert.equal(true, is.nonEmptyStr(String('a'))); - assert.equal(true, is.nonEmptyString('a')); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Types within Number - -describe('is.even', function() { - it('should return true if value is an even integer', function() { - assert.equal(false, is.even(null)); - assert.equal(false, is.even()); - assert.equal(false, is.even(new Date())); - assert.equal(false, is.even('hello')); - assert.equal(false, is.even(new Error())); - assert.equal(false, is.even({})); - assert.equal(false, is.even([])); - assert.equal(false, is.even(23.000001)); - assert.equal(false, is.even(-2.000001)); - assert.equal(false, is.even(1)); - assert.equal(false, is.even(3)); - assert.equal(true, is.even(4)); - assert.equal(true, is.even(2)); - assert.equal(true, is.even(0)); - assert.equal(true, is.even(-2)); - assert.equal(true, is.even(10000)); - }); -}); - -describe('is.decimal', function() { - it('should return true if value is a decimal number (has a fractional value).', function() { - assert.equal(false, is.decimal(null)); - assert.equal(false, is.decimal()); - assert.equal(false, is.decimal(false)); - assert.equal(false, is.decimal(true)); - assert.equal(false, is.decimal(1)); - assert.equal(false, is.decimal(-1)); - assert.equal(false, is.decimal(0)); - assert.equal(false, is.decimal(10)); - assert.equal(false, is.decimal(new Date())); - assert.equal(false, is.decimal(new Error())); - assert.equal(true, is.decimal(1.1)); - assert.equal(true, is.decimal(-1.1)); - assert.equal(true, is.decimal(0.000001)); - assert.equal(true, is.decimal(-0.000001)); - assert.equal(true, is.decimal(20.00002)); - assert.equal(true, is.decimal(-20.00002)); - assert.equal(true, is.decNum(-20.00002)); - assert.equal(true, is.dec(-20.00002)); - }); -}); - -describe('is.integer', function() { - it('should return true if value is an integer', function() { - assert.equal(false, is.integer(null)); - assert.equal(false, is.integer()); - assert.equal(false, is.integer('hello')); - assert.equal(false, is.integer([])); - assert.equal(false, is.integer({})); - assert.equal(false, is.integer(new Error())); - assert.equal(false, is.integer(new Date())); - assert.equal(false, is.integer(false)); - assert.equal(false, is.integer(1.1)); - assert.equal(false, is.integer(0.1)); - assert.equal(false, is.integer(-0.0000001)); - assert.equal(false, is.integer(10000000.1)); - assert.equal(true, is.integer(0)); - assert.equal(true, is.integer(10)); - assert.equal(true, is.integer(-2)); - assert.equal(true, is.integer(-77)); - assert.equal(true, is.int(-77)); - }); -}); - -describe('is.notANumber', function() { - it('should return true if value is not a number', function() { - assert.equal(true, is.nan(null)); - assert.equal(true, is.nan(undefined)); - assert.equal(true, is.nan(true)); - assert.equal(true, is.nan(false)); - assert.equal(false, is.nan(37)); - assert.equal(true, is.nan('37')); - assert.equal(true, is.nan('37.37')); - assert.equal(true, is.nan(' ')); - assert.equal(true, is.nan('')); // false converted to 0 - assert.equal(true, is.nan('blabla')); - assert.equal(true, is.nan(NaN)); - assert.equal(true, is.notANumber(NaN)); - assert.equal(true, is.notANum(NaN)); - }); -}); - -describe('is.odd', function() { - it('should return true if value is an odd integer', function() { - assert.equal(false, is.odd(null)); - assert.equal(false, is.odd()); - assert.equal(false, is.odd(new Date())); - assert.equal(false, is.odd('hello')); - assert.equal(false, is.odd(new Error())); - assert.equal(false, is.odd({})); - assert.equal(false, is.odd([])); - assert.equal(false, is.odd(23.000001)); - assert.equal(false, is.odd(-2.000001)); - assert.equal(false, is.odd(0)); - assert.equal(false, is.odd(2)); - assert.equal(true, is.odd(3)); - assert.equal(true, is.odd(1)); - assert.equal(true, is.odd(-1)); - assert.equal(true, is.odd(-3)); - assert.equal(true, is.odd(10001)); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Type & State - -describe('is.positiveNumber', function() { - it('should return true if value is a positive number', function() { - assert.equal(false, is.positiveNumber()); - assert.equal(false, is.positiveNumber(null)); - assert.equal(false, is.positiveNumber(-1)); - assert.equal(false, is.positiveNumber(0)); - assert.equal(false, is.positiveNumber('hello')); - assert.equal(false, is.positiveNumber('1')); - assert.equal(false, is.positiveNumber(new Date())); - assert.equal(false, is.positiveNumber(new Error())); - assert.equal(false, is.positiveNumber({})); - assert.equal(false, is.positiveNumber(-1.1)); - assert.equal(true, is.positiveNumber(1)); - assert.equal(true, is.positiveNumber(1/2.00001)); - assert.equal(true, is.positiveNumber(0.00001)); - }); -}); - - -describe('is.negativeNumber', function() { - it('should return true if value is a negative number', function() { - assert.equal(false, is.negativeNumber()); - assert.equal(false, is.negativeNumber(null)); - assert.equal(false, is.negativeNumber(0)); - assert.equal(false, is.negativeNumber('hello')); - assert.equal(false, is.negativeNumber('1')); - assert.equal(false, is.negativeNumber(new Date())); - assert.equal(false, is.negativeNumber(new Error())); - assert.equal(false, is.negativeNumber({})); - assert.equal(true, is.negativeNumber(-1.1)); - assert.equal(true, is.negativeNumber(-1)); - assert.equal(true, is.negativeNumber(-1/2.00001)); - assert.equal(true, is.negativeNumber(-0.00001)); - }); -}); - -describe('is.divisibleBy', function() { - it('should return true if value is divisible by n', function() { - assert.equal(false, is.divisibleBy()); - assert.equal(false, is.divisibleBy(1)); - assert.equal(false, is.divisibleBy('Hello', 'there')); - assert.equal(false, is.divisibleBy({}, {})); - assert.equal(false, is.divisibleBy([],[])); - assert.equal(false, is.divisibleBy(null,null)); - assert.equal(false, is.divisibleBy(1, 3)); - assert.equal(false, is.divisibleBy(0, 9)); - assert.equal(false, is.divisibleBy(-1, 3)); - assert.equal(false, is.divisibleBy(1, 2)); - assert.equal(true, is.divisibleBy(10, 2)); - assert.equal(true, is.divisibleBy(-10, -2)); - assert.equal(true, is.divisibleBy(-10, -1)); - assert.equal(true, is.divisibleBy(100, 10)); - }); -}); - -describe('is.positiveInt', function() { - it('should return true if value is a positive integer', function() { - assert.equal(false, is.positiveInteger(null)); - assert.equal(false, is.positiveInteger()); - assert.equal(false, is.positiveInteger('hello')); - assert.equal(false, is.positiveInteger([])); - assert.equal(false, is.positiveInteger({})); - assert.equal(false, is.positiveInteger(new Error())); - assert.equal(false, is.positiveInteger(new Date())); - assert.equal(false, is.positiveInteger(false)); - assert.equal(false, is.positiveInteger(1.1)); - assert.equal(false, is.positiveInteger(0.1)); - assert.equal(false, is.positiveInteger(-0.0000001)); - assert.equal(false, is.positiveInteger(10000000.1)); - assert.equal(false, is.positiveInteger(0)); - assert.equal(true, is.positiveInteger(10)); - assert.equal(false, is.positiveInteger(-2)); - assert.equal(true, is.positiveInteger(1)); - }); -}); - -describe('is.negativeInt', function() { - it('should return true if value is a negative integer', function() { - assert.equal(false, is.negativeInteger(null)); - assert.equal(false, is.negativeInteger()); - assert.equal(false, is.negativeInteger('hello')); - assert.equal(false, is.negativeInteger([])); - assert.equal(false, is.negativeInteger({})); - assert.equal(false, is.negativeInteger(new Error())); - assert.equal(false, is.negativeInteger(new Date())); - assert.equal(false, is.negativeInteger(false)); - assert.equal(false, is.negativeInteger(1.1)); - assert.equal(false, is.negativeInteger(0.1)); - assert.equal(false, is.negativeInteger(-0.0000001)); - assert.equal(false, is.negativeInteger(10000000.1)); - assert.equal(false, is.negativeInteger(0)); - assert.equal(false, is.negativeInteger(10)); - assert.equal(true, is.negativeInteger(-2)); - assert.equal(true, is.negativeInteger(-20000)); - assert.equal(false, is.negativeInteger(1)); - assert.equal(false, is.negativeInteger(10000)); - }); -}); - -describe('is.maximum', function() { - it('should return true if value is the maximum in the others array', function() { - assert.equal(false, is.maximum(null,null)); - assert.equal(false, is.maximum('hello',null)); - assert.equal(false, is.maximum(1,null)); - assert.equal(false, is.maximum(false,true)); - assert.equal(false, is.maximum()); - assert.equal(false, is.maximum(null,[1,2,3,4,5])); - assert.equal(false, is.maximum(true,[1,2,3,4,5])); - assert.equal(false, is.maximum(undefined,[1,2,3,4,5])); - assert.equal(false, is.maximum(new Date(),[1,2,3,4,5])); - assert.equal(false, is.maximum(new Error(),[1,2,3,4,5])); - assert.equal(false, is.maximum(1,[1,2,3,4,5])); - assert.equal(false, is.maximum(2,[1,2,3,4,5])); - assert.equal(false, is.maximum(3,[1,2,3,4,5])); - assert.equal(false, is.maximum(4,[1,2,3,4,5])); - assert.equal(true, is.maximum(5,[1,2,3,4,5])); - }); -}); - -describe('is.minimum', function() { - it('should return true if value is the minimum in the others array', function() { - assert.equal(false, is.minimum(null,null)); - assert.equal(false, is.minimum('hello',null)); - assert.equal(false, is.minimum(1,null)); - assert.equal(false, is.minimum(false,true)); - assert.equal(false, is.minimum()); - assert.equal(false, is.minimum(null,[1,2,3,4,5])); - assert.equal(false, is.minimum(true,[1,2,3,4,5])); - assert.equal(false, is.minimum(undefined,[1,2,3,4,5])); - assert.equal(false, is.minimum(new Date(),[1,2,3,4,5])); - assert.equal(false, is.minimum(new Error(),[1,2,3,4,5])); - assert.equal(true, is.minimum(1,[1,2,3,4,5])); - assert.equal(false, is.minimum(2,[1,2,3,4,5])); - assert.equal(false, is.minimum(3,[1,2,3,4,5])); - assert.equal(false, is.minimum(4,[1,2,3,4,5])); - assert.equal(false, is.minimum(5,[1,2,3,4,5])); - }); -}); - -describe('is.gt', function() { - it('should return true if value is greater than other', function() { - assert.equal(false, is.gt()); - assert.equal(false, is.gt(null,null)); - assert.equal(false, is.gt('6', '7')); - assert.equal(false, is.gt('alhpa', 'beta')); - assert.equal(false, is.gt(6, 7)); - assert.equal(false, is.gt(6, 7)); - }); -}); - -describe('is.ge', function() { - it('should return true if value is greater than or equal to other', function() { - assert.equal(false, is.ge()); - assert.equal(true, is.ge(null,null)); - assert.equal(false, is.ge('6', '7')); - assert.equal(false, is.ge('alhpa', 'beta')); - assert.equal(false, is.ge(6, 7)); - assert.equal(true, is.ge(6, 6)); - assert.equal(true, is.ge(6, 5)); - }); -}); - -describe('is.lt', function() { - it('should return true if value is less than other', function() { - assert.equal(false, is.lt()); - assert.equal(false, is.lt(null,null)); - assert.equal(true, is.lt('6', '7')); - assert.equal(true, is.lt('alhpa', 'beta')); - assert.equal(true, is.lt(6, 7)); - assert.equal(false, is.lt(7, 6)); - }); -}); - -describe('is.le', function() { - it('should return true if value is less than or equal to other', function() { - assert.equal(false, is.le()); - assert.equal(true, is.le(null,null)); - assert.equal(true, is.le('6', '7')); - assert.equal(true, is.le('6', '6')); - assert.equal(true, is.le('alhpa', 'beta')); - assert.equal(true, is.le(6, 7)); - assert.equal(true, is.le(6, 6)); - assert.equal(false, is.le(7, 6)); - }); -}); - -describe('is.within', function() { - it('should return true if value is within start and finish values', function() { - assert.equal(false, is.withIn(null, null)); - assert.equal(true, is.withIn(2, -1, 6)); - assert.equal(false, is.withIn(22, -1, 6)); - assert.equal(false, is.withIn('7', '2', '100')); // '7' is greater than '1' - assert.equal(true, is.withIn(7, 2, 100)); - assert.equal(false, is.withIn('1', '2', '100')); - }); -}); - -describe('is.objectInstanceOf', function() { - it('should return true if value is an instance of type object', function() { - function Circle() { - this.raidius = 3; - this.area = 4; - } - function Polygon() { - this.edges = 8; // octogons are the default - this.regular = false; // sides needn't be all the same - this.area = 1; - } - - function Rectangle(top_len, side_len) { - this.edges = 4; - this.top = top_len; - this.side = side_len; - this.area = top_len*side_len; - } - Rectangle.prototype = new Polygon(); - var box = new Rectangle(8,3); - - assert.equal(true, is.objectInstanceOf(box, Rectangle)); - //assert.equal(true, is.objectInstanceOf(box, Polygon)); - assert.equal(false, is.objectInstanceOf(box, Circle)); - //assert.equal(false, is.objectInstanceOf(box, undefined)); - }); -}); - - -describe('is.emailAddress', function() { - it('should return true for valid email address ', function() { - //http://isemail.info/_system/is_email/test/?all - assert.equal(false, is.email('edmond')); - assert.equal(true, is.email('edmond@stdarg')); - assert.equal(true, is.email('edmond@stdarg.com')); - assert.equal(true, is.email('edmond@127.0.0.1')); - assert.equal(false, is.email('@')); - assert.equal(false, is.email('@stdarg')); - assert.equal(false, is.email('@stdarg.com')); - assert.equal(false, is.email('@stdarg.something')); - assert.equal(true, is.email('e@stdarg.something.something')); - assert.equal(false, is.email('.e@stdarg.something')); - assert.equal(true, is.email('e.m@stdarg.com')); - assert.equal(false, is.email('e..m@stdarg.com')); - assert.equal(true, is.email('!#$%&`*+/=?^`{|}~@stdarg.com')); - //assert.equal(false, is.email('hi@edmond@stdarg.com')); - //assert.equal(false, is.email('hi\\@edmond@stdarg.com')); - //assert.equal(false, is.email('123@stdarg.com')); - assert.equal(true, is.email('edmond@123.com')); - assert.equal(true, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@123.com')); - - //assert.equal(false, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklmn@stdarg.com')); - assert.equal(true, is.email('edmond@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.com')); - //assert.equal(false, is.email('edmond@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm.com')); - assert.equal(true, is.email('edmond@test-stdarg.com')); - //assert.equal(false, is.email('edmond@-stdarg.com')); - assert.equal(true, is.email('edmond@test--stdarg.com')); - assert.equal(false, is.email('edmond@.stdarg.com')); - assert.equal(true, is.email('a@a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v')); - assert.equal(true, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi')); - //assert.equal(false, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij')); - //assert.equal(false, is.email('"edmond"@stdarg.com')); - //assert.equal(false, is.email('""@stdarg.com')); - //assert.equal(false, is.email('"\\e"@stdarg.com')); - - - }); -}); - -describe('is.ipv4Address', function() { - it('should return true for valid ipv4 address ', function() { - assert.equal(false, is.ipv4('edmond')); - assert.equal(false, is.ipv4('192.168.0.2000000000')); - assert.equal(true, is.ipv4('192.168.0.2')); - assert.equal(false, is.ipv4('336.332')); - assert.equal(true, is.ipv4('255.255.255.0')); - assert.equal(true, is.ipv4('255.255.255.255')); - assert.equal(true, is.ipv4('0.0.0.0')); - assert.equal(false, is.ipv4('192.168.a.0')); - }); -}); - -describe('is.ipv6Address', function() { - it('should return true for valid ipv6 address ', function() { - assert.equal(false, is.ipv6('edmond')); - assert.equal(false, is.ipv6('192.168.0.2000000000')); - assert.equal(false, is.ipv6('192.168.0.2')); - assert.equal(false, is.ipv6('336.332')); - assert.equal(false, is.ipv6('')); - assert.equal(false, is.ipv6('---')); - assert.equal(false, is.ipv6('2001:0000:1234: 0000:0000:C1C0:ABCD:0876')); - assert.equal(false, is.ipv6('2001:1:1:1:1:1:255Z255X255Y255')); - assert.equal(false, is.ipv6('2001:0000:1234:0000:00001:C1C0:ABCD:0876')); - assert.equal(false, is.ipv6('2001:0000:1234: 0000:0000:C1C0:ABCD:0876')); - - // FIXME Broken cases. - // assert.equal(false, is.ipv6('2001:0000:1234:0000:0000:C1C0:ABCD:0876 0')); - // assert.equal(false, is.ipv6('02001:0000:1234:0000:0000:C1C0:ABCD:0876')); - - assert.equal(true, is.ipv6('2600:1700:f1b0:92a0:152a:c1b0:f3a3:f9a0')); - assert.equal(true, is.ipv6('2001:db8:3333:4444:5555:6666:1.2.3.4')); - assert.equal(true, is.ipv6('2001:0000:1234:0000:0000:C1C0:ABCD:0876')); - assert.equal(true, is.ipv6('2001:0:1234::C1C0:ABCD:876')); - assert.equal(true, is.ipv6('3ffe:0b00:0000:0000:0001:0000:0000:000a')); - assert.equal(true, is.ipv6('3ffe:b00::1:0:0:a')); - assert.equal(true, is.ipv6('FF02:0000:0000:0000:0000:0000:0000:0001')); - assert.equal(true, is.ipv6('FF02::1')); - assert.equal(true, is.ipv6('0000:0000:0000:0000:0000:0000:0000:0001')); - assert.equal(true, is.ipv6('0000:0000:0000:0000:0000:0000:0000:0000')); - assert.equal(true, is.ipv6('::')); - assert.equal(true, is.ipv6('::ffff:192.168.1.26')); - assert.equal(true, is.ipv6('2001:0:1234::C1C0:ABCD:876')); - assert.equal(true, is.ipv6('2001:0000:1234:0000:0000:C1C0:ABCD:0876')); - }); -}); - -describe('is.dnsAddress', function() { - it('should return true for valid dns address ', function() { - assert.equal(true, is.dns('stdarg')); - - assert.equal(true, is.dns('stdarg.com')); - assert.equal(true, is.dns('www.stdarg.com')); - assert.equal(false, is.dns('336.332')); - assert.equal(true, is.dns('3stdarg.com')); - assert.equal(false, is.dns('192.168.0.2000000000')); - assert.equal(false, is.dns('192.168.0.2')); - assert.equal(false, is.dns('*hi*.com')); - assert.equal(false, is.dns('-hi-.com')); - assert.equal(false, is.dns('_stdrg-.com')); - assert.equal(true, is.dns('www--stdrg.com')); - assert.equal(false, is.dns(':54:sda54')); - assert.equal(false, is.dns('2001:db8:3333:4444:5555:6666:1.2.3.4')); - assert.equal(false, is.dns('2001:0000:1234: 0000:0000:C1C0:ABCD:0876')); - assert.equal(false, is.dns('2001:1:1:1:1:1:255Z255X255Y255')); - }); -}); - -describe('is.port', function() { - it('should return true for valid port numbers ', function() { - assert.equal(false, is.port(-11)); - assert.equal(false, is.port(-11)); - assert.equal(true, is.port(0)); - assert.equal(true, is.port(1)); - assert.equal(true, is.port(10)); - assert.equal(true, is.port(100)); - assert.equal(true, is.port(65535)); - assert.equal(false, is.port(65536)); - }); - - it('should return false for invalid port numbers ', function() { - assert.equal(false, is.port(-1100)); - assert.equal(false, is.port(-10)); - assert.equal(true, is.port(0)); - assert.equal(true, is.port(10)); - assert.equal(true, is.port(65535)); - assert.equal(false, is.port(65536)); - assert.equal(false, is.port()); - assert.equal(false, is.port(null)); - assert.equal(false, is.port('22')); - assert.equal(false, is.port('heya')); - assert.equal(false, is.port(true)); - assert.equal(false, is.port({a:22})); - assert.equal(false, is.port([])); - assert.equal(false, is.port([1,2,3])); - }); -}); - -describe('is.systemPort', function() { - it('should return true for valid port numbers 0-1023 ', function() { - assert.equal(false, is.systemPort(-1)); - assert.equal(true, is.systemPort(0)); - assert.equal(true, is.systemPort(1)); - assert.equal(true, is.systemPort(1023)); - assert.equal(false, is.systemPort(1024)); - assert.equal(false, is.systemPort(10000)); - }); -}); - -describe('is.userPort', function() { - it('should return true for valid port numbers 1024-65535 ', function() { - assert.equal(false, is.userPort(-1)); - assert.equal(false, is.userPort(0)); - assert.equal(false, is.userPort(1)); - assert.equal(false, is.userPort(1023)); - assert.equal(true, is.userPort(1024)); - assert.equal(true, is.userPort(1025)); - assert.equal(true, is.userPort(65535)); - assert.equal(false, is.userPort(65536)); - }); -}); - -describe('is.creditCard', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.creditCard(-1)); - assert.equal(false, is.creditCard(false)); - assert.equal(false, is.creditCard('3678363')); - assert.equal(false, is.creditCard({})); - assert.equal(true, is.creditCard('4556737586899855')); - assert.equal(true, is.creditCard('4929660015246383')); - assert.equal(true, is.creditCard('5311287563096839')); - assert.equal(true, is.creditCard('6011090018648076')); - assert.equal(true, is.creditCard('3528110531264368')); - assert.equal(true, is.creditCard('5426995946026032')); - assert.equal(true, is.creditCard('6304894372418471')); - assert.equal(true, is.creditCard('4917768861309447')); - assert.equal(true, is.creditCard('6387665553270232')); - assert.equal(true, is.creditCard('5038882537870764')); - assert.equal(true, is.creditCard('343064005618154')); - assert.equal(true, is.creditCard('79927398713')); - }); -}); - -describe('is.amexCard', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.amexCard(-1)); - assert.equal(false, is.amexCard(false)); - assert.equal(false, is.amexCard('3678363')); - assert.equal(false, is.amexCard({})); - assert.equal(false, is.amexCard('4556737586899855')); - assert.equal(false, is.amexCard('4929660015246383')); - assert.equal(false, is.amexCard('5311287563096839')); - assert.equal(false, is.amexCard('6011090018648076')); - assert.equal(false, is.amexCard('3528110531264368')); - assert.equal(false, is.amexCard('5426995946026032')); - assert.equal(false, is.amexCard('6304894372418471')); - assert.equal(false, is.amexCard('4917768861309447')); - assert.equal(false, is.amexCard('6387665553270232')); - assert.equal(false, is.amexCard('5038882537870764')); - assert.equal(false, is.amexCard('79927398713')); - assert.equal(true, is.amexCard('343064005618154')); - assert.equal(true, is.amexCard('342320557154811')); - assert.equal(true, is.amexCard('378282246310005')); - assert.equal(true, is.amexCard('378734493671000')); - }); -}); - -describe('is.dinersClubCarteBlancheCard', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dinersClubCarteBlancheCard(-1)); - assert.equal(false, is.dinersClubCarteBlancheCard(false)); - assert.equal(false, is.dinersClubCarteBlancheCard('3678363')); - assert.equal(false, is.dinersClubCarteBlancheCard({})); - assert.equal(false, is.dinersClubCarteBlancheCard('4556737586899855')); - assert.equal(false, is.dinersClubCarteBlancheCard('4929660015246383')); - assert.equal(false, is.dinersClubCarteBlancheCard('5311287563096839')); - assert.equal(false, is.dinersClubCarteBlancheCard('6011090018648076')); - assert.equal(false, is.dinersClubCarteBlancheCard('3528110531264368')); - assert.equal(false, is.dinersClubCarteBlancheCard('5426995946026032')); - assert.equal(false, is.dinersClubCarteBlancheCard('6304894372418471')); - assert.equal(false, is.dinersClubCarteBlancheCard('4917768861309447')); - assert.equal(false, is.dinersClubCarteBlancheCard('6387665553270232')); - assert.equal(false, is.dinersClubCarteBlancheCard('5038882537870764')); - assert.equal(false, is.dinersClubCarteBlancheCard('79927398713')); - assert.equal(false, is.dinersClubCarteBlancheCard('343064005618154')); - assert.equal(true, is.dinersClubCarteBlancheCard('30538524124412')); - assert.equal(true, is.dinersClubCarteBlancheCard('30106026933654')); - assert.equal(true, is.dinersClubCarteBlancheCard('30449619157293')); - }); -}); - -describe('is.dinersClubInternationalCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dinersClubInternationalCardNumber(-1)); - assert.equal(false, is.dinersClubInternationalCardNumber(false)); - assert.equal(false, is.dinersClubInternationalCardNumber('3678363')); - assert.equal(false, is.dinersClubInternationalCardNumber({})); - assert.equal(false, is.dinersClubInternationalCardNumber('4556737586899855')); - assert.equal(false, is.dinersClubInternationalCardNumber('4929660015246383')); - assert.equal(false, is.dinersClubInternationalCardNumber('5311287563096839')); - assert.equal(false, is.dinersClubInternationalCardNumber('6011090018648076')); - assert.equal(false, is.dinersClubInternationalCardNumber('3528110531264368')); - assert.equal(false, is.dinersClubInternationalCardNumber('5426995946026032')); - assert.equal(false, is.dinersClubInternationalCardNumber('6304894372418471')); - assert.equal(false, is.dinersClubInternationalCardNumber('4917768861309447')); - assert.equal(false, is.dinersClubInternationalCardNumber('6387665553270232')); - assert.equal(false, is.dinersClubInternationalCardNumber('5038882537870764')); - assert.equal(false, is.dinersClubInternationalCardNumber('79927398713')); - assert.equal(false, is.dinersClubInternationalCardNumber('343064005618154')); - assert.equal(true, is.dinersClubInternationalCardNumber('36613787276938')); - assert.equal(true, is.dinersClubInternationalCardNumber('36511672170689')); - assert.equal(true, is.dinersClubInternationalCardNumber('36725805797974')); - }); -}); - -describe('is.dinersClubUSACanadaCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dinersClubUSACanadaCardNumber(-1)); - assert.equal(false, is.dinersClubUSACanadaCardNumber(false)); - assert.equal(false, is.dinersClubUSACanadaCardNumber('3678363')); - assert.equal(false, is.dinersClubUSACanadaCardNumber({})); - assert.equal(false, is.dinersClubUSACanadaCardNumber('4556737586899855')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('4929660015246383')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('5311287563096839')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('6011090018648076')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('3528110531264368')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('6304894372418471')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('4917768861309447')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('6387665553270232')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('5038882537870764')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('79927398713')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('343064005618154')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5426995946026032')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5431142191824349')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5543473646866162')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5516577322816656')); - }); -}); - -describe('is.discoverCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.discoverCardNumber(-1)); - assert.equal(false, is.discoverCardNumber(false)); - assert.equal(false, is.discoverCardNumber('3678363')); - assert.equal(false, is.discoverCardNumber({})); - assert.equal(false, is.discoverCardNumber('4556737586899855')); - assert.equal(false, is.discoverCardNumber('4929660015246383')); - assert.equal(false, is.discoverCardNumber('5311287563096839')); - assert.equal(false, is.discoverCardNumber('3528110531264368')); - assert.equal(false, is.discoverCardNumber('6304894372418471')); - assert.equal(false, is.discoverCardNumber('4917768861309447')); - assert.equal(false, is.discoverCardNumber('6387665553270232')); - assert.equal(false, is.discoverCardNumber('5038882537870764')); - assert.equal(false, is.discoverCardNumber('79927398713')); - assert.equal(false, is.discoverCardNumber('343064005618154')); - assert.equal(false, is.discoverCardNumber('5426995946026032')); - assert.equal(true, is.discoverCardNumber('6011090018648076')); - assert.equal(true, is.discoverCardNumber('6011182164850760')); - assert.equal(true, is.discoverCardNumber('6011377056444884')); - assert.equal(true, is.discoverCardNumber('6011060206223099')); - }); -}); - -describe('is.instaPaymentCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.instaPaymentCardNumber(-1)); - assert.equal(false, is.instaPaymentCardNumber(false)); - assert.equal(false, is.instaPaymentCardNumber('3678363')); - assert.equal(false, is.instaPaymentCardNumber({})); - assert.equal(false, is.instaPaymentCardNumber('4556737586899855')); - assert.equal(false, is.instaPaymentCardNumber('4929660015246383')); - assert.equal(false, is.instaPaymentCardNumber('5311287563096839')); - assert.equal(false, is.instaPaymentCardNumber('3528110531264368')); - assert.equal(false, is.instaPaymentCardNumber('6304894372418471')); - assert.equal(false, is.instaPaymentCardNumber('4917768861309447')); - assert.equal(false, is.instaPaymentCardNumber('5038882537870764')); - assert.equal(false, is.instaPaymentCardNumber('79927398713')); - assert.equal(false, is.instaPaymentCardNumber('343064005618154')); - assert.equal(false, is.instaPaymentCardNumber('5426995946026032')); - assert.equal(false, is.instaPaymentCardNumber('6011090018648076')); - assert.equal(true, is.instaPaymentCardNumber('6387665553270232')); - assert.equal(true, is.instaPaymentCardNumber('6387266246078411')); - assert.equal(true, is.instaPaymentCardNumber('6375295695268144')); - assert.equal(true, is.instaPaymentCardNumber('6390280410058799')); - }); -}); - -describe('is.instaPaymentCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.instaPaymentCardNumber(-1)); - assert.equal(false, is.instaPaymentCardNumber(false)); - assert.equal(false, is.instaPaymentCardNumber('3678363')); - assert.equal(false, is.instaPaymentCardNumber({})); - assert.equal(false, is.instaPaymentCardNumber('4556737586899855')); - assert.equal(false, is.instaPaymentCardNumber('4929660015246383')); - assert.equal(false, is.instaPaymentCardNumber('5311287563096839')); - assert.equal(false, is.instaPaymentCardNumber('3528110531264368')); - assert.equal(false, is.instaPaymentCardNumber('6304894372418471')); - assert.equal(false, is.instaPaymentCardNumber('4917768861309447')); - assert.equal(false, is.instaPaymentCardNumber('5038882537870764')); - assert.equal(false, is.instaPaymentCardNumber('79927398713')); - assert.equal(false, is.instaPaymentCardNumber('343064005618154')); - assert.equal(false, is.instaPaymentCardNumber('5426995946026032')); - assert.equal(false, is.instaPaymentCardNumber('6011090018648076')); - assert.equal(true, is.instaPaymentCardNumber('6387665553270232')); - assert.equal(true, is.instaPaymentCardNumber('6387266246078411')); - assert.equal(true, is.instaPaymentCardNumber('6375295695268144')); - assert.equal(true, is.instaPaymentCardNumber('6390280410058799')); - }); -}); - -describe('is.jcbCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.jcbCardNumber(-1)); - assert.equal(false, is.jcbCardNumber(false)); - assert.equal(false, is.jcbCardNumber('3678363')); - assert.equal(false, is.jcbCardNumber({})); - assert.equal(false, is.jcbCardNumber('4556737586899855')); - assert.equal(false, is.jcbCardNumber('4929660015246383')); - assert.equal(false, is.jcbCardNumber('5311287563096839')); - assert.equal(false, is.jcbCardNumber('4917768861309447')); - assert.equal(false, is.jcbCardNumber('5038882537870764')); - assert.equal(false, is.jcbCardNumber('79927398713')); - assert.equal(false, is.jcbCardNumber('343064005618154')); - assert.equal(false, is.jcbCardNumber('5426995946026032')); - assert.equal(false, is.jcbCardNumber('6011090018648076')); - assert.equal(false, is.jcbCardNumber('6387665553270232')); - assert.equal(false, is.jcbCardNumber('6304894372418471')); - assert.equal(true, is.jcbCardNumber('3528110531264368')); - assert.equal(true, is.jcbCardNumber('3530111333300000')); - assert.equal(true, is.jcbCardNumber('3566002020360505')); - }); -}); - -describe('is.laserCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.laserCardNumber(-1)); - assert.equal(false, is.laserCardNumber(false)); - assert.equal(false, is.laserCardNumber('3678363')); - assert.equal(false, is.laserCardNumber({})); - assert.equal(false, is.laserCardNumber('4556737586899855')); - assert.equal(false, is.laserCardNumber('4929660015246383')); - assert.equal(false, is.laserCardNumber('5311287563096839')); - assert.equal(false, is.laserCardNumber('4917768861309447')); - assert.equal(false, is.laserCardNumber('5038882537870764')); - assert.equal(false, is.laserCardNumber('79927398713')); - assert.equal(false, is.laserCardNumber('343064005618154')); - assert.equal(false, is.laserCardNumber('5426995946026032')); - assert.equal(false, is.laserCardNumber('6011090018648076')); - assert.equal(false, is.laserCardNumber('6387665553270232')); - assert.equal(false, is.laserCardNumber('3528110531264368')); - assert.equal(true, is.laserCardNumber('6304894372418471')); - assert.equal(true, is.laserCardNumber('6706142507937195')); - assert.equal(true, is.laserCardNumber('6771157847381508')); - assert.equal(true, is.laserCardNumber('6706622469321660')); - }); -}); - -describe('is.dankortCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dankortCardNumber(-1)); - assert.equal(false, is.dankortCardNumber(false)); - assert.equal(false, is.dankortCardNumber('3678363')); - assert.equal(false, is.dankortCardNumber({})); - assert.equal(false, is.dankortCardNumber('4556737586899855')); - assert.equal(false, is.dankortCardNumber('4929660015246383')); - assert.equal(false, is.dankortCardNumber('5311287563096839')); - assert.equal(false, is.dankortCardNumber('4917768861309447')); - assert.equal(false, is.dankortCardNumber('5038882537870764')); - assert.equal(false, is.dankortCardNumber('79927398713')); - assert.equal(false, is.dankortCardNumber('343064005618154')); - assert.equal(false, is.dankortCardNumber('5426995946026032')); - assert.equal(false, is.dankortCardNumber('6011090018648076')); - assert.equal(false, is.dankortCardNumber('6387665553270232')); - assert.equal(false, is.dankortCardNumber('3528110531264368')); - assert.equal(false, is.dankortCardNumber('6304894372418471')); - assert.equal(true, is.dankortCardNumber('5019717010103742')); - }); -}); - -describe('is.visaCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.visaCardNumber(-1)); - assert.equal(false, is.visaCardNumber(false)); - assert.equal(false, is.visaCardNumber('3678363')); - assert.equal(false, is.visaCardNumber({})); - assert.equal(false, is.visaCardNumber('79927398713')); - assert.equal(false, is.visaCardNumber('343064005618154')); - assert.equal(false, is.visaCardNumber('6011090018648076')); - assert.equal(false, is.visaCardNumber('6387665553270232')); - assert.equal(false, is.visaCardNumber('3528110531264368')); - assert.equal(false, is.visaCardNumber('6304894372418471')); - assert.equal(false, is.visaCardNumber('5426995946026032')); - assert.equal(false, is.visaCardNumber('5311287563096839')); - assert.equal(true, is.visaCardNumber('4556737586899855')); - assert.equal(true, is.visaCardNumber('4929660015246383')); - assert.equal(true, is.visaCardNumber('4929834838354035')); - assert.equal(true, is.visaCardNumber('4929834838354035')); - }); -}); - -/* -describe('is.visaElectronCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.visaElectronCardNumber(-1)); - assert.equal(false, is.visaElectronCardNumber(false)); - assert.equal(false, is.visaElectronCardNumber('3678363')); - assert.equal(false, is.visaElectronCardNumber({})); - assert.equal(false, is.visaElectronCardNumber('79927398713')); - assert.equal(false, is.visaElectronCardNumber('343064005618154')); - assert.equal(false, is.visaElectronCardNumber('6011090018648076')); - assert.equal(false, is.visaElectronCardNumber('6387665553270232')); - assert.equal(false, is.visaElectronCardNumber('3528110531264368')); - assert.equal(false, is.visaElectronCardNumber('6304894372418471')); - assert.equal(false, is.visaElectronCardNumber('5426995946026032')); - assert.equal(false, is.visaElectronCardNumber('5311287563096839')); - assert.equal(false, is.visaElectronCardNumber('4556737586899855')); - assert.equal(false, is.visaElectronCardNumber('4929660015246383')); - assert.equal(true, is.visaElectronCardNumber('4917768861309447')); - assert.equal(true, is.visaElectronCardNumber('4026691823166028')); - assert.equal(true, is.visaElectronCardNumber('4175007561308913')); - assert.equal(true, is.visaElectronCardNumber('4508840471561769')); - }); -}); -*/ - -describe('is.uuid', function() { - it('should return true for valid uuids ', function() { - assert.equal(false, is.uuid()); - assert.equal(false, is.uuid(null)); - assert.equal(false, is.uuid(-1)); - assert.equal(false, is.uuid(-1)); - assert.equal(false, is.uuid(false)); - assert.equal(false, is.uuid('3678363')); - assert.equal(false, is.uuid({})); - assert.equal(false, is.uuid([])); - assert.equal(false, is.uuid('uuid')); - assert.equal(false, is.uuid(6011090018648076)); - // v4 uuids - assert.equal(true, is.uuid('bbb1e6cf-fb9c-4946-8e64-88ac25393845')); - assert.equal(true, is.uuid('4b301b45-3473-4c31-8b0d-9aea4f46de91')); - assert.equal(true, is.uuid('f7f03879-c31b-4c28-af7d-40584f55e8a6')); - assert.equal(true, is.uuid('7e3c9d08-6fdb-415b-a33c-0c0c057491df')); - // v1 uuids - assert.equal(true, is.uuid('49b782c0-7690-11e5-8bcf-feff819cdc9f')); - assert.equal(true, is.uuid('71d3cb56-7690-11e5-8bcf-feff819cdc9f')); - assert.equal(true, is.uuid('7e1978f2-7690-11e5-8bcf-feff819cdc9f')); - assert.equal(true, is.uuid('83e32954-7690-11e5-8bcf-feff819cdc9f')); - }); -}); - -describe('is.hostAddress', function() { - it('should return true for valid uuids ', function() { - assert.equal(false, is.hostAddress()); - assert.equal(false, is.hostAddress(null)); - assert.equal(false, is.hostAddress(-1)); - assert.equal(false, is.hostAddress(-1)); - assert.equal(false, is.hostAddress(false)); - assert.equal(false, is.hostAddress('3678363')); - assert.equal(false, is.hostAddress({})); - assert.equal(false, is.hostAddress([])); - assert.equal(false, is.hostAddress(6011090018648076)); - assert.equal(false, is.hostAddress('1000000.10.1.1')); - - /* - assert.equal(true, is.hostAddress('192.168.1.1')); - assert.equal(true, is.hostAddress('10.10.1.1')); - assert.equal(true, is.hostAddress('www.google.com')); - assert.equal(true, is.hostAddress('finance.yahoo.com')); - assert.equal(true, is.hostAddress('google.com')); - assert.equal(true, is.hostAddress('google')); - assert.equal(true, is.hostAddress('close5-dev.5fxjas.0001.usw1.cache.amazonaws.com')); - */ - }); -}); - -describe('is.mongoId', function() { - it('should return true for valid mongo ids ', function() { - assert.equal(false, is.objectId()); - assert.equal(false, is.objectId(111111111111111111111111)); - assert.equal(false, is.objectId(null)); - assert.equal(false, is.objectId(false)); - assert.equal(false, is.objectId({})); - assert.equal(false, is.objectId({})); - - var ObjectID = require('mongodb').ObjectID; - assert.equal(true, is.objectId('507f1f77bcf86cd799439011')); - assert.equal(true, is.objectId('507f191e810c19729de860ea')); - assert.equal(true, is.objectId(new ObjectID())); - }); -}); - -describe('is.matching', function() { - it('should return true if the first arg matches any of the subsequent in '+ - 'strict comparison ', function() { - assert.equal(false, is.match()); - assert.equal(false, is.match(111111111111111111111111)); - assert.equal(false, is.match(null)); - assert.equal(false, is.match(false)); - assert.equal(false, is.match({})); - - assert.equal(false, is.match({}, true)); - assert.equal(true, is.match(111111111111111111111111, 111111111111111111111111)); - assert.equal(true, is.match(null, null)); - assert.equal(true, is.match(false, false)); - - assert.equal(true, is.match(false, true, false)); - - assert.equal(true, is.match('507f191e810c19729de860ea', false, '507f191e810c19729de860ea')); - - var ObjectID = require('mongodb').ObjectID; - var objId = new ObjectID(); - assert.equal(true, is.match(objId, objId)); - }); -}); -describe('is.streetAddress', function(){ - it('should return true for a string containing a street address', function(){ - assert.equal(false, is.streetAddress()); - assert.equal(false, is.streetAddress(null)); - assert.equal(false, is.streetAddress(-1)); - assert.equal(false, is.streetAddress('123')); - assert.equal(false, is.streetAddress(undefined)); - assert.equal(false, is.streetAddress('192.168.0.1')); - assert.equal(false, is.streetAddress('some unrelated string, with nothing in common with any other strings in the room. \n Poor little guy')); - assert.equal(false, is.streetAddress('This string talks about money, and 55 dollars is nothing to scoff at, but shouldn\'t trigger a false positive.')); - assert.equal(false, is.streetAddress('This string doesn\'t use money, but it does use numbers like 23 is a good number, so is 999 or 234,432.')); - - assert.equal(true, is.streetAddress('55 Main Street.')); - assert.equal(true, is.streetAddress('1999 Pullman Ave. Apt. 322')); - assert.equal(true, is.streetAddress('This is a long string with newline characters, \nthis should still capture an address like 123 Sesame Street.')); - assert.equal(true, is.streetAddress('I know I should\'t really have to do this,' + - 'but template strings are an ES6 feature. If you want to submit ideas for this project,' + - 'you should write to 89 Some Place, #33 San Francisco, CA 94130. Or, don\'t, the choice is up to you.')); - }); -}); - -describe('is.zipCode', function(){ - it('should return true for a string or number resembling a US zipcode', function(){ - assert.equal(false, is.zipCode()); - assert.equal(false, is.zipCode(1234)); - assert.equal(false, is.zipCode('555-555-5555')); - assert.equal(false, is.zipCode(123456)); - assert.equal(false, is.zipCode('10293-564372')); - assert.equal(false, is.zipCode({something: 'is wrong here'})); - assert.equal(false, is.zipCode(['something', 'is wrong here'])); - - assert.equal(true, is.zipCode(12345)); - assert.equal(true, is.zipCode('99999')); - assert.equal(true, is.zipCode('12345-6789')); - }); -}); - -describe('is.phoneNumber', function(){ - it('should return true for a string containing a US phone number', function(){ - assert.equal(false, is.phoneNumber()); - assert.equal(false, is.phoneNumber(23897498729387)); - assert.equal(false, is.phoneNumber('something with a 213219 number in it')); - assert.equal(false, is.phoneNumber('something with a 123,456,7890 number in it')); - - assert.equal(true, is.phoneNumber('my number is 123.555.5767')); - assert.equal(true, is.phoneNumber('my number is 1 123-555-5767')); - assert.equal(true, is.phoneNumber('my number is (123) 555-5767')); - assert.equal(true, is.phoneNumber('my number is (123) 555.5767')); - assert.equal(true, is.phoneNumber('my number is 123 555 5767')); - assert.equal(true, is.phoneNumber('my number is 123 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is (123) 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 123-555-5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1.123.555.5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1-123-555-5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555-5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555 \n5767 and here\'s some more text')); - }); -}); - -describe('is.url', function(){ - it('should return true for valid URLs', function(){ - assert.equal(false, is.url()); - assert.equal(false, is.url(23897498729387)); - assert.equal(false, is.url('something with a 213219 number in it')); - assert.equal(false, is.url(null)); - assert.equal(false, is.url(false)); - assert.equal(false, is.url({})); - assert.equal(false, is.url({url:1})); - - assert.equal(true, is.url('http://www.amazon.com')); - assert.equal(true, is.url('http://www.amazon.com/')); - assert.equal(true, is.url('http://www.amazon.com/help')); - assert.equal(true, is.url('http://www.amazon.com/help?page1&num=383833')); - assert.equal(true, is.url('http://amazon.com')); - assert.equal(false, is.url('http://amazon')); - }); -}); - -describe('is.enum', function(){ - it('should return true for if the array contains the value', function(){ - assert.equal(false, is.enum()); - assert.equal(false, is.enum('a')); - assert.equal(false, is.enum('a', 12)); - assert.equal(false, is.enum('a', {a: 'a'})); - assert.equal(false, is.enum('a', true)); - assert.equal(false, is.enum('a', ['b', 'c'])); - assert.equal(false, is.enum('a', ['b', 'c'])); - assert.equal(false, is.enum('a', ['b', 'c', 4, {a: 'a'}])); - - assert.equal(true, is.enum('a', ['a', 'b', 'c'])); - assert.equal(true, is.enum(1, ['a', 'b', 'c', 1])); - assert.equal(true, is.enum(true, ['a', 'b', 'c', true])); - assert.equal(true, is.enum(null, ['a', 'b', 'c', null])); - assert.equal(true, is.enum(false, ['a', 'b', 'c', false])); - assert.equal(true, is.enum([1], ['a', 'b', 'c', [1]])); - assert.equal(true, is.enum({a: 'a'}, ['a', 'b', 'c', {a: 'a'}])); - }); -}); - -describe('is.prettyClose', function(){ - it('should return true for floating point numbers that are close', function(){ - assert.equal(false, is.prettyClose()); - assert.equal(false, is.prettyClose(1, 'a')); - assert.equal(false, is.prettyClose('b', 'c')); - assert.equal(false, is.prettyClose(9, null)); - assert.equal(false, is.prettyClose(1, 3, -9)); - assert.equal(false, is.prettyClose(1.1, 1.16, 1)); - assert.equal(false, is.prettyClose(23.678, 23.98746, 4)); - - assert.equal(true, is.prettyClose(1.1, 1.12, 1)); - assert.equal(true, is.prettyClose(100.4, 100.439999, 1)); - assert.equal(true, is.prettyClose(0.39, 0.414, 1)); - assert.equal(true, is.prettyClose(0.00000009, 0.0000001, 7)); - assert.equal(true, is.prettyClose(1.123, 1.121)); - assert.equal(true, is.prettyClose(1, 1, 1)); - }); -}); diff --git a/node_modules/isexe/.npmignore b/node_modules/isexe/.npmignore deleted file mode 100644 index c1cb757..0000000 --- a/node_modules/isexe/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.nyc_output/ -coverage/ diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/isexe/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md deleted file mode 100644 index 35769e8..0000000 --- a/node_modules/isexe/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# isexe - -Minimal module to check if a file is executable, and a normal file. - -Uses `fs.stat` and tests against the `PATHEXT` environment variable on -Windows. - -## USAGE - -```javascript -var isexe = require('isexe') -isexe('some-file-name', function (err, isExe) { - if (err) { - console.error('probably file does not exist or something', err) - } else if (isExe) { - console.error('this thing can be run') - } else { - console.error('cannot be run') - } -}) - -// same thing but synchronous, throws errors -var isExe = isexe.sync('some-file-name') - -// treat errors as just "not executable" -isexe('maybe-missing-file', { ignoreErrors: true }, callback) -var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) -``` - -## API - -### `isexe(path, [options], [callback])` - -Check if the path is executable. If no callback provided, and a -global `Promise` object is available, then a Promise will be returned. - -Will raise whatever errors may be raised by `fs.stat`, unless -`options.ignoreErrors` is set to true. - -### `isexe.sync(path, [options])` - -Same as `isexe` but returns the value and throws any errors raised. - -### Options - -* `ignoreErrors` Treat all errors as "no, this is not executable", but - don't raise them. -* `uid` Number to use as the user id -* `gid` Number to use as the group id -* `pathExt` List of path extensions to use instead of `PATHEXT` - environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js deleted file mode 100644 index 553fb32..0000000 --- a/node_modules/isexe/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('fs') -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = require('./windows.js') -} else { - core = require('./mode.js') -} - -module.exports = isexe -isexe.sync = sync - -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } - - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } - - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} - -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } - } -} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js deleted file mode 100644 index 1995ea4..0000000 --- a/node_modules/isexe/mode.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = isexe -isexe.sync = sync - -var fs = require('fs') - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() - - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g - - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 - - return ret -} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json deleted file mode 100644 index e452689..0000000 --- a/node_modules/isexe/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "isexe", - "version": "2.0.0", - "description": "Minimal module to check if a file is executable.", - "main": "index.js", - "directories": { - "test": "test" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "rimraf": "^2.5.0", - "tap": "^10.3.0" - }, - "scripts": { - "test": "tap test/*.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/isexe.git" - }, - "keywords": [], - "bugs": { - "url": "https://github.com/isaacs/isexe/issues" - }, - "homepage": "https://github.com/isaacs/isexe#readme" -} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js deleted file mode 100644 index d926df6..0000000 --- a/node_modules/isexe/test/basic.js +++ /dev/null @@ -1,221 +0,0 @@ -var t = require('tap') -var fs = require('fs') -var path = require('path') -var fixture = path.resolve(__dirname, 'fixtures') -var meow = fixture + '/meow.cat' -var mine = fixture + '/mine.cat' -var ours = fixture + '/ours.cat' -var fail = fixture + '/fail.false' -var noent = fixture + '/enoent.exe' -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var isWindows = process.platform === 'win32' -var hasAccess = typeof fs.access === 'function' -var winSkip = isWindows && 'windows' -var accessSkip = !hasAccess && 'no fs.access function' -var hasPromise = typeof Promise === 'function' -var promiseSkip = !hasPromise && 'no global Promise' - -function reset () { - delete require.cache[require.resolve('../')] - return require('../') -} - -t.test('setup fixtures', function (t) { - rimraf.sync(fixture) - mkdirp.sync(fixture) - fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') - fs.chmodSync(meow, parseInt('0755', 8)) - fs.writeFileSync(fail, '#!/usr/bin/env false\n') - fs.chmodSync(fail, parseInt('0644', 8)) - fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') - fs.chmodSync(mine, parseInt('0744', 8)) - fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') - fs.chmodSync(ours, parseInt('0754', 8)) - t.end() -}) - -t.test('promise', { skip: promiseSkip }, function (t) { - var isexe = reset() - t.test('meow async', function (t) { - isexe(meow).then(function (is) { - t.ok(is) - t.end() - }) - }) - t.test('fail async', function (t) { - isexe(fail).then(function (is) { - t.notOk(is) - t.end() - }) - }) - t.test('noent async', function (t) { - isexe(noent).catch(function (er) { - t.ok(er) - t.end() - }) - }) - t.test('noent ignore async', function (t) { - isexe(noent, { ignoreErrors: true }).then(function (is) { - t.notOk(is) - t.end() - }) - }) - t.end() -}) - -t.test('no promise', function (t) { - global.Promise = null - var isexe = reset() - t.throws('try to meow a promise', function () { - isexe(meow) - }) - t.end() -}) - -t.test('access', { skip: accessSkip || winSkip }, function (t) { - runTest(t) -}) - -t.test('mode', { skip: winSkip }, function (t) { - delete fs.access - delete fs.accessSync - var isexe = reset() - t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) - t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) - runTest(t) -}) - -t.test('windows', function (t) { - global.TESTING_WINDOWS = true - var pathExt = '.EXE;.CAT;.CMD;.COM' - t.test('pathExt option', function (t) { - runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) - }) - t.test('pathExt env', function (t) { - process.env.PATHEXT = pathExt - runTest(t) - }) - t.test('no pathExt', function (t) { - // with a pathExt of '', any filename is fine. - // so the "fail" one would still pass. - runTest(t, { pathExt: '', skipFail: true }) - }) - t.test('pathext with empty entry', function (t) { - // with a pathExt of '', any filename is fine. - // so the "fail" one would still pass. - runTest(t, { pathExt: ';' + pathExt, skipFail: true }) - }) - t.end() -}) - -t.test('cleanup', function (t) { - rimraf.sync(fixture) - t.end() -}) - -function runTest (t, options) { - var isexe = reset() - - var optionsIgnore = Object.create(options || {}) - optionsIgnore.ignoreErrors = true - - if (!options || !options.skipFail) { - t.notOk(isexe.sync(fail, options)) - } - t.notOk(isexe.sync(noent, optionsIgnore)) - if (!options) { - t.ok(isexe.sync(meow)) - } else { - t.ok(isexe.sync(meow, options)) - } - - t.ok(isexe.sync(mine, options)) - t.ok(isexe.sync(ours, options)) - t.throws(function () { - isexe.sync(noent, options) - }) - - t.test('meow async', function (t) { - if (!options) { - isexe(meow, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - } else { - isexe(meow, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - } - }) - - t.test('mine async', function (t) { - isexe(mine, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - }) - - t.test('ours async', function (t) { - isexe(ours, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - }) - - if (!options || !options.skipFail) { - t.test('fail async', function (t) { - isexe(fail, options, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - } - - t.test('noent async', function (t) { - isexe(noent, options, function (er, is) { - t.ok(er) - t.notOk(is) - t.end() - }) - }) - - t.test('noent ignore async', function (t) { - isexe(noent, optionsIgnore, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - - t.test('directory is not executable', function (t) { - isexe(__dirname, options, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - - t.end() -} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js deleted file mode 100644 index 3499673..0000000 --- a/node_modules/isexe/windows.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = isexe -isexe.sync = sync - -var fs = require('fs') - -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT - - if (!pathext) { - return true - } - - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} - -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} diff --git a/node_modules/isobject/LICENSE b/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d..0000000 --- a/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/isobject/README.md b/node_modules/isobject/README.md deleted file mode 100644 index d01feaa..0000000 --- a/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/isobject/index.d.ts b/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c2..0000000 --- a/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/isobject/index.js b/node_modules/isobject/index.js deleted file mode 100644 index 2d59958..0000000 --- a/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/isobject/package.json b/node_modules/isobject/package.json deleted file mode 100644 index 62aa8c1..0000000 --- a/node_modules/isobject/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "isobject", - "description": "Returns true if the value is an object and not an array or null.", - "version": "3.0.1", - "homepage": "https://github.com/jonschlinkert/isobject", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "(https://github.com/LeSuisse)", - "Brian Woodward (https://twitter.com/doowb)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Magnús Dæhlen (https://github.com/magnudae)", - "Tom MacWright (https://macwright.org)" - ], - "repository": "jonschlinkert/isobject", - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "license": "MIT", - "files": [ - "index.d.ts", - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "dependencies": {}, - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - } -} diff --git a/node_modules/jest-worker/LICENSE b/node_modules/jest-worker/LICENSE deleted file mode 100644 index b96dcb0..0000000 --- a/node_modules/jest-worker/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/jest-worker/README.md b/node_modules/jest-worker/README.md deleted file mode 100644 index 0727a04..0000000 --- a/node_modules/jest-worker/README.md +++ /dev/null @@ -1,247 +0,0 @@ -# jest-worker - -Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, and bound workers. - -The module works by providing an absolute path of the module to be loaded in all forked processes. Files relative to a node module are also accepted. All methods are exposed on the parent process as promises, so they can be `await`'ed. Child (worker) methods can either be synchronous or asynchronous. - -The module also implements support for bound workers. Binding a worker means that, based on certain parameters, the same task will always be executed by the same worker. The way bound workers work is by using the returned string of the `computeWorkerKey` method. If the string was used before for a task, the call will be queued to the related worker that processed the task earlier; if not, it will be executed by the first available worker, then sticked to the worker that executed it; so the next time it will be processed by the same worker. If you have no preference on the worker executing the task, but you have defined a `computeWorkerKey` method because you want _some_ of the tasks to be sticked, you can return `null` from it. - -The list of exposed methods can be explicitly provided via the `exposedMethods` option. If it is not provided, it will be obtained by requiring the child module into the main process, and analyzed via reflection. Check the "minimal example" section for a valid one. - -## Install - -```sh -$ yarn add jest-worker -``` - -## Example - -This example covers the minimal usage: - -### File `parent.js` - -```javascript -import {Worker as JestWorker} from 'jest-worker'; - -async function main() { - const worker = new JestWorker(require.resolve('./Worker')); - const result = await worker.hello('Alice'); // "Hello, Alice" -} - -main(); -``` - -### File `worker.js` - -```javascript -export function hello(param) { - return 'Hello, ' + param; -} -``` - -## Experimental worker - -Node 10 shipped with [worker-threads](https://nodejs.org/api/worker_threads.html), a "threading API" that uses SharedArrayBuffers to communicate between the main process and its child threads. This experimental Node feature can significantly improve the communication time between parent and child processes in `jest-worker`. - -Since `worker_threads` are considered experimental in Node, you have to opt-in to this behavior by passing `enableWorkerThreads: true` when instantiating the worker. While the feature was unflagged in Node 11.7.0, you'll need to run the Node process with the `--experimental-worker` flag for Node 10. - -## API - -The `Worker` export is a constructor that is initialized by passing the worker path, plus an options object. - -### `workerPath: string` (required) - -Node module name or absolute path of the file to be loaded in the child processes. Use `require.resolve` to transform a relative path into an absolute one. - -### `options: Object` (optional) - -#### `exposedMethods: $ReadOnlyArray` (optional) - -List of method names that can be called on the child processes from the parent process. You cannot expose any method named like a public `Worker` method, or starting with `_`. If you use method auto-discovery, then these methods will not be exposed, even if they exist. - -#### `numWorkers: number` (optional) - -Amount of workers to spawn. Defaults to the number of CPUs minus 1. - -#### `maxRetries: number` (optional) - -Maximum amount of times that a dead child can be re-spawned, per call. Defaults to `3`, pass `Infinity` to allow endless retries. - -#### `forkOptions: Object` (optional) - -Allow customizing all options passed to `childProcess.fork`. By default, some values are set (`cwd`, `env` and `execArgv`), but you can override them and customize the rest. For a list of valid values, check [the Node documentation](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options). - -#### `computeWorkerKey: (method: string, ...args: Array) => ?string` (optional) - -Every time a method exposed via the API is called, `computeWorkerKey` is also called in order to bound the call to a worker. This is useful for workers that are able to cache the result or part of it. You bound calls to a worker by making `computeWorkerKey` return the same identifier for all different calls. If you do not want to bind the call to any worker, return `null`. - -The callback you provide is called with the method name, plus all the rest of the arguments of the call. Thus, you have full control to decide what to return. Check a practical example on bound workers under the "bound worker usage" section. - -By default, no process is bound to any worker. - -#### `setupArgs: Array` (optional) - -The arguments that will be passed to the `setup` method during initialization. - -#### `WorkerPool: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional) - -Provide a custom worker pool to be used for spawning child processes. By default, Jest will use a node thread pool if available and fall back to child process threads. - -#### `enableWorkerThreads: boolean` (optional) - -`jest-worker` will automatically detect if `worker_threads` are available, but will not use them unless passed `enableWorkerThreads: true`. - -### `workerSchedulingPolicy: 'round-robin' | 'in-order'` (optional) - -Specifies the policy how tasks are assigned to workers if multiple workers are _idle_: - -- `round-robin` (default): The task will be sequentially distributed onto the workers. The first task is assigned to the worker 1, the second to the worker 2, to ensure that the work is distributed across workers. -- `in-order`: The task will be assigned to the first free worker starting with worker 1 and only assign the work to worker 2 if the worker 1 is busy. - -Tasks are always assigned to the first free worker as soon as tasks start to queue up. The scheduling policy does not define the task scheduling which is always first-in, first-out. - -### `taskQueue`: TaskQueue` (optional) - -The task queue defines in which order tasks (method calls) are processed by the workers. `jest-worker` ships with a `FifoQueue` and `PriorityQueue`: - -- `FifoQueue` (default): Processes the method calls (tasks) in the call order. -- `PriorityQueue`: Processes the method calls by a computed priority in natural ordering (lower priorities first). Tasks with the same priority are processed in any order (FIFO not guaranteed). The constructor accepts a single argument, the function that is passed the name of the called function and the arguments and returns a numerical value for the priority: `new require('jest-worker').PriorityQueue((method, filename) => filename.length)`. - -## JestWorker - -### Methods - -The returned `JestWorker` instance has all the exposed methods, plus some additional ones to interact with the workers itself: - -#### `getStdout(): Readable` - -Returns a `ReadableStream` where the standard output of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`. - -#### `getStderr(): Readable` - -Returns a `ReadableStream` where the standard error of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`. - -#### `end()` - -Finishes the workers by killing all workers. No further calls can be done to the `Worker` instance. - -Returns a Promise that resolves with `{ forceExited: boolean }` once all workers are dead. If `forceExited` is `true`, at least one of the workers did not exit gracefully, which likely happened because it executed a leaky task that left handles open. This should be avoided, force exiting workers is a last resort to prevent creating lots of orphans. - -**Note:** - -`await`ing the `end()` Promise immediately after the workers are no longer needed before proceeding to do other useful things in your program may not be a good idea. If workers have to be force exited, `jest-worker` may go through multiple stages of force exiting (e.g. SIGTERM, later SIGKILL) and give the worker overall around 1 second time to exit on its own. During this time, your program will wait, even though it may not be necessary that all workers are dead before continuing execution. - -Consider deliberately leaving this Promise floating (unhandled resolution). After your program has done the rest of its work and is about to exit, the Node process will wait for the Promise to resolve after all workers are dead as the last event loop task. That way you parallelized computation time of your program and waiting time and you didn't delay the outputs of your program unnecessarily. - -### Worker IDs - -Each worker has a unique id (index that starts with `1`), which is available inside the worker as `process.env.JEST_WORKER_ID`. - -## Setting up and tearing down the child process - -The child process can define two special methods (both of them can be asynchronous): - -- `setup()`: If defined, it's executed before the first call to any method in the child. -- `teardown()`: If defined, it's executed when the farm ends. - -# More examples - -## Standard usage - -This example covers the standard usage: - -### File `parent.js` - -```javascript -import {Worker as JestWorker} from 'jest-worker'; - -async function main() { - const myWorker = new JestWorker(require.resolve('./Worker'), { - exposedMethods: ['foo', 'bar', 'getWorkerId'], - numWorkers: 4, - }); - - console.log(await myWorker.foo('Alice')); // "Hello from foo: Alice" - console.log(await myWorker.bar('Bob')); // "Hello from bar: Bob" - console.log(await myWorker.getWorkerId()); // "3" -> this message has sent from the 3rd worker - - const {forceExited} = await myWorker.end(); - if (forceExited) { - console.error('Workers failed to exit gracefully'); - } -} - -main(); -``` - -### File `worker.js` - -```javascript -export function foo(param) { - return 'Hello from foo: ' + param; -} - -export function bar(param) { - return 'Hello from bar: ' + param; -} - -export function getWorkerId() { - return process.env.JEST_WORKER_ID; -} -``` - -## Bound worker usage: - -This example covers the usage with a `computeWorkerKey` method: - -### File `parent.js` - -```javascript -import {Worker as JestWorker} from 'jest-worker'; - -async function main() { - const myWorker = new JestWorker(require.resolve('./Worker'), { - computeWorkerKey: (method, filename) => filename, - }); - - // Transform the given file, within the first available worker. - console.log(await myWorker.transform('/tmp/foo.js')); - - // Wait a bit. - await sleep(10000); - - // Transform the same file again. Will immediately return because the - // transformed file is cached in the worker, and `computeWorkerKey` ensures - // the same worker that processed the file the first time will process it now. - console.log(await myWorker.transform('/tmp/foo.js')); - - const {forceExited} = await myWorker.end(); - if (forceExited) { - console.error('Workers failed to exit gracefully'); - } -} - -main(); -``` - -### File `worker.js` - -```javascript -import babel from '@babel/core'; - -const cache = Object.create(null); - -export function transform(filename) { - if (cache[filename]) { - return cache[filename]; - } - - // jest-worker can handle both immediate results and thenables. If a - // thenable is returned, it will be await'ed until it resolves. - return babel.transformFileAsync(filename).then(result => { - cache[filename] = result; - - return result; - }); -} -``` diff --git a/node_modules/jest-worker/build/Farm.d.ts b/node_modules/jest-worker/build/Farm.d.ts deleted file mode 100644 index 3fe79d0..0000000 --- a/node_modules/jest-worker/build/Farm.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { FarmOptions, PromiseWithCustomMessage, TaskQueue } from './types'; -export default class Farm { - private _numOfWorkers; - private _callback; - private readonly _computeWorkerKey; - private readonly _workerSchedulingPolicy; - private readonly _cacheKeys; - private readonly _locks; - private _offset; - private readonly _taskQueue; - constructor(_numOfWorkers: number, _callback: Function, options?: { - computeWorkerKey?: FarmOptions['computeWorkerKey']; - workerSchedulingPolicy?: FarmOptions['workerSchedulingPolicy']; - taskQueue?: TaskQueue; - }); - doWork(method: string, ...args: Array): PromiseWithCustomMessage; - private _process; - private _push; - private _getNextWorkerOffset; - private _lock; - private _unlock; - private _isLocked; -} diff --git a/node_modules/jest-worker/build/Farm.js b/node_modules/jest-worker/build/Farm.js deleted file mode 100644 index e29daf5..0000000 --- a/node_modules/jest-worker/build/Farm.js +++ /dev/null @@ -1,206 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -var _FifoQueue = _interopRequireDefault(require('./FifoQueue')); - -var _types = require('./types'); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -class Farm { - constructor(_numOfWorkers, _callback, options = {}) { - var _options$workerSchedu, _options$taskQueue; - - _defineProperty(this, '_computeWorkerKey', void 0); - - _defineProperty(this, '_workerSchedulingPolicy', void 0); - - _defineProperty(this, '_cacheKeys', Object.create(null)); - - _defineProperty(this, '_locks', []); - - _defineProperty(this, '_offset', 0); - - _defineProperty(this, '_taskQueue', void 0); - - this._numOfWorkers = _numOfWorkers; - this._callback = _callback; - this._computeWorkerKey = options.computeWorkerKey; - this._workerSchedulingPolicy = - (_options$workerSchedu = options.workerSchedulingPolicy) !== null && - _options$workerSchedu !== void 0 - ? _options$workerSchedu - : 'round-robin'; - this._taskQueue = - (_options$taskQueue = options.taskQueue) !== null && - _options$taskQueue !== void 0 - ? _options$taskQueue - : new _FifoQueue.default(); - } - - doWork(method, ...args) { - const customMessageListeners = new Set(); - - const addCustomMessageListener = listener => { - customMessageListeners.add(listener); - return () => { - customMessageListeners.delete(listener); - }; - }; - - const onCustomMessage = message => { - customMessageListeners.forEach(listener => listener(message)); - }; - - const promise = new Promise( // Bind args to this function so it won't reference to the parent scope. - // This prevents a memory leak in v8, because otherwise the function will - // retaine args for the closure. - ((args, resolve, reject) => { - const computeWorkerKey = this._computeWorkerKey; - const request = [_types.CHILD_MESSAGE_CALL, false, method, args]; - let worker = null; - let hash = null; - - if (computeWorkerKey) { - hash = computeWorkerKey.call(this, method, ...args); - worker = hash == null ? null : this._cacheKeys[hash]; - } - - const onStart = worker => { - if (hash != null) { - this._cacheKeys[hash] = worker; - } - }; - - const onEnd = (error, result) => { - customMessageListeners.clear(); - - if (error) { - reject(error); - } else { - resolve(result); - } - }; - - const task = { - onCustomMessage, - onEnd, - onStart, - request - }; - - if (worker) { - this._taskQueue.enqueue(task, worker.getWorkerId()); - - this._process(worker.getWorkerId()); - } else { - this._push(task); - } - }).bind(null, args) - ); - promise.UNSTABLE_onCustomMessage = addCustomMessageListener; - return promise; - } - - _process(workerId) { - if (this._isLocked(workerId)) { - return this; - } - - const task = this._taskQueue.dequeue(workerId); - - if (!task) { - return this; - } - - if (task.request[1]) { - throw new Error('Queue implementation returned processed task'); - } // Reference the task object outside so it won't be retained by onEnd, - // and other properties of the task object, such as task.request can be - // garbage collected. - - const taskOnEnd = task.onEnd; - - const onEnd = (error, result) => { - taskOnEnd(error, result); - - this._unlock(workerId); - - this._process(workerId); - }; - - task.request[1] = true; - - this._lock(workerId); - - this._callback( - workerId, - task.request, - task.onStart, - onEnd, - task.onCustomMessage - ); - - return this; - } - - _push(task) { - this._taskQueue.enqueue(task); - - const offset = this._getNextWorkerOffset(); - - for (let i = 0; i < this._numOfWorkers; i++) { - this._process((offset + i) % this._numOfWorkers); - - if (task.request[1]) { - break; - } - } - - return this; - } - - _getNextWorkerOffset() { - switch (this._workerSchedulingPolicy) { - case 'in-order': - return 0; - - case 'round-robin': - return this._offset++; - } - } - - _lock(workerId) { - this._locks[workerId] = true; - } - - _unlock(workerId) { - this._locks[workerId] = false; - } - - _isLocked(workerId) { - return this._locks[workerId]; - } -} - -exports.default = Farm; diff --git a/node_modules/jest-worker/build/FifoQueue.d.ts b/node_modules/jest-worker/build/FifoQueue.d.ts deleted file mode 100644 index d78e9e2..0000000 --- a/node_modules/jest-worker/build/FifoQueue.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import type { QueueChildMessage, TaskQueue } from './types'; -/** - * First-in, First-out task queue that manages a dedicated pool - * for each worker as well as a shared queue. The FIFO ordering is guaranteed - * across the worker specific and shared queue. - */ -export default class FifoQueue implements TaskQueue { - private _workerQueues; - private _sharedQueue; - enqueue(task: QueueChildMessage, workerId?: number): void; - dequeue(workerId: number): QueueChildMessage | null; -} diff --git a/node_modules/jest-worker/build/FifoQueue.js b/node_modules/jest-worker/build/FifoQueue.js deleted file mode 100644 index bb52e07..0000000 --- a/node_modules/jest-worker/build/FifoQueue.js +++ /dev/null @@ -1,171 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/** - * First-in, First-out task queue that manages a dedicated pool - * for each worker as well as a shared queue. The FIFO ordering is guaranteed - * across the worker specific and shared queue. - */ -class FifoQueue { - constructor() { - _defineProperty(this, '_workerQueues', []); - - _defineProperty(this, '_sharedQueue', new InternalQueue()); - } - - enqueue(task, workerId) { - if (workerId == null) { - this._sharedQueue.enqueue(task); - - return; - } - - let workerQueue = this._workerQueues[workerId]; - - if (workerQueue == null) { - workerQueue = this._workerQueues[workerId] = new InternalQueue(); - } - - const sharedTop = this._sharedQueue.peekLast(); - - const item = { - previousSharedTask: sharedTop, - task - }; - workerQueue.enqueue(item); - } - - dequeue(workerId) { - var _this$_workerQueues$w, _workerTop$previousSh, _workerTop$previousSh2; - - const workerTop = - (_this$_workerQueues$w = this._workerQueues[workerId]) === null || - _this$_workerQueues$w === void 0 - ? void 0 - : _this$_workerQueues$w.peek(); - const sharedTaskIsProcessed = - (_workerTop$previousSh = - workerTop === null || workerTop === void 0 - ? void 0 - : (_workerTop$previousSh2 = workerTop.previousSharedTask) === null || - _workerTop$previousSh2 === void 0 - ? void 0 - : _workerTop$previousSh2.request[1]) !== null && - _workerTop$previousSh !== void 0 - ? _workerTop$previousSh - : true; // Process the top task from the shared queue if - // - there's no task in the worker specific queue or - // - if the non-worker-specific task after which this worker specifif task - // hasn been queued wasn't processed yet - - if (workerTop != null && sharedTaskIsProcessed) { - var _this$_workerQueues$w2, - _this$_workerQueues$w3, - _this$_workerQueues$w4; - - return (_this$_workerQueues$w2 = - (_this$_workerQueues$w3 = this._workerQueues[workerId]) === null || - _this$_workerQueues$w3 === void 0 - ? void 0 - : (_this$_workerQueues$w4 = _this$_workerQueues$w3.dequeue()) === - null || _this$_workerQueues$w4 === void 0 - ? void 0 - : _this$_workerQueues$w4.task) !== null && - _this$_workerQueues$w2 !== void 0 - ? _this$_workerQueues$w2 - : null; - } - - return this._sharedQueue.dequeue(); - } -} - -exports.default = FifoQueue; - -/** - * FIFO queue for a single worker / shared queue. - */ -class InternalQueue { - constructor() { - _defineProperty(this, '_head', null); - - _defineProperty(this, '_last', null); - } - - enqueue(value) { - const item = { - next: null, - value - }; - - if (this._last == null) { - this._head = item; - } else { - this._last.next = item; - } - - this._last = item; - } - - dequeue() { - if (this._head == null) { - return null; - } - - const item = this._head; - this._head = item.next; - - if (this._head == null) { - this._last = null; - } - - return item.value; - } - - peek() { - var _this$_head$value, _this$_head; - - return (_this$_head$value = - (_this$_head = this._head) === null || _this$_head === void 0 - ? void 0 - : _this$_head.value) !== null && _this$_head$value !== void 0 - ? _this$_head$value - : null; - } - - peekLast() { - var _this$_last$value, _this$_last; - - return (_this$_last$value = - (_this$_last = this._last) === null || _this$_last === void 0 - ? void 0 - : _this$_last.value) !== null && _this$_last$value !== void 0 - ? _this$_last$value - : null; - } -} diff --git a/node_modules/jest-worker/build/PriorityQueue.d.ts b/node_modules/jest-worker/build/PriorityQueue.d.ts deleted file mode 100644 index d6bcf4c..0000000 --- a/node_modules/jest-worker/build/PriorityQueue.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import type { QueueChildMessage, TaskQueue } from './types'; -export declare type ComputeTaskPriorityCallback = (method: string, ...args: Array) => number; -declare type QueueItem = { - task: QueueChildMessage; - priority: number; -}; -/** - * Priority queue that processes tasks in natural ordering (lower priority first) - * accoridng to the priority computed by the function passed in the constructor. - * - * FIFO ordering isn't guaranteed for tasks with the same priority. - * - * Worker specific tasks with the same priority as a non-worker specific task - * are always processed first. - */ -export default class PriorityQueue implements TaskQueue { - private _computePriority; - private _queue; - private _sharedQueue; - constructor(_computePriority: ComputeTaskPriorityCallback); - enqueue(task: QueueChildMessage, workerId?: number): void; - _enqueue(task: QueueChildMessage, queue: MinHeap): void; - dequeue(workerId: number): QueueChildMessage | null; - _getWorkerQueue(workerId: number): MinHeap; -} -declare type HeapItem = { - priority: number; -}; -declare class MinHeap { - private _heap; - peek(): TItem | null; - add(item: TItem): void; - poll(): TItem | null; -} -export {}; diff --git a/node_modules/jest-worker/build/PriorityQueue.js b/node_modules/jest-worker/build/PriorityQueue.js deleted file mode 100644 index 6a55b59..0000000 --- a/node_modules/jest-worker/build/PriorityQueue.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/** - * Priority queue that processes tasks in natural ordering (lower priority first) - * accoridng to the priority computed by the function passed in the constructor. - * - * FIFO ordering isn't guaranteed for tasks with the same priority. - * - * Worker specific tasks with the same priority as a non-worker specific task - * are always processed first. - */ -class PriorityQueue { - constructor(_computePriority) { - _defineProperty(this, '_queue', []); - - _defineProperty(this, '_sharedQueue', new MinHeap()); - - this._computePriority = _computePriority; - } - - enqueue(task, workerId) { - if (workerId == null) { - this._enqueue(task, this._sharedQueue); - } else { - const queue = this._getWorkerQueue(workerId); - - this._enqueue(task, queue); - } - } - - _enqueue(task, queue) { - const item = { - priority: this._computePriority(task.request[2], ...task.request[3]), - task - }; - queue.add(item); - } - - dequeue(workerId) { - const workerQueue = this._getWorkerQueue(workerId); - - const workerTop = workerQueue.peek(); - - const sharedTop = this._sharedQueue.peek(); // use the task from the worker queue if there's no task in the shared queue - // or if the priority of the worker queue is smaller or equal to the - // priority of the top task in the shared queue. The tasks of the - // worker specific queue are preferred because no other worker can pick this - // specific task up. - - if ( - sharedTop == null || - (workerTop != null && workerTop.priority <= sharedTop.priority) - ) { - var _workerQueue$poll$tas, _workerQueue$poll; - - return (_workerQueue$poll$tas = - (_workerQueue$poll = workerQueue.poll()) === null || - _workerQueue$poll === void 0 - ? void 0 - : _workerQueue$poll.task) !== null && _workerQueue$poll$tas !== void 0 - ? _workerQueue$poll$tas - : null; - } - - return this._sharedQueue.poll().task; - } - - _getWorkerQueue(workerId) { - let queue = this._queue[workerId]; - - if (queue == null) { - queue = this._queue[workerId] = new MinHeap(); - } - - return queue; - } -} - -exports.default = PriorityQueue; - -class MinHeap { - constructor() { - _defineProperty(this, '_heap', []); - } - - peek() { - var _this$_heap$; - - return (_this$_heap$ = this._heap[0]) !== null && _this$_heap$ !== void 0 - ? _this$_heap$ - : null; - } - - add(item) { - const nodes = this._heap; - nodes.push(item); - - if (nodes.length === 1) { - return; - } - - let currentIndex = nodes.length - 1; // Bubble up the added node as long as the parent is bigger - - while (currentIndex > 0) { - const parentIndex = Math.floor((currentIndex + 1) / 2) - 1; - const parent = nodes[parentIndex]; - - if (parent.priority <= item.priority) { - break; - } - - nodes[currentIndex] = parent; - nodes[parentIndex] = item; - currentIndex = parentIndex; - } - } - - poll() { - const nodes = this._heap; - const result = nodes[0]; - const lastElement = nodes.pop(); // heap was empty or removed the last element - - if (result == null || nodes.length === 0) { - return result !== null && result !== void 0 ? result : null; - } - - let index = 0; - nodes[0] = - lastElement !== null && lastElement !== void 0 ? lastElement : null; - const element = nodes[0]; - - while (true) { - let swapIndex = null; - const rightChildIndex = (index + 1) * 2; - const leftChildIndex = rightChildIndex - 1; - const rightChild = nodes[rightChildIndex]; - const leftChild = nodes[leftChildIndex]; // if the left child is smaller, swap with the left - - if (leftChild != null && leftChild.priority < element.priority) { - swapIndex = leftChildIndex; - } // If the right child is smaller or the right child is smaller than the left - // then swap with the right child - - if ( - rightChild != null && - rightChild.priority < (swapIndex == null ? element : leftChild).priority - ) { - swapIndex = rightChildIndex; - } - - if (swapIndex == null) { - break; - } - - nodes[index] = nodes[swapIndex]; - nodes[swapIndex] = element; - index = swapIndex; - } - - return result; - } -} diff --git a/node_modules/jest-worker/build/WorkerPool.d.ts b/node_modules/jest-worker/build/WorkerPool.d.ts deleted file mode 100644 index 9f13ff7..0000000 --- a/node_modules/jest-worker/build/WorkerPool.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import BaseWorkerPool from './base/BaseWorkerPool'; -import type { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions, WorkerPoolInterface } from './types'; -declare class WorkerPool extends BaseWorkerPool implements WorkerPoolInterface { - send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd, onCustomMessage: OnCustomMessage): void; - createWorker(workerOptions: WorkerOptions): WorkerInterface; -} -export default WorkerPool; diff --git a/node_modules/jest-worker/build/WorkerPool.js b/node_modules/jest-worker/build/WorkerPool.js deleted file mode 100644 index b19a679..0000000 --- a/node_modules/jest-worker/build/WorkerPool.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -var _BaseWorkerPool = _interopRequireDefault(require('./base/BaseWorkerPool')); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -const canUseWorkerThreads = () => { - try { - require('worker_threads'); - - return true; - } catch { - return false; - } -}; - -class WorkerPool extends _BaseWorkerPool.default { - send(workerId, request, onStart, onEnd, onCustomMessage) { - this.getWorkerById(workerId).send(request, onStart, onEnd, onCustomMessage); - } - - createWorker(workerOptions) { - let Worker; - - if (this._options.enableWorkerThreads && canUseWorkerThreads()) { - Worker = require('./workers/NodeThreadsWorker').default; - } else { - Worker = require('./workers/ChildProcessWorker').default; - } - - return new Worker(workerOptions); - } -} - -var _default = WorkerPool; -exports.default = _default; diff --git a/node_modules/jest-worker/build/base/BaseWorkerPool.d.ts b/node_modules/jest-worker/build/base/BaseWorkerPool.d.ts deleted file mode 100644 index 311309e..0000000 --- a/node_modules/jest-worker/build/base/BaseWorkerPool.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { PoolExitResult, WorkerInterface, WorkerOptions, WorkerPoolOptions } from '../types'; -export default class BaseWorkerPool { - private readonly _stderr; - private readonly _stdout; - protected readonly _options: WorkerPoolOptions; - private readonly _workers; - constructor(workerPath: string, options: WorkerPoolOptions); - getStderr(): NodeJS.ReadableStream; - getStdout(): NodeJS.ReadableStream; - getWorkers(): Array; - getWorkerById(workerId: number): WorkerInterface; - createWorker(_workerOptions: WorkerOptions): WorkerInterface; - end(): Promise; -} diff --git a/node_modules/jest-worker/build/base/BaseWorkerPool.js b/node_modules/jest-worker/build/base/BaseWorkerPool.js deleted file mode 100644 index 491deb8..0000000 --- a/node_modules/jest-worker/build/base/BaseWorkerPool.js +++ /dev/null @@ -1,201 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -function path() { - const data = _interopRequireWildcard(require('path')); - - path = function () { - return data; - }; - - return data; -} - -function _mergeStream() { - const data = _interopRequireDefault(require('merge-stream')); - - _mergeStream = function () { - return data; - }; - - return data; -} - -var _types = require('../types'); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== 'function') return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function (nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -} - -function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { - return {default: obj}; - } - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -// How long to wait for the child process to terminate -// after CHILD_MESSAGE_END before sending force exiting. -const FORCE_EXIT_DELAY = 500; -/* istanbul ignore next */ - -const emptyMethod = () => {}; - -class BaseWorkerPool { - constructor(workerPath, options) { - _defineProperty(this, '_stderr', void 0); - - _defineProperty(this, '_stdout', void 0); - - _defineProperty(this, '_options', void 0); - - _defineProperty(this, '_workers', void 0); - - this._options = options; - this._workers = new Array(options.numWorkers); - - if (!path().isAbsolute(workerPath)) { - workerPath = require.resolve(workerPath); - } - - const stdout = (0, _mergeStream().default)(); - const stderr = (0, _mergeStream().default)(); - const {forkOptions, maxRetries, resourceLimits, setupArgs} = options; - - for (let i = 0; i < options.numWorkers; i++) { - const workerOptions = { - forkOptions, - maxRetries, - resourceLimits, - setupArgs, - workerId: i, - workerPath - }; - const worker = this.createWorker(workerOptions); - const workerStdout = worker.getStdout(); - const workerStderr = worker.getStderr(); - - if (workerStdout) { - stdout.add(workerStdout); - } - - if (workerStderr) { - stderr.add(workerStderr); - } - - this._workers[i] = worker; - } - - this._stdout = stdout; - this._stderr = stderr; - } - - getStderr() { - return this._stderr; - } - - getStdout() { - return this._stdout; - } - - getWorkers() { - return this._workers; - } - - getWorkerById(workerId) { - return this._workers[workerId]; - } - - createWorker(_workerOptions) { - throw Error('Missing method createWorker in WorkerPool'); - } - - async end() { - // We do not cache the request object here. If so, it would only be only - // processed by one of the workers, and we want them all to close. - const workerExitPromises = this._workers.map(async worker => { - worker.send( - [_types.CHILD_MESSAGE_END, false], - emptyMethod, - emptyMethod, - emptyMethod - ); // Schedule a force exit in case worker fails to exit gracefully so - // await worker.waitForExit() never takes longer than FORCE_EXIT_DELAY - - let forceExited = false; - const forceExitTimeout = setTimeout(() => { - worker.forceExit(); - forceExited = true; - }, FORCE_EXIT_DELAY); - await worker.waitForExit(); // Worker ideally exited gracefully, don't send force exit then - - clearTimeout(forceExitTimeout); - return forceExited; - }); - - const workerExits = await Promise.all(workerExitPromises); - return workerExits.reduce( - (result, forceExited) => ({ - forceExited: result.forceExited || forceExited - }), - { - forceExited: false - } - ); - } -} - -exports.default = BaseWorkerPool; diff --git a/node_modules/jest-worker/build/index.d.ts b/node_modules/jest-worker/build/index.d.ts deleted file mode 100644 index 5908dbb..0000000 --- a/node_modules/jest-worker/build/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import type { FarmOptions, PoolExitResult, PromiseWithCustomMessage, TaskQueue } from './types'; -export { default as PriorityQueue } from './PriorityQueue'; -export { default as FifoQueue } from './FifoQueue'; -export { default as messageParent } from './workers/messageParent'; -/** - * The Jest farm (publicly called "Worker") is a class that allows you to queue - * methods across multiple child processes, in order to parallelize work. This - * is done by providing an absolute path to a module that will be loaded on each - * of the child processes, and bridged to the main process. - * - * Bridged methods are specified by using the "exposedMethods" property of the - * "options" object. This is an array of strings, where each of them corresponds - * to the exported name in the loaded module. - * - * You can also control the amount of workers by using the "numWorkers" property - * of the "options" object, and the settings passed to fork the process through - * the "forkOptions" property. The amount of workers defaults to the amount of - * CPUS minus one. - * - * Queueing calls can be done in two ways: - * - Standard method: calls will be redirected to the first available worker, - * so they will get executed as soon as they can. - * - * - Sticky method: if a "computeWorkerKey" method is provided within the - * config, the resulting string of this method will be used as a key. - * Every time this key is returned, it is guaranteed that your job will be - * processed by the same worker. This is specially useful if your workers - * are caching results. - */ -export declare class Worker { - private _ending; - private _farm; - private _options; - private _workerPool; - constructor(workerPath: string, options?: FarmOptions); - private _bindExposedWorkerMethods; - private _callFunctionWithArgs; - getStderr(): NodeJS.ReadableStream; - getStdout(): NodeJS.ReadableStream; - end(): Promise; -} -export type { PromiseWithCustomMessage, TaskQueue }; diff --git a/node_modules/jest-worker/build/index.js b/node_modules/jest-worker/build/index.js deleted file mode 100644 index 5dac183..0000000 --- a/node_modules/jest-worker/build/index.js +++ /dev/null @@ -1,223 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -Object.defineProperty(exports, 'FifoQueue', { - enumerable: true, - get: function () { - return _FifoQueue.default; - } -}); -Object.defineProperty(exports, 'PriorityQueue', { - enumerable: true, - get: function () { - return _PriorityQueue.default; - } -}); -exports.Worker = void 0; -Object.defineProperty(exports, 'messageParent', { - enumerable: true, - get: function () { - return _messageParent.default; - } -}); - -function _os() { - const data = require('os'); - - _os = function () { - return data; - }; - - return data; -} - -var _Farm = _interopRequireDefault(require('./Farm')); - -var _WorkerPool = _interopRequireDefault(require('./WorkerPool')); - -var _PriorityQueue = _interopRequireDefault(require('./PriorityQueue')); - -var _FifoQueue = _interopRequireDefault(require('./FifoQueue')); - -var _messageParent = _interopRequireDefault(require('./workers/messageParent')); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -function getExposedMethods(workerPath, options) { - let exposedMethods = options.exposedMethods; // If no methods list is given, try getting it by auto-requiring the module. - - if (!exposedMethods) { - const module = require(workerPath); - - exposedMethods = Object.keys(module).filter( - // @ts-expect-error: no index - name => typeof module[name] === 'function' - ); - - if (typeof module === 'function') { - exposedMethods = [...exposedMethods, 'default']; - } - } - - return exposedMethods; -} -/** - * The Jest farm (publicly called "Worker") is a class that allows you to queue - * methods across multiple child processes, in order to parallelize work. This - * is done by providing an absolute path to a module that will be loaded on each - * of the child processes, and bridged to the main process. - * - * Bridged methods are specified by using the "exposedMethods" property of the - * "options" object. This is an array of strings, where each of them corresponds - * to the exported name in the loaded module. - * - * You can also control the amount of workers by using the "numWorkers" property - * of the "options" object, and the settings passed to fork the process through - * the "forkOptions" property. The amount of workers defaults to the amount of - * CPUS minus one. - * - * Queueing calls can be done in two ways: - * - Standard method: calls will be redirected to the first available worker, - * so they will get executed as soon as they can. - * - * - Sticky method: if a "computeWorkerKey" method is provided within the - * config, the resulting string of this method will be used as a key. - * Every time this key is returned, it is guaranteed that your job will be - * processed by the same worker. This is specially useful if your workers - * are caching results. - */ - -class Worker { - constructor(workerPath, options) { - var _this$_options$enable, - _this$_options$forkOp, - _this$_options$maxRet, - _this$_options$numWor, - _this$_options$resour, - _this$_options$setupA; - - _defineProperty(this, '_ending', void 0); - - _defineProperty(this, '_farm', void 0); - - _defineProperty(this, '_options', void 0); - - _defineProperty(this, '_workerPool', void 0); - - this._options = {...options}; - this._ending = false; - const workerPoolOptions = { - enableWorkerThreads: - (_this$_options$enable = this._options.enableWorkerThreads) !== null && - _this$_options$enable !== void 0 - ? _this$_options$enable - : false, - forkOptions: - (_this$_options$forkOp = this._options.forkOptions) !== null && - _this$_options$forkOp !== void 0 - ? _this$_options$forkOp - : {}, - maxRetries: - (_this$_options$maxRet = this._options.maxRetries) !== null && - _this$_options$maxRet !== void 0 - ? _this$_options$maxRet - : 3, - numWorkers: - (_this$_options$numWor = this._options.numWorkers) !== null && - _this$_options$numWor !== void 0 - ? _this$_options$numWor - : Math.max((0, _os().cpus)().length - 1, 1), - resourceLimits: - (_this$_options$resour = this._options.resourceLimits) !== null && - _this$_options$resour !== void 0 - ? _this$_options$resour - : {}, - setupArgs: - (_this$_options$setupA = this._options.setupArgs) !== null && - _this$_options$setupA !== void 0 - ? _this$_options$setupA - : [] - }; - - if (this._options.WorkerPool) { - // @ts-expect-error: constructor target any? - this._workerPool = new this._options.WorkerPool( - workerPath, - workerPoolOptions - ); - } else { - this._workerPool = new _WorkerPool.default(workerPath, workerPoolOptions); - } - - this._farm = new _Farm.default( - workerPoolOptions.numWorkers, - this._workerPool.send.bind(this._workerPool), - { - computeWorkerKey: this._options.computeWorkerKey, - taskQueue: this._options.taskQueue, - workerSchedulingPolicy: this._options.workerSchedulingPolicy - } - ); - - this._bindExposedWorkerMethods(workerPath, this._options); - } - - _bindExposedWorkerMethods(workerPath, options) { - getExposedMethods(workerPath, options).forEach(name => { - if (name.startsWith('_')) { - return; - } - - if (this.constructor.prototype.hasOwnProperty(name)) { - throw new TypeError('Cannot define a method called ' + name); - } // @ts-expect-error: dynamic extension of the class instance is expected. - - this[name] = this._callFunctionWithArgs.bind(this, name); - }); - } - - _callFunctionWithArgs(method, ...args) { - if (this._ending) { - throw new Error('Farm is ended, no more calls can be done to it'); - } - - return this._farm.doWork(method, ...args); - } - - getStderr() { - return this._workerPool.getStderr(); - } - - getStdout() { - return this._workerPool.getStdout(); - } - - async end() { - if (this._ending) { - throw new Error('Farm is ended, no more calls can be done to it'); - } - - this._ending = true; - return this._workerPool.end(); - } -} - -exports.Worker = Worker; diff --git a/node_modules/jest-worker/build/types.d.ts b/node_modules/jest-worker/build/types.d.ts deleted file mode 100644 index be160f6..0000000 --- a/node_modules/jest-worker/build/types.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import type { ForkOptions } from 'child_process'; -import type { EventEmitter } from 'events'; -export interface ResourceLimits { - maxYoungGenerationSizeMb?: number; - maxOldGenerationSizeMb?: number; - codeRangeSizeMb?: number; - stackSizeMb?: number; -} -export declare const CHILD_MESSAGE_INITIALIZE: 0; -export declare const CHILD_MESSAGE_CALL: 1; -export declare const CHILD_MESSAGE_END: 2; -export declare const PARENT_MESSAGE_OK: 0; -export declare const PARENT_MESSAGE_CLIENT_ERROR: 1; -export declare const PARENT_MESSAGE_SETUP_ERROR: 2; -export declare const PARENT_MESSAGE_CUSTOM: 3; -export declare type PARENT_MESSAGE_ERROR = typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR; -export interface WorkerPoolInterface { - getStderr(): NodeJS.ReadableStream; - getStdout(): NodeJS.ReadableStream; - getWorkers(): Array; - createWorker(options: WorkerOptions): WorkerInterface; - send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd, onCustomMessage: OnCustomMessage): void; - end(): Promise; -} -export interface WorkerInterface { - send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void; - waitForExit(): Promise; - forceExit(): void; - getWorkerId(): number; - getStderr(): NodeJS.ReadableStream | null; - getStdout(): NodeJS.ReadableStream | null; -} -export declare type PoolExitResult = { - forceExited: boolean; -}; -export interface PromiseWithCustomMessage extends Promise { - UNSTABLE_onCustomMessage?: (listener: OnCustomMessage) => () => void; -} -export type { ForkOptions }; -export interface TaskQueue { - /** - * Enqueues the task in the queue for the specified worker or adds it to the - * queue shared by all workers - * @param task the task to queue - * @param workerId the id of the worker that should process this task or undefined - * if there's no preference. - */ - enqueue(task: QueueChildMessage, workerId?: number): void; - /** - * Dequeues the next item from the queue for the speified worker - * @param workerId the id of the worker for which the next task should be retrieved - */ - dequeue(workerId: number): QueueChildMessage | null; -} -export declare type FarmOptions = { - computeWorkerKey?: (method: string, ...args: Array) => string | null; - exposedMethods?: ReadonlyArray; - forkOptions?: ForkOptions; - workerSchedulingPolicy?: 'round-robin' | 'in-order'; - resourceLimits?: ResourceLimits; - setupArgs?: Array; - maxRetries?: number; - numWorkers?: number; - taskQueue?: TaskQueue; - WorkerPool?: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface; - enableWorkerThreads?: boolean; -}; -export declare type WorkerPoolOptions = { - setupArgs: Array; - forkOptions: ForkOptions; - resourceLimits: ResourceLimits; - maxRetries: number; - numWorkers: number; - enableWorkerThreads: boolean; -}; -export declare type WorkerOptions = { - forkOptions: ForkOptions; - resourceLimits: ResourceLimits; - setupArgs: Array; - maxRetries: number; - workerId: number; - workerData?: unknown; - workerPath: string; -}; -export declare type MessagePort = typeof EventEmitter & { - postMessage(message: unknown): void; -}; -export declare type MessageChannel = { - port1: MessagePort; - port2: MessagePort; -}; -export declare type ChildMessageInitialize = [ - typeof CHILD_MESSAGE_INITIALIZE, - boolean, - string, - // file - Array | undefined, - // setupArgs - MessagePort | undefined -]; -export declare type ChildMessageCall = [ - typeof CHILD_MESSAGE_CALL, - boolean, - string, - Array -]; -export declare type ChildMessageEnd = [ - typeof CHILD_MESSAGE_END, - boolean -]; -export declare type ChildMessage = ChildMessageInitialize | ChildMessageCall | ChildMessageEnd; -export declare type ParentMessageCustom = [ - typeof PARENT_MESSAGE_CUSTOM, - unknown -]; -export declare type ParentMessageOk = [ - typeof PARENT_MESSAGE_OK, - unknown -]; -export declare type ParentMessageError = [ - PARENT_MESSAGE_ERROR, - string, - string, - string, - unknown -]; -export declare type ParentMessage = ParentMessageOk | ParentMessageError | ParentMessageCustom; -export declare type OnStart = (worker: WorkerInterface) => void; -export declare type OnEnd = (err: Error | null, result: unknown) => void; -export declare type OnCustomMessage = (message: Array | unknown) => void; -export declare type QueueChildMessage = { - request: ChildMessageCall; - onStart: OnStart; - onEnd: OnEnd; - onCustomMessage: OnCustomMessage; -}; diff --git a/node_modules/jest-worker/build/types.js b/node_modules/jest-worker/build/types.js deleted file mode 100644 index 92b358b..0000000 --- a/node_modules/jest-worker/build/types.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.PARENT_MESSAGE_SETUP_ERROR = - exports.PARENT_MESSAGE_OK = - exports.PARENT_MESSAGE_CUSTOM = - exports.PARENT_MESSAGE_CLIENT_ERROR = - exports.CHILD_MESSAGE_INITIALIZE = - exports.CHILD_MESSAGE_END = - exports.CHILD_MESSAGE_CALL = - void 0; - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -// import type {ResourceLimits} from 'worker_threads'; -// This is not present in the Node 12 typings -// Because of the dynamic nature of a worker communication process, all messages -// coming from any of the other processes cannot be typed. Thus, many types -// include "unknown" as a TS type, which is (unfortunately) correct here. -const CHILD_MESSAGE_INITIALIZE = 0; -exports.CHILD_MESSAGE_INITIALIZE = CHILD_MESSAGE_INITIALIZE; -const CHILD_MESSAGE_CALL = 1; -exports.CHILD_MESSAGE_CALL = CHILD_MESSAGE_CALL; -const CHILD_MESSAGE_END = 2; -exports.CHILD_MESSAGE_END = CHILD_MESSAGE_END; -const PARENT_MESSAGE_OK = 0; -exports.PARENT_MESSAGE_OK = PARENT_MESSAGE_OK; -const PARENT_MESSAGE_CLIENT_ERROR = 1; -exports.PARENT_MESSAGE_CLIENT_ERROR = PARENT_MESSAGE_CLIENT_ERROR; -const PARENT_MESSAGE_SETUP_ERROR = 2; -exports.PARENT_MESSAGE_SETUP_ERROR = PARENT_MESSAGE_SETUP_ERROR; -const PARENT_MESSAGE_CUSTOM = 3; -exports.PARENT_MESSAGE_CUSTOM = PARENT_MESSAGE_CUSTOM; diff --git a/node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts b/node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts deleted file mode 100644 index 4a8dcf1..0000000 --- a/node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; -/** - * This class wraps the child process and provides a nice interface to - * communicate with. It takes care of: - * - * - Re-spawning the process if it dies. - * - Queues calls while the worker is busy. - * - Re-sends the requests if the worker blew up. - * - * The reason for queueing them here (since childProcess.send also has an - * internal queue) is because the worker could be doing asynchronous work, and - * this would lead to the child process to read its receiving buffer and start a - * second call. By queueing calls here, we don't send the next call to the - * children until we receive the result of the previous one. - * - * As soon as a request starts to be processed by a worker, its "processed" - * field is changed to "true", so that other workers which might encounter the - * same call skip it. - */ -export default class ChildProcessWorker implements WorkerInterface { - private _child; - private _options; - private _request; - private _retries; - private _onProcessEnd; - private _onCustomMessage; - private _fakeStream; - private _stdout; - private _stderr; - private _exitPromise; - private _resolveExitPromise; - constructor(options: WorkerOptions); - initialize(): void; - private _shutdown; - private _onMessage; - private _onExit; - send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void; - waitForExit(): Promise; - forceExit(): void; - getWorkerId(): number; - getStdout(): NodeJS.ReadableStream | null; - getStderr(): NodeJS.ReadableStream | null; - private _getFakeStream; -} diff --git a/node_modules/jest-worker/build/workers/ChildProcessWorker.js b/node_modules/jest-worker/build/workers/ChildProcessWorker.js deleted file mode 100644 index f8a42c9..0000000 --- a/node_modules/jest-worker/build/workers/ChildProcessWorker.js +++ /dev/null @@ -1,333 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -function _child_process() { - const data = require('child_process'); - - _child_process = function () { - return data; - }; - - return data; -} - -function _stream() { - const data = require('stream'); - - _stream = function () { - return data; - }; - - return data; -} - -function _mergeStream() { - const data = _interopRequireDefault(require('merge-stream')); - - _mergeStream = function () { - return data; - }; - - return data; -} - -function _supportsColor() { - const data = require('supports-color'); - - _supportsColor = function () { - return data; - }; - - return data; -} - -var _types = require('../types'); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -const SIGNAL_BASE_EXIT_CODE = 128; -const SIGKILL_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 9; -const SIGTERM_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 15; // How long to wait after SIGTERM before sending SIGKILL - -const SIGKILL_DELAY = 500; -/** - * This class wraps the child process and provides a nice interface to - * communicate with. It takes care of: - * - * - Re-spawning the process if it dies. - * - Queues calls while the worker is busy. - * - Re-sends the requests if the worker blew up. - * - * The reason for queueing them here (since childProcess.send also has an - * internal queue) is because the worker could be doing asynchronous work, and - * this would lead to the child process to read its receiving buffer and start a - * second call. By queueing calls here, we don't send the next call to the - * children until we receive the result of the previous one. - * - * As soon as a request starts to be processed by a worker, its "processed" - * field is changed to "true", so that other workers which might encounter the - * same call skip it. - */ - -class ChildProcessWorker { - constructor(options) { - _defineProperty(this, '_child', void 0); - - _defineProperty(this, '_options', void 0); - - _defineProperty(this, '_request', void 0); - - _defineProperty(this, '_retries', void 0); - - _defineProperty(this, '_onProcessEnd', void 0); - - _defineProperty(this, '_onCustomMessage', void 0); - - _defineProperty(this, '_fakeStream', void 0); - - _defineProperty(this, '_stdout', void 0); - - _defineProperty(this, '_stderr', void 0); - - _defineProperty(this, '_exitPromise', void 0); - - _defineProperty(this, '_resolveExitPromise', void 0); - - this._options = options; - this._request = null; - this._fakeStream = null; - this._stdout = null; - this._stderr = null; - this._exitPromise = new Promise(resolve => { - this._resolveExitPromise = resolve; - }); - this.initialize(); - } - - initialize() { - const forceColor = _supportsColor().stdout - ? { - FORCE_COLOR: '1' - } - : {}; - const child = (0, _child_process().fork)( - require.resolve('./processChild'), - [], - { - cwd: process.cwd(), - env: { - ...process.env, - JEST_WORKER_ID: String(this._options.workerId + 1), - // 0-indexed workerId, 1-indexed JEST_WORKER_ID - ...forceColor - }, - // Suppress --debug / --inspect flags while preserving others (like --harmony). - execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)), - silent: true, - ...this._options.forkOptions - } - ); - - if (child.stdout) { - if (!this._stdout) { - // We need to add a permanent stream to the merged stream to prevent it - // from ending when the subprocess stream ends - this._stdout = (0, _mergeStream().default)(this._getFakeStream()); - } - - this._stdout.add(child.stdout); - } - - if (child.stderr) { - if (!this._stderr) { - // We need to add a permanent stream to the merged stream to prevent it - // from ending when the subprocess stream ends - this._stderr = (0, _mergeStream().default)(this._getFakeStream()); - } - - this._stderr.add(child.stderr); - } - - child.on('message', this._onMessage.bind(this)); - child.on('exit', this._onExit.bind(this)); - child.send([ - _types.CHILD_MESSAGE_INITIALIZE, - false, - this._options.workerPath, - this._options.setupArgs - ]); - this._child = child; - this._retries++; // If we exceeded the amount of retries, we will emulate an error reply - // coming from the child. This avoids code duplication related with cleaning - // the queue, and scheduling the next call. - - if (this._retries > this._options.maxRetries) { - const error = new Error( - `Jest worker encountered ${this._retries} child process exceptions, exceeding retry limit` - ); - - this._onMessage([ - _types.PARENT_MESSAGE_CLIENT_ERROR, - error.name, - error.message, - error.stack, - { - type: 'WorkerError' - } - ]); - } - } - - _shutdown() { - // End the temporary streams so the merged streams end too - if (this._fakeStream) { - this._fakeStream.end(); - - this._fakeStream = null; - } - - this._resolveExitPromise(); - } - - _onMessage(response) { - // TODO: Add appropriate type check - let error; - - switch (response[0]) { - case _types.PARENT_MESSAGE_OK: - this._onProcessEnd(null, response[1]); - - break; - - case _types.PARENT_MESSAGE_CLIENT_ERROR: - error = response[4]; - - if (error != null && typeof error === 'object') { - const extra = error; // @ts-expect-error: no index - - const NativeCtor = global[response[1]]; - const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; - error = new Ctor(response[2]); - error.type = response[1]; - error.stack = response[3]; - - for (const key in extra) { - error[key] = extra[key]; - } - } - - this._onProcessEnd(error, null); - - break; - - case _types.PARENT_MESSAGE_SETUP_ERROR: - error = new Error('Error when calling setup: ' + response[2]); - error.type = response[1]; - error.stack = response[3]; - - this._onProcessEnd(error, null); - - break; - - case _types.PARENT_MESSAGE_CUSTOM: - this._onCustomMessage(response[1]); - - break; - - default: - throw new TypeError('Unexpected response from worker: ' + response[0]); - } - } - - _onExit(exitCode) { - if ( - exitCode !== 0 && - exitCode !== null && - exitCode !== SIGTERM_EXIT_CODE && - exitCode !== SIGKILL_EXIT_CODE - ) { - this.initialize(); - - if (this._request) { - this._child.send(this._request); - } - } else { - this._shutdown(); - } - } - - send(request, onProcessStart, onProcessEnd, onCustomMessage) { - onProcessStart(this); - - this._onProcessEnd = (...args) => { - // Clean the request to avoid sending past requests to workers that fail - // while waiting for a new request (timers, unhandled rejections...) - this._request = null; - return onProcessEnd(...args); - }; - - this._onCustomMessage = (...arg) => onCustomMessage(...arg); - - this._request = request; - this._retries = 0; - - this._child.send(request, () => {}); - } - - waitForExit() { - return this._exitPromise; - } - - forceExit() { - this._child.kill('SIGTERM'); - - const sigkillTimeout = setTimeout( - () => this._child.kill('SIGKILL'), - SIGKILL_DELAY - ); - - this._exitPromise.then(() => clearTimeout(sigkillTimeout)); - } - - getWorkerId() { - return this._options.workerId; - } - - getStdout() { - return this._stdout; - } - - getStderr() { - return this._stderr; - } - - _getFakeStream() { - if (!this._fakeStream) { - this._fakeStream = new (_stream().PassThrough)(); - } - - return this._fakeStream; - } -} - -exports.default = ChildProcessWorker; diff --git a/node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts b/node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts deleted file mode 100644 index 4696ecc..0000000 --- a/node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; -export default class ExperimentalWorker implements WorkerInterface { - private _worker; - private _options; - private _request; - private _retries; - private _onProcessEnd; - private _onCustomMessage; - private _fakeStream; - private _stdout; - private _stderr; - private _exitPromise; - private _resolveExitPromise; - private _forceExited; - constructor(options: WorkerOptions); - initialize(): void; - private _shutdown; - private _onMessage; - private _onExit; - waitForExit(): Promise; - forceExit(): void; - send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd | null, onCustomMessage: OnCustomMessage): void; - getWorkerId(): number; - getStdout(): NodeJS.ReadableStream | null; - getStderr(): NodeJS.ReadableStream | null; - private _getFakeStream; -} diff --git a/node_modules/jest-worker/build/workers/NodeThreadsWorker.js b/node_modules/jest-worker/build/workers/NodeThreadsWorker.js deleted file mode 100644 index 21b7dd2..0000000 --- a/node_modules/jest-worker/build/workers/NodeThreadsWorker.js +++ /dev/null @@ -1,344 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -function path() { - const data = _interopRequireWildcard(require('path')); - - path = function () { - return data; - }; - - return data; -} - -function _stream() { - const data = require('stream'); - - _stream = function () { - return data; - }; - - return data; -} - -function _worker_threads() { - const data = require('worker_threads'); - - _worker_threads = function () { - return data; - }; - - return data; -} - -function _mergeStream() { - const data = _interopRequireDefault(require('merge-stream')); - - _mergeStream = function () { - return data; - }; - - return data; -} - -var _types = require('../types'); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== 'function') return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function (nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -} - -function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { - return {default: obj}; - } - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} - -class ExperimentalWorker { - constructor(options) { - _defineProperty(this, '_worker', void 0); - - _defineProperty(this, '_options', void 0); - - _defineProperty(this, '_request', void 0); - - _defineProperty(this, '_retries', void 0); - - _defineProperty(this, '_onProcessEnd', void 0); - - _defineProperty(this, '_onCustomMessage', void 0); - - _defineProperty(this, '_fakeStream', void 0); - - _defineProperty(this, '_stdout', void 0); - - _defineProperty(this, '_stderr', void 0); - - _defineProperty(this, '_exitPromise', void 0); - - _defineProperty(this, '_resolveExitPromise', void 0); - - _defineProperty(this, '_forceExited', void 0); - - this._options = options; - this._request = null; - this._fakeStream = null; - this._stdout = null; - this._stderr = null; - this._exitPromise = new Promise(resolve => { - this._resolveExitPromise = resolve; - }); - this._forceExited = false; - this.initialize(); - } - - initialize() { - this._worker = new (_worker_threads().Worker)( - path().resolve(__dirname, './threadChild.js'), - { - eval: false, - // @ts-expect-error: added in newer versions - resourceLimits: this._options.resourceLimits, - stderr: true, - stdout: true, - workerData: this._options.workerData, - ...this._options.forkOptions - } - ); - - if (this._worker.stdout) { - if (!this._stdout) { - // We need to add a permanent stream to the merged stream to prevent it - // from ending when the subprocess stream ends - this._stdout = (0, _mergeStream().default)(this._getFakeStream()); - } - - this._stdout.add(this._worker.stdout); - } - - if (this._worker.stderr) { - if (!this._stderr) { - // We need to add a permanent stream to the merged stream to prevent it - // from ending when the subprocess stream ends - this._stderr = (0, _mergeStream().default)(this._getFakeStream()); - } - - this._stderr.add(this._worker.stderr); - } - - this._worker.on('message', this._onMessage.bind(this)); - - this._worker.on('exit', this._onExit.bind(this)); - - this._worker.postMessage([ - _types.CHILD_MESSAGE_INITIALIZE, - false, - this._options.workerPath, - this._options.setupArgs, - String(this._options.workerId + 1) // 0-indexed workerId, 1-indexed JEST_WORKER_ID - ]); - - this._retries++; // If we exceeded the amount of retries, we will emulate an error reply - // coming from the child. This avoids code duplication related with cleaning - // the queue, and scheduling the next call. - - if (this._retries > this._options.maxRetries) { - const error = new Error('Call retries were exceeded'); - - this._onMessage([ - _types.PARENT_MESSAGE_CLIENT_ERROR, - error.name, - error.message, - error.stack, - { - type: 'WorkerError' - } - ]); - } - } - - _shutdown() { - // End the permanent stream so the merged stream end too - if (this._fakeStream) { - this._fakeStream.end(); - - this._fakeStream = null; - } - - this._resolveExitPromise(); - } - - _onMessage(response) { - let error; - - switch (response[0]) { - case _types.PARENT_MESSAGE_OK: - this._onProcessEnd(null, response[1]); - - break; - - case _types.PARENT_MESSAGE_CLIENT_ERROR: - error = response[4]; - - if (error != null && typeof error === 'object') { - const extra = error; // @ts-expect-error: no index - - const NativeCtor = global[response[1]]; - const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; - error = new Ctor(response[2]); - error.type = response[1]; - error.stack = response[3]; - - for (const key in extra) { - // @ts-expect-error: no index - error[key] = extra[key]; - } - } - - this._onProcessEnd(error, null); - - break; - - case _types.PARENT_MESSAGE_SETUP_ERROR: - error = new Error('Error when calling setup: ' + response[2]); // @ts-expect-error: adding custom properties to errors. - - error.type = response[1]; - error.stack = response[3]; - - this._onProcessEnd(error, null); - - break; - - case _types.PARENT_MESSAGE_CUSTOM: - this._onCustomMessage(response[1]); - - break; - - default: - throw new TypeError('Unexpected response from worker: ' + response[0]); - } - } - - _onExit(exitCode) { - if (exitCode !== 0 && !this._forceExited) { - this.initialize(); - - if (this._request) { - this._worker.postMessage(this._request); - } - } else { - this._shutdown(); - } - } - - waitForExit() { - return this._exitPromise; - } - - forceExit() { - this._forceExited = true; - - this._worker.terminate(); - } - - send(request, onProcessStart, onProcessEnd, onCustomMessage) { - onProcessStart(this); - - this._onProcessEnd = (...args) => { - var _onProcessEnd; - - // Clean the request to avoid sending past requests to workers that fail - // while waiting for a new request (timers, unhandled rejections...) - this._request = null; - const res = - (_onProcessEnd = onProcessEnd) === null || _onProcessEnd === void 0 - ? void 0 - : _onProcessEnd(...args); // Clean up the reference so related closures can be garbage collected. - - onProcessEnd = null; - return res; - }; - - this._onCustomMessage = (...arg) => onCustomMessage(...arg); - - this._request = request; - this._retries = 0; - - this._worker.postMessage(request); - } - - getWorkerId() { - return this._options.workerId; - } - - getStdout() { - return this._stdout; - } - - getStderr() { - return this._stderr; - } - - _getFakeStream() { - if (!this._fakeStream) { - this._fakeStream = new (_stream().PassThrough)(); - } - - return this._fakeStream; - } -} - -exports.default = ExperimentalWorker; diff --git a/node_modules/jest-worker/build/workers/messageParent.d.ts b/node_modules/jest-worker/build/workers/messageParent.d.ts deleted file mode 100644 index 795bb35..0000000 --- a/node_modules/jest-worker/build/workers/messageParent.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -export default function messageParent(message: unknown, parentProcess?: NodeJS.Process): void; diff --git a/node_modules/jest-worker/build/workers/messageParent.js b/node_modules/jest-worker/build/workers/messageParent.js deleted file mode 100644 index 51765ff..0000000 --- a/node_modules/jest-worker/build/workers/messageParent.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = messageParent; - -var _types = require('../types'); - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -const isWorkerThread = (() => { - try { - // `Require` here to support Node v10 - const {isMainThread, parentPort} = require('worker_threads'); - - return !isMainThread && parentPort != null; - } catch { - return false; - } -})(); - -function messageParent(message, parentProcess = process) { - if (isWorkerThread) { - // `Require` here to support Node v10 - const {parentPort} = require('worker_threads'); // ! is safe due to `null` check in `isWorkerThread` - - parentPort.postMessage([_types.PARENT_MESSAGE_CUSTOM, message]); - } else if (typeof parentProcess.send === 'function') { - parentProcess.send([_types.PARENT_MESSAGE_CUSTOM, message]); - } else { - throw new Error('"messageParent" can only be used inside a worker'); - } -} diff --git a/node_modules/jest-worker/build/workers/processChild.d.ts b/node_modules/jest-worker/build/workers/processChild.d.ts deleted file mode 100644 index fac0c7e..0000000 --- a/node_modules/jest-worker/build/workers/processChild.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export {}; diff --git a/node_modules/jest-worker/build/workers/processChild.js b/node_modules/jest-worker/build/workers/processChild.js deleted file mode 100644 index fdf766e..0000000 --- a/node_modules/jest-worker/build/workers/processChild.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict'; - -var _types = require('../types'); - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -let file = null; -let setupArgs = []; -let initialized = false; -/** - * This file is a small bootstrapper for workers. It sets up the communication - * between the worker and the parent process, interpreting parent messages and - * sending results back. - * - * The file loaded will be lazily initialized the first time any of the workers - * is called. This is done for optimal performance: if the farm is initialized, - * but no call is made to it, child Node processes will be consuming the least - * possible amount of memory. - * - * If an invalid message is detected, the child will exit (by throwing) with a - * non-zero exit code. - */ - -const messageListener = request => { - switch (request[0]) { - case _types.CHILD_MESSAGE_INITIALIZE: - const init = request; - file = init[2]; - setupArgs = request[3]; - break; - - case _types.CHILD_MESSAGE_CALL: - const call = request; - execMethod(call[2], call[3]); - break; - - case _types.CHILD_MESSAGE_END: - end(); - break; - - default: - throw new TypeError( - 'Unexpected request from parent process: ' + request[0] - ); - } -}; - -process.on('message', messageListener); - -function reportSuccess(result) { - if (!process || !process.send) { - throw new Error('Child can only be used on a forked process'); - } - - process.send([_types.PARENT_MESSAGE_OK, result]); -} - -function reportClientError(error) { - return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR); -} - -function reportInitializeError(error) { - return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR); -} - -function reportError(error, type) { - if (!process || !process.send) { - throw new Error('Child can only be used on a forked process'); - } - - if (error == null) { - error = new Error('"null" or "undefined" thrown'); - } - - process.send([ - type, - error.constructor && error.constructor.name, - error.message, - error.stack, - typeof error === 'object' ? {...error} : error - ]); -} - -function end() { - const main = require(file); - - if (!main.teardown) { - exitProcess(); - return; - } - - execFunction(main.teardown, main, [], exitProcess, exitProcess); -} - -function exitProcess() { - // Clean up open handles so the process ideally exits gracefully - process.removeListener('message', messageListener); -} - -function execMethod(method, args) { - const main = require(file); - - let fn; - - if (method === 'default') { - fn = main.__esModule ? main['default'] : main; - } else { - fn = main[method]; - } - - function execHelper() { - execFunction(fn, main, args, reportSuccess, reportClientError); - } - - if (initialized || !main.setup) { - execHelper(); - return; - } - - initialized = true; - execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError); -} - -const isPromise = obj => - !!obj && - (typeof obj === 'object' || typeof obj === 'function') && - typeof obj.then === 'function'; - -function execFunction(fn, ctx, args, onResult, onError) { - let result; - - try { - result = fn.apply(ctx, args); - } catch (err) { - onError(err); - return; - } - - if (isPromise(result)) { - result.then(onResult, onError); - } else { - onResult(result); - } -} diff --git a/node_modules/jest-worker/build/workers/threadChild.d.ts b/node_modules/jest-worker/build/workers/threadChild.d.ts deleted file mode 100644 index fac0c7e..0000000 --- a/node_modules/jest-worker/build/workers/threadChild.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export {}; diff --git a/node_modules/jest-worker/build/workers/threadChild.js b/node_modules/jest-worker/build/workers/threadChild.js deleted file mode 100644 index dae1e64..0000000 --- a/node_modules/jest-worker/build/workers/threadChild.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -function _worker_threads() { - const data = require('worker_threads'); - - _worker_threads = function () { - return data; - }; - - return data; -} - -var _types = require('../types'); - -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -let file = null; -let setupArgs = []; -let initialized = false; -/** - * This file is a small bootstrapper for workers. It sets up the communication - * between the worker and the parent process, interpreting parent messages and - * sending results back. - * - * The file loaded will be lazily initialized the first time any of the workers - * is called. This is done for optimal performance: if the farm is initialized, - * but no call is made to it, child Node processes will be consuming the least - * possible amount of memory. - * - * If an invalid message is detected, the child will exit (by throwing) with a - * non-zero exit code. - */ - -const messageListener = request => { - switch (request[0]) { - case _types.CHILD_MESSAGE_INITIALIZE: - const init = request; - file = init[2]; - setupArgs = request[3]; - process.env.JEST_WORKER_ID = request[4]; - break; - - case _types.CHILD_MESSAGE_CALL: - const call = request; - execMethod(call[2], call[3]); - break; - - case _types.CHILD_MESSAGE_END: - end(); - break; - - default: - throw new TypeError( - 'Unexpected request from parent process: ' + request[0] - ); - } -}; - -_worker_threads().parentPort.on('message', messageListener); - -function reportSuccess(result) { - if (_worker_threads().isMainThread) { - throw new Error('Child can only be used on a forked process'); - } - - _worker_threads().parentPort.postMessage([_types.PARENT_MESSAGE_OK, result]); -} - -function reportClientError(error) { - return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR); -} - -function reportInitializeError(error) { - return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR); -} - -function reportError(error, type) { - if (_worker_threads().isMainThread) { - throw new Error('Child can only be used on a forked process'); - } - - if (error == null) { - error = new Error('"null" or "undefined" thrown'); - } - - _worker_threads().parentPort.postMessage([ - type, - error.constructor && error.constructor.name, - error.message, - error.stack, - typeof error === 'object' ? {...error} : error - ]); -} - -function end() { - const main = require(file); - - if (!main.teardown) { - exitProcess(); - return; - } - - execFunction(main.teardown, main, [], exitProcess, exitProcess); -} - -function exitProcess() { - // Clean up open handles so the worker ideally exits gracefully - _worker_threads().parentPort.removeListener('message', messageListener); -} - -function execMethod(method, args) { - const main = require(file); - - let fn; - - if (method === 'default') { - fn = main.__esModule ? main['default'] : main; - } else { - fn = main[method]; - } - - function execHelper() { - execFunction(fn, main, args, reportSuccess, reportClientError); - } - - if (initialized || !main.setup) { - execHelper(); - return; - } - - initialized = true; - execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError); -} - -const isPromise = obj => - !!obj && - (typeof obj === 'object' || typeof obj === 'function') && - typeof obj.then === 'function'; - -function execFunction(fn, ctx, args, onResult, onError) { - let result; - - try { - result = fn.apply(ctx, args); - } catch (err) { - onError(err); - return; - } - - if (isPromise(result)) { - result.then(onResult, onError); - } else { - onResult(result); - } -} diff --git a/node_modules/jest-worker/package.json b/node_modules/jest-worker/package.json deleted file mode 100644 index 06280d1..0000000 --- a/node_modules/jest-worker/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "jest-worker", - "version": "27.5.1", - "repository": { - "type": "git", - "url": "https://github.com/facebook/jest.git", - "directory": "packages/jest-worker" - }, - "license": "MIT", - "main": "./build/index.js", - "types": "./build/index.d.ts", - "exports": { - ".": { - "types": "./build/index.d.ts", - "default": "./build/index.js" - }, - "./package.json": "./package.json" - }, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "devDependencies": { - "@types/merge-stream": "^1.1.2", - "@types/supports-color": "^8.1.0", - "get-stream": "^6.0.0", - "jest-leak-detector": "^27.5.1", - "worker-farm": "^1.6.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "publishConfig": { - "access": "public" - }, - "gitHead": "67c1aa20c5fec31366d733e901fee2b981cb1850" -} diff --git a/node_modules/json-parse-even-better-errors/CHANGELOG.md b/node_modules/json-parse-even-better-errors/CHANGELOG.md deleted file mode 100644 index dfd6733..0000000 --- a/node_modules/json-parse-even-better-errors/CHANGELOG.md +++ /dev/null @@ -1,50 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -## 2.0.0 - -* Add custom error classes - - -## [1.0.2](https://github.com/npm/json-parse-even-better-errors/compare/v1.0.1...v1.0.2) (2018-03-30) - - -### Bug Fixes - -* **messages:** More friendly messages for non-string ([#1](https://github.com/npm/json-parse-even-better-errors/issues/1)) ([a476d42](https://github.com/npm/json-parse-even-better-errors/commit/a476d42)) - - - - -## [1.0.1](https://github.com/npm/json-parse-even-better-errors/compare/v1.0.0...v1.0.1) (2017-08-16) - - -### Bug Fixes - -* **license:** oops. Forgot to update license.md ([efe2958](https://github.com/npm/json-parse-even-better-errors/commit/efe2958)) - - - - -# 1.0.0 (2017-08-15) - - -### Features - -* **init:** Initial Commit ([562c977](https://github.com/npm/json-parse-even-better-errors/commit/562c977)) - - -### BREAKING CHANGES - -* **init:** This is the first commit! - - - - -# 0.1.0 (2017-08-15) - - -### Features - -* **init:** Initial Commit ([9dd1a19](https://github.com/npm/json-parse-even-better-errors/commit/9dd1a19)) diff --git a/node_modules/json-parse-even-better-errors/LICENSE.md b/node_modules/json-parse-even-better-errors/LICENSE.md deleted file mode 100644 index 6991b7c..0000000 --- a/node_modules/json-parse-even-better-errors/LICENSE.md +++ /dev/null @@ -1,25 +0,0 @@ -Copyright 2017 Kat Marchán -Copyright npm, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - ---- - -This library is a fork of 'better-json-errors' by Kat Marchán, extended and -distributed under the terms of the MIT license above. diff --git a/node_modules/json-parse-even-better-errors/README.md b/node_modules/json-parse-even-better-errors/README.md deleted file mode 100644 index 2799efe..0000000 --- a/node_modules/json-parse-even-better-errors/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# json-parse-even-better-errors - -[`json-parse-even-better-errors`](https://github.com/npm/json-parse-even-better-errors) -is a Node.js library for getting nicer errors out of `JSON.parse()`, -including context and position of the parse errors. - -It also preserves the newline and indentation styles of the JSON data, by -putting them in the object or array in the `Symbol.for('indent')` and -`Symbol.for('newline')` properties. - -## Install - -`$ npm install --save json-parse-even-better-errors` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Contributing](#contributing) -* [API](#api) - * [`parse`](#parse) - -### Example - -```javascript -const parseJson = require('json-parse-even-better-errors') - -parseJson('"foo"') // returns the string 'foo' -parseJson('garbage') // more useful error message -parseJson.noExceptions('garbage') // returns undefined -``` - -### Features - -* Like JSON.parse, but the errors are better. -* Strips a leading byte-order-mark that you sometimes get reading files. -* Has a `noExceptions` method that returns undefined rather than throwing. -* Attaches the newline character(s) used to the `Symbol.for('newline')` - property on objects and arrays. -* Attaches the indentation character(s) used to the `Symbol.for('indent')` - property on objects and arrays. - -## Indentation - -To preserve indentation when the file is saved back to disk, use -`data[Symbol.for('indent')]` as the third argument to `JSON.stringify`, and -if you want to preserve windows `\r\n` newlines, replace the `\n` chars in -the string with `data[Symbol.for('newline')]`. - -For example: - -```js -const txt = await readFile('./package.json', 'utf8') -const data = parseJsonEvenBetterErrors(txt) -const indent = Symbol.for('indent') -const newline = Symbol.for('newline') -// .. do some stuff to the data .. -const string = JSON.stringify(data, null, data[indent]) + '\n' -const eolFixed = data[newline] === '\n' ? string - : string.replace(/\n/g, data[newline]) -await writeFile('./package.json', eolFixed) -``` - -Indentation is determined by looking at the whitespace between the initial -`{` and `[` and the character that follows it. If you have lots of weird -inconsistent indentation, then it won't track that or give you any way to -preserve it. Whether this is a bug or a feature is debatable ;) - -### API - -#### `parse(txt, reviver = null, context = 20)` - -Works just like `JSON.parse`, but will include a bit more information when -an error happens, and attaches a `Symbol.for('indent')` and -`Symbol.for('newline')` on objects and arrays. This throws a -`JSONParseError`. - -#### `parse.noExceptions(txt, reviver = null)` - -Works just like `JSON.parse`, but will return `undefined` rather than -throwing an error. - -#### `class JSONParseError(er, text, context = 20, caller = null)` - -Extends the JavaScript `SyntaxError` class to parse the message and provide -better metadata. - -Pass in the error thrown by the built-in `JSON.parse`, and the text being -parsed, and it'll parse out the bits needed to be helpful. - -`context` defaults to 20. - -Set a `caller` function to trim internal implementation details out of the -stack trace. When calling `parseJson`, this is set to the `parseJson` -function. If not set, then the constructor defaults to itself, so the -stack trace will point to the spot where you call `new JSONParseError`. diff --git a/node_modules/json-parse-even-better-errors/index.js b/node_modules/json-parse-even-better-errors/index.js deleted file mode 100644 index 86a1fdc..0000000 --- a/node_modules/json-parse-even-better-errors/index.js +++ /dev/null @@ -1,121 +0,0 @@ -'use strict' - -const hexify = char => { - const h = char.charCodeAt(0).toString(16).toUpperCase() - return '0x' + (h.length % 2 ? '0' : '') + h -} - -const parseError = (e, txt, context) => { - if (!txt) { - return { - message: e.message + ' while parsing empty string', - position: 0, - } - } - const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i) - const errIdx = badToken ? +badToken[2] - : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 - : null - - const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${ - JSON.stringify(badToken[1]) - } (${hexify(badToken[1])})`) - : e.message - - if (errIdx !== null && errIdx !== undefined) { - const start = errIdx <= context ? 0 - : errIdx - context - - const end = errIdx + context >= txt.length ? txt.length - : errIdx + context - - const slice = (start === 0 ? '' : '...') + - txt.slice(start, end) + - (end === txt.length ? '' : '...') - - const near = txt === slice ? '' : 'near ' - - return { - message: msg + ` while parsing ${near}${JSON.stringify(slice)}`, - position: errIdx, - } - } else { - return { - message: msg + ` while parsing '${txt.slice(0, context * 2)}'`, - position: 0, - } - } -} - -class JSONParseError extends SyntaxError { - constructor (er, txt, context, caller) { - context = context || 20 - const metadata = parseError(er, txt, context) - super(metadata.message) - Object.assign(this, metadata) - this.code = 'EJSONPARSE' - this.systemError = er - Error.captureStackTrace(this, caller || this.constructor) - } - get name () { return this.constructor.name } - set name (n) {} - get [Symbol.toStringTag] () { return this.constructor.name } -} - -const kIndent = Symbol.for('indent') -const kNewline = Symbol.for('newline') -// only respect indentation if we got a line break, otherwise squash it -// things other than objects and arrays aren't indented, so ignore those -// Important: in both of these regexps, the $1 capture group is the newline -// or undefined, and the $2 capture group is the indent, or undefined. -const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/ -const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ - -const parseJson = (txt, reviver, context) => { - const parseText = stripBOM(txt) - context = context || 20 - try { - // get the indentation so that we can save it back nicely - // if the file starts with {" then we have an indent of '', ie, none - // otherwise, pick the indentation of the next line after the first \n - // If the pattern doesn't match, then it means no indentation. - // JSON.stringify ignores symbols, so this is reasonably safe. - // if the string is '{}' or '[]', then use the default 2-space indent. - const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || - parseText.match(formatRE) || - [, '', ''] - - const result = JSON.parse(parseText, reviver) - if (result && typeof result === 'object') { - result[kNewline] = newline - result[kIndent] = indent - } - return result - } catch (e) { - if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) { - const isEmptyArray = Array.isArray(txt) && txt.length === 0 - throw Object.assign(new TypeError( - `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}` - ), { - code: 'EJSONPARSE', - systemError: e, - }) - } - - throw new JSONParseError(e, parseText, context, parseJson) - } -} - -// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) -// because the buffer-to-string conversion in `fs.readFileSync()` -// translates it to FEFF, the UTF-16 BOM. -const stripBOM = txt => String(txt).replace(/^\uFEFF/, '') - -module.exports = parseJson -parseJson.JSONParseError = JSONParseError - -parseJson.noExceptions = (txt, reviver) => { - try { - return JSON.parse(stripBOM(txt), reviver) - } catch (e) {} -} diff --git a/node_modules/json-parse-even-better-errors/package.json b/node_modules/json-parse-even-better-errors/package.json deleted file mode 100644 index ed0fdaf..0000000 --- a/node_modules/json-parse-even-better-errors/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "json-parse-even-better-errors", - "version": "2.3.1", - "description": "JSON.parse with context information on error", - "main": "index.js", - "files": [ - "*.js" - ], - "scripts": { - "preversion": "npm t", - "postversion": "npm publish", - "prepublishOnly": "git push --follow-tags", - "test": "tap", - "snap": "tap" - }, - "repository": "https://github.com/npm/json-parse-even-better-errors", - "keywords": [ - "JSON", - "parser" - ], - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech", - "twitter": "maybekatz" - }, - "license": "MIT", - "devDependencies": { - "tap": "^14.6.5" - }, - "tap": { - "check-coverage": true - } -} diff --git a/node_modules/json-schema-traverse/.eslintrc.yml b/node_modules/json-schema-traverse/.eslintrc.yml deleted file mode 100644 index ab1762d..0000000 --- a/node_modules/json-schema-traverse/.eslintrc.yml +++ /dev/null @@ -1,27 +0,0 @@ -extends: eslint:recommended -env: - node: true - browser: true -rules: - block-scoped-var: 2 - complexity: [2, 13] - curly: [2, multi-or-nest, consistent] - dot-location: [2, property] - dot-notation: 2 - indent: [2, 2, SwitchCase: 1] - linebreak-style: [2, unix] - new-cap: 2 - no-console: [2, allow: [warn, error]] - no-else-return: 2 - no-eq-null: 2 - no-fallthrough: 2 - no-invalid-this: 2 - no-return-assign: 2 - no-shadow: 1 - no-trailing-spaces: 2 - no-use-before-define: [2, nofunc] - quotes: [2, single, avoid-escape] - semi: [2, always] - strict: [2, global] - valid-jsdoc: [2, requireReturn: false] - no-control-regex: 0 diff --git a/node_modules/json-schema-traverse/.travis.yml b/node_modules/json-schema-traverse/.travis.yml deleted file mode 100644 index 7ddce74..0000000 --- a/node_modules/json-schema-traverse/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "4" - - "6" - - "7" - - "8" -after_script: - - coveralls < coverage/lcov.info diff --git a/node_modules/json-schema-traverse/LICENSE b/node_modules/json-schema-traverse/LICENSE deleted file mode 100644 index 7f15435..0000000 --- a/node_modules/json-schema-traverse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/json-schema-traverse/README.md b/node_modules/json-schema-traverse/README.md deleted file mode 100644 index d5ccaf4..0000000 --- a/node_modules/json-schema-traverse/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# json-schema-traverse -Traverse JSON Schema passing each schema object to callback - -[![Build Status](https://travis-ci.org/epoberezkin/json-schema-traverse.svg?branch=master)](https://travis-ci.org/epoberezkin/json-schema-traverse) -[![npm version](https://badge.fury.io/js/json-schema-traverse.svg)](https://www.npmjs.com/package/json-schema-traverse) -[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) - - -## Install - -``` -npm install json-schema-traverse -``` - - -## Usage - -```javascript -const traverse = require('json-schema-traverse'); -const schema = { - properties: { - foo: {type: 'string'}, - bar: {type: 'integer'} - } -}; - -traverse(schema, {cb}); -// cb is called 3 times with: -// 1. root schema -// 2. {type: 'string'} -// 3. {type: 'integer'} - -// Or: - -traverse(schema, {cb: {pre, post}}); -// pre is called 3 times with: -// 1. root schema -// 2. {type: 'string'} -// 3. {type: 'integer'} -// -// post is called 3 times with: -// 1. {type: 'string'} -// 2. {type: 'integer'} -// 3. root schema - -``` - -Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. - -Callback is passed these parameters: - -- _schema_: the current schema object -- _JSON pointer_: from the root schema to the current schema object -- _root schema_: the schema passed to `traverse` object -- _parent JSON pointer_: from the root schema to the parent schema object (see below) -- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) -- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema -- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` - - -## Traverse objects in all unknown keywords - -```javascript -const traverse = require('json-schema-traverse'); -const schema = { - mySchema: { - minimum: 1, - maximum: 2 - } -}; - -traverse(schema, {allKeys: true, cb}); -// cb is called 2 times with: -// 1. root schema -// 2. mySchema -``` - -Without option `allKeys: true` callback will be called only with root schema. - - -## License - -[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/node_modules/json-schema-traverse/index.js b/node_modules/json-schema-traverse/index.js deleted file mode 100644 index d4a18df..0000000 --- a/node_modules/json-schema-traverse/index.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -var traverse = module.exports = function (schema, opts, cb) { - // Legacy support for v0.3.1 and earlier. - if (typeof opts == 'function') { - cb = opts; - opts = {}; - } - - cb = opts.cb || cb; - var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; - var post = cb.post || function() {}; - - _traverse(opts, pre, post, schema, '', schema); -}; - - -traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true -}; - -traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true -}; - -traverse.propsKeywords = { - definitions: true, - properties: true, - patternProperties: true, - dependencies: true -}; - -traverse.skipKeywords = { - default: true, - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true -}; - - -function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema) { - var sch = schema[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i=0; i65M downloads/week](https://www.npmjs.com/package/json5)**, -ranks in the **[top 0.1%](https://gist.github.com/anvaka/8e8fa57c7ee1350e3491)** of the most depended-upon packages on npm, -and has been adopted by major projects like -**[Chromium](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;drc=5de823b36e68fd99009a29281b17bc3a1d6b329c), -[Next.js](https://github.com/vercel/next.js/blob/b88f20c90bf4659b8ad5cb2a27956005eac2c7e8/packages/next/lib/find-config.ts#L43-L46), -[Babel](https://babeljs.io/docs/en/config-files#supported-file-extensions), -[Retool](https://community.retool.com/t/i-am-attempting-to-append-several-text-fields-to-a-google-sheet-but-receiving-a-json5-invalid-character-error/7626), -[WebStorm](https://www.jetbrains.com/help/webstorm/json.html), -and [more](https://github.com/json5/json5/wiki/In-the-Wild)**. -It's also natively supported on **[Apple platforms](https://developer.apple.com/documentation/foundation/jsondecoder/3766916-allowsjson5)** -like **MacOS** and **iOS**. - -Formally, the **[JSON5 Data Interchange Format](https://spec.json5.org/)** is a superset of JSON -(so valid JSON files will always be valid JSON5 files) -that expands its syntax to include some productions from [ECMAScript 5.1] (ES5). -It's also a strict _subset_ of ES5, so valid JSON5 files will always be valid ES5. - -This JavaScript library is a reference implementation for JSON5 parsing and serialization, -and is directly used in many of the popular projects mentioned above -(where e.g. extreme performance isn't necessary), -but others have created [many other libraries](https://github.com/json5/json5/wiki/In-the-Wild) -across many other platforms. - -[Build Status]: https://app.travis-ci.com/json5/json5 - -[Coverage Status]: https://coveralls.io/github/json5/json5 - -[JSON]: https://tools.ietf.org/html/rfc7159 - -[ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/ - -## Summary of Features -The following ECMAScript 5.1 features, which are not supported in JSON, have -been extended to JSON5. - -### Objects -- Object keys may be an ECMAScript 5.1 _[IdentifierName]_. -- Objects may have a single trailing comma. - -### Arrays -- Arrays may have a single trailing comma. - -### Strings -- Strings may be single quoted. -- Strings may span multiple lines by escaping new line characters. -- Strings may include character escapes. - -### Numbers -- Numbers may be hexadecimal. -- Numbers may have a leading or trailing decimal point. -- Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN. -- Numbers may begin with an explicit plus sign. - -### Comments -- Single and multi-line comments are allowed. - -### White Space -- Additional white space characters are allowed. - -[IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6 - -[IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933 - -## Example -Kitchen-sink example: - -```js -{ - // comments - unquoted: 'and you can quote me on that', - singleQuotes: 'I can use "double quotes" here', - lineBreaks: "Look, Mom! \ -No \\n's!", - hexadecimal: 0xdecaf, - leadingDecimalPoint: .8675309, andTrailing: 8675309., - positiveSign: +1, - trailingComma: 'in objects', andIn: ['arrays',], - "backwardsCompatible": "with JSON", -} -``` - -A more real-world example is [this config file](https://github.com/chromium/chromium/blob/feb3c9f670515edf9a88f185301cbd7794ee3e52/third_party/blink/renderer/platform/runtime_enabled_features.json5) -from the Chromium/Blink project. - -## Specification -For a detailed explanation of the JSON5 format, please read the [official -specification](https://json5.github.io/json5-spec/). - -## Installation and Usage -### Node.js -```sh -npm install json5 -``` - -#### CommonJS -```js -const JSON5 = require('json5') -``` - -#### Modules -```js -import JSON5 from 'json5' -``` - -### Browsers -#### UMD -```html - - -``` - -#### Modules -```html - -``` - -## API -The JSON5 API is compatible with the [JSON API]. - -[JSON API]: -https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON - -### JSON5.parse() -Parses a JSON5 string, constructing the JavaScript value or object described by -the string. An optional reviver function can be provided to perform a -transformation on the resulting object before it is returned. - -#### Syntax - JSON5.parse(text[, reviver]) - -#### Parameters -- `text`: The string to parse as JSON5. -- `reviver`: If a function, this prescribes how the value originally produced by - parsing is transformed, before being returned. - -#### Return value -The object corresponding to the given JSON5 text. - -### JSON5.stringify() -Converts a JavaScript value to a JSON5 string, optionally replacing values if a -replacer function is specified, or optionally including only the specified -properties if a replacer array is specified. - -#### Syntax - JSON5.stringify(value[, replacer[, space]]) - JSON5.stringify(value[, options]) - -#### Parameters -- `value`: The value to convert to a JSON5 string. -- `replacer`: A function that alters the behavior of the stringification - process, or an array of String and Number objects that serve as a whitelist - for selecting/filtering the properties of the value object to be included in - the JSON5 string. If this value is null or not provided, all properties of the - object are included in the resulting JSON5 string. -- `space`: A String or Number object that's used to insert white space into the - output JSON5 string for readability purposes. If this is a Number, it - indicates the number of space characters to use as white space; this number is - capped at 10 (if it is greater, the value is just 10). Values less than 1 - indicate that no space should be used. If this is a String, the string (or the - first 10 characters of the string, if it's longer than that) is used as white - space. If this parameter is not provided (or is null), no white space is used. - If white space is used, trailing commas will be used in objects and arrays. -- `options`: An object with the following properties: - - `replacer`: Same as the `replacer` parameter. - - `space`: Same as the `space` parameter. - - `quote`: A String representing the quote character to use when serializing - strings. - -#### Return value -A JSON5 string representing the value. - -### Node.js `require()` JSON5 files -When using Node.js, you can `require()` JSON5 files by adding the following -statement. - -```js -require('json5/lib/register') -``` - -Then you can load a JSON5 file with a Node.js `require()` statement. For -example: - -```js -const config = require('./config.json5') -``` - -## CLI -Since JSON is more widely used than JSON5, this package includes a CLI for -converting JSON5 to JSON and for validating the syntax of JSON5 documents. - -### Installation -```sh -npm install --global json5 -``` - -### Usage -```sh -json5 [options] -``` - -If `` is not provided, then STDIN is used. - -#### Options: -- `-s`, `--space`: The number of spaces to indent or `t` for tabs -- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT -- `-v`, `--validate`: Validate JSON5 but do not output JSON -- `-V`, `--version`: Output the version number -- `-h`, `--help`: Output usage information - -## Contributing -### Development -```sh -git clone https://github.com/json5/json5 -cd json5 -npm install -``` - -When contributing code, please write relevant tests and run `npm test` and `npm -run lint` before submitting pull requests. Please use an editor that supports -[EditorConfig](http://editorconfig.org/). - -### Issues -To report bugs or request features regarding the JSON5 **data format**, -please submit an issue to the official -**[_specification_ repository](https://github.com/json5/json5-spec)**. - -Note that we will never add any features that make JSON5 incompatible with ES5; -that compatibility is a fundamental premise of JSON5. - -To report bugs or request features regarding this **JavaScript implementation** -of JSON5, please submit an issue to **_this_ repository**. - -### Security Vulnerabilities and Disclosures -To report a security vulnerability, please follow the follow the guidelines -described in our [security policy](./SECURITY.md). - -## License -MIT. See [LICENSE.md](./LICENSE.md) for details. - -## Credits -[Aseem Kishore](https://github.com/aseemk) founded this project. -He wrote a [blog post](https://aseemk.substack.com/p/ignore-the-f-ing-haters-json5) -about the journey and lessons learned 10 years in. - -[Michael Bolin](http://bolinfest.com/) independently arrived at and published -some of these same ideas with awesome explanations and detail. Recommended -reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) - -[Douglas Crockford](http://www.crockford.com/) of course designed and built -JSON, but his state machine diagrams on the [JSON website](http://json.org/), as -cheesy as it may sound, gave us motivation and confidence that building a new -parser to implement these ideas was within reach! The original -implementation of JSON5 was also modeled directly off of Doug’s open-source -[json_parse.js] parser. We’re grateful for that clean and well-documented -code. - -[json_parse.js]: -https://github.com/douglascrockford/JSON-js/blob/03157639c7a7cddd2e9f032537f346f1a87c0f6d/json_parse.js - -[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific -supporter, contributing multiple patches and ideas. - -[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original -`stringify` method. - -[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely -with ES5, wrote the official JSON5 specification, completely rewrote the -codebase from the ground up, and is actively maintaining this project. diff --git a/node_modules/json5/dist/index.js b/node_modules/json5/dist/index.js deleted file mode 100644 index bf86533..0000000 --- a/node_modules/json5/dist/index.js +++ /dev/null @@ -1,1737 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.JSON5 = factory()); -}(this, (function () { 'use strict'; - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var _global = createCommonjsModule(function (module) { - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); - if (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef - }); - - var _core = createCommonjsModule(function (module) { - var core = module.exports = { version: '2.6.5' }; - if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef - }); - var _core_1 = _core.version; - - var _isObject = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - - var _anObject = function (it) { - if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); } - return it; - }; - - var _fails = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } - }; - - // Thank's IE8 for his funny defineProperty - var _descriptors = !_fails(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; - }); - - var document = _global.document; - // typeof document.createElement is 'object' in old IE - var is = _isObject(document) && _isObject(document.createElement); - var _domCreate = function (it) { - return is ? document.createElement(it) : {}; - }; - - var _ie8DomDefine = !_descriptors && !_fails(function () { - return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; - }); - - // 7.1.1 ToPrimitive(input [, PreferredType]) - - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - var _toPrimitive = function (it, S) { - if (!_isObject(it)) { return it; } - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } - if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; } - if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } - throw TypeError("Can't convert object to primitive value"); - }; - - var dP = Object.defineProperty; - - var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { - _anObject(O); - P = _toPrimitive(P, true); - _anObject(Attributes); - if (_ie8DomDefine) { try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } } - if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); } - if ('value' in Attributes) { O[P] = Attributes.value; } - return O; - }; - - var _objectDp = { - f: f - }; - - var _propertyDesc = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; - }; - - var _hide = _descriptors ? function (object, key, value) { - return _objectDp.f(object, key, _propertyDesc(1, value)); - } : function (object, key, value) { - object[key] = value; - return object; - }; - - var hasOwnProperty = {}.hasOwnProperty; - var _has = function (it, key) { - return hasOwnProperty.call(it, key); - }; - - var id = 0; - var px = Math.random(); - var _uid = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); - }; - - var _library = false; - - var _shared = createCommonjsModule(function (module) { - var SHARED = '__core-js_shared__'; - var store = _global[SHARED] || (_global[SHARED] = {}); - - (module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); - })('versions', []).push({ - version: _core.version, - mode: _library ? 'pure' : 'global', - copyright: '© 2019 Denis Pushkarev (zloirock.ru)' - }); - }); - - var _functionToString = _shared('native-function-to-string', Function.toString); - - var _redefine = createCommonjsModule(function (module) { - var SRC = _uid('src'); - - var TO_STRING = 'toString'; - var TPL = ('' + _functionToString).split(TO_STRING); - - _core.inspectSource = function (it) { - return _functionToString.call(it); - }; - - (module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); } - if (O[key] === val) { return; } - if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); } - if (O === _global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - _hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - _hide(O, key, val); - } - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - })(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || _functionToString.call(this); - }); - }); - - var _aFunction = function (it) { - if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); } - return it; - }; - - // optional / simple context binding - - var _ctx = function (fn, that, length) { - _aFunction(fn); - if (that === undefined) { return fn; } - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; - }; - - var PROTOTYPE = 'prototype'; - - var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) { source = name; } - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; - // extend global - if (target) { _redefine(target, key, out, type & $export.U); } - // export - if (exports[key] != out) { _hide(exports, key, exp); } - if (IS_PROTO && expProto[key] != out) { expProto[key] = out; } - } - }; - _global.core = _core; - // type bitmap - $export.F = 1; // forced - $export.G = 2; // global - $export.S = 4; // static - $export.P = 8; // proto - $export.B = 16; // bind - $export.W = 32; // wrap - $export.U = 64; // safe - $export.R = 128; // real proto method for `library` - var _export = $export; - - // 7.1.4 ToInteger - var ceil = Math.ceil; - var floor = Math.floor; - var _toInteger = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); - }; - - // 7.2.1 RequireObjectCoercible(argument) - var _defined = function (it) { - if (it == undefined) { throw TypeError("Can't call method on " + it); } - return it; - }; - - // true -> String#at - // false -> String#codePointAt - var _stringAt = function (TO_STRING) { - return function (that, pos) { - var s = String(_defined(that)); - var i = _toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; } - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; - }; - - var $at = _stringAt(false); - _export(_export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } - }); - - var codePointAt = _core.String.codePointAt; - - var max = Math.max; - var min = Math.min; - var _toAbsoluteIndex = function (index, length) { - index = _toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); - }; - - var fromCharCode = String.fromCharCode; - var $fromCodePoint = String.fromCodePoint; - - // length should be 1, old FF problem - _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { - var arguments$1 = arguments; - // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments$1[i++]; - if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); } - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } - }); - - var fromCodePoint = _core.String.fromCodePoint; - - // This is a generated file. Do not edit. - var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; - var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7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72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; - var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\u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\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\u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\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; - - var unicode = { - Space_Separator: Space_Separator, - ID_Start: ID_Start, - ID_Continue: ID_Continue - }; - - var util = { - isSpaceSeparator: function isSpaceSeparator (c) { - return typeof c === 'string' && unicode.Space_Separator.test(c) - }, - - isIdStartChar: function isIdStartChar (c) { - return typeof c === 'string' && ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar: function isIdContinueChar (c) { - return typeof c === 'string' && ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit: function isDigit (c) { - return typeof c === 'string' && /[0-9]/.test(c) - }, - - isHexDigit: function isHexDigit (c) { - return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) - }, - }; - - var source; - var parseState; - var stack; - var pos; - var line; - var column; - var token; - var key; - var root; - - var parse = function parse (text, reviver) { - source = String(text); - parseState = 'start'; - stack = []; - pos = 0; - line = 1; - column = 0; - token = undefined; - key = undefined; - root = undefined; - - do { - token = lex(); - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState](); - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root - }; - - function internalize (holder, name, reviver) { - var value = holder[name]; - if (value != null && typeof value === 'object') { - if (Array.isArray(value)) { - for (var i = 0; i < value.length; i++) { - var key = String(i); - var replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - Object.defineProperty(value, key, { - value: replacement, - writable: true, - enumerable: true, - configurable: true, - }); - } - } - } else { - for (var key$1 in value) { - var replacement$1 = internalize(value, key$1, reviver); - if (replacement$1 === undefined) { - delete value[key$1]; - } else { - Object.defineProperty(value, key$1, { - value: replacement$1, - writable: true, - enumerable: true, - configurable: true, - }); - } - } - } - } - - return reviver.call(holder, name, value) - } - - var lexState; - var buffer; - var doubleQuote; - var sign; - var c; - - function lex () { - lexState = 'default'; - buffer = ''; - doubleQuote = false; - sign = 1; - - for (;;) { - c = peek(); - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - var token = lexStates[lexState](); - if (token) { - return token - } - } - } - - function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } - } - - function read () { - var c = peek(); - - if (c === '\n') { - line++; - column = 0; - } else if (c) { - column += c.length; - } else { - column++; - } - - if (c) { - pos += c.length; - } - - return c - } - - var lexStates = { - default: function default$1 () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - return - - case '/': - read(); - lexState = 'comment'; - return - - case undefined: - read(); - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read(); - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment: function comment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineComment'; - return - - case '/': - read(); - lexState = 'singleLineComment'; - return - } - - throw invalidChar(read()) - }, - - multiLineComment: function multiLineComment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineCommentAsterisk'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - }, - - multiLineCommentAsterisk: function multiLineCommentAsterisk () { - switch (c) { - case '*': - read(); - return - - case '/': - read(); - lexState = 'default'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - lexState = 'multiLineComment'; - }, - - singleLineComment: function singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - lexState = 'default'; - return - - case undefined: - read(); - return newToken('eof') - } - - read(); - }, - - value: function value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read(); - literal('ull'); - return newToken('null', null) - - case 't': - read(); - literal('rue'); - return newToken('boolean', true) - - case 'f': - read(); - literal('alse'); - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1; - } - - lexState = 'sign'; - return - - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"'); - buffer = ''; - lexState = 'string'; - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape: function identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - var u = unicodeEscape(); - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - identifierName: function identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read(); - return - - case '\\': - read(); - lexState = 'identifierNameEscape'; - return - } - - if (util.isIdContinueChar(c)) { - buffer += read(); - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape: function identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - var u = unicodeEscape(); - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - sign: function sign$1 () { - switch (c) { - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', sign * Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero: function zero () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - - case 'x': - case 'X': - buffer += read(); - lexState = 'hexadecimal'; - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger: function decimalInteger () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading: function decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - throw invalidChar(read()) - }, - - decimalPoint: function decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction: function decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent: function decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read(); - lexState = 'decimalExponentSign'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign: function decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger: function decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal: function hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read(); - lexState = 'hexadecimalInteger'; - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger: function hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string: function string () { - switch (c) { - case '\\': - read(); - buffer += escape(); - return - - case '"': - if (doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case "'": - if (!doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c); - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read(); - }, - - start: function start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value'; - }, - - beforePropertyName: function beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read(); - lexState = 'identifierName'; - return - - case '\\': - read(); - lexState = 'identifierNameStartEscape'; - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"'); - lexState = 'string'; - return - } - - if (util.isIdStartChar(c)) { - buffer += read(); - lexState = 'identifierName'; - return - } - - throw invalidChar(read()) - }, - - afterPropertyName: function afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue: function beforePropertyValue () { - lexState = 'value'; - }, - - afterPropertyValue: function afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue: function beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value'; - }, - - afterArrayValue: function afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end: function end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, - }; - - function newToken (type, value) { - return { - type: type, - value: value, - line: line, - column: column, - } - } - - function literal (s) { - for (var i = 0, list = s; i < list.length; i += 1) { - var c = list[i]; - - var p = peek(); - - if (p !== c) { - throw invalidChar(read()) - } - - read(); - } - } - - function escape () { - var c = peek(); - switch (c) { - case 'b': - read(); - return '\b' - - case 'f': - read(); - return '\f' - - case 'n': - read(); - return '\n' - - case 'r': - read(); - return '\r' - - case 't': - read(); - return '\t' - - case 'v': - read(); - return '\v' - - case '0': - read(); - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read(); - return hexEscape() - - case 'u': - read(); - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read(); - return '' - - case '\r': - read(); - if (peek() === '\n') { - read(); - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() - } - - function hexEscape () { - var buffer = ''; - var c = peek(); - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - return String.fromCodePoint(parseInt(buffer, 16)) - } - - function unicodeEscape () { - var buffer = ''; - var count = 4; - - while (count-- > 0) { - var c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - } - - return String.fromCodePoint(parseInt(buffer, 16)) - } - - var parseStates = { - start: function start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforePropertyName: function beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value; - parseState = 'afterPropertyName'; - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop(); - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName: function afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue'; - }, - - beforePropertyValue: function beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforeArrayValue: function beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop(); - return - } - - push(); - }, - - afterPropertyValue: function afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName'; - return - - case '}': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue: function afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue'; - return - - case ']': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end: function end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, - }; - - function push () { - var value; - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {}; - break - - case '[': - value = []; - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value; - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value; - } else { - var parent = stack[stack.length - 1]; - if (Array.isArray(parent)) { - parent.push(value); - } else { - Object.defineProperty(parent, key, { - value: value, - writable: true, - enumerable: true, - configurable: true, - }); - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value); - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue'; - } else { - parseState = 'beforePropertyName'; - } - } else { - var current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } - } - - function pop () { - stack.pop(); - - var current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } - - // This code is unreachable. - // function invalidParseState () { - // return new Error(`JSON5: invalid parse state '${parseState}'`) - // } - - // This code is unreachable. - // function invalidLexState (state) { - // return new Error(`JSON5: invalid lex state '${state}'`) - // } - - function invalidChar (c) { - if (c === undefined) { - return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) - } - - return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column)) - } - - function invalidEOF () { - return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) - } - - // This code is unreachable. - // function invalidToken () { - // if (token.type === 'eof') { - // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - // } - - // const c = String.fromCodePoint(token.value.codePointAt(0)) - // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) - // } - - function invalidIdentifier () { - column -= 5; - return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column)) - } - - function separatorChar (c) { - console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping")); - } - - function formatChar (c) { - var replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - var hexString = c.charCodeAt(0).toString(16); - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c - } - - function syntaxError (message) { - var err = new SyntaxError(message); - err.lineNumber = line; - err.columnNumber = column; - return err - } - - var stringify = function stringify (value, replacer, space) { - var stack = []; - var indent = ''; - var propertyList; - var replacerFunc; - var gap = ''; - var quote; - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space; - quote = replacer.quote; - replacer = replacer.replacer; - } - - if (typeof replacer === 'function') { - replacerFunc = replacer; - } else if (Array.isArray(replacer)) { - propertyList = []; - for (var i = 0, list = replacer; i < list.length; i += 1) { - var v = list[i]; - - var item = (void 0); - - if (typeof v === 'string') { - item = v; - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v); - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item); - } - } - } - - if (space instanceof Number) { - space = Number(space); - } else if (space instanceof String) { - space = String(space); - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)); - gap = ' '.substr(0, space); - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10); - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - var value = holder[key]; - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key); - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value); - } - - if (value instanceof Number) { - value = Number(value); - } else if (value instanceof String) { - value = String(value); - } else if (value instanceof Boolean) { - value = value.valueOf(); - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - var quotes = { - "'": 0.1, - '"': 0.2, - }; - - var replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - var product = ''; - - for (var i = 0; i < value.length; i++) { - var c = value[i]; - switch (c) { - case "'": - case '"': - quotes[c]++; - product += c; - continue - - case '\0': - if (util.isDigit(value[i + 1])) { - product += '\\x00'; - continue - } - } - - if (replacements[c]) { - product += replacements[c]; - continue - } - - if (c < ' ') { - var hexString = c.charCodeAt(0).toString(16); - product += '\\x' + ('00' + hexString).substring(hexString.length); - continue - } - - product += c; - } - - var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; }); - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - var stepback = indent; - indent = indent + gap; - - var keys = propertyList || Object.keys(value); - var partial = []; - for (var i = 0, list = keys; i < list.length; i += 1) { - var key = list[i]; - - var propertyString = serializeProperty(key, value); - if (propertyString !== undefined) { - var member = serializeKey(key) + ':'; - if (gap !== '') { - member += ' '; - } - member += propertyString; - partial.push(member); - } - } - - var final; - if (partial.length === 0) { - final = '{}'; - } else { - var properties; - if (gap === '') { - properties = partial.join(','); - final = '{' + properties + '}'; - } else { - var separator = ',\n' + indent; - properties = partial.join(separator); - final = '{\n' + indent + properties + ',\n' + stepback + '}'; - } - } - - stack.pop(); - indent = stepback; - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - var firstChar = String.fromCodePoint(key.codePointAt(0)); - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (var i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - var stepback = indent; - indent = indent + gap; - - var partial = []; - for (var i = 0; i < value.length; i++) { - var propertyString = serializeProperty(String(i), value); - partial.push((propertyString !== undefined) ? propertyString : 'null'); - } - - var final; - if (partial.length === 0) { - final = '[]'; - } else { - if (gap === '') { - var properties = partial.join(','); - final = '[' + properties + ']'; - } else { - var separator = ',\n' + indent; - var properties$1 = partial.join(separator); - final = '[\n' + indent + properties$1 + ',\n' + stepback + ']'; - } - } - - stack.pop(); - indent = stepback; - return final - } - }; - - var JSON5 = { - parse: parse, - stringify: stringify, - }; - - var lib = JSON5; - - var es5 = lib; - - return es5; - -}))); diff --git a/node_modules/json5/dist/index.min.js b/node_modules/json5/dist/index.min.js deleted file mode 100644 index ddce3e2..0000000 --- a/node_modules/json5/dist/index.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";function u(u,D){return u(D={exports:{}},D.exports),D.exports}var D=u(function(u){var D=u.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=D)}),e=u(function(u){var D=u.exports={version:"2.6.5"};"number"==typeof __e&&(__e=D)}),r=(e.version,function(u){return"object"==typeof u?null!==u:"function"==typeof u}),t=function(u){if(!r(u))throw TypeError(u+" is not an object!");return u},n=function(u){try{return!!u()}catch(u){return!0}},F=!n(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),C=D.document,A=r(C)&&r(C.createElement),i=!F&&!n(function(){return 7!=Object.defineProperty((u="div",A?C.createElement(u):{}),"a",{get:function(){return 7}}).a;var u}),E=Object.defineProperty,o={f:F?Object.defineProperty:function(u,D,e){if(t(u),D=function(u,D){if(!r(u))return u;var e,t;if(D&&"function"==typeof(e=u.toString)&&!r(t=e.call(u)))return t;if("function"==typeof(e=u.valueOf)&&!r(t=e.call(u)))return t;if(!D&&"function"==typeof(e=u.toString)&&!r(t=e.call(u)))return t;throw TypeError("Can't convert object to primitive value")}(D,!0),t(e),i)try{return E(u,D,e)}catch(u){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(u[D]=e.value),u}},a=F?function(u,D,e){return o.f(u,D,function(u,D){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:D}}(1,e))}:function(u,D,e){return u[D]=e,u},c={}.hasOwnProperty,B=function(u,D){return c.call(u,D)},s=0,f=Math.random(),l=u(function(u){var r=D["__core-js_shared__"]||(D["__core-js_shared__"]={});(u.exports=function(u,D){return r[u]||(r[u]=void 0!==D?D:{})})("versions",[]).push({version:e.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})("native-function-to-string",Function.toString),d=u(function(u){var r,t="Symbol(".concat(void 0===(r="src")?"":r,")_",(++s+f).toString(36)),n=(""+l).split("toString");e.inspectSource=function(u){return l.call(u)},(u.exports=function(u,e,r,F){var C="function"==typeof r;C&&(B(r,"name")||a(r,"name",e)),u[e]!==r&&(C&&(B(r,t)||a(r,t,u[e]?""+u[e]:n.join(String(e)))),u===D?u[e]=r:F?u[e]?u[e]=r:a(u,e,r):(delete u[e],a(u,e,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||l.call(this)})}),v=function(u,D,e){if(function(u){if("function"!=typeof u)throw TypeError(u+" is not a function!")}(u),void 0===D)return u;switch(e){case 1:return function(e){return u.call(D,e)};case 2:return function(e,r){return u.call(D,e,r)};case 3:return function(e,r,t){return u.call(D,e,r,t)}}return function(){return u.apply(D,arguments)}},p=function(u,r,t){var n,F,C,A,i=u&p.F,E=u&p.G,o=u&p.S,c=u&p.P,B=u&p.B,s=E?D:o?D[r]||(D[r]={}):(D[r]||{}).prototype,f=E?e:e[r]||(e[r]={}),l=f.prototype||(f.prototype={});for(n in E&&(t=r),t)C=((F=!i&&s&&void 0!==s[n])?s:t)[n],A=B&&F?v(C,D):c&&"function"==typeof C?v(Function.call,C):C,s&&d(s,n,C,u&p.U),f[n]!=C&&a(f,n,A),c&&l[n]!=C&&(l[n]=C)};D.core=e,p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128;var h,m=p,g=Math.ceil,y=Math.floor,w=function(u){return isNaN(u=+u)?0:(u>0?y:g)(u)},b=(h=!1,function(u,D){var e,r,t=String(function(u){if(null==u)throw TypeError("Can't call method on "+u);return u}(u)),n=w(D),F=t.length;return n<0||n>=F?h?"":void 0:(e=t.charCodeAt(n))<55296||e>56319||n+1===F||(r=t.charCodeAt(n+1))<56320||r>57343?h?t.charAt(n):e:h?t.slice(n,n+2):r-56320+(e-55296<<10)+65536});m(m.P,"String",{codePointAt:function(u){return b(this,u)}});e.String.codePointAt;var S=Math.max,x=Math.min,N=String.fromCharCode,P=String.fromCodePoint;m(m.S+m.F*(!!P&&1!=P.length),"String",{fromCodePoint:function(u){for(var D,e,r,t=arguments,n=[],F=arguments.length,C=0;F>C;){if(D=+t[C++],r=1114111,((e=w(e=D))<0?S(e+r,0):x(e,r))!==D)throw RangeError(D+" is not a valid code point");n.push(D<65536?N(D):N(55296+((D-=65536)>>10),D%1024+56320))}return n.join("")}});e.String.fromCodePoint;var _,O,j,I,V,J,M,k,L,T,z,H,$,R,G={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\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DC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uF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-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC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F4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE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[\uDD00-\uDDEF]/},U={isSpaceSeparator:function(u){return"string"==typeof u&&G.Space_Separator.test(u)},isIdStartChar:function(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||G.ID_Start.test(u))},isIdContinueChar:function(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||G.ID_Continue.test(u))},isDigit:function(u){return"string"==typeof u&&/[0-9]/.test(u)},isHexDigit:function(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};function Z(){for(T="default",z="",H=!1,$=1;;){R=q();var u=X[T]();if(u)return u}}function q(){if(_[I])return String.fromCodePoint(_.codePointAt(I))}function W(){var u=q();return"\n"===u?(V++,J=0):u?J+=u.length:J++,u&&(I+=u.length),u}var X={default:function(){switch(R){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void W();case"/":return W(),void(T="comment");case void 0:return W(),K("eof")}if(!U.isSpaceSeparator(R))return X[O]();W()},comment:function(){switch(R){case"*":return W(),void(T="multiLineComment");case"/":return W(),void(T="singleLineComment")}throw ru(W())},multiLineComment:function(){switch(R){case"*":return W(),void(T="multiLineCommentAsterisk");case void 0:throw ru(W())}W()},multiLineCommentAsterisk:function(){switch(R){case"*":return void W();case"/":return W(),void(T="default");case void 0:throw ru(W())}W(),T="multiLineComment"},singleLineComment:function(){switch(R){case"\n":case"\r":case"\u2028":case"\u2029":return W(),void(T="default");case void 0:return W(),K("eof")}W()},value:function(){switch(R){case"{":case"[":return K("punctuator",W());case"n":return W(),Q("ull"),K("null",null);case"t":return W(),Q("rue"),K("boolean",!0);case"f":return W(),Q("alse"),K("boolean",!1);case"-":case"+":return"-"===W()&&($=-1),void(T="sign");case".":return z=W(),void(T="decimalPointLeading");case"0":return z=W(),void(T="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return z=W(),void(T="decimalInteger");case"I":return W(),Q("nfinity"),K("numeric",1/0);case"N":return W(),Q("aN"),K("numeric",NaN);case'"':case"'":return H='"'===W(),z="",void(T="string")}throw ru(W())},identifierNameStartEscape:function(){if("u"!==R)throw ru(W());W();var u=Y();switch(u){case"$":case"_":break;default:if(!U.isIdStartChar(u))throw nu()}z+=u,T="identifierName"},identifierName:function(){switch(R){case"$":case"_":case"‌":case"‍":return void(z+=W());case"\\":return W(),void(T="identifierNameEscape")}if(!U.isIdContinueChar(R))return K("identifier",z);z+=W()},identifierNameEscape:function(){if("u"!==R)throw ru(W());W();var u=Y();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!U.isIdContinueChar(u))throw nu()}z+=u,T="identifierName"},sign:function(){switch(R){case".":return z=W(),void(T="decimalPointLeading");case"0":return z=W(),void(T="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return z=W(),void(T="decimalInteger");case"I":return W(),Q("nfinity"),K("numeric",$*(1/0));case"N":return W(),Q("aN"),K("numeric",NaN)}throw ru(W())},zero:function(){switch(R){case".":return z+=W(),void(T="decimalPoint");case"e":case"E":return z+=W(),void(T="decimalExponent");case"x":case"X":return z+=W(),void(T="hexadecimal")}return K("numeric",0*$)},decimalInteger:function(){switch(R){case".":return z+=W(),void(T="decimalPoint");case"e":case"E":return z+=W(),void(T="decimalExponent")}if(!U.isDigit(R))return K("numeric",$*Number(z));z+=W()},decimalPointLeading:function(){if(U.isDigit(R))return z+=W(),void(T="decimalFraction");throw ru(W())},decimalPoint:function(){switch(R){case"e":case"E":return z+=W(),void(T="decimalExponent")}return U.isDigit(R)?(z+=W(),void(T="decimalFraction")):K("numeric",$*Number(z))},decimalFraction:function(){switch(R){case"e":case"E":return z+=W(),void(T="decimalExponent")}if(!U.isDigit(R))return K("numeric",$*Number(z));z+=W()},decimalExponent:function(){switch(R){case"+":case"-":return z+=W(),void(T="decimalExponentSign")}if(U.isDigit(R))return z+=W(),void(T="decimalExponentInteger");throw ru(W())},decimalExponentSign:function(){if(U.isDigit(R))return z+=W(),void(T="decimalExponentInteger");throw ru(W())},decimalExponentInteger:function(){if(!U.isDigit(R))return K("numeric",$*Number(z));z+=W()},hexadecimal:function(){if(U.isHexDigit(R))return z+=W(),void(T="hexadecimalInteger");throw ru(W())},hexadecimalInteger:function(){if(!U.isHexDigit(R))return K("numeric",$*Number(z));z+=W()},string:function(){switch(R){case"\\":return W(),void(z+=function(){switch(q()){case"b":return W(),"\b";case"f":return W(),"\f";case"n":return W(),"\n";case"r":return W(),"\r";case"t":return W(),"\t";case"v":return W(),"\v";case"0":if(W(),U.isDigit(q()))throw ru(W());return"\0";case"x":return W(),function(){var u="",D=q();if(!U.isHexDigit(D))throw ru(W());if(u+=W(),D=q(),!U.isHexDigit(D))throw ru(W());return u+=W(),String.fromCodePoint(parseInt(u,16))}();case"u":return W(),Y();case"\n":case"\u2028":case"\u2029":return W(),"";case"\r":return W(),"\n"===q()&&W(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw ru(W())}return W()}());case'"':return H?(W(),K("string",z)):void(z+=W());case"'":return H?void(z+=W()):(W(),K("string",z));case"\n":case"\r":throw ru(W());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+Fu(u)+"' in strings is not valid ECMAScript; consider escaping")}(R);break;case void 0:throw ru(W())}z+=W()},start:function(){switch(R){case"{":case"[":return K("punctuator",W())}T="value"},beforePropertyName:function(){switch(R){case"$":case"_":return z=W(),void(T="identifierName");case"\\":return W(),void(T="identifierNameStartEscape");case"}":return K("punctuator",W());case'"':case"'":return H='"'===W(),void(T="string")}if(U.isIdStartChar(R))return z+=W(),void(T="identifierName");throw ru(W())},afterPropertyName:function(){if(":"===R)return K("punctuator",W());throw ru(W())},beforePropertyValue:function(){T="value"},afterPropertyValue:function(){switch(R){case",":case"}":return K("punctuator",W())}throw ru(W())},beforeArrayValue:function(){if("]"===R)return K("punctuator",W());T="value"},afterArrayValue:function(){switch(R){case",":case"]":return K("punctuator",W())}throw ru(W())},end:function(){throw ru(W())}};function K(u,D){return{type:u,value:D,line:V,column:J}}function Q(u){for(var D=0,e=u;D0;){var e=q();if(!U.isHexDigit(e))throw ru(W());u+=W()}return String.fromCodePoint(parseInt(u,16))}var uu={start:function(){if("eof"===M.type)throw tu();Du()},beforePropertyName:function(){switch(M.type){case"identifier":case"string":return k=M.value,void(O="afterPropertyName");case"punctuator":return void eu();case"eof":throw tu()}},afterPropertyName:function(){if("eof"===M.type)throw tu();O="beforePropertyValue"},beforePropertyValue:function(){if("eof"===M.type)throw tu();Du()},beforeArrayValue:function(){if("eof"===M.type)throw tu();"punctuator"!==M.type||"]"!==M.value?Du():eu()},afterPropertyValue:function(){if("eof"===M.type)throw tu();switch(M.value){case",":return void(O="beforePropertyName");case"}":eu()}},afterArrayValue:function(){if("eof"===M.type)throw tu();switch(M.value){case",":return void(O="beforeArrayValue");case"]":eu()}},end:function(){}};function Du(){var u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}if(void 0===L)L=u;else{var D=j[j.length-1];Array.isArray(D)?D.push(u):Object.defineProperty(D,k,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(null!==u&&"object"==typeof u)j.push(u),O=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var e=j[j.length-1];O=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function eu(){j.pop();var u=j[j.length-1];O=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function ru(u){return Cu(void 0===u?"JSON5: invalid end of input at "+V+":"+J:"JSON5: invalid character '"+Fu(u)+"' at "+V+":"+J)}function tu(){return Cu("JSON5: invalid end of input at "+V+":"+J)}function nu(){return Cu("JSON5: invalid identifier character at "+V+":"+(J-=5))}function Fu(u){var D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){var e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function Cu(u){var D=new SyntaxError(u);return D.lineNumber=V,D.columnNumber=J,D}return{parse:function(u,D){_=String(u),O="start",j=[],I=0,V=1,J=0,M=void 0,k=void 0,L=void 0;do{M=Z(),uu[O]()}while("eof"!==M.type);return"function"==typeof D?function u(D,e,r){var t=D[e];if(null!=t&&"object"==typeof t)if(Array.isArray(t))for(var n=0;n0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),c("",{"":u});function c(u,D){var e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),t&&(e=t.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?B(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(F.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");F.push(u);var D=C;C+=A;for(var e,r=[],t=0;t=0)throw TypeError("Converting circular structure to JSON5");F.push(u);var D=C;C+=A;for(var e,t,n=r||Object.keys(u),i=[],E=0,o=n;E"string"==typeof u&&unicode.Space_Separator.test(u),isIdStartChar:u=>"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||unicode.ID_Start.test(u)),isIdContinueChar:u=>"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||unicode.ID_Continue.test(u)),isDigit:u=>"string"==typeof u&&/[0-9]/.test(u),isHexDigit:u=>"string"==typeof u&&/[0-9A-Fa-f]/.test(u)};let source,parseState,stack,pos,line,column,token,key,root;var parse=function(u,D){source=String(u),parseState="start",stack=[],pos=0,line=1,column=0,token=void 0,key=void 0,root=void 0;do{token=lex(),parseStates[parseState]()}while("eof"!==token.type);return"function"==typeof D?internalize({"":root},"",D):root};function internalize(u,D,e){const r=u[D];if(null!=r&&"object"==typeof r)if(Array.isArray(r))for(let u=0;u0;){const D=peek();if(!util.isHexDigit(D))throw invalidChar(read());u+=read()}return String.fromCodePoint(parseInt(u,16))}const parseStates={start(){if("eof"===token.type)throw invalidEOF();push()},beforePropertyName(){switch(token.type){case"identifier":case"string":return key=token.value,void(parseState="afterPropertyName");case"punctuator":return void pop();case"eof":throw invalidEOF()}},afterPropertyName(){if("eof"===token.type)throw invalidEOF();parseState="beforePropertyValue"},beforePropertyValue(){if("eof"===token.type)throw invalidEOF();push()},beforeArrayValue(){if("eof"===token.type)throw invalidEOF();"punctuator"!==token.type||"]"!==token.value?push():pop()},afterPropertyValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforePropertyName");case"}":pop()}},afterArrayValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforeArrayValue");case"]":pop()}},end(){}};function push(){let u;switch(token.type){case"punctuator":switch(token.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=token.value}if(void 0===root)root=u;else{const D=stack[stack.length-1];Array.isArray(D)?D.push(u):Object.defineProperty(D,key,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(null!==u&&"object"==typeof u)stack.push(u),parseState=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}}function pop(){stack.pop();const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function invalidChar(u){return syntaxError(void 0===u?`JSON5: invalid end of input at ${line}:${column}`:`JSON5: invalid character '${formatChar(u)}' at ${line}:${column}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)}function invalidIdentifier(){return syntaxError(`JSON5: invalid identifier character at ${line}:${column-=5}`)}function separatorChar(u){console.warn(`JSON5: '${formatChar(u)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return"\\x"+("00"+D).substring(D.length)}return u}function syntaxError(u){const D=new SyntaxError(u);return D.lineNumber=line,D.columnNumber=column,D}var stringify=function(u,D,e){const r=[];let t,F,C,a="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,C=D.quote,D=D.replacer),"function"==typeof D)F=D;else if(Array.isArray(D)){t=[];for(const u of D){let D;"string"==typeof u?D=u:("number"==typeof u||u instanceof String||u instanceof Number)&&(D=String(u)),void 0!==D&&t.indexOf(D)<0&&t.push(D)}}return e instanceof Number?e=Number(e):e instanceof String&&(e=String(e)),"number"==typeof e?e>0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),n("",{"":u});function n(u,D){let e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),F&&(e=F.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?E(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(r.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,t=[];for(let D=0;D=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,F=t||Object.keys(u),C=[];for(const D of F){const e=n(D,u);if(void 0!==e){let u=i(D)+":";""!==A&&(u+=" "),u+=e,C.push(u)}}if(0===C.length)e="{}";else{let u;if(""===A)u=C.join(","),e="{"+u+"}";else{let r=",\n"+a;u=C.join(r),e="{\n"+a+u+",\n"+D+"}"}}return r.pop(),a=D,e}(e):void 0}function E(u){const D={"'":.1,'"':.2},e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let r="";for(let t=0;tD[u]= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar (c) { - return typeof c === 'string' && ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit (c) { - return typeof c === 'string' && /[0-9]/.test(c) - }, - - isHexDigit (c) { - return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) - }, -}; - -let source; -let parseState; -let stack; -let pos; -let line; -let column; -let token; -let key; -let root; - -var parse = function parse (text, reviver) { - source = String(text); - parseState = 'start'; - stack = []; - pos = 0; - line = 1; - column = 0; - token = undefined; - key = undefined; - root = undefined; - - do { - token = lex(); - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState](); - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root -}; - -function internalize (holder, name, reviver) { - const value = holder[name]; - if (value != null && typeof value === 'object') { - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - const key = String(i); - const replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - Object.defineProperty(value, key, { - value: replacement, - writable: true, - enumerable: true, - configurable: true, - }); - } - } - } else { - for (const key in value) { - const replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - Object.defineProperty(value, key, { - value: replacement, - writable: true, - enumerable: true, - configurable: true, - }); - } - } - } - } - - return reviver.call(holder, name, value) -} - -let lexState; -let buffer; -let doubleQuote; -let sign; -let c; - -function lex () { - lexState = 'default'; - buffer = ''; - doubleQuote = false; - sign = 1; - - for (;;) { - c = peek(); - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - const token = lexStates[lexState](); - if (token) { - return token - } - } -} - -function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } -} - -function read () { - const c = peek(); - - if (c === '\n') { - line++; - column = 0; - } else if (c) { - column += c.length; - } else { - column++; - } - - if (c) { - pos += c.length; - } - - return c -} - -const lexStates = { - default () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - return - - case '/': - read(); - lexState = 'comment'; - return - - case undefined: - read(); - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read(); - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineComment'; - return - - case '/': - read(); - lexState = 'singleLineComment'; - return - } - - throw invalidChar(read()) - }, - - multiLineComment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineCommentAsterisk'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - }, - - multiLineCommentAsterisk () { - switch (c) { - case '*': - read(); - return - - case '/': - read(); - lexState = 'default'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - lexState = 'multiLineComment'; - }, - - singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - lexState = 'default'; - return - - case undefined: - read(); - return newToken('eof') - } - - read(); - }, - - value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read(); - literal('ull'); - return newToken('null', null) - - case 't': - read(); - literal('rue'); - return newToken('boolean', true) - - case 'f': - read(); - literal('alse'); - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1; - } - - lexState = 'sign'; - return - - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"'); - buffer = ''; - lexState = 'string'; - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - const u = unicodeEscape(); - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read(); - return - - case '\\': - read(); - lexState = 'identifierNameEscape'; - return - } - - if (util.isIdContinueChar(c)) { - buffer += read(); - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - const u = unicodeEscape(); - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - sign () { - switch (c) { - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', sign * Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - - case 'x': - case 'X': - buffer += read(); - lexState = 'hexadecimal'; - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - throw invalidChar(read()) - }, - - decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read(); - lexState = 'decimalExponentSign'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read(); - lexState = 'hexadecimalInteger'; - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string () { - switch (c) { - case '\\': - read(); - buffer += escape(); - return - - case '"': - if (doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case "'": - if (!doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c); - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read(); - }, - - start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value'; - }, - - beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read(); - lexState = 'identifierName'; - return - - case '\\': - read(); - lexState = 'identifierNameStartEscape'; - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"'); - lexState = 'string'; - return - } - - if (util.isIdStartChar(c)) { - buffer += read(); - lexState = 'identifierName'; - return - } - - throw invalidChar(read()) - }, - - afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue () { - lexState = 'value'; - }, - - afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value'; - }, - - afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, -}; - -function newToken (type, value) { - return { - type, - value, - line, - column, - } -} - -function literal (s) { - for (const c of s) { - const p = peek(); - - if (p !== c) { - throw invalidChar(read()) - } - - read(); - } -} - -function escape () { - const c = peek(); - switch (c) { - case 'b': - read(); - return '\b' - - case 'f': - read(); - return '\f' - - case 'n': - read(); - return '\n' - - case 'r': - read(); - return '\r' - - case 't': - read(); - return '\t' - - case 'v': - read(); - return '\v' - - case '0': - read(); - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read(); - return hexEscape() - - case 'u': - read(); - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read(); - return '' - - case '\r': - read(); - if (peek() === '\n') { - read(); - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() -} - -function hexEscape () { - let buffer = ''; - let c = peek(); - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -function unicodeEscape () { - let buffer = ''; - let count = 4; - - while (count-- > 0) { - const c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - } - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -const parseStates = { - start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value; - parseState = 'afterPropertyName'; - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop(); - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue'; - }, - - beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop(); - return - } - - push(); - }, - - afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName'; - return - - case '}': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue'; - return - - case ']': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, -}; - -function push () { - let value; - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {}; - break - - case '[': - value = []; - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value; - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value; - } else { - const parent = stack[stack.length - 1]; - if (Array.isArray(parent)) { - parent.push(value); - } else { - Object.defineProperty(parent, key, { - value, - writable: true, - enumerable: true, - configurable: true, - }); - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value); - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue'; - } else { - parseState = 'beforePropertyName'; - } - } else { - const current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } -} - -function pop () { - stack.pop(); - - const current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } -} - -// This code is unreachable. -// function invalidParseState () { -// return new Error(`JSON5: invalid parse state '${parseState}'`) -// } - -// This code is unreachable. -// function invalidLexState (state) { -// return new Error(`JSON5: invalid lex state '${state}'`) -// } - -function invalidChar (c) { - if (c === undefined) { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - } - - return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -} - -function invalidEOF () { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -} - -// This code is unreachable. -// function invalidToken () { -// if (token.type === 'eof') { -// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -// } - -// const c = String.fromCodePoint(token.value.codePointAt(0)) -// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -// } - -function invalidIdentifier () { - column -= 5; - return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) -} - -function separatorChar (c) { - console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`); -} - -function formatChar (c) { - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - const hexString = c.charCodeAt(0).toString(16); - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c -} - -function syntaxError (message) { - const err = new SyntaxError(message); - err.lineNumber = line; - err.columnNumber = column; - return err -} - -var stringify = function stringify (value, replacer, space) { - const stack = []; - let indent = ''; - let propertyList; - let replacerFunc; - let gap = ''; - let quote; - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space; - quote = replacer.quote; - replacer = replacer.replacer; - } - - if (typeof replacer === 'function') { - replacerFunc = replacer; - } else if (Array.isArray(replacer)) { - propertyList = []; - for (const v of replacer) { - let item; - - if (typeof v === 'string') { - item = v; - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v); - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item); - } - } - } - - if (space instanceof Number) { - space = Number(space); - } else if (space instanceof String) { - space = String(space); - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)); - gap = ' '.substr(0, space); - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10); - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - let value = holder[key]; - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key); - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value); - } - - if (value instanceof Number) { - value = Number(value); - } else if (value instanceof String) { - value = String(value); - } else if (value instanceof Boolean) { - value = value.valueOf(); - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - const quotes = { - "'": 0.1, - '"': 0.2, - }; - - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - let product = ''; - - for (let i = 0; i < value.length; i++) { - const c = value[i]; - switch (c) { - case "'": - case '"': - quotes[c]++; - product += c; - continue - - case '\0': - if (util.isDigit(value[i + 1])) { - product += '\\x00'; - continue - } - } - - if (replacements[c]) { - product += replacements[c]; - continue - } - - if (c < ' ') { - let hexString = c.charCodeAt(0).toString(16); - product += '\\x' + ('00' + hexString).substring(hexString.length); - continue - } - - product += c; - } - - const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b); - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - let stepback = indent; - indent = indent + gap; - - let keys = propertyList || Object.keys(value); - let partial = []; - for (const key of keys) { - const propertyString = serializeProperty(key, value); - if (propertyString !== undefined) { - let member = serializeKey(key) + ':'; - if (gap !== '') { - member += ' '; - } - member += propertyString; - partial.push(member); - } - } - - let final; - if (partial.length === 0) { - final = '{}'; - } else { - let properties; - if (gap === '') { - properties = partial.join(','); - final = '{' + properties + '}'; - } else { - let separator = ',\n' + indent; - properties = partial.join(separator); - final = '{\n' + indent + properties + ',\n' + stepback + '}'; - } - } - - stack.pop(); - indent = stepback; - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - const firstChar = String.fromCodePoint(key.codePointAt(0)); - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (let i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - let stepback = indent; - indent = indent + gap; - - let partial = []; - for (let i = 0; i < value.length; i++) { - const propertyString = serializeProperty(String(i), value); - partial.push((propertyString !== undefined) ? propertyString : 'null'); - } - - let final; - if (partial.length === 0) { - final = '[]'; - } else { - if (gap === '') { - let properties = partial.join(','); - final = '[' + properties + ']'; - } else { - let separator = ',\n' + indent; - let properties = partial.join(separator); - final = '[\n' + indent + properties + ',\n' + stepback + ']'; - } - } - - stack.pop(); - indent = stepback; - return final - } -}; - -const JSON5 = { - parse, - stringify, -}; - -var lib = JSON5; - -export default lib; diff --git a/node_modules/json5/lib/cli.js b/node_modules/json5/lib/cli.js deleted file mode 100644 index 93cb809..0000000 --- a/node_modules/json5/lib/cli.js +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs') -const path = require('path') -const pkg = require('../package.json') -const JSON5 = require('./') - -const argv = parseArgs() - -if (argv.version) { - version() -} else if (argv.help) { - usage() -} else { - const inFilename = argv.defaults[0] - - let readStream - if (inFilename) { - readStream = fs.createReadStream(inFilename) - } else { - readStream = process.stdin - } - - let json5 = '' - readStream.on('data', data => { - json5 += data - }) - - readStream.on('end', () => { - let space - if (argv.space === 't' || argv.space === 'tab') { - space = '\t' - } else { - space = Number(argv.space) - } - - let value - try { - value = JSON5.parse(json5) - if (!argv.validate) { - const json = JSON.stringify(value, null, space) - - let writeStream - - // --convert is for backward compatibility with v0.5.1. If - // specified with and not --out-file, then a file with - // the same name but with a .json extension will be written. - if (argv.convert && inFilename && !argv.outFile) { - const parsedFilename = path.parse(inFilename) - const outFilename = path.format( - Object.assign( - parsedFilename, - {base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'} - ) - ) - - writeStream = fs.createWriteStream(outFilename) - } else if (argv.outFile) { - writeStream = fs.createWriteStream(argv.outFile) - } else { - writeStream = process.stdout - } - - writeStream.write(json) - } - } catch (err) { - console.error(err.message) - process.exit(1) - } - }) -} - -function parseArgs () { - let convert - let space - let validate - let outFile - let version - let help - const defaults = [] - - const args = process.argv.slice(2) - for (let i = 0; i < args.length; i++) { - const arg = args[i] - switch (arg) { - case '--convert': - case '-c': - convert = true - break - - case '--space': - case '-s': - space = args[++i] - break - - case '--validate': - case '-v': - validate = true - break - - case '--out-file': - case '-o': - outFile = args[++i] - break - - case '--version': - case '-V': - version = true - break - - case '--help': - case '-h': - help = true - break - - default: - defaults.push(arg) - break - } - } - - return { - convert, - space, - validate, - outFile, - version, - help, - defaults, - } -} - -function version () { - console.log(pkg.version) -} - -function usage () { - console.log( - ` - Usage: json5 [options] - - If is not provided, then STDIN is used. - - Options: - - -s, --space The number of spaces to indent or 't' for tabs - -o, --out-file [file] Output to the specified file, otherwise STDOUT - -v, --validate Validate JSON5 but do not output JSON - -V, --version Output the version number - -h, --help Output usage information` - ) -} diff --git a/node_modules/json5/lib/index.d.ts b/node_modules/json5/lib/index.d.ts deleted file mode 100644 index 1c45bca..0000000 --- a/node_modules/json5/lib/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import parse = require('./parse') -import stringify = require('./stringify') - -export {parse, stringify} diff --git a/node_modules/json5/lib/index.js b/node_modules/json5/lib/index.js deleted file mode 100644 index 3679638..0000000 --- a/node_modules/json5/lib/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const parse = require('./parse') -const stringify = require('./stringify') - -const JSON5 = { - parse, - stringify, -} - -module.exports = JSON5 diff --git a/node_modules/json5/lib/parse.d.ts b/node_modules/json5/lib/parse.d.ts deleted file mode 100644 index 8c8d883..0000000 --- a/node_modules/json5/lib/parse.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Parses a JSON5 string, constructing the JavaScript value or object described - * by the string. - * @template T The type of the return value. - * @param text The string to parse as JSON5. - * @param reviver A function that prescribes how the value originally produced - * by parsing is transformed before being returned. - * @returns The JavaScript value converted from the JSON5 string. - */ -declare function parse( - text: string, - reviver?: ((this: any, key: string, value: any) => any) | null, -): T - -export = parse diff --git a/node_modules/json5/lib/parse.js b/node_modules/json5/lib/parse.js deleted file mode 100644 index da2078a..0000000 --- a/node_modules/json5/lib/parse.js +++ /dev/null @@ -1,1114 +0,0 @@ -const util = require('./util') - -let source -let parseState -let stack -let pos -let line -let column -let token -let key -let root - -module.exports = function parse (text, reviver) { - source = String(text) - parseState = 'start' - stack = [] - pos = 0 - line = 1 - column = 0 - token = undefined - key = undefined - root = undefined - - do { - token = lex() - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState]() - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root -} - -function internalize (holder, name, reviver) { - const value = holder[name] - if (value != null && typeof value === 'object') { - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - const key = String(i) - const replacement = internalize(value, key, reviver) - if (replacement === undefined) { - delete value[key] - } else { - Object.defineProperty(value, key, { - value: replacement, - writable: true, - enumerable: true, - configurable: true, - }) - } - } - } else { - for (const key in value) { - const replacement = internalize(value, key, reviver) - if (replacement === undefined) { - delete value[key] - } else { - Object.defineProperty(value, key, { - value: replacement, - writable: true, - enumerable: true, - configurable: true, - }) - } - } - } - } - - return reviver.call(holder, name, value) -} - -let lexState -let buffer -let doubleQuote -let sign -let c - -function lex () { - lexState = 'default' - buffer = '' - doubleQuote = false - sign = 1 - - for (;;) { - c = peek() - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - const token = lexStates[lexState]() - if (token) { - return token - } - } -} - -function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } -} - -function read () { - const c = peek() - - if (c === '\n') { - line++ - column = 0 - } else if (c) { - column += c.length - } else { - column++ - } - - if (c) { - pos += c.length - } - - return c -} - -const lexStates = { - default () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read() - return - - case '/': - read() - lexState = 'comment' - return - - case undefined: - read() - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read() - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment () { - switch (c) { - case '*': - read() - lexState = 'multiLineComment' - return - - case '/': - read() - lexState = 'singleLineComment' - return - } - - throw invalidChar(read()) - }, - - multiLineComment () { - switch (c) { - case '*': - read() - lexState = 'multiLineCommentAsterisk' - return - - case undefined: - throw invalidChar(read()) - } - - read() - }, - - multiLineCommentAsterisk () { - switch (c) { - case '*': - read() - return - - case '/': - read() - lexState = 'default' - return - - case undefined: - throw invalidChar(read()) - } - - read() - lexState = 'multiLineComment' - }, - - singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read() - lexState = 'default' - return - - case undefined: - read() - return newToken('eof') - } - - read() - }, - - value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read() - literal('ull') - return newToken('null', null) - - case 't': - read() - literal('rue') - return newToken('boolean', true) - - case 'f': - read() - literal('alse') - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1 - } - - lexState = 'sign' - return - - case '.': - buffer = read() - lexState = 'decimalPointLeading' - return - - case '0': - buffer = read() - lexState = 'zero' - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read() - lexState = 'decimalInteger' - return - - case 'I': - read() - literal('nfinity') - return newToken('numeric', Infinity) - - case 'N': - read() - literal('aN') - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"') - buffer = '' - lexState = 'string' - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read() - const u = unicodeEscape() - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u - lexState = 'identifierName' - }, - - identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read() - return - - case '\\': - read() - lexState = 'identifierNameEscape' - return - } - - if (util.isIdContinueChar(c)) { - buffer += read() - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read() - const u = unicodeEscape() - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u - lexState = 'identifierName' - }, - - sign () { - switch (c) { - case '.': - buffer = read() - lexState = 'decimalPointLeading' - return - - case '0': - buffer = read() - lexState = 'zero' - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read() - lexState = 'decimalInteger' - return - - case 'I': - read() - literal('nfinity') - return newToken('numeric', sign * Infinity) - - case 'N': - read() - literal('aN') - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero () { - switch (c) { - case '.': - buffer += read() - lexState = 'decimalPoint' - return - - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - - case 'x': - case 'X': - buffer += read() - lexState = 'hexadecimal' - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger () { - switch (c) { - case '.': - buffer += read() - lexState = 'decimalPoint' - return - - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalFraction' - return - } - - throw invalidChar(read()) - }, - - decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalFraction' - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read() - lexState = 'decimalExponentSign' - return - } - - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalExponentInteger' - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalExponentInteger' - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read() - lexState = 'hexadecimalInteger' - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string () { - switch (c) { - case '\\': - read() - buffer += escape() - return - - case '"': - if (doubleQuote) { - read() - return newToken('string', buffer) - } - - buffer += read() - return - - case "'": - if (!doubleQuote) { - read() - return newToken('string', buffer) - } - - buffer += read() - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c) - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read() - }, - - start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value' - }, - - beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read() - lexState = 'identifierName' - return - - case '\\': - read() - lexState = 'identifierNameStartEscape' - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"') - lexState = 'string' - return - } - - if (util.isIdStartChar(c)) { - buffer += read() - lexState = 'identifierName' - return - } - - throw invalidChar(read()) - }, - - afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue () { - lexState = 'value' - }, - - afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value' - }, - - afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, -} - -function newToken (type, value) { - return { - type, - value, - line, - column, - } -} - -function literal (s) { - for (const c of s) { - const p = peek() - - if (p !== c) { - throw invalidChar(read()) - } - - read() - } -} - -function escape () { - const c = peek() - switch (c) { - case 'b': - read() - return '\b' - - case 'f': - read() - return '\f' - - case 'n': - read() - return '\n' - - case 'r': - read() - return '\r' - - case 't': - read() - return '\t' - - case 'v': - read() - return '\v' - - case '0': - read() - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read() - return hexEscape() - - case 'u': - read() - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read() - return '' - - case '\r': - read() - if (peek() === '\n') { - read() - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() -} - -function hexEscape () { - let buffer = '' - let c = peek() - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - - c = peek() - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -function unicodeEscape () { - let buffer = '' - let count = 4 - - while (count-- > 0) { - const c = peek() - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - } - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -const parseStates = { - start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push() - }, - - beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value - parseState = 'afterPropertyName' - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop() - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue' - }, - - beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push() - }, - - beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop() - return - } - - push() - }, - - afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName' - return - - case '}': - pop() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue' - return - - case ']': - pop() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, -} - -function push () { - let value - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {} - break - - case '[': - value = [] - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value - } else { - const parent = stack[stack.length - 1] - if (Array.isArray(parent)) { - parent.push(value) - } else { - Object.defineProperty(parent, key, { - value, - writable: true, - enumerable: true, - configurable: true, - }) - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value) - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue' - } else { - parseState = 'beforePropertyName' - } - } else { - const current = stack[stack.length - 1] - if (current == null) { - parseState = 'end' - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue' - } else { - parseState = 'afterPropertyValue' - } - } -} - -function pop () { - stack.pop() - - const current = stack[stack.length - 1] - if (current == null) { - parseState = 'end' - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue' - } else { - parseState = 'afterPropertyValue' - } -} - -// This code is unreachable. -// function invalidParseState () { -// return new Error(`JSON5: invalid parse state '${parseState}'`) -// } - -// This code is unreachable. -// function invalidLexState (state) { -// return new Error(`JSON5: invalid lex state '${state}'`) -// } - -function invalidChar (c) { - if (c === undefined) { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - } - - return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -} - -function invalidEOF () { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -} - -// This code is unreachable. -// function invalidToken () { -// if (token.type === 'eof') { -// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -// } - -// const c = String.fromCodePoint(token.value.codePointAt(0)) -// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -// } - -function invalidIdentifier () { - column -= 5 - return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) -} - -function separatorChar (c) { - console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`) -} - -function formatChar (c) { - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - } - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - const hexString = c.charCodeAt(0).toString(16) - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c -} - -function syntaxError (message) { - const err = new SyntaxError(message) - err.lineNumber = line - err.columnNumber = column - return err -} diff --git a/node_modules/json5/lib/register.js b/node_modules/json5/lib/register.js deleted file mode 100644 index 935cdba..0000000 --- a/node_modules/json5/lib/register.js +++ /dev/null @@ -1,13 +0,0 @@ -const fs = require('fs') -const JSON5 = require('./') - -// eslint-disable-next-line node/no-deprecated-api -require.extensions['.json5'] = function (module, filename) { - const content = fs.readFileSync(filename, 'utf8') - try { - module.exports = JSON5.parse(content) - } catch (err) { - err.message = filename + ': ' + err.message - throw err - } -} diff --git a/node_modules/json5/lib/require.js b/node_modules/json5/lib/require.js deleted file mode 100644 index 3aa29be..0000000 --- a/node_modules/json5/lib/require.js +++ /dev/null @@ -1,4 +0,0 @@ -// This file is for backward compatibility with v0.5.1. -require('./register') - -console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.") diff --git a/node_modules/json5/lib/stringify.d.ts b/node_modules/json5/lib/stringify.d.ts deleted file mode 100644 index 3c34838..0000000 --- a/node_modules/json5/lib/stringify.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -declare type StringifyOptions = { - /** - * A function that alters the behavior of the stringification process, or an - * array of String and Number objects that serve as a allowlist for - * selecting/filtering the properties of the value object to be included in - * the JSON5 string. If this value is null or not provided, all properties - * of the object are included in the resulting JSON5 string. - */ - replacer?: - | ((this: any, key: string, value: any) => any) - | (string | number)[] - | null - - /** - * A String or Number object that's used to insert white space into the - * output JSON5 string for readability purposes. If this is a Number, it - * indicates the number of space characters to use as white space; this - * number is capped at 10 (if it is greater, the value is just 10). Values - * less than 1 indicate that no space should be used. If this is a String, - * the string (or the first 10 characters of the string, if it's longer than - * that) is used as white space. If this parameter is not provided (or is - * null), no white space is used. If white space is used, trailing commas - * will be used in objects and arrays. - */ - space?: string | number | null - - /** - * A String representing the quote character to use when serializing - * strings. - */ - quote?: string | null -} - -/** - * Converts a JavaScript value to a JSON5 string. - * @param value The value to convert to a JSON5 string. - * @param replacer A function that alters the behavior of the stringification - * process. If this value is null or not provided, all properties of the object - * are included in the resulting JSON5 string. - * @param space A String or Number object that's used to insert white space into - * the output JSON5 string for readability purposes. If this is a Number, it - * indicates the number of space characters to use as white space; this number - * is capped at 10 (if it is greater, the value is just 10). Values less than 1 - * indicate that no space should be used. If this is a String, the string (or - * the first 10 characters of the string, if it's longer than that) is used as - * white space. If this parameter is not provided (or is null), no white space - * is used. If white space is used, trailing commas will be used in objects and - * arrays. - * @returns The JSON5 string converted from the JavaScript value. - */ -declare function stringify( - value: any, - replacer?: ((this: any, key: string, value: any) => any) | null, - space?: string | number | null, -): string - -/** - * Converts a JavaScript value to a JSON5 string. - * @param value The value to convert to a JSON5 string. - * @param replacer An array of String and Number objects that serve as a - * allowlist for selecting/filtering the properties of the value object to be - * included in the JSON5 string. If this value is null or not provided, all - * properties of the object are included in the resulting JSON5 string. - * @param space A String or Number object that's used to insert white space into - * the output JSON5 string for readability purposes. If this is a Number, it - * indicates the number of space characters to use as white space; this number - * is capped at 10 (if it is greater, the value is just 10). Values less than 1 - * indicate that no space should be used. If this is a String, the string (or - * the first 10 characters of the string, if it's longer than that) is used as - * white space. If this parameter is not provided (or is null), no white space - * is used. If white space is used, trailing commas will be used in objects and - * arrays. - * @returns The JSON5 string converted from the JavaScript value. - */ -declare function stringify( - value: any, - replacer: (string | number)[], - space?: string | number | null, -): string - -/** - * Converts a JavaScript value to a JSON5 string. - * @param value The value to convert to a JSON5 string. - * @param options An object specifying options. - * @returns The JSON5 string converted from the JavaScript value. - */ -declare function stringify(value: any, options: StringifyOptions): string - -export = stringify diff --git a/node_modules/json5/lib/stringify.js b/node_modules/json5/lib/stringify.js deleted file mode 100644 index 7cb3b0e..0000000 --- a/node_modules/json5/lib/stringify.js +++ /dev/null @@ -1,261 +0,0 @@ -const util = require('./util') - -module.exports = function stringify (value, replacer, space) { - const stack = [] - let indent = '' - let propertyList - let replacerFunc - let gap = '' - let quote - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space - quote = replacer.quote - replacer = replacer.replacer - } - - if (typeof replacer === 'function') { - replacerFunc = replacer - } else if (Array.isArray(replacer)) { - propertyList = [] - for (const v of replacer) { - let item - - if (typeof v === 'string') { - item = v - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v) - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item) - } - } - } - - if (space instanceof Number) { - space = Number(space) - } else if (space instanceof String) { - space = String(space) - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)) - gap = ' '.substr(0, space) - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10) - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - let value = holder[key] - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key) - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key) - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value) - } - - if (value instanceof Number) { - value = Number(value) - } else if (value instanceof String) { - value = String(value) - } else if (value instanceof Boolean) { - value = value.valueOf() - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - const quotes = { - "'": 0.1, - '"': 0.2, - } - - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - } - - let product = '' - - for (let i = 0; i < value.length; i++) { - const c = value[i] - switch (c) { - case "'": - case '"': - quotes[c]++ - product += c - continue - - case '\0': - if (util.isDigit(value[i + 1])) { - product += '\\x00' - continue - } - } - - if (replacements[c]) { - product += replacements[c] - continue - } - - if (c < ' ') { - let hexString = c.charCodeAt(0).toString(16) - product += '\\x' + ('00' + hexString).substring(hexString.length) - continue - } - - product += c - } - - const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b) - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]) - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value) - - let stepback = indent - indent = indent + gap - - let keys = propertyList || Object.keys(value) - let partial = [] - for (const key of keys) { - const propertyString = serializeProperty(key, value) - if (propertyString !== undefined) { - let member = serializeKey(key) + ':' - if (gap !== '') { - member += ' ' - } - member += propertyString - partial.push(member) - } - } - - let final - if (partial.length === 0) { - final = '{}' - } else { - let properties - if (gap === '') { - properties = partial.join(',') - final = '{' + properties + '}' - } else { - let separator = ',\n' + indent - properties = partial.join(separator) - final = '{\n' + indent + properties + ',\n' + stepback + '}' - } - } - - stack.pop() - indent = stepback - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - const firstChar = String.fromCodePoint(key.codePointAt(0)) - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (let i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value) - - let stepback = indent - indent = indent + gap - - let partial = [] - for (let i = 0; i < value.length; i++) { - const propertyString = serializeProperty(String(i), value) - partial.push((propertyString !== undefined) ? propertyString : 'null') - } - - let final - if (partial.length === 0) { - final = '[]' - } else { - if (gap === '') { - let properties = partial.join(',') - final = '[' + properties + ']' - } else { - let separator = ',\n' + indent - let properties = partial.join(separator) - final = '[\n' + indent + properties + ',\n' + stepback + ']' - } - } - - stack.pop() - indent = stepback - return final - } -} diff --git a/node_modules/json5/lib/unicode.d.ts b/node_modules/json5/lib/unicode.d.ts deleted file mode 100644 index 610f805..0000000 --- a/node_modules/json5/lib/unicode.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const Space_Separator: RegExp -export declare const ID_Start: RegExp -export declare const ID_Continue: RegExp diff --git a/node_modules/json5/lib/unicode.js b/node_modules/json5/lib/unicode.js deleted file mode 100644 index 215ccd8..0000000 --- a/node_modules/json5/lib/unicode.js +++ /dev/null @@ -1,4 +0,0 @@ -// This is a generated file. Do not edit. -module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/ -module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\u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DC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/ -module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-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F13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD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\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ diff --git a/node_modules/json5/lib/util.d.ts b/node_modules/json5/lib/util.d.ts deleted file mode 100644 index a940cea..0000000 --- a/node_modules/json5/lib/util.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function isSpaceSeparator(c?: string): boolean -export declare function isIdStartChar(c?: string): boolean -export declare function isIdContinueChar(c?: string): boolean -export declare function isDigit(c?: string): boolean -export declare function isHexDigit(c?: string): boolean diff --git a/node_modules/json5/lib/util.js b/node_modules/json5/lib/util.js deleted file mode 100644 index 40bfe2f..0000000 --- a/node_modules/json5/lib/util.js +++ /dev/null @@ -1,35 +0,0 @@ -const unicode = require('../lib/unicode') - -module.exports = { - isSpaceSeparator (c) { - return typeof c === 'string' && unicode.Space_Separator.test(c) - }, - - isIdStartChar (c) { - return typeof c === 'string' && ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar (c) { - return typeof c === 'string' && ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit (c) { - return typeof c === 'string' && /[0-9]/.test(c) - }, - - isHexDigit (c) { - return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) - }, -} diff --git a/node_modules/json5/package.json b/node_modules/json5/package.json deleted file mode 100644 index 60c51d9..0000000 --- a/node_modules/json5/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "json5", - "version": "2.2.3", - "description": "JSON for Humans", - "main": "lib/index.js", - "module": "dist/index.mjs", - "bin": "lib/cli.js", - "browser": "dist/index.js", - "types": "lib/index.d.ts", - "files": [ - "lib/", - "dist/" - ], - "engines": { - "node": ">=6" - }, - "scripts": { - "build": "rollup -c", - "build-package": "node build/package.js", - "build-unicode": "node build/unicode.js", - "coverage": "tap --coverage-report html test", - "lint": "eslint --fix .", - "lint-report": "eslint .", - "prepublishOnly": "npm run production", - "preversion": "npm run production", - "production": "run-s test build", - "tap": "tap -Rspec --100 test", - "test": "run-s lint-report tap", - "version": "npm run build-package && git add package.json5" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/json5/json5.git" - }, - "keywords": [ - "json", - "json5", - "es5", - "es2015", - "ecmascript" - ], - "author": "Aseem Kishore ", - "contributors": [ - "Max Nanasy ", - "Andrew Eisenberg ", - "Jordan Tucker " - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/json5/json5/issues" - }, - "homepage": "http://json5.org/", - "devDependencies": { - "core-js": "^2.6.5", - "eslint": "^5.15.3", - "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": "^2.16.0", - "eslint-plugin-node": "^8.0.1", - "eslint-plugin-promise": "^4.0.1", - "eslint-plugin-standard": "^4.0.0", - "npm-run-all": "^4.1.5", - "regenerate": "^1.4.0", - "rollup": "^0.64.1", - "rollup-plugin-buble": "^0.19.6", - "rollup-plugin-commonjs": "^9.2.1", - "rollup-plugin-node-resolve": "^3.4.0", - "rollup-plugin-terser": "^1.0.1", - "sinon": "^6.3.5", - "tap": "^12.6.0", - "unicode-10.0.0": "^0.7.5" - } -} diff --git a/node_modules/kind-of/CHANGELOG.md b/node_modules/kind-of/CHANGELOG.md deleted file mode 100644 index 01687d5..0000000 --- a/node_modules/kind-of/CHANGELOG.md +++ /dev/null @@ -1,160 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
- Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
- -
- Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
- -## [6.0.3] - 2020-01-16 - -- Merge pull request #31 for issue #30 - -## [6.0.0] - 2017-10-13 - -- refactor code to be more performant -- refactor benchmarks - -## [5.1.0] - 2017-10-13 - -**Added** - -- Merge pull request #15 from aretecode/patch-1 -- adds support and tests for string & array iterators - -**Changed** - -- updates benchmarks - -## [5.0.2] - 2017-08-02 - -- Merge pull request #14 from struct78/master -- Added `undefined` check - -## [5.0.0] - 2017-06-21 - -- Merge pull request #12 from aretecode/iterator -- Set Iterator + Map Iterator -- streamline `isbuffer`, minor edits - -## [4.0.0] - 2017-05-19 - -- Merge pull request #8 from tunnckoCore/master -- update deps - -## [3.2.2] - 2017-05-16 - -- fix version - -## [3.2.1] - 2017-05-16 - -- add browserify - -## [3.2.0] - 2017-04-25 - -- Merge pull request #10 from ksheedlo/unrequire-buffer -- add `promise` support and tests -- Remove unnecessary `Buffer` check - -## [3.1.0] - 2016-12-07 - -- Merge pull request #7 from laggingreflex/err -- add support for `error` and tests -- run update - -## [3.0.4] - 2016-07-29 - -- move tests -- run update - -## [3.0.3] - 2016-05-03 - -- fix prepublish script -- remove unused dep - -## [3.0.0] - 2015-11-17 - -- add typed array support -- Merge pull request #5 from miguelmota/typed-arrays -- adds new tests - -## [2.0.1] - 2015-08-21 - -- use `is-buffer` module - -## [2.0.0] - 2015-05-31 - -- Create fallback for `Array.isArray` if used as a browser package -- Merge pull request #2 from dtothefp/patch-1 -- Merge pull request #3 from pdehaan/patch-1 -- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master -- optimizations, mostly date and regex - -## [1.1.0] - 2015-02-09 - -- adds `buffer` support -- adds tests for `buffer` - -## [1.0.0] - 2015-01-19 - -- update benchmarks -- optimizations based on benchmarks - -## [0.1.2] - 2014-10-26 - -- return `typeof` value if it's not an object. very slight speed improvement -- use `.slice` -- adds benchmarks - -## [0.1.0] - 2014-9-26 - -- first commit - -[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 -[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 -[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 -[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 -[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 -[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 -[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 -[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 -[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 -[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 - -[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog \ No newline at end of file diff --git a/node_modules/kind-of/LICENSE b/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca1..0000000 --- a/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/kind-of/README.md b/node_modules/kind-of/README.md deleted file mode 100644 index 0411dc5..0000000 --- a/node_modules/kind-of/README.md +++ /dev/null @@ -1,367 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, es6, and browser ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(new Error('error')); -//=> 'error' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'generatorfunction' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). - -```bash -# arguments (32 bytes) - kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) - lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) - lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) - - fastest is kind-of (by 161% avg) - -# array (22 bytes) - kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) - lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) - lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) - - fastest is kind-of (by 196% avg) - -# boolean (24 bytes) - kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) - lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) - lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) - - fastest is kind-of (by 204% avg) - -# buffer (38 bytes) - kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) - lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) - lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) - - fastest is kind-of (by 247% avg) - -# date (30 bytes) - kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) - lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) - lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) - - fastest is kind-of (by 184% avg) - -# error (36 bytes) - kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) - lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) - lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) - - fastest is kind-of (by 127% avg) - -# function (34 bytes) - kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) - lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) - lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) - - fastest is kind-of (by 113% avg) - -# null (24 bytes) - kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) - lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) - lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) - - fastest is kind-of (by 174% avg) - -# number (22 bytes) - kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) - lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) - lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) - - fastest is kind-of (by 632% avg) - -# object-plain (47 bytes) - kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) - lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) - lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) - - fastest is lib-type-of (by 112% avg) - -# regex (25 bytes) - kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) - lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) - lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) - - fastest is kind-of (by 158% avg) - -# string (33 bytes) - kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) - lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) - lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) - - fastest is kind-of (by 220% avg) - -# symbol (34 bytes) - kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) - lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) - lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) - - fastest is kind-of (by 310% avg) - -# template-strings (36 bytes) - kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) - lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) - lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) - - fastest is kind-of (by 210% avg) - -# undefined (29 bytes) - kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) - lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) - lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) - - fastest is lib-typeof,kind-of - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly identifies instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/micromatch/is-glob) | [homepage](https://github.com/micromatch/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if a number or string value is a finite number. Useful for regex… [more](https://github.com/jonschlinkert/is-number) | [homepage](https://github.com/jonschlinkert/is-number "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 102 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [tunnckoCore](https://github.com/tunnckoCore) | -| 1 | [xiaofen9](https://github.com/xiaofen9) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -### License - -Copyright © 2020, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on January 16, 2020._ \ No newline at end of file diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js deleted file mode 100644 index dfa799b..0000000 --- a/node_modules/kind-of/index.js +++ /dev/null @@ -1,129 +0,0 @@ -var toString = Object.prototype.toString; - -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; - } - - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; - - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; - - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; - - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; - - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; - - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } - - if (isGeneratorObj(val)) { - return 'generator'; - } - - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; - } - - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -function ctorName(val) { - return typeof val.constructor === 'function' ? val.constructor.name : null; -} - -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} - -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); -} - -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; -} - -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; -} - -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} - -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} - -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } - } - return false; -} - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); - } - return false; -} diff --git a/node_modules/kind-of/package.json b/node_modules/kind-of/package.json deleted file mode 100644 index 5820cad..0000000 --- a/node_modules/kind-of/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "kind-of", - "description": "Get the native type of a value.", - "version": "6.0.3", - "homepage": "https://github.com/jonschlinkert/kind-of", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "David Fox-Powell (https://dtothefp.github.io/me)", - "James (https://twitter.com/aretecode)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Ken Sheedlo (kensheedlo.com)", - "laggingreflex (https://github.com/laggingreflex)", - "Miguel Mota (https://miguelmota.com)", - "Peter deHaan (http://about.me/peterdehaan)", - "tunnckoCore (https://i.am.charlike.online)" - ], - "repository": "jonschlinkert/kind-of", - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha", - "prepublish": "browserify -o browser.js -e index.js -s index --bare" - }, - "devDependencies": { - "benchmarked": "^2.0.0", - "browserify": "^14.4.0", - "gulp-format-md": "^1.0.0", - "mocha": "^4.0.1", - "write": "^1.0.3" - }, - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - } -} diff --git a/node_modules/loader-runner/LICENSE b/node_modules/loader-runner/LICENSE deleted file mode 100644 index 084338a..0000000 --- a/node_modules/loader-runner/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) Tobias Koppers @sokra - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/loader-runner/README.md b/node_modules/loader-runner/README.md deleted file mode 100644 index f052dd3..0000000 --- a/node_modules/loader-runner/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# loader-runner - -``` js -import { runLoaders } from "loader-runner"; - -runLoaders({ - resource: "/abs/path/to/file.txt?query", - // String: Absolute path to the resource (optionally including query string) - - loaders: ["/abs/path/to/loader.js?query"], - // String[]: Absolute paths to the loaders (optionally including query string) - // {loader, options}[]: Absolute paths to the loaders with options object - - context: { minimize: true }, - // Additional loader context which is used as base context - - processResource: (loaderContext, resourcePath, callback) => { ... }, - // Optional: A function to process the resource - // Must have signature function(context, path, function(err, buffer)) - // By default readResource is used and the resource is added a fileDependency - - readResource: fs.readFile.bind(fs) - // Optional: A function to read the resource - // Only used when 'processResource' is not provided - // Must have signature function(path, function(err, buffer)) - // By default fs.readFile is used -}, function(err, result) { - // err: Error? - - // result.result: Buffer | String - // The result - // only available when no error occured - - // result.resourceBuffer: Buffer - // The raw resource as Buffer (useful for SourceMaps) - // only available when no error occured - - // result.cacheable: Bool - // Is the result cacheable or do it require reexecution? - - // result.fileDependencies: String[] - // An array of paths (existing files) on which the result depends on - - // result.missingDependencies: String[] - // An array of paths (not existing files) on which the result depends on - - // result.contextDependencies: String[] - // An array of paths (directories) on which the result depends on -}) -``` - -More documentation following... - diff --git a/node_modules/loader-runner/lib/LoaderLoadingError.js b/node_modules/loader-runner/lib/LoaderLoadingError.js deleted file mode 100644 index fa1e54d..0000000 --- a/node_modules/loader-runner/lib/LoaderLoadingError.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -class LoadingLoaderError extends Error { - constructor(message) { - super(message); - this.name = "LoaderRunnerError"; - Error.captureStackTrace(this, this.constructor); - } -} - -module.exports = LoadingLoaderError; diff --git a/node_modules/loader-runner/lib/LoaderRunner.js b/node_modules/loader-runner/lib/LoaderRunner.js deleted file mode 100644 index 5909261..0000000 --- a/node_modules/loader-runner/lib/LoaderRunner.js +++ /dev/null @@ -1,416 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -var fs = require("fs"); -var readFile = fs.readFile.bind(fs); -var loadLoader = require("./loadLoader"); - -function utf8BufferToString(buf) { - var str = buf.toString("utf-8"); - if(str.charCodeAt(0) === 0xFEFF) { - return str.substr(1); - } else { - return str; - } -} - -const PATH_QUERY_FRAGMENT_REGEXP = /^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; - -/** - * @param {string} str the path with query and fragment - * @returns {{ path: string, query: string, fragment: string }} parsed parts - */ -function parsePathQueryFragment(str) { - var match = PATH_QUERY_FRAGMENT_REGEXP.exec(str); - return { - path: match[1].replace(/\0(.)/g, "$1"), - query: match[2] ? match[2].replace(/\0(.)/g, "$1") : "", - fragment: match[3] || "" - }; -} - -function dirname(path) { - if(path === "/") return "/"; - var i = path.lastIndexOf("/"); - var j = path.lastIndexOf("\\"); - var i2 = path.indexOf("/"); - var j2 = path.indexOf("\\"); - var idx = i > j ? i : j; - var idx2 = i > j ? i2 : j2; - if(idx < 0) return path; - if(idx === idx2) return path.substr(0, idx + 1); - return path.substr(0, idx); -} - -function createLoaderObject(loader) { - var obj = { - path: null, - query: null, - fragment: null, - options: null, - ident: null, - normal: null, - pitch: null, - raw: null, - data: null, - pitchExecuted: false, - normalExecuted: false - }; - Object.defineProperty(obj, "request", { - enumerable: true, - get: function() { - return obj.path.replace(/#/g, "\0#") + obj.query.replace(/#/g, "\0#") + obj.fragment; - }, - set: function(value) { - if(typeof value === "string") { - var splittedRequest = parsePathQueryFragment(value); - obj.path = splittedRequest.path; - obj.query = splittedRequest.query; - obj.fragment = splittedRequest.fragment; - obj.options = undefined; - obj.ident = undefined; - } else { - if(!value.loader) - throw new Error("request should be a string or object with loader and options (" + JSON.stringify(value) + ")"); - obj.path = value.loader; - obj.fragment = value.fragment || ""; - obj.type = value.type; - obj.options = value.options; - obj.ident = value.ident; - if(obj.options === null) - obj.query = ""; - else if(obj.options === undefined) - obj.query = ""; - else if(typeof obj.options === "string") - obj.query = "?" + obj.options; - else if(obj.ident) - obj.query = "??" + obj.ident; - else if(typeof obj.options === "object" && obj.options.ident) - obj.query = "??" + obj.options.ident; - else - obj.query = "?" + JSON.stringify(obj.options); - } - } - }); - obj.request = loader; - if(Object.preventExtensions) { - Object.preventExtensions(obj); - } - return obj; -} - -function runSyncOrAsync(fn, context, args, callback) { - var isSync = true; - var isDone = false; - var isError = false; // internal error - var reportedError = false; - context.async = function async() { - if(isDone) { - if(reportedError) return; // ignore - throw new Error("async(): The callback was already called."); - } - isSync = false; - return innerCallback; - }; - var innerCallback = context.callback = function() { - if(isDone) { - if(reportedError) return; // ignore - throw new Error("callback(): The callback was already called."); - } - isDone = true; - isSync = false; - try { - callback.apply(null, arguments); - } catch(e) { - isError = true; - throw e; - } - }; - try { - var result = (function LOADER_EXECUTION() { - return fn.apply(context, args); - }()); - if(isSync) { - isDone = true; - if(result === undefined) - return callback(); - if(result && typeof result === "object" && typeof result.then === "function") { - return result.then(function(r) { - callback(null, r); - }, callback); - } - return callback(null, result); - } - } catch(e) { - if(isError) throw e; - if(isDone) { - // loader is already "done", so we cannot use the callback function - // for better debugging we print the error on the console - if(typeof e === "object" && e.stack) console.error(e.stack); - else console.error(e); - return; - } - isDone = true; - reportedError = true; - callback(e); - } - -} - -function convertArgs(args, raw) { - if(!raw && Buffer.isBuffer(args[0])) - args[0] = utf8BufferToString(args[0]); - else if(raw && typeof args[0] === "string") - args[0] = Buffer.from(args[0], "utf-8"); -} - -function iteratePitchingLoaders(options, loaderContext, callback) { - // abort after last loader - if(loaderContext.loaderIndex >= loaderContext.loaders.length) - return processResource(options, loaderContext, callback); - - var currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex]; - - // iterate - if(currentLoaderObject.pitchExecuted) { - loaderContext.loaderIndex++; - return iteratePitchingLoaders(options, loaderContext, callback); - } - - // load loader module - loadLoader(currentLoaderObject, function(err) { - if(err) { - loaderContext.cacheable(false); - return callback(err); - } - var fn = currentLoaderObject.pitch; - currentLoaderObject.pitchExecuted = true; - if(!fn) return iteratePitchingLoaders(options, loaderContext, callback); - - runSyncOrAsync( - fn, - loaderContext, [loaderContext.remainingRequest, loaderContext.previousRequest, currentLoaderObject.data = {}], - function(err) { - if(err) return callback(err); - var args = Array.prototype.slice.call(arguments, 1); - // Determine whether to continue the pitching process based on - // argument values (as opposed to argument presence) in order - // to support synchronous and asynchronous usages. - var hasArg = args.some(function(value) { - return value !== undefined; - }); - if(hasArg) { - loaderContext.loaderIndex--; - iterateNormalLoaders(options, loaderContext, args, callback); - } else { - iteratePitchingLoaders(options, loaderContext, callback); - } - } - ); - }); -} - -function processResource(options, loaderContext, callback) { - // set loader index to last loader - loaderContext.loaderIndex = loaderContext.loaders.length - 1; - - var resourcePath = loaderContext.resourcePath; - if(resourcePath) { - options.processResource(loaderContext, resourcePath, function(err) { - if(err) return callback(err); - var args = Array.prototype.slice.call(arguments, 1); - options.resourceBuffer = args[0]; - iterateNormalLoaders(options, loaderContext, args, callback); - }); - } else { - iterateNormalLoaders(options, loaderContext, [null], callback); - } -} - -function iterateNormalLoaders(options, loaderContext, args, callback) { - if(loaderContext.loaderIndex < 0) - return callback(null, args); - - var currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex]; - - // iterate - if(currentLoaderObject.normalExecuted) { - loaderContext.loaderIndex--; - return iterateNormalLoaders(options, loaderContext, args, callback); - } - - var fn = currentLoaderObject.normal; - currentLoaderObject.normalExecuted = true; - if(!fn) { - return iterateNormalLoaders(options, loaderContext, args, callback); - } - - convertArgs(args, currentLoaderObject.raw); - - runSyncOrAsync(fn, loaderContext, args, function(err) { - if(err) return callback(err); - - var args = Array.prototype.slice.call(arguments, 1); - iterateNormalLoaders(options, loaderContext, args, callback); - }); -} - -exports.getContext = function getContext(resource) { - var path = parsePathQueryFragment(resource).path; - return dirname(path); -}; - -exports.runLoaders = function runLoaders(options, callback) { - // read options - var resource = options.resource || ""; - var loaders = options.loaders || []; - var loaderContext = options.context || {}; - var processResource = options.processResource || ((readResource, context, resource, callback) => { - context.addDependency(resource); - readResource(resource, callback); - }).bind(null, options.readResource || readFile); - - // - var splittedResource = resource && parsePathQueryFragment(resource); - var resourcePath = splittedResource ? splittedResource.path : undefined; - var resourceQuery = splittedResource ? splittedResource.query : undefined; - var resourceFragment = splittedResource ? splittedResource.fragment : undefined; - var contextDirectory = resourcePath ? dirname(resourcePath) : null; - - // execution state - var requestCacheable = true; - var fileDependencies = []; - var contextDependencies = []; - var missingDependencies = []; - - // prepare loader objects - loaders = loaders.map(createLoaderObject); - - loaderContext.context = contextDirectory; - loaderContext.loaderIndex = 0; - loaderContext.loaders = loaders; - loaderContext.resourcePath = resourcePath; - loaderContext.resourceQuery = resourceQuery; - loaderContext.resourceFragment = resourceFragment; - loaderContext.async = null; - loaderContext.callback = null; - loaderContext.cacheable = function cacheable(flag) { - if(flag === false) { - requestCacheable = false; - } - }; - loaderContext.dependency = loaderContext.addDependency = function addDependency(file) { - fileDependencies.push(file); - }; - loaderContext.addContextDependency = function addContextDependency(context) { - contextDependencies.push(context); - }; - loaderContext.addMissingDependency = function addMissingDependency(context) { - missingDependencies.push(context); - }; - loaderContext.getDependencies = function getDependencies() { - return fileDependencies.slice(); - }; - loaderContext.getContextDependencies = function getContextDependencies() { - return contextDependencies.slice(); - }; - loaderContext.getMissingDependencies = function getMissingDependencies() { - return missingDependencies.slice(); - }; - loaderContext.clearDependencies = function clearDependencies() { - fileDependencies.length = 0; - contextDependencies.length = 0; - missingDependencies.length = 0; - requestCacheable = true; - }; - Object.defineProperty(loaderContext, "resource", { - enumerable: true, - get: function() { - if(loaderContext.resourcePath === undefined) - return undefined; - return loaderContext.resourcePath.replace(/#/g, "\0#") + loaderContext.resourceQuery.replace(/#/g, "\0#") + loaderContext.resourceFragment; - }, - set: function(value) { - var splittedResource = value && parsePathQueryFragment(value); - loaderContext.resourcePath = splittedResource ? splittedResource.path : undefined; - loaderContext.resourceQuery = splittedResource ? splittedResource.query : undefined; - loaderContext.resourceFragment = splittedResource ? splittedResource.fragment : undefined; - } - }); - Object.defineProperty(loaderContext, "request", { - enumerable: true, - get: function() { - return loaderContext.loaders.map(function(o) { - return o.request; - }).concat(loaderContext.resource || "").join("!"); - } - }); - Object.defineProperty(loaderContext, "remainingRequest", { - enumerable: true, - get: function() { - if(loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource) - return ""; - return loaderContext.loaders.slice(loaderContext.loaderIndex + 1).map(function(o) { - return o.request; - }).concat(loaderContext.resource || "").join("!"); - } - }); - Object.defineProperty(loaderContext, "currentRequest", { - enumerable: true, - get: function() { - return loaderContext.loaders.slice(loaderContext.loaderIndex).map(function(o) { - return o.request; - }).concat(loaderContext.resource || "").join("!"); - } - }); - Object.defineProperty(loaderContext, "previousRequest", { - enumerable: true, - get: function() { - return loaderContext.loaders.slice(0, loaderContext.loaderIndex).map(function(o) { - return o.request; - }).join("!"); - } - }); - Object.defineProperty(loaderContext, "query", { - enumerable: true, - get: function() { - var entry = loaderContext.loaders[loaderContext.loaderIndex]; - return entry.options && typeof entry.options === "object" ? entry.options : entry.query; - } - }); - Object.defineProperty(loaderContext, "data", { - enumerable: true, - get: function() { - return loaderContext.loaders[loaderContext.loaderIndex].data; - } - }); - - // finish loader context - if(Object.preventExtensions) { - Object.preventExtensions(loaderContext); - } - - var processOptions = { - resourceBuffer: null, - processResource: processResource - }; - iteratePitchingLoaders(processOptions, loaderContext, function(err, result) { - if(err) { - return callback(err, { - cacheable: requestCacheable, - fileDependencies: fileDependencies, - contextDependencies: contextDependencies, - missingDependencies: missingDependencies - }); - } - callback(null, { - result: result, - resourceBuffer: processOptions.resourceBuffer, - cacheable: requestCacheable, - fileDependencies: fileDependencies, - contextDependencies: contextDependencies, - missingDependencies: missingDependencies - }); - }); -}; diff --git a/node_modules/loader-runner/lib/loadLoader.js b/node_modules/loader-runner/lib/loadLoader.js deleted file mode 100644 index 1210353..0000000 --- a/node_modules/loader-runner/lib/loadLoader.js +++ /dev/null @@ -1,54 +0,0 @@ -var LoaderLoadingError = require("./LoaderLoadingError"); -var url; - -module.exports = function loadLoader(loader, callback) { - if(loader.type === "module") { - try { - if(url === undefined) url = require("url"); - var loaderUrl = url.pathToFileURL(loader.path); - var modulePromise = eval("import(" + JSON.stringify(loaderUrl.toString()) + ")"); - modulePromise.then(function(module) { - handleResult(loader, module, callback); - }, callback); - return; - } catch(e) { - callback(e); - } - } else { - try { - var module = require(loader.path); - } catch(e) { - // it is possible for node to choke on a require if the FD descriptor - // limit has been reached. give it a chance to recover. - if(e instanceof Error && e.code === "EMFILE") { - var retry = loadLoader.bind(null, loader, callback); - if(typeof setImmediate === "function") { - // node >= 0.9.0 - return setImmediate(retry); - } else { - // node < 0.9.0 - return process.nextTick(retry); - } - } - return callback(e); - } - return handleResult(loader, module, callback); - } -}; - -function handleResult(loader, module, callback) { - if(typeof module !== "function" && typeof module !== "object") { - return callback(new LoaderLoadingError( - "Module '" + loader.path + "' is not a loader (export function or es6 module)" - )); - } - loader.normal = typeof module === "function" ? module : module.default; - loader.pitch = module.pitch; - loader.raw = module.raw; - if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") { - return callback(new LoaderLoadingError( - "Module '" + loader.path + "' is not a loader (must have normal or pitch function)" - )); - } - callback(); -} diff --git a/node_modules/loader-runner/package.json b/node_modules/loader-runner/package.json deleted file mode 100644 index f8db868..0000000 --- a/node_modules/loader-runner/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "loader-runner", - "version": "4.3.0", - "description": "Runs (webpack) loaders", - "main": "lib/LoaderRunner.js", - "scripts": { - "lint": "eslint lib test", - "pretest": "npm run lint", - "test": "mocha --reporter spec", - "precover": "npm run lint", - "cover": "istanbul cover node_modules/mocha/bin/_mocha" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/webpack/loader-runner.git" - }, - "keywords": [ - "webpack", - "loader" - ], - "author": "Tobias Koppers @sokra", - "license": "MIT", - "bugs": { - "url": "https://github.com/webpack/loader-runner/issues" - }, - "homepage": "https://github.com/webpack/loader-runner#readme", - "engines": { - "node": ">=6.11.5" - }, - "files": [ - "lib/", - "bin/", - "hot/", - "web_modules/", - "schemas/" - ], - "devDependencies": { - "eslint": "^3.12.2", - "eslint-plugin-node": "^3.0.5", - "eslint-plugin-nodeca": "^1.0.3", - "istanbul": "^0.4.1", - "mocha": "^3.2.0", - "should": "^8.0.2" - } -} diff --git a/node_modules/locate-path/index.d.ts b/node_modules/locate-path/index.d.ts deleted file mode 100644 index fbde526..0000000 --- a/node_modules/locate-path/index.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare namespace locatePath { - interface Options { - /** - Current working directory. - - @default process.cwd() - */ - readonly cwd?: string; - - /** - Type of path to match. - - @default 'file' - */ - readonly type?: 'file' | 'directory'; - - /** - Allow symbolic links to match if they point to the requested path type. - - @default true - */ - readonly allowSymlinks?: boolean; - } - - interface AsyncOptions extends Options { - /** - Number of concurrently pending promises. Minimum: `1`. - - @default Infinity - */ - readonly concurrency?: number; - - /** - Preserve `paths` order when searching. - - Disable this to improve performance if you don't care about the order. - - @default true - */ - readonly preserveOrder?: boolean; - } -} - -declare const locatePath: { - /** - Get the first path that exists on disk of multiple paths. - - @param paths - Paths to check. - @returns The first path that exists or `undefined` if none exists. - - @example - ``` - import locatePath = require('locate-path'); - - const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' - ]; - - (async () => { - console(await locatePath(files)); - //=> 'rainbow' - })(); - ``` - */ - (paths: Iterable, options?: locatePath.AsyncOptions): Promise< - string | undefined - >; - - /** - Synchronously get the first path that exists on disk of multiple paths. - - @param paths - Paths to check. - @returns The first path that exists or `undefined` if none exists. - */ - sync( - paths: Iterable, - options?: locatePath.Options - ): string | undefined; -}; - -export = locatePath; diff --git a/node_modules/locate-path/index.js b/node_modules/locate-path/index.js deleted file mode 100644 index 4604bbf..0000000 --- a/node_modules/locate-path/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; -const path = require('path'); -const fs = require('fs'); -const {promisify} = require('util'); -const pLocate = require('p-locate'); - -const fsStat = promisify(fs.stat); -const fsLStat = promisify(fs.lstat); - -const typeMappings = { - directory: 'isDirectory', - file: 'isFile' -}; - -function checkType({type}) { - if (type in typeMappings) { - return; - } - - throw new Error(`Invalid type specified: ${type}`); -} - -const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); - -module.exports = async (paths, options) => { - options = { - cwd: process.cwd(), - type: 'file', - allowSymlinks: true, - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fsStat : fsLStat; - - return pLocate(paths, async path_ => { - try { - const stat = await statFn(path.resolve(options.cwd, path_)); - return matchType(options.type, stat); - } catch (_) { - return false; - } - }, options); -}; - -module.exports.sync = (paths, options) => { - options = { - cwd: process.cwd(), - allowSymlinks: true, - type: 'file', - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; - - for (const path_ of paths) { - try { - const stat = statFn(path.resolve(options.cwd, path_)); - - if (matchType(options.type, stat)) { - return path_; - } - } catch (_) { - } - } -}; diff --git a/node_modules/locate-path/license b/node_modules/locate-path/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/locate-path/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/locate-path/package.json b/node_modules/locate-path/package.json deleted file mode 100644 index 063b290..0000000 --- a/node_modules/locate-path/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "locate-path", - "version": "5.0.0", - "description": "Get the first path that exists on disk of multiple paths", - "license": "MIT", - "repository": "sindresorhus/locate-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "locate", - "path", - "paths", - "file", - "files", - "exists", - "find", - "finder", - "search", - "searcher", - "array", - "iterable", - "iterator" - ], - "dependencies": { - "p-locate": "^4.1.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/locate-path/readme.md b/node_modules/locate-path/readme.md deleted file mode 100644 index 2184c6f..0000000 --- a/node_modules/locate-path/readme.md +++ /dev/null @@ -1,122 +0,0 @@ -# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) - -> Get the first path that exists on disk of multiple paths - - -## Install - -``` -$ npm install locate-path -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const locatePath = require('locate-path'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - console(await locatePath(files)); - //=> 'rainbow' -})(); -``` - - -## API - -### locatePath(paths, [options]) - -Returns a `Promise` for the first path that exists or `undefined` if none exists. - -#### paths - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
-Default: `Infinity`
-Minimum: `1` - -Number of concurrently pending promises. - -##### preserveOrder - -Type: `boolean`
-Default: `true` - -Preserve `paths` order when searching. - -Disable this to improve performance if you don't care about the order. - -##### cwd - -Type: `string`
-Default: `process.cwd()` - -Current working directory. - -##### type - -Type: `string`
-Default: `file`
-Values: `file` `directory` - -The type of paths that can match. - -##### allowSymlinks - -Type: `boolean`
-Default: `true` - -Allow symbolic links to match if they point to the chosen path type. - -### locatePath.sync(paths, [options]) - -Returns the first path that exists or `undefined` if none exists. - -#### paths - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### cwd - -Same as above. - -##### type - -Same as above. - -##### allowSymlinks - -Same as above. - - -## Related - -- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/lodash.filter/LICENSE b/node_modules/lodash.filter/LICENSE deleted file mode 100644 index e0c69d5..0000000 --- a/node_modules/lodash.filter/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/node_modules/lodash.filter/README.md b/node_modules/lodash.filter/README.md deleted file mode 100644 index 0218221..0000000 --- a/node_modules/lodash.filter/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.filter v4.6.0 - -The [lodash](https://lodash.com/) method `_.filter` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.filter -``` - -In Node.js: -```js -var filter = require('lodash.filter'); -``` - -See the [documentation](https://lodash.com/docs#filter) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.filter) for more details. diff --git a/node_modules/lodash.filter/index.js b/node_modules/lodash.filter/index.js deleted file mode 100644 index 4e18bb3..0000000 --- a/node_modules/lodash.filter/index.js +++ /dev/null @@ -1,2366 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used to compose bitmasks for comparison styles. */ -var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding('util'); - } catch (e) {} -}()); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array ? array.length : 0, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; -} - -/** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ -function arraySome(array, predicate) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - this.__data__ = new ListCache(entries); -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - return this.__data__['delete'](key); -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - return this; - } - cache = this.__data__ = new MapCache(pairs); - } - cache.set(key, value); - return this; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; -} - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEach = createBaseEach(baseForOwn); - -/** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; -} - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} - -/** - * The base implementation of `getTag`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - return objectToString.call(value); -} - -/** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHasIn(object, key) { - return object != null && key in Object(object); -} - -/** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ -function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); -} - -/** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = getTag(object); - objTag = objTag == argsTag ? objectTag : objTag; - } - if (!othIsArr) { - othTag = getTag(other); - othTag = othTag == argsTag ? objectTag : othTag; - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; - - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) - : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); - } - if (!(bitmask & PARTIAL_COMPARE_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, equalFunc, customizer, bitmask, stack); -} - -/** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) - : result - )) { - return false; - } - } - } - return true; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; -} - -/** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ -function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); -} - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -/** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; -} - -/** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; -} - -/** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; -} - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value) { - return isArray(value) ? value : stringToPath(value); -} - -/** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; -} - -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -/** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ -function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!seen.has(othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - return seen.add(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, customizer, bitmask, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; -} - -/** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= UNORDERED_COMPARE_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; -} - -/** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ -function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11, -// for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -/** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ -function hasPath(object, path, hasFunc) { - path = isKey(path, object) ? [path] : castPath(path); - - var result, - index = -1, - length = path.length; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result) { - return result; - } - var length = object ? object.length : 0; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && !isObject(value); -} - -/** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; -} - -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoize(function(string) { - string = toString(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); - -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] - * The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ -function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); -} - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; -} - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} - -/** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -/** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - * @example - * - * var objects = [ - * { 'a': { 'b': 2 } }, - * { 'a': { 'b': 1 } } - * ]; - * - * _.map(objects, _.property('a.b')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); - * // => [1, 2] - */ -function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); -} - -module.exports = filter; diff --git a/node_modules/lodash.filter/package.json b/node_modules/lodash.filter/package.json deleted file mode 100644 index 521b8c5..0000000 --- a/node_modules/lodash.filter/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.filter", - "version": "4.6.0", - "description": "The lodash method `_.filter` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, filter", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/node_modules/lodash.merge/LICENSE b/node_modules/lodash.merge/LICENSE deleted file mode 100644 index 77c42f1..0000000 --- a/node_modules/lodash.merge/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright OpenJS Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/node_modules/lodash.merge/README.md b/node_modules/lodash.merge/README.md deleted file mode 100644 index 91b7538..0000000 --- a/node_modules/lodash.merge/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.merge v4.6.2 - -The [Lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.merge -``` - -In Node.js: -```js -var merge = require('lodash.merge'); -``` - -See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.merge) for more details. diff --git a/node_modules/lodash.merge/index.js b/node_modules/lodash.merge/index.js deleted file mode 100644 index 8e75d95..0000000 --- a/node_modules/lodash.merge/index.js +++ /dev/null @@ -1,1977 +0,0 @@ -/** - * Lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeMax = Math.max, - nativeNow = Date.now; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; - this.size = 0; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -/** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } -} - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; -} - -/** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -/** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ -function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); -} - -/** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ -function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); -} - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); -} - -/** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; -} - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} - -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); -} - -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; -} - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} - -/** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } - - if (key == '__proto__') { - return; - } - - return object[key]; -} - -/** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var setToString = shortOut(baseSetToString); - -/** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ -function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; -} - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -/** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ -function toPlainObject(value) { - return copyObject(value, keysIn(value)); -} - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); -} - -/** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ -var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); -}); - -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = merge; diff --git a/node_modules/lodash.merge/package.json b/node_modules/lodash.merge/package.json deleted file mode 100644 index 3130fc8..0000000 --- a/node_modules/lodash.merge/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "lodash.merge", - "version": "4.6.2", - "description": "The Lodash method `_.merge` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, merge", - "author": "John-David Dalton ", - "contributors": [ - "John-David Dalton ", - "Mathias Bynens " - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/node_modules/make-error/LICENSE b/node_modules/make-error/LICENSE deleted file mode 100644 index 9dcf797..0000000 --- a/node_modules/make-error/LICENSE +++ /dev/null @@ -1,5 +0,0 @@ -Copyright 2014 Julien Fontanet - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/make-error/README.md b/node_modules/make-error/README.md deleted file mode 100644 index 5c089a2..0000000 --- a/node_modules/make-error/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# make-error - -[![Package Version](https://badgen.net/npm/v/make-error)](https://npmjs.org/package/make-error) [![Build Status](https://travis-ci.org/JsCommunity/make-error.png?branch=master)](https://travis-ci.org/JsCommunity/make-error) [![PackagePhobia](https://badgen.net/packagephobia/install/make-error)](https://packagephobia.now.sh/result?p=make-error) [![Latest Commit](https://badgen.net/github/last-commit/JsCommunity/make-error)](https://github.com/JsCommunity/make-error/commits/master) - -> Make your own error types! - -## Features - -- Compatible Node & browsers -- `instanceof` support -- `error.name` & `error.stack` support -- compatible with [CSP](https://en.wikipedia.org/wiki/Content_Security_Policy) (i.e. no `eval()`) - -## Installation - -### Node & [Browserify](http://browserify.org/)/[Webpack](https://webpack.js.org/) - -Installation of the [npm package](https://npmjs.org/package/make-error): - -``` -> npm install --save make-error -``` - -Then require the package: - -```javascript -var makeError = require("make-error"); -``` - -### Browser - -You can directly use the build provided at [unpkg.com](https://unpkg.com): - -```html - -``` - -## Usage - -### Basic named error - -```javascript -var CustomError = makeError("CustomError"); - -// Parameters are forwarded to the super class (here Error). -throw new CustomError("a message"); -``` - -### Advanced error class - -```javascript -function CustomError(customValue) { - CustomError.super.call(this, "custom error message"); - - this.customValue = customValue; -} -makeError(CustomError); - -// Feel free to extend the prototype. -CustomError.prototype.myMethod = function CustomError$myMethod() { - console.log("CustomError.myMethod (%s, %s)", this.code, this.message); -}; - -//----- - -try { - throw new CustomError(42); -} catch (error) { - error.myMethod(); -} -``` - -### Specialized error - -```javascript -var SpecializedError = makeError("SpecializedError", CustomError); - -throw new SpecializedError(42); -``` - -### Inheritance - -> Best for ES2015+. - -```javascript -import { BaseError } from "make-error"; - -class CustomError extends BaseError { - constructor() { - super("custom error message"); - } -} -``` - -## Related - -- [make-error-cause](https://www.npmjs.com/package/make-error-cause): Make your own error types, with a cause! - -## Contributions - -Contributions are _very_ welcomed, either on the documentation or on -the code. - -You may: - -- report any [issue](https://github.com/JsCommunity/make-error/issues) - you've encountered; -- fork and create a pull request. - -## License - -ISC © [Julien Fontanet](http://julien.isonoe.net) diff --git a/node_modules/make-error/dist/make-error.js b/node_modules/make-error/dist/make-error.js deleted file mode 100644 index 32444c6..0000000 --- a/node_modules/make-error/dist/make-error.js +++ /dev/null @@ -1 +0,0 @@ -!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).makeError=f()}}(function(){return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i; - -/** - * Set the constructor prototype to `BaseError`. - */ -declare function makeError(super_: { - new (...args: any[]): T; -}): makeError.Constructor; - -/** - * Create a specialized error instance. - */ -declare function makeError( - name: string | Function, - super_: K -): K & makeError.SpecializedConstructor; - -declare namespace makeError { - /** - * Use with ES2015+ inheritance. - */ - export class BaseError extends Error { - message: string; - name: string; - stack: string; - - constructor(message?: string); - } - - export interface Constructor { - new (message?: string): T; - super_: any; - prototype: T; - } - - export interface SpecializedConstructor { - super_: any; - prototype: T; - } -} - -export = makeError; diff --git a/node_modules/make-error/index.js b/node_modules/make-error/index.js deleted file mode 100644 index fab6040..0000000 --- a/node_modules/make-error/index.js +++ /dev/null @@ -1,151 +0,0 @@ -// ISC @ Julien Fontanet - -"use strict"; - -// =================================================================== - -var construct = typeof Reflect !== "undefined" ? Reflect.construct : undefined; -var defineProperty = Object.defineProperty; - -// ------------------------------------------------------------------- - -var captureStackTrace = Error.captureStackTrace; -if (captureStackTrace === undefined) { - captureStackTrace = function captureStackTrace(error) { - var container = new Error(); - - defineProperty(error, "stack", { - configurable: true, - get: function getStack() { - var stack = container.stack; - - // Replace property with value for faster future accesses. - defineProperty(this, "stack", { - configurable: true, - value: stack, - writable: true, - }); - - return stack; - }, - set: function setStack(stack) { - defineProperty(error, "stack", { - configurable: true, - value: stack, - writable: true, - }); - }, - }); - }; -} - -// ------------------------------------------------------------------- - -function BaseError(message) { - if (message !== undefined) { - defineProperty(this, "message", { - configurable: true, - value: message, - writable: true, - }); - } - - var cname = this.constructor.name; - if (cname !== undefined && cname !== this.name) { - defineProperty(this, "name", { - configurable: true, - value: cname, - writable: true, - }); - } - - captureStackTrace(this, this.constructor); -} - -BaseError.prototype = Object.create(Error.prototype, { - // See: https://github.com/JsCommunity/make-error/issues/4 - constructor: { - configurable: true, - value: BaseError, - writable: true, - }, -}); - -// ------------------------------------------------------------------- - -// Sets the name of a function if possible (depends of the JS engine). -var setFunctionName = (function() { - function setFunctionName(fn, name) { - return defineProperty(fn, "name", { - configurable: true, - value: name, - }); - } - try { - var f = function() {}; - setFunctionName(f, "foo"); - if (f.name === "foo") { - return setFunctionName; - } - } catch (_) {} -})(); - -// ------------------------------------------------------------------- - -function makeError(constructor, super_) { - if (super_ == null || super_ === Error) { - super_ = BaseError; - } else if (typeof super_ !== "function") { - throw new TypeError("super_ should be a function"); - } - - var name; - if (typeof constructor === "string") { - name = constructor; - constructor = - construct !== undefined - ? function() { - return construct(super_, arguments, this.constructor); - } - : function() { - super_.apply(this, arguments); - }; - - // If the name can be set, do it once and for all. - if (setFunctionName !== undefined) { - setFunctionName(constructor, name); - name = undefined; - } - } else if (typeof constructor !== "function") { - throw new TypeError("constructor should be either a string or a function"); - } - - // Also register the super constructor also as `constructor.super_` just - // like Node's `util.inherits()`. - // - // eslint-disable-next-line dot-notation - constructor.super_ = constructor["super"] = super_; - - var properties = { - constructor: { - configurable: true, - value: constructor, - writable: true, - }, - }; - - // If the name could not be set on the constructor, set it on the - // prototype. - if (name !== undefined) { - properties.name = { - configurable: true, - value: name, - writable: true, - }; - } - constructor.prototype = Object.create(super_.prototype, properties); - - return constructor; -} -exports = module.exports = makeError; -exports.BaseError = BaseError; diff --git a/node_modules/make-error/package.json b/node_modules/make-error/package.json deleted file mode 100644 index 2af27e1..0000000 --- a/node_modules/make-error/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "make-error", - "version": "1.3.6", - "main": "index.js", - "license": "ISC", - "description": "Make your own error types!", - "keywords": [ - "create", - "custom", - "derive", - "error", - "errors", - "extend", - "extending", - "extension", - "factory", - "inherit", - "make", - "subclass" - ], - "homepage": "https://github.com/JsCommunity/make-error", - "bugs": "https://github.com/JsCommunity/make-error/issues", - "author": "Julien Fontanet ", - "repository": { - "type": "git", - "url": "git://github.com/JsCommunity/make-error.git" - }, - "devDependencies": { - "browserify": "^16.2.3", - "eslint": "^6.5.1", - "eslint-config-prettier": "^6.4.0", - "eslint-config-standard": "^14.1.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^10.0.0", - "eslint-plugin-promise": "^4.0.1", - "eslint-plugin-standard": "^4.0.0", - "husky": "^3.0.9", - "jest": "^24", - "prettier": "^1.14.3", - "uglify-js": "^3.3.2" - }, - "jest": { - "testEnvironment": "node" - }, - "scripts": { - "dev-test": "jest --watch", - "format": "prettier --write '**'", - "prepublishOnly": "mkdir -p dist && browserify -s makeError index.js | uglifyjs -c > dist/make-error.js", - "pretest": "eslint --ignore-path .gitignore .", - "test": "jest" - }, - "files": [ - "dist/", - "index.js", - "index.d.ts" - ], - "husky": { - "hooks": { - "commit-msg": "npm run test" - } - } -} diff --git a/node_modules/merge-stream/LICENSE b/node_modules/merge-stream/LICENSE deleted file mode 100644 index 94a4c0a..0000000 --- a/node_modules/merge-stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Stephen Sugden (stephensugden.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/merge-stream/README.md b/node_modules/merge-stream/README.md deleted file mode 100644 index 0d54841..0000000 --- a/node_modules/merge-stream/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# merge-stream - -Merge (interleave) a bunch of streams. - -[![build status](https://secure.travis-ci.org/grncdr/merge-stream.svg?branch=master)](http://travis-ci.org/grncdr/merge-stream) - -## Synopsis - -```javascript -var stream1 = new Stream(); -var stream2 = new Stream(); - -var merged = mergeStream(stream1, stream2); - -var stream3 = new Stream(); -merged.add(stream3); -merged.isEmpty(); -//=> false -``` - -## Description - -This is adapted from [event-stream](https://github.com/dominictarr/event-stream) separated into a new module, using Streams3. - -## API - -### `mergeStream` - -Type: `function` - -Merges an arbitrary number of streams. Returns a merged stream. - -#### `merged.add` - -A method to dynamically add more sources to the stream. The argument supplied to `add` can be either a source or an array of sources. - -#### `merged.isEmpty` - -A method that tells you if the merged stream is empty. - -When a stream is "empty" (aka. no sources were added), it could not be returned to a gulp task. - -So, we could do something like this: - -```js -stream = require('merge-stream')(); -// Something like a loop to add some streams to the merge stream -// stream.add(streamA); -// stream.add(streamB); -return stream.isEmpty() ? null : stream; -``` - -## Gulp example - -An example use case for **merge-stream** is to combine parts of a task in a project's **gulpfile.js** like this: - -```js -const gulp = require('gulp'); -const htmlValidator = require('gulp-w3c-html-validator'); -const jsHint = require('gulp-jshint'); -const mergeStream = require('merge-stream'); - -function lint() { - return mergeStream( - gulp.src('src/*.html') - .pipe(htmlValidator()) - .pipe(htmlValidator.reporter()), - gulp.src('src/*.js') - .pipe(jsHint()) - .pipe(jsHint.reporter()) - ); -} -gulp.task('lint', lint); -``` - -## License - -MIT diff --git a/node_modules/merge-stream/index.js b/node_modules/merge-stream/index.js deleted file mode 100644 index b1a9e1a..0000000 --- a/node_modules/merge-stream/index.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const { PassThrough } = require('stream'); - -module.exports = function (/*streams...*/) { - var sources = [] - var output = new PassThrough({objectMode: true}) - - output.setMaxListeners(0) - - output.add = add - output.isEmpty = isEmpty - - output.on('unpipe', remove) - - Array.prototype.slice.call(arguments).forEach(add) - - return output - - function add (source) { - if (Array.isArray(source)) { - source.forEach(add) - return this - } - - sources.push(source); - source.once('end', remove.bind(null, source)) - source.once('error', output.emit.bind(output, 'error')) - source.pipe(output, {end: false}) - return this - } - - function isEmpty () { - return sources.length == 0; - } - - function remove (source) { - sources = sources.filter(function (it) { return it !== source }) - if (!sources.length && output.readable) { output.end() } - } -} diff --git a/node_modules/merge-stream/package.json b/node_modules/merge-stream/package.json deleted file mode 100644 index 1a4c54c..0000000 --- a/node_modules/merge-stream/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "merge-stream", - "version": "2.0.0", - "description": "Create a stream that emits events from multiple other streams", - "files": [ - "index.js" - ], - "scripts": { - "test": "istanbul cover test.js && istanbul check-cover --statements 100 --branches 100" - }, - "repository": "grncdr/merge-stream", - "author": "Stephen Sugden ", - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "from2": "^2.0.3", - "istanbul": "^0.4.5" - } -} diff --git a/node_modules/mime-db/HISTORY.md b/node_modules/mime-db/HISTORY.md deleted file mode 100644 index 7436f64..0000000 --- a/node_modules/mime-db/HISTORY.md +++ /dev/null @@ -1,507 +0,0 @@ -1.52.0 / 2022-02-21 -=================== - - * Add extensions from IANA for more `image/*` types - * Add extension `.asc` to `application/pgp-keys` - * Add extensions to various XML types - * Add new upstream MIME types - -1.51.0 / 2021-11-08 -=================== - - * Add new upstream MIME types - * Mark `image/vnd.microsoft.icon` as compressible - * Mark `image/vnd.ms-dds` as compressible - -1.50.0 / 2021-09-15 -=================== - - * Add deprecated iWorks mime types and extensions - * Add new upstream MIME types - -1.49.0 / 2021-07-26 -=================== - - * Add extension `.trig` to `application/trig` - * Add new upstream MIME types - -1.48.0 / 2021-05-30 -=================== - - * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - * Add new upstream MIME types - * Mark `text/yaml` as compressible - -1.47.0 / 2021-04-01 -=================== - - * Add new upstream MIME types - * Remove ambigious extensions from IANA for `application/*+xml` types - * Update primary extension to `.es` for `application/ecmascript` - -1.46.0 / 2021-02-13 -=================== - - * Add extension `.amr` to `audio/amr` - * Add extension `.m4s` to `video/iso.segment` - * Add extension `.opus` to `audio/ogg` - * Add new upstream MIME types - -1.45.0 / 2020-09-22 -=================== - - * Add `application/ubjson` with extension `.ubj` - * Add `image/avif` with extension `.avif` - * Add `image/ktx2` with extension `.ktx2` - * Add extension `.dbf` to `application/vnd.dbf` - * Add extension `.rar` to `application/vnd.rar` - * Add extension `.td` to `application/urc-targetdesc+xml` - * Add new upstream MIME types - * Fix extension of `application/vnd.apple.keynote` to be `.key` - -1.44.0 / 2020-04-22 -=================== - - * Add charsets from IANA - * Add extension `.cjs` to `application/node` - * Add new upstream MIME types - -1.43.0 / 2020-01-05 -=================== - - * Add `application/x-keepass2` with extension `.kdbx` - * Add extension `.mxmf` to `audio/mobile-xmf` - * Add extensions from IANA for `application/*+xml` types - * Add new upstream MIME types - -1.42.0 / 2019-09-25 -=================== - - * Add `image/vnd.ms-dds` with extension `.dds` - * Add new upstream MIME types - * Remove compressible from `multipart/mixed` - -1.41.0 / 2019-08-30 -=================== - - * Add new upstream MIME types - * Add `application/toml` with extension `.toml` - * Mark `font/ttf` as compressible - -1.40.0 / 2019-04-20 -=================== - - * Add extensions from IANA for `model/*` types - * Add `text/mdx` with extension `.mdx` - -1.39.0 / 2019-04-04 -=================== - - * Add extensions `.siv` and `.sieve` to `application/sieve` - * Add new upstream MIME types - -1.38.0 / 2019-02-04 -=================== - - * Add extension `.nq` to `application/n-quads` - * Add extension `.nt` to `application/n-triples` - * Add new upstream MIME types - * Mark `text/less` as compressible - -1.37.0 / 2018-10-19 -=================== - - * Add extensions to HEIC image types - * Add new upstream MIME types - -1.36.0 / 2018-08-20 -=================== - - * Add Apple file extensions from IANA - * Add extensions from IANA for `image/*` types - * Add new upstream MIME types - -1.35.0 / 2018-07-15 -=================== - - * Add extension `.owl` to `application/rdf+xml` - * Add new upstream MIME types - - Removes extension `.woff` from `application/font-woff` - -1.34.0 / 2018-06-03 -=================== - - * Add extension `.csl` to `application/vnd.citationstyles.style+xml` - * Add extension `.es` to `application/ecmascript` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/turtle` - * Mark all XML-derived types as compressible - -1.33.0 / 2018-02-15 -=================== - - * Add extensions from IANA for `message/*` types - * Add new upstream MIME types - * Fix some incorrect OOXML types - * Remove `application/font-woff2` - -1.32.0 / 2017-11-29 -=================== - - * Add new upstream MIME types - * Update `text/hjson` to registered `application/hjson` - * Add `text/shex` with extension `.shex` - -1.31.0 / 2017-10-25 -=================== - - * Add `application/raml+yaml` with extension `.raml` - * Add `application/wasm` with extension `.wasm` - * Add new `font` type from IANA - * Add new upstream font extensions - * Add new upstream MIME types - * Add extensions for JPEG-2000 images - -1.30.0 / 2017-08-27 -=================== - - * Add `application/vnd.ms-outlook` - * Add `application/x-arj` - * Add extension `.mjs` to `application/javascript` - * Add glTF types and extensions - * Add new upstream MIME types - * Add `text/x-org` - * Add VirtualBox MIME types - * Fix `source` records for `video/*` types that are IANA - * Update `font/opentype` to registered `font/otf` - -1.29.0 / 2017-07-10 -=================== - - * Add `application/fido.trusted-apps+json` - * Add extension `.wadl` to `application/vnd.sun.wadl+xml` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/css` - -1.28.0 / 2017-05-14 -=================== - - * Add new upstream MIME types - * Add extension `.gz` to `application/gzip` - * Update extensions `.md` and `.markdown` to be `text/markdown` - -1.27.0 / 2017-03-16 -=================== - - * Add new upstream MIME types - * Add `image/apng` with extension `.apng` - -1.26.0 / 2017-01-14 -=================== - - * Add new upstream MIME types - * Add extension `.geojson` to `application/geo+json` - -1.25.0 / 2016-11-11 -=================== - - * Add new upstream MIME types - -1.24.0 / 2016-09-18 -=================== - - * Add `audio/mp3` - * Add new upstream MIME types - -1.23.0 / 2016-05-01 -=================== - - * Add new upstream MIME types - * Add extension `.3gpp` to `audio/3gpp` - -1.22.0 / 2016-02-15 -=================== - - * Add `text/slim` - * Add extension `.rng` to `application/xml` - * Add new upstream MIME types - * Fix extension of `application/dash+xml` to be `.mpd` - * Update primary extension to `.m4a` for `audio/mp4` - -1.21.0 / 2016-01-06 -=================== - - * Add Google document types - * Add new upstream MIME types - -1.20.0 / 2015-11-10 -=================== - - * Add `text/x-suse-ymp` - * Add new upstream MIME types - -1.19.0 / 2015-09-17 -=================== - - * Add `application/vnd.apple.pkpass` - * Add new upstream MIME types - -1.18.0 / 2015-09-03 -=================== - - * Add new upstream MIME types - -1.17.0 / 2015-08-13 -=================== - - * Add `application/x-msdos-program` - * Add `audio/g711-0` - * Add `image/vnd.mozilla.apng` - * Add extension `.exe` to `application/x-msdos-program` - -1.16.0 / 2015-07-29 -=================== - - * Add `application/vnd.uri-map` - -1.15.0 / 2015-07-13 -=================== - - * Add `application/x-httpd-php` - -1.14.0 / 2015-06-25 -=================== - - * Add `application/scim+json` - * Add `application/vnd.3gpp.ussd+xml` - * Add `application/vnd.biopax.rdf+xml` - * Add `text/x-processing` - -1.13.0 / 2015-06-07 -=================== - - * Add nginx as a source - * Add `application/x-cocoa` - * Add `application/x-java-archive-diff` - * Add `application/x-makeself` - * Add `application/x-perl` - * Add `application/x-pilot` - * Add `application/x-redhat-package-manager` - * Add `application/x-sea` - * Add `audio/x-m4a` - * Add `audio/x-realaudio` - * Add `image/x-jng` - * Add `text/mathml` - -1.12.0 / 2015-06-05 -=================== - - * Add `application/bdoc` - * Add `application/vnd.hyperdrive+json` - * Add `application/x-bdoc` - * Add extension `.rtf` to `text/rtf` - -1.11.0 / 2015-05-31 -=================== - - * Add `audio/wav` - * Add `audio/wave` - * Add extension `.litcoffee` to `text/coffeescript` - * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` - * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` - -1.10.0 / 2015-05-19 -=================== - - * Add `application/vnd.balsamiq.bmpr` - * Add `application/vnd.microsoft.portable-executable` - * Add `application/x-ns-proxy-autoconfig` - -1.9.1 / 2015-04-19 -================== - - * Remove `.json` extension from `application/manifest+json` - - This is causing bugs downstream - -1.9.0 / 2015-04-19 -================== - - * Add `application/manifest+json` - * Add `application/vnd.micro+json` - * Add `image/vnd.zbrush.pcx` - * Add `image/x-ms-bmp` - -1.8.0 / 2015-03-13 -================== - - * Add `application/vnd.citationstyles.style+xml` - * Add `application/vnd.fastcopy-disk-image` - * Add `application/vnd.gov.sk.xmldatacontainer+xml` - * Add extension `.jsonld` to `application/ld+json` - -1.7.0 / 2015-02-08 -================== - - * Add `application/vnd.gerber` - * Add `application/vnd.msa-disk-image` - -1.6.1 / 2015-02-05 -================== - - * Community extensions ownership transferred from `node-mime` - -1.6.0 / 2015-01-29 -================== - - * Add `application/jose` - * Add `application/jose+json` - * Add `application/json-seq` - * Add `application/jwk+json` - * Add `application/jwk-set+json` - * Add `application/jwt` - * Add `application/rdap+json` - * Add `application/vnd.gov.sk.e-form+xml` - * Add `application/vnd.ims.imsccv1p3` - -1.5.0 / 2014-12-30 -================== - - * Add `application/vnd.oracle.resource+json` - * Fix various invalid MIME type entries - - `application/mbox+xml` - - `application/oscp-response` - - `application/vwg-multiplexed` - - `audio/g721` - -1.4.0 / 2014-12-21 -================== - - * Add `application/vnd.ims.imsccv1p2` - * Fix various invalid MIME type entries - - `application/vnd-acucobol` - - `application/vnd-curl` - - `application/vnd-dart` - - `application/vnd-dxr` - - `application/vnd-fdf` - - `application/vnd-mif` - - `application/vnd-sema` - - `application/vnd-wap-wmlc` - - `application/vnd.adobe.flash-movie` - - `application/vnd.dece-zip` - - `application/vnd.dvb_service` - - `application/vnd.micrografx-igx` - - `application/vnd.sealed-doc` - - `application/vnd.sealed-eml` - - `application/vnd.sealed-mht` - - `application/vnd.sealed-ppt` - - `application/vnd.sealed-tiff` - - `application/vnd.sealed-xls` - - `application/vnd.sealedmedia.softseal-html` - - `application/vnd.sealedmedia.softseal-pdf` - - `application/vnd.wap-slc` - - `application/vnd.wap-wbxml` - - `audio/vnd.sealedmedia.softseal-mpeg` - - `image/vnd-djvu` - - `image/vnd-svf` - - `image/vnd-wap-wbmp` - - `image/vnd.sealed-png` - - `image/vnd.sealedmedia.softseal-gif` - - `image/vnd.sealedmedia.softseal-jpg` - - `model/vnd-dwf` - - `model/vnd.parasolid.transmit-binary` - - `model/vnd.parasolid.transmit-text` - - `text/vnd-a` - - `text/vnd-curl` - - `text/vnd.wap-wml` - * Remove example template MIME types - - `application/example` - - `audio/example` - - `image/example` - - `message/example` - - `model/example` - - `multipart/example` - - `text/example` - - `video/example` - -1.3.1 / 2014-12-16 -================== - - * Fix missing extensions - - `application/json5` - - `text/hjson` - -1.3.0 / 2014-12-07 -================== - - * Add `application/a2l` - * Add `application/aml` - * Add `application/atfx` - * Add `application/atxml` - * Add `application/cdfx+xml` - * Add `application/dii` - * Add `application/json5` - * Add `application/lxf` - * Add `application/mf4` - * Add `application/vnd.apache.thrift.compact` - * Add `application/vnd.apache.thrift.json` - * Add `application/vnd.coffeescript` - * Add `application/vnd.enphase.envoy` - * Add `application/vnd.ims.imsccv1p1` - * Add `text/csv-schema` - * Add `text/hjson` - * Add `text/markdown` - * Add `text/yaml` - -1.2.0 / 2014-11-09 -================== - - * Add `application/cea` - * Add `application/dit` - * Add `application/vnd.gov.sk.e-form+zip` - * Add `application/vnd.tmd.mediaflex.api+xml` - * Type `application/epub+zip` is now IANA-registered - -1.1.2 / 2014-10-23 -================== - - * Rebuild database for `application/x-www-form-urlencoded` change - -1.1.1 / 2014-10-20 -================== - - * Mark `application/x-www-form-urlencoded` as compressible. - -1.1.0 / 2014-09-28 -================== - - * Add `application/font-woff2` - -1.0.3 / 2014-09-25 -================== - - * Fix engine requirement in package - -1.0.2 / 2014-09-25 -================== - - * Add `application/coap-group+json` - * Add `application/dcd` - * Add `application/vnd.apache.thrift.binary` - * Add `image/vnd.tencent.tap` - * Mark all JSON-derived types as compressible - * Update `text/vtt` data - -1.0.1 / 2014-08-30 -================== - - * Fix extension ordering - -1.0.0 / 2014-08-30 -================== - - * Add `application/atf` - * Add `application/merge-patch+json` - * Add `multipart/x-mixed-replace` - * Add `source: 'apache'` metadata - * Add `source: 'iana'` metadata - * Remove badly-assumed charset data diff --git a/node_modules/mime-db/LICENSE b/node_modules/mime-db/LICENSE deleted file mode 100644 index 0751cb1..0000000 --- a/node_modules/mime-db/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015-2022 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mime-db/README.md b/node_modules/mime-db/README.md deleted file mode 100644 index 5a8fcfe..0000000 --- a/node_modules/mime-db/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# mime-db - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -This is a large database of mime types and information about them. -It consists of a single, public JSON file and does not include any logic, -allowing it to remain as un-opinionated as possible with an API. -It aggregates data from the following sources: - -- http://www.iana.org/assignments/media-types/media-types.xhtml -- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types - -## Installation - -```bash -npm install mime-db -``` - -### Database Download - -If you're crazy enough to use this in the browser, you can just grab the -JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to -replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) -as the JSON format may change in the future. - -``` -https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json -``` - -## Usage - -```js -var db = require('mime-db') - -// grab data on .js files -var data = db['application/javascript'] -``` - -## Data Structure - -The JSON file is a map lookup for lowercased mime types. -Each mime type has the following properties: - -- `.source` - where the mime type is defined. - If not set, it's probably a custom media type. - - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) - - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) -- `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type can be gzipped. -- `.charset` - the default charset associated with this type, if any. - -If unknown, every property could be `undefined`. - -## Contributing - -To edit the database, only make PRs against `src/custom-types.json` or -`src/custom-suffix.json`. - -The `src/custom-types.json` file is a JSON object with the MIME type as the -keys and the values being an object with the following keys: - -- `compressible` - leave out if you don't know, otherwise `true`/`false` to - indicate whether the data represented by the type is typically compressible. -- `extensions` - include an array of file extensions that are associated with - the type. -- `notes` - human-readable notes about the type, typically what the type is. -- `sources` - include an array of URLs of where the MIME type and the associated - extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); - links to type aggregating sites and Wikipedia are _not acceptable_. - -To update the build, run `npm run build`. - -### Adding Custom Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -If that is not possible / feasible, they can be added directly here as a -"custom" type. To do this, it is required to have a primary source that -definitively lists the media type. If an extension is going to be listed as -associateed with this media type, the source must definitively link the -media type and extension as well. - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci -[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://badgen.net/npm/node/mime-db -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-db -[npm-url]: https://npmjs.org/package/mime-db -[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/node_modules/mime-db/db.json b/node_modules/mime-db/db.json deleted file mode 100644 index eb9c42c..0000000 --- a/node_modules/mime-db/db.json +++ /dev/null @@ -1,8519 +0,0 @@ -{ - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/3gpp-ims+xml": { - "source": "iana", - "compressible": true - }, - "application/3gpphal+json": { - "source": "iana", - "compressible": true - }, - "application/3gpphalforms+json": { - "source": "iana", - "compressible": true - }, - "application/a2l": { - "source": "iana" - }, - "application/ace+cbor": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/activity+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamcontrol+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamparams+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": ["ez"] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": ["aw"] - }, - "application/at+jwt": { - "source": "iana" - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atom"] - }, - "application/atomcat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomcat"] - }, - "application/atomdeleted+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomdeleted"] - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomsvc"] - }, - "application/atsc-dwd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dwd"] - }, - "application/atsc-dynamic-event-message": { - "source": "iana" - }, - "application/atsc-held+xml": { - "source": "iana", - "compressible": true, - "extensions": ["held"] - }, - "application/atsc-rdt+json": { - "source": "iana", - "compressible": true - }, - "application/atsc-rsat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsat"] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana", - "compressible": true - }, - "application/bacnet-xdd+zip": { - "source": "iana", - "compressible": false - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/beep+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xcs"] - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/captive+json": { - "source": "iana", - "compressible": true - }, - "application/cbor": { - "source": "iana" - }, - "application/cbor-seq": { - "source": "iana" - }, - "application/cccex": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana", - "compressible": true - }, - "application/ccxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ccxml"] - }, - "application/cdfx+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdfx"] - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": ["cdmia"] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": ["cdmic"] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": ["cdmid"] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": ["cdmio"] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": ["cdmiq"] - }, - "application/cdni": { - "source": "iana" - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana", - "compressible": true - }, - "application/cellml+xml": { - "source": "iana", - "compressible": true - }, - "application/cfw": { - "source": "iana" - }, - "application/city+json": { - "source": "iana", - "compressible": true - }, - "application/clr": { - "source": "iana" - }, - "application/clue+xml": { - "source": "iana", - "compressible": true - }, - "application/clue_info+xml": { - "source": "iana", - "compressible": true - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana", - "compressible": true - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/coap-payload": { - "source": "iana" - }, - "application/commonground": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/cose": { - "source": "iana" - }, - "application/cose-key": { - "source": "iana" - }, - "application/cose-key-set": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cpl"] - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana", - "compressible": true - }, - "application/cstadata+xml": { - "source": "iana", - "compressible": true - }, - "application/csvm+json": { - "source": "iana", - "compressible": true - }, - "application/cu-seeme": { - "source": "apache", - "extensions": ["cu"] - }, - "application/cwt": { - "source": "iana" - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpd"] - }, - "application/dash-patch+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpp"] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "compressible": true, - "extensions": ["davmount"] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana", - "compressible": true - }, - "application/dicom": { - "source": "iana" - }, - "application/dicom+json": { - "source": "iana", - "compressible": true - }, - "application/dicom+xml": { - "source": "iana", - "compressible": true - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/dns+json": { - "source": "iana", - "compressible": true - }, - "application/dns-message": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dbk"] - }, - "application/dots+cbor": { - "source": "iana" - }, - "application/dskpp+xml": { - "source": "iana", - "compressible": true - }, - "application/dssc+der": { - "source": "iana", - "extensions": ["dssc"] - }, - "application/dssc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdssc"] - }, - "application/dvcs": { - "source": "iana" - }, - "application/ecmascript": { - "source": "iana", - "compressible": true, - "extensions": ["es","ecma"] - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/efi": { - "source": "iana" - }, - "application/elm+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/elm+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.cap+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/emergencycalldata.comment+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.control+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.deviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.ecall.msd": { - "source": "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.serviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.subscriberinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.veds+xml": { - "source": "iana", - "compressible": true - }, - "application/emma+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emma"] - }, - "application/emotionml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emotionml"] - }, - "application/encaprtp": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana", - "compressible": true - }, - "application/epub+zip": { - "source": "iana", - "compressible": false, - "extensions": ["epub"] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": ["exi"] - }, - "application/expect-ct-report+json": { - "source": "iana", - "compressible": true - }, - "application/express": { - "source": "iana", - "extensions": ["exp"] - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fdt"] - }, - "application/fhir+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fhir+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fido.trusted-apps+json": { - "compressible": true - }, - "application/fits": { - "source": "iana" - }, - "application/flexfec": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": ["pfr"] - }, - "application/font-woff": { - "source": "iana", - "compressible": false - }, - "application/framework-attributes+xml": { - "source": "iana", - "compressible": true - }, - "application/geo+json": { - "source": "iana", - "compressible": true, - "extensions": ["geojson"] - }, - "application/geo+json-seq": { - "source": "iana" - }, - "application/geopackage+sqlite3": { - "source": "iana" - }, - "application/geoxacml+xml": { - "source": "iana", - "compressible": true - }, - "application/gltf-buffer": { - "source": "iana" - }, - "application/gml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["gml"] - }, - "application/gpx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["gpx"] - }, - "application/gxf": { - "source": "apache", - "extensions": ["gxf"] - }, - "application/gzip": { - "source": "iana", - "compressible": false, - "extensions": ["gz"] - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana", - "compressible": true - }, - "application/hjson": { - "extensions": ["hjson"] - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": ["stk"] - }, - "application/ibe-key-request+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pkg-reply+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ink","inkml"] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": ["ipfix"] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana", - "compressible": true, - "extensions": ["its"] - }, - "application/java-archive": { - "source": "apache", - "compressible": false, - "extensions": ["jar","war","ear"] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": ["ser"] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": ["class"] - }, - "application/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js","mjs"] - }, - "application/jf2feed+json": { - "source": "iana", - "compressible": true - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/jscalendar+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["json","map"] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": ["json5"] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": ["jsonml"] - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana", - "compressible": true - }, - "application/kpml-response+xml": { - "source": "iana", - "compressible": true - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": ["jsonld"] - }, - "application/lgr+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lgr"] - }, - "application/link-format": { - "source": "iana" - }, - "application/load-control+xml": { - "source": "iana", - "compressible": true - }, - "application/lost+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lostxml"] - }, - "application/lostsync+xml": { - "source": "iana", - "compressible": true - }, - "application/lpf+zip": { - "source": "iana", - "compressible": false - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": ["hqx"] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": ["cpt"] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mads"] - }, - "application/manifest+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["webmanifest"] - }, - "application/marc": { - "source": "iana", - "extensions": ["mrc"] - }, - "application/marcxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mrcx"] - }, - "application/mathematica": { - "source": "iana", - "extensions": ["ma","nb","mb"] - }, - "application/mathml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mathml"] - }, - "application/mathml-content+xml": { - "source": "iana", - "compressible": true - }, - "application/mathml-presentation+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-deregister+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-envelope+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-protection-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-reception-report+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-schedule+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-user-service-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbox": { - "source": "iana", - "extensions": ["mbox"] - }, - "application/media-policy-dataset+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpf"] - }, - "application/media_control+xml": { - "source": "iana", - "compressible": true - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mscml"] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "compressible": true, - "extensions": ["metalink"] - }, - "application/metalink4+xml": { - "source": "iana", - "compressible": true, - "extensions": ["meta4"] - }, - "application/mets+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mets"] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mipc": { - "source": "iana" - }, - "application/missing-blocks+cbor-seq": { - "source": "iana" - }, - "application/mmt-aei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["maei"] - }, - "application/mmt-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musd"] - }, - "application/mods+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mods"] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": ["m21","mp21"] - }, - "application/mp4": { - "source": "iana", - "extensions": ["mp4s","m4p"] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana", - "compressible": true - }, - "application/mrb-publish+xml": { - "source": "iana", - "compressible": true - }, - "application/msc-ivr+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msc-mixer+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": ["doc","dot"] - }, - "application/mud+json": { - "source": "iana", - "compressible": true - }, - "application/multipart-core": { - "source": "iana" - }, - "application/mxf": { - "source": "iana", - "extensions": ["mxf"] - }, - "application/n-quads": { - "source": "iana", - "extensions": ["nq"] - }, - "application/n-triples": { - "source": "iana", - "extensions": ["nt"] - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-groupinfo": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana", - "compressible": true - }, - "application/node": { - "source": "iana", - "extensions": ["cjs"] - }, - "application/nss": { - "source": "iana" - }, - "application/oauth-authz-req+jwt": { - "source": "iana" - }, - "application/oblivious-dns-message": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": false, - "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] - }, - "application/oda": { - "source": "iana", - "extensions": ["oda"] - }, - "application/odm+xml": { - "source": "iana", - "compressible": true - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["opf"] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogx"] - }, - "application/omdoc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["omdoc"] - }, - "application/onenote": { - "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg"] - }, - "application/opc-nodeset+xml": { - "source": "iana", - "compressible": true - }, - "application/oscore": { - "source": "iana" - }, - "application/oxps": { - "source": "iana", - "extensions": ["oxps"] - }, - "application/p21": { - "source": "iana" - }, - "application/p21+zip": { - "source": "iana", - "compressible": false - }, - "application/p2p-overlay+xml": { - "source": "iana", - "compressible": true, - "extensions": ["relo"] - }, - "application/parityfec": { - "source": "iana" - }, - "application/passport": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xer"] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": ["pdf"] - }, - "application/pdx": { - "source": "iana" - }, - "application/pem-certificate-chain": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": ["pgp"] - }, - "application/pgp-keys": { - "source": "iana", - "extensions": ["asc"] - }, - "application/pgp-signature": { - "source": "iana", - "extensions": ["asc","sig"] - }, - "application/pics-rules": { - "source": "apache", - "extensions": ["prf"] - }, - "application/pidf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pidf-diff+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pkcs10": { - "source": "iana", - "extensions": ["p10"] - }, - "application/pkcs12": { - "source": "iana" - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": ["p7m","p7c"] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": ["p7s"] - }, - "application/pkcs8": { - "source": "iana", - "extensions": ["p8"] - }, - "application/pkcs8-encrypted": { - "source": "iana" - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": ["ac"] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": ["cer"] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": ["crl"] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": ["pkipath"] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": ["pki"] - }, - "application/pls+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pls"] - }, - "application/poc-settings+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": ["ai","eps","ps"] - }, - "application/ppsp-tracker+json": { - "source": "iana", - "compressible": true - }, - "application/problem+json": { - "source": "iana", - "compressible": true - }, - "application/problem+xml": { - "source": "iana", - "compressible": true - }, - "application/provenance+xml": { - "source": "iana", - "compressible": true, - "extensions": ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": ["cww"] - }, - "application/prs.cyn": { - "source": "iana", - "charset": "7-BIT" - }, - "application/prs.hpub+zip": { - "source": "iana", - "compressible": false - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana", - "compressible": true - }, - "application/pskc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pskcxml"] - }, - "application/pvd+json": { - "source": "iana", - "compressible": true - }, - "application/qsig": { - "source": "iana" - }, - "application/raml+yaml": { - "compressible": true, - "extensions": ["raml"] - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rdf","owl"] - }, - "application/reginfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rif"] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": ["rnc"] - }, - "application/remote-printing": { - "source": "iana" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resource-lists+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rl"] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rld"] - }, - "application/rfc+xml": { - "source": "iana", - "compressible": true - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana", - "compressible": true - }, - "application/rls-services+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rs"] - }, - "application/route-apd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rapd"] - }, - "application/route-s-tsid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sls"] - }, - "application/route-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rusd"] - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": ["gbr"] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": ["mft"] - }, - "application/rpki-publication": { - "source": "iana" - }, - "application/rpki-roa": { - "source": "iana", - "extensions": ["roa"] - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rsd"] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rss"] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana", - "compressible": true - }, - "application/samlmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/sarif+json": { - "source": "iana", - "compressible": true - }, - "application/sarif-external-properties+json": { - "source": "iana", - "compressible": true - }, - "application/sbe": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sbml"] - }, - "application/scaip+xml": { - "source": "iana", - "compressible": true - }, - "application/scim+json": { - "source": "iana", - "compressible": true - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": ["scq"] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": ["scs"] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": ["spq"] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": ["spp"] - }, - "application/sdp": { - "source": "iana", - "extensions": ["sdp"] - }, - "application/secevent+jwt": { - "source": "iana" - }, - "application/senml+cbor": { - "source": "iana" - }, - "application/senml+json": { - "source": "iana", - "compressible": true - }, - "application/senml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["senmlx"] - }, - "application/senml-etch+cbor": { - "source": "iana" - }, - "application/senml-etch+json": { - "source": "iana", - "compressible": true - }, - "application/senml-exi": { - "source": "iana" - }, - "application/sensml+cbor": { - "source": "iana" - }, - "application/sensml+json": { - "source": "iana", - "compressible": true - }, - "application/sensml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sensmlx"] - }, - "application/sensml-exi": { - "source": "iana" - }, - "application/sep+xml": { - "source": "iana", - "compressible": true - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": ["setpay"] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": ["setreg"] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["shf"] - }, - "application/sieve": { - "source": "iana", - "extensions": ["siv","sieve"] - }, - "application/simple-filter+xml": { - "source": "iana", - "compressible": true - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/sipc": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "iana" - }, - "application/smil+xml": { - "source": "iana", - "compressible": true, - "extensions": ["smi","smil"] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": ["rq"] - }, - "application/sparql-results+xml": { - "source": "iana", - "compressible": true, - "extensions": ["srx"] - }, - "application/spdx+json": { - "source": "iana", - "compressible": true - }, - "application/spirits-event+xml": { - "source": "iana", - "compressible": true - }, - "application/sql": { - "source": "iana" - }, - "application/srgs": { - "source": "iana", - "extensions": ["gram"] - }, - "application/srgs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["grxml"] - }, - "application/sru+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sru"] - }, - "application/ssdl+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ssdl"] - }, - "application/ssml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ssml"] - }, - "application/stix+json": { - "source": "iana", - "compressible": true - }, - "application/swid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["swidtag"] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/taxii+json": { - "source": "iana", - "compressible": true - }, - "application/td+json": { - "source": "iana", - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tei","teicorpus"] - }, - "application/tetra_isi": { - "source": "iana" - }, - "application/thraud+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tfi"] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": ["tsd"] - }, - "application/tlsrpt+gzip": { - "source": "iana" - }, - "application/tlsrpt+json": { - "source": "iana", - "compressible": true - }, - "application/tnauthlist": { - "source": "iana" - }, - "application/token-introspection+jwt": { - "source": "iana" - }, - "application/toml": { - "compressible": true, - "extensions": ["toml"] - }, - "application/trickle-ice-sdpfrag": { - "source": "iana" - }, - "application/trig": { - "source": "iana", - "extensions": ["trig"] - }, - "application/ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ttml"] - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/tzif": { - "source": "iana" - }, - "application/tzif-leap": { - "source": "iana" - }, - "application/ubjson": { - "compressible": false, - "extensions": ["ubj"] - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/urc-ressheet+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsheet"] - }, - "application/urc-targetdesc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["td"] - }, - "application/urc-uisocketdesc+xml": { - "source": "iana", - "compressible": true - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana", - "compressible": true - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - "source": "iana", - "compressible": true, - "extensions": ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-v2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.5gnas": { - "source": "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gmop+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gtpc": { - "source": "iana" - }, - "application/vnd.3gpp.interworking-data": { - "source": "iana" - }, - "application/vnd.3gpp.lpp": { - "source": "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-payload": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-signalling": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mid-call+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ngap": { - "source": "iana" - }, - "application/vnd.3gpp.pfcp": { - "source": "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - "source": "iana" - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp.sms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ussd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - "source": "iana" - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": ["aso"] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": ["imp"] - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": ["acu"] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": ["atc","acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "compressible": false, - "extensions": ["air"] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": ["fcdt"] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": ["fxp","fxpl"] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdp"] - }, - "application/vnd.adobe.xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - "source": "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - "source": "iana" - }, - "application/vnd.afpc.foca-charset": { - "source": "iana" - }, - "application/vnd.afpc.foca-codedfont": { - "source": "iana" - }, - "application/vnd.afpc.foca-codepage": { - "source": "iana" - }, - "application/vnd.afpc.modca": { - "source": "iana" - }, - "application/vnd.afpc.modca-cmtable": { - "source": "iana" - }, - "application/vnd.afpc.modca-formdef": { - "source": "iana" - }, - "application/vnd.afpc.modca-mediummap": { - "source": "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - "source": "iana" - }, - "application/vnd.afpc.modca-overlay": { - "source": "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - "source": "iana" - }, - "application/vnd.age": { - "source": "iana", - "extensions": ["age"] - }, - "application/vnd.ah-barcode": { - "source": "iana" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": ["azs"] - }, - "application/vnd.amadeus+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - "source": "iana" - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": ["acc"] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.android.ota": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": ["apk"] - }, - "application/vnd.anki": { - "source": "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": ["fti"] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": ["atx"] - }, - "application/vnd.apache.arrow.file": { - "source": "iana" - }, - "application/vnd.apache.arrow.stream": { - "source": "iana" - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.aplextor.warrp+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apothekende.reservation+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpkg"] - }, - "application/vnd.apple.keynote": { - "source": "iana", - "extensions": ["key"] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": ["m3u8"] - }, - "application/vnd.apple.numbers": { - "source": "iana", - "extensions": ["numbers"] - }, - "application/vnd.apple.pages": { - "source": "iana", - "extensions": ["pages"] - }, - "application/vnd.apple.pkpass": { - "compressible": false, - "extensions": ["pkpass"] - }, - "application/vnd.arastra.swi": { - "source": "iana" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": ["swi"] - }, - "application/vnd.artisan+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": ["iota"] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": ["aep"] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avalon+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.avistar+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - "source": "iana" - }, - "application/vnd.banana-accounting": { - "source": "iana" - }, - "application/vnd.bbf.usp.error": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bint.med-content": { - "source": "iana" - }, - "application/vnd.biopax.rdf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.blink-idb-value-wrapper": { - "source": "iana" - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": ["bmi"] - }, - "application/vnd.bpf": { - "source": "iana" - }, - "application/vnd.bpf3": { - "source": "iana" - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": ["rep"] - }, - "application/vnd.byu.uapi+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.capasystems-pg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdxml"] - }, - "application/vnd.chess-pgn": { - "source": "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": ["mmd"] - }, - "application/vnd.ciedi": { - "source": "iana" - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana", - "compressible": true, - "extensions": ["csl"] - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": ["cla"] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": ["rp9"] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": ["c4g","c4d","c4f","c4p","c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": ["c11amz"] - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.comicbook+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.comicbook-rar": { - "source": "iana" - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": ["csp"] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": ["cmc"] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": ["clkp"] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.crypto-shade-file": { - "source": "iana" - }, - "application/vnd.cryptomator.encrypted": { - "source": "iana" - }, - "application/vnd.cryptomator.vault": { - "source": "iana" - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": ["pml"] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": ["ppd"] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": ["car"] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.cyclonedx+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cyclonedx+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.d3m-dataset": { - "source": "iana" - }, - "application/vnd.d3m-problem": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": ["dart"] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": ["rdz"] - }, - "application/vnd.datapackage+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dataresource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dbf": { - "source": "iana", - "extensions": ["dbf"] - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": ["uvf","uvvf","uvd","uvvd"] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uvt","uvvt"] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": ["uvx","uvvx"] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": ["uvz","uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": ["fe_launch"] - }, - "application/vnd.desmume.movie": { - "source": "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dna": { - "source": "iana", - "extensions": ["dna"] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": ["dpg"] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": ["dfac"] - }, - "application/vnd.drive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": ["kpxx"] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": ["svc"] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": ["geo"] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecip.rlp": { - "source": "iana" - }, - "application/vnd.eclipse.ditto+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": ["mag"] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.efi.img": { - "source": "iana" - }, - "application/vnd.efi.iso": { - "source": "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": ["nml"] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": ["esf"] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": ["msf"] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": ["qam"] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": ["slt"] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.espass-espass+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "compressible": true, - "extensions": ["es3","et3"] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.cug+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.sci+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eu.kasparian.car+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.evolv.ecig.profile": { - "source": "iana" - }, - "application/vnd.evolv.ecig.settings": { - "source": "iana" - }, - "application/vnd.evolv.ecig.theme": { - "source": "iana" - }, - "application/vnd.exstream-empower+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.exstream-package": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": ["ez2"] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": ["ez3"] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "iana", - "extensions": ["fdf"] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": ["mseed"] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": ["seed","dataless"] - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.ficlab.flb+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.filmit.zfc": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": ["gph"] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": ["fm","frame","maker","book"] - }, - "application/vnd.frogans.fnc": { - "source": "iana", - "extensions": ["fnc"] - }, - "application/vnd.frogans.ltf": { - "source": "iana", - "extensions": ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.futoin+cbor": { - "source": "iana" - }, - "application/vnd.futoin+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": ["txd"] - }, - "application/vnd.gentics.grd+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geo+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": ["ggb"] - }, - "application/vnd.geogebra.slides": { - "source": "iana" - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": ["ggt"] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": ["gex","gre"] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": ["gxt"] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": ["g2w"] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": ["g3w"] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": ["gmx"] - }, - "application/vnd.google-apps.document": { - "compressible": false, - "extensions": ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - "compressible": false, - "extensions": ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - "compressible": false, - "extensions": ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["kml"] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": ["gqf","gqs"] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": ["gac"] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": ["ghf"] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": ["gim"] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": ["grv"] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": ["gtm"] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": ["tpl"] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": ["vcg"] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "compressible": true, - "extensions": ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zmm"] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": ["hbci"] - }, - "application/vnd.hc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.hdt": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": ["les"] - }, - "application/vnd.hl7cda+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.hl7v2+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": ["hpgl"] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": ["hpid"] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": ["hps"] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": ["jlt"] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": ["pcl"] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": ["pclxl"] - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana", - "extensions": ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyper-item+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyperdrive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "iana" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": ["mpy"] - }, - "application/vnd.ibm.modcap": { - "source": "iana", - "extensions": ["afp","listafp","list3820"] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": ["irm"] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": ["sc"] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": ["icc","icm"] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.imagemeter.image+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": ["ivp"] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.informix-visionary": { - "source": "iana" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": ["igm"] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": ["xpw","xpx"] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": ["i2g"] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": ["qbo"] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["irp"] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": ["xpr"] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.jam": { - "source": "iana", - "extensions": ["jam"] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": ["rms"] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": ["jisp"] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": ["ktz","ktr"] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": ["karbon"] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": ["chrt"] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": ["kfo"] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": ["flw"] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": ["kon"] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": ["kpr","kpt"] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": ["ksp"] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": ["kwd","kwt"] - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": ["htke"] - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": ["kia"] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": ["kne","knp"] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": ["skp","skd","skt","skm"] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": ["sse"] - }, - "application/vnd.las": { - "source": "iana" - }, - "application/vnd.las.las+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.las.las+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lasxml"] - }, - "application/vnd.laszip": { - "source": "iana" - }, - "application/vnd.leap+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.liberty-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.loom": { - "source": "iana" - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": ["123"] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": ["apr"] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": ["pre"] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": ["nsf"] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": ["org"] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": ["scm"] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": ["lwp"] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - "source": "iana", - "extensions": ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxar.archive.3tz+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": ["mcd"] - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": ["mwf"] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": ["mfm"] - }, - "application/vnd.micro+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": ["flo"] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - "source": "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - "source": "iana" - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": ["daf"] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": ["dis"] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": ["mbk"] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": ["mqy"] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": ["msl"] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": ["plc"] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": ["txf"] - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": ["mpn"] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xul"] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": ["cil"] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": ["xltm"] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": ["eot"] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": ["chm"] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": ["ims"] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": ["thmx"] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-outlook": { - "compressible": false, - "extensions": ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": ["cat"] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": ["ppt","pps","pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-printschematicket+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": ["mpp","mpt"] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-windows.devicepairing": { - "source": "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": ["dotm"] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": ["wps","wks","wcm","wdb"] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": ["xps"] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": ["mseq"] - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": ["mus"] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": ["msty"] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nearst.inv+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nebumind.line": { - "source": "iana" - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": ["nlu"] - }, - "application/vnd.nimn": { - "source": "iana" - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": ["ntf","nitf"] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": ["nnd"] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": ["nns"] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": ["nnw"] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "iana", - "extensions": ["n-gage"] - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": ["rpss"] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": ["edm"] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": ["edx"] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": ["ext"] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - "source": "iana", - "extensions": ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": ["oth"] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.ocf+cbor": { - "source": "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": ["xo"] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+cbor": { - "source": "iana" - }, - "application/vnd.oma.lwm2m+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+tlv": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.omads-email+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-file+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-folder+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.onepager": { - "source": "iana" - }, - "application/vnd.onepagertamp": { - "source": "iana" - }, - "application/vnd.onepagertamx": { - "source": "iana" - }, - "application/vnd.onepagertat": { - "source": "iana" - }, - "application/vnd.onepagertatp": { - "source": "iana" - }, - "application/vnd.onepagertatx": { - "source": "iana" - }, - "application/vnd.openblox.game+xml": { - "source": "iana", - "compressible": true, - "extensions": ["obgx"] - }, - "application/vnd.openblox.game-binary": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osm"] - }, - "application/vnd.opentimestamps.ots": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "iana", - "extensions": ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "iana", - "extensions": ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "iana", - "extensions": ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": ["mgp"] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": ["dp"] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oxli.countgraph": { - "source": "iana" - }, - "application/vnd.pagerduty+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.palm": { - "source": "iana", - "extensions": ["pdb","pqa","oprc"] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "iana" - }, - "application/vnd.patentdive": { - "source": "iana" - }, - "application/vnd.patientecommsdoc": { - "source": "iana" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": ["paw"] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": ["str"] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": ["efif"] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": ["plf"] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": ["box"] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": ["mgz"] - }, - "application/vnd.psfs": { - "source": "iana" - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": ["qps"] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quarantainenet": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.rar": { - "source": "iana", - "extensions": ["rar"] - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": ["bed"] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.resilient.logic": { - "source": "iana" - }, - "application/vnd.restful+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": ["cryptonote"] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": ["cod"] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "compressible": true, - "extensions": ["link66"] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": ["st"] - }, - "application/vnd.sar": { - "source": "iana" - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": ["see"] - }, - "application/vnd.seis+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.sema": { - "source": "iana", - "extensions": ["sema"] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": ["semd"] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": ["semf"] - }, - "application/vnd.shade-save-file": { - "source": "iana" - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": ["itp"] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": ["iif"] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": ["ipk"] - }, - "application/vnd.shootproof+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shopkick+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shp": { - "source": "iana" - }, - "application/vnd.shx": { - "source": "iana" - }, - "application/vnd.sigrok.session": { - "source": "iana" - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": ["twd","twds"] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": ["mmf"] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": ["teacher"] - }, - "application/vnd.snesdev-page-table": { - "source": "iana" - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sdkm","sdkd"] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": ["dxp"] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": ["sfs"] - }, - "application/vnd.sqlite3": { - "source": "iana" - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": ["sdc"] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": ["sda"] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": ["sdd"] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": ["smf"] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": ["sdw","vor"] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": ["sgl"] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": ["sm"] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wadl"] - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": ["stc"] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": ["std"] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": ["sti"] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": ["sxm"] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": ["stw"] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": ["sus","susp"] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": ["svd"] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.sycle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.syft+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": ["sis","sisx"] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tableschema+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": ["tao"] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": ["pcap","cap","dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.tml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": ["tmo"] - }, - "application/vnd.tri.onesource": { - "source": "iana" - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": ["tpt"] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": ["mxs"] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": ["tra"] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": ["ufd","ufdl"] - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": ["utz"] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": ["umj"] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": ["unityweb"] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uoml"] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.uri-map": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": ["vcx"] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.vel+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.veritone.aion+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.veryant.thin": { - "source": "iana" - }, - "application/vnd.ves.encrypted": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": ["vsd","vst","vss","vsw"] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": ["vis"] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": ["vsf"] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["wbxml"] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": ["wmlsc"] - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": ["wtb"] - }, - "application/vnd.wfa.dpp": { - "source": "iana" - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": ["nbp"] - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": ["wpd"] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.wv.ssp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": ["xar"] - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": ["xfdl"] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": ["cmp"] - }, - "application/vnd.youtube.yt": { - "source": "iana" - }, - "application/vnd.zul": { - "source": "iana", - "extensions": ["zir","zirz"] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zaz"] - }, - "application/voicexml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["vxml"] - }, - "application/voucher-cms+json": { - "source": "iana", - "compressible": true - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/wasm": { - "source": "iana", - "compressible": true, - "extensions": ["wasm"] - }, - "application/watcherinfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wif"] - }, - "application/webpush-options+json": { - "source": "iana", - "compressible": true - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": ["wgt"] - }, - "application/winhlp": { - "source": "apache", - "extensions": ["hlp"] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wsdl"] - }, - "application/wspolicy+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wspolicy"] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["7z"] - }, - "application/x-abiword": { - "source": "apache", - "extensions": ["abw"] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": ["ace"] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": ["dmg"] - }, - "application/x-arj": { - "compressible": false, - "extensions": ["arj"] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": ["aab","x32","u32","vox"] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": ["aam"] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": ["aas"] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": ["bcpio"] - }, - "application/x-bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": ["torrent"] - }, - "application/x-blorb": { - "source": "apache", - "extensions": ["blb","blorb"] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": ["bz"] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": ["bz2","boz"] - }, - "application/x-cbr": { - "source": "apache", - "extensions": ["cbr","cba","cbt","cbz","cb7"] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": ["vcd"] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": ["cfs"] - }, - "application/x-chat": { - "source": "apache", - "extensions": ["chat"] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": ["pgn"] - }, - "application/x-chrome-extension": { - "extensions": ["crx"] - }, - "application/x-cocoa": { - "source": "nginx", - "extensions": ["cco"] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-conference": { - "source": "apache", - "extensions": ["nsc"] - }, - "application/x-cpio": { - "source": "apache", - "extensions": ["cpio"] - }, - "application/x-csh": { - "source": "apache", - "extensions": ["csh"] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": ["deb","udeb"] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": ["dgc"] - }, - "application/x-director": { - "source": "apache", - "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] - }, - "application/x-doom": { - "source": "apache", - "extensions": ["wad"] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ncx"] - }, - "application/x-dtbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dtb"] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "compressible": true, - "extensions": ["res"] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": ["dvi"] - }, - "application/x-envoy": { - "source": "apache", - "extensions": ["evy"] - }, - "application/x-eva": { - "source": "apache", - "extensions": ["eva"] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": ["bdf"] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": ["gsf"] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": ["psf"] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": ["pcf"] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": ["snf"] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-type1": { - "source": "apache", - "extensions": ["pfa","pfb","pfm","afm"] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": ["arc"] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": ["spl"] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": ["gca"] - }, - "application/x-glulx": { - "source": "apache", - "extensions": ["ulx"] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": ["gnumeric"] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": ["gramps"] - }, - "application/x-gtar": { - "source": "apache", - "extensions": ["gtar"] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": ["hdf"] - }, - "application/x-httpd-php": { - "compressible": true, - "extensions": ["php"] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": ["install"] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - "extensions": ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - "extensions": ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - "extensions": ["pages"] - }, - "application/x-java-archive-diff": { - "source": "nginx", - "extensions": ["jardiff"] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": ["jnlp"] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-keepass2": { - "extensions": ["kdbx"] - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": ["latex"] - }, - "application/x-lua-bytecode": { - "extensions": ["luac"] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": ["lzh","lha"] - }, - "application/x-makeself": { - "source": "nginx", - "extensions": ["run"] - }, - "application/x-mie": { - "source": "apache", - "extensions": ["mie"] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": ["prc","mobi"] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": ["application"] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": ["lnk"] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": ["wmd"] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": ["wmz"] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": ["xbap"] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": ["mdb"] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": ["obd"] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": ["crd"] - }, - "application/x-msclip": { - "source": "apache", - "extensions": ["clp"] - }, - "application/x-msdos-program": { - "extensions": ["exe"] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": ["exe","dll","com","bat","msi"] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": ["mvb","m13","m14"] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": ["wmf","wmz","emf","emz"] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": ["mny"] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": ["pub"] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": ["scd"] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": ["trm"] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": ["wri"] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": ["nc","cdf"] - }, - "application/x-ns-proxy-autoconfig": { - "compressible": true, - "extensions": ["pac"] - }, - "application/x-nzb": { - "source": "apache", - "extensions": ["nzb"] - }, - "application/x-perl": { - "source": "nginx", - "extensions": ["pl","pm"] - }, - "application/x-pilot": { - "source": "nginx", - "extensions": ["prc","pdb"] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": ["p12","pfx"] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": ["p7b","spc"] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": ["p7r"] - }, - "application/x-pki-message": { - "source": "iana" - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["rar"] - }, - "application/x-redhat-package-manager": { - "source": "nginx", - "extensions": ["rpm"] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": ["ris"] - }, - "application/x-sea": { - "source": "nginx", - "extensions": ["sea"] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": ["sh"] - }, - "application/x-shar": { - "source": "apache", - "extensions": ["shar"] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": ["swf"] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": ["xap"] - }, - "application/x-sql": { - "source": "apache", - "extensions": ["sql"] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": ["sit"] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": ["sitx"] - }, - "application/x-subrip": { - "source": "apache", - "extensions": ["srt"] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": ["sv4cpio"] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": ["sv4crc"] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": ["t3"] - }, - "application/x-tads": { - "source": "apache", - "extensions": ["gam"] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": ["tar"] - }, - "application/x-tcl": { - "source": "apache", - "extensions": ["tcl","tk"] - }, - "application/x-tex": { - "source": "apache", - "extensions": ["tex"] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": ["tfm"] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": ["texinfo","texi"] - }, - "application/x-tgif": { - "source": "apache", - "extensions": ["obj"] - }, - "application/x-ustar": { - "source": "apache", - "extensions": ["ustar"] - }, - "application/x-virtualbox-hdd": { - "compressible": true, - "extensions": ["hdd"] - }, - "application/x-virtualbox-ova": { - "compressible": true, - "extensions": ["ova"] - }, - "application/x-virtualbox-ovf": { - "compressible": true, - "extensions": ["ovf"] - }, - "application/x-virtualbox-vbox": { - "compressible": true, - "extensions": ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - "compressible": false, - "extensions": ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - "compressible": true, - "extensions": ["vdi"] - }, - "application/x-virtualbox-vhd": { - "compressible": true, - "extensions": ["vhd"] - }, - "application/x-virtualbox-vmdk": { - "compressible": true, - "extensions": ["vmdk"] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": ["src"] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": ["webapp"] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "iana", - "extensions": ["der","crt","pem"] - }, - "application/x-x509-ca-ra-cert": { - "source": "iana" - }, - "application/x-x509-next-ca-cert": { - "source": "iana" - }, - "application/x-xfig": { - "source": "apache", - "extensions": ["fig"] - }, - "application/x-xliff+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xlf"] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": ["xpi"] - }, - "application/x-xz": { - "source": "apache", - "extensions": ["xz"] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana", - "compressible": true - }, - "application/xaml+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xaml"] - }, - "application/xcap-att+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xav"] - }, - "application/xcap-caps+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xca"] - }, - "application/xcap-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/xcap-el+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xel"] - }, - "application/xcap-error+xml": { - "source": "iana", - "compressible": true - }, - "application/xcap-ns+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xns"] - }, - "application/xcon-conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana", - "compressible": true - }, - "application/xenc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xenc"] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtml","xht"] - }, - "application/xhtml-voice+xml": { - "source": "apache", - "compressible": true - }, - "application/xliff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xlf"] - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml","xsl","xsd","rng"] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": ["dtd"] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/xmpp+xml": { - "source": "iana", - "compressible": true - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xop"] - }, - "application/xproc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xpl"] - }, - "application/xslt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xsl","xslt"] - }, - "application/xspf+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xspf"] - }, - "application/xv+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mxml","xhvml","xvml","xvm"] - }, - "application/yang": { - "source": "iana", - "extensions": ["yang"] - }, - "application/yang-data+json": { - "source": "iana", - "compressible": true - }, - "application/yang-data+xml": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+json": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/yin+xml": { - "source": "iana", - "compressible": true, - "extensions": ["yin"] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": ["zip"] - }, - "application/zlib": { - "source": "iana" - }, - "application/zstd": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana", - "compressible": false, - "extensions": ["3gpp"] - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/aac": { - "source": "iana" - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": ["adp"] - }, - "audio/amr": { - "source": "iana", - "extensions": ["amr"] - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": ["au","snd"] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/evs": { - "source": "iana" - }, - "audio/flexfec": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g711-0": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/melp": { - "source": "iana" - }, - "audio/melp1200": { - "source": "iana" - }, - "audio/melp2400": { - "source": "iana" - }, - "audio/melp600": { - "source": "iana" - }, - "audio/mhas": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": ["mid","midi","kar","rmi"] - }, - "audio/mobile-xmf": { - "source": "iana", - "extensions": ["mxmf"] - }, - "audio/mp3": { - "compressible": false, - "extensions": ["mp3"] - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["m4a","mp4a"] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["oga","ogg","spx","opus"] - }, - "audio/opus": { - "source": "iana" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": ["s3m"] - }, - "audio/scip": { - "source": "iana" - }, - "audio/silk": { - "source": "apache", - "extensions": ["sil"] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sofa": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tetra_acelp": { - "source": "iana" - }, - "audio/tetra_acelp_bb": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/tsvcis": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/usac": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": ["uva","uvva"] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": ["eol"] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": ["dra"] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": ["dts"] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": ["dtshd"] - }, - "audio/vnd.dts.uhd": { - "source": "iana" - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.presonus.multitrack": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": ["rip"] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/wav": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/wave": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": ["weba"] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": ["aac"] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": ["aif","aiff","aifc"] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": ["caf"] - }, - "audio/x-flac": { - "source": "apache", - "extensions": ["flac"] - }, - "audio/x-m4a": { - "source": "nginx", - "extensions": ["m4a"] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": ["mka"] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": ["m3u"] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": ["wax"] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": ["wma"] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": ["ram","ra"] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": ["rmp"] - }, - "audio/x-realaudio": { - "source": "nginx", - "extensions": ["ra"] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": ["wav"] - }, - "audio/xm": { - "source": "apache", - "extensions": ["xm"] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": ["cdx"] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": ["cif"] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": ["cmdf"] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": ["cml"] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": ["csml"] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": ["xyz"] - }, - "font/collection": { - "source": "iana", - "extensions": ["ttc"] - }, - "font/otf": { - "source": "iana", - "compressible": true, - "extensions": ["otf"] - }, - "font/sfnt": { - "source": "iana" - }, - "font/ttf": { - "source": "iana", - "compressible": true, - "extensions": ["ttf"] - }, - "font/woff": { - "source": "iana", - "extensions": ["woff"] - }, - "font/woff2": { - "source": "iana", - "extensions": ["woff2"] - }, - "image/aces": { - "source": "iana", - "extensions": ["exr"] - }, - "image/apng": { - "compressible": false, - "extensions": ["apng"] - }, - "image/avci": { - "source": "iana", - "extensions": ["avci"] - }, - "image/avcs": { - "source": "iana", - "extensions": ["avcs"] - }, - "image/avif": { - "source": "iana", - "compressible": false, - "extensions": ["avif"] - }, - "image/bmp": { - "source": "iana", - "compressible": true, - "extensions": ["bmp"] - }, - "image/cgm": { - "source": "iana", - "extensions": ["cgm"] - }, - "image/dicom-rle": { - "source": "iana", - "extensions": ["drle"] - }, - "image/emf": { - "source": "iana", - "extensions": ["emf"] - }, - "image/fits": { - "source": "iana", - "extensions": ["fits"] - }, - "image/g3fax": { - "source": "iana", - "extensions": ["g3"] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": ["gif"] - }, - "image/heic": { - "source": "iana", - "extensions": ["heic"] - }, - "image/heic-sequence": { - "source": "iana", - "extensions": ["heics"] - }, - "image/heif": { - "source": "iana", - "extensions": ["heif"] - }, - "image/heif-sequence": { - "source": "iana", - "extensions": ["heifs"] - }, - "image/hej2k": { - "source": "iana", - "extensions": ["hej2"] - }, - "image/hsj2": { - "source": "iana", - "extensions": ["hsj2"] - }, - "image/ief": { - "source": "iana", - "extensions": ["ief"] - }, - "image/jls": { - "source": "iana", - "extensions": ["jls"] - }, - "image/jp2": { - "source": "iana", - "compressible": false, - "extensions": ["jp2","jpg2"] - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": ["jpeg","jpg","jpe"] - }, - "image/jph": { - "source": "iana", - "extensions": ["jph"] - }, - "image/jphc": { - "source": "iana", - "extensions": ["jhc"] - }, - "image/jpm": { - "source": "iana", - "compressible": false, - "extensions": ["jpm"] - }, - "image/jpx": { - "source": "iana", - "compressible": false, - "extensions": ["jpx","jpf"] - }, - "image/jxr": { - "source": "iana", - "extensions": ["jxr"] - }, - "image/jxra": { - "source": "iana", - "extensions": ["jxra"] - }, - "image/jxrs": { - "source": "iana", - "extensions": ["jxrs"] - }, - "image/jxs": { - "source": "iana", - "extensions": ["jxs"] - }, - "image/jxsc": { - "source": "iana", - "extensions": ["jxsc"] - }, - "image/jxsi": { - "source": "iana", - "extensions": ["jxsi"] - }, - "image/jxss": { - "source": "iana", - "extensions": ["jxss"] - }, - "image/ktx": { - "source": "iana", - "extensions": ["ktx"] - }, - "image/ktx2": { - "source": "iana", - "extensions": ["ktx2"] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": ["png"] - }, - "image/prs.btif": { - "source": "iana", - "extensions": ["btif"] - }, - "image/prs.pti": { - "source": "iana", - "extensions": ["pti"] - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": ["sgi"] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["svg","svgz"] - }, - "image/t38": { - "source": "iana", - "extensions": ["t38"] - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": ["tif","tiff"] - }, - "image/tiff-fx": { - "source": "iana", - "extensions": ["tfx"] - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana", - "extensions": ["azv"] - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": ["uvi","uvvi","uvg","uvvg"] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": ["djvu","djv"] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": ["dwg"] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": ["dxf"] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": ["fbs"] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": ["fpx"] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana", - "compressible": true, - "extensions": ["ico"] - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.mozilla.apng": { - "source": "iana" - }, - "image/vnd.ms-dds": { - "compressible": true, - "extensions": ["dds"] - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": ["mdi"] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": ["wdp"] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": ["npx"] - }, - "image/vnd.pco.b16": { - "source": "iana", - "extensions": ["b16"] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana", - "extensions": ["tap"] - }, - "image/vnd.valve.source.texture": { - "source": "iana", - "extensions": ["vtf"] - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": ["wbmp"] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": ["xif"] - }, - "image/vnd.zbrush.pcx": { - "source": "iana", - "extensions": ["pcx"] - }, - "image/webp": { - "source": "apache", - "extensions": ["webp"] - }, - "image/wmf": { - "source": "iana", - "extensions": ["wmf"] - }, - "image/x-3ds": { - "source": "apache", - "extensions": ["3ds"] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": ["ras"] - }, - "image/x-cmx": { - "source": "apache", - "extensions": ["cmx"] - }, - "image/x-freehand": { - "source": "apache", - "extensions": ["fh","fhc","fh4","fh5","fh7"] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": ["ico"] - }, - "image/x-jng": { - "source": "nginx", - "extensions": ["jng"] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": ["sid"] - }, - "image/x-ms-bmp": { - "source": "nginx", - "compressible": true, - "extensions": ["bmp"] - }, - "image/x-pcx": { - "source": "apache", - "extensions": ["pcx"] - }, - "image/x-pict": { - "source": "apache", - "extensions": ["pic","pct"] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": ["pnm"] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": ["pbm"] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": ["pgm"] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": ["ppm"] - }, - "image/x-rgb": { - "source": "apache", - "extensions": ["rgb"] - }, - "image/x-tga": { - "source": "apache", - "extensions": ["tga"] - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": ["xbm"] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": ["xpm"] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": ["xwd"] - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana", - "extensions": [ - "disposition-notification" - ] - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana", - "extensions": ["u8msg"] - }, - "message/global-delivery-status": { - "source": "iana", - "extensions": ["u8dsn"] - }, - "message/global-disposition-notification": { - "source": "iana", - "extensions": ["u8mdn"] - }, - "message/global-headers": { - "source": "iana", - "extensions": ["u8hdr"] - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/news": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": ["eml","mime"] - }, - "message/s-http": { - "source": "iana" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "iana" - }, - "message/vnd.wfa.wsc": { - "source": "iana", - "extensions": ["wsc"] - }, - "model/3mf": { - "source": "iana", - "extensions": ["3mf"] - }, - "model/e57": { - "source": "iana" - }, - "model/gltf+json": { - "source": "iana", - "compressible": true, - "extensions": ["gltf"] - }, - "model/gltf-binary": { - "source": "iana", - "compressible": true, - "extensions": ["glb"] - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": ["igs","iges"] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": ["msh","mesh","silo"] - }, - "model/mtl": { - "source": "iana", - "extensions": ["mtl"] - }, - "model/obj": { - "source": "iana", - "extensions": ["obj"] - }, - "model/step": { - "source": "iana" - }, - "model/step+xml": { - "source": "iana", - "compressible": true, - "extensions": ["stpx"] - }, - "model/step+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpz"] - }, - "model/step-xml+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpxz"] - }, - "model/stl": { - "source": "iana", - "extensions": ["stl"] - }, - "model/vnd.collada+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dae"] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": ["dwf"] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": ["gdl"] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": ["gtw"] - }, - "model/vnd.moml+xml": { - "source": "iana", - "compressible": true - }, - "model/vnd.mts": { - "source": "iana", - "extensions": ["mts"] - }, - "model/vnd.opengex": { - "source": "iana", - "extensions": ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana", - "extensions": ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana", - "extensions": ["x_t"] - }, - "model/vnd.pytha.pyox": { - "source": "iana" - }, - "model/vnd.rosette.annotated-data-model": { - "source": "iana" - }, - "model/vnd.sap.vds": { - "source": "iana", - "extensions": ["vds"] - }, - "model/vnd.usdz+zip": { - "source": "iana", - "compressible": false, - "extensions": ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana", - "extensions": ["bsp"] - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": ["vtu"] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": ["wrl","vrml"] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": ["x3db","x3dbz"] - }, - "model/x3d+fastinfoset": { - "source": "iana", - "extensions": ["x3db"] - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": ["x3dv","x3dvz"] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": ["x3d","x3dz"] - }, - "model/x3d-vrml": { - "source": "iana", - "extensions": ["x3dv"] - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana" - }, - "multipart/multilingual": { - "source": "iana" - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/vnd.bint.med-plus": { - "source": "iana" - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": ["appcache","manifest"] - }, - "text/calendar": { - "source": "iana", - "extensions": ["ics","ifb"] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": ["coffee","litcoffee"] - }, - "text/cql": { - "source": "iana" - }, - "text/cql-expression": { - "source": "iana" - }, - "text/cql-identifier": { - "source": "iana" - }, - "text/css": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["css"] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": ["csv"] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "iana" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/fhirpath": { - "source": "iana" - }, - "text/flexfec": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/gff3": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": ["html","htm","shtml"] - }, - "text/jade": { - "extensions": ["jade"] - }, - "text/javascript": { - "source": "iana", - "compressible": true - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": ["jsx"] - }, - "text/less": { - "compressible": true, - "extensions": ["less"] - }, - "text/markdown": { - "source": "iana", - "compressible": true, - "extensions": ["markdown","md"] - }, - "text/mathml": { - "source": "nginx", - "extensions": ["mml"] - }, - "text/mdx": { - "compressible": true, - "extensions": ["mdx"] - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["n3"] - }, - "text/parameters": { - "source": "iana", - "charset": "UTF-8" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": ["txt","text","conf","def","list","log","in","ini"] - }, - "text/provenance-notation": { - "source": "iana", - "charset": "UTF-8" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": ["dsc"] - }, - "text/prs.prop.logic": { - "source": "iana" - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": ["rtx"] - }, - "text/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": ["sgml","sgm"] - }, - "text/shaclc": { - "source": "iana" - }, - "text/shex": { - "source": "iana", - "extensions": ["shex"] - }, - "text/slim": { - "extensions": ["slim","slm"] - }, - "text/spdx": { - "source": "iana", - "extensions": ["spdx"] - }, - "text/strings": { - "source": "iana" - }, - "text/stylus": { - "extensions": ["stylus","styl"] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": ["tsv"] - }, - "text/troff": { - "source": "iana", - "extensions": ["t","tr","roff","man","me","ms"] - }, - "text/turtle": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["ttl"] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": ["uri","uris","urls"] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": ["vcard"] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.ascii-art": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": ["curl"] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": ["dcurl"] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": ["mcurl"] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": ["scurl"] - }, - "text/vnd.debian.copyright": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - "source": "iana", - "extensions": ["ged"] - }, - "text/vnd.ficlab.flt": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": ["fly"] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": ["flx"] - }, - "text/vnd.gml": { - "source": "iana" - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": ["gv"] - }, - "text/vnd.hans": { - "source": "iana" - }, - "text/vnd.hgl": { - "source": "iana" - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": ["3dml"] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": ["spot"] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.senx.warpscript": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "iana" - }, - "text/vnd.sosi": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["jad"] - }, - "text/vnd.trolltech.linguist": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": ["wml"] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": ["wmls"] - }, - "text/vtt": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["vtt"] - }, - "text/x-asm": { - "source": "apache", - "extensions": ["s","asm"] - }, - "text/x-c": { - "source": "apache", - "extensions": ["c","cc","cxx","cpp","h","hh","dic"] - }, - "text/x-component": { - "source": "nginx", - "extensions": ["htc"] - }, - "text/x-fortran": { - "source": "apache", - "extensions": ["f","for","f77","f90"] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": ["hbs"] - }, - "text/x-java-source": { - "source": "apache", - "extensions": ["java"] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": ["lua"] - }, - "text/x-markdown": { - "compressible": true, - "extensions": ["mkd"] - }, - "text/x-nfo": { - "source": "apache", - "extensions": ["nfo"] - }, - "text/x-opml": { - "source": "apache", - "extensions": ["opml"] - }, - "text/x-org": { - "compressible": true, - "extensions": ["org"] - }, - "text/x-pascal": { - "source": "apache", - "extensions": ["p","pas"] - }, - "text/x-processing": { - "compressible": true, - "extensions": ["pde"] - }, - "text/x-sass": { - "extensions": ["sass"] - }, - "text/x-scss": { - "extensions": ["scss"] - }, - "text/x-setext": { - "source": "apache", - "extensions": ["etx"] - }, - "text/x-sfv": { - "source": "apache", - "extensions": ["sfv"] - }, - "text/x-suse-ymp": { - "compressible": true, - "extensions": ["ymp"] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": ["uu"] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": ["vcs"] - }, - "text/x-vcard": { - "source": "apache", - "extensions": ["vcf"] - }, - "text/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml"] - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "compressible": true, - "extensions": ["yaml","yml"] - }, - "video/1d-interleaved-parityfec": { - "source": "iana" - }, - "video/3gpp": { - "source": "iana", - "extensions": ["3gp","3gpp"] - }, - "video/3gpp-tt": { - "source": "iana" - }, - "video/3gpp2": { - "source": "iana", - "extensions": ["3g2"] - }, - "video/av1": { - "source": "iana" - }, - "video/bmpeg": { - "source": "iana" - }, - "video/bt656": { - "source": "iana" - }, - "video/celb": { - "source": "iana" - }, - "video/dv": { - "source": "iana" - }, - "video/encaprtp": { - "source": "iana" - }, - "video/ffv1": { - "source": "iana" - }, - "video/flexfec": { - "source": "iana" - }, - "video/h261": { - "source": "iana", - "extensions": ["h261"] - }, - "video/h263": { - "source": "iana", - "extensions": ["h263"] - }, - "video/h263-1998": { - "source": "iana" - }, - "video/h263-2000": { - "source": "iana" - }, - "video/h264": { - "source": "iana", - "extensions": ["h264"] - }, - "video/h264-rcdo": { - "source": "iana" - }, - "video/h264-svc": { - "source": "iana" - }, - "video/h265": { - "source": "iana" - }, - "video/iso.segment": { - "source": "iana", - "extensions": ["m4s"] - }, - "video/jpeg": { - "source": "iana", - "extensions": ["jpgv"] - }, - "video/jpeg2000": { - "source": "iana" - }, - "video/jpm": { - "source": "apache", - "extensions": ["jpm","jpgm"] - }, - "video/jxsv": { - "source": "iana" - }, - "video/mj2": { - "source": "iana", - "extensions": ["mj2","mjp2"] - }, - "video/mp1s": { - "source": "iana" - }, - "video/mp2p": { - "source": "iana" - }, - "video/mp2t": { - "source": "iana", - "extensions": ["ts"] - }, - "video/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["mp4","mp4v","mpg4"] - }, - "video/mp4v-es": { - "source": "iana" - }, - "video/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpeg","mpg","mpe","m1v","m2v"] - }, - "video/mpeg4-generic": { - "source": "iana" - }, - "video/mpv": { - "source": "iana" - }, - "video/nv": { - "source": "iana" - }, - "video/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogv"] - }, - "video/parityfec": { - "source": "iana" - }, - "video/pointer": { - "source": "iana" - }, - "video/quicktime": { - "source": "iana", - "compressible": false, - "extensions": ["qt","mov"] - }, - "video/raptorfec": { - "source": "iana" - }, - "video/raw": { - "source": "iana" - }, - "video/rtp-enc-aescm128": { - "source": "iana" - }, - "video/rtploopback": { - "source": "iana" - }, - "video/rtx": { - "source": "iana" - }, - "video/scip": { - "source": "iana" - }, - "video/smpte291": { - "source": "iana" - }, - "video/smpte292m": { - "source": "iana" - }, - "video/ulpfec": { - "source": "iana" - }, - "video/vc1": { - "source": "iana" - }, - "video/vc2": { - "source": "iana" - }, - "video/vnd.cctv": { - "source": "iana" - }, - "video/vnd.dece.hd": { - "source": "iana", - "extensions": ["uvh","uvvh"] - }, - "video/vnd.dece.mobile": { - "source": "iana", - "extensions": ["uvm","uvvm"] - }, - "video/vnd.dece.mp4": { - "source": "iana" - }, - "video/vnd.dece.pd": { - "source": "iana", - "extensions": ["uvp","uvvp"] - }, - "video/vnd.dece.sd": { - "source": "iana", - "extensions": ["uvs","uvvs"] - }, - "video/vnd.dece.video": { - "source": "iana", - "extensions": ["uvv","uvvv"] - }, - "video/vnd.directv.mpeg": { - "source": "iana" - }, - "video/vnd.directv.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dvb.file": { - "source": "iana", - "extensions": ["dvb"] - }, - "video/vnd.fvt": { - "source": "iana", - "extensions": ["fvt"] - }, - "video/vnd.hns.video": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "iana" - }, - "video/vnd.motorola.video": { - "source": "iana" - }, - "video/vnd.motorola.videop": { - "source": "iana" - }, - "video/vnd.mpegurl": { - "source": "iana", - "extensions": ["mxu","m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "iana", - "extensions": ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "iana" - }, - "video/vnd.nokia.mp4vr": { - "source": "iana" - }, - "video/vnd.nokia.videovoip": { - "source": "iana" - }, - "video/vnd.objectvideo": { - "source": "iana" - }, - "video/vnd.radgamettools.bink": { - "source": "iana" - }, - "video/vnd.radgamettools.smacker": { - "source": "iana" - }, - "video/vnd.sealed.mpeg1": { - "source": "iana" - }, - "video/vnd.sealed.mpeg4": { - "source": "iana" - }, - "video/vnd.sealed.swf": { - "source": "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "iana" - }, - "video/vnd.uvvu.mp4": { - "source": "iana", - "extensions": ["uvu","uvvu"] - }, - "video/vnd.vivo": { - "source": "iana", - "extensions": ["viv"] - }, - "video/vnd.youtube.yt": { - "source": "iana" - }, - "video/vp8": { - "source": "iana" - }, - "video/vp9": { - "source": "iana" - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": ["webm"] - }, - "video/x-f4v": { - "source": "apache", - "extensions": ["f4v"] - }, - "video/x-fli": { - "source": "apache", - "extensions": ["fli"] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": ["flv"] - }, - "video/x-m4v": { - "source": "apache", - "extensions": ["m4v"] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": ["mkv","mk3d","mks"] - }, - "video/x-mng": { - "source": "apache", - "extensions": ["mng"] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": ["asf","asx"] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": ["vob"] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": ["wm"] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": ["wmv"] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": ["wmx"] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": ["wvx"] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": ["avi"] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": ["movie"] - }, - "video/x-smv": { - "source": "apache", - "extensions": ["smv"] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": ["ice"] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -} diff --git a/node_modules/mime-db/index.js b/node_modules/mime-db/index.js deleted file mode 100644 index ec2be30..0000000 --- a/node_modules/mime-db/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = require('./db.json') diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json deleted file mode 100644 index 32c14b8..0000000 --- a/node_modules/mime-db/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "mime-db", - "description": "Media Type Database", - "version": "1.52.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)", - "Robert Kieffer (http://github.com/broofa)" - ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": "jshttp/mime-db", - "devDependencies": { - "bluebird": "3.7.2", - "co": "4.6.0", - "cogent": "1.0.1", - "csv-parse": "4.16.3", - "eslint": "7.32.0", - "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.1.1", - "eslint-plugin-standard": "4.1.0", - "gnode": "0.1.2", - "media-typer": "1.1.0", - "mocha": "9.2.1", - "nyc": "15.1.0", - "raw-body": "2.5.0", - "stream-to-array": "2.3.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "db.json", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "update": "npm run fetch && npm run build", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/mime-types/HISTORY.md b/node_modules/mime-types/HISTORY.md deleted file mode 100644 index c5043b7..0000000 --- a/node_modules/mime-types/HISTORY.md +++ /dev/null @@ -1,397 +0,0 @@ -2.1.35 / 2022-03-12 -=================== - - * deps: mime-db@1.52.0 - - Add extensions from IANA for more `image/*` types - - Add extension `.asc` to `application/pgp-keys` - - Add extensions to various XML types - - Add new upstream MIME types - -2.1.34 / 2021-11-08 -=================== - - * deps: mime-db@1.51.0 - - Add new upstream MIME types - -2.1.33 / 2021-10-01 -=================== - - * deps: mime-db@1.50.0 - - Add deprecated iWorks mime types and extensions - - Add new upstream MIME types - -2.1.32 / 2021-07-27 -=================== - - * deps: mime-db@1.49.0 - - Add extension `.trig` to `application/trig` - - Add new upstream MIME types - -2.1.31 / 2021-06-01 -=================== - - * deps: mime-db@1.48.0 - - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - - Add new upstream MIME types - -2.1.30 / 2021-04-02 -=================== - - * deps: mime-db@1.47.0 - - Add extension `.amr` to `audio/amr` - - Remove ambigious extensions from IANA for `application/*+xml` types - - Update primary extension to `.es` for `application/ecmascript` - -2.1.29 / 2021-02-17 -=================== - - * deps: mime-db@1.46.0 - - Add extension `.amr` to `audio/amr` - - Add extension `.m4s` to `video/iso.segment` - - Add extension `.opus` to `audio/ogg` - - Add new upstream MIME types - -2.1.28 / 2021-01-01 -=================== - - * deps: mime-db@1.45.0 - - Add `application/ubjson` with extension `.ubj` - - Add `image/avif` with extension `.avif` - - Add `image/ktx2` with extension `.ktx2` - - Add extension `.dbf` to `application/vnd.dbf` - - Add extension `.rar` to `application/vnd.rar` - - Add extension `.td` to `application/urc-targetdesc+xml` - - Add new upstream MIME types - - Fix extension of `application/vnd.apple.keynote` to be `.key` - -2.1.27 / 2020-04-23 -=================== - - * deps: mime-db@1.44.0 - - Add charsets from IANA - - Add extension `.cjs` to `application/node` - - Add new upstream MIME types - -2.1.26 / 2020-01-05 -=================== - - * deps: mime-db@1.43.0 - - Add `application/x-keepass2` with extension `.kdbx` - - Add extension `.mxmf` to `audio/mobile-xmf` - - Add extensions from IANA for `application/*+xml` types - - Add new upstream MIME types - -2.1.25 / 2019-11-12 -=================== - - * deps: mime-db@1.42.0 - - Add new upstream MIME types - - Add `application/toml` with extension `.toml` - - Add `image/vnd.ms-dds` with extension `.dds` - -2.1.24 / 2019-04-20 -=================== - - * deps: mime-db@1.40.0 - - Add extensions from IANA for `model/*` types - - Add `text/mdx` with extension `.mdx` - -2.1.23 / 2019-04-17 -=================== - - * deps: mime-db@~1.39.0 - - Add extensions `.siv` and `.sieve` to `application/sieve` - - Add new upstream MIME types - -2.1.22 / 2019-02-14 -=================== - - * deps: mime-db@~1.38.0 - - Add extension `.nq` to `application/n-quads` - - Add extension `.nt` to `application/n-triples` - - Add new upstream MIME types - -2.1.21 / 2018-10-19 -=================== - - * deps: mime-db@~1.37.0 - - Add extensions to HEIC image types - - Add new upstream MIME types - -2.1.20 / 2018-08-26 -=================== - - * deps: mime-db@~1.36.0 - - Add Apple file extensions from IANA - - Add extensions from IANA for `image/*` types - - Add new upstream MIME types - -2.1.19 / 2018-07-17 -=================== - - * deps: mime-db@~1.35.0 - - Add extension `.csl` to `application/vnd.citationstyles.style+xml` - - Add extension `.es` to `application/ecmascript` - - Add extension `.owl` to `application/rdf+xml` - - Add new upstream MIME types - - Add UTF-8 as default charset for `text/turtle` - -2.1.18 / 2018-02-16 -=================== - - * deps: mime-db@~1.33.0 - - Add `application/raml+yaml` with extension `.raml` - - Add `application/wasm` with extension `.wasm` - - Add `text/shex` with extension `.shex` - - Add extensions for JPEG-2000 images - - Add extensions from IANA for `message/*` types - - Add new upstream MIME types - - Update font MIME types - - Update `text/hjson` to registered `application/hjson` - -2.1.17 / 2017-09-01 -=================== - - * deps: mime-db@~1.30.0 - - Add `application/vnd.ms-outlook` - - Add `application/x-arj` - - Add extension `.mjs` to `application/javascript` - - Add glTF types and extensions - - Add new upstream MIME types - - Add `text/x-org` - - Add VirtualBox MIME types - - Fix `source` records for `video/*` types that are IANA - - Update `font/opentype` to registered `font/otf` - -2.1.16 / 2017-07-24 -=================== - - * deps: mime-db@~1.29.0 - - Add `application/fido.trusted-apps+json` - - Add extension `.wadl` to `application/vnd.sun.wadl+xml` - - Add extension `.gz` to `application/gzip` - - Add new upstream MIME types - - Update extensions `.md` and `.markdown` to be `text/markdown` - -2.1.15 / 2017-03-23 -=================== - - * deps: mime-db@~1.27.0 - - Add new mime types - - Add `image/apng` - -2.1.14 / 2017-01-14 -=================== - - * deps: mime-db@~1.26.0 - - Add new mime types - -2.1.13 / 2016-11-18 -=================== - - * deps: mime-db@~1.25.0 - - Add new mime types - -2.1.12 / 2016-09-18 -=================== - - * deps: mime-db@~1.24.0 - - Add new mime types - - Add `audio/mp3` - -2.1.11 / 2016-05-01 -=================== - - * deps: mime-db@~1.23.0 - - Add new mime types - -2.1.10 / 2016-02-15 -=================== - - * deps: mime-db@~1.22.0 - - Add new mime types - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - -2.1.9 / 2016-01-06 -================== - - * deps: mime-db@~1.21.0 - - Add new mime types - -2.1.8 / 2015-11-30 -================== - - * deps: mime-db@~1.20.0 - - Add new mime types - -2.1.7 / 2015-09-20 -================== - - * deps: mime-db@~1.19.0 - - Add new mime types - -2.1.6 / 2015-09-03 -================== - - * deps: mime-db@~1.18.0 - - Add new mime types - -2.1.5 / 2015-08-20 -================== - - * deps: mime-db@~1.17.0 - - Add new mime types - -2.1.4 / 2015-07-30 -================== - - * deps: mime-db@~1.16.0 - - Add new mime types - -2.1.3 / 2015-07-13 -================== - - * deps: mime-db@~1.15.0 - - Add new mime types - -2.1.2 / 2015-06-25 -================== - - * deps: mime-db@~1.14.0 - - Add new mime types - -2.1.1 / 2015-06-08 -================== - - * perf: fix deopt during mapping - -2.1.0 / 2015-06-07 -================== - - * Fix incorrectly treating extension-less file name as extension - - i.e. `'path/to/json'` will no longer return `application/json` - * Fix `.charset(type)` to accept parameters - * Fix `.charset(type)` to match case-insensitive - * Improve generation of extension to MIME mapping - * Refactor internals for readability and no argument reassignment - * Prefer `application/*` MIME types from the same source - * Prefer any type over `application/octet-stream` - * deps: mime-db@~1.13.0 - - Add nginx as a source - - Add new mime types - -2.0.14 / 2015-06-06 -=================== - - * deps: mime-db@~1.12.0 - - Add new mime types - -2.0.13 / 2015-05-31 -=================== - - * deps: mime-db@~1.11.0 - - Add new mime types - -2.0.12 / 2015-05-19 -=================== - - * deps: mime-db@~1.10.0 - - Add new mime types - -2.0.11 / 2015-05-05 -=================== - - * deps: mime-db@~1.9.1 - - Add new mime types - -2.0.10 / 2015-03-13 -=================== - - * deps: mime-db@~1.8.0 - - Add new mime types - -2.0.9 / 2015-02-09 -================== - - * deps: mime-db@~1.7.0 - - Add new mime types - - Community extensions ownership transferred from `node-mime` - -2.0.8 / 2015-01-29 -================== - - * deps: mime-db@~1.6.0 - - Add new mime types - -2.0.7 / 2014-12-30 -================== - - * deps: mime-db@~1.5.0 - - Add new mime types - - Fix various invalid MIME type entries - -2.0.6 / 2014-12-30 -================== - - * deps: mime-db@~1.4.0 - - Add new mime types - - Fix various invalid MIME type entries - - Remove example template MIME types - -2.0.5 / 2014-12-29 -================== - - * deps: mime-db@~1.3.1 - - Fix missing extensions - -2.0.4 / 2014-12-10 -================== - - * deps: mime-db@~1.3.0 - - Add new mime types - -2.0.3 / 2014-11-09 -================== - - * deps: mime-db@~1.2.0 - - Add new mime types - -2.0.2 / 2014-09-28 -================== - - * deps: mime-db@~1.1.0 - - Add new mime types - - Update charsets - -2.0.1 / 2014-09-07 -================== - - * Support Node.js 0.6 - -2.0.0 / 2014-09-02 -================== - - * Use `mime-db` - * Remove `.define()` - -1.0.2 / 2014-08-04 -================== - - * Set charset=utf-8 for `text/javascript` - -1.0.1 / 2014-06-24 -================== - - * Add `text/jsx` type - -1.0.0 / 2014-05-12 -================== - - * Return `false` for unknown types - * Set charset=utf-8 for `application/json` - -0.1.0 / 2014-05-02 -================== - - * Initial release diff --git a/node_modules/mime-types/LICENSE b/node_modules/mime-types/LICENSE deleted file mode 100644 index 0616607..0000000 --- a/node_modules/mime-types/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mime-types/README.md b/node_modules/mime-types/README.md deleted file mode 100644 index 48d2fb4..0000000 --- a/node_modules/mime-types/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# mime-types - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -The ultimate javascript content-type utility. - -Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: - -- __No fallbacks.__ Instead of naively returning the first available type, - `mime-types` simply returns `false`, so do - `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. -- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. -- No `.define()` functionality -- Bug fixes for `.lookup(path)` - -Otherwise, the API is compatible with `mime` 1.x. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install mime-types -``` - -## Adding Types - -All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), -so open a PR there if you'd like to add mime types. - -## API - -```js -var mime = require('mime-types') -``` - -All functions return `false` if input is invalid or not found. - -### mime.lookup(path) - -Lookup the content-type associated with a file. - -```js -mime.lookup('json') // 'application/json' -mime.lookup('.md') // 'text/markdown' -mime.lookup('file.html') // 'text/html' -mime.lookup('folder/file.js') // 'application/javascript' -mime.lookup('folder/.htaccess') // false - -mime.lookup('cats') // false -``` - -### mime.contentType(type) - -Create a full content-type header given a content-type or extension. -When given an extension, `mime.lookup` is used to get the matching -content-type, otherwise the given content-type is used. Then if the -content-type does not already have a `charset` parameter, `mime.charset` -is used to get the default charset and add to the returned content-type. - -```js -mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' -mime.contentType('file.json') // 'application/json; charset=utf-8' -mime.contentType('text/html') // 'text/html; charset=utf-8' -mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' - -// from a full path -mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' -``` - -### mime.extension(type) - -Get the default extension for a content-type. - -```js -mime.extension('application/octet-stream') // 'bin' -``` - -### mime.charset(type) - -Lookup the implied default charset of a content-type. - -```js -mime.charset('text/markdown') // 'UTF-8' -``` - -### var type = mime.types[extension] - -A map of content-types by extension. - -### [extensions...] = mime.extensions[type] - -A map of extensions by content-type. - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci -[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master -[node-version-image]: https://badgen.net/npm/node/mime-types -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-types -[npm-url]: https://npmjs.org/package/mime-types -[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/node_modules/mime-types/index.js b/node_modules/mime-types/index.js deleted file mode 100644 index b9f34d5..0000000 --- a/node_modules/mime-types/index.js +++ /dev/null @@ -1,188 +0,0 @@ -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var db = require('mime-db') -var extname = require('path').extname - -/** - * Module variables. - * @private - */ - -var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ -var TEXT_TYPE_REGEXP = /^text\//i - -/** - * Module exports. - * @public - */ - -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) - -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) - -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - var mime = match && db[match[1].toLowerCase()] - - if (mime && mime.charset) { - return mime.charset - } - - // default text/* to utf-8 - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return 'UTF-8' - } - - return false -} - -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {boolean|string} - */ - -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } - - var mime = str.indexOf('/') === -1 - ? exports.lookup(str) - : str - - if (!mime) { - return false - } - - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } - - return mime -} - -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] - - if (!exts || !exts.length) { - return false - } - - return exts[0] -} - -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {boolean|string} - */ - -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } - - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .substr(1) - - if (!extension) { - return false - } - - return exports.types[extension] || false -} - -/** - * Populate the extensions and types maps. - * @private - */ - -function populateMaps (extensions, types) { - // source preference (least -> most) - var preference = ['nginx', 'apache', undefined, 'iana'] - - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions - - if (!exts || !exts.length) { - return - } - - // mime -> extensions - extensions[type] = exts - - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] - - if (types[extension]) { - var from = preference.indexOf(db[types[extension]].source) - var to = preference.indexOf(mime.source) - - if (types[extension] !== 'application/octet-stream' && - (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { - // skip the remapping - continue - } - } - - // set the extension -> mime - types[extension] = type - } - }) -} diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json deleted file mode 100644 index bbef696..0000000 --- a/node_modules/mime-types/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "mime-types", - "description": "The ultimate javascript content-type utility.", - "version": "2.1.35", - "contributors": [ - "Douglas Christopher Wilson ", - "Jeremiah Senkpiel (https://searchbeam.jit.su)", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "keywords": [ - "mime", - "types" - ], - "repository": "jshttp/mime-types", - "dependencies": { - "mime-db": "1.52.0" - }, - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.2", - "nyc": "15.1.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec test/test.js", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js deleted file mode 100644 index ea734fb..0000000 --- a/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function (val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md deleted file mode 100644 index fa5d39b..0000000 --- a/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 Vercel, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json deleted file mode 100644 index 4997189..0000000 --- a/node_modules/ms/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "ms", - "version": "2.1.3", - "description": "Tiny millisecond conversion utility", - "repository": "vercel/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "4.18.2", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1", - "prettier": "2.0.5" - } -} diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md deleted file mode 100644 index 0fc1abb..0000000 --- a/node_modules/ms/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# ms - -![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/node_modules/neo-async/LICENSE b/node_modules/neo-async/LICENSE deleted file mode 100644 index 4ec13d1..0000000 --- a/node_modules/neo-async/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-2018 Suguru Motegi -Based on Async.js, Copyright Caolan McMahon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/neo-async/README.md b/node_modules/neo-async/README.md deleted file mode 100644 index d49e93c..0000000 --- a/node_modules/neo-async/README.md +++ /dev/null @@ -1,273 +0,0 @@ -

Neo-Async

- -

- -

- -

- npm - Travis Status - Coverage Status - download - Code Quality: Javascript - Total Alerts - FOSSA -

- -Neo-Async is thought to be used as a drop-in replacement for [Async](https://github.com/caolan/async), it almost fully covers its functionality and runs [faster](#benchmark). - -Benchmark is [here](#benchmark)! - -Bluebird's benchmark is [here](https://github.com/suguru03/bluebird/tree/aigle/benchmark)! - -## Code Coverage -![coverage](https://raw.githubusercontent.com/wiki/suguru03/neo-async/images/coverage.png) - -## Installation - -### In a browser -```html - -``` - -### In an AMD loader -```js -require(['async'], function(async) {}); -``` - -### Promise and async/await - -I recommend to use [`Aigle`](https://github.com/suguru03/aigle). - -It is optimized for Promise handling and has almost the same functionality as `neo-async`. - -### Node.js - -#### standard - -```bash -$ npm install neo-async -``` -```js -var async = require('neo-async'); -``` - -#### replacement -```bash -$ npm install neo-async -$ ln -s ./node_modules/neo-async ./node_modules/async -``` -```js -var async = require('async'); -``` - -### Bower - -```bash -bower install neo-async -``` - -## Feature - -[JSDoc](http://suguru03.github.io/neo-async/doc/async.html) - -\* not in Async - -### Collections - -- [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) -- [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -- [`eachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -- [`forEach`](http://suguru03.github.io/neo-async/doc/async.each.html) -> [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) -- [`forEachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -> [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -- [`forEachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -> [`eachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -- [`eachOf`](http://suguru03.github.io/neo-async/doc/async.each.html) -> [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) -- [`eachOfSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -> [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -- [`eachOfLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -> [`eachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -- [`forEachOf`](http://suguru03.github.io/neo-async/doc/async.each.html) -> [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) -- [`forEachOfSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -> [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -- [`eachOfLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -> [`forEachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -- [`map`](http://suguru03.github.io/neo-async/doc/async.map.html) -- [`mapSeries`](http://suguru03.github.io/neo-async/doc/async.mapSeries.html) -- [`mapLimit`](http://suguru03.github.io/neo-async/doc/async.mapLimit.html) -- [`mapValues`](http://suguru03.github.io/neo-async/doc/async.mapValues.html) -- [`mapValuesSeries`](http://suguru03.github.io/neo-async/doc/async.mapValuesSeries.html) -- [`mapValuesLimit`](http://suguru03.github.io/neo-async/doc/async.mapValuesLimit.html) -- [`filter`](http://suguru03.github.io/neo-async/doc/async.filter.html) -- [`filterSeries`](http://suguru03.github.io/neo-async/doc/async.filterSeries.html) -- [`filterLimit`](http://suguru03.github.io/neo-async/doc/async.filterLimit.html) -- [`select`](http://suguru03.github.io/neo-async/doc/async.filter.html) -> [`filter`](http://suguru03.github.io/neo-async/doc/async.filter.html) -- [`selectSeries`](http://suguru03.github.io/neo-async/doc/async.filterSeries.html) -> [`filterSeries`](http://suguru03.github.io/neo-async/doc/async.filterSeries.html) -- [`selectLimit`](http://suguru03.github.io/neo-async/doc/async.filterLimit.html) -> [`filterLimit`](http://suguru03.github.io/neo-async/doc/async.filterLimit.html) -- [`reject`](http://suguru03.github.io/neo-async/doc/async.reject.html) -- [`rejectSeries`](http://suguru03.github.io/neo-async/doc/async.rejectSeries.html) -- [`rejectLimit`](http://suguru03.github.io/neo-async/doc/async.rejectLimit.html) -- [`detect`](http://suguru03.github.io/neo-async/doc/async.detect.html) -- [`detectSeries`](http://suguru03.github.io/neo-async/doc/async.detectSeries.html) -- [`detectLimit`](http://suguru03.github.io/neo-async/doc/async.detectLimit.html) -- [`find`](http://suguru03.github.io/neo-async/doc/async.detect.html) -> [`detect`](http://suguru03.github.io/neo-async/doc/async.detect.html) -- [`findSeries`](http://suguru03.github.io/neo-async/doc/async.detectSeries.html) -> [`detectSeries`](http://suguru03.github.io/neo-async/doc/async.detectSeries.html) -- [`findLimit`](http://suguru03.github.io/neo-async/doc/async.detectLimit.html) -> [`detectLimit`](http://suguru03.github.io/neo-async/doc/async.detectLimit.html) -- [`pick`](http://suguru03.github.io/neo-async/doc/async.pick.html) * -- [`pickSeries`](http://suguru03.github.io/neo-async/doc/async.pickSeries.html) * -- [`pickLimit`](http://suguru03.github.io/neo-async/doc/async.pickLimit.html) * -- [`omit`](http://suguru03.github.io/neo-async/doc/async.omit.html) * -- [`omitSeries`](http://suguru03.github.io/neo-async/doc/async.omitSeries.html) * -- [`omitLimit`](http://suguru03.github.io/neo-async/doc/async.omitLimit.html) * -- [`reduce`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -- [`inject`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -> [`reduce`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -- [`foldl`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -> [`reduce`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -- [`reduceRight`](http://suguru03.github.io/neo-async/doc/async.reduceRight.html) -- [`foldr`](http://suguru03.github.io/neo-async/doc/async.reduceRight.html) -> [`reduceRight`](http://suguru03.github.io/neo-async/doc/async.reduceRight.html) -- [`transform`](http://suguru03.github.io/neo-async/doc/async.transform.html) -- [`transformSeries`](http://suguru03.github.io/neo-async/doc/async.transformSeries.html) * -- [`transformLimit`](http://suguru03.github.io/neo-async/doc/async.transformLimit.html) * -- [`sortBy`](http://suguru03.github.io/neo-async/doc/async.sortBy.html) -- [`sortBySeries`](http://suguru03.github.io/neo-async/doc/async.sortBySeries.html) * -- [`sortByLimit`](http://suguru03.github.io/neo-async/doc/async.sortByLimit.html) * -- [`some`](http://suguru03.github.io/neo-async/doc/async.some.html) -- [`someSeries`](http://suguru03.github.io/neo-async/doc/async.someSeries.html) -- [`someLimit`](http://suguru03.github.io/neo-async/doc/async.someLimit.html) -- [`any`](http://suguru03.github.io/neo-async/doc/async.some.html) -> [`some`](http://suguru03.github.io/neo-async/doc/async.some.html) -- [`anySeries`](http://suguru03.github.io/neo-async/doc/async.someSeries.html) -> [`someSeries`](http://suguru03.github.io/neo-async/doc/async.someSeries.html) -- [`anyLimit`](http://suguru03.github.io/neo-async/doc/async.someLimit.html) -> [`someLimit`](http://suguru03.github.io/neo-async/doc/async.someLimit.html) -- [`every`](http://suguru03.github.io/neo-async/doc/async.every.html) -- [`everySeries`](http://suguru03.github.io/neo-async/doc/async.everySeries.html) -- [`everyLimit`](http://suguru03.github.io/neo-async/doc/async.everyLimit.html) -- [`all`](http://suguru03.github.io/neo-async/doc/async.every.html) -> [`every`](http://suguru03.github.io/neo-async/doc/async.every.html) -- [`allSeries`](http://suguru03.github.io/neo-async/doc/async.everySeries.html) -> [`every`](http://suguru03.github.io/neo-async/doc/async.everySeries.html) -- [`allLimit`](http://suguru03.github.io/neo-async/doc/async.everyLimit.html) -> [`every`](http://suguru03.github.io/neo-async/doc/async.everyLimit.html) -- [`concat`](http://suguru03.github.io/neo-async/doc/async.concat.html) -- [`concatSeries`](http://suguru03.github.io/neo-async/doc/async.concatSeries.html) -- [`concatLimit`](http://suguru03.github.io/neo-async/doc/async.concatLimit.html) * - -### Control Flow - -- [`parallel`](http://suguru03.github.io/neo-async/doc/async.parallel.html) -- [`series`](http://suguru03.github.io/neo-async/doc/async.series.html) -- [`parallelLimit`](http://suguru03.github.io/neo-async/doc/async.series.html) -- [`tryEach`](http://suguru03.github.io/neo-async/doc/async.tryEach.html) -- [`waterfall`](http://suguru03.github.io/neo-async/doc/async.waterfall.html) -- [`angelFall`](http://suguru03.github.io/neo-async/doc/async.angelFall.html) * -- [`angelfall`](http://suguru03.github.io/neo-async/doc/async.angelFall.html) -> [`angelFall`](http://suguru03.github.io/neo-async/doc/async.angelFall.html) * -- [`whilst`](#whilst) -- [`doWhilst`](#doWhilst) -- [`until`](#until) -- [`doUntil`](#doUntil) -- [`during`](#during) -- [`doDuring`](#doDuring) -- [`forever`](#forever) -- [`compose`](#compose) -- [`seq`](#seq) -- [`applyEach`](#applyEach) -- [`applyEachSeries`](#applyEachSeries) -- [`queue`](#queue) -- [`priorityQueue`](#priorityQueue) -- [`cargo`](#cargo) -- [`auto`](#auto) -- [`autoInject`](#autoInject) -- [`retry`](#retry) -- [`retryable`](#retryable) -- [`iterator`](#iterator) -- [`times`](http://suguru03.github.io/neo-async/doc/async.times.html) -- [`timesSeries`](http://suguru03.github.io/neo-async/doc/async.timesSeries.html) -- [`timesLimit`](http://suguru03.github.io/neo-async/doc/async.timesLimit.html) -- [`race`](#race) - -### Utils -- [`apply`](#apply) -- [`setImmediate`](#setImmediate) -- [`nextTick`](#nextTick) -- [`memoize`](#memoize) -- [`unmemoize`](#unmemoize) -- [`ensureAsync`](#ensureAsync) -- [`constant`](#constant) -- [`asyncify`](#asyncify) -- [`wrapSync`](#asyncify) -> [`asyncify`](#asyncify) -- [`log`](#log) -- [`dir`](#dir) -- [`timeout`](http://suguru03.github.io/neo-async/doc/async.timeout.html) -- [`reflect`](#reflect) -- [`reflectAll`](#reflectAll) -- [`createLogger`](#createLogger) - -## Mode -- [`safe`](#safe) * -- [`fast`](#fast) * - -## Benchmark - -[Benchmark: Async vs Neo-Async](http://suguru03.hatenablog.com/entry/2016/06/10/135559) - -### How to check - -```bash -$ node perf -``` - -### Environment - -* Darwin 17.3.0 x64 -* Node.js v8.9.4 -* async v2.6.0 -* neo-async v2.5.0 -* benchmark v2.1.4 - -### Result - -The value is the ratio (Neo-Async/Async) of the average speed. - -#### Collections -|function|benchmark| -|---|--:| -|each/forEach|2.43| -|eachSeries/forEachSeries|1.75| -|eachLimit/forEachLimit|1.68| -|eachOf|3.29| -|eachOfSeries|1.50| -|eachOfLimit|1.59| -|map|3.95| -|mapSeries|1.81| -|mapLimit|1.27| -|mapValues|2.73| -|mapValuesSeries|1.59| -|mapValuesLimit|1.23| -|filter|3.00| -|filterSeries|1.74| -|filterLimit|1.17| -|reject|4.59| -|rejectSeries|2.31| -|rejectLimit|1.58| -|detect|4.30| -|detectSeries|1.86| -|detectLimit|1.32| -|reduce|1.82| -|transform|2.46| -|sortBy|4.08| -|some|2.19| -|someSeries|1.83| -|someLimit|1.32| -|every|2.09| -|everySeries|1.84| -|everyLimit|1.35| -|concat|3.79| -|concatSeries|4.45| - -#### Control Flow -|funciton|benchmark| -|---|--:| -|parallel|2.93| -|series|1.96| -|waterfall|1.29| -|whilst|1.00| -|doWhilst|1.12| -|until|1.12| -|doUntil|1.12| -|during|1.18| -|doDuring|2.42| -|times|4.25| -|auto|1.97| - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fsuguru03%2Fneo-async.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fsuguru03%2Fneo-async?ref=badge_large) diff --git a/node_modules/neo-async/all.js b/node_modules/neo-async/all.js deleted file mode 100644 index dad54e7..0000000 --- a/node_modules/neo-async/all.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').all; diff --git a/node_modules/neo-async/allLimit.js b/node_modules/neo-async/allLimit.js deleted file mode 100644 index d9d7aaa..0000000 --- a/node_modules/neo-async/allLimit.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').allLimit; diff --git a/node_modules/neo-async/allSeries.js b/node_modules/neo-async/allSeries.js deleted file mode 100644 index 2a7a8ba..0000000 --- a/node_modules/neo-async/allSeries.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').allSeries; diff --git a/node_modules/neo-async/angelFall.js b/node_modules/neo-async/angelFall.js deleted file mode 100644 index 476c23e..0000000 --- a/node_modules/neo-async/angelFall.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').angelfall; diff --git a/node_modules/neo-async/any.js b/node_modules/neo-async/any.js deleted file mode 100644 index d6b07bb..0000000 --- a/node_modules/neo-async/any.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').any; diff --git a/node_modules/neo-async/anyLimit.js b/node_modules/neo-async/anyLimit.js deleted file mode 100644 index 34114f8..0000000 --- a/node_modules/neo-async/anyLimit.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').anyLimit; diff --git a/node_modules/neo-async/anySeries.js b/node_modules/neo-async/anySeries.js deleted file mode 100644 index bb3781f..0000000 --- a/node_modules/neo-async/anySeries.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').anySeries; diff --git a/node_modules/neo-async/apply.js b/node_modules/neo-async/apply.js deleted file mode 100644 index 41135e2..0000000 --- a/node_modules/neo-async/apply.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').apply; diff --git a/node_modules/neo-async/applyEach.js b/node_modules/neo-async/applyEach.js deleted file mode 100644 index 292bd1c..0000000 --- a/node_modules/neo-async/applyEach.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').applyEach; diff --git a/node_modules/neo-async/applyEachSeries.js b/node_modules/neo-async/applyEachSeries.js deleted file mode 100644 index 0aece7c..0000000 --- a/node_modules/neo-async/applyEachSeries.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./async').applyEachSeries; diff --git a/node_modules/neo-async/async.js b/node_modules/neo-async/async.js deleted file mode 100644 index e78eb16..0000000 --- a/node_modules/neo-async/async.js +++ /dev/null @@ -1,9184 +0,0 @@ -(function(global, factory) { - /*jshint -W030 */ - 'use strict'; - typeof exports === 'object' && typeof module !== 'undefined' - ? factory(exports) - : typeof define === 'function' && define.amd - ? define(['exports'], factory) - : global.async - ? factory((global.neo_async = global.neo_async || {})) - : factory((global.async = global.async || {})); -})(this, function(exports) { - 'use strict'; - - var noop = function noop() {}; - var throwError = function throwError() { - throw new Error('Callback was already called.'); - }; - - var DEFAULT_TIMES = 5; - var DEFAULT_INTERVAL = 0; - - var obj = 'object'; - var func = 'function'; - var isArray = Array.isArray; - var nativeKeys = Object.keys; - var nativePush = Array.prototype.push; - var iteratorSymbol = typeof Symbol === func && Symbol.iterator; - - var nextTick, asyncNextTick, asyncSetImmediate; - createImmediate(); - - /** - * @memberof async - * @namespace each - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(); - * }, num * 10); - * }; - * async.each(array, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(); - * }, num * 10); - * }; - * async.each(array, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(); - * }, num * 10); - * }; - * async.each(object, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(); - * }, num * 10); - * }; - * async.each(object, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - * @example - * - * // break - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num !== 2); - * }, num * 10); - * }; - * async.each(array, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 2] - * }); - * - */ - var each = createEach(arrayEach, baseEach, symbolEach); - - /** - * @memberof async - * @namespace map - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.map(array, iterator, function(err, res) { - * console.log(res); // [1, 3, 2]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.map(array, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.map(object, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.map(object, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - */ - var map = createMap(arrayEachIndex, baseEachIndex, symbolEachIndex, true); - - /** - * @memberof async - * @namespace mapValues - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapValues(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3, '2': 2 } - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.mapValues(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3, '2': 2 } - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapValues(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3, c: 2 } - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.mapValues(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3, c: 2 } - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - */ - var mapValues = createMap(arrayEachIndex, baseEachKey, symbolEachKey, false); - - /** - * @memberof async - * @namespace filter - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filter(array, iterator, function(err, res) { - * console.log(res); // [1, 3]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filter(array, iterator, function(err, res) { - * console.log(res); // [1, 3]; - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filter(object, iterator, function(err, res) { - * console.log(res); // [1, 3]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filter(object, iterator, function(err, res) { - * console.log(res); // [1, 3]; - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - */ - var filter = createFilter(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue, true); - - /** - * @memberof async - * @namespace filterSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterSeries(array, iterator, function(err, res) { - * console.log(res); // [1, 3]; - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterSeries(array, iterator, function(err, res) { - * console.log(res); // [1, 3] - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterSeries(object, iterator, function(err, res) { - * console.log(res); // [1, 3] - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterSeries(object, iterator, function(err, res) { - * console.log(res); // [1, 3] - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] - * }); - * - */ - var filterSeries = createFilterSeries(true); - - /** - * @memberof async - * @namespace filterLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3] - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.filterLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3] - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - var filterLimit = createFilterLimit(true); - - /** - * @memberof async - * @namespace reject - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.reject(array, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.reject(array, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.reject(object, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.reject(object, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - */ - var reject = createFilter(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue, false); - - /** - * @memberof async - * @namespace rejectSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectSeries(array, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectSeries(object, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectSeries(object, iterator, function(err, res) { - * console.log(res); // [2]; - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] - * }); - * - */ - var rejectSeries = createFilterSeries(false); - - /** - * @memberof async - * @namespace rejectLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [4, 2] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [4, 2] - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [4, 2] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.rejectLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [4, 2] - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - var rejectLimit = createFilterLimit(false); - - /** - * @memberof async - * @namespace detect - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detect(array, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detect(array, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [[1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detect(object, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detect(object, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [[1, 'a']] - * }); - * - */ - var detect = createDetect(arrayEachValue, baseEachValue, symbolEachValue, true); - - /** - * @memberof async - * @namespace detectSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectSeries(array, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectSeries(array, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [[1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectSeries(object, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectSeries(object, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [[1, 'a']] - * }); - * - */ - var detectSeries = createDetectSeries(true); - - /** - * @memberof async - * @namespace detectLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectLimit(array, 2, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectLimit(array, 2, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [[1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectLimit(object, 2, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.detectLimit(object, 2, iterator, function(err, res) { - * console.log(res); // 1 - * console.log(order); // [[1, 'a']] - * }); - * - */ - var detectLimit = createDetectLimit(true); - - /** - * @memberof async - * @namespace every - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.every(array, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [1, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.every(array, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [[1, 0], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.every(object, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [1, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.every(object, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [[1, 'a'], [2, 'c']] - * }); - * - */ - var every = createEvery(arrayEachValue, baseEachValue, symbolEachValue); - - /** - * @memberof async - * @namespace everySeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everySeries(array, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everySeries(array, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everySeries(object, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everySeries(object, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [[1, 'a'], [3, 'b'] [2, 'c']] - * }); - * - */ - var everySeries = createEverySeries(); - - /** - * @memberof async - * @namespace everyLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everyLimit(array, 2, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [1, 3, 5, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everyLimit(array, 2, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everyLimit(object, 2, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [1, 3, 5, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.everyLimit(object, 2, iterator, function(err, res) { - * console.log(res); // false - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e']] - * }); - * - */ - var everyLimit = createEveryLimit(); - - /** - * @memberof async - * @namespace pick - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pick(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3 } - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pick(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3 } - * console.log(order); // [[0, 1], [2, 2], [3, 1], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pick(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3 } - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pick(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3 } - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b'], [4, 'd']] - * }); - * - */ - var pick = createPick(arrayEachIndexValue, baseEachKeyValue, symbolEachKeyValue, true); - - /** - * @memberof async - * @namespace pickSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickSeries(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3 } - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickSeries(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3 } - * console.log(order); // [[0, 1], [3, 1], [2, 2], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickSeries(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3 } - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickSeries(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3 } - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c'], [4, 'd']] - * }); - * - */ - var pickSeries = createPickSeries(true); - - /** - * @memberof async - * @namespace pickLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 5, '2': 3 } - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 5, '2': 3 } - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 5, c: 3 } - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.pickLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 5, c: 3 } - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - var pickLimit = createPickLimit(true); - - /** - * @memberof async - * @namespace omit - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omit(array, iterator, function(err, res) { - * console.log(res); // { '2': 2, '3': 4 } - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omit(array, iterator, function(err, res) { - * console.log(res); // { '2': 2, '3': 4 } - * console.log(order); // [[0, 1], [2, 2], [3, 1], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omit(object, iterator, function(err, res) { - * console.log(res); // { c: 2, d: 4 } - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omit(object, iterator, function(err, res) { - * console.log(res); // { c: 2, d: 4 } - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b'], [4, 'd']] - * }); - * - */ - var omit = createPick(arrayEachIndexValue, baseEachKeyValue, symbolEachKeyValue, false); - - /** - * @memberof async - * @namespace omitSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitSeries(array, iterator, function(err, res) { - * console.log(res); // { '2': 2, '3': 4 } - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2, 4]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitSeries(array, iterator, function(err, res) { - * console.log(res); // { '2': 2, '3': 4 } - * console.log(order); // [[0, 1], [3, 1], [2, 2], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitSeries(object, iterator, function(err, res) { - * console.log(res); // { c: 2, d: 4 } - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitSeries(object, iterator, function(err, res) { - * console.log(res); // { c: 2, d: 4 } - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c'], [4, 'd']] - * }); - * - */ - var omitSeries = createPickSeries(false); - - /** - * @memberof async - * @namespace omitLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '3': 4, '4': 2 } - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '3': 4, '4': 2 } - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { d: 4, e: 2 } - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.omitLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { d: 4, e: 2 } - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - var omitLimit = createPickLimit(false); - - /** - * @memberof async - * @namespace transform - * @param {Array|Object} collection - * @param {Array|Object|Function} [accumulator] - * @param {Function} [iterator] - * @param {Function} [callback] - * @example - * - * // array - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * result.push(num) - * done(); - * }, num * 10); - * }; - * async.transform(collection, iterator, function(err, res) { - * console.log(res); // [1, 2, 3, 4] - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * // array with index and accumulator - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * result[index] = num; - * done(); - * }, num * 10); - * }; - * async.transform(collection, {}, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3, '2': 2, '3': 4 } - * console.log(order); // [[1, 0], [2, 2], [3, 1], [4, 3]] - * }); - * - * @example - * - * // object with accumulator - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * result.push(num); - * done(); - * }, num * 10); - * }; - * async.transform(collection, [], iterator, function(err, res) { - * console.log(res); // [1, 2, 3, 4] - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * result[key] = num; - * done(); - * }, num * 10); - * }; - * async.transform(collection, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3, c: 2, d: 4 } - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b'], [4, 'd']] - * }); - * - */ - var transform = createTransform(arrayEachResult, baseEachResult, symbolEachResult); - - /** - * @memberof async - * @namespace sortBy - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.sortBy(array, iterator, function(err, res) { - * console.log(res); // [1, 2, 3]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.sortBy(array, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.sortBy(object, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.sortBy(object, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - */ - var sortBy = createSortBy(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue); - - /** - * @memberof async - * @namespace concat - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, [num]); - * }, num * 10); - * }; - * async.concat(array, iterator, function(err, res) { - * console.log(res); // [1, 2, 3]; - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, [num]); - * }, num * 10); - * }; - * async.concat(array, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [[1, 0], [2, 2], [3, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, [num]); - * }, num * 10); - * }; - * async.concat(object, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [1, 2, 3] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, [num]); - * }, num * 10); - * }; - * async.concat(object, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] - * }); - * - */ - var concat = createConcat(arrayEachIndex, baseEachIndex, symbolEachIndex); - - /** - * @memberof async - * @namespace groupBy - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [4.2, 6.4, 6.1]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBy(array, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } - * console.log(order); // [4.2, 6.1, 6.4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [4.2, 6.4, 6.1]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBy(array, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } - * console.log(order); // [[4.2, 0], [6.1, 2], [6.4, 1]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 4.2, b: 6.4, c: 6.1 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBy(object, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } - * console.log(order); // [4.2, 6.1, 6.4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 4.2, b: 6.4, c: 6.1 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBy(object, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } - * console.log(order); // [[4.2, 'a'], [6.1, 'c'], [6.4, 'b']] - * }); - * - */ - var groupBy = createGroupBy(arrayEachValue, baseEachValue, symbolEachValue); - - /** - * @memberof async - * @namespace parallel - * @param {Array|Object} tasks - functions - * @param {Function} callback - * @example - * - * var order = []; - * var tasks = [ - * function(done) { - * setTimeout(function() { - * order.push(1); - * done(null, 1); - * }, 10); - * }, - * function(done) { - * setTimeout(function() { - * order.push(2); - * done(null, 2); - * }, 30); - * }, - * function(done) { - * setTimeout(function() { - * order.push(3); - * done(null, 3); - * }, 40); - * }, - * function(done) { - * setTimeout(function() { - * order.push(4); - * done(null, 4); - * }, 20); - * } - * ]; - * async.parallel(tasks, function(err, res) { - * console.log(res); // [1, 2, 3, 4]; - * console.log(order); // [1, 4, 2, 3] - * }); - * - * @example - * - * var order = []; - * var tasks = { - * 'a': function(done) { - * setTimeout(function() { - * order.push(1); - * done(null, 1); - * }, 10); - * }, - * 'b': function(done) { - * setTimeout(function() { - * order.push(2); - * done(null, 2); - * }, 30); - * }, - * 'c': function(done) { - * setTimeout(function() { - * order.push(3); - * done(null, 3); - * }, 40); - * }, - * 'd': function(done) { - * setTimeout(function() { - * order.push(4); - * done(null, 4); - * }, 20); - * } - * }; - * async.parallel(tasks, function(err, res) { - * console.log(res); // { a: 1, b: 2, c: 3, d:4 } - * console.log(order); // [1, 4, 2, 3] - * }); - * - */ - var parallel = createParallel(arrayEachFunc, baseEachFunc); - - /** - * @memberof async - * @namespace applyEach - */ - var applyEach = createApplyEach(map); - - /** - * @memberof async - * @namespace applyEachSeries - */ - var applyEachSeries = createApplyEach(mapSeries); - - /** - * @memberof async - * @namespace log - */ - var log = createLogger('log'); - - /** - * @memberof async - * @namespace dir - */ - var dir = createLogger('dir'); - - /** - * @version 2.6.2 - * @namespace async - */ - var index = { - VERSION: '2.6.2', - - // Collections - each: each, - eachSeries: eachSeries, - eachLimit: eachLimit, - forEach: each, - forEachSeries: eachSeries, - forEachLimit: eachLimit, - eachOf: each, - eachOfSeries: eachSeries, - eachOfLimit: eachLimit, - forEachOf: each, - forEachOfSeries: eachSeries, - forEachOfLimit: eachLimit, - map: map, - mapSeries: mapSeries, - mapLimit: mapLimit, - mapValues: mapValues, - mapValuesSeries: mapValuesSeries, - mapValuesLimit: mapValuesLimit, - filter: filter, - filterSeries: filterSeries, - filterLimit: filterLimit, - select: filter, - selectSeries: filterSeries, - selectLimit: filterLimit, - reject: reject, - rejectSeries: rejectSeries, - rejectLimit: rejectLimit, - detect: detect, - detectSeries: detectSeries, - detectLimit: detectLimit, - find: detect, - findSeries: detectSeries, - findLimit: detectLimit, - pick: pick, - pickSeries: pickSeries, - pickLimit: pickLimit, - omit: omit, - omitSeries: omitSeries, - omitLimit: omitLimit, - reduce: reduce, - inject: reduce, - foldl: reduce, - reduceRight: reduceRight, - foldr: reduceRight, - transform: transform, - transformSeries: transformSeries, - transformLimit: transformLimit, - sortBy: sortBy, - sortBySeries: sortBySeries, - sortByLimit: sortByLimit, - some: some, - someSeries: someSeries, - someLimit: someLimit, - any: some, - anySeries: someSeries, - anyLimit: someLimit, - every: every, - everySeries: everySeries, - everyLimit: everyLimit, - all: every, - allSeries: everySeries, - allLimit: everyLimit, - concat: concat, - concatSeries: concatSeries, - concatLimit: concatLimit, - groupBy: groupBy, - groupBySeries: groupBySeries, - groupByLimit: groupByLimit, - - // Control Flow - parallel: parallel, - series: series, - parallelLimit: parallelLimit, - tryEach: tryEach, - waterfall: waterfall, - angelFall: angelFall, - angelfall: angelFall, - whilst: whilst, - doWhilst: doWhilst, - until: until, - doUntil: doUntil, - during: during, - doDuring: doDuring, - forever: forever, - compose: compose, - seq: seq, - applyEach: applyEach, - applyEachSeries: applyEachSeries, - queue: queue, - priorityQueue: priorityQueue, - cargo: cargo, - auto: auto, - autoInject: autoInject, - retry: retry, - retryable: retryable, - iterator: iterator, - times: times, - timesSeries: timesSeries, - timesLimit: timesLimit, - race: race, - - // Utils - apply: apply, - nextTick: asyncNextTick, - setImmediate: asyncSetImmediate, - memoize: memoize, - unmemoize: unmemoize, - ensureAsync: ensureAsync, - constant: constant, - asyncify: asyncify, - wrapSync: asyncify, - log: log, - dir: dir, - reflect: reflect, - reflectAll: reflectAll, - timeout: timeout, - createLogger: createLogger, - - // Mode - safe: safe, - fast: fast - }; - - exports['default'] = index; - baseEachSync( - index, - function(func, key) { - exports[key] = func; - }, - nativeKeys(index) - ); - - /** - * @private - */ - function createImmediate(safeMode) { - var delay = function delay(fn) { - var args = slice(arguments, 1); - setTimeout(function() { - fn.apply(null, args); - }); - }; - asyncSetImmediate = typeof setImmediate === func ? setImmediate : delay; - if (typeof process === obj && typeof process.nextTick === func) { - nextTick = /^v0.10/.test(process.version) ? asyncSetImmediate : process.nextTick; - asyncNextTick = /^v0/.test(process.version) ? asyncSetImmediate : process.nextTick; - } else { - asyncNextTick = nextTick = asyncSetImmediate; - } - if (safeMode === false) { - nextTick = function(cb) { - cb(); - }; - } - } - - /* sync functions based on lodash */ - - /** - * Converts `arguments` to an array. - * - * @private - * @param {Array} array = The array to slice. - */ - function createArray(array) { - var index = -1; - var size = array.length; - var result = Array(size); - - while (++index < size) { - result[index] = array[index]; - } - return result; - } - - /** - * Create an array from `start` - * - * @private - * @param {Array} array - The array to slice. - * @param {number} start - The start position. - */ - function slice(array, start) { - var end = array.length; - var index = -1; - var size = end - start; - if (size <= 0) { - return []; - } - var result = Array(size); - - while (++index < size) { - result[index] = array[index + start]; - } - return result; - } - - /** - * @private - * @param {Object} object - */ - function objectClone(object) { - var keys = nativeKeys(object); - var size = keys.length; - var index = -1; - var result = {}; - - while (++index < size) { - var key = keys[index]; - result[key] = object[key]; - } - return result; - } - - /** - * Create an array with all falsey values removed. - * - * @private - * @param {Array} array - The array to compact. - */ - function compact(array) { - var index = -1; - var size = array.length; - var result = []; - - while (++index < size) { - var value = array[index]; - if (value) { - result[result.length] = value; - } - } - return result; - } - - /** - * Create an array of reverse sequence. - * - * @private - * @param {Array} array - The array to reverse. - */ - function reverse(array) { - var index = -1; - var size = array.length; - var result = Array(size); - var resIndex = size; - - while (++index < size) { - result[--resIndex] = array[index]; - } - return result; - } - - /** - * Checks if key exists in object property. - * - * @private - * @param {Object} object - The object to inspect. - * @param {string} key - The key to check. - */ - function has(object, key) { - return object.hasOwnProperty(key); - } - - /** - * Check if target exists in array. - * @private - * @param {Array} array - * @param {*} target - */ - function notInclude(array, target) { - var index = -1; - var size = array.length; - - while (++index < size) { - if (array[index] === target) { - return false; - } - } - return true; - } - - /** - * @private - * @param {Array} array - The array to iterate over. - * @param {Function} iterator - The function invoked per iteration. - */ - function arrayEachSync(array, iterator) { - var index = -1; - var size = array.length; - - while (++index < size) { - iterator(array[index], index); - } - return array; - } - - /** - * @private - * @param {Object} object - The object to iterate over. - * @param {Function} iterator - The function invoked per iteration. - * @param {Array} keys - */ - function baseEachSync(object, iterator, keys) { - var index = -1; - var size = keys.length; - - while (++index < size) { - var key = keys[index]; - iterator(object[key], key); - } - return object; - } - - /** - * @private - * @param {number} n - * @param {Function} iterator - */ - function timesSync(n, iterator) { - var index = -1; - while (++index < n) { - iterator(index); - } - } - - /** - * @private - * @param {Array} array - * @param {number[]} criteria - */ - function sortByCriteria(array, criteria) { - var l = array.length; - var indices = Array(l); - var i; - for (i = 0; i < l; i++) { - indices[i] = i; - } - quickSort(criteria, 0, l - 1, indices); - var result = Array(l); - for (var n = 0; n < l; n++) { - i = indices[n]; - result[n] = i === undefined ? array[n] : array[i]; - } - return result; - } - - function partition(array, i, j, mid, indices) { - var l = i; - var r = j; - while (l <= r) { - i = l; - while (l < r && array[l] < mid) { - l++; - } - while (r >= i && array[r] >= mid) { - r--; - } - if (l > r) { - break; - } - swap(array, indices, l++, r--); - } - return l; - } - - function swap(array, indices, l, r) { - var n = array[l]; - array[l] = array[r]; - array[r] = n; - var i = indices[l]; - indices[l] = indices[r]; - indices[r] = i; - } - - function quickSort(array, i, j, indices) { - if (i === j) { - return; - } - var k = i; - while (++k <= j && array[i] === array[k]) { - var l = k - 1; - if (indices[l] > indices[k]) { - var index = indices[l]; - indices[l] = indices[k]; - indices[k] = index; - } - } - if (k > j) { - return; - } - var p = array[i] > array[k] ? i : k; - k = partition(array, i, j, array[p], indices); - quickSort(array, i, k - 1, indices); - quickSort(array, k, j, indices); - } - - /** - * @Private - */ - function makeConcatResult(array) { - var result = []; - arrayEachSync(array, function(value) { - if (value === noop) { - return; - } - if (isArray(value)) { - nativePush.apply(result, value); - } else { - result.push(value); - } - }); - return result; - } - - /* async functions */ - - /** - * @private - */ - function arrayEach(array, iterator, callback) { - var index = -1; - var size = array.length; - - if (iterator.length === 3) { - while (++index < size) { - iterator(array[index], index, onlyOnce(callback)); - } - } else { - while (++index < size) { - iterator(array[index], onlyOnce(callback)); - } - } - } - - /** - * @private - */ - function baseEach(object, iterator, callback, keys) { - var key; - var index = -1; - var size = keys.length; - - if (iterator.length === 3) { - while (++index < size) { - key = keys[index]; - iterator(object[key], key, onlyOnce(callback)); - } - } else { - while (++index < size) { - iterator(object[keys[index]], onlyOnce(callback)); - } - } - } - - /** - * @private - */ - function symbolEach(collection, iterator, callback) { - var iter = collection[iteratorSymbol](); - var index = 0; - var item; - if (iterator.length === 3) { - while ((item = iter.next()).done === false) { - iterator(item.value, index++, onlyOnce(callback)); - } - } else { - while ((item = iter.next()).done === false) { - index++; - iterator(item.value, onlyOnce(callback)); - } - } - return index; - } - - /** - * @private - */ - function arrayEachResult(array, result, iterator, callback) { - var index = -1; - var size = array.length; - - if (iterator.length === 4) { - while (++index < size) { - iterator(result, array[index], index, onlyOnce(callback)); - } - } else { - while (++index < size) { - iterator(result, array[index], onlyOnce(callback)); - } - } - } - - /** - * @private - */ - function baseEachResult(object, result, iterator, callback, keys) { - var key; - var index = -1; - var size = keys.length; - - if (iterator.length === 4) { - while (++index < size) { - key = keys[index]; - iterator(result, object[key], key, onlyOnce(callback)); - } - } else { - while (++index < size) { - iterator(result, object[keys[index]], onlyOnce(callback)); - } - } - } - - /** - * @private - */ - function symbolEachResult(collection, result, iterator, callback) { - var item; - var index = 0; - var iter = collection[iteratorSymbol](); - - if (iterator.length === 4) { - while ((item = iter.next()).done === false) { - iterator(result, item.value, index++, onlyOnce(callback)); - } - } else { - while ((item = iter.next()).done === false) { - index++; - iterator(result, item.value, onlyOnce(callback)); - } - } - return index; - } - - /** - * @private - */ - function arrayEachFunc(array, createCallback) { - var index = -1; - var size = array.length; - - while (++index < size) { - array[index](createCallback(index)); - } - } - - /** - * @private - */ - function baseEachFunc(object, createCallback, keys) { - var key; - var index = -1; - var size = keys.length; - - while (++index < size) { - key = keys[index]; - object[key](createCallback(key)); - } - } - - /** - * @private - */ - function arrayEachIndex(array, iterator, createCallback) { - var index = -1; - var size = array.length; - - if (iterator.length === 3) { - while (++index < size) { - iterator(array[index], index, createCallback(index)); - } - } else { - while (++index < size) { - iterator(array[index], createCallback(index)); - } - } - } - - /** - * @private - */ - function baseEachIndex(object, iterator, createCallback, keys) { - var key; - var index = -1; - var size = keys.length; - - if (iterator.length === 3) { - while (++index < size) { - key = keys[index]; - iterator(object[key], key, createCallback(index)); - } - } else { - while (++index < size) { - iterator(object[keys[index]], createCallback(index)); - } - } - } - - /** - * @private - */ - function symbolEachIndex(collection, iterator, createCallback) { - var item; - var index = 0; - var iter = collection[iteratorSymbol](); - - if (iterator.length === 3) { - while ((item = iter.next()).done === false) { - iterator(item.value, index, createCallback(index++)); - } - } else { - while ((item = iter.next()).done === false) { - iterator(item.value, createCallback(index++)); - } - } - return index; - } - - /** - * @private - */ - function baseEachKey(object, iterator, createCallback, keys) { - var key; - var index = -1; - var size = keys.length; - - if (iterator.length === 3) { - while (++index < size) { - key = keys[index]; - iterator(object[key], key, createCallback(key)); - } - } else { - while (++index < size) { - key = keys[index]; - iterator(object[key], createCallback(key)); - } - } - } - - /** - * @private - */ - function symbolEachKey(collection, iterator, createCallback) { - var item; - var index = 0; - var iter = collection[iteratorSymbol](); - - if (iterator.length === 3) { - while ((item = iter.next()).done === false) { - iterator(item.value, index, createCallback(index++)); - } - } else { - while ((item = iter.next()).done === false) { - iterator(item.value, createCallback(index++)); - } - } - return index; - } - - /** - * @private - */ - function arrayEachValue(array, iterator, createCallback) { - var value; - var index = -1; - var size = array.length; - - if (iterator.length === 3) { - while (++index < size) { - value = array[index]; - iterator(value, index, createCallback(value)); - } - } else { - while (++index < size) { - value = array[index]; - iterator(value, createCallback(value)); - } - } - } - - /** - * @private - */ - function baseEachValue(object, iterator, createCallback, keys) { - var key, value; - var index = -1; - var size = keys.length; - - if (iterator.length === 3) { - while (++index < size) { - key = keys[index]; - value = object[key]; - iterator(value, key, createCallback(value)); - } - } else { - while (++index < size) { - value = object[keys[index]]; - iterator(value, createCallback(value)); - } - } - } - - /** - * @private - */ - function symbolEachValue(collection, iterator, createCallback) { - var value, item; - var index = 0; - var iter = collection[iteratorSymbol](); - - if (iterator.length === 3) { - while ((item = iter.next()).done === false) { - value = item.value; - iterator(value, index++, createCallback(value)); - } - } else { - while ((item = iter.next()).done === false) { - index++; - value = item.value; - iterator(value, createCallback(value)); - } - } - return index; - } - - /** - * @private - */ - function arrayEachIndexValue(array, iterator, createCallback) { - var value; - var index = -1; - var size = array.length; - - if (iterator.length === 3) { - while (++index < size) { - value = array[index]; - iterator(value, index, createCallback(index, value)); - } - } else { - while (++index < size) { - value = array[index]; - iterator(value, createCallback(index, value)); - } - } - } - - /** - * @private - */ - function baseEachIndexValue(object, iterator, createCallback, keys) { - var key, value; - var index = -1; - var size = keys.length; - - if (iterator.length === 3) { - while (++index < size) { - key = keys[index]; - value = object[key]; - iterator(value, key, createCallback(index, value)); - } - } else { - while (++index < size) { - value = object[keys[index]]; - iterator(value, createCallback(index, value)); - } - } - } - - /** - * @private - */ - function symbolEachIndexValue(collection, iterator, createCallback) { - var value, item; - var index = 0; - var iter = collection[iteratorSymbol](); - - if (iterator.length === 3) { - while ((item = iter.next()).done === false) { - value = item.value; - iterator(value, index, createCallback(index++, value)); - } - } else { - while ((item = iter.next()).done === false) { - value = item.value; - iterator(value, createCallback(index++, value)); - } - } - return index; - } - - /** - * @private - */ - function baseEachKeyValue(object, iterator, createCallback, keys) { - var key, value; - var index = -1; - var size = keys.length; - - if (iterator.length === 3) { - while (++index < size) { - key = keys[index]; - value = object[key]; - iterator(value, key, createCallback(key, value)); - } - } else { - while (++index < size) { - key = keys[index]; - value = object[key]; - iterator(value, createCallback(key, value)); - } - } - } - - /** - * @private - */ - function symbolEachKeyValue(collection, iterator, createCallback) { - var value, item; - var index = 0; - var iter = collection[iteratorSymbol](); - - if (iterator.length === 3) { - while ((item = iter.next()).done === false) { - value = item.value; - iterator(value, index, createCallback(index++, value)); - } - } else { - while ((item = iter.next()).done === false) { - value = item.value; - iterator(value, createCallback(index++, value)); - } - } - return index; - } - - /** - * @private - * @param {Function} func - */ - function onlyOnce(func) { - return function(err, res) { - var fn = func; - func = throwError; - fn(err, res); - }; - } - - /** - * @private - * @param {Function} func - */ - function once(func) { - return function(err, res) { - var fn = func; - func = noop; - fn(err, res); - }; - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - */ - function createEach(arrayEach, baseEach, symbolEach) { - return function each(collection, iterator, callback) { - callback = once(callback || noop); - var size, keys; - var completed = 0; - if (isArray(collection)) { - size = collection.length; - arrayEach(collection, iterator, done); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = symbolEach(collection, iterator, done); - size && size === completed && callback(null); - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - baseEach(collection, iterator, done, keys); - } - if (!size) { - callback(null); - } - - function done(err, bool) { - if (err) { - callback = once(callback); - callback(err); - } else if (++completed === size) { - callback(null); - } else if (bool === false) { - callback = once(callback); - callback(null); - } - } - }; - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - */ - function createMap(arrayEach, baseEach, symbolEach, useArray) { - var init, clone; - if (useArray) { - init = Array; - clone = createArray; - } else { - init = function() { - return {}; - }; - clone = objectClone; - } - - return function(collection, iterator, callback) { - callback = callback || noop; - var size, keys, result; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - result = init(size); - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - // TODO: size could be changed - result = init(0); - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null, result); - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - result = init(size); - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - callback(null, init()); - } - - function createCallback(key) { - return function done(err, res) { - if (key === null) { - throwError(); - } - if (err) { - key = null; - callback = once(callback); - callback(err, clone(result)); - return; - } - result[key] = res; - key = null; - if (++completed === size) { - callback(null, result); - } - }; - } - }; - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - * @param {boolean} bool - */ - function createFilter(arrayEach, baseEach, symbolEach, bool) { - return function(collection, iterator, callback) { - callback = callback || noop; - var size, keys, result; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - result = Array(size); - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - result = []; - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null, compact(result)); - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - result = Array(size); - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - return callback(null, []); - } - - function createCallback(index, value) { - return function done(err, res) { - if (index === null) { - throwError(); - } - if (err) { - index = null; - callback = once(callback); - callback(err); - return; - } - if (!!res === bool) { - result[index] = value; - } - index = null; - if (++completed === size) { - callback(null, compact(result)); - } - }; - } - }; - } - - /** - * @private - * @param {boolean} bool - */ - function createFilterSeries(bool) { - return function(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, value, keys, iter, item, iterate; - var sync = false; - var completed = 0; - var result = []; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, []); - } - iterate(); - - function arrayIterator() { - value = collection[completed]; - iterator(value, done); - } - - function arrayIteratorWithIndex() { - value = collection[completed]; - iterator(value, completed, done); - } - - function symbolIterator() { - item = iter.next(); - value = item.value; - item.done ? callback(null, result) : iterator(value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - value = item.value; - item.done ? callback(null, result) : iterator(value, completed, done); - } - - function objectIterator() { - key = keys[completed]; - value = collection[key]; - iterator(value, done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - value = collection[key]; - iterator(value, key, done); - } - - function done(err, res) { - if (err) { - callback(err); - return; - } - if (!!res === bool) { - result[result.length] = value; - } - if (++completed === size) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - }; - } - - /** - * @private - * @param {boolean} bool - */ - function createFilterLimit(bool) { - return function(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, value, keys, iter, item, iterate, result; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - result = []; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, []); - } - result = result || Array(size); - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, createCallback(value, index)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, index, createCallback(value, index)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - value = item.value; - iterator(value, createCallback(value, started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, compact(result)); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - value = item.value; - iterator(value, started, createCallback(value, started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, compact(result)); - } - } - - function objectIterator() { - index = started++; - if (index < size) { - value = collection[keys[index]]; - iterator(value, createCallback(value, index)); - } - } - - function objectIteratorWithKey() { - index = started++; - if (index < size) { - key = keys[index]; - value = collection[key]; - iterator(value, key, createCallback(value, index)); - } - } - - function createCallback(value, index) { - return function(err, res) { - if (index === null) { - throwError(); - } - if (err) { - index = null; - iterate = noop; - callback = once(callback); - callback(err); - return; - } - if (!!res === bool) { - result[index] = value; - } - index = null; - if (++completed === size) { - callback = onlyOnce(callback); - callback(null, compact(result)); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - }; - } - - /** - * @memberof async - * @namespace eachSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(); - * }, num * 10); - * }; - * async.eachSeries(array, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(); - * }, num * 10); - * }; - * async.eachSeries(array, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(); - * }, num * 10); - * }; - * async.eachSeries(object, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(); - * }, num * 10); - * }; - * async.eachSeries(object, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'b']] - * }); - * - * @example - * - * // break - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num !== 3); - * }, num * 10); - * }; - * async.eachSeries(array, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 3] - * }); - */ - function eachSeries(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, keys, iter, item, iterate; - var sync = false; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null); - } - iterate(); - - function arrayIterator() { - iterator(collection[completed], done); - } - - function arrayIteratorWithIndex() { - iterator(collection[completed], completed, done); - } - - function symbolIterator() { - item = iter.next(); - item.done ? callback(null) : iterator(item.value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - item.done ? callback(null) : iterator(item.value, completed, done); - } - - function objectIterator() { - iterator(collection[keys[completed]], done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - iterator(collection[key], key, done); - } - - function done(err, bool) { - if (err) { - callback(err); - } else if (++completed === size || bool === false) { - iterate = throwError; - callback(null); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace eachLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(); - * }, num * 10); - * }; - * async.eachLimit(array, 2, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(); - * }, num * 10); - * }; - * async.eachLimit(array, 2, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(); - * }, num * 10); - * }; - * async.eachLimit(object, 2, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(); - * }, num * 10); - * }; - * async.eachLimit(object, 2, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - * @example - * - * // break - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num !== 5); - * }, num * 10); - * }; - * async.eachLimit(array, 2, iterator, function(err, res) { - * console.log(res); // undefined - * console.log(order); // [1, 3, 5] - * }); - * - */ - function eachLimit(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, keys, iter, item, iterate; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } else { - return callback(null); - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - if (started < size) { - iterator(collection[started++], done); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - iterator(collection[index], index, done); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - started++; - iterator(item.value, done); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, started++, done); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null); - } - } - - function objectIterator() { - if (started < size) { - iterator(collection[keys[started++]], done); - } - } - - function objectIteratorWithKey() { - index = started++; - if (index < size) { - key = keys[index]; - iterator(collection[key], key, done); - } - } - - function done(err, bool) { - if (err || bool === false) { - iterate = noop; - callback = once(callback); - callback(err); - } else if (++completed === size) { - iterator = noop; - iterate = throwError; - callback = onlyOnce(callback); - callback(null); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace mapSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapSeries(array, iterator, function(err, res) { - * console.log(res); // [1, 3, 2]; - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.mapSeries(array, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapSeries(object, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.mapSeries(object, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] - * }); - * - */ - function mapSeries(collection, iterator, callback) { - callback = callback || noop; - var size, key, keys, iter, item, result, iterate; - var sync = false; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - result = []; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, []); - } - result = result || Array(size); - iterate(); - - function arrayIterator() { - iterator(collection[completed], done); - } - - function arrayIteratorWithIndex() { - iterator(collection[completed], completed, done); - } - - function symbolIterator() { - item = iter.next(); - item.done ? callback(null, result) : iterator(item.value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - item.done ? callback(null, result) : iterator(item.value, completed, done); - } - - function objectIterator() { - iterator(collection[keys[completed]], done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - iterator(collection[key], key, done); - } - - function done(err, res) { - if (err) { - iterate = throwError; - callback = onlyOnce(callback); - callback(err, createArray(result)); - return; - } - result[completed] = res; - if (++completed === size) { - iterate = throwError; - callback(null, result); - callback = throwError; - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace mapLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3, 4, 2] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.mapLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3, 4, 2] - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3, 4, 2] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.mapLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 5, 3, 4, 2] - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - function mapLimit(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, keys, iter, item, result, iterate; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - result = []; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, []); - } - result = result || Array(size); - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - iterator(collection[index], createCallback(index)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - iterator(collection[index], index, createCallback(index)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, createCallback(started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, started, createCallback(started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function objectIterator() { - index = started++; - if (index < size) { - iterator(collection[keys[index]], createCallback(index)); - } - } - - function objectIteratorWithKey() { - index = started++; - if (index < size) { - key = keys[index]; - iterator(collection[key], key, createCallback(index)); - } - } - - function createCallback(index) { - return function(err, res) { - if (index === null) { - throwError(); - } - if (err) { - index = null; - iterate = noop; - callback = once(callback); - callback(err, createArray(result)); - return; - } - result[index] = res; - index = null; - if (++completed === size) { - iterate = throwError; - callback(null, result); - callback = throwError; - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @memberof async - * @namespace mapValuesSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesSeries(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3, '2': 2 } - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesSeries(array, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3, '2': 2 } - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesSeries(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3, c: 2 } - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesSeries(object, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3, c: 2 } - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] - * }); - * - */ - function mapValuesSeries(collection, iterator, callback) { - callback = callback || noop; - var size, key, keys, iter, item, iterate; - var sync = false; - var result = {}; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, result); - } - iterate(); - - function arrayIterator() { - key = completed; - iterator(collection[completed], done); - } - - function arrayIteratorWithIndex() { - key = completed; - iterator(collection[completed], completed, done); - } - - function symbolIterator() { - key = completed; - item = iter.next(); - item.done ? callback(null, result) : iterator(item.value, done); - } - - function symbolIteratorWithKey() { - key = completed; - item = iter.next(); - item.done ? callback(null, result) : iterator(item.value, completed, done); - } - - function objectIterator() { - key = keys[completed]; - iterator(collection[key], done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - iterator(collection[key], key, done); - } - - function done(err, res) { - if (err) { - iterate = throwError; - callback = onlyOnce(callback); - callback(err, objectClone(result)); - return; - } - result[key] = res; - if (++completed === size) { - iterate = throwError; - callback(null, result); - callback = throwError; - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace mapValuesLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 5, '2': 3, '3': 4, '4': 2 } - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 5, '2': 3, '3': 4, '4': 2 } - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 5, c: 3, d: 4, e: 2 } - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.mapValuesLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 5, c: 3, d: 4, e: 2 } - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - function mapValuesLimit(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, keys, iter, item, iterate; - var sync = false; - var result = {}; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, result); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - iterator(collection[index], createCallback(index)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - iterator(collection[index], index, createCallback(index)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, createCallback(started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, started, createCallback(started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function objectIterator() { - index = started++; - if (index < size) { - key = keys[index]; - iterator(collection[key], createCallback(key)); - } - } - - function objectIteratorWithKey() { - index = started++; - if (index < size) { - key = keys[index]; - iterator(collection[key], key, createCallback(key)); - } - } - - function createCallback(key) { - return function(err, res) { - if (key === null) { - throwError(); - } - if (err) { - key = null; - iterate = noop; - callback = once(callback); - callback(err, objectClone(result)); - return; - } - result[key] = res; - key = null; - if (++completed === size) { - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - * @param {boolean} bool - */ - function createDetect(arrayEach, baseEach, symbolEach, bool) { - return function(collection, iterator, callback) { - callback = callback || noop; - var size, keys; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null); - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - callback(null); - } - - function createCallback(value) { - var called = false; - return function done(err, res) { - if (called) { - throwError(); - } - called = true; - if (err) { - callback = once(callback); - callback(err); - } else if (!!res === bool) { - callback = once(callback); - callback(null, value); - } else if (++completed === size) { - callback(null); - } - }; - } - }; - } - - /** - * @private - * @param {boolean} bool - */ - function createDetectSeries(bool) { - return function(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, value, keys, iter, item, iterate; - var sync = false; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null); - } - iterate(); - - function arrayIterator() { - value = collection[completed]; - iterator(value, done); - } - - function arrayIteratorWithIndex() { - value = collection[completed]; - iterator(value, completed, done); - } - - function symbolIterator() { - item = iter.next(); - value = item.value; - item.done ? callback(null) : iterator(value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - value = item.value; - item.done ? callback(null) : iterator(value, completed, done); - } - - function objectIterator() { - value = collection[keys[completed]]; - iterator(value, done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - value = collection[key]; - iterator(value, key, done); - } - - function done(err, res) { - if (err) { - callback(err); - } else if (!!res === bool) { - iterate = throwError; - callback(null, value); - } else if (++completed === size) { - iterate = throwError; - callback(null); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - }; - } - - /** - * @private - * @param {boolean} bool - */ - function createDetectLimit(bool) { - return function(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, value, keys, iter, item, iterate; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, createCallback(value)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, index, createCallback(value)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - started++; - value = item.value; - iterator(value, createCallback(value)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - value = item.value; - iterator(value, started++, createCallback(value)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null); - } - } - - function objectIterator() { - index = started++; - if (index < size) { - value = collection[keys[index]]; - iterator(value, createCallback(value)); - } - } - - function objectIteratorWithKey() { - if (started < size) { - key = keys[started++]; - value = collection[key]; - iterator(value, key, createCallback(value)); - } - } - - function createCallback(value) { - var called = false; - return function(err, res) { - if (called) { - throwError(); - } - called = true; - if (err) { - iterate = noop; - callback = once(callback); - callback(err); - } else if (!!res === bool) { - iterate = noop; - callback = once(callback); - callback(null, value); - } else if (++completed === size) { - callback(null); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - }; - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - * @param {boolean} bool - */ - function createPick(arrayEach, baseEach, symbolEach, bool) { - return function(collection, iterator, callback) { - callback = callback || noop; - var size, keys; - var completed = 0; - var result = {}; - - if (isArray(collection)) { - size = collection.length; - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null, result); - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - return callback(null, {}); - } - - function createCallback(key, value) { - return function done(err, res) { - if (key === null) { - throwError(); - } - if (err) { - key = null; - callback = once(callback); - callback(err, objectClone(result)); - return; - } - if (!!res === bool) { - result[key] = value; - } - key = null; - if (++completed === size) { - callback(null, result); - } - }; - } - }; - } - - /** - * @private - * @param {boolean} bool - */ - function createPickSeries(bool) { - return function(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, value, keys, iter, item, iterate; - var sync = false; - var result = {}; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, {}); - } - iterate(); - - function arrayIterator() { - key = completed; - value = collection[completed]; - iterator(value, done); - } - - function arrayIteratorWithIndex() { - key = completed; - value = collection[completed]; - iterator(value, completed, done); - } - - function symbolIterator() { - key = completed; - item = iter.next(); - value = item.value; - item.done ? callback(null, result) : iterator(value, done); - } - - function symbolIteratorWithKey() { - key = completed; - item = iter.next(); - value = item.value; - item.done ? callback(null, result) : iterator(value, key, done); - } - - function objectIterator() { - key = keys[completed]; - value = collection[key]; - iterator(value, done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - value = collection[key]; - iterator(value, key, done); - } - - function done(err, res) { - if (err) { - callback(err, result); - return; - } - if (!!res === bool) { - result[key] = value; - } - if (++completed === size) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - }; - } - - /** - * @private - * @param {boolean} bool - */ - function createPickLimit(bool) { - return function(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, value, keys, iter, item, iterate; - var sync = false; - var result = {}; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, {}); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, createCallback(value, index)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, index, createCallback(value, index)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - value = item.value; - iterator(value, createCallback(value, started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - value = item.value; - iterator(value, started, createCallback(value, started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function objectIterator() { - if (started < size) { - key = keys[started++]; - value = collection[key]; - iterator(value, createCallback(value, key)); - } - } - - function objectIteratorWithKey() { - if (started < size) { - key = keys[started++]; - value = collection[key]; - iterator(value, key, createCallback(value, key)); - } - } - - function createCallback(value, key) { - return function(err, res) { - if (key === null) { - throwError(); - } - if (err) { - key = null; - iterate = noop; - callback = once(callback); - callback(err, objectClone(result)); - return; - } - if (!!res === bool) { - result[key] = value; - } - key = null; - if (++completed === size) { - iterate = throwError; - callback = onlyOnce(callback); - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - }; - } - - /** - * @memberof async - * @namespace reduce - * @param {Array|Object} collection - * @param {*} result - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduce(collection, 0, iterator, function(err, res) { - * console.log(res); // 10 - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduce(collection, '', iterator, function(err, res) { - * console.log(res); // '1324' - * console.log(order); // [[1, 0], [3, 1], [2, 2], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduce(collection, '', iterator, function(err, res) { - * console.log(res); // '1324' - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduce(collection, 0, iterator, function(err, res) { - * console.log(res); // 10 - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'b'], [4, 'd']] - * }); - * - */ - function reduce(collection, result, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, keys, iter, item, iterate; - var sync = false; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, result); - } - iterate(result); - - function arrayIterator(result) { - iterator(result, collection[completed], done); - } - - function arrayIteratorWithIndex(result) { - iterator(result, collection[completed], completed, done); - } - - function symbolIterator(result) { - item = iter.next(); - item.done ? callback(null, result) : iterator(result, item.value, done); - } - - function symbolIteratorWithKey(result) { - item = iter.next(); - item.done ? callback(null, result) : iterator(result, item.value, completed, done); - } - - function objectIterator(result) { - iterator(result, collection[keys[completed]], done); - } - - function objectIteratorWithKey(result) { - key = keys[completed]; - iterator(result, collection[key], key, done); - } - - function done(err, result) { - if (err) { - callback(err, result); - } else if (++completed === size) { - iterator = throwError; - callback(null, result); - } else if (sync) { - nextTick(function() { - iterate(result); - }); - } else { - sync = true; - iterate(result); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace reduceRight - * @param {Array|Object} collection - * @param {*} result - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduceRight(collection, 0, iterator, function(err, res) { - * console.log(res); // 10 - * console.log(order); // [4, 2, 3, 1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduceRight(collection, '', iterator, function(err, res) { - * console.log(res); // '4231' - * console.log(order); // [[4, 3], [2, 2], [3, 1], [1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduceRight(collection, '', iterator, function(err, res) { - * console.log(res); // '4231' - * console.log(order); // [4, 2, 3, 1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, result + num); - * }, num * 10); - * }; - * async.reduceRight(collection, 0, iterator, function(err, res) { - * console.log(res); // 10 - * console.log(order); // [[4, 3], [2, 2], [3, 1], [1, 0]] - * }); - * - */ - function reduceRight(collection, result, iterator, callback) { - callback = onlyOnce(callback || noop); - var resIndex, index, key, keys, iter, item, col, iterate; - var sync = false; - - if (isArray(collection)) { - resIndex = collection.length; - iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - col = []; - iter = collection[iteratorSymbol](); - index = -1; - while ((item = iter.next()).done === false) { - col[++index] = item.value; - } - collection = col; - resIndex = col.length; - iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - resIndex = keys.length; - iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; - } - if (!resIndex) { - return callback(null, result); - } - iterate(result); - - function arrayIterator(result) { - iterator(result, collection[--resIndex], done); - } - - function arrayIteratorWithIndex(result) { - iterator(result, collection[--resIndex], resIndex, done); - } - - function objectIterator(result) { - iterator(result, collection[keys[--resIndex]], done); - } - - function objectIteratorWithKey(result) { - key = keys[--resIndex]; - iterator(result, collection[key], key, done); - } - - function done(err, result) { - if (err) { - callback(err, result); - } else if (resIndex === 0) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(function() { - iterate(result); - }); - } else { - sync = true; - iterate(result); - } - sync = false; - } - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - */ - function createTransform(arrayEach, baseEach, symbolEach) { - return function transform(collection, accumulator, iterator, callback) { - if (arguments.length === 3) { - callback = iterator; - iterator = accumulator; - accumulator = undefined; - } - callback = callback || noop; - var size, keys, result; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - result = accumulator !== undefined ? accumulator : []; - arrayEach(collection, result, iterator, done); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - result = accumulator !== undefined ? accumulator : {}; - size = symbolEach(collection, result, iterator, done); - size && size === completed && callback(null, result); - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - result = accumulator !== undefined ? accumulator : {}; - baseEach(collection, result, iterator, done, keys); - } - if (!size) { - callback(null, accumulator !== undefined ? accumulator : result || {}); - } - - function done(err, bool) { - if (err) { - callback = once(callback); - callback(err, isArray(result) ? createArray(result) : objectClone(result)); - } else if (++completed === size) { - callback(null, result); - } else if (bool === false) { - callback = once(callback); - callback(null, isArray(result) ? createArray(result) : objectClone(result)); - } - } - }; - } - - /** - * @memberof async - * @namespace transformSeries - * @param {Array|Object} collection - * @param {Array|Object|Function} [accumulator] - * @param {Function} [iterator] - * @param {Function} [callback] - * @example - * - * // array - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * result.push(num) - * done(); - * }, num * 10); - * }; - * async.transformSeries(collection, iterator, function(err, res) { - * console.log(res); // [1, 3, 2, 4] - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // array with index and accumulator - * var order = []; - * var collection = [1, 3, 2, 4]; - * var iterator = function(result, num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * result[index] = num; - * done(); - * }, num * 10); - * }; - * async.transformSeries(collection, {}, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 3, '2': 2, '3': 4 } - * console.log(order); // [[1, 0], [3, 1], [2, 2], [4, 3]] - * }); - * - * @example - * - * // object with accumulator - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * result.push(num); - * done(); - * }, num * 10); - * }; - * async.transformSeries(collection, [], iterator, function(err, res) { - * console.log(res); // [1, 3, 2, 4] - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2, d: 4 }; - * var iterator = function(result, num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * result[key] = num; - * done(); - * }, num * 10); - * }; - * async.transformSeries(collection, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 3, c: 2, d: 4 } - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'b'], [4, 'd']] - * }); - * - */ - function transformSeries(collection, accumulator, iterator, callback) { - if (arguments.length === 3) { - callback = iterator; - iterator = accumulator; - accumulator = undefined; - } - callback = onlyOnce(callback || noop); - var size, key, keys, iter, item, iterate, result; - var sync = false; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - result = accumulator !== undefined ? accumulator : []; - iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - result = accumulator !== undefined ? accumulator : {}; - iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - result = accumulator !== undefined ? accumulator : {}; - iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, accumulator !== undefined ? accumulator : result || {}); - } - iterate(); - - function arrayIterator() { - iterator(result, collection[completed], done); - } - - function arrayIteratorWithIndex() { - iterator(result, collection[completed], completed, done); - } - - function symbolIterator() { - item = iter.next(); - item.done ? callback(null, result) : iterator(result, item.value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - item.done ? callback(null, result) : iterator(result, item.value, completed, done); - } - - function objectIterator() { - iterator(result, collection[keys[completed]], done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - iterator(result, collection[key], key, done); - } - - function done(err, bool) { - if (err) { - callback(err, result); - } else if (++completed === size || bool === false) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace transformLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Array|Object|Function} [accumulator] - * @param {Function} [iterator] - * @param {Function} [callback] - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * result.push(num); - * done(); - * }, num * 10); - * }; - * async.transformLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 3, 5, 2, 4] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index and accumulator - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(result, num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * result[index] = key; - * done(); - * }, num * 10); - * }; - * async.transformLimit(array, 2, {}, iterator, function(err, res) { - * console.log(res); // { '0': 1, '1': 5, '2': 3, '3': 4, '4': 2 } - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object with accumulator - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(result, num, done) { - * setTimeout(function() { - * order.push(num); - * result.push(num); - * done(); - * }, num * 10); - * }; - * async.transformLimit(object, 2, [], iterator, function(err, res) { - * console.log(res); // [1, 3, 5, 2, 4] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(result, num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * result[key] = num; - * done(); - * }, num * 10); - * }; - * async.transformLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - function transformLimit(collection, limit, accumulator, iterator, callback) { - if (arguments.length === 4) { - callback = iterator; - iterator = accumulator; - accumulator = undefined; - } - callback = callback || noop; - var size, index, key, keys, iter, item, iterate, result; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - result = accumulator !== undefined ? accumulator : []; - iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - result = accumulator !== undefined ? accumulator : {}; - iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - result = accumulator !== undefined ? accumulator : {}; - iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, accumulator !== undefined ? accumulator : result || {}); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - iterator(result, collection[index], onlyOnce(done)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - iterator(result, collection[index], index, onlyOnce(done)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - started++; - iterator(result, item.value, onlyOnce(done)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - iterator(result, item.value, started++, onlyOnce(done)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function objectIterator() { - index = started++; - if (index < size) { - iterator(result, collection[keys[index]], onlyOnce(done)); - } - } - - function objectIteratorWithKey() { - index = started++; - if (index < size) { - key = keys[index]; - iterator(result, collection[key], key, onlyOnce(done)); - } - } - - function done(err, bool) { - if (err || bool === false) { - iterate = noop; - callback(err || null, isArray(result) ? createArray(result) : objectClone(result)); - callback = noop; - } else if (++completed === size) { - iterator = noop; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @private - * @param {function} arrayEach - * @param {function} baseEach - * @param {function} symbolEach - */ - function createSortBy(arrayEach, baseEach, symbolEach) { - return function sortBy(collection, iterator, callback) { - callback = callback || noop; - var size, array, criteria; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - array = Array(size); - criteria = Array(size); - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - array = []; - criteria = []; - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null, sortByCriteria(array, criteria)); - } else if (typeof collection === obj) { - var keys = nativeKeys(collection); - size = keys.length; - array = Array(size); - criteria = Array(size); - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - callback(null, []); - } - - function createCallback(index, value) { - var called = false; - array[index] = value; - return function done(err, criterion) { - if (called) { - throwError(); - } - called = true; - criteria[index] = criterion; - if (err) { - callback = once(callback); - callback(err); - } else if (++completed === size) { - callback(null, sortByCriteria(array, criteria)); - } - }; - } - }; - } - - /** - * @memberof async - * @namespace sortBySeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.sortBySeries(array, iterator, function(err, res) { - * console.log(res); // [1, 2, 3]; - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.sortBySeries(array, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.sortBySeries(object, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.sortBySeries(object, iterator, function(err, res) { - * console.log(res); // [1, 2, 3] - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] - * }); - * - */ - function sortBySeries(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, value, keys, iter, item, array, criteria, iterate; - var sync = false; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - array = collection; - criteria = Array(size); - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - array = []; - criteria = []; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - array = Array(size); - criteria = Array(size); - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, []); - } - iterate(); - - function arrayIterator() { - value = collection[completed]; - iterator(value, done); - } - - function arrayIteratorWithIndex() { - value = collection[completed]; - iterator(value, completed, done); - } - - function symbolIterator() { - item = iter.next(); - if (item.done) { - return callback(null, sortByCriteria(array, criteria)); - } - value = item.value; - array[completed] = value; - iterator(value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done) { - return callback(null, sortByCriteria(array, criteria)); - } - value = item.value; - array[completed] = value; - iterator(value, completed, done); - } - - function objectIterator() { - value = collection[keys[completed]]; - array[completed] = value; - iterator(value, done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - value = collection[key]; - array[completed] = value; - iterator(value, key, done); - } - - function done(err, criterion) { - criteria[completed] = criterion; - if (err) { - callback(err); - } else if (++completed === size) { - iterate = throwError; - callback(null, sortByCriteria(array, criteria)); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace sortByLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.sortByLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 2, 3, 4, 5] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num); - * }, num * 10); - * }; - * async.sortByLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 2, 3, 4, 5] - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num); - * }, num * 10); - * }; - * async.sortByLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 2, 3, 4, 5] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.sortByLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 2, 3, 4, 5] - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - function sortByLimit(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, value, array, keys, iter, item, criteria, iterate; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - array = collection; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - array = []; - criteria = []; - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - array = Array(size); - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, []); - } - criteria = criteria || Array(size); - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - if (started < size) { - value = collection[started]; - iterator(value, createCallback(value, started++)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, index, createCallback(value, index)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - value = item.value; - array[started] = value; - iterator(value, createCallback(value, started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, sortByCriteria(array, criteria)); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - value = item.value; - array[started] = value; - iterator(value, started, createCallback(value, started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, sortByCriteria(array, criteria)); - } - } - - function objectIterator() { - if (started < size) { - value = collection[keys[started]]; - array[started] = value; - iterator(value, createCallback(value, started++)); - } - } - - function objectIteratorWithKey() { - if (started < size) { - key = keys[started]; - value = collection[key]; - array[started] = value; - iterator(value, key, createCallback(value, started++)); - } - } - - function createCallback(value, index) { - var called = false; - return function(err, criterion) { - if (called) { - throwError(); - } - called = true; - criteria[index] = criterion; - if (err) { - iterate = noop; - callback(err); - callback = noop; - } else if (++completed === size) { - callback(null, sortByCriteria(array, criteria)); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @memberof async - * @namespace some - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.some(array, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.some(array, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [[1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.some(object, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.some(object, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [[1, 'a']] - * }); - * - */ - function some(collection, iterator, callback) { - callback = callback || noop; - detect(collection, iterator, done); - - function done(err, res) { - if (err) { - return callback(err); - } - callback(null, !!res); - } - } - - /** - * @memberof async - * @namespace someSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someSeries(array, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someSeries(array, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [[1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someSeries(object, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someSeries(object, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [[1, 'a']] - * }); - * - */ - function someSeries(collection, iterator, callback) { - callback = callback || noop; - detectSeries(collection, iterator, done); - - function done(err, res) { - if (err) { - return callback(err); - } - callback(null, !!res); - } - } - - /** - * @memberof async - * @namespace someLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someLimit(array, 2, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someLimit(array, 2, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [[1, 0]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someLimit(object, 2, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num % 2); - * }, num * 10); - * }; - * async.someLimit(object, 2, iterator, function(err, res) { - * console.log(res); // true - * console.log(order); // [[1, 'a']] - * }); - * - */ - function someLimit(collection, limit, iterator, callback) { - callback = callback || noop; - detectLimit(collection, limit, iterator, done); - - function done(err, res) { - if (err) { - return callback(err); - } - callback(null, !!res); - } - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - */ - function createEvery(arrayEach, baseEach, symbolEach) { - var deny = createDetect(arrayEach, baseEach, symbolEach, false); - - return function every(collection, iterator, callback) { - callback = callback || noop; - deny(collection, iterator, done); - - function done(err, res) { - if (err) { - return callback(err); - } - callback(null, !res); - } - }; - } - - /** - * @private - */ - function createEverySeries() { - var denySeries = createDetectSeries(false); - - return function everySeries(collection, iterator, callback) { - callback = callback || noop; - denySeries(collection, iterator, done); - - function done(err, res) { - if (err) { - return callback(err); - } - callback(null, !res); - } - }; - } - - /** - * @private - */ - function createEveryLimit() { - var denyLimit = createDetectLimit(false); - - return function everyLimit(collection, limit, iterator, callback) { - callback = callback || noop; - denyLimit(collection, limit, iterator, done); - - function done(err, res) { - if (err) { - return callback(err); - } - callback(null, !res); - } - }; - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - */ - function createConcat(arrayEach, baseEach, symbolEach) { - return function concat(collection, iterator, callback) { - callback = callback || noop; - var size, result; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - result = Array(size); - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - result = []; - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null, result); - } else if (typeof collection === obj) { - var keys = nativeKeys(collection); - size = keys.length; - result = Array(size); - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - callback(null, []); - } - - function createCallback(index) { - return function done(err, res) { - if (index === null) { - throwError(); - } - if (err) { - index = null; - callback = once(callback); - arrayEachSync(result, function(array, index) { - if (array === undefined) { - result[index] = noop; - } - }); - callback(err, makeConcatResult(result)); - return; - } - switch (arguments.length) { - case 0: - case 1: - result[index] = noop; - break; - case 2: - result[index] = res; - break; - default: - result[index] = slice(arguments, 1); - break; - } - index = null; - if (++completed === size) { - callback(null, makeConcatResult(result)); - } - }; - } - }; - } - - /** - * @memberof async - * @namespace concatSeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, [num]); - * }, num * 10); - * }; - * async.concatSeries(array, iterator, function(err, res) { - * console.log(res); // [1, 3, 2]; - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 3, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, [num]); - * }, num * 10); - * }; - * async.concatSeries(array, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [[1, 0], [3, 1], [2, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, [num]); - * }, num * 10); - * }; - * async.concatSeries(object, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [1, 3, 2] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 3, c: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, [num]); - * }, num * 10); - * }; - * async.concatSeries(object, iterator, function(err, res) { - * console.log(res); // [1, 3, 2] - * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] - * }); - * - */ - function concatSeries(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, keys, iter, item, iterate; - var sync = false; - var result = []; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, result); - } - iterate(); - - function arrayIterator() { - iterator(collection[completed], done); - } - - function arrayIteratorWithIndex() { - iterator(collection[completed], completed, done); - } - - function symbolIterator() { - item = iter.next(); - item.done ? callback(null, result) : iterator(item.value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - item.done ? callback(null, result) : iterator(item.value, completed, done); - } - - function objectIterator() { - iterator(collection[keys[completed]], done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - iterator(collection[key], key, done); - } - - function done(err, array) { - if (isArray(array)) { - nativePush.apply(result, array); - } else if (arguments.length >= 2) { - nativePush.apply(result, slice(arguments, 1)); - } - if (err) { - callback(err, result); - } else if (++completed === size) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace concatLimit - * @param {Array|Object} collection - * @param {number} limit - limit >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, [num]); - * }, num * 10); - * }; - * async.concatLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 3, 5, 2, 4] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1, 5, 3, 4, 2]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, [num]); - * }, num * 10); - * }; - * async.cocnatLimit(array, 2, iterator, function(err, res) { - * console.log(res); // [1, 3, 5, 2, 4] - * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, [num]); - * }, num * 10); - * }; - * async.concatLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 3, 5, 2, 4] - * console.log(order); // [1, 3, 5, 2, 4] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, num); - * }, num * 10); - * }; - * async.cocnatLimit(object, 2, iterator, function(err, res) { - * console.log(res); // [1, 3, 5, 2, 4] - * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] - * }); - * - */ - function concatLimit(collection, limit, iterator, callback) { - callback = callback || noop; - var size, key, iter, item, iterate, result; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - result = []; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - var keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, []); - } - result = result || Array(size); - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - if (started < size) { - iterator(collection[started], createCallback(started++)); - } - } - - function arrayIteratorWithIndex() { - if (started < size) { - iterator(collection[started], started, createCallback(started++)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, createCallback(started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, makeConcatResult(result)); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - iterator(item.value, started, createCallback(started++)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, makeConcatResult(result)); - } - } - - function objectIterator() { - if (started < size) { - iterator(collection[keys[started]], createCallback(started++)); - } - } - - function objectIteratorWithKey() { - if (started < size) { - key = keys[started]; - iterator(collection[key], key, createCallback(started++)); - } - } - - function createCallback(index) { - return function(err, res) { - if (index === null) { - throwError(); - } - if (err) { - index = null; - iterate = noop; - callback = once(callback); - arrayEachSync(result, function(array, index) { - if (array === undefined) { - result[index] = noop; - } - }); - callback(err, makeConcatResult(result)); - return; - } - switch (arguments.length) { - case 0: - case 1: - result[index] = noop; - break; - case 2: - result[index] = res; - break; - default: - result[index] = slice(arguments, 1); - break; - } - index = null; - if (++completed === size) { - iterate = throwError; - callback(null, makeConcatResult(result)); - callback = throwError; - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - * @param {Function} symbolEach - */ - function createGroupBy(arrayEach, baseEach, symbolEach) { - return function groupBy(collection, iterator, callback) { - callback = callback || noop; - var size; - var completed = 0; - var result = {}; - - if (isArray(collection)) { - size = collection.length; - arrayEach(collection, iterator, createCallback); - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = symbolEach(collection, iterator, createCallback); - size && size === completed && callback(null, result); - } else if (typeof collection === obj) { - var keys = nativeKeys(collection); - size = keys.length; - baseEach(collection, iterator, createCallback, keys); - } - if (!size) { - callback(null, {}); - } - - function createCallback(value) { - var called = false; - return function done(err, key) { - if (called) { - throwError(); - } - called = true; - if (err) { - callback = once(callback); - callback(err, objectClone(result)); - return; - } - var array = result[key]; - if (!array) { - result[key] = [value]; - } else { - array.push(value); - } - if (++completed === size) { - callback(null, result); - } - }; - } - }; - } - - /** - * @memberof async - * @namespace groupBySeries - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [4.2, 6.4, 6.1]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBySeries(array, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } - * console.log(order); // [4.2, 6.4, 6.1] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [4.2, 6.4, 6.1]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBySeries(array, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } - * console.log(order); // [[4.2, 0], [6.4, 1], [6.1, 2]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 4.2, b: 6.4, c: 6.1 }; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBySeries(object, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } - * console.log(order); // [4.2, 6.4, 6.1] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 4.2, b: 6.4, c: 6.1 }; - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupBySeries(object, iterator, function(err, res) { - * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } - * console.log(order); // [[4.2, 'a'], [6.4, 'b'], [6.1, 'c']] - * }); - * - */ - function groupBySeries(collection, iterator, callback) { - callback = onlyOnce(callback || noop); - var size, key, value, keys, iter, item, iterate; - var sync = false; - var completed = 0; - var result = {}; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size) { - return callback(null, result); - } - iterate(); - - function arrayIterator() { - value = collection[completed]; - iterator(value, done); - } - - function arrayIteratorWithIndex() { - value = collection[completed]; - iterator(value, completed, done); - } - - function symbolIterator() { - item = iter.next(); - value = item.value; - item.done ? callback(null, result) : iterator(value, done); - } - - function symbolIteratorWithKey() { - item = iter.next(); - value = item.value; - item.done ? callback(null, result) : iterator(value, completed, done); - } - - function objectIterator() { - value = collection[keys[completed]]; - iterator(value, done); - } - - function objectIteratorWithKey() { - key = keys[completed]; - value = collection[key]; - iterator(value, key, done); - } - - function done(err, key) { - if (err) { - iterate = throwError; - callback = onlyOnce(callback); - callback(err, objectClone(result)); - return; - } - var array = result[key]; - if (!array) { - result[key] = [value]; - } else { - array.push(value); - } - if (++completed === size) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace groupByLimit - * @param {Array|Object} collection - * @param {Function} iterator - * @param {Function} callback - * @example - * - * // array - * var order = []; - * var array = [1.1, 5.9, 3.2, 3.9, 2.1]; - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupByLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } - * console.log(order); // [1.1, 3.2, 5.9, 2.1, 3.9] - * }); - * - * @example - * - * // array with index - * var order = []; - * var array = [1.1, 5.9, 3.2, 3.9, 2.1]; - * var iterator = function(num, index, done) { - * setTimeout(function() { - * order.push([num, index]); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupByLimit(array, 2, iterator, function(err, res) { - * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } - * console.log(order); // [[1.1, 0], [3.2, 2], [5.9, 1], [2.1, 4], [3.9, 3]] - * }); - * - * @example - * - * // object - * var order = []; - * var object = { a: 1.1, b: 5.9, c: 3.2, d: 3.9, e: 2.1 } - * var iterator = function(num, done) { - * setTimeout(function() { - * order.push(num); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupByLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } - * console.log(order); // [1.1, 3.2, 5.9, 2.1, 3.9] - * }); - * - * @example - * - * // object with key - * var order = []; - * var object = { a: 1.1, b: 5.9, c: 3.2, d: 3.9, e: 2.1 } - * var iterator = function(num, key, done) { - * setTimeout(function() { - * order.push([num, key]); - * done(null, Math.floor(num)); - * }, num * 10); - * }; - * async.groupByLimit(object, 2, iterator, function(err, res) { - * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } - * console.log(order); // [[1.1, 'a'], [3.2, 'c'], [5.9, 'b'], [2.1, 'e'], [3.9, 'd']] - * }); - * - */ - function groupByLimit(collection, limit, iterator, callback) { - callback = callback || noop; - var size, index, key, value, keys, iter, item, iterate; - var sync = false; - var started = 0; - var completed = 0; - var result = {}; - - if (isArray(collection)) { - size = collection.length; - iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; - } else if (!collection) { - } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = Infinity; - iter = collection[iteratorSymbol](); - iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; - } else if (typeof collection === obj) { - keys = nativeKeys(collection); - size = keys.length; - iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, result); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - if (started < size) { - value = collection[started++]; - iterator(value, createCallback(value)); - } - } - - function arrayIteratorWithIndex() { - index = started++; - if (index < size) { - value = collection[index]; - iterator(value, index, createCallback(value)); - } - } - - function symbolIterator() { - item = iter.next(); - if (item.done === false) { - started++; - value = item.value; - iterator(value, createCallback(value)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function symbolIteratorWithKey() { - item = iter.next(); - if (item.done === false) { - value = item.value; - iterator(value, started++, createCallback(value)); - } else if (completed === started && iterator !== noop) { - iterator = noop; - callback(null, result); - } - } - - function objectIterator() { - if (started < size) { - value = collection[keys[started++]]; - iterator(value, createCallback(value)); - } - } - - function objectIteratorWithKey() { - if (started < size) { - key = keys[started++]; - value = collection[key]; - iterator(value, key, createCallback(value)); - } - } - - function createCallback(value) { - var called = false; - return function(err, key) { - if (called) { - throwError(); - } - called = true; - if (err) { - iterate = noop; - callback = once(callback); - callback(err, objectClone(result)); - return; - } - var array = result[key]; - if (!array) { - result[key] = [value]; - } else { - array.push(value); - } - if (++completed === size) { - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @private - * @param {Function} arrayEach - * @param {Function} baseEach - */ - function createParallel(arrayEach, baseEach) { - return function parallel(tasks, callback) { - callback = callback || noop; - var size, keys, result; - var completed = 0; - - if (isArray(tasks)) { - size = tasks.length; - result = Array(size); - arrayEach(tasks, createCallback); - } else if (tasks && typeof tasks === obj) { - keys = nativeKeys(tasks); - size = keys.length; - result = {}; - baseEach(tasks, createCallback, keys); - } - if (!size) { - callback(null, result); - } - - function createCallback(key) { - return function(err, res) { - if (key === null) { - throwError(); - } - if (err) { - key = null; - callback = once(callback); - callback(err, result); - return; - } - result[key] = arguments.length <= 2 ? res : slice(arguments, 1); - key = null; - if (++completed === size) { - callback(null, result); - } - }; - } - }; - } - - /** - * @memberof async - * @namespace series - * @param {Array|Object} tasks - functions - * @param {Function} callback - * @example - * - * var order = []; - * var tasks = [ - * function(done) { - * setTimeout(function() { - * order.push(1); - * done(null, 1); - * }, 10); - * }, - * function(done) { - * setTimeout(function() { - * order.push(2); - * done(null, 2); - * }, 30); - * }, - * function(done) { - * setTimeout(function() { - * order.push(3); - * done(null, 3); - * }, 40); - * }, - * function(done) { - * setTimeout(function() { - * order.push(4); - * done(null, 4); - * }, 20); - * } - * ]; - * async.series(tasks, function(err, res) { - * console.log(res); // [1, 2, 3, 4]; - * console.log(order); // [1, 2, 3, 4] - * }); - * - * @example - * - * var order = []; - * var tasks = { - * 'a': function(done) { - * setTimeout(function() { - * order.push(1); - * done(null, 1); - * }, 10); - * }, - * 'b': function(done) { - * setTimeout(function() { - * order.push(2); - * done(null, 2); - * }, 30); - * }, - * 'c': function(done) { - * setTimeout(function() { - * order.push(3); - * done(null, 3); - * }, 40); - * }, - * 'd': function(done) { - * setTimeout(function() { - * order.push(4); - * done(null, 4); - * }, 20); - * } - * }; - * async.series(tasks, function(err, res) { - * console.log(res); // { a: 1, b: 2, c: 3, d:4 } - * console.log(order); // [1, 4, 2, 3] - * }); - * - */ - function series(tasks, callback) { - callback = callback || noop; - var size, key, keys, result, iterate; - var sync = false; - var completed = 0; - - if (isArray(tasks)) { - size = tasks.length; - result = Array(size); - iterate = arrayIterator; - } else if (tasks && typeof tasks === obj) { - keys = nativeKeys(tasks); - size = keys.length; - result = {}; - iterate = objectIterator; - } else { - return callback(null); - } - if (!size) { - return callback(null, result); - } - iterate(); - - function arrayIterator() { - key = completed; - tasks[completed](done); - } - - function objectIterator() { - key = keys[completed]; - tasks[key](done); - } - - function done(err, res) { - if (err) { - iterate = throwError; - callback = onlyOnce(callback); - callback(err, result); - return; - } - result[key] = arguments.length <= 2 ? res : slice(arguments, 1); - if (++completed === size) { - iterate = throwError; - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace parallelLimit - * @param {Array|Object} tasks - functions - * @param {number} limit - limit >= 1 - * @param {Function} callback - * @example - * - * var order = []; - * var tasks = [ - * function(done) { - * setTimeout(function() { - * order.push(1); - * done(null, 1); - * }, 10); - * }, - * function(done) { - * setTimeout(function() { - * order.push(2); - * done(null, 2); - * }, 50); - * }, - * function(done) { - * setTimeout(function() { - * order.push(3); - * done(null, 3); - * }, 30); - * }, - * function(done) { - * setTimeout(function() { - * order.push(4); - * done(null, 4); - * }, 40); - * } - * ]; - * async.parallelLimit(tasks, 2, function(err, res) { - * console.log(res); // [1, 2, 3, 4]; - * console.log(order); // [1, 3, 2, 4] - * }); - * - * @example - * - * var order = []; - * var tasks = { - * 'a': function(done) { - * setTimeout(function() { - * order.push(1); - * done(null, 1); - * }, 10); - * }, - * 'b': function(done) { - * setTimeout(function() { - * order.push(2); - * done(null, 2); - * }, 50); - * }, - * 'c': function(done) { - * setTimeout(function() { - * order.push(3); - * done(null, 3); - * }, 20); - * }, - * 'd': function(done) { - * setTimeout(function() { - * order.push(4); - * done(null, 4); - * }, 40); - * } - * }; - * async.parallelLimit(tasks, 2, function(err, res) { - * console.log(res); // { a: 1, b: 2, c: 3, d:4 } - * console.log(order); // [1, 3, 2, 4] - * }); - * - */ - function parallelLimit(tasks, limit, callback) { - callback = callback || noop; - var size, index, key, keys, result, iterate; - var sync = false; - var started = 0; - var completed = 0; - - if (isArray(tasks)) { - size = tasks.length; - result = Array(size); - iterate = arrayIterator; - } else if (tasks && typeof tasks === obj) { - keys = nativeKeys(tasks); - size = keys.length; - result = {}; - iterate = objectIterator; - } - if (!size || isNaN(limit) || limit < 1) { - return callback(null, result); - } - timesSync(limit > size ? size : limit, iterate); - - function arrayIterator() { - index = started++; - if (index < size) { - tasks[index](createCallback(index)); - } - } - - function objectIterator() { - if (started < size) { - key = keys[started++]; - tasks[key](createCallback(key)); - } - } - - function createCallback(key) { - return function(err, res) { - if (key === null) { - throwError(); - } - if (err) { - key = null; - iterate = noop; - callback = once(callback); - callback(err, result); - return; - } - result[key] = arguments.length <= 2 ? res : slice(arguments, 1); - key = null; - if (++completed === size) { - callback(null, result); - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @memberof async - * @namespace tryEach - * @param {Array|Object} tasks - functions - * @param {Function} callback - * @example - * - * var tasks = [ - * function(done) { - * setTimeout(function() { - * done(new Error('error')); - * }, 10); - * }, - * function(done) { - * setTimeout(function() { - * done(null, 2); - * }, 10); - * } - * ]; - * async.tryEach(tasks, function(err, res) { - * console.log(res); // 2 - * }); - * - * @example - * - * var tasks = [ - * function(done) { - * setTimeout(function() { - * done(new Error('error1')); - * }, 10); - * }, - * function(done) { - * setTimeout(function() { - * done(new Error('error2'); - * }, 10); - * } - * ]; - * async.tryEach(tasks, function(err, res) { - * console.log(err); // error2 - * console.log(res); // undefined - * }); - * - */ - function tryEach(tasks, callback) { - callback = callback || noop; - var size, keys, iterate; - var sync = false; - var completed = 0; - - if (isArray(tasks)) { - size = tasks.length; - iterate = arrayIterator; - } else if (tasks && typeof tasks === obj) { - keys = nativeKeys(tasks); - size = keys.length; - iterate = objectIterator; - } - if (!size) { - return callback(null); - } - iterate(); - - function arrayIterator() { - tasks[completed](done); - } - - function objectIterator() { - tasks[keys[completed]](done); - } - - function done(err, res) { - if (!err) { - if (arguments.length <= 2) { - callback(null, res); - } else { - callback(null, slice(arguments, 1)); - } - } else if (++completed === size) { - callback(err); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * check for waterfall tasks - * @private - * @param {Array} tasks - * @param {Function} callback - * @return {boolean} - */ - function checkWaterfallTasks(tasks, callback) { - if (!isArray(tasks)) { - callback(new Error('First argument to waterfall must be an array of functions')); - return false; - } - if (tasks.length === 0) { - callback(null); - return false; - } - return true; - } - - /** - * check for waterfall tasks - * @private - * @param {function} func - * @param {Array|Object} args - arguments - * @return {function} next - */ - function waterfallIterator(func, args, next) { - switch (args.length) { - case 0: - case 1: - return func(next); - case 2: - return func(args[1], next); - case 3: - return func(args[1], args[2], next); - case 4: - return func(args[1], args[2], args[3], next); - case 5: - return func(args[1], args[2], args[3], args[4], next); - case 6: - return func(args[1], args[2], args[3], args[4], args[5], next); - default: - args = slice(args, 1); - args.push(next); - return func.apply(null, args); - } - } - - /** - * @memberof async - * @namespace waterfall - * @param {Array} tasks - functions - * @param {Function} callback - * @example - * - * var order = []; - * var tasks = [ - * function(next) { - * setTimeout(function() { - * order.push(1); - * next(null, 1); - * }, 10); - * }, - * function(arg1, next) { - * setTimeout(function() { - * order.push(2); - * next(null, 1, 2); - * }, 30); - * }, - * function(arg1, arg2, next) { - * setTimeout(function() { - * order.push(3); - * next(null, 3); - * }, 20); - * }, - * function(arg1, next) { - * setTimeout(function() { - * order.push(4); - * next(null, 1, 2, 3, 4); - * }, 40); - * } - * ]; - * async.waterfall(tasks, function(err, arg1, arg2, arg3, arg4) { - * console.log(arg1, arg2, arg3, arg4); // 1 2 3 4 - * }); - * - */ - function waterfall(tasks, callback) { - callback = callback || noop; - if (!checkWaterfallTasks(tasks, callback)) { - return; - } - var func, args, done, sync; - var completed = 0; - var size = tasks.length; - waterfallIterator(tasks[0], [], createCallback(0)); - - function iterate() { - waterfallIterator(func, args, createCallback(func)); - } - - function createCallback(index) { - return function next(err, res) { - if (index === undefined) { - callback = noop; - throwError(); - } - index = undefined; - if (err) { - done = callback; - callback = throwError; - done(err); - return; - } - if (++completed === size) { - done = callback; - callback = throwError; - if (arguments.length <= 2) { - done(err, res); - } else { - done.apply(null, createArray(arguments)); - } - return; - } - if (sync) { - args = arguments; - func = tasks[completed] || throwError; - nextTick(iterate); - } else { - sync = true; - waterfallIterator(tasks[completed] || throwError, arguments, createCallback(completed)); - } - sync = false; - }; - } - } - - /** - * `angelFall` is like `waterfall` and inject callback to last argument of next task. - * - * @memberof async - * @namespace angelFall - * @param {Array} tasks - functions - * @param {Function} callback - * @example - * - * var order = []; - * var tasks = [ - * function(next) { - * setTimeout(function() { - * order.push(1); - * next(null, 1); - * }, 10); - * }, - * function(arg1, empty, next) { - * setTimeout(function() { - * order.push(2); - * next(null, 1, 2); - * }, 30); - * }, - * function(next) { - * setTimeout(function() { - * order.push(3); - * next(null, 3); - * }, 20); - * }, - * function(arg1, empty1, empty2, empty3, next) { - * setTimeout(function() { - * order.push(4); - * next(null, 1, 2, 3, 4); - * }, 40); - * } - * ]; - * async.angelFall(tasks, function(err, arg1, arg2, arg3, arg4) { - * console.log(arg1, arg2, arg3, arg4); // 1 2 3 4 - * }); - * - */ - function angelFall(tasks, callback) { - callback = callback || noop; - if (!checkWaterfallTasks(tasks, callback)) { - return; - } - var completed = 0; - var sync = false; - var size = tasks.length; - var func = tasks[completed]; - var args = []; - var iterate = function() { - switch (func.length) { - case 0: - try { - next(null, func()); - } catch (e) { - next(e); - } - return; - case 1: - return func(next); - case 2: - return func(args[1], next); - case 3: - return func(args[1], args[2], next); - case 4: - return func(args[1], args[2], args[3], next); - case 5: - return func(args[1], args[2], args[3], args[4], next); - default: - args = slice(args, 1); - args[func.length - 1] = next; - return func.apply(null, args); - } - }; - iterate(); - - function next(err, res) { - if (err) { - iterate = throwError; - callback = onlyOnce(callback); - callback(err); - return; - } - if (++completed === size) { - iterate = throwError; - var done = callback; - callback = throwError; - if (arguments.length === 2) { - done(err, res); - } else { - done.apply(null, createArray(arguments)); - } - return; - } - func = tasks[completed]; - args = arguments; - if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace whilst - * @param {Function} test - * @param {Function} iterator - * @param {Function} callback - */ - function whilst(test, iterator, callback) { - callback = callback || noop; - var sync = false; - if (test()) { - iterate(); - } else { - callback(null); - } - - function iterate() { - if (sync) { - nextTick(next); - } else { - sync = true; - iterator(done); - } - sync = false; - } - - function next() { - iterator(done); - } - - function done(err, arg) { - if (err) { - return callback(err); - } - if (arguments.length <= 2) { - if (test(arg)) { - iterate(); - } else { - callback(null, arg); - } - return; - } - arg = slice(arguments, 1); - if (test.apply(null, arg)) { - iterate(); - } else { - callback.apply(null, [null].concat(arg)); - } - } - } - - /** - * @memberof async - * @namespace doWhilst - * @param {Function} iterator - * @param {Function} test - * @param {Function} callback - */ - function doWhilst(iterator, test, callback) { - callback = callback || noop; - var sync = false; - next(); - - function iterate() { - if (sync) { - nextTick(next); - } else { - sync = true; - iterator(done); - } - sync = false; - } - - function next() { - iterator(done); - } - - function done(err, arg) { - if (err) { - return callback(err); - } - if (arguments.length <= 2) { - if (test(arg)) { - iterate(); - } else { - callback(null, arg); - } - return; - } - arg = slice(arguments, 1); - if (test.apply(null, arg)) { - iterate(); - } else { - callback.apply(null, [null].concat(arg)); - } - } - } - - /** - * @memberof async - * @namespace until - * @param {Function} test - * @param {Function} iterator - * @param {Function} callback - */ - function until(test, iterator, callback) { - callback = callback || noop; - var sync = false; - if (!test()) { - iterate(); - } else { - callback(null); - } - - function iterate() { - if (sync) { - nextTick(next); - } else { - sync = true; - iterator(done); - } - sync = false; - } - - function next() { - iterator(done); - } - - function done(err, arg) { - if (err) { - return callback(err); - } - if (arguments.length <= 2) { - if (!test(arg)) { - iterate(); - } else { - callback(null, arg); - } - return; - } - arg = slice(arguments, 1); - if (!test.apply(null, arg)) { - iterate(); - } else { - callback.apply(null, [null].concat(arg)); - } - } - } - - /** - * @memberof async - * @namespace doUntil - * @param {Function} iterator - * @param {Function} test - * @param {Function} callback - */ - function doUntil(iterator, test, callback) { - callback = callback || noop; - var sync = false; - next(); - - function iterate() { - if (sync) { - nextTick(next); - } else { - sync = true; - iterator(done); - } - sync = false; - } - - function next() { - iterator(done); - } - - function done(err, arg) { - if (err) { - return callback(err); - } - if (arguments.length <= 2) { - if (!test(arg)) { - iterate(); - } else { - callback(null, arg); - } - return; - } - arg = slice(arguments, 1); - if (!test.apply(null, arg)) { - iterate(); - } else { - callback.apply(null, [null].concat(arg)); - } - } - } - - /** - * @memberof async - * @namespace during - * @param {Function} test - * @param {Function} iterator - * @param {Function} callback - */ - function during(test, iterator, callback) { - callback = callback || noop; - _test(); - - function _test() { - test(iterate); - } - - function iterate(err, truth) { - if (err) { - return callback(err); - } - if (truth) { - iterator(done); - } else { - callback(null); - } - } - - function done(err) { - if (err) { - return callback(err); - } - _test(); - } - } - - /** - * @memberof async - * @namespace doDuring - * @param {Function} test - * @param {Function} iterator - * @param {Function} callback - */ - function doDuring(iterator, test, callback) { - callback = callback || noop; - iterate(null, true); - - function iterate(err, truth) { - if (err) { - return callback(err); - } - if (truth) { - iterator(done); - } else { - callback(null); - } - } - - function done(err, res) { - if (err) { - return callback(err); - } - switch (arguments.length) { - case 0: - case 1: - test(iterate); - break; - case 2: - test(res, iterate); - break; - default: - var args = slice(arguments, 1); - args.push(iterate); - test.apply(null, args); - break; - } - } - } - - /** - * @memberof async - * @namespace forever - */ - function forever(iterator, callback) { - var sync = false; - iterate(); - - function iterate() { - iterator(next); - } - - function next(err) { - if (err) { - if (callback) { - return callback(err); - } - throw err; - } - if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace compose - */ - function compose() { - return seq.apply(null, reverse(arguments)); - } - - /** - * @memberof async - * @namespace seq - */ - function seq(/* functions... */) { - var fns = createArray(arguments); - - return function() { - var self = this; - var args = createArray(arguments); - var callback = args[args.length - 1]; - if (typeof callback === func) { - args.pop(); - } else { - callback = noop; - } - reduce(fns, args, iterator, done); - - function iterator(newargs, fn, callback) { - var func = function(err) { - var nextargs = slice(arguments, 1); - callback(err, nextargs); - }; - newargs.push(func); - fn.apply(self, newargs); - } - - function done(err, res) { - res = isArray(res) ? res : [res]; - res.unshift(err); - callback.apply(self, res); - } - }; - } - - function createApplyEach(func) { - return function applyEach(fns /* arguments */) { - var go = function() { - var self = this; - var args = createArray(arguments); - var callback = args.pop() || noop; - return func(fns, iterator, callback); - - function iterator(fn, done) { - fn.apply(self, args.concat([done])); - } - }; - if (arguments.length > 1) { - var args = slice(arguments, 1); - return go.apply(this, args); - } else { - return go; - } - }; - } - - /** - * @see https://github.com/caolan/async/blob/master/lib/internal/DoublyLinkedList.js - */ - function DLL() { - this.head = null; - this.tail = null; - this.length = 0; - } - - DLL.prototype._removeLink = function(node) { - var prev = node.prev; - var next = node.next; - if (prev) { - prev.next = next; - } else { - this.head = next; - } - if (next) { - next.prev = prev; - } else { - this.tail = prev; - } - node.prev = null; - node.next = null; - this.length--; - return node; - }; - - DLL.prototype.empty = DLL; - - DLL.prototype._setInitial = function(node) { - this.length = 1; - this.head = this.tail = node; - }; - - DLL.prototype.insertBefore = function(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) { - node.prev.next = newNode; - } else { - this.head = newNode; - } - node.prev = newNode; - this.length++; - }; - - DLL.prototype.unshift = function(node) { - if (this.head) { - this.insertBefore(this.head, node); - } else { - this._setInitial(node); - } - }; - - DLL.prototype.push = function(node) { - var tail = this.tail; - if (tail) { - node.prev = tail; - node.next = tail.next; - this.tail = node; - tail.next = node; - this.length++; - } else { - this._setInitial(node); - } - }; - - DLL.prototype.shift = function() { - return this.head && this._removeLink(this.head); - }; - - DLL.prototype.splice = function(end) { - var task; - var tasks = []; - while (end-- && (task = this.shift())) { - tasks.push(task); - } - return tasks; - }; - - DLL.prototype.remove = function(test) { - var node = this.head; - while (node) { - if (test(node)) { - this._removeLink(node); - } - node = node.next; - } - return this; - }; - - /** - * @private - */ - function baseQueue(isQueue, worker, concurrency, payload) { - if (concurrency === undefined) { - concurrency = 1; - } else if (isNaN(concurrency) || concurrency < 1) { - throw new Error('Concurrency must not be zero'); - } - - var workers = 0; - var workersList = []; - var _callback, _unshift; - - var q = { - _tasks: new DLL(), - concurrency: concurrency, - payload: payload, - saturated: noop, - unsaturated: noop, - buffer: concurrency / 4, - empty: noop, - drain: noop, - error: noop, - started: false, - paused: false, - push: push, - kill: kill, - unshift: unshift, - remove: remove, - process: isQueue ? runQueue : runCargo, - length: getLength, - running: running, - workersList: getWorkersList, - idle: idle, - pause: pause, - resume: resume, - _worker: worker - }; - return q; - - function push(tasks, callback) { - _insert(tasks, callback); - } - - function unshift(tasks, callback) { - _insert(tasks, callback, true); - } - - function _exec(task) { - var item = { - data: task, - callback: _callback - }; - if (_unshift) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - nextTick(q.process); - } - - function _insert(tasks, callback, unshift) { - if (callback == null) { - callback = noop; - } else if (typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - var _tasks = isArray(tasks) ? tasks : [tasks]; - - if (tasks === undefined || !_tasks.length) { - if (q.idle()) { - nextTick(q.drain); - } - return; - } - - _unshift = unshift; - _callback = callback; - arrayEachSync(_tasks, _exec); - // Avoid leaking the callback - _callback = undefined; - } - - function kill() { - q.drain = noop; - q._tasks.empty(); - } - - function _next(q, tasks) { - var called = false; - return function done(err, res) { - if (called) { - throwError(); - } - called = true; - - workers--; - var task; - var index = -1; - var size = workersList.length; - var taskIndex = -1; - var taskSize = tasks.length; - var useApply = arguments.length > 2; - var args = useApply && createArray(arguments); - while (++taskIndex < taskSize) { - task = tasks[taskIndex]; - while (++index < size) { - if (workersList[index] === task) { - if (index === 0) { - workersList.shift(); - } else { - workersList.splice(index, 1); - } - index = size; - size--; - } - } - index = -1; - if (useApply) { - task.callback.apply(task, args); - } else { - task.callback(err, res); - } - if (err) { - q.error(err, task.data); - } - } - - if (workers <= q.concurrency - q.buffer) { - q.unsaturated(); - } - - if (q._tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - } - - function runQueue() { - while (!q.paused && workers < q.concurrency && q._tasks.length) { - var task = q._tasks.shift(); - workers++; - workersList.push(task); - if (q._tasks.length === 0) { - q.empty(); - } - if (workers === q.concurrency) { - q.saturated(); - } - var done = _next(q, [task]); - worker(task.data, done); - } - } - - function runCargo() { - while (!q.paused && workers < q.concurrency && q._tasks.length) { - var tasks = q._tasks.splice(q.payload || q._tasks.length); - var index = -1; - var size = tasks.length; - var data = Array(size); - while (++index < size) { - data[index] = tasks[index].data; - } - workers++; - nativePush.apply(workersList, tasks); - if (q._tasks.length === 0) { - q.empty(); - } - if (workers === q.concurrency) { - q.saturated(); - } - var done = _next(q, tasks); - worker(data, done); - } - } - - function getLength() { - return q._tasks.length; - } - - function running() { - return workers; - } - - function getWorkersList() { - return workersList; - } - - function idle() { - return q.length() + workers === 0; - } - - function pause() { - q.paused = true; - } - - function _resume() { - nextTick(q.process); - } - - function resume() { - if (q.paused === false) { - return; - } - q.paused = false; - var count = q.concurrency < q._tasks.length ? q.concurrency : q._tasks.length; - timesSync(count, _resume); - } - - /** - * @param {Function} test - */ - function remove(test) { - q._tasks.remove(test); - } - } - - /** - * @memberof async - * @namespace queue - */ - function queue(worker, concurrency) { - return baseQueue(true, worker, concurrency); - } - - /** - * @memberof async - * @namespace priorityQueue - */ - function priorityQueue(worker, concurrency) { - var q = baseQueue(true, worker, concurrency); - q.push = push; - delete q.unshift; - return q; - - function push(tasks, priority, callback) { - q.started = true; - priority = priority || 0; - var _tasks = isArray(tasks) ? tasks : [tasks]; - var taskSize = _tasks.length; - - if (tasks === undefined || taskSize === 0) { - if (q.idle()) { - nextTick(q.drain); - } - return; - } - - callback = typeof callback === func ? callback : noop; - var nextNode = q._tasks.head; - while (nextNode && priority >= nextNode.priority) { - nextNode = nextNode.next; - } - while (taskSize--) { - var item = { - data: _tasks[taskSize], - priority: priority, - callback: callback - }; - if (nextNode) { - q._tasks.insertBefore(nextNode, item); - } else { - q._tasks.push(item); - } - nextTick(q.process); - } - } - } - - /** - * @memberof async - * @namespace cargo - */ - function cargo(worker, payload) { - return baseQueue(false, worker, 1, payload); - } - - /** - * @memberof async - * @namespace auto - * @param {Object} tasks - * @param {number} [concurrency] - * @param {Function} [callback] - */ - function auto(tasks, concurrency, callback) { - if (typeof concurrency === func) { - callback = concurrency; - concurrency = null; - } - var keys = nativeKeys(tasks); - var rest = keys.length; - var results = {}; - if (rest === 0) { - return callback(null, results); - } - var runningTasks = 0; - var readyTasks = new DLL(); - var listeners = Object.create(null); - callback = onlyOnce(callback || noop); - concurrency = concurrency || rest; - - baseEachSync(tasks, iterator, keys); - proceedQueue(); - - function iterator(task, key) { - // no dependencies - var _task, _taskSize; - if (!isArray(task)) { - _task = task; - _taskSize = 0; - readyTasks.push([_task, _taskSize, done]); - return; - } - var dependencySize = task.length - 1; - _task = task[dependencySize]; - _taskSize = dependencySize; - if (dependencySize === 0) { - readyTasks.push([_task, _taskSize, done]); - return; - } - // dependencies - var index = -1; - while (++index < dependencySize) { - var dependencyName = task[index]; - if (notInclude(keys, dependencyName)) { - var msg = - 'async.auto task `' + - key + - '` has non-existent dependency `' + - dependencyName + - '` in ' + - task.join(', '); - throw new Error(msg); - } - var taskListeners = listeners[dependencyName]; - if (!taskListeners) { - taskListeners = listeners[dependencyName] = []; - } - taskListeners.push(taskListener); - } - - function done(err, arg) { - if (key === null) { - throwError(); - } - arg = arguments.length <= 2 ? arg : slice(arguments, 1); - if (err) { - rest = 0; - runningTasks = 0; - readyTasks.length = 0; - var safeResults = objectClone(results); - safeResults[key] = arg; - key = null; - var _callback = callback; - callback = noop; - _callback(err, safeResults); - return; - } - runningTasks--; - rest--; - results[key] = arg; - taskComplete(key); - key = null; - } - - function taskListener() { - if (--dependencySize === 0) { - readyTasks.push([_task, _taskSize, done]); - } - } - } - - function proceedQueue() { - if (readyTasks.length === 0 && runningTasks === 0) { - if (rest !== 0) { - throw new Error('async.auto task has cyclic dependencies'); - } - return callback(null, results); - } - while (readyTasks.length && runningTasks < concurrency && callback !== noop) { - runningTasks++; - var array = readyTasks.shift(); - if (array[1] === 0) { - array[0](array[2]); - } else { - array[0](results, array[2]); - } - } - } - - function taskComplete(key) { - var taskListeners = listeners[key] || []; - arrayEachSync(taskListeners, function(task) { - task(); - }); - proceedQueue(); - } - } - - var FN_ARGS = /^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /(=.+)?(\s*)$/; - var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; - - /** - * parse function arguments for `autoInject` - * - * @private - */ - function parseParams(func) { - func = func.toString().replace(STRIP_COMMENTS, ''); - func = func.match(FN_ARGS)[2].replace(' ', ''); - func = func ? func.split(FN_ARG_SPLIT) : []; - func = func.map(function(arg) { - return arg.replace(FN_ARG, '').trim(); - }); - return func; - } - - /** - * @memberof async - * @namespace autoInject - * @param {Object} tasks - * @param {number} [concurrency] - * @param {Function} [callback] - */ - function autoInject(tasks, concurrency, callback) { - var newTasks = {}; - baseEachSync(tasks, iterator, nativeKeys(tasks)); - auto(newTasks, concurrency, callback); - - function iterator(task, key) { - var params; - var taskLength = task.length; - - if (isArray(task)) { - if (taskLength === 0) { - throw new Error('autoInject task functions require explicit parameters.'); - } - params = createArray(task); - taskLength = params.length - 1; - task = params[taskLength]; - if (taskLength === 0) { - newTasks[key] = task; - return; - } - } else if (taskLength === 1) { - newTasks[key] = task; - return; - } else { - params = parseParams(task); - if (taskLength === 0 && params.length === 0) { - throw new Error('autoInject task functions require explicit parameters.'); - } - taskLength = params.length - 1; - } - params[taskLength] = newTask; - newTasks[key] = params; - - function newTask(results, done) { - switch (taskLength) { - case 1: - task(results[params[0]], done); - break; - case 2: - task(results[params[0]], results[params[1]], done); - break; - case 3: - task(results[params[0]], results[params[1]], results[params[2]], done); - break; - default: - var i = -1; - while (++i < taskLength) { - params[i] = results[params[i]]; - } - params[i] = done; - task.apply(null, params); - break; - } - } - } - } - - /** - * @memberof async - * @namespace retry - * @param {integer|Object|Function} opts - * @param {Function} [task] - * @param {Function} [callback] - */ - function retry(opts, task, callback) { - var times, intervalFunc, errorFilter; - var count = 0; - if (arguments.length < 3 && typeof opts === func) { - callback = task || noop; - task = opts; - opts = null; - times = DEFAULT_TIMES; - } else { - callback = callback || noop; - switch (typeof opts) { - case 'object': - if (typeof opts.errorFilter === func) { - errorFilter = opts.errorFilter; - } - var interval = opts.interval; - switch (typeof interval) { - case func: - intervalFunc = interval; - break; - case 'string': - case 'number': - interval = +interval; - intervalFunc = interval - ? function() { - return interval; - } - : function() { - return DEFAULT_INTERVAL; - }; - break; - } - times = +opts.times || DEFAULT_TIMES; - break; - case 'number': - times = opts || DEFAULT_TIMES; - break; - case 'string': - times = +opts || DEFAULT_TIMES; - break; - default: - throw new Error('Invalid arguments for async.retry'); - } - } - if (typeof task !== 'function') { - throw new Error('Invalid arguments for async.retry'); - } - - if (intervalFunc) { - task(intervalCallback); - } else { - task(simpleCallback); - } - - function simpleIterator() { - task(simpleCallback); - } - - function simpleCallback(err, res) { - if (++count === times || !err || (errorFilter && !errorFilter(err))) { - if (arguments.length <= 2) { - return callback(err, res); - } - var args = createArray(arguments); - return callback.apply(null, args); - } - simpleIterator(); - } - - function intervalIterator() { - task(intervalCallback); - } - - function intervalCallback(err, res) { - if (++count === times || !err || (errorFilter && !errorFilter(err))) { - if (arguments.length <= 2) { - return callback(err, res); - } - var args = createArray(arguments); - return callback.apply(null, args); - } - setTimeout(intervalIterator, intervalFunc(count)); - } - } - - function retryable(opts, task) { - if (!task) { - task = opts; - opts = null; - } - return done; - - function done() { - var taskFn; - var args = createArray(arguments); - var lastIndex = args.length - 1; - var callback = args[lastIndex]; - switch (task.length) { - case 1: - taskFn = task1; - break; - case 2: - taskFn = task2; - break; - case 3: - taskFn = task3; - break; - default: - taskFn = task4; - } - if (opts) { - retry(opts, taskFn, callback); - } else { - retry(taskFn, callback); - } - - function task1(done) { - task(done); - } - - function task2(done) { - task(args[0], done); - } - - function task3(done) { - task(args[0], args[1], done); - } - - function task4(callback) { - args[lastIndex] = callback; - task.apply(null, args); - } - } - } - - /** - * @memberof async - * @namespace iterator - */ - function iterator(tasks) { - var size = 0; - var keys = []; - if (isArray(tasks)) { - size = tasks.length; - } else { - keys = nativeKeys(tasks); - size = keys.length; - } - return makeCallback(0); - - function makeCallback(index) { - var fn = function() { - if (size) { - var key = keys[index] || index; - tasks[key].apply(null, createArray(arguments)); - } - return fn.next(); - }; - fn.next = function() { - return index < size - 1 ? makeCallback(index + 1) : null; - }; - return fn; - } - } - - /** - * @memberof async - * @namespace apply - */ - function apply(func) { - switch (arguments.length) { - case 0: - case 1: - return func; - case 2: - return func.bind(null, arguments[1]); - case 3: - return func.bind(null, arguments[1], arguments[2]); - case 4: - return func.bind(null, arguments[1], arguments[2], arguments[3]); - case 5: - return func.bind(null, arguments[1], arguments[2], arguments[3], arguments[4]); - default: - var size = arguments.length; - var index = 0; - var args = Array(size); - args[index] = null; - while (++index < size) { - args[index] = arguments[index]; - } - return func.bind.apply(func, args); - } - } - - /** - * @memberof async - * @namespace timeout - * @param {Function} func - * @param {number} millisec - * @param {*} info - */ - function timeout(func, millisec, info) { - var callback, timer; - return wrappedFunc; - - function wrappedFunc() { - timer = setTimeout(timeoutCallback, millisec); - var args = createArray(arguments); - var lastIndex = args.length - 1; - callback = args[lastIndex]; - args[lastIndex] = injectedCallback; - simpleApply(func, args); - } - - function timeoutCallback() { - var name = func.name || 'anonymous'; - var err = new Error('Callback function "' + name + '" timed out.'); - err.code = 'ETIMEDOUT'; - if (info) { - err.info = info; - } - timer = null; - callback(err); - } - - function injectedCallback() { - if (timer !== null) { - simpleApply(callback, createArray(arguments)); - clearTimeout(timer); - } - } - - function simpleApply(func, args) { - switch (args.length) { - case 0: - func(); - break; - case 1: - func(args[0]); - break; - case 2: - func(args[0], args[1]); - break; - default: - func.apply(null, args); - break; - } - } - } - - /** - * @memberof async - * @namespace times - * @param {number} n - n >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * var iterator = function(n, done) { - * done(null, n); - * }; - * async.times(4, iterator, function(err, res) { - * console.log(res); // [0, 1, 2, 3]; - * }); - * - */ - function times(n, iterator, callback) { - callback = callback || noop; - n = +n; - if (isNaN(n) || n < 1) { - return callback(null, []); - } - var result = Array(n); - timesSync(n, iterate); - - function iterate(num) { - iterator(num, createCallback(num)); - } - - function createCallback(index) { - return function(err, res) { - if (index === null) { - throwError(); - } - result[index] = res; - index = null; - if (err) { - callback(err); - callback = noop; - } else if (--n === 0) { - callback(null, result); - } - }; - } - } - - /** - * @memberof async - * @namespace timesSeries - * @param {number} n - n >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * var iterator = function(n, done) { - * done(null, n); - * }; - * async.timesSeries(4, iterator, function(err, res) { - * console.log(res); // [0, 1, 2, 3]; - * }); - * - */ - function timesSeries(n, iterator, callback) { - callback = callback || noop; - n = +n; - if (isNaN(n) || n < 1) { - return callback(null, []); - } - var result = Array(n); - var sync = false; - var completed = 0; - iterate(); - - function iterate() { - iterator(completed, done); - } - - function done(err, res) { - result[completed] = res; - if (err) { - callback(err); - callback = throwError; - } else if (++completed >= n) { - callback(null, result); - callback = throwError; - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - } - } - - /** - * @memberof async - * @namespace timesLimit - * @param {number} n - n >= 1 - * @param {number} limit - n >= 1 - * @param {Function} iterator - * @param {Function} callback - * @example - * - * var iterator = function(n, done) { - * done(null, n); - * }; - * async.timesLimit(4, 2, iterator, function(err, res) { - * console.log(res); // [0, 1, 2, 3]; - * }); - * - */ - function timesLimit(n, limit, iterator, callback) { - callback = callback || noop; - n = +n; - if (isNaN(n) || n < 1 || isNaN(limit) || limit < 1) { - return callback(null, []); - } - var result = Array(n); - var sync = false; - var started = 0; - var completed = 0; - timesSync(limit > n ? n : limit, iterate); - - function iterate() { - var index = started++; - if (index < n) { - iterator(index, createCallback(index)); - } - } - - function createCallback(index) { - return function(err, res) { - if (index === null) { - throwError(); - } - result[index] = res; - index = null; - if (err) { - callback(err); - callback = noop; - } else if (++completed >= n) { - callback(null, result); - callback = throwError; - } else if (sync) { - nextTick(iterate); - } else { - sync = true; - iterate(); - } - sync = false; - }; - } - } - - /** - * @memberof async - * @namespace race - * @param {Array|Object} tasks - functions - * @param {Function} callback - * @example - * - * // array - * var called = 0; - * var tasks = [ - * function(done) { - * setTimeout(function() { - * called++; - * done(null, '1'); - * }, 30); - * }, - * function(done) { - * setTimeout(function() { - * called++; - * done(null, '2'); - * }, 20); - * }, - * function(done) { - * setTimeout(function() { - * called++; - * done(null, '3'); - * }, 10); - * } - * ]; - * async.race(tasks, function(err, res) { - * console.log(res); // '3' - * console.log(called); // 1 - * setTimeout(function() { - * console.log(called); // 3 - * }, 50); - * }); - * - * @example - * - * // object - * var called = 0; - * var tasks = { - * 'test1': function(done) { - * setTimeout(function() { - * called++; - * done(null, '1'); - * }, 30); - * }, - * 'test2': function(done) { - * setTimeout(function() { - * called++; - * done(null, '2'); - * }, 20); - * }, - * 'test3': function(done) { - * setTimeout(function() { - * called++; - * done(null, '3'); - * }, 10); - * } - * }; - * async.race(tasks, function(err, res) { - * console.log(res); // '3' - * console.log(called); // 1 - * setTimeout(function() { - * console.log(called); // 3 - * done(); - * }, 50); - * }); - * - */ - function race(tasks, callback) { - callback = once(callback || noop); - var size, keys; - var index = -1; - if (isArray(tasks)) { - size = tasks.length; - while (++index < size) { - tasks[index](callback); - } - } else if (tasks && typeof tasks === obj) { - keys = nativeKeys(tasks); - size = keys.length; - while (++index < size) { - tasks[keys[index]](callback); - } - } else { - return callback(new TypeError('First argument to race must be a collection of functions')); - } - if (!size) { - callback(null); - } - } - - /** - * @memberof async - * @namespace memoize - */ - function memoize(fn, hasher) { - hasher = - hasher || - function(hash) { - return hash; - }; - - var memo = {}; - var queues = {}; - var memoized = function() { - var args = createArray(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (has(memo, key)) { - nextTick(function() { - callback.apply(null, memo[key]); - }); - return; - } - if (has(queues, key)) { - return queues[key].push(callback); - } - - queues[key] = [callback]; - args.push(done); - fn.apply(null, args); - - function done(err) { - var args = createArray(arguments); - if (!err) { - memo[key] = args; - } - var q = queues[key]; - delete queues[key]; - - var i = -1; - var size = q.length; - while (++i < size) { - q[i].apply(null, args); - } - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - } - - /** - * @memberof async - * @namespace unmemoize - */ - function unmemoize(fn) { - return function() { - return (fn.unmemoized || fn).apply(null, arguments); - }; - } - - /** - * @memberof async - * @namespace ensureAsync - */ - function ensureAsync(fn) { - return function(/* ...args, callback */) { - var args = createArray(arguments); - var lastIndex = args.length - 1; - var callback = args[lastIndex]; - var sync = true; - args[lastIndex] = done; - fn.apply(this, args); - sync = false; - - function done() { - var innerArgs = createArray(arguments); - if (sync) { - nextTick(function() { - callback.apply(null, innerArgs); - }); - } else { - callback.apply(null, innerArgs); - } - } - }; - } - - /** - * @memberof async - * @namespace constant - */ - function constant(/* values... */) { - var args = [null].concat(createArray(arguments)); - return function(callback) { - callback = arguments[arguments.length - 1]; - callback.apply(this, args); - }; - } - - function asyncify(fn) { - return function(/* args..., callback */) { - var args = createArray(arguments); - var callback = args.pop(); - var result; - try { - result = fn.apply(this, args); - } catch (e) { - return callback(e); - } - if (result && typeof result.then === func) { - result.then( - function(value) { - invokeCallback(callback, null, value); - }, - function(err) { - invokeCallback(callback, err && err.message ? err : new Error(err)); - } - ); - } else { - callback(null, result); - } - }; - } - - function invokeCallback(callback, err, value) { - try { - callback(err, value); - } catch (e) { - nextTick(rethrow, e); - } - } - - function rethrow(error) { - throw error; - } - - /** - * @memberof async - * @namespace reflect - * @param {Function} func - * @return {Function} - */ - function reflect(func) { - return function(/* args..., callback */) { - var callback; - switch (arguments.length) { - case 1: - callback = arguments[0]; - return func(done); - case 2: - callback = arguments[1]; - return func(arguments[0], done); - default: - var args = createArray(arguments); - var lastIndex = args.length - 1; - callback = args[lastIndex]; - args[lastIndex] = done; - func.apply(this, args); - } - - function done(err, res) { - if (err) { - return callback(null, { - error: err - }); - } - if (arguments.length > 2) { - res = slice(arguments, 1); - } - callback(null, { - value: res - }); - } - }; - } - - /** - * @memberof async - * @namespace reflectAll - * @param {Array[]|Object} tasks - * @return {Function} - */ - function reflectAll(tasks) { - var newTasks, keys; - if (isArray(tasks)) { - newTasks = Array(tasks.length); - arrayEachSync(tasks, iterate); - } else if (tasks && typeof tasks === obj) { - keys = nativeKeys(tasks); - newTasks = {}; - baseEachSync(tasks, iterate, keys); - } - return newTasks; - - function iterate(func, key) { - newTasks[key] = reflect(func); - } - } - - /** - * @memberof async - * @namespace createLogger - */ - function createLogger(name) { - return function(fn) { - var args = slice(arguments, 1); - args.push(done); - fn.apply(null, args); - }; - - function done(err) { - if (typeof console === obj) { - if (err) { - if (console.error) { - console.error(err); - } - return; - } - if (console[name]) { - var args = slice(arguments, 1); - arrayEachSync(args, function(arg) { - console[name](arg); - }); - } - } - } - } - - /** - * @memberof async - * @namespace safe - */ - function safe() { - createImmediate(); - return exports; - } - - /** - * @memberof async - * @namespace fast - */ - function fast() { - createImmediate(false); - return exports; - } -}); diff --git a/node_modules/neo-async/async.min.js b/node_modules/neo-async/async.min.js deleted file mode 100644 index 4161a3f..0000000 --- a/node_modules/neo-async/async.min.js +++ /dev/null @@ -1,80 +0,0 @@ -(function(N,O){"object"===typeof exports&&"undefined"!==typeof module?O(exports):"function"===typeof define&&define.amd?define(["exports"],O):N.async?O(N.neo_async=N.neo_async||{}):O(N.async=N.async||{})})(this,function(N){function O(a){var c=function(a){var d=J(arguments,1);setTimeout(function(){a.apply(null,d)})};T="function"===typeof setImmediate?setImmediate:c;"object"===typeof process&&"function"===typeof process.nextTick?(D=/^v0.10/.test(process.version)?T:process.nextTick,ba=/^v0/.test(process.version)? -T:process.nextTick):ba=D=T;!1===a&&(D=function(a){a()})}function H(a){for(var c=-1,b=a.length,d=Array(b);++c=d)return[];for(var e=Array(d);++bd[e]){var g=d[f]; -d[f]=d[e];d[e]=g}}if(!(e>b)){for(var l,e=a[a[c]>a[e]?c:e],f=c,g=b;f<=g;){for(l=f;f=l&&a[g]>=e;)g--;if(f>g)break;var q=a;l=d;var s=f++,h=g--,k=q[s];q[s]=q[h];q[h]=k;q=l[s];l[s]=l[h];l[h]=q}e=f;ca(a,c,e-1,d);ca(a,e,b,d)}}}function S(a){var c=[];Q(a,function(a){a!==w&&(C(a)?X.apply(c,a):c.push(a))});return c}function da(a,c,b){var d=-1,e=a.length;if(3===c.length)for(;++db)return e(null,[]);y=y||Array(m);K(b>m?m:b,x)}}function Y(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n=r.next();n.done?b(null):c(n.value,s)}function g(){n=r.next();n.done?b(null):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?b(a):++v===h||!1===d?(p=A,b(null)):u?D(p): -(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null);p()}function Z(a,c,b,d){function e(){xc)return d(null);K(c>k?k:c,v)}function za(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next(); -n.done?b(null,p):c(n.value,s)}function g(){n=r.next();n.done?b(null,p):c(n.value,t,s)}function l(){c(a[m[t]],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(u=A,b=E(b),b(a,H(p))):(p[t]=d,++t===h?(u=A,b(null,p),b=A):v?D(u):(v=!0,u()),v=!1)}b=b||w;var h,k,m,r,n,p,u,v=!1,t=0;C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,p=[],r=a[z](),u=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===c.length?q:l));if(!h)return b(null,[]);p=p||Array(h);u()}function Aa(a,c,b,d){return function(e, -f,g){function l(a){var b=!1;return function(c,e){b&&A();b=!0;c?(g=I(g),g(c)):!!e===d?(g=I(g),g(null,a)):++h===q&&g(null)}}g=g||w;var q,s,h=0;C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));q||g(null)}}function Ba(a){return function(c,b,d){function e(){r=c[x];b(r,h)}function f(){r=c[x];b(r,x,h)}function g(){u=p.next();r=u.value;u.done?d(null):b(r,h)}function l(){u=p.next();r=u.value;u.done?d(null):b(r,x,h)}function q(){r=c[n[x]]; -b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):!!c===a?(v=A,d(null,r)):++x===k?(v=A,d(null)):t?D(v):(t=!0,v());t=!1}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null);v()}}function Ca(a){return function(c,b,d,e){function f(){r=G++;rb)return e(null);K(b>m?m:b,x)}}function Da(a,c,b,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&A();c?(a=null,g=I(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===q&&g(null,k))}}g=g||w;var q,s,h=0,k={};C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null,k):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));if(!q)return g(null,{})}}function Ea(a){return function(c, -b,d){function e(){m=y;r=c[y];b(r,h)}function f(){m=y;r=c[y];b(r,y,h)}function g(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,h)}function l(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,m,h)}function q(){m=n[y];r=c[m];b(r,h)}function s(){m=n[y];r=c[m];b(r,m,h)}function h(b,c){b?d(b,x):(!!c===a&&(x[m]=r),++y===k?(v=A,d(null,x)):t?D(v):(t=!0,v()),t=!1)}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x={},y=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&& -(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null,{});v()}}function Fa(a){return function(c,b,d,e){function f(){r=B++;rb)return e(null,{});K(b>m?m:b,x)}}function $(a,c,b,d){function e(d){b(d,a[t],h)}function f(d){b(d,a[t],t,h)}function g(a){p=n.next();p.done?d(null,a):b(a,p.value, -h)}function l(a){p=n.next();p.done?d(null,a):b(a,p.value,t,h)}function q(d){b(d,a[r[t]],h)}function s(d){m=r[t];b(d,a[m],m,h)}function h(a,c){a?d(a,c):++t===k?(b=A,d(null,c)):v?D(function(){u(c)}):(v=!0,u(c));v=!1}d=E(d||w);var k,m,r,n,p,u,v=!1,t=0;C(a)?(k=a.length,u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,u=4===b.length?s:q));if(!k)return d(null,c);u(c)}function Ga(a,c,b,d){function e(d){b(d,a[--s],q)}function f(d){b(d,a[--s], -s,q)}function g(d){b(d,a[m[--s]],q)}function l(d){k=m[--s];b(d,a[k],k,q)}function q(a,b){a?d(a,b):0===s?(u=A,d(null,b)):v?D(function(){u(b)}):(v=!0,u(b));v=!1}d=E(d||w);var s,h,k,m,r,n,p,u,v=!1;if(C(a))s=a.length,u=4===b.length?f:e;else if(a)if(z&&a[z]){p=[];r=a[z]();for(h=-1;!1===(n=r.next()).done;)p[++h]=n.value;a=p;s=p.length;u=4===b.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===b.length?l:g);if(!s)return d(null,c);u(c)}function Ha(a,c,b){b=b||w;ja(a,c,function(a,c){if(a)return b(a); -b(null,!!c)})}function Ia(a,c,b){b=b||w;ka(a,c,function(a,c){if(a)return b(a);b(null,!!c)})}function Ja(a,c,b,d){d=d||w;la(a,c,b,function(a,b){if(a)return d(a);d(null,!!b)})}function Ka(a,c){return C(a)?0===a.length?(c(null),!1):!0:(c(Error("First argument to waterfall must be an array of functions")),!1)}function ma(a,c,b){switch(c.length){case 0:case 1:return a(b);case 2:return a(c[1],b);case 3:return a(c[1],c[2],b);case 4:return a(c[1],c[2],c[3],b);case 5:return a(c[1],c[2],c[3],c[4],b);case 6:return a(c[1], -c[2],c[3],c[4],c[5],b);default:return c=J(c,1),c.push(b),a.apply(null,c)}}function La(a,c){function b(b,h){if(b)q=A,c=E(c),c(b);else if(++d===f){q=A;var k=c;c=A;2===arguments.length?k(b,h):k.apply(null,H(arguments))}else g=a[d],l=arguments,e?D(q):(e=!0,q()),e=!1}c=c||w;if(Ka(a,c)){var d=0,e=!1,f=a.length,g=a[d],l=[],q=function(){switch(g.length){case 0:try{b(null,g())}catch(a){b(a)}break;case 1:return g(b);case 2:return g(l[1],b);case 3:return g(l[1],l[2],b);case 4:return g(l[1],l[2],l[3],b);case 5:return g(l[1], -l[2],l[3],l[4],b);default:return l=J(l,1),l[g.length-1]=b,g.apply(null,l)}};q()}}function Ma(){var a=H(arguments);return function(){var c=this,b=H(arguments),d=b[b.length-1];"function"===typeof d?b.pop():d=w;$(a,b,function(a,b,d){a.push(function(a){var b=J(arguments,1);d(a,b)});b.apply(c,a)},function(a,b){b=C(b)?b:[b];b.unshift(a);d.apply(c,b)})}}function Na(a){return function(c){var b=function(){var b=this,d=H(arguments),g=d.pop()||w;return a(c,function(a,c){a.apply(b,d.concat([c]))},g)};if(1b)throw Error("Concurrency must not be zero");var h=0,k=[],m,r,n={_tasks:new M,concurrency:b,payload:d,saturated:w,unsaturated:w,buffer:b/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(a, -b){f(a,b)},kill:function(){n.drain=w;n._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){n._tasks.remove(a)},process:a?l:q,length:function(){return n._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===n.length()+h},pause:function(){n.paused=!0},resume:function(){!1!==n.paused&&(n.paused=!1,K(n.concurrency=arguments.length?f:J(arguments,1);if(a){q=g=0;s.length=0;var k=L(l);k[d]=f;d=null;var h= -b;b=w;h(a,k)}else q--,g--,l[d]=f,e(d),d=null}function n(){0===--v&&s.push([p,u,c])}var p,u;if(C(a)){var v=a.length-1;p=a[v];u=v;if(0===v)s.push([p,u,c]);else for(var t=-1;++t=arguments.length)return b(a,e);var f=H(arguments);return b.apply(null,f)}c(d)}function e(){c(f)}function f(a,d){if(++s===g||!a||q&&!q(a)){if(2>=arguments.length)return b(a,d);var c=H(arguments);return b.apply(null,c)}setTimeout(e,l(s))}var g,l,q,s=0;if(3>arguments.length&&"function"===typeof a)b=c||w,c=a,a=null,g=5;else switch(b=b||w,typeof a){case "object":"function"===typeof a.errorFilter&&(q=a.errorFilter);var h=a.interval; -switch(typeof h){case "function":l=h;break;case "string":case "number":l=(h=+h)?function(){return h}:function(){return 0}}g=+a.times||5;break;case "number":g=a||5;break;case "string":g=+a||5;break;default:throw Error("Invalid arguments for async.retry");}if("function"!==typeof c)throw Error("Invalid arguments for async.retry");l?c(f):c(d)}function Pa(a){return function(){var c=H(arguments),b=c.pop(),d;try{d=a.apply(this,c)}catch(e){return b(e)}d&&"function"===typeof d.then?d.then(function(a){try{b(null, -a)}catch(d){D(Qa,d)}},function(a){a=a&&a.message?a:Error(a);try{b(a,void 0)}catch(d){D(Qa,d)}}):b(null,d)}}function Qa(a){throw a;}function Ra(a){return function(){function c(a,d){if(a)return b(null,{error:a});2=arguments.length?c:J(arguments,1),a=null,++q===f&&d(null,l))}}d=d||w;var f,g,l,q=0;C(b)?(f=b.length,l=Array(f),a(b,e)):b&&"object"===typeof b&&(g=F(b),f=g.length,l={},c(b,e,g));f||d(null,l)}}(function(a,c){for(var b=-1,d=a.length;++bc)return d(null,[]);v=v||Array(k);K(c>k?k:c,t)},mapValues:fb,mapValuesSeries:function(a,c,b){function d(){k=t;c(a[t], -s)}function e(){k=t;c(a[t],t,s)}function f(){k=t;n=r.next();n.done?b(null,v):c(n.value,s)}function g(){k=t;n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){k=m[t];c(a[k],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(p=A,b=E(b),b(a,L(v))):(v[k]=d,++t===h?(p=A,b(null,v),b=A):u?D(p):(u=!0,p()),u=!1)}b=b||w;var h,k,m,r,n,p,u=!1,v={},t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l)); -if(!h)return b(null,v);p()},mapValuesLimit:function(a,c,b,d){function e(){m=y++;mc)return d(null,x);K(c>k?k:c,v)},filter:Ta,filterSeries:Ua,filterLimit:Va,select:Ta,selectSeries:Ua,selectLimit:Va,reject:gb,rejectSeries:hb,rejectLimit:ib,detect:ja,detectSeries:ka,detectLimit:la,find:ja,findSeries:ka,findLimit:la,pick:jb,pickSeries:kb, -pickLimit:lb,omit:mb,omitSeries:nb,omitLimit:ob,reduce:$,inject:$,foldl:$,reduceRight:Ga,foldr:Ga,transform:pb,transformSeries:function(a,c,b,d){function e(){b(v,a[x],h)}function f(){b(v,a[x],x,h)}function g(){p=n.next();p.done?d(null,v):b(v,p.value,h)}function l(){p=n.next();p.done?d(null,v):b(v,p.value,x,h)}function q(){b(v,a[r[x]],h)}function s(){m=r[x];b(v,a[m],m,h)}function h(a,b){a?d(a,v):++x===k||!1===b?(u=A,d(null,v)):t?D(u):(t=!0,u());t=!1}3===arguments.length&&(d=b,b=c,c=void 0);d=E(d|| -w);var k,m,r,n,p,u,v,t=!1,x=0;C(a)?(k=a.length,v=void 0!==c?c:[],u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),v=void 0!==c?c:{},u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,v=void 0!==c?c:{},u=4===b.length?s:q));if(!k)return d(null,void 0!==c?c:v||{});u()},transformLimit:function(a,c,b,d,e){function f(){r=A++;rc)return e(null,void 0!==b?b:x||{});K(c>m?m:c,t)},sortBy:qb,sortBySeries:function(a,c,b){function d(){m=a[y];c(m,s)}function e(){m=a[y];c(m,y,s)}function f(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,s)}function g(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,y,s)}function l(){m=a[r[y]];u[y]=m;c(m,s)}function q(){k=r[y];m=a[k];u[y]=m;c(m,k,s)}function s(a,d){v[y]=d;a?b(a):++y===h?(t=A,b(null, -P(u,v))):x?D(t):(x=!0,t());x=!1}b=E(b||w);var h,k,m,r,n,p,u,v,t,x=!1,y=0;C(a)?(h=a.length,u=a,v=Array(h),t=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,u=[],v=[],n=a[z](),t=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=Array(h),v=Array(h),t=3===c.length?q:l));if(!h)return b(null,[]);t()},sortByLimit:function(a,c,b,d){function e(){Bc)return d(null,[]);x=x||Array(k);K(c>k?k:c,y)},some:Ha,someSeries:Ia,someLimit:Ja,any:Ha,anySeries:Ia,anyLimit:Ja,every:Wa,everySeries:Xa,everyLimit:Ya,all:Wa,allSeries:Xa,allLimit:Ya,concat:rb,concatSeries:function(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next();n.done?b(null,v):c(n.value,s)}function g(){n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){c(a[m[t]], -s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){C(d)?X.apply(v,d):2<=arguments.length&&X.apply(v,J(arguments,1));a?b(a,v):++t===h?(p=A,b(null,v)):u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=[],t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,v);p()},concatLimit:function(a,c,b,d){function e(){tc)return d(null,[]);u=u||Array(k);K(c>k?k:c,p)},groupBy:sb,groupBySeries:function(a,c,b){function d(){m=a[t];c(m,s)}function e(){m=a[t];c(m,t,s)}function f(){p=n.next();m=p.value;p.done?b(null,x):c(m,s)}function g(){p=n.next();m=p.value;p.done? -b(null,x):c(m,t,s)}function l(){m=a[r[t]];c(m,s)}function q(){k=r[t];m=a[k];c(m,k,s)}function s(a,d){if(a)u=A,b=E(b),b(a,L(x));else{var c=x[d];c?c.push(m):x[d]=[m];++t===h?(u=A,b(null,x)):v?D(u):(v=!0,u());v=!1}}b=E(b||w);var h,k,m,r,n,p,u,v=!1,t=0,x={};C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,n=a[z](),u=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=3===c.length?q:l));if(!h)return b(null,x);u()},groupByLimit:function(a,c,b,d){function e(){yc)return d(null,B);K(c>k?k:c,t)},parallel:tb,series:function(a,c){function b(){g=k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,b){a?(s=A,c=E(c),c(a,q)):(q[g]=2>=arguments.length?b:J(arguments,1),++k===f?(s=A,c(null,q)):h?D(s):(h=!0,s()),h=!1)}c=c||w;var f,g,l,q,s,h=!1,k=0;if(C(a))f=a.length,q=Array(f), -s=b;else if(a&&"object"===typeof a)l=F(a),f=l.length,q={},s=d;else return c(null);if(!f)return c(null,q);s()},parallelLimit:function(a,c,b){function d(){l=r++;if(l=arguments.length?c:J(arguments,1),a=null,++n===g?b(null,h):m?D(k):(m=!0,k()),m=!1)}}b=b||w;var g,l,q,s,h,k,m=!1,r=0,n=0;C(a)?(g=a.length,h=Array(g),k=d):a&&"object"===typeof a&&(s=F(a),g=s.length,h= -{},k=e);if(!g||isNaN(c)||1>c)return b(null,h);K(c>g?g:c,k)},tryEach:function(a,c){function b(){a[q](e)}function d(){a[g[q]](e)}function e(a,b){a?++q===f?c(a):l():2>=arguments.length?c(null,b):c(null,J(arguments,1))}c=c||w;var f,g,l,q=0;C(a)?(f=a.length,l=b):a&&"object"===typeof a&&(g=F(a),f=g.length,l=d);if(!f)return c(null);l()},waterfall:function(a,c){function b(){ma(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(c=w,A());h=void 0;k?(g=c,c=A,g(k)):++q===s?(g=c,c=A,2>=arguments.length? -g(k,m):g.apply(null,H(arguments))):(l?(f=arguments,e=a[q]||A,D(b)):(l=!0,ma(a[q]||A,arguments,d(q))),l=!1)}}c=c||w;if(Ka(a,c)){var e,f,g,l,q=0,s=a.length;ma(a[0],[],d(0))}},angelFall:La,angelfall:La,whilst:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?d():b(null,e):(e=J(arguments,1),a.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;a()?d():b(null)},doWhilst:function(a,c,b){function d(){g?D(e):(g=!0, -a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?d():b(null,e):(e=J(arguments,1),c.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;e()},until:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?b(null,e):d():(e=J(arguments,1),a.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;a()?b(null):d()},doUntil:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g= -!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?b(null,e):d():(e=J(arguments,1),c.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;e()},during:function(a,c,b){function d(a,d){if(a)return b(a);d?c(e):b(null)}function e(c){if(c)return b(c);a(d)}b=b||w;a(d)},doDuring:function(a,c,b){function d(d,c){if(d)return b(d);c?a(e):b(null)}function e(a,e){if(a)return b(a);switch(arguments.length){case 0:case 1:c(d);break;case 2:c(e,d);break;default:var l=J(arguments, -1);l.push(d);c.apply(null,l)}}b=b||w;d(null,!0)},forever:function(a,c){function b(){a(d)}function d(a){if(a){if(c)return c(a);throw a;}e?D(b):(e=!0,b());e=!1}var e=!1;b()},compose:function(){return Ma.apply(null,Za(arguments))},seq:Ma,applyEach:ub,applyEachSeries:vb,queue:function(a,c){return na(!0,a,c)},priorityQueue:function(a,c){var b=na(!0,a,c);b.push=function(a,c,f){b.started=!0;c=c||0;var g=C(a)?a:[a],l=g.length;if(void 0===a||0===l)b.idle()&&D(b.drain);else{f="function"===typeof f?f:w;for(a= -b._tasks.head;a&&c>=a.priority;)a=a.next;for(;l--;){var q={data:g[l],priority:c,callback:f};a?b._tasks.insertBefore(a,q):b._tasks.push(q);D(b.process)}}};delete b.unshift;return b},cargo:function(a,c){return na(!1,a,1,c)},auto:Oa,autoInject:function(a,c,b){var d={};W(a,function(a,b){var c,l=a.length;if(C(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=H(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=ab(a);if(0===l&&0===c.length)throw Error("autoInject task functions require explicit parameters."); -l=c.length-1}c[l]=function(b,d){switch(l){case 1:a(b[c[0]],d);break;case 2:a(b[c[0]],b[c[1]],d);break;case 3:a(b[c[0]],b[c[1]],b[c[2]],d);break;default:for(var f=-1;++fa)return b(null,[]);var e=Array(a);K(a,function(a){c(a,d(a))})},timesSeries:function(a,c,b){function d(){c(l, -e)}function e(c,e){f[l]=e;c?(b(c),b=A):++l>=a?(b(null,f),b=A):g?D(d):(g=!0,d());g=!1}b=b||w;a=+a;if(isNaN(a)||1>a)return b(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,c,b,d){function e(){var c=q++;c=a?(d(null,g),d=A):l?D(e):(l=!0,e());l=!1}}d=d||w;a=+a;if(isNaN(a)||1>a||isNaN(c)||1>c)return d(null,[]);var g=Array(a),l=!1,q=0,s=0;K(c>a?a:c,e)},race:function(a,c){c=I(c||w);var b,d,e=-1;if(C(a))for(b= -a.length;++e", - "license": "MIT", - "devDependencies": { - "semver": "^7.3.5" - } -} diff --git a/node_modules/p-limit/index.d.ts b/node_modules/p-limit/index.d.ts deleted file mode 100644 index 6bbfad4..0000000 --- a/node_modules/p-limit/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export interface Limit { - /** - @param fn - Promise-returning/async function. - @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. - @returns The promise returned by calling `fn(...arguments)`. - */ - ( - fn: (...arguments: Arguments) => PromiseLike | ReturnType, - ...arguments: Arguments - ): Promise; - - /** - The number of promises that are currently running. - */ - readonly activeCount: number; - - /** - The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - */ - readonly pendingCount: number; - - /** - Discard pending promises that are waiting to run. - - This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. - - Note: This does not cancel promises that are already running. - */ - clearQueue(): void; -} - -/** -Run multiple promise-returning & async functions with limited concurrency. - -@param concurrency - Concurrency limit. Minimum: `1`. -@returns A `limit` function. -*/ -export default function pLimit(concurrency: number): Limit; diff --git a/node_modules/p-limit/index.js b/node_modules/p-limit/index.js deleted file mode 100644 index 6a72a4c..0000000 --- a/node_modules/p-limit/index.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; -const pTry = require('p-try'); - -const pLimit = concurrency => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); - } - - const queue = []; - let activeCount = 0; - - const next = () => { - activeCount--; - - if (queue.length > 0) { - queue.shift()(); - } - }; - - const run = (fn, resolve, ...args) => { - activeCount++; - - const result = pTry(fn, ...args); - - resolve(result); - - result.then(next, next); - }; - - const enqueue = (fn, resolve, ...args) => { - if (activeCount < concurrency) { - run(fn, resolve, ...args); - } else { - queue.push(run.bind(null, fn, resolve, ...args)); - } - }; - - const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.length - }, - clearQueue: { - value: () => { - queue.length = 0; - } - } - }); - - return generator; -}; - -module.exports = pLimit; -module.exports.default = pLimit; diff --git a/node_modules/p-limit/license b/node_modules/p-limit/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/p-limit/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-limit/package.json b/node_modules/p-limit/package.json deleted file mode 100644 index 99a814f..0000000 --- a/node_modules/p-limit/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "p-limit", - "version": "2.3.0", - "description": "Run multiple promise-returning & async functions with limited concurrency", - "license": "MIT", - "repository": "sindresorhus/p-limit", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd-check" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "promise", - "limit", - "limited", - "concurrency", - "throttle", - "throat", - "rate", - "batch", - "ratelimit", - "task", - "queue", - "async", - "await", - "promises", - "bluebird" - ], - "dependencies": { - "p-try": "^2.0.0" - }, - "devDependencies": { - "ava": "^1.2.1", - "delay": "^4.1.0", - "in-range": "^1.0.0", - "random-int": "^1.0.0", - "time-span": "^2.0.0", - "tsd-check": "^0.3.0", - "xo": "^0.24.0" - } -} diff --git a/node_modules/p-limit/readme.md b/node_modules/p-limit/readme.md deleted file mode 100644 index 64aa476..0000000 --- a/node_modules/p-limit/readme.md +++ /dev/null @@ -1,101 +0,0 @@ -# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) - -> Run multiple promise-returning & async functions with limited concurrency - -## Install - -``` -$ npm install p-limit -``` - -## Usage - -```js -const pLimit = require('p-limit'); - -const limit = pLimit(1); - -const input = [ - limit(() => fetchSomething('foo')), - limit(() => fetchSomething('bar')), - limit(() => doSomething()) -]; - -(async () => { - // Only one promise is run at once - const result = await Promise.all(input); - console.log(result); -})(); -``` - -## API - -### pLimit(concurrency) - -Returns a `limit` function. - -#### concurrency - -Type: `number`\ -Minimum: `1`\ -Default: `Infinity` - -Concurrency limit. - -### limit(fn, ...args) - -Returns the promise returned by calling `fn(...args)`. - -#### fn - -Type: `Function` - -Promise-returning/async function. - -#### args - -Any arguments to pass through to `fn`. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -### limit.activeCount - -The number of promises that are currently running. - -### limit.pendingCount - -The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - -### limit.clearQueue() - -Discard pending promises that are waiting to run. - -This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. - -Note: This does not cancel promises that are already running. - -## FAQ - -### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? - -This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. - -## Related - -- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control -- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions -- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions -- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency -- [More…](https://github.com/sindresorhus/promise-fun) - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/p-locate/index.d.ts b/node_modules/p-locate/index.d.ts deleted file mode 100644 index 14115e1..0000000 --- a/node_modules/p-locate/index.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -declare namespace pLocate { - interface Options { - /** - Number of concurrently pending promises returned by `tester`. Minimum: `1`. - - @default Infinity - */ - readonly concurrency?: number; - - /** - Preserve `input` order when searching. - - Disable this to improve performance if you don't care about the order. - - @default true - */ - readonly preserveOrder?: boolean; - } -} - -declare const pLocate: { - /** - Get the first fulfilled promise that satisfies the provided testing function. - - @param input - An iterable of promises/values to test. - @param tester - This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. - @returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. - - @example - ``` - import pathExists = require('path-exists'); - import pLocate = require('p-locate'); - - const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' - ]; - - (async () => { - const foundPath = await pLocate(files, file => pathExists(file)); - - console.log(foundPath); - //=> 'rainbow' - })(); - ``` - */ - ( - input: Iterable | ValueType>, - tester: (element: ValueType) => PromiseLike | boolean, - options?: pLocate.Options - ): Promise; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function pLocate( - // input: Iterable | ValueType>, - // tester: (element: ValueType) => PromiseLike | boolean, - // options?: pLocate.Options - // ): Promise; - // export = pLocate; - default: typeof pLocate; -}; - -export = pLocate; diff --git a/node_modules/p-locate/index.js b/node_modules/p-locate/index.js deleted file mode 100644 index e13ce15..0000000 --- a/node_modules/p-locate/index.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; -const pLimit = require('p-limit'); - -class EndError extends Error { - constructor(value) { - super(); - this.value = value; - } -} - -// The input can also be a promise, so we await it -const testElement = async (element, tester) => tester(await element); - -// The input can also be a promise, so we `Promise.all()` them both -const finder = async element => { - const values = await Promise.all(element); - if (values[1] === true) { - throw new EndError(values[0]); - } - - return false; -}; - -const pLocate = async (iterable, tester, options) => { - options = { - concurrency: Infinity, - preserveOrder: true, - ...options - }; - - const limit = pLimit(options.concurrency); - - // Start all the promises concurrently with optional limit - const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); - - // Check the promises either serially or concurrently - const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); - - try { - await Promise.all(items.map(element => checkLimit(finder, element))); - } catch (error) { - if (error instanceof EndError) { - return error.value; - } - - throw error; - } -}; - -module.exports = pLocate; -// TODO: Remove this for the next major release -module.exports.default = pLocate; diff --git a/node_modules/p-locate/license b/node_modules/p-locate/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/p-locate/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-locate/package.json b/node_modules/p-locate/package.json deleted file mode 100644 index e3de275..0000000 --- a/node_modules/p-locate/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "p-locate", - "version": "4.1.0", - "description": "Get the first fulfilled promise that satisfies the provided testing function", - "license": "MIT", - "repository": "sindresorhus/p-locate", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "promise", - "locate", - "find", - "finder", - "search", - "searcher", - "test", - "array", - "collection", - "iterable", - "iterator", - "race", - "fulfilled", - "fastest", - "async", - "await", - "promises", - "bluebird" - ], - "dependencies": { - "p-limit": "^2.2.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "delay": "^4.1.0", - "in-range": "^1.0.0", - "time-span": "^3.0.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/p-locate/readme.md b/node_modules/p-locate/readme.md deleted file mode 100644 index f8e2c2e..0000000 --- a/node_modules/p-locate/readme.md +++ /dev/null @@ -1,90 +0,0 @@ -# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) - -> Get the first fulfilled promise that satisfies the provided testing function - -Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). - - -## Install - -``` -$ npm install p-locate -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - const foundPath = await pLocate(files, file => pathExists(file)); - - console.log(foundPath); - //=> 'rainbow' -})(); -``` - -*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* - - -## API - -### pLocate(input, tester, [options]) - -Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. - -#### input - -Type: `Iterable` - -An iterable of promises/values to test. - -#### tester(element) - -Type: `Function` - -This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
-Default: `Infinity`
-Minimum: `1` - -Number of concurrently pending promises returned by `tester`. - -##### preserveOrder - -Type: `boolean`
-Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - - -## Related - -- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently -- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently -- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/p-try/index.d.ts b/node_modules/p-try/index.d.ts deleted file mode 100644 index 2a7319e..0000000 --- a/node_modules/p-try/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -declare const pTry: { - /** - Start a promise chain. - - @param fn - The function to run to start the promise chain. - @param arguments - Arguments to pass to `fn`. - @returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. - - @example - ``` - import pTry = require('p-try'); - - (async () => { - try { - const value = await pTry(() => { - return synchronousFunctionThatMightThrow(); - }); - console.log(value); - } catch (error) { - console.error(error); - } - })(); - ``` - */ - ( - fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, - ...arguments: ArgumentsType - ): Promise; - - // TODO: remove this in the next major version, refactor the whole definition to: - // declare function pTry( - // fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, - // ...arguments: ArgumentsType - // ): Promise; - // export = pTry; - default: typeof pTry; -}; - -export = pTry; diff --git a/node_modules/p-try/index.js b/node_modules/p-try/index.js deleted file mode 100644 index db858da..0000000 --- a/node_modules/p-try/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const pTry = (fn, ...arguments_) => new Promise(resolve => { - resolve(fn(...arguments_)); -}); - -module.exports = pTry; -// TODO: remove this in the next major version -module.exports.default = pTry; diff --git a/node_modules/p-try/license b/node_modules/p-try/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/p-try/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-try/package.json b/node_modules/p-try/package.json deleted file mode 100644 index 81c4d32..0000000 --- a/node_modules/p-try/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "p-try", - "version": "2.2.0", - "description": "`Start a promise chain", - "license": "MIT", - "repository": "sindresorhus/p-try", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "promise", - "try", - "resolve", - "function", - "catch", - "async", - "await", - "promises", - "settled", - "ponyfill", - "polyfill", - "shim", - "bluebird" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - } -} diff --git a/node_modules/p-try/readme.md b/node_modules/p-try/readme.md deleted file mode 100644 index 4d7bd64..0000000 --- a/node_modules/p-try/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) - -> Start a promise chain - -[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) - - -## Install - -``` -$ npm install p-try -``` - - -## Usage - -```js -const pTry = require('p-try'); - -(async () => { - try { - const value = await pTry(() => { - return synchronousFunctionThatMightThrow(); - }); - console.log(value); - } catch (error) { - console.error(error); - } -})(); -``` - - -## API - -### pTry(fn, ...arguments) - -Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -#### fn - -The function to run to start the promise chain. - -#### arguments - -Arguments to pass to `fn`. - - -## Related - -- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-exists/index.d.ts b/node_modules/path-exists/index.d.ts deleted file mode 100644 index 54b7ab8..0000000 --- a/node_modules/path-exists/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare const pathExists: { - /** - Check if a path exists. - - @returns Whether the path exists. - - @example - ``` - // foo.ts - import pathExists = require('path-exists'); - - (async () => { - console.log(await pathExists('foo.ts')); - //=> true - })(); - ``` - */ - (path: string): Promise; - - /** - Synchronously check if a path exists. - - @returns Whether the path exists. - */ - sync(path: string): boolean; -}; - -export = pathExists; diff --git a/node_modules/path-exists/index.js b/node_modules/path-exists/index.js deleted file mode 100644 index 1943921..0000000 --- a/node_modules/path-exists/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const fs = require('fs'); -const {promisify} = require('util'); - -const pAccess = promisify(fs.access); - -module.exports = async path => { - try { - await pAccess(path); - return true; - } catch (_) { - return false; - } -}; - -module.exports.sync = path => { - try { - fs.accessSync(path); - return true; - } catch (_) { - return false; - } -}; diff --git a/node_modules/path-exists/license b/node_modules/path-exists/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/path-exists/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-exists/package.json b/node_modules/path-exists/package.json deleted file mode 100644 index 0755256..0000000 --- a/node_modules/path-exists/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "path-exists", - "version": "4.0.0", - "description": "Check if a path exists", - "license": "MIT", - "repository": "sindresorhus/path-exists", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "path", - "exists", - "exist", - "file", - "filepath", - "fs", - "filesystem", - "file-system", - "access", - "stat" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/path-exists/readme.md b/node_modules/path-exists/readme.md deleted file mode 100644 index 81f9845..0000000 --- a/node_modules/path-exists/readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) - -> Check if a path exists - -NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed. - -While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. - -Never use this before handling a file though: - -> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. - - -## Install - -``` -$ npm install path-exists -``` - - -## Usage - -```js -// foo.js -const pathExists = require('path-exists'); - -(async () => { - console.log(await pathExists('foo.js')); - //=> true -})(); -``` - - -## API - -### pathExists(path) - -Returns a `Promise` of whether the path exists. - -### pathExists.sync(path) - -Returns a `boolean` of whether the path exists. - - -## Related - -- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-key/index.d.ts b/node_modules/path-key/index.d.ts deleted file mode 100644 index 7c575d1..0000000 --- a/node_modules/path-key/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// - -declare namespace pathKey { - interface Options { - /** - Use a custom environment variables object. Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env). - */ - readonly env?: {[key: string]: string | undefined}; - - /** - Get the PATH key for a specific platform. Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform). - */ - readonly platform?: NodeJS.Platform; - } -} - -declare const pathKey: { - /** - Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform. - - @example - ``` - import pathKey = require('path-key'); - - const key = pathKey(); - //=> 'PATH' - - const PATH = process.env[key]; - //=> '/usr/local/bin:/usr/bin:/bin' - ``` - */ - (options?: pathKey.Options): string; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function pathKey(options?: pathKey.Options): string; - // export = pathKey; - default: typeof pathKey; -}; - -export = pathKey; diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js deleted file mode 100644 index 0cf6415..0000000 --- a/node_modules/path-key/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; -}; - -module.exports = pathKey; -// TODO: Remove this for the next major release -module.exports.default = pathKey; diff --git a/node_modules/path-key/license b/node_modules/path-key/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/path-key/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json deleted file mode 100644 index c8cbd38..0000000 --- a/node_modules/path-key/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "path-key", - "version": "3.1.1", - "description": "Get the PATH environment variable key cross-platform", - "license": "MIT", - "repository": "sindresorhus/path-key", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "path", - "key", - "environment", - "env", - "variable", - "var", - "get", - "cross-platform", - "windows" - ], - "devDependencies": { - "@types/node": "^11.13.0", - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md deleted file mode 100644 index a9052d7..0000000 --- a/node_modules/path-key/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) - -> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform - -It's usually `PATH`, but on Windows it can be any casing like `Path`... - - -## Install - -``` -$ npm install path-key -``` - - -## Usage - -```js -const pathKey = require('path-key'); - -const key = pathKey(); -//=> 'PATH' - -const PATH = process.env[key]; -//=> '/usr/local/bin:/usr/bin:/bin' -``` - - -## API - -### pathKey(options?) - -#### options - -Type: `object` - -##### env - -Type: `object`
-Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) - -Use a custom environment variables object. - -#### platform - -Type: `string`
-Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) - -Get the PATH key for a specific platform. - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/path-parse/LICENSE b/node_modules/path-parse/LICENSE deleted file mode 100644 index 810f3db..0000000 --- a/node_modules/path-parse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Javier Blanco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/path-parse/README.md b/node_modules/path-parse/README.md deleted file mode 100644 index 05097f8..0000000 --- a/node_modules/path-parse/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) - -> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). - -## Install - -``` -$ npm install --save path-parse -``` - -## Usage - -```js -var pathParse = require('path-parse'); - -pathParse('/home/user/dir/file.txt'); -//=> { -// root : "/", -// dir : "/home/user/dir", -// base : "file.txt", -// ext : ".txt", -// name : "file" -// } -``` - -## API - -See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. - -### pathParse(path) - -### pathParse.posix(path) - -The Posix specific version. - -### pathParse.win32(path) - -The Windows specific version. - -## License - -MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js deleted file mode 100644 index f062d0a..0000000 --- a/node_modules/path-parse/index.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -var isWindows = process.platform === 'win32'; - -// Regex to split a windows path into into [dir, root, basename, name, ext] -var splitWindowsRe = - /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; - -var win32 = {}; - -function win32SplitPath(filename) { - return splitWindowsRe.exec(filename).slice(1); -} - -win32.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 5) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[1], - dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), - base: allParts[2], - ext: allParts[4], - name: allParts[3] - }; -}; - - - -// Split a filename into [dir, root, basename, name, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; -var posix = {}; - - -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} - - -posix.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 5) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - - return { - root: allParts[1], - dir: allParts[0].slice(0, -1), - base: allParts[2], - ext: allParts[4], - name: allParts[3], - }; -}; - - -if (isWindows) - module.exports = win32.parse; -else /* posix */ - module.exports = posix.parse; - -module.exports.posix = posix.parse; -module.exports.win32 = win32.parse; diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json deleted file mode 100644 index 36c23f8..0000000 --- a/node_modules/path-parse/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "path-parse", - "version": "1.0.7", - "description": "Node.js path.parse() ponyfill", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/jbgutierrez/path-parse.git" - }, - "keywords": [ - "path", - "paths", - "file", - "dir", - "parse", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim" - ], - "author": "Javier Blanco ", - "license": "MIT", - "bugs": { - "url": "https://github.com/jbgutierrez/path-parse/issues" - }, - "homepage": "https://github.com/jbgutierrez/path-parse#readme" -} diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE deleted file mode 100644 index 496098c..0000000 --- a/node_modules/picocolors/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md deleted file mode 100644 index 8e47aa8..0000000 --- a/node_modules/picocolors/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# picocolors - -The tiniest and the fastest library for terminal output formatting with ANSI colors. - -```javascript -import pc from "picocolors" - -console.log( - pc.green(`How are ${pc.italic(`you`)} doing?`) -) -``` - -- **No dependencies.** -- **14 times** smaller and **2 times** faster than chalk. -- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist. -- Node.js v6+ & browsers support. Support for both CJS and ESM projects. -- TypeScript type declarations included. -- [`NO_COLOR`](https://no-color.org/) friendly. - -## Docs -Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub. diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json deleted file mode 100644 index 85a12d5..0000000 --- a/node_modules/picocolors/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "picocolors", - "version": "1.0.0", - "main": "./picocolors.js", - "types": "./picocolors.d.ts", - "browser": { - "./picocolors.js": "./picocolors.browser.js" - }, - "sideEffects": false, - "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors", - "files": [ - "picocolors.*", - "types.ts" - ], - "keywords": [ - "terminal", - "colors", - "formatting", - "cli", - "console" - ], - "author": "Alexey Raspopov", - "repository": "alexeyraspopov/picocolors", - "license": "ISC" -} diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js deleted file mode 100644 index 5eb9fbe..0000000 --- a/node_modules/picocolors/picocolors.browser.js +++ /dev/null @@ -1,4 +0,0 @@ -var x=String; -var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}}; -module.exports=create(); -module.exports.createColors = create; diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts deleted file mode 100644 index 94e146a..0000000 --- a/node_modules/picocolors/picocolors.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Colors } from "./types" - -declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors } - -export = picocolors diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js deleted file mode 100644 index fdb6304..0000000 --- a/node_modules/picocolors/picocolors.js +++ /dev/null @@ -1,58 +0,0 @@ -let tty = require("tty") - -let isColorSupported = - !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && - ("FORCE_COLOR" in process.env || - process.argv.includes("--color") || - process.platform === "win32" || - (tty.isatty(1) && process.env.TERM !== "dumb") || - "CI" in process.env) - -let formatter = - (open, close, replace = open) => - input => { - let string = "" + input - let index = string.indexOf(close, open.length) - return ~index - ? open + replaceClose(string, close, replace, index) + close - : open + string + close - } - -let replaceClose = (string, close, replace, index) => { - let start = string.substring(0, index) + replace - let end = string.substring(index + close.length) - let nextIndex = end.indexOf(close) - return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end -} - -let createColors = (enabled = isColorSupported) => ({ - isColorSupported: enabled, - reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String, - bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, - dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, - italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, - underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, - inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, - hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, - strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, - black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, - red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, - green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, - yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, - blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, - magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, - cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, - white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, - gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, - bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, - bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, - bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, - bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, - bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, - bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, - bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, - bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, -}) - -module.exports = createColors() -module.exports.createColors = createColors diff --git a/node_modules/picocolors/types.ts b/node_modules/picocolors/types.ts deleted file mode 100644 index b4bacee..0000000 --- a/node_modules/picocolors/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -export type Formatter = (input: string | number | null | undefined) => string - -export interface Colors { - isColorSupported: boolean - reset: Formatter - bold: Formatter - dim: Formatter - italic: Formatter - underline: Formatter - inverse: Formatter - hidden: Formatter - strikethrough: Formatter - black: Formatter - red: Formatter - green: Formatter - yellow: Formatter - blue: Formatter - magenta: Formatter - cyan: Formatter - white: Formatter - gray: Formatter - bgBlack: Formatter - bgRed: Formatter - bgGreen: Formatter - bgYellow: Formatter - bgBlue: Formatter - bgMagenta: Formatter - bgCyan: Formatter - bgWhite: Formatter -} diff --git a/node_modules/pkg-dir/index.d.ts b/node_modules/pkg-dir/index.d.ts deleted file mode 100644 index e339404..0000000 --- a/node_modules/pkg-dir/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -declare const pkgDir: { - /** - Find the root directory of a Node.js project or npm package. - - @param cwd - Directory to start from. Default: `process.cwd()`. - @returns The project root path or `undefined` if it couldn't be found. - - @example - ``` - // / - // └── Users - // └── sindresorhus - // └── foo - // ├── package.json - // └── bar - // ├── baz - // └── example.js - - // example.js - import pkgDir = require('pkg-dir'); - - (async () => { - const rootDir = await pkgDir(__dirname); - - console.log(rootDir); - //=> '/Users/sindresorhus/foo' - })(); - ``` - */ - (cwd?: string): Promise; - - /** - Synchronously find the root directory of a Node.js project or npm package. - - @param cwd - Directory to start from. Default: `process.cwd()`. - @returns The project root path or `undefined` if it couldn't be found. - */ - sync(cwd?: string): string | undefined; - - // TODO: Remove this for the next major release - default: typeof pkgDir; -}; - -export = pkgDir; diff --git a/node_modules/pkg-dir/index.js b/node_modules/pkg-dir/index.js deleted file mode 100644 index 83e683d..0000000 --- a/node_modules/pkg-dir/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -const path = require('path'); -const findUp = require('find-up'); - -const pkgDir = async cwd => { - const filePath = await findUp('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; - -module.exports = pkgDir; -// TODO: Remove this for the next major release -module.exports.default = pkgDir; - -module.exports.sync = cwd => { - const filePath = findUp.sync('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; diff --git a/node_modules/pkg-dir/license b/node_modules/pkg-dir/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/pkg-dir/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pkg-dir/package.json b/node_modules/pkg-dir/package.json deleted file mode 100644 index aad11e8..0000000 --- a/node_modules/pkg-dir/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "pkg-dir", - "version": "4.2.0", - "description": "Find the root directory of a Node.js project or npm package", - "license": "MIT", - "repository": "sindresorhus/pkg-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "package", - "json", - "root", - "npm", - "entry", - "find", - "up", - "find-up", - "findup", - "look-up", - "look", - "file", - "search", - "match", - "resolve", - "parent", - "parents", - "folder", - "directory", - "dir", - "walk", - "walking", - "path" - ], - "dependencies": { - "find-up": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tempy": "^0.3.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/pkg-dir/readme.md b/node_modules/pkg-dir/readme.md deleted file mode 100644 index 92a77f4..0000000 --- a/node_modules/pkg-dir/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir) - -> Find the root directory of a Node.js project or npm package - - -## Install - -``` -$ npm install pkg-dir -``` - - -## Usage - -``` -/ -└── Users - └── sindresorhus - └── foo - ├── package.json - └── bar - ├── baz - └── example.js -``` - -```js -// example.js -const pkgDir = require('pkg-dir'); - -(async () => { - const rootDir = await pkgDir(__dirname); - - console.log(rootDir); - //=> '/Users/sindresorhus/foo' -})(); -``` - - -## API - -### pkgDir([cwd]) - -Returns a `Promise` for either the project root path or `undefined` if it couldn't be found. - -### pkgDir.sync([cwd]) - -Returns the project root path or `undefined` if it couldn't be found. - -#### cwd - -Type: `string`
-Default: `process.cwd()` - -Directory to start from. - - -## Related - -- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module -- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file -- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/property-path/.jshintrc b/node_modules/property-path/.jshintrc deleted file mode 100644 index a9ff6c1..0000000 --- a/node_modules/property-path/.jshintrc +++ /dev/null @@ -1,44 +0,0 @@ -{ - "browser" : false, - "curly" : false, - "devel" : false, - "eqeqeq" : false, - "eqnull" : true, - "es5" : true, - "esnext" : true, - "expr" : true, - "forin" : false, - "immed" : false, - "indent" : 4, - "latedef" : false, - "laxcomma" : true, - "maxcomplexity" : 39, - "maxdepth" : 5, - "maxlen" : 150, - "maxparams" : 4, - "maxstatements" : 100, - "newcap" : true, - "noarg" : true, - "noempty" : true, - "nonew" : false, - "node" : true, - "onevar" : false, - "plusplus" : false, - "quotmark" : "single", - "regexp" : false, - "undef" : true, - "unused" : true, - "swindent" : true, - "trailing" : true, - "undef" : true, - "unused" : true, - "white" : false, - - "globals" : { - "it" : true, - "should" : true, - "console" : true, - "logger" : true, - "describe" : true - } -} diff --git a/node_modules/property-path/LICENSE b/node_modules/property-path/LICENSE deleted file mode 100644 index 0f43cc8..0000000 --- a/node_modules/property-path/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Edmond Meinfelder - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/property-path/README.md b/node_modules/property-path/README.md deleted file mode 100644 index d233144..0000000 --- a/node_modules/property-path/README.md +++ /dev/null @@ -1,118 +0,0 @@ -property-path -============= - -Get and set object properties by a string path, where you can specify the -separator. - -## Example - - var propPath = require('property-path'); - - var testObj = { - a: 1, - b: true, - c: { - d: { - e: 'Hello', - f: [ 1, 2, false, 'hi' ] - } - } - }; - - console.log(propPath.get(testObj, 'a')); - console.log(propPath.get(testObj, 'b')); - console.log(propPath.get(testObj, 'c.d.e')); - console.log(propPath.get(testObj, 'c/d/e', '/')); - - propPath.set(testObj, 'c.d.f.0', 333); - console.log(testObj.c.d.f[0]); - -The above code results in the following output: - - 1 - true - Hello - Hello - 333 - -## Installation - - npm install property-path - -## API - -### get(obj, path, [sep]) - -Given an object and a char-separated path, return the value at the path -or false if no such value can be found. - -#### Params: - -* **Object** *obj* An object upon which to apply the path. -* **String** *path* The path to traverse the object, e.g 'a.b.c' -* **String** *[sep]* The separator char to delimit the properties in the path. Optional. If not specified, '.' is assumed. - -#### Return: - -* **Undefined|Any** returns the value, if found or undefined otherwise. - -### set(obj, path, value, [sep]) - -Given an object and a char-separated path, return the value at the path -or false if no such value can be found. - -#### Params: - -* **Object** *obj* An object upon which to apply the path. -* **String** *path* The path to traverse the object, e.g 'a.b.c' -* **Any** *value* The value to set the property to. -* **String** *[sep]* The separator char to delimit the properties in the path. Optional. If not specified, '.' is assumed. - -#### Return: - -* **Undefined|Any** returns the value set, if the property is found or undefined otherwise. - -### remove(obj, path, [sep]) -Delete the property at path on obj. - -* **Object** *obj* An object upon which to apply the path. -* **String** *path* The path to traverse the object, e.g 'a.b.c' -* **String** *[sep]* The separator char to delimit the properties in the path. Optional. If not specified, '.' is assumed. - -#### Return: - -* **Boolean** returns the value set, if the property is found or undefined otherwise. - -### setSepChar(chr) -Set the default separator character. Normally, when not specified, '.' is used, -however, you may set the default to whatever you want. - -* **String** *chr* The new default separator char to delimit the properties in the path. - -#### Return: - -* **Boolean** true if set and false otherwise. - - -## License -The MIT License (MIT) - -Copyright (c) 2014 Edmond Meinfelder - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/property-path/index.js b/node_modules/property-path/index.js deleted file mode 100644 index 144dbd0..0000000 --- a/node_modules/property-path/index.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @fileOverview - * Get and set a properties by a path with optional separator character. - */ -'use strict'; - -module.exports = { - getChild: getChild, - getParentPath: getParentPath, - get: get, - set: set, - remove: remove, - setSepChar: setSepChar -}; - -var is = require('is2'); -var filter = require('lodash.filter'); -var defaultSepChar = '.'; // global separator character, default is '.' - -/** - * Allows you to change the default separator character from '.' to whatever - * you want. - * @param {String} chr The separator character to use to separate path parts. - * @return {Boolean} true if the separator character was set and false otherwise. - */ -function setSepChar(chr) { - if (is.nonEmptyStr(chr)) { - defaultSepChar = chr; - return true; - } - return false; -} - -/** - * Given a char separated object path, return the child element (last part) of - * the path. For the path, '1.2.3.4', the child path would be '4'. - * @param {String} path The path for which which we want the child. - * @param {String} sep The separator character to separate path elements in the string path. - * @return {String|Boolean} Child element of the input path parameter or false is there is no child element. - */ -function getChild(path, sep) { - if (!is.nonEmptyStr(path)) return false; - if (!is.nonEmptyStr(sep)) sep = defaultSepChar; - - // create new path and remove leading and trailing sep chars - var pathParts = filter(path.split(sep), function(elem) { - return is.str(elem) && elem.length; - }); - - var child = pathParts.length === 0 ? false : pathParts[pathParts.length-1]; - return child; -} - -/** - * Given a char separated object path, return the parent part of the path. Given - * a path, return the parent path, for '1.2.3.4', the parent path would be - * '1.2.3'. - * @param {String} path The path for which which we want the parent. - * @param {String} sep The separator character to separate path elements. - * @return {String|Boolean} The parent to the path input parameter or false if there is no parent path. - */ -function getParentPath(path, sep) { - if (!is.nonEmptyStr(path)) return false; - if (!is.nonEmptyStr(sep)) sep = defaultSepChar; - - // create new path and remove leading and trailing sep chars - var properties = filter(path.split(sep), function(elem) { - return is.str(elem) && elem.length; - }); - - // create a parent path - var parentPath = ''; - for (var i=0; i opts && opts.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${v4})|(?:${v6})`, 'g'); - -ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g'); -ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g'); diff --git a/node_modules/property-path/node_modules/ip-regex/license b/node_modules/property-path/node_modules/ip-regex/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/property-path/node_modules/ip-regex/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/property-path/node_modules/ip-regex/package.json b/node_modules/property-path/node_modules/ip-regex/package.json deleted file mode 100644 index aa51479..0000000 --- a/node_modules/property-path/node_modules/ip-regex/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "ip-regex", - "version": "2.1.0", - "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", - "license": "MIT", - "repository": "sindresorhus/ip-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ip", - "ipv6", - "ipv4", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "text", - "pattern", - "internet", - "protocol", - "address", - "validate" - ], - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "xo": { - "esnext": true - } -} diff --git a/node_modules/property-path/node_modules/ip-regex/readme.md b/node_modules/property-path/node_modules/ip-regex/readme.md deleted file mode 100644 index 66bc7f2..0000000 --- a/node_modules/property-path/node_modules/ip-regex/readme.md +++ /dev/null @@ -1,63 +0,0 @@ -# ip-regex [![Build Status](https://travis-ci.org/sindresorhus/ip-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ip-regex) - -> Regular expression for matching IP addresses - - -## Install - -``` -$ npm install --save ip-regex -``` - - -## Usage - -```js -const ipRegex = require('ip-regex'); - -// Contains an IP address? -ipRegex().test('unicorn 192.168.0.1'); -//=> true - -// Is an IP address? -ipRegex({exact: true}).test('unicorn 192.168.0.1'); -//=> false - -ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); -//=> true - -'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); -//=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] -``` - - -## API - -### ipRegex([options]) - -Returns a regex for matching both IPv4 and IPv6. - -### ipRegex.v4([options]) - -Returns a regex for matching IPv4. - -### ipRegex.v6([options]) - -Returns a regex for matching IPv6. - -#### options.exact - -Type: `boolean`
-Default: `false` *(Matches any IP address in a string)* - -Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. - - -## Related - -- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/property-path/node_modules/is2/.jshintrc b/node_modules/property-path/node_modules/is2/.jshintrc deleted file mode 100644 index f39326d..0000000 --- a/node_modules/property-path/node_modules/is2/.jshintrc +++ /dev/null @@ -1,43 +0,0 @@ -{ - "browser" : false, - "curly" : false, - "devel" : false, - "eqeqeq" : true, - "eqnull" : true, - "es5" : true, - "esnext" : true, - "expr" : true, - "forin" : false, - "immed" : false, - "indent" : 4, - "latedef" : false, - "laxcomma" : true, - "maxdepth" : 5, - "maxlen" : 9110, - "maxparams" : 4, - "maxstatements" : 100, - "newcap" : true, - "noarg" : true, - "noempty" : true, - "nonew" : false, - "node" : true, - "onevar" : false, - "plusplus" : false, - "quotmark" : "single", - "regexp" : false, - "undef" : true, - "unused" : true, - "strict" : true, - "trailing" : true, - "undef" : true, - "unused" : true, - "white" : false, - - "globals" : { - "it" : false, - "console" : true, - "describe" : false, - "toString" : false, - "window" : true - } -} diff --git a/node_modules/property-path/node_modules/is2/LICENSE b/node_modules/property-path/node_modules/is2/LICENSE deleted file mode 100644 index 4c05804..0000000 --- a/node_modules/property-path/node_modules/is2/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Edmond Meinfelder - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/property-path/node_modules/is2/README.md b/node_modules/property-path/node_modules/is2/README.md deleted file mode 100644 index d27505e..0000000 --- a/node_modules/property-path/node_modules/is2/README.md +++ /dev/null @@ -1,164 +0,0 @@ -is2 -=== -is2 is a type-checking module for JavaScript to test values. Is does not throw -exceptions and every function only returns true or false. Use is2 to validate -types in your node.js code. Every function in is2 returns either true of false. - -## Installation -To install is2, type: - - $ npm install is2 - -## Usage - - const is = require('is2'); - - console.log(`1===1 is: ${is.equal(true, 1===1)}`); - console.log(`10 is a positive number: ${is.positiveNumber(10)}`); - console.log(`11 is an odd number: ${is.oddNumber(11)}`); - -## API - -Each function returns true or false. The names after the '-' are aliases, which -provide brevity. - -Environment: - -* is.browser() -* is.defined(val) - is.def -* is.nodejs() - is.node() -* is.undefined(val) - is.udef, is.undef - -Types: - -* is.array(val) - is.ary, is.arry -* is.arrayLike(val) - is.arryLike, is.aryLike, is.arrLike -* is.arguments(val) - is.args -* is.boolean(val) - is.bool -* is.buffer(val) - is.buf, is.buff -* is.date(val) -* is.error(val) - is.err -* is.false(val) -* is.function(val) - is.funct, is.fun -* is.mongoId - is.objectId, is.objId -* is.null(val) -* is.nullOrUndefined(val) - is.nullOrUndef -* is.number(val) - is.num -* is.object(val) - is.obj -* is.regExp(val) - is.regexp, is.re -* is.string(val) - is.str -* is.true(val) -* is.uuid(val) - -Relationships: - -* is.equal(val, other) - is.eq, is.objEquals -* is.hosted(val, host) -* is.instanceOf(val, constructor) - is.instOf, is.instanceof -* is.matching(val1, val2 [, val3, ...]) - is.match : true if the first arument - is strictly equal to any of the subsequent args. -* is.objectInstanceof(obj, objType) - is.instOf, is.instanceOf, is.objInstOf, is.objectInstanceOf -* is.type(val, type) - is.a -* is.enumerator(val, array) - is.enum, is.inArray - -Object State: - -* is.empty(val) -* is.emptyArguments(val) - is.emptyArgs, is.noArgs -* is.emptyArray(val) - is.emptyArry, is.emptyAry, is.emptyArray -* is.emptyArrayLike(val) - is.emptyArrLike -* is.emptyString(val) - is.emptyStr -* is.nonEmptyArray(val) - is.nonEmptyArry, is.nonEmptyAry -* is.nonEmptyObject(val) - is.nonEmptyObj -* is.emptyObject(val) - is.emptyObj -* is.nonEmptyString(val) - is.nonEmptyStr - -Numeric Types within Number: - -* is.even(val) - is.evenNum, is.evenNumber -* is.decimal(val) - is.decNum, is.dec -* is.integer(val) - is.int -* is.notANumber(val) - is.nan, is.notANum -* is.odd(val) - is.oddNum, is.oddNumber - -Numeric Type and State: - -* is.positiveNumber(val) - is.pos, is.positive, is.posNum, is.positiveNum -* is.negativeNumber(val) - is.neg, is.negNum, is.negativeNum, is.negativeNumber -* is.negativeInteger(val) - is.negativeInt, is.negInt -* is.positiveInteger(val) - is.posInt, is.positiveInt - -Numeric Relationship: - -* is.divisibleBy(val, other) - is.divisBy, is.divBy -* is.greaterOrEqualTo(val, other) - is.ge, is.greaterOrEqual -* is.greaterThan(val, other) - is.gt -* is.lessThanOrEqualTo(val, other) - is.lessThanOrEq, is.lessThanOrEqual, is.le -* is.lessThan(val, other) - is.lt -* is.maximum(val, array) - is.max -* is.minimum(val, array) - is.min -* is.withIn(val, start, finish) - is.within -* is.prettyClose(val, comp, precision) - is.closish, is.near - -Networking: - -* is.dnsAddress(val) - is.dnsAddr, is.dns -* is.emailAddress(val) - is.email, is.emailAddr -* is.ipv4Address(val) - is.ipv4, is.ipv4Addr -* is.ipv6Address(val) - is.ipv6, is.ipv6Addr -* is.ipAddress(val) - is.ip, is.ipAddr -* is.hostAddress(val) - is.host = is.hostIp = is.hostAddr -* is.port(val) -* is.systemPort(val) - is.sysPort -* is.url(val) - is.uri -* is.userPort(val) - -Credit Cards: - -* is.creditCardNumber(str) - is.creditCard, is.creditCardNum -* is.americanExpressCardNumber(str) - is.amexCardNum, is.amexCard -* is.chinaUnionPayCardNumber(str) - is.chinaUnionPayCard, is.chinaUnion -* is.dankortCardNumber(str) - is.dankortCard, is.dankort -* is.dinersClubCarteBlancheCardNumber(str) - is.dinersClubCarteBlancheCard, - is.dinersClubCB -* is.dinersClubInternationalCardNumber(str) - is.dinersClubInternationalCard, - is.dinersClubInt -* is.dinersClubUSACanadaCardNumber(str) - is.dinersClubUSACanCard, is.dinersClub -* is.discoverCardNumber(str) - is.discoverCard, is.discover -* is.instaPaymentCardNumber(str) - is.instaPayment -* is.jcbCardNumber(str) - is.jcbCard, is.jcb -* is.laserCardNumber(str) - is.laserCard, is.laser -* is.maestroCardNumber(str) - is.maestroCard, is.maestro -* is.masterCardCardNumber - is.masterCardCard, is.masterCard -* is.visaCardNumber(str) - is.visaCard, is.visa -* is.visaElectronCardNumber(str) - is.visaElectronCard, is.visaElectron - -Personal information: - -* is.streetAddress(str) - is.street, is.address -* is.zipCode(str) - is.zip -* is.phoneNumber(str) - is.phone - - -## License -The MIT License (MIT) - -Copyright (c) 2013,2014 Edmond Meinfelder -Copyright (c) 2011 Enrico Marino - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/property-path/node_modules/is2/index.js b/node_modules/property-path/node_modules/is2/index.js deleted file mode 100644 index 626614f..0000000 --- a/node_modules/property-path/node_modules/is2/index.js +++ /dev/null @@ -1,1310 +0,0 @@ -/** - * @fileOverview - * is2 derived from is by Enrico Marino, adapted for Node.js. - * Slightly modified by Edmond Meinfelder - * - * is - * the definitive JavaScript type testing library - * Copyright(c) 2013,2014 Edmond Meinfelder - * Copyright(c) 2011 Enrico Marino - * MIT license - */ -'use strict'; -const owns = {}.hasOwnProperty; -const toString = {}.toString; -const is = exports; -const deepIs = require('deep-is'); -const ipRegEx = require('ip-regex'); -is.version = require('./package.json').version; - -//////////////////////////////////////////////////////////////////////////////// -// Environment - -/** - * Tests if is is running under a browser. - * @return {Boolean} true if the environment has process, process.version and process.versions. - */ -is.browser = function() { - return (!is.node() && typeof window !== 'undefined' && toString.call(window) === '[object global]'); -}; - -/** - * Test if 'value' is defined. - * Alias: def - * @param {Any} value The value to test. - * @return {Boolean} true if 'value' is defined, false otherwise. - */ -is.defined = function(value) { - return typeof value !== 'undefined'; -}; -is.def = is.defined; - -/** - * Tests if is is running under node.js - * @return {Boolean} true if the environment has process, process.version and process.versions. - */ -is.nodejs = function() { - return (process && process.hasOwnProperty('version') && - process.hasOwnProperty('versions')); -}; -is.node = is.nodejs; - -/** - * Test if 'value' is undefined. - * Aliases: undef, udef - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is undefined, false otherwise. - */ -is.undefined = function(value) { - return value === undefined; -}; -is.udef = is.undef = is.undefined; - - -//////////////////////////////////////////////////////////////////////////////// -// Types - -/** - * Test if 'value' is an array. - * Alias: ary, arry - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an array, false otherwise. - */ -is.array = function(value) { - return '[object Array]' === toString.call(value); -}; -is.arr = is.ary = is.arry = is.array; - -/** - * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value) - * Aliases: arraylike, arryLike, aryLike - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an arguments object, false otherwise. - */ -is.arrayLike = function(value) { - if (is.nullOrUndef(value)) - return false; - return value !== undefined && - owns.call(value, 'length') && - isFinite(value.length); -}; -is.arrLike = is.arryLike = is.aryLike = is.arraylike = is.arrayLike; - -/** - * Test if 'value' is an arguments object. - * Alias: args - * @param {Any} value value to test - * @return {Boolean} true if 'value' is an arguments object, false otherwise - */ -is.arguments = function(value) { - return '[object Arguments]' === toString.call(value); -}; -is.args = is.arguments; - -/** - * Test if 'value' is a boolean. - * Alias: bool - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a boolean, false otherwise. - */ -is.boolean = function(value) { - return '[object Boolean]' === toString.call(value); -}; -is.bool = is.boolean; - -/** - * Test if 'value' is an instance of Buffer. - * Aliases: instOf, instanceof - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an instance of 'constructor'. - */ -is.buffer = function(value) { - return is.nodejs() && Buffer && Buffer.hasOwnProperty('isBuffer') && Buffer.isBuffer(value); -}; -is.buff = is.buf = is.buffer; - -/** - * Test if 'value' is a date. - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a date, false otherwise. - */ -is.date = function(value) { - return '[object Date]' === toString.call(value); -}; - -/** - * Test if 'value' is an error object. - * Alias: err - * @param value value to test. - * @return {Boolean} true if 'value' is an error object, false otherwise. - */ -is.error = function(value) { - return '[object Error]' === toString.call(value); -}; -is.err = is.error; - -/** - * Test if 'value' is false. - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is false, false otherwise - */ -is.false = function(value) { - return value === false; -}; - -/** - * Test if 'value' is a function or async function. - * Alias: func - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a function, false otherwise. - */ -is.function = function(value) { - return is.syncFunction(value) || is.asyncFunction(value) -}; -is.fun = is.func = is.function; - -/** - * Test if 'value' is an async function using `async () => {}` or `async function () {}`. - * Alias: func - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a function, false otherwise. - */ -is.asyncFunction = function(value) { - return '[object AsyncFunction]' === toString.call(value); -} -is.asyncFun = is.asyncFunc = is.asyncFunction; - -/** - * Test if 'value' is a synchronous function. - * Alias: syncFunc - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a function, false otherwise. - */ -is.syncFunction = function (value) { - return '[object Function]' === toString.call(value); -} -is.syncFun = is.syncFunc = is.syncFunction -/** - * Test if 'value' is null. - * @param {Any} value to test. - * @return {Boolean} true if 'value' is null, false otherwise. - */ -is.null = function(value) { - return value === null; -}; - -/** - * Test is 'value' is either null or undefined. - * Alias: nullOrUndef - * @param {Any} value value to test. - * @return {Boolean} True if value is null or undefined, false otherwise. - */ -is.nullOrUndefined = function(value) { - return value === null || typeof value === 'undefined'; -}; -is.nullOrUndef = is.nullOrUndefined; - -/** - * Test if 'value' is a number. - * Alias: num - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a number, false otherwise. - */ -is.number = function(value) { - return '[object Number]' === toString.call(value); -}; -is.num = is.number; - -/** - * Test if 'value' is an object. Note: Arrays, RegExps, Date, Error, etc all return false. - * Alias: obj - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.object = function(value) { - return '[object Object]' === toString.call(value); -}; -is.obj = is.object; - -/** - * Test if 'value' is a regular expression. - * Alias: regexp - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a regexp, false otherwise. - */ -is.regExp = function(value) { - return '[object RegExp]' === toString.call(value); -}; -is.re = is.regexp = is.regExp; - -/** - * Test if 'value' is a string. - * Alias: str - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a string, false otherwise. - */ -is.string = function(value) { - return '[object String]' === toString.call(value); -}; -is.str = is.string; - -/** - * Test if 'value' is true. - * @param {Any} value to test. - * @return {Boolean} true if 'value' is true, false otherwise. - */ -is.true = function(value) { - return value === true; -}; - -/** - * Test if 'value' is a uuid (v1-v5) - * @param {Any} value to test. - * @return {Boolean} true if 'value is a valid RFC4122 UUID. Case non-specific. - */ -var uuidRegExp = new RegExp('[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab]'+ - '[0-9a-f]{3}-[0-9a-f]{12}', 'i'); -is.uuid = function(value) { - return uuidRegExp.test(value); -}; - -//////////////////////////////////////////////////////////////////////////////// -// Object Relationships - -/** - * Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions, - * using recursion. - * Alias: eq - * @param {Any} value value. - * @param {Any} other value to compare with. - * @return {Boolean} true if 'value' is equal to 'other', false otherwise - */ -is.equal = function(value, other) { - var type = toString.call(value); - - if (typeof value !== typeof other) { - return false; - } - - if (type !== toString.call(other)) { - return false; - } - - if ('[object Object]' === type || '[object Array]' === type) { - return deepIs(value, other); - } else if ('[object Function]' === type) { - return value.prototype === other.prototype; - } else if ('[object Date]' === type) { - return value.getTime() === other.getTime(); - } - - return value === other; -}; -is.objEquals = is.eq = is.equal; - -/** - * JS Type definitions which cannot host values. - * @api private - */ -var NON_HOST_TYPES = { - 'boolean': 1, - 'number': 1, - 'string': 1, - 'undefined': 1 -}; - -/** - * Test if 'key' in host is an object. To be hosted means host[value] is an object. - * @param {Any} value The value to test. - * @param {Any} host Host that may contain value. - * @return {Boolean} true if 'value' is hosted by 'host', false otherwise. - */ -is.hosted = function(value, host) { - if (is.nullOrUndef(value)) - return false; - var type = typeof host[value]; - return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type]; -}; - -/** - * Test if 'value' is an instance of 'constructor'. - * Aliases: instOf, instanceof - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an instance of 'constructor'. - */ -is.instanceOf = function(value, constructor) { - if (is.nullOrUndef(value) || is.nullOrUndef(constructor)) - return false; - return (value instanceof constructor); -}; -is.instOf = is.instanceof = is.instanceOf; - -/** - * Test if 'value' is an instance type objType. - * Aliases: objInstOf, objectinstanceof, instOf, instanceOf - * @param {object} objInst an object to testfor type. - * @param {object} objType an object type to compare. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.objectInstanceOf = function(objInst, objType) { - try { - return '[object Object]' === toString.call(objInst) && (objInst instanceof objType); - } catch(err) { - return false; - } -}; -is.instOf = is.instanceOf = is.objInstOf = is.objectInstanceOf; - -/** - * Test if 'value' is a type of 'type'. - * Alias: a - * @param value value to test. - * @param {String} type The name of the type. - * @return {Boolean} true if 'value' is an arguments object, false otherwise. - */ -is.type = function(value, type) { - return typeof value === type; -}; -is.a = is.type; - -//////////////////////////////////////////////////////////////////////////////// -// Object State - -/** - * Test if 'value' is empty. To be empty means to be an array, object or string with nothing contained. - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is empty, false otherwise. - */ -is.empty = function(value) { - var type = toString.call(value); - - if ('[object Array]' === type || '[object Arguments]' === type) { - return value.length === 0; - } - - if ('[object Object]' === type) { - for (var key in value) if (owns.call(value, key)) return false; - return true; - } - - if ('[object String]' === type) { - return value === ''; - } - - return false; -}; - -/** - * Test if 'value' is an arguments object that is empty. - * Alias: args - * @param {Any} value value to test - * @return {Boolean} true if 'value' is an arguments object with no args, false otherwise - */ -is.emptyArguments = function(value) { - return '[object Arguments]' === toString.call(value) && value.length === 0; -}; -is.noArgs = is.emptyArgs = is.emptyArguments; - -/** - * Test if 'value' is an array containing no entries. - * Aliases: emptyArry, emptyAry - * @param {Any} value The value to test. - * @return {Boolean} true if 'value' is an array with no elemnets. - */ -is.emptyArray = function(value) { - return '[object Array]' === toString.call(value) && value.length === 0; -}; -is.emptyArry = is.emptyAry = is.emptyArray; - -/** - * Test if 'value' is an empty array(like) object. - * Aliases: arguents.empty, args.empty, ary.empty, arry.empty - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is an empty array(like), false otherwise. - */ -is.emptyArrayLike = function(value) { - return value.length === 0; -}; -is.emptyArrLike = is.emptyArrayLike; - -/** - * Test if 'value' is an empty string. - * Alias: emptyStr - * @param {Any} value to test. - * @return {Boolean} true if 'value' is am empty string, false otherwise. - */ -is.emptyString = function(value) { - return is.string(value) && value.length === 0; -}; -is.emptyStr = is.emptyString; - -/** - * Test if 'value' is an array containing at least 1 entry. - * Aliases: nonEmptyArry, nonEmptyAry - * @param {Any} value The value to test. - * @return {Boolean} true if 'value' is an array with at least 1 value, false otherwise. - */ -is.nonEmptyArray = function(value) { - return '[object Array]' === toString.call(value) && value.length > 0; -}; -is.nonEmptyArr = is.nonEmptyArry = is.nonEmptyAry = is.nonEmptyArray; - -/** - * Test if 'value' is an object with properties. Note: Arrays are objects. - * Alias: nonEmptyObj - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.nonEmptyObject = function(value) { - return '[object Object]' === toString.call(value) && Object.keys(value).length > 0; -}; -is.nonEmptyObj = is.nonEmptyObject; - -/** - * Test if 'value' is an object with no properties. Note: Arrays are objects. - * Alias: nonEmptyObj - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an object, false otherwise. - */ -is.emptyObject = function(value) { - return '[object Object]' === toString.call(value) && Object.keys(value).length === 0; -}; -is.emptyObj = is.emptyObject; - -/** - * Test if 'value' is a non-empty string. - * Alias: nonEmptyStr - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a non-empty string, false otherwise. - */ -is.nonEmptyString = function(value) { - return is.string(value) && value.length > 0; -}; -is.nonEmptyStr = is.nonEmptyString; - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Types within Number - -/** - * Test if 'value' is an even number. - * @param {Number} value to test. - * @return {Boolean} true if 'value' is an even number, false otherwise. - */ -is.even = function(value) { - return '[object Number]' === toString.call(value) && value % 2 === 0; -}; - -/** - * Test if 'value' is a decimal number. - * Aliases: decimalNumber, decNum - * @param {Any} value value to test. - * @return {Boolean} true if 'value' is a decimal number, false otherwise. - */ -is.decimal = function(value) { - return '[object Number]' === toString.call(value) && value % 1 !== 0; -}; -is.dec = is.decNum = is.decimal; - -/** - * Test if 'value' is an integer. - * Alias: integer - * @param {Any} value to test. - * @return {Boolean} true if 'value' is an integer, false otherwise. - */ -is.integer = function(value) { - return '[object Number]' === toString.call(value) && value % 1 === 0; -}; -is.int = is.integer; - -/** - * is.nan - * Test if `value` is not a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is not a number, false otherwise - * @api public - */ -is.notANumber = function(value) { - return !is.num(value) || value !== value; -}; -is.nan = is.notANum = is.notANumber; - -/** - * Test if 'value' is an odd number. - * @param {Number} value to test. - * @return {Boolean} true if 'value' is an odd number, false otherwise. - */ -is.odd = function(value) { - return !is.decimal(value) && '[object Number]' === toString.call(value) && value % 2 !== 0; -}; -is.oddNumber = is.oddNum = is.odd; - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Type & State - -/** - * Test if 'value' is a positive number. - * Alias: positiveNum, posNum - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a number, false otherwise. - */ -is.positiveNumber = function(value) { - return '[object Number]' === toString.call(value) && value > 0; -}; -is.pos = is.positive = is.posNum = is.positiveNum = is.positiveNumber; - -/** - * Test if 'value' is a negative number. - * Aliases: negNum, negativeNum - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a number, false otherwise. - */ -is.negativeNumber = function(value) { - return '[object Number]' === toString.call(value) && value < 0; -}; -is.neg = is.negNum = is.negativeNum = is.negativeNumber; - -/** - * Test if 'value' is a negative integer. - * Aliases: negInt, negativeInteger - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a negative integer, false otherwise. - */ -is.negativeInteger = function(value) { - return '[object Number]' === toString.call(value) && value % 1 === 0 && value < 0; -}; -is.negativeInt = is.negInt = is.negativeInteger; - -/** - * Test if 'value' is a positive integer. - * Alias: posInt - * @param {Any} value to test. - * @return {Boolean} true if 'value' is a positive integer, false otherwise. - */ -is.positiveInteger = function(value) { - return '[object Number]' === toString.call(value) && value % 1 === 0 && value > 0; -}; -is.posInt = is.positiveInt = is.positiveInteger; - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Relationships - -/** - * Test if 'value' is divisible by 'n'. - * Alias: divisBy - * @param {Number} value value to test. - * @param {Number} n dividend. - * @return {Boolean} true if 'value' is divisible by 'n', false otherwise. - */ -is.divisibleBy = function(value, n) { - if (value === 0) - return false; - return '[object Number]' === toString.call(value) && - n !== 0 && - value % n === 0; -}; -is.divBy = is.divisBy = is.divisibleBy; - -/** - * Test if 'value' is greater than or equal to 'other'. - * Aliases: greaterOrEq, greaterOrEqual - * @param {Number} value value to test. - * @param {Number} other value to compare with. - * @return {Boolean} true, if value is greater than or equal to other, false otherwise. - */ -is.greaterOrEqualTo = function(value, other) { - return value >= other; -}; -is.greaterOrEqual = is.ge = is.greaterOrEqualTo; - -/** - * Test if 'value' is greater than 'other'. - * Aliases: greaterThan - * @param {Number} value value to test. - * @param {Number} other value to compare with. - * @return {Boolean} true, if value is greater than other, false otherwise. - */ -is.greaterThan = function(value, other) { - return value > other; -}; -is.gt = is.greaterThan; - -/** - * Test if 'value' is less than or equal to 'other'. - * Alias: lessThanOrEq, lessThanOrEqual - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} true, if 'value' is less than or equal to 'other', false otherwise. - */ -is.lessThanOrEqualTo = function(value, other) { - return value <= other; -}; -is.lessThanOrEq = is.lessThanOrEqual = is.le = is.lessThanOrEqualTo; - -/** - * Test if 'value' is less than 'other'. - * Alias: lessThan - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} true, if 'value' is less than 'other', false otherwise. - */ -is.lessThan = function(value, other) { - return value < other; -}; -is.lt = is.lessThan; - -/** - * Test if 'value' is greater than 'others' values. - * Alias: max - * @param {Number} value value to test. - * @param {Array} others values to compare with. - * @return {Boolean} true if 'value' is greater than 'others' values. - */ -is.maximum = function(value, others) { - if (!is.arrayLike(others) || !is.number(value)) - return false; - - var len = others.length; - while (--len > -1) { - if (value < others[len]) { - return false; - } - } - - return true; -}; -is.max = is.maximum; - -/** - * Test if 'value' is less than 'others' values. - * Alias: min - * @param {Number} value value to test. - * @param {Array} others values to compare with. - * @return {Boolean} true if 'value' is less than 'others' values. - */ -is.minimum = function(value, others) { - if (!is.arrayLike(others) || !is.number(value)) - return false; - - var len = others.length; - while (--len > -1) { - if (value > others[len]) { - return false; - } - } - - return true; -}; -is.min = is.minimum; - -/** - * Test if 'value' is within 'start' and 'finish'. - * Alias: withIn - * @param {Number} value value to test. - * @param {Number} start lower bound. - * @param {Number} finish upper bound. - * @return {Boolean} true if 'value' is is within 'start' and 'finish', false otherwise. - */ -is.within = function(value, start, finish) { - return value >= start && value <= finish; -}; -is.withIn = is.within; - -/** - * Test if 'value' is within 'precision' decimal places from 'comparitor'. - * Alias: closish, near. - * @param {Number} value value to test - * @param {Number} comparitor value to test 'value' against - * @param {Number} precision number of decimals to compare floating points, defaults to 2 - * @return {Boolean} true if 'value' is within 'precision' decimal places from 'comparitor', false otherwise. - */ -is.prettyClose = function(value, comparitor, precision) { - if (!is.number(value) || !is.number(comparitor)) return false; - if (is.defined(precision) && !is.posInt(precision)) return false; - if (is.undefined(precision)) precision = 2; - - return value.toFixed(precision) === comparitor.toFixed(precision); -}; -is.closish = is.near = is.prettyClose; -//////////////////////////////////////////////////////////////////////////////// -// Networking - -/** - * Test if a value is a valid DNS address. eg www.stdarg.com is true while - * 127.0.0.1 is false. - * @param {Any} value to test if a DNS address. - * @return {Boolean} true if a DNS address, false otherwise. - * DNS Address is made up of labels separated by '.' - * Each label must be between 1 and 63 characters long - * The entire hostname (including the delimiting dots) has a maximum of 255 characters. - * Hostname may not contain other characters, such as the underscore character (_) - * other DNS names may contain the underscore. - */ -is.dnsAddress = function(value) { - if (!is.nonEmptyStr(value)) return false; - if (value.length > 255) return false; - if (numbersLabel.test(value)) return false; - if (!dnsLabel.test(value)) return false; - return true; - //var names = value.split('.'); - //if (!is.array(names) || !names.length) return false; - //if (names[0].indexOf('_') > -1) return false; - //for (var i=0; i 15) return false; - var octets = value.split('.'); - if (!is.array(octets) || octets.length !== 4) return false; - for (var i=0; i 255) return false; - } - return true; -}; -is.ipv4 = is.ipv4Addr = is.ipv4Address; - -/** - * Test if a value is either an IPv6 numeric IP address. - * @param {Any} value to test if an ip address. - * @return {Boolean} true if an ip address, false otherwise. - */ -is.ipv6Address = function(value) { - if (!is.nonEmptyStr(value)) return false; - return ipRegEx.v6({extract: true}).test(value); -}; -is.ipv6 = is.ipv6Addr = is.ipv6Address; - -/** - * Test if a value is either an IPv4 or IPv6 numeric IP address. - * @param {Any} value to test if an ip address. - * @return {Boolean} true if an ip address, false otherwise. - */ -is.ipAddress = function(value) { - if (!is.nonEmptyStr(value)) return false; - return is.ipv4Address(value) || is.ipv6Address(value) -}; -is.ip = is.ipAddr = is.ipAddress; - -/** - * Test is a value is a valid ipv4, ipv6 or DNS name. - * Aliases: host, hostAddr, hostAddress. - * @param {Any} value to test if a host address. - * @return {Boolean} true if a host address, false otherwise. - */ -is.hostAddress = function(value) { - if (!is.nonEmptyStr(value)) return false; - return is.dns(value) || is.ipv4(value) || is.ipv6(value); -}; -is.host = is.hostIp = is.hostAddr = is.hostAddress; - -/** - * Test if a number is a valid TCP port - * @param {Any} value to test if its a valid TCP port - */ -is.port = function(value) { - if (!is.num(value) || is.negativeInt(value) || value > 65535) - return false; - return true; -}; - -/** - * Test if a number is a valid TCP port in the range 0-1023. - * Alias: is.sysPort. - * @param {Any} value to test if its a valid TCP port - */ -is.systemPort = function(value) { - if (is.port(value) && value < 1024) - return true; - return false; -}; -is.sysPort = is.systemPort; - -/** - * Test if a number is a valid TCP port in the range 1024-65535. - * @param {Any} value to test if its a valid TCP port - */ -is.userPort = function(value) { - if (is.port(value) && value > 1023) - return true; - return false; -}; - -/* -function sumDigits(num) { - var str = num.toString(); - var sum = 0; - for (var i = 0; i < str.length; i++) - sum += (str[i]-0); - return sum; -} -*/ - -/** - * Test if a string is a credit card. - * From http://en.wikipedia.org/wiki/Luhn_algorithm - * @param {String} value to test if a credit card. - * @return true if the string is the correct format, false otherwise - */ -is.creditCardNumber = function(str) { - if (!is.str(str)) - return false; - - var ary = str.split(''); - var i, cnt; - // From the rightmost digit, which is the check digit, moving left, double - // the value of every second digit; - for (i=ary.length-1, cnt=1; i>-1; i--, cnt++) { - if (cnt%2 === 0) - ary[i] *= 2; - } - - str = ary.join(''); - var sum = 0; - // if the product of the previous doubling operation is greater than 9 - // (e.g., 7 * 2 = 14), then sum the digits of the products (e.g., 10: 1 + 0 - // = 1, 14: 1 + 4 = 5). We do the this by joining the array of numbers and - // add adding the int value of all the characters in the string. - for (i=0; i 19)) - return false; - - var prefix = Math.floor(str.slice(0,2)); - if (prefix !== 62 && prefix !== 88) - return false; - - // no validation for this card - return true; -}; -is.chinaUnion = is.chinaUnionPayCard = is.chinaUnionPayCardNumber; - -/** - * Test if card number is a Diner's Club Carte Blance card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dinersClubCarteBlancheCardNumber = function(str) { - if (!is.str(str) || str.length !== 14) - return false; - - var prefix = Math.floor(str.slice(0,3)); - if (prefix < 300 || prefix > 305) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dinersClubCB = is.dinersClubCarteBlancheCard = - is.dinersClubCarteBlancheCardNumber; - -/** - * Test if card number is a Diner's Club International card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dinersClubInternationalCardNumber = function(str) { - if (!is.str(str) || str.length !== 14) - return false; - var prefix = Math.floor(str.slice(0,3)); - var prefix2 = Math.floor(str.slice(0,2)); - - // 300-305, 309, 36, 38-39 - if ((prefix < 300 || prefix > 305) && prefix !== 309 && prefix2 !== 36 && - (prefix2 < 38 || prefix2 > 39)) { - return false; - } - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dinersClubInt = is.dinersClubInternationalCard = - is.dinersClubInternationalCardNumber; - -/** - * Test if card number is a Diner's Club USA & CA card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dinersClubUSACanadaCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - var prefix = Math.floor(str.slice(0,2)); - - if (prefix !== 54 && prefix !== 55) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dinersClub = is.dinersClubUSACanCard = is.dinersClubUSACanadaCardNumber; - -/** - * Test if card number is a Diner's Club USA/CA card. - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.discoverCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,6)); - var prefix2 = Math.floor(str.slice(0,3)); - - if (str.slice(0,4) !== '6011' && (prefix < 622126 || prefix > 622925) && - (prefix2 < 644 || prefix2 > 649) && str.slice(0,2) !== '65') { - return false; - } - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.discover = is.discoverCard = is.discoverCardNumber; - -/** - * Test if card number is an InstaPayment card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.instaPaymentCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,3)); - if (prefix < 637 || prefix > 639) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.instaPayment = is.instaPaymentCardNumber; - -/** - * Test if card number is a JCB card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.jcbCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,4)); - if (prefix < 3528 || prefix > 3589) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.jcb = is.jcbCard = is.jcbCardNumber; - -/** - * Test if card number is a Laser card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.laserCardNumber = function(str) { - if (!is.str(str) || (str.length < 16 && str.length > 19)) - return false; - - var prefix = Math.floor(str.slice(0,4)); - var valid = [ 6304, 6706, 6771, 6709 ]; - if (valid.indexOf(prefix) === -1) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.laser = is.laserCard = is.laserCardNumber; - -/** - * Test if card number is a Maestro card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.maestroCardNumber = function(str) { - if (!is.str(str) || str.length < 12 || str.length > 19) - return false; - - var prefix = str.slice(0,4); - var valid = [ '5018', '5020', '5038', '5612', '5893', '6304', '6759', - '6761', '6762', '6763', '0604', '6390' ]; - - if (valid.indexOf(prefix) === -1) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.maestro = is.maestroCard = is.maestroCardNumber; - -/** - * Test if card number is a Dankort card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.dankortCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - if (str.slice(0,4) !== '5019') - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.dankort = is.dankortCard = is.dankortCardNumber; - -/** - * Test if card number is a MasterCard card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.masterCardCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,2)); - if (prefix < 50 || prefix > 55) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; -is.masterCard = is.masterCardCard = is.masterCardCardNumber; - -/** - * Test if card number is a Visa card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.visaCardNumber = function(str) { - if (!is.str(str) || (str.length !== 13 && str.length !== 16)) - return false; - - if ('4' !== str.slice(0,1)) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return true; -}; - -is.visa = is.visaCard = is.visaCardNumber; - -/** - * Test if card number is a Visa card number - * @param {String} the credit card number string to test. - * @return true if the string is the correct format, false otherwise - */ -is.visaElectronCardNumber = function(str) { - if (!is.str(str) || str.length !== 16) - return false; - - var prefix = Math.floor(str.slice(0,4)); - var valid = [ 4026, 4405, 4508, 4844, 4913, 4917 ]; - if ('417500' !== str.slice(0,6) && valid.indexOf(prefix) === -1) - return false; - - if (!is.creditCardNumber(str)) - return false; - - return false; -}; - -is.visaElectron = is.visaElectronCard = is.visaElectronCardNumber; - -/** - * Test if the input is a valid MongoDB id. - * @param {String|Object} Either a mongodb object id or a string representation. - * @return true if the string is the correct format, false otherwise - * Thanks to Jason Denizac (https://github.com/jden) for pointing this out. - * https://github.com/jden/objectid/blob/master/index.js#L7-L10 - */ -var objIdPattern = /^[0-9a-fA-F]{24}$/; -is.mongoId = is.objectId = is.objId = function(id) { - return (Boolean(id) && !Array.isArray(id) && objIdPattern.test(String(id))); -}; - -/** - * Test is the first argument is structly equal to any of the subsequent args. - * @param Value to test against subsequent arguments. - * @return true if the first value matches any of subsequent values. - */ -is.matching = is.match = is.inArgs = function(val) { - if (arguments.length < 2) - return false; - var result = false; - for (var i=1; i", - "maintainers": "Edmond Meinfelder , Chris Oyler ", - "homepage": "http://github.com/stdarg/is2", - "repository": { - "type": "git", - "url": "git@github.com:stdarg/is2.git" - }, - "bugs": { - "url": "http://github.com/stdarg/is/issues" - }, - "main": "./index.js", - "scripts": { - "test": "./node_modules/.bin/mocha -C --reporter list tests.js" - }, - "engines": { - "node": ">=v0.10.0" - }, - "dependencies": { - "deep-is": "^0.1.3", - "ip-regex": "^2.1.0", - "is-url": "^1.2.2" - }, - "devDependencies": { - "jsdom": "0.5.0", - "mocha": "5.0.1", - "mongodb": "3.0.2" - } -} diff --git a/node_modules/property-path/node_modules/is2/tests.js b/node_modules/property-path/node_modules/is2/tests.js deleted file mode 100644 index 5857390..0000000 --- a/node_modules/property-path/node_modules/is2/tests.js +++ /dev/null @@ -1,1570 +0,0 @@ -'use strict'; -var assert = require('assert'); -var is = require('./index'); - -// Environment -describe('is.browser()', function() { - it('should return true if window is defined and is an object', function() { - var expected = false; - if (typeof window !== 'undefined' && toString.call(window) === '[object global]') { - expected = true; - } else { - expected = false; - } - assert.ok(expected === is.browser()); - }); -}); - -describe('is.defined()', function() { - it('should return true if value is not undefined', function() { - var val1; - assert.equal(false, is.defined(val1)); - assert.equal(true, is.defined(false)); - assert.equal(false, is.def(val1)); - assert.equal(true, is.def(false)); - }); -}); - -describe('is.nodejs()', function() { - it('should return true if process, process.version & process.versions is defined', function() { - var expected; - if (process && process.hasOwnProperty('version') && - process.hasOwnProperty('versions')) { - expected = true; - } else { - expected = false; - } - assert.ok(expected, is.nodejs()); - assert.ok(expected, is.node()); - }); -}); - -describe('is.undefined', function() { - it('should return true if value is undefined', function() { - assert.equal(true, is.undefined(undefined)); - assert.equal(false, is.undefined(null)); - assert.equal(false, is.undefined(false)); - assert.equal(true, is.undefined()); - assert.equal(true, is.undef(undefined)); - assert.equal(false, is.undef(null)); - assert.equal(false, is.undef(false)); - assert.equal(true, is.undef()); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Types - -describe('is.array', function() { - it('should return true if value is an array', function() { - assert.equal(false, is.array(false)); - assert.equal(true, is.array([1,2,3])); - assert.equal(false, is.array(arguments)); - assert.equal(false, is.array({1: 'a', 2: 'b'})); - assert.equal(false, is.ary({1: 'a', 2: 'b'})); - assert.equal(false, is.arry({1: 'a', 2: 'b'})); - assert.equal(false, is.arr({1: 'a', 2: 'b'})); - }); -}); - -describe('is.arrayLike', function() { - it('should return true if value is an array-like object', function() { - assert.equal(false, is.arrayLike(false)); - assert.equal(false, is.arrayLike(1)); - assert.equal(false, is.arrayLike(new Date())); - assert.equal(false, is.arrayLike(new Error())); - - var f = function(arg1, arg2) { - assert.equal(true, is.arrayLike(arguments)); - }; - f('test1', false); - - assert.equal(true, is.arrayLike(arguments)); - assert.equal(true, is.arrayLike([])); - assert.equal(true, is.arrayLike([1])); - assert.equal(true, is.arrayLike([1,2])); - assert.equal(false, is.arrayLike({})); - assert.equal(false, is.arrayLike({a:1})); - assert.equal(false, is.arrayLike({a:1,b:2})); - assert.equal(false, is.arrLike({a:1,b:2})); - assert.equal(false, is.arryLike({a:1,b:2})); - assert.equal(false, is.aryLike({a:1,b:2})); - assert.equal(false, is.arraylike({a:1,b:2})); - }); -}); - -describe('is.arguments', function() { - it('should return true if value is an arguments object', function() { - assert.equal(true, is.arguments(arguments)); - assert.equal(false, is.arguments(['1', '2', '3', false])); - assert.equal(false, is.args(['1', '2', '3', false])); - }); -}); - -describe('is.boolean', function() { - it('should return true if value is a boolean value', function() { - assert.equal(true, is.boolean(true)); - assert.equal(true, is.boolean(false)); - assert.equal(false, is.boolean({})); - assert.equal(false, is.boolean('bool')); - assert.equal(true, is.bool(true)); - }); -}); - -describe('is.buffer', function() { - it('should return true if value ', function() { - assert.equal(false, is.buffer()); - assert.equal(false, is.buffer(null)); - assert.equal(false, is.buffer('')); - assert.equal(false, is.buffer(8)); - assert.equal(false, is.buffer(new Date())); - assert.equal(false, is.buffer(new Error())); - assert.equal(false, is.buffer(true)); - assert.equal(false, is.buffer(new RegExp('e'))); - assert.equal(true, is.buffer(new Buffer('heya'))); - assert.equal(false, is.buffer('')); - assert.equal(false, is.buffer(String(''))); - assert.equal(true, is.buffer(new Buffer(23))); - assert.equal(true, is.buf(new Buffer(23))); - assert.equal(true, is.buff(new Buffer(23))); - }); -}); - -describe('is.date', function() { - it('should return true if value is a date object', function() { - assert.equal(false, is.date()); - assert.equal(false, is.date(false)); - assert.equal(false, is.date({})); - assert.equal(false, is.date(new Error())); - assert.equal(true, is.date(new Date())); - assert.equal(false, is.date([])); - }); -}); - -describe('is.error', function() { - it('should return true if value is an error object', function() { - assert.equal(false, is.error()); - assert.equal(false, is.error(1)); - assert.equal(false, is.error([])); - assert.equal(false, is.error([1])); - assert.equal(false, is.error([1,2])); - assert.equal(false, is.error({a:1})); - assert.equal(false, is.error({a:1,b:2})); - assert.equal(false, is.error({a:1,b:2,c:3})); - assert.equal(false, is.error(false)); - assert.equal(false, is.error(null)); - assert.equal(false, is.error('error')); - assert.equal(false, is.error(new Date())); - assert.equal(true, is.error(new Error())); - assert.equal(true, is.err(new Error())); - }); -}); - -describe('is.false', function() { - it('should return true if value is false', function() { - assert.equal(false, is.false(1)); - assert.equal(false, is.false(null)); - assert.equal(false, is.false()); - assert.equal(false, is.false('Hello')); - assert.equal(false, is.false([])); - assert.equal(false, is.false({})); - assert.equal(false, is.false(true)); - assert.equal(true, is.false(false)); - assert.equal(true, is.false(1!==1)); - assert.equal(false, is.false(1===1)); - }); -}); - -describe('is.function', function() { - it('should return true if value is a function', function() { - assert.equal(false, is.function()); - assert.equal(false, is.function('a')); - assert.equal(false, is.function(1)); - assert.equal(false, is.function(true)); - assert.equal(false, is.function(null)); - assert.equal(false, is.function(false)); - assert.equal(false, is.function({})); - assert.equal(false, is.function({a:1})); - assert.equal(false, is.function({a:1,b:2})); - assert.equal(false, is.function([])); - assert.equal(false, is.function([1])); - assert.equal(false, is.function([1,2])); - assert.equal(false, is.function(new Error())); - assert.equal(false, is.function(new Date())); - - var f = function() { var a = 1; a++; }; - var fa = () => { let a = 1; a++; }; - var a = async () => Promise.resolve(true); - var af = async function() { await Promise.resolve(true); }; - assert.equal(true, is.function(f)); - assert.equal(true, is.fun(f)); - assert.equal(true, is.func(f)); - assert.equal(true, is.function(fa)); - assert.equal(true, is.fun(fa)); - assert.equal(true, is.func(fa)); - assert.equal(true, is.function(a)); - assert.equal(true, is.fun(a)); - assert.equal(true, is.func(a)); - assert.equal(true, is.function(af)); - assert.equal(true, is.fun(af)); - assert.equal(true, is.func(af)); - }); -}); - -describe('is.syncFunction', function() { - it('should return true if the value is a synchronous function', () => { - var a = async () => Promise.resolve(true); - var af = async function() { await Promise.resolve(true); }; - assert.equal(false, is.syncFunction(a)); - assert.equal(false, is.syncFunction(af)); - assert.equal(false, is.syncFunction()); - assert.equal(false, is.syncFunction('a')); - assert.equal(false, is.syncFunction(1)); - assert.equal(false, is.syncFunction(true)); - assert.equal(false, is.syncFunction(null)); - assert.equal(false, is.syncFunction(false)); - assert.equal(false, is.syncFunction({})); - assert.equal(false, is.syncFunction({a:1})); - assert.equal(false, is.syncFunction({a:1,b:2})); - assert.equal(false, is.syncFunction([])); - assert.equal(false, is.syncFunction([1])); - assert.equal(false, is.syncFunction([1,2])); - assert.equal(false, is.syncFunction(new Error())); - assert.equal(false, is.syncFunction(new Date())); - - var f = function() { var a = 1; a++; }; - var fa = () => { let a = 1; a++; }; - - assert.equal(true, is.syncFunction(f)); - assert.equal(true, is.syncFunc(f)); - assert.equal(true, is.syncFun(f)); - assert.equal(true, is.syncFunction(fa)); - assert.equal(true, is.syncFunc(fa)); - assert.equal(true, is.syncFun(fa)); - - }); -}); -describe('is.asyncFunction', function() { - it('should return true if the value is an asynchronous function', () => { - var f = function() { var a = 1; a++; }; - var fa = () => { let a = 1; a++; }; - assert.equal(false, is.asyncFunction(f)); - assert.equal(false, is.asyncFunction(fa)); - assert.equal(false, is.asyncFunction()); - assert.equal(false, is.asyncFunction('a')); - assert.equal(false, is.asyncFunction(1)); - assert.equal(false, is.asyncFunction(true)); - assert.equal(false, is.asyncFunction(null)); - assert.equal(false, is.asyncFunction(false)); - assert.equal(false, is.asyncFunction({})); - assert.equal(false, is.asyncFunction({a:1})); - assert.equal(false, is.asyncFunction({a:1,b:2})); - assert.equal(false, is.asyncFunction([])); - assert.equal(false, is.asyncFunction([1])); - assert.equal(false, is.asyncFunction([1,2])); - assert.equal(false, is.asyncFunction(new Error())); - assert.equal(false, is.asyncFunction(new Date())); - - var a = async () => Promise.resolve(true); - var af = async function() { await Promise.resolve(true); }; - - - assert.equal(true, is.asyncFunction(a)); - assert.equal(true, is.asyncFunc(a)); - assert.equal(true, is.asyncFun(a)); - assert.equal(true, is.asyncFunction(af)); - assert.equal(true, is.asyncFunc(af)); - assert.equal(true, is.asyncFun(af)); - }); -}); - -describe('is.null', function() { - it('should return true if value is null', function() { - assert.equal(false, is.null(undefined)); - assert.equal(true, is.null(null)); - }); -}); - -describe('is.nullOrUndefined', function() { - it('should return true if the value is either null or undefined', function () { - assert.equal(true, is.nullOrUndefined(null)); - assert.equal(true, is.nullOrUndefined(undefined)); - assert.equal(false, is.nullOrUndefined(true)); - assert.equal(true, is.nullOrUndef(null)); - assert.equal(true, is.nullOrUndef(undefined)); - assert.equal(false, is.nullOrUndef(true)); - }); -}); - -describe('is.number', function() { - it('should return true if value is a number', function() { - assert.equal(false, is.number(false)); - assert.equal(false, is.number({})); - assert.equal(false, is.number([])); - assert.equal(false, is.number(new Error())); - assert.equal(false, is.number(new Date())); - assert.equal(false, is.number('hiya')); - assert.equal(false, is.number(true)); - assert.equal(false, is.number()); - assert.equal(false, is.number(null)); - assert.equal(true, is.number(1)); - assert.equal(true, is.number(0)); - assert.equal(true, is.number(1.0000001)); - assert.equal(true, is.number(-1.0000001)); - assert.equal(true, is.number(-0)); - assert.equal(true, is.number(2/0)); - assert.equal(true, is.number(0/2)); - assert.equal(true, is.num(0/2)); - }); -}); - -describe('is.object', function() { - it('should return true if value is an object', function() { - assert.equal(false, is.object(null)); - assert.equal(false, is.object(3)); - assert.equal(false, is.object(false)); - assert.equal(false, is.object(true)); - assert.equal(false, is.object(0)); - assert.equal(false, is.object('Hello')); - assert.equal(false, is.object([])); - assert.equal(true, is.object({})); - assert.equal(false, is.object(new Error())); - assert.equal(false, is.object(new Date())); - assert.equal(true, is.obj({})); - }); -}); - -describe('is.regExp', function() { - it('should return true if value is a regular expression', function() { - assert.equal(false, is.regExp(null)); - assert.equal(false, is.regExp(false)); - assert.equal(false, is.regExp(778)); - assert.equal(false, is.regExp([])); - assert.equal(false, is.regExp({})); - assert.equal(false, is.regExp('heya')); - assert.equal(true, is.regExp(/is/g)); - assert.equal(true, is.regExp(new RegExp('e'))); - assert.equal(true, is.regexp(new RegExp('e'))); - assert.equal(true, is.re(new RegExp('e'))); - }); -}); - -describe('is.string', function() { - it('should return true if value is a string', function() { - assert.equal(false, is.string(null)); - assert.equal(false, is.string(false)); - assert.equal(false, is.string({})); - assert.equal(false, is.string([])); - assert.equal(false, is.string(9908)); - assert.equal(false, is.string(new RegExp('e'))); - assert.equal(false, is.string(new Date())); - assert.equal(false, is.string(new Error())); - assert.equal(true, is.string('hello')); - assert.equal(true, is.string('')); - assert.equal(true, is.string(String('cow'))); - assert.equal(true, is.str(String('cow'))); - }); -}); - -describe('is.true', function() { - it('should return true if value is true', function() { - assert.equal(false, is.true(1)); - assert.equal(false, is.true(null)); - assert.equal(false, is.true()); - assert.equal(false, is.true('Hello')); - assert.equal(false, is.true([])); - assert.equal(false, is.true({})); - assert.equal(true, is.true(true)); - assert.equal(false, is.true(false)); - assert.equal(false, is.true(1!==1)); - assert.equal(true, is.true(1===1)); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Object Relationships - -describe('is.equal', function() { - it('should return true if value is the same as value1', function() { - assert.equal(true, is.equal(true, true)); - assert.equal(true, is.equal(1, 1)); - assert.equal(true, is.equal('1', '1')); - assert.equal(true, is.equal(['1'], ['1'])); - assert.equal(true, is.equal({a: '1'}, {a: '1'})); - assert.equal(true, is.equal({a: '1', c: {b: true}}, {a: '1', c: {b: true}})); - - assert.equal(false, is.equal(true, false)); - assert.equal(false, is.equal(1, 0)); - assert.equal(false, is.equal('1', '2')); - assert.equal(false, is.equal(['1'], ['0'])); - assert.equal(false, is.equal({a: '1'}, {a: '2'})); - assert.equal(true, is.equal({a: false}, {a: false})); - assert.equal(false, is.equal({a: '1', c: {b: true}}, {a: '1', c: {b: false}})); - assert.equal(true, is.eq({a: false}, {a: false})); - assert.equal(true, is.objEquals({a: false}, {a: false})); - }); -}); - -describe('is.hosted', function() { - it('should return true if value1 is hosted in value2', function() { - assert.equal(false, is.hosted(true, [false, true])); - assert.equal(false, is.hosted(true, [true, true])); - assert.equal(false, is.hosted('a', [false, true, 'a'])); - assert.equal(false, is.hosted('b', [ false, true, 'a'] )); - assert.equal(true, is.hosted(0, [{}, 2, 3])); - assert.equal(true, is.hosted('a', { a: {} } )); - assert.equal(false, is.hosted('b', 'This be a string')); - assert.equal(false, is.hosted('x', 'This be a string')); - assert.equal(true, is.hosted('x', { x: []})); - assert.equal(true, is.hosted('x', { x: {}})); - assert.equal(false, is.hosted('x', { x: true})); - }); -}); - -describe('is.objectInstanceOf', function() { - it('should return true if value is an instance of constructor', function() { - function Circle() { - this.raidius = 3; - this.area = 4; - } - function Polygon() { - this.edges = 8; // octogons are the default - this.regular = false; // sides needn't be all the same - this.area = 1; - } - - function Rectangle(top_len, side_len) { - this.edges = 4; - this.top = top_len; - this.side = side_len; - this.area = top_len*side_len; - } - Rectangle.prototype = new Polygon(); - var box = new Rectangle(8,3); - - assert.equal(true, is.objectInstanceOf(box, Rectangle)); - assert.equal(true, is.objectInstanceOf(box, Polygon)); - assert.equal(false, is.objectInstanceOf(box, Circle)); - assert.equal(false, is.objectInstanceOf(box, undefined)); - assert.equal(true, is.instanceOf(box, Rectangle)); - assert.equal(true, is.instOf(box, Rectangle)); - assert.equal(true, is.objInstOf(box, Rectangle)); - }); -}); - -describe('is.type()', function() { - it('should return true if value is equal to string type', function() { - // is.a is an alias - assert.equal(true, is.a('This is a test', 'string')); - assert.equal(false, is.a('This is also a test', 'number')); - - assert.equal(true, is.type('This is a test', 'string')); - assert.equal(false, is.type('This is also a test', 'number')); - assert.equal(true, is.a('This is a test', 'string')); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Object State - -describe('is.empty', function() { - it('should return true if the value is a string, array or object and contains nothing', function() { - assert.equal(true, is.empty('')); - assert.equal(true, is.empty({})); - assert.equal(true, is.empty([])); - assert.equal(false, is.empty('a')); - assert.equal(false, is.empty({a: true})); - assert.equal(false, is.empty(['a'])); - assert.equal(false, is.empty(false)); - assert.equal(false, is.empty(0)); - assert.equal(false, is.empty(function() {})); - }); -}); - -describe('is.emptyArray', function() { - it('should return true if value is a non-empty array', function() { - assert.equal(true, is.emptyArray([])); - assert.equal(false, is.emptyArray({})); - assert.equal(false, is.emptyArray({a:1})); - assert.equal(false, is.emptyArray([1])); - assert.equal(false, is.emptyArray([1,2])); - assert.equal(false, is.emptyArray([1,2,3])); - }); -}); - -describe('is.emptyArrayLike', function() { - it('should return true if array-like has length == 0', function() { - assert.equal(true, is.emptyArrayLike([])); - assert.equal(true, is.emptyArrayLike('')); - assert.equal(true, is.emptyArrLike('')); - assert.equal(false, is.emptyArrayLike([1])); - assert.equal(false, is.emptyArrayLike('a')); - }); -}); - -describe('is.emptyString', function() { - it('should return true if string has length == 0', function() { - assert.equal(true, is.emptyString('')); - assert.equal(true, is.emptyStr('')); - assert.equal(false, is.emptyStr()); - assert.equal(false, is.emptyStr(false)); - assert.equal(false, is.emptyStr([])); - }); -}); - -describe('is.nonEmptyArray', function() { - it('should return true if value is a non-empty array', function() { - assert.equal(false, is.nonEmptyArray([])); - assert.equal(false, is.nonEmptyArray({})); - assert.equal(false, is.nonEmptyArray({a:1})); - assert.equal(true, is.nonEmptyArray([1])); - assert.equal(true, is.nonEmptyArray([1,2])); - assert.equal(true, is.nonEmptyArray([1,2,3])); - assert.equal(true, is.nonEmptyArry([1,2,3])); - assert.equal(true, is.nonEmptyArr([1,2,3])); - assert.equal(true, is.nonEmptyAry([1,2,3])); - }); -}); - -describe('is.nonEmptyObject', function() { - it('should return true if value is an object with at least 1 property', function() { - assert.equal(false, is.nonEmptyObject()); - assert.equal(false, is.nonEmptyObject(null)); - assert.equal(false, is.nonEmptyObject(7)); - assert.equal(false, is.nonEmptyObject(false)); - assert.equal(false, is.nonEmptyObject('Hello')); - assert.equal(false, is.nonEmptyObject(new Error())); - assert.equal(false, is.nonEmptyObject(new Date())); - assert.equal(false, is.nonEmptyObject({})); - assert.equal(true, is.nonEmptyObject({a:1})); - assert.equal(true, is.nonEmptyObj({a:1})); - }); -}); - -describe('is.nonEmptyString', function() { - it('should return true if value ', function() { - assert.equal(false, is.nonEmptyStr()); - assert.equal(false, is.nonEmptyStr(null)); - assert.equal(false, is.nonEmptyStr(false)); - assert.equal(false, is.nonEmptyStr(8)); - assert.equal(false, is.nonEmptyStr(new Date())); - assert.equal(false, is.nonEmptyStr(new Error())); - assert.equal(false, is.nonEmptyStr(true)); - assert.equal(false, is.nonEmptyStr(new RegExp('e'))); - assert.equal(true, is.nonEmptyStr('heya')); - assert.equal(false, is.nonEmptyStr('')); - assert.equal(false, is.nonEmptyStr(String(''))); - assert.equal(true, is.nonEmptyStr(String('a'))); - assert.equal(true, is.nonEmptyString('a')); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Types within Number - -describe('is.even', function() { - it('should return true if value is an even integer', function() { - assert.equal(false, is.even(null)); - assert.equal(false, is.even()); - assert.equal(false, is.even(new Date())); - assert.equal(false, is.even('hello')); - assert.equal(false, is.even(new Error())); - assert.equal(false, is.even({})); - assert.equal(false, is.even([])); - assert.equal(false, is.even(23.000001)); - assert.equal(false, is.even(-2.000001)); - assert.equal(false, is.even(1)); - assert.equal(false, is.even(3)); - assert.equal(true, is.even(4)); - assert.equal(true, is.even(2)); - assert.equal(true, is.even(0)); - assert.equal(true, is.even(-2)); - assert.equal(true, is.even(10000)); - }); -}); - -describe('is.decimal', function() { - it('should return true if value is a decimal number (has a fractional value).', function() { - assert.equal(false, is.decimal(null)); - assert.equal(false, is.decimal()); - assert.equal(false, is.decimal(false)); - assert.equal(false, is.decimal(true)); - assert.equal(false, is.decimal(1)); - assert.equal(false, is.decimal(-1)); - assert.equal(false, is.decimal(0)); - assert.equal(false, is.decimal(10)); - assert.equal(false, is.decimal(new Date())); - assert.equal(false, is.decimal(new Error())); - assert.equal(true, is.decimal(1.1)); - assert.equal(true, is.decimal(-1.1)); - assert.equal(true, is.decimal(0.000001)); - assert.equal(true, is.decimal(-0.000001)); - assert.equal(true, is.decimal(20.00002)); - assert.equal(true, is.decimal(-20.00002)); - assert.equal(true, is.decNum(-20.00002)); - assert.equal(true, is.dec(-20.00002)); - }); -}); - -describe('is.integer', function() { - it('should return true if value is an integer', function() { - assert.equal(false, is.integer(null)); - assert.equal(false, is.integer()); - assert.equal(false, is.integer('hello')); - assert.equal(false, is.integer([])); - assert.equal(false, is.integer({})); - assert.equal(false, is.integer(new Error())); - assert.equal(false, is.integer(new Date())); - assert.equal(false, is.integer(false)); - assert.equal(false, is.integer(1.1)); - assert.equal(false, is.integer(0.1)); - assert.equal(false, is.integer(-0.0000001)); - assert.equal(false, is.integer(10000000.1)); - assert.equal(true, is.integer(0)); - assert.equal(true, is.integer(10)); - assert.equal(true, is.integer(-2)); - assert.equal(true, is.integer(-77)); - assert.equal(true, is.int(-77)); - }); -}); - -describe('is.notANumber', function() { - it('should return true if value is not a number', function() { - assert.equal(true, is.nan(null)); - assert.equal(true, is.nan(undefined)); - assert.equal(true, is.nan(true)); - assert.equal(true, is.nan(false)); - assert.equal(false, is.nan(37)); - assert.equal(true, is.nan('37')); - assert.equal(true, is.nan('37.37')); - assert.equal(true, is.nan(' ')); - assert.equal(true, is.nan('')); // false converted to 0 - assert.equal(true, is.nan('blabla')); - assert.equal(true, is.nan(NaN)); - assert.equal(true, is.notANumber(NaN)); - assert.equal(true, is.notANum(NaN)); - }); -}); - -describe('is.odd', function() { - it('should return true if value is an odd integer', function() { - assert.equal(false, is.odd(null)); - assert.equal(false, is.odd()); - assert.equal(false, is.odd(new Date())); - assert.equal(false, is.odd('hello')); - assert.equal(false, is.odd(new Error())); - assert.equal(false, is.odd({})); - assert.equal(false, is.odd([])); - assert.equal(false, is.odd(23.000001)); - assert.equal(false, is.odd(-2.000001)); - assert.equal(false, is.odd(0)); - assert.equal(false, is.odd(2)); - assert.equal(true, is.odd(3)); - assert.equal(true, is.odd(1)); - assert.equal(true, is.odd(-1)); - assert.equal(true, is.odd(-3)); - assert.equal(true, is.odd(10001)); - }); -}); - -//////////////////////////////////////////////////////////////////////////////// -// Numeric Type & State - -describe('is.positiveNumber', function() { - it('should return true if value is a positive number', function() { - assert.equal(false, is.positiveNumber()); - assert.equal(false, is.positiveNumber(null)); - assert.equal(false, is.positiveNumber(-1)); - assert.equal(false, is.positiveNumber(0)); - assert.equal(false, is.positiveNumber('hello')); - assert.equal(false, is.positiveNumber('1')); - assert.equal(false, is.positiveNumber(new Date())); - assert.equal(false, is.positiveNumber(new Error())); - assert.equal(false, is.positiveNumber({})); - assert.equal(false, is.positiveNumber(-1.1)); - assert.equal(true, is.positiveNumber(1)); - assert.equal(true, is.positiveNumber(1/2.00001)); - assert.equal(true, is.positiveNumber(0.00001)); - }); -}); - - -describe('is.negativeNumber', function() { - it('should return true if value is a negative number', function() { - assert.equal(false, is.negativeNumber()); - assert.equal(false, is.negativeNumber(null)); - assert.equal(false, is.negativeNumber(0)); - assert.equal(false, is.negativeNumber('hello')); - assert.equal(false, is.negativeNumber('1')); - assert.equal(false, is.negativeNumber(new Date())); - assert.equal(false, is.negativeNumber(new Error())); - assert.equal(false, is.negativeNumber({})); - assert.equal(true, is.negativeNumber(-1.1)); - assert.equal(true, is.negativeNumber(-1)); - assert.equal(true, is.negativeNumber(-1/2.00001)); - assert.equal(true, is.negativeNumber(-0.00001)); - }); -}); - -describe('is.divisibleBy', function() { - it('should return true if value is divisible by n', function() { - assert.equal(false, is.divisibleBy()); - assert.equal(false, is.divisibleBy(1)); - assert.equal(false, is.divisibleBy('Hello', 'there')); - assert.equal(false, is.divisibleBy({}, {})); - assert.equal(false, is.divisibleBy([],[])); - assert.equal(false, is.divisibleBy(null,null)); - assert.equal(false, is.divisibleBy(1, 3)); - assert.equal(false, is.divisibleBy(0, 9)); - assert.equal(false, is.divisibleBy(-1, 3)); - assert.equal(false, is.divisibleBy(1, 2)); - assert.equal(true, is.divisibleBy(10, 2)); - assert.equal(true, is.divisibleBy(-10, -2)); - assert.equal(true, is.divisibleBy(-10, -1)); - assert.equal(true, is.divisibleBy(100, 10)); - }); -}); - -describe('is.positiveInt', function() { - it('should return true if value is a positive integer', function() { - assert.equal(false, is.positiveInteger(null)); - assert.equal(false, is.positiveInteger()); - assert.equal(false, is.positiveInteger('hello')); - assert.equal(false, is.positiveInteger([])); - assert.equal(false, is.positiveInteger({})); - assert.equal(false, is.positiveInteger(new Error())); - assert.equal(false, is.positiveInteger(new Date())); - assert.equal(false, is.positiveInteger(false)); - assert.equal(false, is.positiveInteger(1.1)); - assert.equal(false, is.positiveInteger(0.1)); - assert.equal(false, is.positiveInteger(-0.0000001)); - assert.equal(false, is.positiveInteger(10000000.1)); - assert.equal(false, is.positiveInteger(0)); - assert.equal(true, is.positiveInteger(10)); - assert.equal(false, is.positiveInteger(-2)); - assert.equal(true, is.positiveInteger(1)); - }); -}); - -describe('is.negativeInt', function() { - it('should return true if value is a negative integer', function() { - assert.equal(false, is.negativeInteger(null)); - assert.equal(false, is.negativeInteger()); - assert.equal(false, is.negativeInteger('hello')); - assert.equal(false, is.negativeInteger([])); - assert.equal(false, is.negativeInteger({})); - assert.equal(false, is.negativeInteger(new Error())); - assert.equal(false, is.negativeInteger(new Date())); - assert.equal(false, is.negativeInteger(false)); - assert.equal(false, is.negativeInteger(1.1)); - assert.equal(false, is.negativeInteger(0.1)); - assert.equal(false, is.negativeInteger(-0.0000001)); - assert.equal(false, is.negativeInteger(10000000.1)); - assert.equal(false, is.negativeInteger(0)); - assert.equal(false, is.negativeInteger(10)); - assert.equal(true, is.negativeInteger(-2)); - assert.equal(true, is.negativeInteger(-20000)); - assert.equal(false, is.negativeInteger(1)); - assert.equal(false, is.negativeInteger(10000)); - }); -}); - -describe('is.maximum', function() { - it('should return true if value is the maximum in the others array', function() { - assert.equal(false, is.maximum(null,null)); - assert.equal(false, is.maximum('hello',null)); - assert.equal(false, is.maximum(1,null)); - assert.equal(false, is.maximum(false,true)); - assert.equal(false, is.maximum()); - assert.equal(false, is.maximum(null,[1,2,3,4,5])); - assert.equal(false, is.maximum(true,[1,2,3,4,5])); - assert.equal(false, is.maximum(undefined,[1,2,3,4,5])); - assert.equal(false, is.maximum(new Date(),[1,2,3,4,5])); - assert.equal(false, is.maximum(new Error(),[1,2,3,4,5])); - assert.equal(false, is.maximum(1,[1,2,3,4,5])); - assert.equal(false, is.maximum(2,[1,2,3,4,5])); - assert.equal(false, is.maximum(3,[1,2,3,4,5])); - assert.equal(false, is.maximum(4,[1,2,3,4,5])); - assert.equal(true, is.maximum(5,[1,2,3,4,5])); - }); -}); - -describe('is.minimum', function() { - it('should return true if value is the minimum in the others array', function() { - assert.equal(false, is.minimum(null,null)); - assert.equal(false, is.minimum('hello',null)); - assert.equal(false, is.minimum(1,null)); - assert.equal(false, is.minimum(false,true)); - assert.equal(false, is.minimum()); - assert.equal(false, is.minimum(null,[1,2,3,4,5])); - assert.equal(false, is.minimum(true,[1,2,3,4,5])); - assert.equal(false, is.minimum(undefined,[1,2,3,4,5])); - assert.equal(false, is.minimum(new Date(),[1,2,3,4,5])); - assert.equal(false, is.minimum(new Error(),[1,2,3,4,5])); - assert.equal(true, is.minimum(1,[1,2,3,4,5])); - assert.equal(false, is.minimum(2,[1,2,3,4,5])); - assert.equal(false, is.minimum(3,[1,2,3,4,5])); - assert.equal(false, is.minimum(4,[1,2,3,4,5])); - assert.equal(false, is.minimum(5,[1,2,3,4,5])); - }); -}); - -describe('is.gt', function() { - it('should return true if value is greater than other', function() { - assert.equal(false, is.gt()); - assert.equal(false, is.gt(null,null)); - assert.equal(false, is.gt('6', '7')); - assert.equal(false, is.gt('alhpa', 'beta')); - assert.equal(false, is.gt(6, 7)); - assert.equal(false, is.gt(6, 7)); - }); -}); - -describe('is.ge', function() { - it('should return true if value is greater than or equal to other', function() { - assert.equal(false, is.ge()); - assert.equal(true, is.ge(null,null)); - assert.equal(false, is.ge('6', '7')); - assert.equal(false, is.ge('alhpa', 'beta')); - assert.equal(false, is.ge(6, 7)); - assert.equal(true, is.ge(6, 6)); - assert.equal(true, is.ge(6, 5)); - }); -}); - -describe('is.lt', function() { - it('should return true if value is less than other', function() { - assert.equal(false, is.lt()); - assert.equal(false, is.lt(null,null)); - assert.equal(true, is.lt('6', '7')); - assert.equal(true, is.lt('alhpa', 'beta')); - assert.equal(true, is.lt(6, 7)); - assert.equal(false, is.lt(7, 6)); - }); -}); - -describe('is.le', function() { - it('should return true if value is less than or equal to other', function() { - assert.equal(false, is.le()); - assert.equal(true, is.le(null,null)); - assert.equal(true, is.le('6', '7')); - assert.equal(true, is.le('6', '6')); - assert.equal(true, is.le('alhpa', 'beta')); - assert.equal(true, is.le(6, 7)); - assert.equal(true, is.le(6, 6)); - assert.equal(false, is.le(7, 6)); - }); -}); - -describe('is.within', function() { - it('should return true if value is within start and finish values', function() { - assert.equal(false, is.withIn(null, null)); - assert.equal(true, is.withIn(2, -1, 6)); - assert.equal(false, is.withIn(22, -1, 6)); - assert.equal(false, is.withIn('7', '2', '100')); // '7' is greater than '1' - assert.equal(true, is.withIn(7, 2, 100)); - assert.equal(false, is.withIn('1', '2', '100')); - }); -}); - -describe('is.objectInstanceOf', function() { - it('should return true if value is an instance of type object', function() { - function Circle() { - this.raidius = 3; - this.area = 4; - } - function Polygon() { - this.edges = 8; // octogons are the default - this.regular = false; // sides needn't be all the same - this.area = 1; - } - - function Rectangle(top_len, side_len) { - this.edges = 4; - this.top = top_len; - this.side = side_len; - this.area = top_len*side_len; - } - Rectangle.prototype = new Polygon(); - var box = new Rectangle(8,3); - - assert.equal(true, is.objectInstanceOf(box, Rectangle)); - //assert.equal(true, is.objectInstanceOf(box, Polygon)); - assert.equal(false, is.objectInstanceOf(box, Circle)); - //assert.equal(false, is.objectInstanceOf(box, undefined)); - }); -}); - - -describe('is.emailAddress', function() { - it('should return true for valid email address ', function() { - //http://isemail.info/_system/is_email/test/?all - assert.equal(false, is.email('edmond')); - assert.equal(true, is.email('edmond@stdarg')); - assert.equal(true, is.email('edmond@stdarg.com')); - assert.equal(true, is.email('edmond@127.0.0.1')); - assert.equal(false, is.email('@')); - assert.equal(false, is.email('@stdarg')); - assert.equal(false, is.email('@stdarg.com')); - assert.equal(false, is.email('@stdarg.something')); - assert.equal(true, is.email('e@stdarg.something.something')); - assert.equal(false, is.email('.e@stdarg.something')); - assert.equal(true, is.email('e.m@stdarg.com')); - assert.equal(false, is.email('e..m@stdarg.com')); - assert.equal(true, is.email('!#$%&`*+/=?^`{|}~@stdarg.com')); - //assert.equal(false, is.email('hi@edmond@stdarg.com')); - //assert.equal(false, is.email('hi\\@edmond@stdarg.com')); - //assert.equal(false, is.email('123@stdarg.com')); - assert.equal(true, is.email('edmond@123.com')); - assert.equal(true, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@123.com')); - - //assert.equal(false, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklmn@stdarg.com')); - assert.equal(true, is.email('edmond@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.com')); - //assert.equal(false, is.email('edmond@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm.com')); - assert.equal(true, is.email('edmond@test-stdarg.com')); - //assert.equal(false, is.email('edmond@-stdarg.com')); - assert.equal(true, is.email('edmond@test--stdarg.com')); - assert.equal(false, is.email('edmond@.stdarg.com')); - assert.equal(true, is.email('a@a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v')); - assert.equal(true, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi')); - //assert.equal(false, is.email('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij')); - //assert.equal(false, is.email('"edmond"@stdarg.com')); - //assert.equal(false, is.email('""@stdarg.com')); - //assert.equal(false, is.email('"\\e"@stdarg.com')); - - - }); -}); - -describe('is.ipv4Address', function() { - it('should return true for valid ipv4 address ', function() { - assert.equal(false, is.ipv4('edmond')); - assert.equal(false, is.ipv4('192.168.0.2000000000')); - assert.equal(true, is.ipv4('192.168.0.2')); - assert.equal(false, is.ipv4('336.332')); - assert.equal(true, is.ipv4('255.255.255.0')); - assert.equal(true, is.ipv4('255.255.255.255')); - assert.equal(true, is.ipv4('0.0.0.0')); - assert.equal(false, is.ipv4('192.168.a.0')); - }); -}); - -describe('is.ipv6Address', function() { - it('should return true for valid ipv6 address ', function() { - assert.equal(false, is.ipv6('edmond')); - assert.equal(false, is.ipv6('192.168.0.2000000000')); - assert.equal(false, is.ipv6('192.168.0.2')); - assert.equal(false, is.ipv6('336.332')); - assert.equal(false, is.ipv6('')); - assert.equal(false, is.ipv6('---')); - assert.equal(false, is.ipv6('2001:0000:1234: 0000:0000:C1C0:ABCD:0876')); - assert.equal(false, is.ipv6('2001:1:1:1:1:1:255Z255X255Y255')); - assert.equal(false, is.ipv6('2001:0000:1234:0000:00001:C1C0:ABCD:0876')); - assert.equal(false, is.ipv6('2001:0000:1234: 0000:0000:C1C0:ABCD:0876')); - - // FIXME Broken cases. - // assert.equal(false, is.ipv6('2001:0000:1234:0000:0000:C1C0:ABCD:0876 0')); - // assert.equal(false, is.ipv6('02001:0000:1234:0000:0000:C1C0:ABCD:0876')); - - assert.equal(true, is.ipv6('2001:db8:3333:4444:5555:6666:1.2.3.4')); - assert.equal(true, is.ipv6('2001:0000:1234:0000:0000:C1C0:ABCD:0876')); - assert.equal(true, is.ipv6('2001:0:1234::C1C0:ABCD:876')); - assert.equal(true, is.ipv6('3ffe:0b00:0000:0000:0001:0000:0000:000a')); - assert.equal(true, is.ipv6('3ffe:b00::1:0:0:a')); - assert.equal(true, is.ipv6('FF02:0000:0000:0000:0000:0000:0000:0001')); - assert.equal(true, is.ipv6('FF02::1')); - assert.equal(true, is.ipv6('0000:0000:0000:0000:0000:0000:0000:0001')); - assert.equal(true, is.ipv6('0000:0000:0000:0000:0000:0000:0000:0000')); - assert.equal(true, is.ipv6('::')); - assert.equal(true, is.ipv6('::ffff:192.168.1.26')); - assert.equal(true, is.ipv6('2001:0:1234::C1C0:ABCD:876')); - assert.equal(true, is.ipv6('2001:0000:1234:0000:0000:C1C0:ABCD:0876')); - }); -}); - -describe('is.dnsAddress', function() { - it('should return true for valid dns address ', function() { - assert.equal(true, is.dns('stdarg')); - - assert.equal(true, is.dns('stdarg.com')); - assert.equal(true, is.dns('www.stdarg.com')); - assert.equal(false, is.dns('336.332')); - assert.equal(true, is.dns('3stdarg.com')); - assert.equal(false, is.dns('192.168.0.2000000000')); - assert.equal(false, is.dns('192.168.0.2')); - assert.equal(false, is.dns('*hi*.com')); - assert.equal(false, is.dns('-hi-.com')); - assert.equal(false, is.dns('_stdrg-.com')); - assert.equal(true, is.dns('www--stdrg.com')); - assert.equal(false, is.dns(':54:sda54')); - assert.equal(false, is.dns('2001:db8:3333:4444:5555:6666:1.2.3.4')); - assert.equal(false, is.dns('2001:0000:1234: 0000:0000:C1C0:ABCD:0876')); - assert.equal(false, is.dns('2001:1:1:1:1:1:255Z255X255Y255')); - }); -}); - -describe('is.port', function() { - it('should return true for valid port numbers ', function() { - assert.equal(false, is.port(-11)); - assert.equal(false, is.port(-11)); - assert.equal(true, is.port(0)); - assert.equal(true, is.port(1)); - assert.equal(true, is.port(10)); - assert.equal(true, is.port(100)); - assert.equal(true, is.port(65535)); - assert.equal(false, is.port(65536)); - }); - - it('should return false for invalid port numbers ', function() { - assert.equal(false, is.port(-1100)); - assert.equal(false, is.port(-10)); - assert.equal(true, is.port(0)); - assert.equal(true, is.port(10)); - assert.equal(true, is.port(65535)); - assert.equal(false, is.port(65536)); - assert.equal(false, is.port()); - assert.equal(false, is.port(null)); - assert.equal(false, is.port('22')); - assert.equal(false, is.port('heya')); - assert.equal(false, is.port(true)); - assert.equal(false, is.port({a:22})); - assert.equal(false, is.port([])); - assert.equal(false, is.port([1,2,3])); - }); -}); - -describe('is.systemPort', function() { - it('should return true for valid port numbers 0-1023 ', function() { - assert.equal(false, is.systemPort(-1)); - assert.equal(true, is.systemPort(0)); - assert.equal(true, is.systemPort(1)); - assert.equal(true, is.systemPort(1023)); - assert.equal(false, is.systemPort(1024)); - assert.equal(false, is.systemPort(10000)); - }); -}); - -describe('is.userPort', function() { - it('should return true for valid port numbers 1024-65535 ', function() { - assert.equal(false, is.userPort(-1)); - assert.equal(false, is.userPort(0)); - assert.equal(false, is.userPort(1)); - assert.equal(false, is.userPort(1023)); - assert.equal(true, is.userPort(1024)); - assert.equal(true, is.userPort(1025)); - assert.equal(true, is.userPort(65535)); - assert.equal(false, is.userPort(65536)); - }); -}); - -describe('is.creditCard', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.creditCard(-1)); - assert.equal(false, is.creditCard(false)); - assert.equal(false, is.creditCard('3678363')); - assert.equal(false, is.creditCard({})); - assert.equal(true, is.creditCard('4556737586899855')); - assert.equal(true, is.creditCard('4929660015246383')); - assert.equal(true, is.creditCard('5311287563096839')); - assert.equal(true, is.creditCard('6011090018648076')); - assert.equal(true, is.creditCard('3528110531264368')); - assert.equal(true, is.creditCard('5426995946026032')); - assert.equal(true, is.creditCard('6304894372418471')); - assert.equal(true, is.creditCard('4917768861309447')); - assert.equal(true, is.creditCard('6387665553270232')); - assert.equal(true, is.creditCard('5038882537870764')); - assert.equal(true, is.creditCard('343064005618154')); - assert.equal(true, is.creditCard('79927398713')); - }); -}); - -describe('is.amexCard', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.amexCard(-1)); - assert.equal(false, is.amexCard(false)); - assert.equal(false, is.amexCard('3678363')); - assert.equal(false, is.amexCard({})); - assert.equal(false, is.amexCard('4556737586899855')); - assert.equal(false, is.amexCard('4929660015246383')); - assert.equal(false, is.amexCard('5311287563096839')); - assert.equal(false, is.amexCard('6011090018648076')); - assert.equal(false, is.amexCard('3528110531264368')); - assert.equal(false, is.amexCard('5426995946026032')); - assert.equal(false, is.amexCard('6304894372418471')); - assert.equal(false, is.amexCard('4917768861309447')); - assert.equal(false, is.amexCard('6387665553270232')); - assert.equal(false, is.amexCard('5038882537870764')); - assert.equal(false, is.amexCard('79927398713')); - assert.equal(true, is.amexCard('343064005618154')); - assert.equal(true, is.amexCard('342320557154811')); - assert.equal(true, is.amexCard('378282246310005')); - assert.equal(true, is.amexCard('378734493671000')); - }); -}); - -describe('is.dinersClubCarteBlancheCard', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dinersClubCarteBlancheCard(-1)); - assert.equal(false, is.dinersClubCarteBlancheCard(false)); - assert.equal(false, is.dinersClubCarteBlancheCard('3678363')); - assert.equal(false, is.dinersClubCarteBlancheCard({})); - assert.equal(false, is.dinersClubCarteBlancheCard('4556737586899855')); - assert.equal(false, is.dinersClubCarteBlancheCard('4929660015246383')); - assert.equal(false, is.dinersClubCarteBlancheCard('5311287563096839')); - assert.equal(false, is.dinersClubCarteBlancheCard('6011090018648076')); - assert.equal(false, is.dinersClubCarteBlancheCard('3528110531264368')); - assert.equal(false, is.dinersClubCarteBlancheCard('5426995946026032')); - assert.equal(false, is.dinersClubCarteBlancheCard('6304894372418471')); - assert.equal(false, is.dinersClubCarteBlancheCard('4917768861309447')); - assert.equal(false, is.dinersClubCarteBlancheCard('6387665553270232')); - assert.equal(false, is.dinersClubCarteBlancheCard('5038882537870764')); - assert.equal(false, is.dinersClubCarteBlancheCard('79927398713')); - assert.equal(false, is.dinersClubCarteBlancheCard('343064005618154')); - assert.equal(true, is.dinersClubCarteBlancheCard('30538524124412')); - assert.equal(true, is.dinersClubCarteBlancheCard('30106026933654')); - assert.equal(true, is.dinersClubCarteBlancheCard('30449619157293')); - }); -}); - -describe('is.dinersClubInternationalCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dinersClubInternationalCardNumber(-1)); - assert.equal(false, is.dinersClubInternationalCardNumber(false)); - assert.equal(false, is.dinersClubInternationalCardNumber('3678363')); - assert.equal(false, is.dinersClubInternationalCardNumber({})); - assert.equal(false, is.dinersClubInternationalCardNumber('4556737586899855')); - assert.equal(false, is.dinersClubInternationalCardNumber('4929660015246383')); - assert.equal(false, is.dinersClubInternationalCardNumber('5311287563096839')); - assert.equal(false, is.dinersClubInternationalCardNumber('6011090018648076')); - assert.equal(false, is.dinersClubInternationalCardNumber('3528110531264368')); - assert.equal(false, is.dinersClubInternationalCardNumber('5426995946026032')); - assert.equal(false, is.dinersClubInternationalCardNumber('6304894372418471')); - assert.equal(false, is.dinersClubInternationalCardNumber('4917768861309447')); - assert.equal(false, is.dinersClubInternationalCardNumber('6387665553270232')); - assert.equal(false, is.dinersClubInternationalCardNumber('5038882537870764')); - assert.equal(false, is.dinersClubInternationalCardNumber('79927398713')); - assert.equal(false, is.dinersClubInternationalCardNumber('343064005618154')); - assert.equal(true, is.dinersClubInternationalCardNumber('36613787276938')); - assert.equal(true, is.dinersClubInternationalCardNumber('36511672170689')); - assert.equal(true, is.dinersClubInternationalCardNumber('36725805797974')); - }); -}); - -describe('is.dinersClubUSACanadaCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dinersClubUSACanadaCardNumber(-1)); - assert.equal(false, is.dinersClubUSACanadaCardNumber(false)); - assert.equal(false, is.dinersClubUSACanadaCardNumber('3678363')); - assert.equal(false, is.dinersClubUSACanadaCardNumber({})); - assert.equal(false, is.dinersClubUSACanadaCardNumber('4556737586899855')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('4929660015246383')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('5311287563096839')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('6011090018648076')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('3528110531264368')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('6304894372418471')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('4917768861309447')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('6387665553270232')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('5038882537870764')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('79927398713')); - assert.equal(false, is.dinersClubUSACanadaCardNumber('343064005618154')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5426995946026032')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5431142191824349')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5543473646866162')); - assert.equal(true, is.dinersClubUSACanadaCardNumber('5516577322816656')); - }); -}); - -describe('is.discoverCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.discoverCardNumber(-1)); - assert.equal(false, is.discoverCardNumber(false)); - assert.equal(false, is.discoverCardNumber('3678363')); - assert.equal(false, is.discoverCardNumber({})); - assert.equal(false, is.discoverCardNumber('4556737586899855')); - assert.equal(false, is.discoverCardNumber('4929660015246383')); - assert.equal(false, is.discoverCardNumber('5311287563096839')); - assert.equal(false, is.discoverCardNumber('3528110531264368')); - assert.equal(false, is.discoverCardNumber('6304894372418471')); - assert.equal(false, is.discoverCardNumber('4917768861309447')); - assert.equal(false, is.discoverCardNumber('6387665553270232')); - assert.equal(false, is.discoverCardNumber('5038882537870764')); - assert.equal(false, is.discoverCardNumber('79927398713')); - assert.equal(false, is.discoverCardNumber('343064005618154')); - assert.equal(false, is.discoverCardNumber('5426995946026032')); - assert.equal(true, is.discoverCardNumber('6011090018648076')); - assert.equal(true, is.discoverCardNumber('6011182164850760')); - assert.equal(true, is.discoverCardNumber('6011377056444884')); - assert.equal(true, is.discoverCardNumber('6011060206223099')); - }); -}); - -describe('is.instaPaymentCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.instaPaymentCardNumber(-1)); - assert.equal(false, is.instaPaymentCardNumber(false)); - assert.equal(false, is.instaPaymentCardNumber('3678363')); - assert.equal(false, is.instaPaymentCardNumber({})); - assert.equal(false, is.instaPaymentCardNumber('4556737586899855')); - assert.equal(false, is.instaPaymentCardNumber('4929660015246383')); - assert.equal(false, is.instaPaymentCardNumber('5311287563096839')); - assert.equal(false, is.instaPaymentCardNumber('3528110531264368')); - assert.equal(false, is.instaPaymentCardNumber('6304894372418471')); - assert.equal(false, is.instaPaymentCardNumber('4917768861309447')); - assert.equal(false, is.instaPaymentCardNumber('5038882537870764')); - assert.equal(false, is.instaPaymentCardNumber('79927398713')); - assert.equal(false, is.instaPaymentCardNumber('343064005618154')); - assert.equal(false, is.instaPaymentCardNumber('5426995946026032')); - assert.equal(false, is.instaPaymentCardNumber('6011090018648076')); - assert.equal(true, is.instaPaymentCardNumber('6387665553270232')); - assert.equal(true, is.instaPaymentCardNumber('6387266246078411')); - assert.equal(true, is.instaPaymentCardNumber('6375295695268144')); - assert.equal(true, is.instaPaymentCardNumber('6390280410058799')); - }); -}); - -describe('is.instaPaymentCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.instaPaymentCardNumber(-1)); - assert.equal(false, is.instaPaymentCardNumber(false)); - assert.equal(false, is.instaPaymentCardNumber('3678363')); - assert.equal(false, is.instaPaymentCardNumber({})); - assert.equal(false, is.instaPaymentCardNumber('4556737586899855')); - assert.equal(false, is.instaPaymentCardNumber('4929660015246383')); - assert.equal(false, is.instaPaymentCardNumber('5311287563096839')); - assert.equal(false, is.instaPaymentCardNumber('3528110531264368')); - assert.equal(false, is.instaPaymentCardNumber('6304894372418471')); - assert.equal(false, is.instaPaymentCardNumber('4917768861309447')); - assert.equal(false, is.instaPaymentCardNumber('5038882537870764')); - assert.equal(false, is.instaPaymentCardNumber('79927398713')); - assert.equal(false, is.instaPaymentCardNumber('343064005618154')); - assert.equal(false, is.instaPaymentCardNumber('5426995946026032')); - assert.equal(false, is.instaPaymentCardNumber('6011090018648076')); - assert.equal(true, is.instaPaymentCardNumber('6387665553270232')); - assert.equal(true, is.instaPaymentCardNumber('6387266246078411')); - assert.equal(true, is.instaPaymentCardNumber('6375295695268144')); - assert.equal(true, is.instaPaymentCardNumber('6390280410058799')); - }); -}); - -describe('is.jcbCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.jcbCardNumber(-1)); - assert.equal(false, is.jcbCardNumber(false)); - assert.equal(false, is.jcbCardNumber('3678363')); - assert.equal(false, is.jcbCardNumber({})); - assert.equal(false, is.jcbCardNumber('4556737586899855')); - assert.equal(false, is.jcbCardNumber('4929660015246383')); - assert.equal(false, is.jcbCardNumber('5311287563096839')); - assert.equal(false, is.jcbCardNumber('4917768861309447')); - assert.equal(false, is.jcbCardNumber('5038882537870764')); - assert.equal(false, is.jcbCardNumber('79927398713')); - assert.equal(false, is.jcbCardNumber('343064005618154')); - assert.equal(false, is.jcbCardNumber('5426995946026032')); - assert.equal(false, is.jcbCardNumber('6011090018648076')); - assert.equal(false, is.jcbCardNumber('6387665553270232')); - assert.equal(false, is.jcbCardNumber('6304894372418471')); - assert.equal(true, is.jcbCardNumber('3528110531264368')); - assert.equal(true, is.jcbCardNumber('3530111333300000')); - assert.equal(true, is.jcbCardNumber('3566002020360505')); - }); -}); - -describe('is.laserCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.laserCardNumber(-1)); - assert.equal(false, is.laserCardNumber(false)); - assert.equal(false, is.laserCardNumber('3678363')); - assert.equal(false, is.laserCardNumber({})); - assert.equal(false, is.laserCardNumber('4556737586899855')); - assert.equal(false, is.laserCardNumber('4929660015246383')); - assert.equal(false, is.laserCardNumber('5311287563096839')); - assert.equal(false, is.laserCardNumber('4917768861309447')); - assert.equal(false, is.laserCardNumber('5038882537870764')); - assert.equal(false, is.laserCardNumber('79927398713')); - assert.equal(false, is.laserCardNumber('343064005618154')); - assert.equal(false, is.laserCardNumber('5426995946026032')); - assert.equal(false, is.laserCardNumber('6011090018648076')); - assert.equal(false, is.laserCardNumber('6387665553270232')); - assert.equal(false, is.laserCardNumber('3528110531264368')); - assert.equal(true, is.laserCardNumber('6304894372418471')); - assert.equal(true, is.laserCardNumber('6706142507937195')); - assert.equal(true, is.laserCardNumber('6771157847381508')); - assert.equal(true, is.laserCardNumber('6706622469321660')); - }); -}); - -describe('is.dankortCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.dankortCardNumber(-1)); - assert.equal(false, is.dankortCardNumber(false)); - assert.equal(false, is.dankortCardNumber('3678363')); - assert.equal(false, is.dankortCardNumber({})); - assert.equal(false, is.dankortCardNumber('4556737586899855')); - assert.equal(false, is.dankortCardNumber('4929660015246383')); - assert.equal(false, is.dankortCardNumber('5311287563096839')); - assert.equal(false, is.dankortCardNumber('4917768861309447')); - assert.equal(false, is.dankortCardNumber('5038882537870764')); - assert.equal(false, is.dankortCardNumber('79927398713')); - assert.equal(false, is.dankortCardNumber('343064005618154')); - assert.equal(false, is.dankortCardNumber('5426995946026032')); - assert.equal(false, is.dankortCardNumber('6011090018648076')); - assert.equal(false, is.dankortCardNumber('6387665553270232')); - assert.equal(false, is.dankortCardNumber('3528110531264368')); - assert.equal(false, is.dankortCardNumber('6304894372418471')); - assert.equal(true, is.dankortCardNumber('5019717010103742')); - }); -}); - -describe('is.visaCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.visaCardNumber(-1)); - assert.equal(false, is.visaCardNumber(false)); - assert.equal(false, is.visaCardNumber('3678363')); - assert.equal(false, is.visaCardNumber({})); - assert.equal(false, is.visaCardNumber('79927398713')); - assert.equal(false, is.visaCardNumber('343064005618154')); - assert.equal(false, is.visaCardNumber('6011090018648076')); - assert.equal(false, is.visaCardNumber('6387665553270232')); - assert.equal(false, is.visaCardNumber('3528110531264368')); - assert.equal(false, is.visaCardNumber('6304894372418471')); - assert.equal(false, is.visaCardNumber('5426995946026032')); - assert.equal(false, is.visaCardNumber('5311287563096839')); - assert.equal(true, is.visaCardNumber('4556737586899855')); - assert.equal(true, is.visaCardNumber('4929660015246383')); - assert.equal(true, is.visaCardNumber('4929834838354035')); - assert.equal(true, is.visaCardNumber('4929834838354035')); - }); -}); - -/* -describe('is.visaElectronCardNumber', function() { - it('should return true for valid credit card numbers ', function() { - assert.equal(false, is.visaElectronCardNumber(-1)); - assert.equal(false, is.visaElectronCardNumber(false)); - assert.equal(false, is.visaElectronCardNumber('3678363')); - assert.equal(false, is.visaElectronCardNumber({})); - assert.equal(false, is.visaElectronCardNumber('79927398713')); - assert.equal(false, is.visaElectronCardNumber('343064005618154')); - assert.equal(false, is.visaElectronCardNumber('6011090018648076')); - assert.equal(false, is.visaElectronCardNumber('6387665553270232')); - assert.equal(false, is.visaElectronCardNumber('3528110531264368')); - assert.equal(false, is.visaElectronCardNumber('6304894372418471')); - assert.equal(false, is.visaElectronCardNumber('5426995946026032')); - assert.equal(false, is.visaElectronCardNumber('5311287563096839')); - assert.equal(false, is.visaElectronCardNumber('4556737586899855')); - assert.equal(false, is.visaElectronCardNumber('4929660015246383')); - assert.equal(true, is.visaElectronCardNumber('4917768861309447')); - assert.equal(true, is.visaElectronCardNumber('4026691823166028')); - assert.equal(true, is.visaElectronCardNumber('4175007561308913')); - assert.equal(true, is.visaElectronCardNumber('4508840471561769')); - }); -}); -*/ - -describe('is.uuid', function() { - it('should return true for valid uuids ', function() { - assert.equal(false, is.uuid()); - assert.equal(false, is.uuid(null)); - assert.equal(false, is.uuid(-1)); - assert.equal(false, is.uuid(-1)); - assert.equal(false, is.uuid(false)); - assert.equal(false, is.uuid('3678363')); - assert.equal(false, is.uuid({})); - assert.equal(false, is.uuid([])); - assert.equal(false, is.uuid('uuid')); - assert.equal(false, is.uuid(6011090018648076)); - // v4 uuids - assert.equal(true, is.uuid('bbb1e6cf-fb9c-4946-8e64-88ac25393845')); - assert.equal(true, is.uuid('4b301b45-3473-4c31-8b0d-9aea4f46de91')); - assert.equal(true, is.uuid('f7f03879-c31b-4c28-af7d-40584f55e8a6')); - assert.equal(true, is.uuid('7e3c9d08-6fdb-415b-a33c-0c0c057491df')); - // v1 uuids - assert.equal(true, is.uuid('49b782c0-7690-11e5-8bcf-feff819cdc9f')); - assert.equal(true, is.uuid('71d3cb56-7690-11e5-8bcf-feff819cdc9f')); - assert.equal(true, is.uuid('7e1978f2-7690-11e5-8bcf-feff819cdc9f')); - assert.equal(true, is.uuid('83e32954-7690-11e5-8bcf-feff819cdc9f')); - }); -}); - -describe('is.hostAddress', function() { - it('should return true for valid uuids ', function() { - assert.equal(false, is.hostAddress()); - assert.equal(false, is.hostAddress(null)); - assert.equal(false, is.hostAddress(-1)); - assert.equal(false, is.hostAddress(-1)); - assert.equal(false, is.hostAddress(false)); - assert.equal(false, is.hostAddress('3678363')); - assert.equal(false, is.hostAddress({})); - assert.equal(false, is.hostAddress([])); - assert.equal(false, is.hostAddress(6011090018648076)); - assert.equal(false, is.hostAddress('1000000.10.1.1')); - - /* - assert.equal(true, is.hostAddress('192.168.1.1')); - assert.equal(true, is.hostAddress('10.10.1.1')); - assert.equal(true, is.hostAddress('www.google.com')); - assert.equal(true, is.hostAddress('finance.yahoo.com')); - assert.equal(true, is.hostAddress('google.com')); - assert.equal(true, is.hostAddress('google')); - assert.equal(true, is.hostAddress('close5-dev.5fxjas.0001.usw1.cache.amazonaws.com')); - */ - }); -}); - -describe('is.mongoId', function() { - it('should return true for valid mongo ids ', function() { - assert.equal(false, is.objectId()); - assert.equal(false, is.objectId(111111111111111111111111)); - assert.equal(false, is.objectId(null)); - assert.equal(false, is.objectId(false)); - assert.equal(false, is.objectId({})); - assert.equal(false, is.objectId({})); - - var ObjectID = require('mongodb').ObjectID; - assert.equal(true, is.objectId('507f1f77bcf86cd799439011')); - assert.equal(true, is.objectId('507f191e810c19729de860ea')); - assert.equal(true, is.objectId(new ObjectID())); - }); -}); - -describe('is.matching', function() { - it('should return true if the first arg matches any of the subsequent in '+ - 'strict comparison ', function() { - assert.equal(false, is.match()); - assert.equal(false, is.match(111111111111111111111111)); - assert.equal(false, is.match(null)); - assert.equal(false, is.match(false)); - assert.equal(false, is.match({})); - - assert.equal(false, is.match({}, true)); - assert.equal(true, is.match(111111111111111111111111, 111111111111111111111111)); - assert.equal(true, is.match(null, null)); - assert.equal(true, is.match(false, false)); - - var ObjectID = require('mongodb').ObjectID; - assert.equal(true, is.match(false, true, false)); - - assert.equal(true, is.match('507f191e810c19729de860ea', false, '507f191e810c19729de860ea')); - var objId = new ObjectID(); - assert.equal(true, is.match(objId, objId)); - }); -}); -describe('is.streetAddress', function(){ - it('should return true for a string containing a street address', function(){ - assert.equal(false, is.streetAddress()); - assert.equal(false, is.streetAddress(null)); - assert.equal(false, is.streetAddress(-1)); - assert.equal(false, is.streetAddress('123')); - assert.equal(false, is.streetAddress(undefined)); - assert.equal(false, is.streetAddress('192.168.0.1')); - assert.equal(false, is.streetAddress('some unrelated string, with nothing in common with any other strings in the room. \n Poor little guy')); - assert.equal(false, is.streetAddress('This string talks about money, and 55 dollars is nothing to scoff at, but shouldn\'t trigger a false positive.')); - assert.equal(false, is.streetAddress('This string doesn\'t use money, but it does use numbers like 23 is a good number, so is 999 or 234,432.')); - - assert.equal(true, is.streetAddress('55 Main Street.')); - assert.equal(true, is.streetAddress('1999 Pullman Ave. Apt. 322')); - assert.equal(true, is.streetAddress('This is a long string with newline characters, \nthis should still capture an address like 123 Sesame Street.')); - assert.equal(true, is.streetAddress('I know I should\'t really have to do this,' + - 'but template strings are an ES6 feature. If you want to submit ideas for this project,' + - 'you should write to 89 Some Place, #33 San Francisco, CA 94130. Or, don\'t, the choice is up to you.')); - }); -}); - -describe('is.zipCode', function(){ - it('should return true for a string or number resembling a US zipcode', function(){ - assert.equal(false, is.zipCode()); - assert.equal(false, is.zipCode(1234)); - assert.equal(false, is.zipCode('555-555-5555')); - assert.equal(false, is.zipCode(123456)); - assert.equal(false, is.zipCode('10293-564372')); - assert.equal(false, is.zipCode({something: 'is wrong here'})); - assert.equal(false, is.zipCode(['something', 'is wrong here'])); - - assert.equal(true, is.zipCode(12345)); - assert.equal(true, is.zipCode('99999')); - assert.equal(true, is.zipCode('12345-6789')); - }); -}); - -describe('is.phoneNumber', function(){ - it('should return true for a string containing a US phone number', function(){ - assert.equal(false, is.phoneNumber()); - assert.equal(false, is.phoneNumber(23897498729387)); - assert.equal(false, is.phoneNumber('something with a 213219 number in it')); - assert.equal(false, is.phoneNumber('something with a 123,456,7890 number in it')); - - assert.equal(true, is.phoneNumber('my number is 123.555.5767')); - assert.equal(true, is.phoneNumber('my number is 1 123-555-5767')); - assert.equal(true, is.phoneNumber('my number is (123) 555-5767')); - assert.equal(true, is.phoneNumber('my number is (123) 555.5767')); - assert.equal(true, is.phoneNumber('my number is 123 555 5767')); - assert.equal(true, is.phoneNumber('my number is 123 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is (123) 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 123-555-5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1.123.555.5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1-123-555-5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555-5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555 5767 and here\'s some more text')); - assert.equal(true, is.phoneNumber('my number is 1 (123) 555 \n5767 and here\'s some more text')); - }); -}); - -describe('is.url', function(){ - it('should return true for valid URLs', function(){ - assert.equal(false, is.url()); - assert.equal(false, is.url(23897498729387)); - assert.equal(false, is.url('something with a 213219 number in it')); - assert.equal(false, is.url(null)); - assert.equal(false, is.url(false)); - assert.equal(false, is.url({})); - assert.equal(false, is.url({url:1})); - - assert.equal(true, is.url('http://www.amazon.com')); - assert.equal(true, is.url('http://www.amazon.com/')); - assert.equal(true, is.url('http://www.amazon.com/help')); - assert.equal(true, is.url('http://www.amazon.com/help?page1&num=383833')); - assert.equal(true, is.url('http://amazon.com')); - assert.equal(false, is.url('http://amazon')); - }); -}); - -describe('is.enum', function(){ - it('should return true for if the array contains the value', function(){ - assert.equal(false, is.enum()); - assert.equal(false, is.enum('a')); - assert.equal(false, is.enum('a', 12)); - assert.equal(false, is.enum('a', {a: 'a'})); - assert.equal(false, is.enum('a', true)); - assert.equal(false, is.enum('a', ['b', 'c'])); - assert.equal(false, is.enum('a', ['b', 'c'])); - assert.equal(false, is.enum('a', ['b', 'c', 4, {a: 'a'}])); - - assert.equal(true, is.enum('a', ['a', 'b', 'c'])); - assert.equal(true, is.enum(1, ['a', 'b', 'c', 1])); - assert.equal(true, is.enum(true, ['a', 'b', 'c', true])); - assert.equal(true, is.enum(null, ['a', 'b', 'c', null])); - assert.equal(true, is.enum(false, ['a', 'b', 'c', false])); - assert.equal(true, is.enum([1], ['a', 'b', 'c', [1]])); - assert.equal(true, is.enum({a: 'a'}, ['a', 'b', 'c', {a: 'a'}])); - }); -}); - -describe('is.prettyClose', function(){ - it('should return true for floating point numbers that are close', function(){ - assert.equal(false, is.prettyClose()); - assert.equal(false, is.prettyClose(1, 'a')); - assert.equal(false, is.prettyClose('b', 'c')); - assert.equal(false, is.prettyClose(9, null)); - assert.equal(false, is.prettyClose(1, 3, -9)); - assert.equal(false, is.prettyClose(1.1, 1.16, 1)); - assert.equal(false, is.prettyClose(23.678, 23.98746, 4)); - - assert.equal(true, is.prettyClose(1.1, 1.12, 1)); - assert.equal(true, is.prettyClose(100.4, 100.439999, 1)); - assert.equal(true, is.prettyClose(0.39, 0.414, 1)); - assert.equal(true, is.prettyClose(0.00000009, 0.0000001, 7)); - assert.equal(true, is.prettyClose(1.123, 1.121)); - assert.equal(true, is.prettyClose(1, 1, 1)); - }); -}); diff --git a/node_modules/property-path/package.json b/node_modules/property-path/package.json deleted file mode 100644 index cabe88a..0000000 --- a/node_modules/property-path/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "property-path", - "version": "1.0.0", - "description": "Get and set object properties by path where you can specify the separator.", - "main": "index.js", - "scripts": { - "test": "./node_modules/.bin/mocha --reporter list ./test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/stdarg/property-path.git" - }, - "keywords": [ - "object", - "property", - "obj", - "properties", - "path", - "get", - "set", - "paths", - "pathes", - "string", - "separator" - ], - "author": "Edmond Meinfelder", - "license": "MIT", - "bugs": { - "url": "https://github.com/stdarg/property-path/issues" - }, - "homepage": "https://github.com/stdarg/property-path", - "dependencies": { - "is2": "2.0.1", - "lodash.filter": "4.6.0" - }, - "devDependencies": { - "mocha": "6.0.2" - } -} diff --git a/node_modules/property-path/test.js b/node_modules/property-path/test.js deleted file mode 100644 index 2176830..0000000 --- a/node_modules/property-path/test.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; -var assert = require('assert'); -var propPath = require('./index'); - -describe('property-path', function() { - - var testObj = { - a: 1, - b: true, - c: { - d: { - e: 'Hello', - f: [ 1, 2, false, 'hi' ] - } - } - }; - - it('get should return the right value for a given path', function() { - assert.equal(1, propPath.get(testObj, 'a')); - assert.equal(true, propPath.get(testObj, 'b')); - - var obj2 = { - d: { - e: 'Hello', - f: [ 1, 2, false, 'hi' ] - } - }; - - assert.deepEqual(obj2, propPath.get(testObj, 'c')); - assert.equal('Hello', propPath.get(testObj, 'c.d.e')); - assert.equal(1, propPath.get(testObj, 'a', '/')); - assert.equal(true, propPath.get(testObj, 'b', '/')); - assert.deepEqual(obj2, propPath.get(testObj, 'c', '/')); - assert.equal('Hello', propPath.get(testObj, 'c/d/e', '/')); - }); - - it('get should return undefined for invalid pathes', function() { - assert.equal(undefined, propPath.get(testObj, 'c/d/e/x', '/')); - assert.equal(undefined, propPath.get(testObj, '////////x', '/')); - assert.equal(undefined, propPath.get(testObj, 'xxx', '/')); - }); - - it('get should return the object given for root path', function() { - assert.deepEqual(testObj, propPath.get(testObj, '', '/')); - assert.deepEqual(testObj, propPath.get(testObj, '', '///')); - // empty string is a root path - assert.deepEqual(testObj, propPath.get(testObj, '', '')); - assert.deepEqual(testObj, propPath.get(testObj, '')); - assert.deepEqual(testObj, propPath.get(testObj, '', '/')); - }); - - it('get should handle duplicated separators in pathes', function() { - // no path should be the root - // should ignore duplicated separators - assert.deepEqual('Hello', propPath.get(testObj, '///c//d///e///', '/')); - - }); - - it('set should modify the right property for a given path', function() { - propPath.set(testObj, 'a', 2); - assert.equal(2, testObj.a); - assert.equal(3, propPath.set(testObj, 'a', 3)); - assert.equal(3, testObj.a); - - propPath.set(testObj, 'c.d.e', 'Greetings'); - assert.equal(testObj.c.d.e, 'Greetings'); - - propPath.set(testObj, 'a', 2, '/'); - assert.equal(2, testObj.a); - assert.equal(3, propPath.set(testObj, 'a', 3)); - assert.equal(3, testObj.a); - - propPath.set(testObj, 'c/d/e', 'Greetings', '/'); - assert.equal(testObj.c.d.e, 'Greetings'); - - assert.equal(333, propPath.set(testObj, 'c/d/f/0', 333, '/')); - assert.equal(333, testObj.c.d.f[0]); - }); - - it('set return undefined for invalid pathes and change nothing', function() { - assert.deepEqual(undefined, propPath.set(testObj, 'x/x/x', 'xxx', '/')); - assert.deepEqual(undefined, propPath.set(testObj, '111728278/ksl/skl', 'xxx', '/')); - }); - - it('set should correctly handle leading and trailing separators', function() { - - var obj2 = { - d: { - e: 'Hello', - f: [ 1, 2, false, 'hi' ] - } - }; - - assert.deepEqual(2, propPath.set(obj2, '....a', 2)); - assert.deepEqual(obj2.a, 2); - - assert.deepEqual(5, propPath.set(obj2, '////a', 5, '/')); - assert.deepEqual(obj2.a, 5); - - assert.deepEqual(4, propPath.set(obj2, 'g....', 4)); - assert.deepEqual(obj2.g, 4); - - assert.deepEqual(6, propPath.set(obj2, 'g////', 6, '/')); - assert.deepEqual(obj2.g, 6); - }); - - it('setSepChar should allow setting of default sep char', function() { - var obj = { - d: { - e: 'Hello', - f: [ 1, 2, false, 'hi' ] - } - }; - - assert.ok(true === propPath.setSepChar('-')); - assert.deepEqual('hi', propPath.get(obj, 'd-f-3')); - assert.deepEqual('hi', propPath.get(obj, 'd/f/3', '/')); - }); -}); diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7..0000000 --- a/node_modules/punycode/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md deleted file mode 100644 index f611016..0000000 --- a/node_modules/punycode/README.md +++ /dev/null @@ -1,148 +0,0 @@ -# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/punycode) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode) - -Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). - -This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: - -* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) -* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) -* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) -* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) -* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) - -This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). - -This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1). - -## Installation - -Via [npm](https://www.npmjs.com/): - -```bash -npm install punycode --save -``` - -In [Node.js](https://nodejs.org/): - -> ⚠️ Note that userland modules don't hide core modules. -> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. -> Use `require('punycode/')` to import userland modules rather than core modules. - -```js -const punycode = require('punycode/'); -``` - -## API - -### `punycode.decode(string)` - -Converts a Punycode string of ASCII symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -### `punycode.encode(string)` - -Converts a string of Unicode symbols to a Punycode string of ASCII symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -### `punycode.toUnicode(input)` - -Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); -// → 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); -// → '☃-⌘.com' - -// decode email addresses -punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); -// → 'джумла@джpумлатест.bрфa' -``` - -### `punycode.toASCII(input)` - -Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); -// → 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); -// → 'xn----dqo34k.com' - -// encode email addresses -punycode.toASCII('джумла@джpумлатест.bрфa'); -// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' -``` - -### `punycode.ucs2` - -#### `punycode.ucs2.decode(string)` - -Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. - -```js -punycode.ucs2.decode('abc'); -// → [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: -punycode.ucs2.decode('\uD834\uDF06'); -// → [0x1D306] -``` - -#### `punycode.ucs2.encode(codePoints)` - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); -// → 'abc' -punycode.ucs2.encode([0x1D306]); -// → '\uD834\uDF06' -``` - -### `punycode.version` - -A string representing the current Punycode.js version number. - -## For maintainers - -### How to publish a new release - -1. On the `main` branch, bump the version number in `package.json`: - - ```sh - npm version patch -m 'Release v%s' - ``` - - Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/). - - Note that this produces a Git commit + tag. - -1. Push the release commit and tag: - - ```sh - git push && git push --tags - ``` - - Our CI then automatically publishes the new release to npm, under both the [`punycode`](https://www.npmjs.com/package/punycode) and [`punycode.js`](https://www.npmjs.com/package/punycode.js) names. - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## License - -Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json deleted file mode 100644 index b8b76fc..0000000 --- a/node_modules/punycode/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "punycode", - "version": "2.3.1", - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "homepage": "https://mths.be/punycode", - "main": "punycode.js", - "jsnext:main": "punycode.es6.js", - "module": "punycode.es6.js", - "engines": { - "node": ">=6" - }, - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "contributors": [ - { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/mathiasbynens/punycode.js.git" - }, - "bugs": "https://github.com/mathiasbynens/punycode.js/issues", - "files": [ - "LICENSE-MIT.txt", - "punycode.js", - "punycode.es6.js" - ], - "scripts": { - "test": "mocha tests", - "build": "node scripts/prepublish.js" - }, - "devDependencies": { - "codecov": "^3.8.3", - "nyc": "^15.1.0", - "mocha": "^10.2.0" - }, - "jspm": { - "map": { - "./punycode.js": { - "node": "@node/punycode" - } - } - } -} diff --git a/node_modules/punycode/punycode.es6.js b/node_modules/punycode/punycode.es6.js deleted file mode 100644 index dadece2..0000000 --- a/node_modules/punycode/punycode.es6.js +++ /dev/null @@ -1,444 +0,0 @@ -'use strict'; - -/** Highest positive signed 32-bit float value */ -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' - -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -const basicToDigit = function(codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); - } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; - } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function(delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function(input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for (let w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - const digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - - } - - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -const encode = function(input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for (let k = base; /* no condition */; k += base) { - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -const toUnicode = function(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -const toASCII = function(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.3.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - -export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; -export default punycode; diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js deleted file mode 100644 index a1ef251..0000000 --- a/node_modules/punycode/punycode.js +++ /dev/null @@ -1,443 +0,0 @@ -'use strict'; - -/** Highest positive signed 32-bit float value */ -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' - -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -const basicToDigit = function(codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); - } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; - } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function(delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function(input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for (let w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - const digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - - } - - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -const encode = function(input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for (let k = base; /* no condition */; k += base) { - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -const toUnicode = function(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -const toASCII = function(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.3.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - -module.exports = punycode; diff --git a/node_modules/randombytes/.travis.yml b/node_modules/randombytes/.travis.yml deleted file mode 100644 index 69fdf71..0000000 --- a/node_modules/randombytes/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: node_js -matrix: - include: - - node_js: '7' - env: TEST_SUITE=test - - node_js: '6' - env: TEST_SUITE=test - - node_js: '5' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=phantom -script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randombytes/.zuul.yml b/node_modules/randombytes/.zuul.yml deleted file mode 100644 index 96d9cfb..0000000 --- a/node_modules/randombytes/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/node_modules/randombytes/LICENSE b/node_modules/randombytes/LICENSE deleted file mode 100644 index fea9d48..0000000 --- a/node_modules/randombytes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 crypto-browserify - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/randombytes/README.md b/node_modules/randombytes/README.md deleted file mode 100644 index 3bacba4..0000000 --- a/node_modules/randombytes/README.md +++ /dev/null @@ -1,14 +0,0 @@ -randombytes -=== - -[![Version](http://img.shields.io/npm/v/randombytes.svg)](https://www.npmjs.org/package/randombytes) [![Build Status](https://travis-ci.org/crypto-browserify/randombytes.svg?branch=master)](https://travis-ci.org/crypto-browserify/randombytes) - -randombytes from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues - -```js -var randomBytes = require('randombytes'); -randomBytes(16);//get 16 random bytes -randomBytes(16, function (err, resp) { - // resp is 16 random bytes -}); -``` diff --git a/node_modules/randombytes/browser.js b/node_modules/randombytes/browser.js deleted file mode 100644 index 0fb0b71..0000000 --- a/node_modules/randombytes/browser.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' - -// limit of Crypto.getRandomValues() -// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues -var MAX_BYTES = 65536 - -// Node supports requesting up to this number of bytes -// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48 -var MAX_UINT32 = 4294967295 - -function oldBrowser () { - throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') -} - -var Buffer = require('safe-buffer').Buffer -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > MAX_UINT32) throw new RangeError('requested too many random bytes') - - var bytes = Buffer.allocUnsafe(size) - - if (size > 0) { // getRandomValues fails on IE if size == 0 - if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues - // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - for (var generated = 0; generated < size; generated += MAX_BYTES) { - // buffer.slice automatically checks if the end is past the end of - // the buffer so we don't have to here - crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)) - } - } else { - crypto.getRandomValues(bytes) - } - } - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} diff --git a/node_modules/randombytes/index.js b/node_modules/randombytes/index.js deleted file mode 100644 index a2d9e39..0000000 --- a/node_modules/randombytes/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('crypto').randomBytes diff --git a/node_modules/randombytes/package.json b/node_modules/randombytes/package.json deleted file mode 100644 index 3623652..0000000 --- a/node_modules/randombytes/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "randombytes", - "version": "2.1.0", - "description": "random bytes from browserify stand alone", - "main": "index.js", - "scripts": { - "test": "standard && node test.js | tspec", - "phantom": "zuul --phantom -- test.js", - "local": "zuul --local --no-coverage -- test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:crypto-browserify/randombytes.git" - }, - "keywords": [ - "crypto", - "random" - ], - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/crypto-browserify/randombytes/issues" - }, - "homepage": "https://github.com/crypto-browserify/randombytes", - "browser": "browser.js", - "devDependencies": { - "phantomjs": "^1.9.9", - "standard": "^10.0.2", - "tap-spec": "^2.1.2", - "tape": "^4.6.3", - "zuul": "^3.7.2" - }, - "dependencies": { - "safe-buffer": "^5.1.0" - } -} diff --git a/node_modules/randombytes/test.js b/node_modules/randombytes/test.js deleted file mode 100644 index f266976..0000000 --- a/node_modules/randombytes/test.js +++ /dev/null @@ -1,81 +0,0 @@ -var test = require('tape') -var randomBytes = require('./') -var MAX_BYTES = 65536 -var MAX_UINT32 = 4294967295 - -test('sync', function (t) { - t.plan(9) - t.equals(randomBytes(0).length, 0, 'len: ' + 0) - t.equals(randomBytes(3).length, 3, 'len: ' + 3) - t.equals(randomBytes(30).length, 30, 'len: ' + 30) - t.equals(randomBytes(300).length, 300, 'len: ' + 300) - t.equals(randomBytes(17 + MAX_BYTES).length, 17 + MAX_BYTES, 'len: ' + 17 + MAX_BYTES) - t.equals(randomBytes(MAX_BYTES * 100).length, MAX_BYTES * 100, 'len: ' + MAX_BYTES * 100) - t.throws(function () { - randomBytes(MAX_UINT32 + 1) - }) - t.throws(function () { - t.equals(randomBytes(-1)) - }) - t.throws(function () { - t.equals(randomBytes('hello')) - }) -}) - -test('async', function (t) { - t.plan(9) - - randomBytes(0, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 0, 'len: ' + 0) - }) - - randomBytes(3, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 3, 'len: ' + 3) - }) - - randomBytes(30, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 30, 'len: ' + 30) - }) - - randomBytes(300, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 300, 'len: ' + 300) - }) - - randomBytes(17 + MAX_BYTES, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 17 + MAX_BYTES, 'len: ' + 17 + MAX_BYTES) - }) - - randomBytes(MAX_BYTES * 100, function (err, resp) { - if (err) throw err - - t.equals(resp.length, MAX_BYTES * 100, 'len: ' + MAX_BYTES * 100) - }) - - t.throws(function () { - randomBytes(MAX_UINT32 + 1, function () { - t.ok(false, 'should not get here') - }) - }) - - t.throws(function () { - randomBytes(-1, function () { - t.ok(false, 'should not get here') - }) - }) - - t.throws(function () { - randomBytes('hello', function () { - t.ok(false, 'should not get here') - }) - }) -}) diff --git a/node_modules/rechoir/CHANGELOG.md b/node_modules/rechoir/CHANGELOG.md deleted file mode 100644 index 79d18d7..0000000 --- a/node_modules/rechoir/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -# Changelog - -## [0.8.0](https://www.github.com/gulpjs/rechoir/compare/v0.7.1...v0.8.0) (2021-07-24) - - -### ⚠ BREAKING CHANGES - -* Normalize repository, dropping node <10.13 support (#40) - -### Miscellaneous Chores - -* Normalize repository, dropping node <10.13 support ([#40](https://www.github.com/gulpjs/rechoir/issues/40)) ([00f5968](https://www.github.com/gulpjs/rechoir/commit/00f59689d0eb9668d939a85e06428a0906587a6f)) diff --git a/node_modules/rechoir/LICENSE b/node_modules/rechoir/LICENSE deleted file mode 100644 index 4f92523..0000000 --- a/node_modules/rechoir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019, 2021 Tyler Kellen , Blaine Bublitz , and Eric Schoffstall - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/rechoir/README.md b/node_modules/rechoir/README.md deleted file mode 100644 index 6e65abb..0000000 --- a/node_modules/rechoir/README.md +++ /dev/null @@ -1,73 +0,0 @@ -

- - - -

- -# rechoir - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] - -Prepare a node environment to require files with different extensions. - -## What is it? - -This module, in conjunction with [interpret]-like objects, can register any filetype the npm ecosystem has a module loader for. This library is a dependency of [liftoff]. - -**Note:** While `rechoir` will automatically load and register transpilers like `coffee-script`, you must provide a local installation. The transpilers are **not** bundled with this module. - -## Usage - -```js -const config = require('interpret').extensions; -const rechoir = require('rechoir'); -rechoir.prepare(config, './test/fixtures/test.coffee'); -rechoir.prepare(config, './test/fixtures/test.csv'); -rechoir.prepare(config, './test/fixtures/test.toml'); - -console.log(require('./test/fixtures/test.coffee')); -console.log(require('./test/fixtures/test.csv')); -console.log(require('./test/fixtures/test.toml')); -``` - -## API - -### `prepare(config, filepath, [cwd], [noThrow])` - -Look for a module loader associated with the provided file and attempt require it. If necessary, run any setup required to inject it into [require.extensions]. - -`config` An [interpret]-like configuration object. - -`filepath` A file whose type you'd like to register a module loader for. - -`cwd` An optional path to start searching for the module required to load the requested file. Defaults to the directory of `filepath`. - -`noThrow` An optional boolean indicating if the method should avoid throwing. - -If calling this method is successful (e.g. it doesn't throw), you can now require files of the type you requested natively. - -An error with a `failures` property will be thrown if the module loader(s) configured for a given extension cannot be registered. - -If a loader is already registered, this will simply return `true`. - -## License - -MIT - - -[downloads-image]: https://img.shields.io/npm/dm/rechoir.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/rechoir -[npm-image]: https://img.shields.io/npm/v/rechoir.svg?style=flat-square - -[ci-url]: https://github.com/gulpjs/rechoir/actions?query=workflow:dev -[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/rechoir/dev?style=flat-square - -[coveralls-url]: https://coveralls.io/r/gulpjs/rechoir -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/rechoir/master.svg - - - -[interpret]: https://github.com/gulpjs/interpret -[require.extensions]: https://nodejs.org/api/modules.html#modules_require_extensions -[liftoff]: https://github.com/js-cli/js-liftoff - diff --git a/node_modules/rechoir/index.js b/node_modules/rechoir/index.js deleted file mode 100644 index cc76ae3..0000000 --- a/node_modules/rechoir/index.js +++ /dev/null @@ -1,69 +0,0 @@ -var path = require('path'); - -var extension = require('./lib/extension'); -var normalize = require('./lib/normalize'); -var register = require('./lib/register'); - -exports.prepare = function (extensions, filepath, cwd, nothrow) { - var config, usedExtension, err, option, attempt, error; - var attempts = []; - var onlyErrors = true; - var exts = extension(filepath); - - if (exts) { - exts.some(function (ext) { - usedExtension = ext; - config = normalize(extensions[ext]); - return !!config; - }); - } - - if (Object.keys(require.extensions).indexOf(usedExtension) !== -1) { - return true; - } - - if (!config) { - if (nothrow) { - return; - } - - throw new Error('No module loader found for "' + usedExtension + '".'); - } - - if (!cwd) { - cwd = path.dirname(path.resolve(filepath)); - } - if (!Array.isArray(config)) { - config = [config]; - } - - for (var i in config) { - option = config[i]; - attempt = register(cwd, option.module, option.register); - error = attempt instanceof Error ? attempt : null; - if (error) { - attempt = null; - } - attempts.push({ - moduleName: option.module, - module: attempt, - error: error, - }); - if (!error) { - onlyErrors = false; - break; - } - } - if (onlyErrors) { - err = new Error( - 'Unable to use specified module loaders for "' + usedExtension + '".' - ); - err.failures = attempts; - if (nothrow) { - return err; - } - - throw err; - } - return attempts; -}; diff --git a/node_modules/rechoir/lib/extension.js b/node_modules/rechoir/lib/extension.js deleted file mode 100644 index 6fe5613..0000000 --- a/node_modules/rechoir/lib/extension.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var path = require('path'); - -function getLongExtension(basename) { - if (basename[basename.length - 1] === '.') { - return null; - } - - var startIndex = basename[0] === '.' ? 1 : 0; - - var dotIndex = basename.indexOf('.', startIndex); - if (dotIndex <= startIndex) { - return null; - } - - return basename.slice(dotIndex); -} - -function getPossibleExtensions(longExtension) { - var arr = [longExtension]; - var len = longExtension.length; - var startIndex = 1; - - while (startIndex < len) { - var dotIndex = longExtension.indexOf('.', startIndex); - if (dotIndex < 0) { - break; - } - arr.push(longExtension.slice(dotIndex)); - startIndex = dotIndex + 1; - } - - return arr; -} - -module.exports = function (input) { - var basename = path.basename(input); - var longExtension = getLongExtension(basename); - if (!longExtension) { - return; - } - return getPossibleExtensions(longExtension); -}; diff --git a/node_modules/rechoir/lib/normalize.js b/node_modules/rechoir/lib/normalize.js deleted file mode 100644 index af1122f..0000000 --- a/node_modules/rechoir/lib/normalize.js +++ /dev/null @@ -1,13 +0,0 @@ -function normalizer(config) { - if (typeof config === 'string') { - return { module: config }; - } - return config; -} - -module.exports = function (config) { - if (Array.isArray(config)) { - return config.map(normalizer); - } - return normalizer(config); -}; diff --git a/node_modules/rechoir/lib/register.js b/node_modules/rechoir/lib/register.js deleted file mode 100644 index 843e8ad..0000000 --- a/node_modules/rechoir/lib/register.js +++ /dev/null @@ -1,15 +0,0 @@ -var resolve = require('resolve'); - -module.exports = function (cwd, moduleName, register) { - var result; - try { - var modulePath = resolve.sync(moduleName, { basedir: cwd }); - result = require(modulePath); - if (typeof register === 'function') { - register(result); - } - } catch (e) { - result = e; - } - return result; -}; diff --git a/node_modules/rechoir/package.json b/node_modules/rechoir/package.json deleted file mode 100644 index 9dad49e..0000000 --- a/node_modules/rechoir/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "rechoir", - "version": "0.8.0", - "description": "Prepare a node environment to require files with different extensions.", - "author": "Gulp Team (http://gulpjs.com/)", - "contributors": [ - "Blaine Bublitz ", - "Tyler Kellen (http://goingslowly.com/)" - ], - "repository": "gulpjs/rechoir", - "license": "MIT", - "engines": { - "node": ">= 10.13.0" - }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js", - "lib/" - ], - "scripts": { - "lint": "eslint .", - "pretest": "rm -rf tmp/ && npm run lint", - "test": "nyc mocha --async-only" - }, - "dependencies": { - "resolve": "^1.20.0" - }, - "devDependencies": { - "eslint": "^7.21.0", - "eslint-config-gulp": "^5.0.1", - "expect": "^27.0.0", - "mocha": "^8.3.0", - "nyc": "^15.1.0" - }, - "nyc": { - "reporter": [ - "lcov", - "text-summary" - ] - }, - "prettier": { - "singleQuote": true - }, - "keywords": [ - "require", - "loader", - "extension", - "extensions", - "prepare" - ] -} diff --git a/node_modules/resolve-cwd/index.d.ts b/node_modules/resolve-cwd/index.d.ts deleted file mode 100644 index 4cc6003..0000000 --- a/node_modules/resolve-cwd/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -declare const resolveCwd: { - /** - Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory. - - @param moduleId - What you would use in `require()`. - @returns The resolved module path. - @throws When the module can't be found. - - @example - ``` - import resolveCwd = require('resolve-cwd'); - - console.log(__dirname); - //=> '/Users/sindresorhus/rainbow' - - console.log(process.cwd()); - //=> '/Users/sindresorhus/unicorn' - - console.log(resolveCwd('./foo')); - //=> '/Users/sindresorhus/unicorn/foo.js' - ``` - */ - (moduleId: string): string; - - /** - Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory. - - @param moduleId - What you would use in `require()`. - @returns The resolved module path. Returns `undefined` instead of throwing when the module can't be found. - - @example - ``` - import resolveCwd = require('resolve-cwd'); - - console.log(__dirname); - //=> '/Users/sindresorhus/rainbow' - - console.log(process.cwd()); - //=> '/Users/sindresorhus/unicorn' - - console.log(resolveCwd.silent('./foo')); - //=> '/Users/sindresorhus/unicorn/foo.js' - ``` - */ - silent(moduleId: string): string | undefined; -}; - -export = resolveCwd; diff --git a/node_modules/resolve-cwd/index.js b/node_modules/resolve-cwd/index.js deleted file mode 100644 index 82dd33c..0000000 --- a/node_modules/resolve-cwd/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -const resolveFrom = require('resolve-from'); - -module.exports = moduleId => resolveFrom(process.cwd(), moduleId); -module.exports.silent = moduleId => resolveFrom.silent(process.cwd(), moduleId); diff --git a/node_modules/resolve-cwd/license b/node_modules/resolve-cwd/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/resolve-cwd/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/resolve-cwd/package.json b/node_modules/resolve-cwd/package.json deleted file mode 100644 index 70dface..0000000 --- a/node_modules/resolve-cwd/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "resolve-cwd", - "version": "3.0.0", - "description": "Resolve the path of a module like `require.resolve()` but from the current working directory", - "license": "MIT", - "repository": "sindresorhus/resolve-cwd", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "require", - "resolve", - "path", - "module", - "from", - "like", - "cwd", - "current", - "working", - "directory", - "import" - ], - "dependencies": { - "resolve-from": "^5.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/resolve-cwd/readme.md b/node_modules/resolve-cwd/readme.md deleted file mode 100644 index d9f3129..0000000 --- a/node_modules/resolve-cwd/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# resolve-cwd [![Build Status](https://travis-ci.org/sindresorhus/resolve-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-cwd) - -> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory - - -## Install - -``` -$ npm install resolve-cwd -``` - - -## Usage - -```js -const resolveCwd = require('resolve-cwd'); - -console.log(__dirname); -//=> '/Users/sindresorhus/rainbow' - -console.log(process.cwd()); -//=> '/Users/sindresorhus/unicorn' - -console.log(resolveCwd('./foo')); -//=> '/Users/sindresorhus/unicorn/foo.js' -``` - - -## API - -### resolveCwd(moduleId) - -Like `require()`, throws when the module can't be found. - -### resolveCwd.silent(moduleId) - -Returns `undefined` instead of throwing when the module can't be found. - -#### moduleId - -Type: `string` - -What you would use in `require()`. - - -## Related - -- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path -- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path -- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory -- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point -- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily -- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/resolve-from/index.d.ts b/node_modules/resolve-from/index.d.ts deleted file mode 100644 index dd5f5ef..0000000 --- a/node_modules/resolve-from/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare const resolveFrom: { - /** - Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. - - @param fromDirectory - Directory to resolve from. - @param moduleId - What you would use in `require()`. - @returns Resolved module path. Throws when the module can't be found. - - @example - ``` - import resolveFrom = require('resolve-from'); - - // There is a file at `./foo/bar.js` - - resolveFrom('foo', './bar'); - //=> '/Users/sindresorhus/dev/test/foo/bar.js' - ``` - */ - (fromDirectory: string, moduleId: string): string; - - /** - Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. - - @param fromDirectory - Directory to resolve from. - @param moduleId - What you would use in `require()`. - @returns Resolved module path or `undefined` when the module can't be found. - */ - silent(fromDirectory: string, moduleId: string): string | undefined; -}; - -export = resolveFrom; diff --git a/node_modules/resolve-from/index.js b/node_modules/resolve-from/index.js deleted file mode 100644 index 44f291c..0000000 --- a/node_modules/resolve-from/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const path = require('path'); -const Module = require('module'); -const fs = require('fs'); - -const resolveFrom = (fromDirectory, moduleId, silent) => { - if (typeof fromDirectory !== 'string') { - throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); - } - - if (typeof moduleId !== 'string') { - throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); - } - - try { - fromDirectory = fs.realpathSync(fromDirectory); - } catch (error) { - if (error.code === 'ENOENT') { - fromDirectory = path.resolve(fromDirectory); - } else if (silent) { - return; - } else { - throw error; - } - } - - const fromFile = path.join(fromDirectory, 'noop.js'); - - const resolveFileName = () => Module._resolveFilename(moduleId, { - id: fromFile, - filename: fromFile, - paths: Module._nodeModulePaths(fromDirectory) - }); - - if (silent) { - try { - return resolveFileName(); - } catch (error) { - return; - } - } - - return resolveFileName(); -}; - -module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId); -module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true); diff --git a/node_modules/resolve-from/license b/node_modules/resolve-from/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/resolve-from/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/resolve-from/package.json b/node_modules/resolve-from/package.json deleted file mode 100644 index 733df16..0000000 --- a/node_modules/resolve-from/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "resolve-from", - "version": "5.0.0", - "description": "Resolve the path of a module like `require.resolve()` but from a given path", - "license": "MIT", - "repository": "sindresorhus/resolve-from", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "require", - "resolve", - "path", - "module", - "from", - "like", - "import" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md deleted file mode 100644 index fd4f46f..0000000 --- a/node_modules/resolve-from/readme.md +++ /dev/null @@ -1,72 +0,0 @@ -# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) - -> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path - - -## Install - -``` -$ npm install resolve-from -``` - - -## Usage - -```js -const resolveFrom = require('resolve-from'); - -// There is a file at `./foo/bar.js` - -resolveFrom('foo', './bar'); -//=> '/Users/sindresorhus/dev/test/foo/bar.js' -``` - - -## API - -### resolveFrom(fromDirectory, moduleId) - -Like `require()`, throws when the module can't be found. - -### resolveFrom.silent(fromDirectory, moduleId) - -Returns `undefined` instead of throwing when the module can't be found. - -#### fromDirectory - -Type: `string` - -Directory to resolve from. - -#### moduleId - -Type: `string` - -What you would use in `require()`. - - -## Tip - -Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times: - -```js -const resolveFromFoo = resolveFrom.bind(null, 'foo'); - -resolveFromFoo('./bar'); -resolveFromFoo('./baz'); -``` - - -## Related - -- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory -- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path -- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory -- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point -- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily -- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/resolve/.editorconfig b/node_modules/resolve/.editorconfig deleted file mode 100644 index d63f0bb..0000000 --- a/node_modules/resolve/.editorconfig +++ /dev/null @@ -1,37 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 200 - -[*.js] -block_comment_start = /* -block_comment = * -block_comment_end = */ - -[*.yml] -indent_size = 1 - -[package.json] -indent_style = tab - -[lib/core.json] -indent_style = tab - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[{*.json,Makefile}] -max_line_length = off - -[test/{dotdot,resolver,module_dir,multirepo,node_path,pathfilter,precedence}/**/*] -indent_style = off -indent_size = off -max_line_length = off -insert_final_newline = off diff --git a/node_modules/resolve/.eslintrc b/node_modules/resolve/.eslintrc deleted file mode 100644 index ad05dd8..0000000 --- a/node_modules/resolve/.eslintrc +++ /dev/null @@ -1,65 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "indent": [2, 4], - "strict": 0, - "complexity": 0, - "consistent-return": 0, - "curly": 0, - "dot-notation": [2, { "allowKeywords": true }], - "func-name-matching": 0, - "func-style": 0, - "global-require": 1, - "id-length": [2, { "min": 1, "max": 40 }], - "max-lines": [2, 350], - "max-lines-per-function": 0, - "max-nested-callbacks": 0, - "max-params": 0, - "max-statements-per-line": [2, { "max": 2 }], - "max-statements": 0, - "no-magic-numbers": 0, - "no-shadow": 0, - "no-use-before-define": 0, - "sort-keys": 0, - }, - "overrides": [ - { - "files": "bin/**", - "rules": { - "no-process-exit": "off", - }, - }, - { - "files": "example/**", - "rules": { - "no-console": 0, - }, - }, - { - "files": "test/resolver/nested_symlinks/mylib/*.js", - "rules": { - "no-throw-literal": 0, - }, - }, - { - "files": "test/**", - "parserOptions": { - "ecmaVersion": 5, - "allowReserved": false, - }, - "rules": { - "dot-notation": [2, { "allowPattern": "throws" }], - "max-lines": 0, - "max-lines-per-function": 0, - "no-unused-vars": [2, { "vars": "all", "args": "none" }], - }, - }, - ], - - "ignorePatterns": [ - "./test/resolver/malformed_package_json/package.json", - ], -} diff --git a/node_modules/resolve/.github/FUNDING.yml b/node_modules/resolve/.github/FUNDING.yml deleted file mode 100644 index d9c0595..0000000 --- a/node_modules/resolve/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/resolve -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/resolve/LICENSE b/node_modules/resolve/LICENSE deleted file mode 100644 index ff4fce2..0000000 --- a/node_modules/resolve/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2012 James Halliday - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/resolve/SECURITY.md b/node_modules/resolve/SECURITY.md deleted file mode 100644 index 82e4285..0000000 --- a/node_modules/resolve/SECURITY.md +++ /dev/null @@ -1,3 +0,0 @@ -# Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. diff --git a/node_modules/resolve/async.js b/node_modules/resolve/async.js deleted file mode 100644 index f38c581..0000000 --- a/node_modules/resolve/async.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/async'); diff --git a/node_modules/resolve/bin/resolve b/node_modules/resolve/bin/resolve deleted file mode 100644 index 21d1a87..0000000 --- a/node_modules/resolve/bin/resolve +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -var path = require('path'); -var fs = require('fs'); - -if ( - String(process.env.npm_lifecycle_script).slice(0, 8) !== 'resolve ' - && ( - !process.argv - || process.argv.length < 2 - || (process.argv[1] !== __filename && fs.statSync(process.argv[1]).ino !== fs.statSync(__filename).ino) - || (process.env.npm_lifecycle_event !== 'npx' && process.env._ && fs.realpathSync(path.resolve(process.env._)) !== __filename) - ) -) { - console.error('Error: `resolve` must be run directly as an executable'); - process.exit(1); -} - -var supportsPreserveSymlinkFlag = require('supports-preserve-symlinks-flag'); - -var preserveSymlinks = false; -for (var i = 2; i < process.argv.length; i += 1) { - if (process.argv[i].slice(0, 2) === '--') { - if (supportsPreserveSymlinkFlag && process.argv[i] === '--preserve-symlinks') { - preserveSymlinks = true; - } else if (process.argv[i].length > 2) { - console.error('Unknown argument ' + process.argv[i].replace(/[=].*$/, '')); - process.exit(2); - } - process.argv.splice(i, 1); - i -= 1; - if (process.argv[i] === '--') { break; } // eslint-disable-line no-restricted-syntax - } -} - -if (process.argv.length < 3) { - console.error('Error: `resolve` expects a specifier'); - process.exit(2); -} - -var resolve = require('../'); - -var result = resolve.sync(process.argv[2], { - basedir: process.cwd(), - preserveSymlinks: preserveSymlinks -}); - -console.log(result); diff --git a/node_modules/resolve/example/async.js b/node_modules/resolve/example/async.js deleted file mode 100644 index 20e65dc..0000000 --- a/node_modules/resolve/example/async.js +++ /dev/null @@ -1,5 +0,0 @@ -var resolve = require('../'); -resolve('tap', { basedir: __dirname }, function (err, res) { - if (err) console.error(err); - else console.log(res); -}); diff --git a/node_modules/resolve/example/sync.js b/node_modules/resolve/example/sync.js deleted file mode 100644 index 54b2cc1..0000000 --- a/node_modules/resolve/example/sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var resolve = require('../'); -var res = resolve.sync('tap', { basedir: __dirname }); -console.log(res); diff --git a/node_modules/resolve/index.js b/node_modules/resolve/index.js deleted file mode 100644 index 125d814..0000000 --- a/node_modules/resolve/index.js +++ /dev/null @@ -1,6 +0,0 @@ -var async = require('./lib/async'); -async.core = require('./lib/core'); -async.isCore = require('./lib/is-core'); -async.sync = require('./lib/sync'); - -module.exports = async; diff --git a/node_modules/resolve/lib/async.js b/node_modules/resolve/lib/async.js deleted file mode 100644 index 60d2555..0000000 --- a/node_modules/resolve/lib/async.js +++ /dev/null @@ -1,329 +0,0 @@ -var fs = require('fs'); -var getHomedir = require('./homedir'); -var path = require('path'); -var caller = require('./caller'); -var nodeModulesPaths = require('./node-modules-paths'); -var normalizeOptions = require('./normalize-options'); -var isCore = require('is-core-module'); - -var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; - -var homedir = getHomedir(); -var defaultPaths = function () { - return [ - path.join(homedir, '.node_modules'), - path.join(homedir, '.node_libraries') - ]; -}; - -var defaultIsFile = function isFile(file, cb) { - fs.stat(file, function (err, stat) { - if (!err) { - return cb(null, stat.isFile() || stat.isFIFO()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); -}; - -var defaultIsDir = function isDirectory(dir, cb) { - fs.stat(dir, function (err, stat) { - if (!err) { - return cb(null, stat.isDirectory()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); -}; - -var defaultRealpath = function realpath(x, cb) { - realpathFS(x, function (realpathErr, realPath) { - if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); - else cb(null, realpathErr ? x : realPath); - }); -}; - -var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { - if (opts && opts.preserveSymlinks === false) { - realpath(x, cb); - } else { - cb(null, x); - } -}; - -var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) { - readFile(pkgfile, function (readFileErr, body) { - if (readFileErr) cb(readFileErr); - else { - try { - var pkg = JSON.parse(body); - cb(null, pkg); - } catch (jsonErr) { - cb(null); - } - } - }); -}; - -var getPackageCandidates = function getPackageCandidates(x, start, opts) { - var dirs = nodeModulesPaths(start, opts, x); - for (var i = 0; i < dirs.length; i++) { - dirs[i] = path.join(dirs[i], x); - } - return dirs; -}; - -module.exports = function resolve(x, options, callback) { - var cb = callback; - var opts = options; - if (typeof options === 'function') { - cb = opts; - opts = {}; - } - if (typeof x !== 'string') { - var err = new TypeError('Path must be a string.'); - return process.nextTick(function () { - cb(err); - }); - } - - opts = normalizeOptions(x, opts); - - var isFile = opts.isFile || defaultIsFile; - var isDirectory = opts.isDirectory || defaultIsDir; - var readFile = opts.readFile || fs.readFile; - var realpath = opts.realpath || defaultRealpath; - var readPackage = opts.readPackage || defaultReadPackage; - if (opts.readFile && opts.readPackage) { - var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.'); - return process.nextTick(function () { - cb(conflictErr); - }); - } - var packageIterator = opts.packageIterator; - - var extensions = opts.extensions || ['.js']; - var includeCoreModules = opts.includeCoreModules !== false; - var basedir = opts.basedir || path.dirname(caller()); - var parent = opts.filename || basedir; - - opts.paths = opts.paths || defaultPaths(); - - // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = path.resolve(basedir); - - maybeRealpath( - realpath, - absoluteStart, - opts, - function (err, realStart) { - if (err) cb(err); - else init(realStart); - } - ); - - var res; - function init(basedir) { - if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { - res = path.resolve(basedir, x); - if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; - if ((/\/$/).test(x) && res === basedir) { - loadAsDirectory(res, opts.package, onfile); - } else loadAsFile(res, opts.package, onfile); - } else if (includeCoreModules && isCore(x)) { - return cb(null, x); - } else loadNodeModules(x, basedir, function (err, n, pkg) { - if (err) cb(err); - else if (n) { - return maybeRealpath(realpath, n, opts, function (err, realN) { - if (err) { - cb(err); - } else { - cb(null, realN, pkg); - } - }); - } else { - var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - moduleError.code = 'MODULE_NOT_FOUND'; - cb(moduleError); - } - }); - } - - function onfile(err, m, pkg) { - if (err) cb(err); - else if (m) cb(null, m, pkg); - else loadAsDirectory(res, function (err, d, pkg) { - if (err) cb(err); - else if (d) { - maybeRealpath(realpath, d, opts, function (err, realD) { - if (err) { - cb(err); - } else { - cb(null, realD, pkg); - } - }); - } else { - var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - moduleError.code = 'MODULE_NOT_FOUND'; - cb(moduleError); - } - }); - } - - function loadAsFile(x, thePackage, callback) { - var loadAsFilePackage = thePackage; - var cb = callback; - if (typeof loadAsFilePackage === 'function') { - cb = loadAsFilePackage; - loadAsFilePackage = undefined; - } - - var exts = [''].concat(extensions); - load(exts, x, loadAsFilePackage); - - function load(exts, x, loadPackage) { - if (exts.length === 0) return cb(null, undefined, loadPackage); - var file = x + exts[0]; - - var pkg = loadPackage; - if (pkg) onpkg(null, pkg); - else loadpkg(path.dirname(file), onpkg); - - function onpkg(err, pkg_, dir) { - pkg = pkg_; - if (err) return cb(err); - if (dir && pkg && opts.pathFilter) { - var rfile = path.relative(dir, file); - var rel = rfile.slice(0, rfile.length - exts[0].length); - var r = opts.pathFilter(pkg, x, rel); - if (r) return load( - [''].concat(extensions.slice()), - path.resolve(dir, r), - pkg - ); - } - isFile(file, onex); - } - function onex(err, ex) { - if (err) return cb(err); - if (ex) return cb(null, file, pkg); - load(exts.slice(1), x, pkg); - } - } - } - - function loadpkg(dir, cb) { - if (dir === '' || dir === '/') return cb(null); - if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { - return cb(null); - } - if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); - - maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { - if (unwrapErr) return loadpkg(path.dirname(dir), cb); - var pkgfile = path.join(pkgdir, 'package.json'); - isFile(pkgfile, function (err, ex) { - // on err, ex is false - if (!ex) return loadpkg(path.dirname(dir), cb); - - readPackage(readFile, pkgfile, function (err, pkgParam) { - if (err) cb(err); - - var pkg = pkgParam; - - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - cb(null, pkg, dir); - }); - }); - }); - } - - function loadAsDirectory(x, loadAsDirectoryPackage, callback) { - var cb = callback; - var fpkg = loadAsDirectoryPackage; - if (typeof fpkg === 'function') { - cb = fpkg; - fpkg = opts.package; - } - - maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { - if (unwrapErr) return cb(unwrapErr); - var pkgfile = path.join(pkgdir, 'package.json'); - isFile(pkgfile, function (err, ex) { - if (err) return cb(err); - if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); - - readPackage(readFile, pkgfile, function (err, pkgParam) { - if (err) return cb(err); - - var pkg = pkgParam; - - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - - if (pkg && pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - return cb(mainError); - } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); - - var dir = path.resolve(x, pkg.main); - loadAsDirectory(dir, pkg, function (err, n, pkg) { - if (err) return cb(err); - if (n) return cb(null, n, pkg); - loadAsFile(path.join(x, 'index'), pkg, cb); - }); - }); - return; - } - - loadAsFile(path.join(x, '/index'), pkg, cb); - }); - }); - }); - } - - function processDirs(cb, dirs) { - if (dirs.length === 0) return cb(null, undefined); - var dir = dirs[0]; - - isDirectory(path.dirname(dir), isdir); - - function isdir(err, isdir) { - if (err) return cb(err); - if (!isdir) return processDirs(cb, dirs.slice(1)); - loadAsFile(dir, opts.package, onfile); - } - - function onfile(err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - loadAsDirectory(dir, opts.package, ondir); - } - - function ondir(err, n, pkg) { - if (err) return cb(err); - if (n) return cb(null, n, pkg); - processDirs(cb, dirs.slice(1)); - } - } - function loadNodeModules(x, start, cb) { - var thunk = function () { return getPackageCandidates(x, start, opts); }; - processDirs( - cb, - packageIterator ? packageIterator(x, start, thunk, opts) : thunk() - ); - } -}; diff --git a/node_modules/resolve/lib/caller.js b/node_modules/resolve/lib/caller.js deleted file mode 100644 index b14a280..0000000 --- a/node_modules/resolve/lib/caller.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function () { - // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - var origPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = function (_, stack) { return stack; }; - var stack = (new Error()).stack; - Error.prepareStackTrace = origPrepareStackTrace; - return stack[2].getFileName(); -}; diff --git a/node_modules/resolve/lib/core.js b/node_modules/resolve/lib/core.js deleted file mode 100644 index 57b048f..0000000 --- a/node_modules/resolve/lib/core.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var isCoreModule = require('is-core-module'); -var data = require('./core.json'); - -var core = {}; -for (var mod in data) { // eslint-disable-line no-restricted-syntax - if (Object.prototype.hasOwnProperty.call(data, mod)) { - core[mod] = isCoreModule(mod); - } -} -module.exports = core; diff --git a/node_modules/resolve/lib/core.json b/node_modules/resolve/lib/core.json deleted file mode 100644 index 3cda693..0000000 --- a/node_modules/resolve/lib/core.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "assert": true, - "node:assert": [">= 14.18 && < 15", ">= 16"], - "assert/strict": ">= 15", - "node:assert/strict": ">= 16", - "async_hooks": ">= 8", - "node:async_hooks": [">= 14.18 && < 15", ">= 16"], - "buffer_ieee754": ">= 0.5 && < 0.9.7", - "buffer": true, - "node:buffer": [">= 14.18 && < 15", ">= 16"], - "child_process": true, - "node:child_process": [">= 14.18 && < 15", ">= 16"], - "cluster": ">= 0.5", - "node:cluster": [">= 14.18 && < 15", ">= 16"], - "console": true, - "node:console": [">= 14.18 && < 15", ">= 16"], - "constants": true, - "node:constants": [">= 14.18 && < 15", ">= 16"], - "crypto": true, - "node:crypto": [">= 14.18 && < 15", ">= 16"], - "_debug_agent": ">= 1 && < 8", - "_debugger": "< 8", - "dgram": true, - "node:dgram": [">= 14.18 && < 15", ">= 16"], - "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"], - "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], - "dns": true, - "node:dns": [">= 14.18 && < 15", ">= 16"], - "dns/promises": ">= 15", - "node:dns/promises": ">= 16", - "domain": ">= 0.7.12", - "node:domain": [">= 14.18 && < 15", ">= 16"], - "events": true, - "node:events": [">= 14.18 && < 15", ">= 16"], - "freelist": "< 6", - "fs": true, - "node:fs": [">= 14.18 && < 15", ">= 16"], - "fs/promises": [">= 10 && < 10.1", ">= 14"], - "node:fs/promises": [">= 14.18 && < 15", ">= 16"], - "_http_agent": ">= 0.11.1", - "node:_http_agent": [">= 14.18 && < 15", ">= 16"], - "_http_client": ">= 0.11.1", - "node:_http_client": [">= 14.18 && < 15", ">= 16"], - "_http_common": ">= 0.11.1", - "node:_http_common": [">= 14.18 && < 15", ">= 16"], - "_http_incoming": ">= 0.11.1", - "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], - "_http_outgoing": ">= 0.11.1", - "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], - "_http_server": ">= 0.11.1", - "node:_http_server": [">= 14.18 && < 15", ">= 16"], - "http": true, - "node:http": [">= 14.18 && < 15", ">= 16"], - "http2": ">= 8.8", - "node:http2": [">= 14.18 && < 15", ">= 16"], - "https": true, - "node:https": [">= 14.18 && < 15", ">= 16"], - "inspector": ">= 8", - "node:inspector": [">= 14.18 && < 15", ">= 16"], - "inspector/promises": [">= 19"], - "node:inspector/promises": [">= 19"], - "_linklist": "< 8", - "module": true, - "node:module": [">= 14.18 && < 15", ">= 16"], - "net": true, - "node:net": [">= 14.18 && < 15", ">= 16"], - "node-inspect/lib/_inspect": ">= 7.6 && < 12", - "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", - "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", - "os": true, - "node:os": [">= 14.18 && < 15", ">= 16"], - "path": true, - "node:path": [">= 14.18 && < 15", ">= 16"], - "path/posix": ">= 15.3", - "node:path/posix": ">= 16", - "path/win32": ">= 15.3", - "node:path/win32": ">= 16", - "perf_hooks": ">= 8.5", - "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], - "process": ">= 1", - "node:process": [">= 14.18 && < 15", ">= 16"], - "punycode": ">= 0.5", - "node:punycode": [">= 14.18 && < 15", ">= 16"], - "querystring": true, - "node:querystring": [">= 14.18 && < 15", ">= 16"], - "readline": true, - "node:readline": [">= 14.18 && < 15", ">= 16"], - "readline/promises": ">= 17", - "node:readline/promises": ">= 17", - "repl": true, - "node:repl": [">= 14.18 && < 15", ">= 16"], - "smalloc": ">= 0.11.5 && < 3", - "_stream_duplex": ">= 0.9.4", - "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], - "_stream_transform": ">= 0.9.4", - "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], - "_stream_wrap": ">= 1.4.1", - "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], - "_stream_passthrough": ">= 0.9.4", - "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], - "_stream_readable": ">= 0.9.4", - "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], - "_stream_writable": ">= 0.9.4", - "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], - "stream": true, - "node:stream": [">= 14.18 && < 15", ">= 16"], - "stream/consumers": ">= 16.7", - "node:stream/consumers": ">= 16.7", - "stream/promises": ">= 15", - "node:stream/promises": ">= 16", - "stream/web": ">= 16.5", - "node:stream/web": ">= 16.5", - "string_decoder": true, - "node:string_decoder": [">= 14.18 && < 15", ">= 16"], - "sys": [">= 0.4 && < 0.7", ">= 0.8"], - "node:sys": [">= 14.18 && < 15", ">= 16"], - "test/reporters": ">= 19.9 && < 20.2", - "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], - "node:test": [">= 16.17 && < 17", ">= 18"], - "timers": true, - "node:timers": [">= 14.18 && < 15", ">= 16"], - "timers/promises": ">= 15", - "node:timers/promises": ">= 16", - "_tls_common": ">= 0.11.13", - "node:_tls_common": [">= 14.18 && < 15", ">= 16"], - "_tls_legacy": ">= 0.11.3 && < 10", - "_tls_wrap": ">= 0.11.3", - "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], - "tls": true, - "node:tls": [">= 14.18 && < 15", ">= 16"], - "trace_events": ">= 10", - "node:trace_events": [">= 14.18 && < 15", ">= 16"], - "tty": true, - "node:tty": [">= 14.18 && < 15", ">= 16"], - "url": true, - "node:url": [">= 14.18 && < 15", ">= 16"], - "util": true, - "node:util": [">= 14.18 && < 15", ">= 16"], - "util/types": ">= 15.3", - "node:util/types": ">= 16", - "v8/tools/arguments": ">= 10 && < 12", - "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], - "v8": ">= 1", - "node:v8": [">= 14.18 && < 15", ">= 16"], - "vm": true, - "node:vm": [">= 14.18 && < 15", ">= 16"], - "wasi": [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], - "node:wasi": [">= 18.17 && < 19", ">= 20"], - "worker_threads": ">= 11.7", - "node:worker_threads": [">= 14.18 && < 15", ">= 16"], - "zlib": ">= 0.5", - "node:zlib": [">= 14.18 && < 15", ">= 16"] -} diff --git a/node_modules/resolve/lib/homedir.js b/node_modules/resolve/lib/homedir.js deleted file mode 100644 index 5ffdf73..0000000 --- a/node_modules/resolve/lib/homedir.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var os = require('os'); - -// adapted from https://github.com/sindresorhus/os-homedir/blob/11e089f4754db38bb535e5a8416320c4446e8cfd/index.js - -module.exports = os.homedir || function homedir() { - var home = process.env.HOME; - var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; - - if (process.platform === 'win32') { - return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null; - } - - if (process.platform === 'darwin') { - return home || (user ? '/Users/' + user : null); - } - - if (process.platform === 'linux') { - return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); // eslint-disable-line no-extra-parens - } - - return home || null; -}; diff --git a/node_modules/resolve/lib/is-core.js b/node_modules/resolve/lib/is-core.js deleted file mode 100644 index 537f5c7..0000000 --- a/node_modules/resolve/lib/is-core.js +++ /dev/null @@ -1,5 +0,0 @@ -var isCoreModule = require('is-core-module'); - -module.exports = function isCore(x) { - return isCoreModule(x); -}; diff --git a/node_modules/resolve/lib/node-modules-paths.js b/node_modules/resolve/lib/node-modules-paths.js deleted file mode 100644 index 1cff010..0000000 --- a/node_modules/resolve/lib/node-modules-paths.js +++ /dev/null @@ -1,42 +0,0 @@ -var path = require('path'); -var parse = path.parse || require('path-parse'); // eslint-disable-line global-require - -var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { - var prefix = '/'; - if ((/^([A-Za-z]:)/).test(absoluteStart)) { - prefix = ''; - } else if ((/^\\\\/).test(absoluteStart)) { - prefix = '\\\\'; - } - - var paths = [absoluteStart]; - var parsed = parse(absoluteStart); - while (parsed.dir !== paths[paths.length - 1]) { - paths.push(parsed.dir); - parsed = parse(parsed.dir); - } - - return paths.reduce(function (dirs, aPath) { - return dirs.concat(modules.map(function (moduleDir) { - return path.resolve(prefix, aPath, moduleDir); - })); - }, []); -}; - -module.exports = function nodeModulesPaths(start, opts, request) { - var modules = opts && opts.moduleDirectory - ? [].concat(opts.moduleDirectory) - : ['node_modules']; - - if (opts && typeof opts.paths === 'function') { - return opts.paths( - request, - start, - function () { return getNodeModulesDirs(start, modules); }, - opts - ); - } - - var dirs = getNodeModulesDirs(start, modules); - return opts && opts.paths ? dirs.concat(opts.paths) : dirs; -}; diff --git a/node_modules/resolve/lib/normalize-options.js b/node_modules/resolve/lib/normalize-options.js deleted file mode 100644 index 4b56904..0000000 --- a/node_modules/resolve/lib/normalize-options.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = function (x, opts) { - /** - * This file is purposefully a passthrough. It's expected that third-party - * environments will override it at runtime in order to inject special logic - * into `resolve` (by manipulating the options). One such example is the PnP - * code path in Yarn. - */ - - return opts || {}; -}; diff --git a/node_modules/resolve/lib/sync.js b/node_modules/resolve/lib/sync.js deleted file mode 100644 index 0b6cd58..0000000 --- a/node_modules/resolve/lib/sync.js +++ /dev/null @@ -1,208 +0,0 @@ -var isCore = require('is-core-module'); -var fs = require('fs'); -var path = require('path'); -var getHomedir = require('./homedir'); -var caller = require('./caller'); -var nodeModulesPaths = require('./node-modules-paths'); -var normalizeOptions = require('./normalize-options'); - -var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; - -var homedir = getHomedir(); -var defaultPaths = function () { - return [ - path.join(homedir, '.node_modules'), - path.join(homedir, '.node_libraries') - ]; -}; - -var defaultIsFile = function isFile(file) { - try { - var stat = fs.statSync(file, { throwIfNoEntry: false }); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return !!stat && (stat.isFile() || stat.isFIFO()); -}; - -var defaultIsDir = function isDirectory(dir) { - try { - var stat = fs.statSync(dir, { throwIfNoEntry: false }); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return !!stat && stat.isDirectory(); -}; - -var defaultRealpathSync = function realpathSync(x) { - try { - return realpathFS(x); - } catch (realpathErr) { - if (realpathErr.code !== 'ENOENT') { - throw realpathErr; - } - } - return x; -}; - -var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { - if (opts && opts.preserveSymlinks === false) { - return realpathSync(x); - } - return x; -}; - -var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) { - var body = readFileSync(pkgfile); - try { - var pkg = JSON.parse(body); - return pkg; - } catch (jsonErr) {} -}; - -var getPackageCandidates = function getPackageCandidates(x, start, opts) { - var dirs = nodeModulesPaths(start, opts, x); - for (var i = 0; i < dirs.length; i++) { - dirs[i] = path.join(dirs[i], x); - } - return dirs; -}; - -module.exports = function resolveSync(x, options) { - if (typeof x !== 'string') { - throw new TypeError('Path must be a string.'); - } - var opts = normalizeOptions(x, options); - - var isFile = opts.isFile || defaultIsFile; - var readFileSync = opts.readFileSync || fs.readFileSync; - var isDirectory = opts.isDirectory || defaultIsDir; - var realpathSync = opts.realpathSync || defaultRealpathSync; - var readPackageSync = opts.readPackageSync || defaultReadPackageSync; - if (opts.readFileSync && opts.readPackageSync) { - throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.'); - } - var packageIterator = opts.packageIterator; - - var extensions = opts.extensions || ['.js']; - var includeCoreModules = opts.includeCoreModules !== false; - var basedir = opts.basedir || path.dirname(caller()); - var parent = opts.filename || basedir; - - opts.paths = opts.paths || defaultPaths(); - - // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); - - if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { - var res = path.resolve(absoluteStart, x); - if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; - var m = loadAsFileSync(res) || loadAsDirectorySync(res); - if (m) return maybeRealpathSync(realpathSync, m, opts); - } else if (includeCoreModules && isCore(x)) { - return x; - } else { - var n = loadNodeModulesSync(x, absoluteStart); - if (n) return maybeRealpathSync(realpathSync, n, opts); - } - - var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - err.code = 'MODULE_NOT_FOUND'; - throw err; - - function loadAsFileSync(x) { - var pkg = loadpkg(path.dirname(x)); - - if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { - var rfile = path.relative(pkg.dir, x); - var r = opts.pathFilter(pkg.pkg, x, rfile); - if (r) { - x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign - } - } - - if (isFile(x)) { - return x; - } - - for (var i = 0; i < extensions.length; i++) { - var file = x + extensions[i]; - if (isFile(file)) { - return file; - } - } - } - - function loadpkg(dir) { - if (dir === '' || dir === '/') return; - if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { - return; - } - if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; - - var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); - - if (!isFile(pkgfile)) { - return loadpkg(path.dirname(dir)); - } - - var pkg = readPackageSync(readFileSync, pkgfile); - - if (pkg && opts.packageFilter) { - // v2 will pass pkgfile - pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment - } - - return { pkg: pkg, dir: dir }; - } - - function loadAsDirectorySync(x) { - var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); - if (isFile(pkgfile)) { - try { - var pkg = readPackageSync(readFileSync, pkgfile); - } catch (e) {} - - if (pkg && opts.packageFilter) { - // v2 will pass pkgfile - pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment - } - - if (pkg && pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - throw mainError; - } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - try { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - var n = loadAsDirectorySync(path.resolve(x, pkg.main)); - if (n) return n; - } catch (e) {} - } - } - - return loadAsFileSync(path.join(x, '/index')); - } - - function loadNodeModulesSync(x, start) { - var thunk = function () { return getPackageCandidates(x, start, opts); }; - var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); - - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - if (isDirectory(path.dirname(dir))) { - var m = loadAsFileSync(dir); - if (m) return m; - var n = loadAsDirectorySync(dir); - if (n) return n; - } - } - } -}; diff --git a/node_modules/resolve/package.json b/node_modules/resolve/package.json deleted file mode 100644 index 537388d..0000000 --- a/node_modules/resolve/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "resolve", - "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", - "version": "1.22.8", - "repository": { - "type": "git", - "url": "git://github.com/browserify/resolve.git" - }, - "bin": { - "resolve": "./bin/resolve" - }, - "main": "index.js", - "keywords": [ - "resolve", - "require", - "node", - "module" - ], - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated && cp node_modules/is-core-module/core.json ./lib/ ||:", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", - "lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'", - "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", - "tests-only": "tape test/*.js", - "pretest": "npm run lint", - "test": "npm run --silent tests-only", - "posttest": "npm run test:multirepo && aud --production", - "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test" - }, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", - "array.prototype.map": "^1.0.6", - "aud": "^2.0.3", - "copy-dir": "^1.3.0", - "eclint": "^2.8.1", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "mkdirp": "^0.5.5", - "mv": "^2.1.1", - "npmignore": "^0.3.0", - "object-keys": "^1.1.1", - "rimraf": "^2.7.1", - "safe-publish-latest": "^2.0.0", - "semver": "^6.3.1", - "tap": "0.4.13", - "tape": "^5.7.0", - "tmp": "^0.0.31" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "publishConfig": { - "ignore": [ - ".github/workflows", - "appveyor.yml", - "test/resolver/malformed_package_json" - ] - } -} diff --git a/node_modules/resolve/readme.markdown b/node_modules/resolve/readme.markdown deleted file mode 100644 index ad34d60..0000000 --- a/node_modules/resolve/readme.markdown +++ /dev/null @@ -1,301 +0,0 @@ -# resolve [![Version Badge][2]][1] - -implements the [node `require.resolve()` algorithm](https://nodejs.org/api/modules.html#modules_all_together) such that you can `require.resolve()` on behalf of a file asynchronously and synchronously - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -# example - -asynchronously resolve: - -```js -var resolve = require('resolve/async'); // or, require('resolve') -resolve('tap', { basedir: __dirname }, function (err, res) { - if (err) console.error(err); - else console.log(res); -}); -``` - -``` -$ node example/async.js -/home/substack/projects/node-resolve/node_modules/tap/lib/main.js -``` - -synchronously resolve: - -```js -var resolve = require('resolve/sync'); // or, `require('resolve').sync -var res = resolve('tap', { basedir: __dirname }); -console.log(res); -``` - -``` -$ node example/sync.js -/home/substack/projects/node-resolve/node_modules/tap/lib/main.js -``` - -# methods - -```js -var resolve = require('resolve'); -var async = require('resolve/async'); -var sync = require('resolve/sync'); -``` - -For both the synchronous and asynchronous methods, errors may have any of the following `err.code` values: - -- `MODULE_NOT_FOUND`: the given path string (`id`) could not be resolved to a module -- `INVALID_BASEDIR`: the specified `opts.basedir` doesn't exist, or is not a directory -- `INVALID_PACKAGE_MAIN`: a `package.json` was encountered with an invalid `main` property (eg. not a string) - -## resolve(id, opts={}, cb) - -Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. - -options are: - -* opts.basedir - directory to begin resolving from - -* opts.package - `package.json` data applicable to the module being loaded - -* opts.extensions - array of file extensions to search in order - -* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search - -* opts.readFile - how to read files asynchronously - -* opts.isFile - function to asynchronously test whether a file exists - -* opts.isDirectory - function to asynchronously test whether a file exists and is a directory - -* opts.realpath - function to asynchronously resolve a potential symlink to its real path - -* `opts.readPackage(readFile, pkgfile, cb)` - function to asynchronously read and parse a package.json file - * readFile - the passed `opts.readFile` or `fs.readFile` if not specified - * pkgfile - path to package.json - * cb - callback - -* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field - * pkg - package data - * pkgfile - path to package.json - * dir - directory that contains package.json - -* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package - * pkg - package data - * path - the path being resolved - * relativePath - the path relative from the package.json location - * returns - a relative path that will be joined from the package.json location - -* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) - - For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function - * request - the import specifier being resolved - * start - lookup path - * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution - * opts - the resolution options - -* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) - * request - the import specifier being resolved - * start - lookup path - * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution - * opts - the resolution options - -* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` - -* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. -This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. -**Note:** this property is currently `true` by default but it will be changed to -`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. - -default `opts` values: - -```js -{ - paths: [], - basedir: __dirname, - extensions: ['.js'], - includeCoreModules: true, - readFile: fs.readFile, - isFile: function isFile(file, cb) { - fs.stat(file, function (err, stat) { - if (!err) { - return cb(null, stat.isFile() || stat.isFIFO()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); - }, - isDirectory: function isDirectory(dir, cb) { - fs.stat(dir, function (err, stat) { - if (!err) { - return cb(null, stat.isDirectory()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); - }, - realpath: function realpath(file, cb) { - var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; - realpath(file, function (realPathErr, realPath) { - if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); - else cb(null, realPathErr ? file : realPath); - }); - }, - readPackage: function defaultReadPackage(readFile, pkgfile, cb) { - readFile(pkgfile, function (readFileErr, body) { - if (readFileErr) cb(readFileErr); - else { - try { - var pkg = JSON.parse(body); - cb(null, pkg); - } catch (jsonErr) { - cb(null); - } - } - }); - }, - moduleDirectory: 'node_modules', - preserveSymlinks: true -} -``` - -## resolve.sync(id, opts) - -Synchronously resolve the module path string `id`, returning the result and -throwing an error when `id` can't be resolved. - -options are: - -* opts.basedir - directory to begin resolving from - -* opts.extensions - array of file extensions to search in order - -* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search - -* opts.readFileSync - how to read files synchronously - -* opts.isFile - function to synchronously test whether a file exists - -* opts.isDirectory - function to synchronously test whether a file exists and is a directory - -* opts.realpathSync - function to synchronously resolve a potential symlink to its real path - -* `opts.readPackageSync(readFileSync, pkgfile)` - function to synchronously read and parse a package.json file - * readFileSync - the passed `opts.readFileSync` or `fs.readFileSync` if not specified - * pkgfile - path to package.json - -* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field - * pkg - package data - * dir - directory that contains package.json (Note: the second argument will change to "pkgfile" in v2) - -* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package - * pkg - package data - * path - the path being resolved - * relativePath - the path relative from the package.json location - * returns - a relative path that will be joined from the package.json location - -* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) - - For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function - * request - the import specifier being resolved - * start - lookup path - * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution - * opts - the resolution options - -* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) - * request - the import specifier being resolved - * start - lookup path - * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution - * opts - the resolution options - -* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` - -* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. -This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. -**Note:** this property is currently `true` by default but it will be changed to -`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. - -default `opts` values: - -```js -{ - paths: [], - basedir: __dirname, - extensions: ['.js'], - includeCoreModules: true, - readFileSync: fs.readFileSync, - isFile: function isFile(file) { - try { - var stat = fs.statSync(file); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return stat.isFile() || stat.isFIFO(); - }, - isDirectory: function isDirectory(dir) { - try { - var stat = fs.statSync(dir); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return stat.isDirectory(); - }, - realpathSync: function realpathSync(file) { - try { - var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; - return realpath(file); - } catch (realPathErr) { - if (realPathErr.code !== 'ENOENT') { - throw realPathErr; - } - } - return file; - }, - readPackageSync: function defaultReadPackageSync(readFileSync, pkgfile) { - var body = readFileSync(pkgfile); - try { - var pkg = JSON.parse(body); - return pkg; - } catch (jsonErr) {} - }, - moduleDirectory: 'node_modules', - preserveSymlinks: true -} -``` - -# install - -With [npm](https://npmjs.org) do: - -```sh -npm install resolve -``` - -# license - -MIT - -[1]: https://npmjs.org/package/resolve -[2]: https://versionbadg.es/browserify/resolve.svg -[5]: https://david-dm.org/browserify/resolve.svg -[6]: https://david-dm.org/browserify/resolve -[7]: https://david-dm.org/browserify/resolve/dev-status.svg -[8]: https://david-dm.org/browserify/resolve#info=devDependencies -[11]: https://nodei.co/npm/resolve.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/resolve.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/resolve.svg -[downloads-url]: https://npm-stat.com/charts.html?package=resolve -[codecov-image]: https://codecov.io/gh/browserify/resolve/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/browserify/resolve/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/resolve -[actions-url]: https://github.com/browserify/resolve/actions diff --git a/node_modules/resolve/sync.js b/node_modules/resolve/sync.js deleted file mode 100644 index cd0ee04..0000000 --- a/node_modules/resolve/sync.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/sync'); diff --git a/node_modules/resolve/test/core.js b/node_modules/resolve/test/core.js deleted file mode 100644 index a477adc..0000000 --- a/node_modules/resolve/test/core.js +++ /dev/null @@ -1,88 +0,0 @@ -var test = require('tape'); -var keys = require('object-keys'); -var semver = require('semver'); - -var resolve = require('../'); - -var brokenNode = semver.satisfies(process.version, '11.11 - 11.13'); - -test('core modules', function (t) { - t.test('isCore()', function (st) { - st.ok(resolve.isCore('fs')); - st.ok(resolve.isCore('net')); - st.ok(resolve.isCore('http')); - - st.ok(!resolve.isCore('seq')); - st.ok(!resolve.isCore('../')); - - st.ok(!resolve.isCore('toString')); - - st.end(); - }); - - t.test('core list', function (st) { - var cores = keys(resolve.core); - st.plan(cores.length); - - for (var i = 0; i < cores.length; ++i) { - var mod = cores[i]; - // note: this must be require, not require.resolve, due to https://github.com/nodejs/node/issues/43274 - var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func - t.comment(mod + ': ' + resolve.core[mod]); - if (resolve.core[mod]) { - st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw'); - } else if (brokenNode) { - st.ok(true, 'this version of node is broken: attempting to require things that fail to resolve breaks "home_paths" tests'); - } else { - st.throws(requireFunc, mod + ' not supported; requiring throws'); - } - } - - st.end(); - }); - - t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { - var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle - if (!libs) { - st.skip('module.builtinModules does not exist'); - return st.end(); - } - for (var i = 0; i < libs.length; ++i) { - var mod = libs[i]; - st.ok(resolve.core[mod], mod + ' is a core module'); - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - } - st.end(); - }); - - t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { - var libs = require('module').builtinModules; - if (!libs) { - st.skip('module.builtinModules does not exist'); - return st.end(); - } - var blacklist = [ - '_debug_agent', - 'v8/tools/tickprocessor-driver', - 'v8/tools/SourceMap', - 'v8/tools/tickprocessor', - 'v8/tools/profile' - ]; - for (var i = 0; i < libs.length; ++i) { - var mod = libs[i]; - if (blacklist.indexOf(mod) === -1) { - st.ok(resolve.core[mod], mod + ' is a core module'); - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - } - } - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/resolve/test/dotdot.js b/node_modules/resolve/test/dotdot.js deleted file mode 100644 index 3080665..0000000 --- a/node_modules/resolve/test/dotdot.js +++ /dev/null @@ -1,29 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('dotdot', function (t) { - t.plan(4); - var dir = path.join(__dirname, '/dotdot/abc'); - - resolve('..', { basedir: dir }, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(__dirname, 'dotdot/index.js')); - }); - - resolve('.', { basedir: dir }, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, 'index.js')); - }); -}); - -test('dotdot sync', function (t) { - t.plan(2); - var dir = path.join(__dirname, '/dotdot/abc'); - - var a = resolve.sync('..', { basedir: dir }); - t.equal(a, path.join(__dirname, 'dotdot/index.js')); - - var b = resolve.sync('.', { basedir: dir }); - t.equal(b, path.join(dir, 'index.js')); -}); diff --git a/node_modules/resolve/test/dotdot/abc/index.js b/node_modules/resolve/test/dotdot/abc/index.js deleted file mode 100644 index 67f2534..0000000 --- a/node_modules/resolve/test/dotdot/abc/index.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = require('..'); -console.log(x); diff --git a/node_modules/resolve/test/dotdot/index.js b/node_modules/resolve/test/dotdot/index.js deleted file mode 100644 index 643f9fc..0000000 --- a/node_modules/resolve/test/dotdot/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'whatever'; diff --git a/node_modules/resolve/test/faulty_basedir.js b/node_modules/resolve/test/faulty_basedir.js deleted file mode 100644 index 5f2141a..0000000 --- a/node_modules/resolve/test/faulty_basedir.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tape'); -var path = require('path'); -var resolve = require('../'); - -test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { - t.plan(1); - - var resolverDir = 'C:\\a\\b\\c\\d'; - - resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { - t.equal(!!err, true); - }); -}); - -test('non-existent basedir should not throw when preserveSymlinks is false', function (t) { - t.plan(2); - - var opts = { - basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'), - preserveSymlinks: false - }; - - var module = './dotdot/abc'; - - resolve(module, opts, function (err, res) { - t.equal(err.code, 'MODULE_NOT_FOUND'); - t.equal(res, undefined); - }); -}); diff --git a/node_modules/resolve/test/filter.js b/node_modules/resolve/test/filter.js deleted file mode 100644 index 8f8cccd..0000000 --- a/node_modules/resolve/test/filter.js +++ /dev/null @@ -1,34 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('filter', function (t) { - t.plan(4); - var dir = path.join(__dirname, 'resolver'); - var packageFilterArgs; - resolve('./baz', { - basedir: dir, - packageFilter: function (pkg, pkgfile) { - pkg.main = 'doom'; // eslint-disable-line no-param-reassign - packageFilterArgs = [pkg, pkgfile]; - return pkg; - } - }, function (err, res, pkg) { - if (err) t.fail(err); - - t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); - - var packageData = packageFilterArgs[0]; - t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); - t.equal(packageData.main, 'doom', 'package "main" was altered'); - - var packageFile = packageFilterArgs[1]; - t.equal( - packageFile, - path.join(dir, 'baz/package.json'), - 'second packageFilter argument is "pkgfile"' - ); - - t.end(); - }); -}); diff --git a/node_modules/resolve/test/filter_sync.js b/node_modules/resolve/test/filter_sync.js deleted file mode 100644 index 8a43b98..0000000 --- a/node_modules/resolve/test/filter_sync.js +++ /dev/null @@ -1,33 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('filter', function (t) { - var dir = path.join(__dirname, 'resolver'); - var packageFilterArgs; - var res = resolve.sync('./baz', { - basedir: dir, - // NOTE: in v2.x, this will be `pkg, pkgfile, dir`, but must remain "broken" here in v1.x for compatibility - packageFilter: function (pkg, /*pkgfile,*/ dir) { // eslint-disable-line spaced-comment - pkg.main = 'doom'; // eslint-disable-line no-param-reassign - packageFilterArgs = 'is 1.x' ? [pkg, dir] : [pkg, pkgfile, dir]; // eslint-disable-line no-constant-condition, no-undef - return pkg; - } - }); - - t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); - - var packageData = packageFilterArgs[0]; - t.equal(packageData.main, 'doom', 'package "main" was altered'); - - if (!'is 1.x') { // eslint-disable-line no-constant-condition - var packageFile = packageFilterArgs[1]; - t.equal(packageFile, path.join(dir, 'baz', 'package.json'), 'package.json path is correct'); - } - - var packageDir = packageFilterArgs['is 1.x' ? 1 : 2]; // eslint-disable-line no-constant-condition - // eslint-disable-next-line no-constant-condition - t.equal(packageDir, path.join(dir, 'baz'), ('is 1.x' ? 'second' : 'third') + ' packageFilter argument is "dir"'); - - t.end(); -}); diff --git a/node_modules/resolve/test/home_paths.js b/node_modules/resolve/test/home_paths.js deleted file mode 100644 index 3b8c9b3..0000000 --- a/node_modules/resolve/test/home_paths.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var homedir = require('../lib/homedir'); -var path = require('path'); - -var test = require('tape'); -var mkdirp = require('mkdirp'); -var rimraf = require('rimraf'); -var mv = require('mv'); -var copyDir = require('copy-dir'); -var tmp = require('tmp'); - -var HOME = homedir(); - -var hnm = path.join(HOME, '.node_modules'); -var hnl = path.join(HOME, '.node_libraries'); - -var resolve = require('../async'); - -function makeDir(t, dir, cb) { - mkdirp(dir, function (err) { - if (err) { - cb(err); - } else { - t.teardown(function cleanup() { - rimraf.sync(dir); - }); - cb(); - } - }); -} - -function makeTempDir(t, dir, cb) { - if (fs.existsSync(dir)) { - var tmpResult = tmp.dirSync(); - t.teardown(tmpResult.removeCallback); - var backup = path.join(tmpResult.name, path.basename(dir)); - mv(dir, backup, function (err) { - if (err) { - cb(err); - } else { - t.teardown(function () { - mv(backup, dir, cb); - }); - makeDir(t, dir, cb); - } - }); - } else { - makeDir(t, dir, cb); - } -} - -test('homedir module paths', function (t) { - t.plan(7); - - makeTempDir(t, hnm, function (err) { - t.error(err, 'no error with HNM temp dir'); - if (err) { - return t.end(); - } - - var bazHNMDir = path.join(hnm, 'baz'); - var dotMainDir = path.join(hnm, 'dot_main'); - copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNMDir); - copyDir.sync(path.join(__dirname, 'resolver/dot_main'), dotMainDir); - - var bazPkg = { name: 'baz', main: 'quux.js' }; - var dotMainPkg = { main: 'index' }; - - var bazHNMmain = path.join(bazHNMDir, 'quux.js'); - t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); - var dotMainMain = path.join(dotMainDir, 'index.js'); - t.equal(require.resolve('dot_main'), dotMainMain, 'sanity check: require.resolve finds `dot_main`'); - - makeTempDir(t, hnl, function (err) { - t.error(err, 'no error with HNL temp dir'); - if (err) { - return t.end(); - } - var bazHNLDir = path.join(hnl, 'baz'); - copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNLDir); - - var dotSlashMainDir = path.join(hnl, 'dot_slash_main'); - var dotSlashMainMain = path.join(dotSlashMainDir, 'index.js'); - var dotSlashMainPkg = { main: 'index' }; - copyDir.sync(path.join(__dirname, 'resolver/dot_slash_main'), dotSlashMainDir); - - t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); - t.equal(require.resolve('dot_slash_main'), dotSlashMainMain, 'sanity check: require.resolve finds HNL `dot_slash_main`'); - - t.test('with temp dirs', function (st) { - st.plan(3); - - st.test('just in `$HOME/.node_modules`', function (s2t) { - s2t.plan(3); - - resolve('dot_main', function (err, res, pkg) { - s2t.error(err, 'no error resolving `dot_main`'); - s2t.equal(res, dotMainMain, '`dot_main` resolves in `$HOME/.node_modules`'); - s2t.deepEqual(pkg, dotMainPkg); - }); - }); - - st.test('just in `$HOME/.node_libraries`', function (s2t) { - s2t.plan(3); - - resolve('dot_slash_main', function (err, res, pkg) { - s2t.error(err, 'no error resolving `dot_slash_main`'); - s2t.equal(res, dotSlashMainMain, '`dot_slash_main` resolves in `$HOME/.node_libraries`'); - s2t.deepEqual(pkg, dotSlashMainPkg); - }); - }); - - st.test('in `$HOME/.node_libraries` and `$HOME/.node_modules`', function (s2t) { - s2t.plan(3); - - resolve('baz', function (err, res, pkg) { - s2t.error(err, 'no error resolving `baz`'); - s2t.equal(res, bazHNMmain, '`baz` resolves in `$HOME/.node_modules` when in both'); - s2t.deepEqual(pkg, bazPkg); - }); - }); - }); - }); - }); -}); diff --git a/node_modules/resolve/test/home_paths_sync.js b/node_modules/resolve/test/home_paths_sync.js deleted file mode 100644 index 5d2c56f..0000000 --- a/node_modules/resolve/test/home_paths_sync.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var homedir = require('../lib/homedir'); -var path = require('path'); - -var test = require('tape'); -var mkdirp = require('mkdirp'); -var rimraf = require('rimraf'); -var mv = require('mv'); -var copyDir = require('copy-dir'); -var tmp = require('tmp'); - -var HOME = homedir(); - -var hnm = path.join(HOME, '.node_modules'); -var hnl = path.join(HOME, '.node_libraries'); - -var resolve = require('../sync'); - -function makeDir(t, dir, cb) { - mkdirp(dir, function (err) { - if (err) { - cb(err); - } else { - t.teardown(function cleanup() { - rimraf.sync(dir); - }); - cb(); - } - }); -} - -function makeTempDir(t, dir, cb) { - if (fs.existsSync(dir)) { - var tmpResult = tmp.dirSync(); - t.teardown(tmpResult.removeCallback); - var backup = path.join(tmpResult.name, path.basename(dir)); - mv(dir, backup, function (err) { - if (err) { - cb(err); - } else { - t.teardown(function () { - mv(backup, dir, cb); - }); - makeDir(t, dir, cb); - } - }); - } else { - makeDir(t, dir, cb); - } -} - -test('homedir module paths', function (t) { - t.plan(7); - - makeTempDir(t, hnm, function (err) { - t.error(err, 'no error with HNM temp dir'); - if (err) { - return t.end(); - } - - var bazHNMDir = path.join(hnm, 'baz'); - var dotMainDir = path.join(hnm, 'dot_main'); - copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNMDir); - copyDir.sync(path.join(__dirname, 'resolver/dot_main'), dotMainDir); - - var bazHNMmain = path.join(bazHNMDir, 'quux.js'); - t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); - var dotMainMain = path.join(dotMainDir, 'index.js'); - t.equal(require.resolve('dot_main'), dotMainMain, 'sanity check: require.resolve finds `dot_main`'); - - makeTempDir(t, hnl, function (err) { - t.error(err, 'no error with HNL temp dir'); - if (err) { - return t.end(); - } - var bazHNLDir = path.join(hnl, 'baz'); - copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNLDir); - - var dotSlashMainDir = path.join(hnl, 'dot_slash_main'); - var dotSlashMainMain = path.join(dotSlashMainDir, 'index.js'); - copyDir.sync(path.join(__dirname, 'resolver/dot_slash_main'), dotSlashMainDir); - - t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); - t.equal(require.resolve('dot_slash_main'), dotSlashMainMain, 'sanity check: require.resolve finds HNL `dot_slash_main`'); - - t.test('with temp dirs', function (st) { - st.plan(3); - - st.test('just in `$HOME/.node_modules`', function (s2t) { - s2t.plan(1); - - var res = resolve('dot_main'); - s2t.equal(res, dotMainMain, '`dot_main` resolves in `$HOME/.node_modules`'); - }); - - st.test('just in `$HOME/.node_libraries`', function (s2t) { - s2t.plan(1); - - var res = resolve('dot_slash_main'); - s2t.equal(res, dotSlashMainMain, '`dot_slash_main` resolves in `$HOME/.node_libraries`'); - }); - - st.test('in `$HOME/.node_libraries` and `$HOME/.node_modules`', function (s2t) { - s2t.plan(1); - - var res = resolve('baz'); - s2t.equal(res, bazHNMmain, '`baz` resolves in `$HOME/.node_modules` when in both'); - }); - }); - }); - }); -}); diff --git a/node_modules/resolve/test/mock.js b/node_modules/resolve/test/mock.js deleted file mode 100644 index 6116275..0000000 --- a/node_modules/resolve/test/mock.js +++ /dev/null @@ -1,315 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('mock', function (t) { - t.plan(8); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - - var dirs = {}; - dirs[path.resolve('/foo/bar')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - isDirectory: function (dir, cb) { - cb(null, !!dirs[path.resolve(dir)]); - }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - }, - realpath: function (file, cb) { - cb(null, file); - } - }; - } - - resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg, undefined); - }); - - resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg, undefined); - }); - - resolve('baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - resolve('../baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); -}); - -test('mock from package', function (t) { - t.plan(8); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - - var dirs = {}; - dirs[path.resolve('/foo/bar')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, file)); - }, - isDirectory: function (dir, cb) { - cb(null, !!dirs[path.resolve(dir)]); - }, - 'package': { main: 'bar' }, - readFile: function (file, cb) { - cb(null, files[file]); - }, - realpath: function (file, cb) { - cb(null, file); - } - }; - } - - resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg && pkg.main, 'bar'); - }); - - resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg && pkg.main, 'bar'); - }); - - resolve('baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - resolve('../baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); -}); - -test('mock package', function (t) { - t.plan(2); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - - var dirs = {}; - dirs[path.resolve('/foo')] = true; - dirs[path.resolve('/foo/node_modules')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - isDirectory: function (dir, cb) { - cb(null, !!dirs[path.resolve(dir)]); - }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - }, - realpath: function (file, cb) { - cb(null, file); - } - }; - } - - resolve('bar', opts('/foo'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); - t.equal(pkg && pkg.main, './baz.js'); - }); -}); - -test('mock package from package', function (t) { - t.plan(2); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - - var dirs = {}; - dirs[path.resolve('/foo')] = true; - dirs[path.resolve('/foo/node_modules')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - isDirectory: function (dir, cb) { - cb(null, !!dirs[path.resolve(dir)]); - }, - 'package': { main: 'bar' }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - }, - realpath: function (file, cb) { - cb(null, file); - } - }; - } - - resolve('bar', opts('/foo'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); - t.equal(pkg && pkg.main, './baz.js'); - }); -}); - -test('symlinked', function (t) { - t.plan(4); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; - - var dirs = {}; - dirs[path.resolve('/foo/bar')] = true; - dirs[path.resolve('/foo/bar/symlinked')] = true; - - function opts(basedir) { - return { - preserveSymlinks: false, - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - isDirectory: function (dir, cb) { - cb(null, !!dirs[path.resolve(dir)]); - }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - }, - realpath: function (file, cb) { - var resolved = path.resolve(file); - - if (resolved.indexOf('symlinked') >= 0) { - cb(null, resolved); - return; - } - - var ext = path.extname(resolved); - - if (ext) { - var dir = path.dirname(resolved); - var base = path.basename(resolved); - cb(null, path.join(dir, 'symlinked', base)); - } else { - cb(null, path.join(resolved, 'symlinked')); - } - } - }; - } - - resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); - t.equal(pkg, undefined); - }); - - resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); - t.equal(pkg, undefined); - }); -}); - -test('readPackage', function (t) { - t.plan(3); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/something-else.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'boop'; - - var dirs = {}; - dirs[path.resolve('/foo')] = true; - dirs[path.resolve('/foo/node_modules')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - isDirectory: function (dir, cb) { - cb(null, !!dirs[path.resolve(dir)]); - }, - 'package': { main: 'bar' }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - }, - realpath: function (file, cb) { - cb(null, file); - } - }; - } - - t.test('with readFile', function (st) { - st.plan(3); - - resolve('bar', opts('/foo'), function (err, res, pkg) { - st.error(err); - st.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); - st.equal(pkg && pkg.main, './baz.js'); - }); - }); - - var readPackage = function (readFile, file, cb) { - var barPackage = path.join('bar', 'package.json'); - if (file.slice(-barPackage.length) === barPackage) { - cb(null, { main: './something-else.js' }); - } else { - cb(null, JSON.parse(files[path.resolve(file)])); - } - }; - - t.test('with readPackage', function (st) { - st.plan(3); - - var options = opts('/foo'); - delete options.readFile; - options.readPackage = readPackage; - resolve('bar', options, function (err, res, pkg) { - st.error(err); - st.equal(res, path.resolve('/foo/node_modules/bar/something-else.js')); - st.equal(pkg && pkg.main, './something-else.js'); - }); - }); - - t.test('with readFile and readPackage', function (st) { - st.plan(1); - - var options = opts('/foo'); - options.readPackage = readPackage; - resolve('bar', options, function (err) { - st.throws(function () { throw err; }, TypeError, 'errors when both readFile and readPackage are provided'); - }); - }); -}); diff --git a/node_modules/resolve/test/mock_sync.js b/node_modules/resolve/test/mock_sync.js deleted file mode 100644 index c5a7e2a..0000000 --- a/node_modules/resolve/test/mock_sync.js +++ /dev/null @@ -1,214 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('mock', function (t) { - t.plan(4); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - - var dirs = {}; - dirs[path.resolve('/foo/bar')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file) { - return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); - }, - isDirectory: function (dir) { - return !!dirs[path.resolve(dir)]; - }, - readFileSync: function (file) { - return files[path.resolve(file)]; - }, - realpathSync: function (file) { - return file; - } - }; - } - - t.equal( - resolve.sync('./baz', opts('/foo/bar')), - path.resolve('/foo/bar/baz.js') - ); - - t.equal( - resolve.sync('./baz.js', opts('/foo/bar')), - path.resolve('/foo/bar/baz.js') - ); - - t.throws(function () { - resolve.sync('baz', opts('/foo/bar')); - }); - - t.throws(function () { - resolve.sync('../baz', opts('/foo/bar')); - }); -}); - -test('mock package', function (t) { - t.plan(1); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - - var dirs = {}; - dirs[path.resolve('/foo')] = true; - dirs[path.resolve('/foo/node_modules')] = true; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file) { - return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); - }, - isDirectory: function (dir) { - return !!dirs[path.resolve(dir)]; - }, - readFileSync: function (file) { - return files[path.resolve(file)]; - }, - realpathSync: function (file) { - return file; - } - }; - } - - t.equal( - resolve.sync('bar', opts('/foo')), - path.resolve('/foo/node_modules/bar/baz.js') - ); -}); - -test('symlinked', function (t) { - t.plan(2); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; - - var dirs = {}; - dirs[path.resolve('/foo/bar')] = true; - dirs[path.resolve('/foo/bar/symlinked')] = true; - - function opts(basedir) { - return { - preserveSymlinks: false, - basedir: path.resolve(basedir), - isFile: function (file) { - return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); - }, - isDirectory: function (dir) { - return !!dirs[path.resolve(dir)]; - }, - readFileSync: function (file) { - return files[path.resolve(file)]; - }, - realpathSync: function (file) { - var resolved = path.resolve(file); - - if (resolved.indexOf('symlinked') >= 0) { - return resolved; - } - - var ext = path.extname(resolved); - - if (ext) { - var dir = path.dirname(resolved); - var base = path.basename(resolved); - return path.join(dir, 'symlinked', base); - } - return path.join(resolved, 'symlinked'); - } - }; - } - - t.equal( - resolve.sync('./baz', opts('/foo/bar')), - path.resolve('/foo/bar/symlinked/baz.js') - ); - - t.equal( - resolve.sync('./baz.js', opts('/foo/bar')), - path.resolve('/foo/bar/symlinked/baz.js') - ); -}); - -test('readPackageSync', function (t) { - t.plan(3); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/something-else.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'boop'; - - var dirs = {}; - dirs[path.resolve('/foo')] = true; - dirs[path.resolve('/foo/node_modules')] = true; - - function opts(basedir, useReadPackage) { - return { - basedir: path.resolve(basedir), - isFile: function (file) { - return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); - }, - isDirectory: function (dir) { - return !!dirs[path.resolve(dir)]; - }, - readFileSync: useReadPackage ? null : function (file) { - return files[path.resolve(file)]; - }, - realpathSync: function (file) { - return file; - } - }; - } - t.test('with readFile', function (st) { - st.plan(1); - - st.equal( - resolve.sync('bar', opts('/foo')), - path.resolve('/foo/node_modules/bar/baz.js') - ); - }); - - var readPackageSync = function (readFileSync, file) { - if (file.indexOf(path.join('bar', 'package.json')) >= 0) { - return { main: './something-else.js' }; - } - return JSON.parse(files[path.resolve(file)]); - }; - - t.test('with readPackage', function (st) { - st.plan(1); - - var options = opts('/foo'); - delete options.readFileSync; - options.readPackageSync = readPackageSync; - - st.equal( - resolve.sync('bar', options), - path.resolve('/foo/node_modules/bar/something-else.js') - ); - }); - - t.test('with readFile and readPackage', function (st) { - st.plan(1); - - var options = opts('/foo'); - options.readPackageSync = readPackageSync; - st.throws( - function () { resolve.sync('bar', options); }, - TypeError, - 'errors when both readFile and readPackage are provided' - ); - }); -}); - diff --git a/node_modules/resolve/test/module_dir.js b/node_modules/resolve/test/module_dir.js deleted file mode 100644 index b50e5bb..0000000 --- a/node_modules/resolve/test/module_dir.js +++ /dev/null @@ -1,56 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('moduleDirectory strings', function (t) { - t.plan(4); - var dir = path.join(__dirname, 'module_dir'); - var xopts = { - basedir: dir, - moduleDirectory: 'xmodules' - }; - resolve('aaa', xopts, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); - }); - - var yopts = { - basedir: dir, - moduleDirectory: 'ymodules' - }; - resolve('aaa', yopts, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); - }); -}); - -test('moduleDirectory array', function (t) { - t.plan(6); - var dir = path.join(__dirname, 'module_dir'); - var aopts = { - basedir: dir, - moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] - }; - resolve('aaa', aopts, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); - }); - - var bopts = { - basedir: dir, - moduleDirectory: ['zmodules', 'ymodules', 'xmodules'] - }; - resolve('aaa', bopts, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); - }); - - var copts = { - basedir: dir, - moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] - }; - resolve('bbb', copts, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, '/zmodules/bbb/main.js')); - }); -}); diff --git a/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/node_modules/resolve/test/module_dir/xmodules/aaa/index.js deleted file mode 100644 index dd7cf7b..0000000 --- a/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (x) { return x * 100; }; diff --git a/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/node_modules/resolve/test/module_dir/ymodules/aaa/index.js deleted file mode 100644 index ef2d4d4..0000000 --- a/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (x) { return x + 100; }; diff --git a/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/node_modules/resolve/test/module_dir/zmodules/bbb/main.js deleted file mode 100644 index e8ba629..0000000 --- a/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (n) { return n * 111; }; diff --git a/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/node_modules/resolve/test/module_dir/zmodules/bbb/package.json deleted file mode 100644 index c13b8cf..0000000 --- a/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "main.js" -} diff --git a/node_modules/resolve/test/node-modules-paths.js b/node_modules/resolve/test/node-modules-paths.js deleted file mode 100644 index 675441d..0000000 --- a/node_modules/resolve/test/node-modules-paths.js +++ /dev/null @@ -1,143 +0,0 @@ -var test = require('tape'); -var path = require('path'); -var parse = path.parse || require('path-parse'); -var keys = require('object-keys'); - -var nodeModulesPaths = require('../lib/node-modules-paths'); - -var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { - var moduleDirs = [].concat(moduleDirectories || 'node_modules'); - if (paths) { - for (var k = 0; k < paths.length; ++k) { - moduleDirs.push(path.basename(paths[k])); - } - } - - var foundModuleDirs = {}; - var uniqueDirs = {}; - var parsedDirs = {}; - for (var i = 0; i < dirs.length; ++i) { - var parsed = parse(dirs[i]); - if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } - foundModuleDirs[parsed.base] += 1; - parsedDirs[parsed.dir] = true; - uniqueDirs[dirs[i]] = true; - } - t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); - var foundModuleDirNames = keys(foundModuleDirs); - t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); - t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); - - var counts = {}; - for (var j = 0; j < foundModuleDirNames.length; ++j) { - counts[foundModuleDirs[j]] = true; - } - t.equal(keys(counts).length, 1, 'all found module directories had the same count'); -}; - -test('node-modules-paths', function (t) { - t.test('no options', function (t) { - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start); - - verifyDirs(t, start, dirs); - - t.end(); - }); - - t.test('empty options', function (t) { - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start, {}); - - verifyDirs(t, start, dirs); - - t.end(); - }); - - t.test('with paths=array option', function (t) { - var start = path.join(__dirname, 'resolver'); - var paths = ['a', 'b']; - var dirs = nodeModulesPaths(start, { paths: paths }); - - verifyDirs(t, start, dirs, null, paths); - - t.end(); - }); - - t.test('with paths=function option', function (t) { - var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { - return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); - }; - - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); - - verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); - - t.end(); - }); - - t.test('with paths=function skipping node modules resolution', function (t) { - var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { - return []; - }; - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start, { paths: paths }); - t.deepEqual(dirs, [], 'no node_modules was computed'); - t.end(); - }); - - t.test('with moduleDirectory option', function (t) { - var start = path.join(__dirname, 'resolver'); - var moduleDirectory = 'not node modules'; - var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); - - verifyDirs(t, start, dirs, moduleDirectory); - - t.end(); - }); - - t.test('with 1 moduleDirectory and paths options', function (t) { - var start = path.join(__dirname, 'resolver'); - var paths = ['a', 'b']; - var moduleDirectory = 'not node modules'; - var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); - - verifyDirs(t, start, dirs, moduleDirectory, paths); - - t.end(); - }); - - t.test('with 1+ moduleDirectory and paths options', function (t) { - var start = path.join(__dirname, 'resolver'); - var paths = ['a', 'b']; - var moduleDirectories = ['not node modules', 'other modules']; - var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); - - verifyDirs(t, start, dirs, moduleDirectories, paths); - - t.end(); - }); - - t.test('combine paths correctly on Windows', function (t) { - var start = 'C:\\Users\\username\\myProject\\src'; - var paths = []; - var moduleDirectories = ['node_modules', start]; - var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); - - t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); - - t.end(); - }); - - t.test('combine paths correctly on non-Windows', { skip: process.platform === 'win32' }, function (t) { - var start = '/Users/username/git/myProject/src'; - var paths = []; - var moduleDirectories = ['node_modules', '/Users/username/git/myProject/src']; - var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); - - t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); - - t.end(); - }); -}); diff --git a/node_modules/resolve/test/node_path.js b/node_modules/resolve/test/node_path.js deleted file mode 100644 index e463d6c..0000000 --- a/node_modules/resolve/test/node_path.js +++ /dev/null @@ -1,70 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('$NODE_PATH', function (t) { - t.plan(8); - - var isDir = function (dir, cb) { - if (dir === '/node_path' || dir === 'node_path/x') { - return cb(null, true); - } - fs.stat(dir, function (err, stat) { - if (!err) { - return cb(null, stat.isDirectory()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); - }; - - resolve('aaa', { - paths: [ - path.join(__dirname, '/node_path/x'), - path.join(__dirname, '/node_path/y') - ], - basedir: __dirname, - isDirectory: isDir - }, function (err, res) { - t.error(err); - t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves'); - }); - - resolve('bbb', { - paths: [ - path.join(__dirname, '/node_path/x'), - path.join(__dirname, '/node_path/y') - ], - basedir: __dirname, - isDirectory: isDir - }, function (err, res) { - t.error(err); - t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves'); - }); - - resolve('ccc', { - paths: [ - path.join(__dirname, '/node_path/x'), - path.join(__dirname, '/node_path/y') - ], - basedir: __dirname, - isDirectory: isDir - }, function (err, res) { - t.error(err); - t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves'); - }); - - // ensure that relative paths still resolve against the regular `node_modules` correctly - resolve('tap', { - paths: [ - 'node_path' - ], - basedir: path.join(__dirname, 'node_path/x'), - isDirectory: isDir - }, function (err, res) { - var root = require('tap/package.json').main; // eslint-disable-line global-require - t.error(err); - t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves'); - }); -}); diff --git a/node_modules/resolve/test/node_path/x/aaa/index.js b/node_modules/resolve/test/node_path/x/aaa/index.js deleted file mode 100644 index ad70d0b..0000000 --- a/node_modules/resolve/test/node_path/x/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'A'; diff --git a/node_modules/resolve/test/node_path/x/ccc/index.js b/node_modules/resolve/test/node_path/x/ccc/index.js deleted file mode 100644 index a64132e..0000000 --- a/node_modules/resolve/test/node_path/x/ccc/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'C'; diff --git a/node_modules/resolve/test/node_path/y/bbb/index.js b/node_modules/resolve/test/node_path/y/bbb/index.js deleted file mode 100644 index 4d0f32e..0000000 --- a/node_modules/resolve/test/node_path/y/bbb/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'B'; diff --git a/node_modules/resolve/test/node_path/y/ccc/index.js b/node_modules/resolve/test/node_path/y/ccc/index.js deleted file mode 100644 index 793315e..0000000 --- a/node_modules/resolve/test/node_path/y/ccc/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'CY'; diff --git a/node_modules/resolve/test/nonstring.js b/node_modules/resolve/test/nonstring.js deleted file mode 100644 index ef63c40..0000000 --- a/node_modules/resolve/test/nonstring.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var resolve = require('../'); - -test('nonstring', function (t) { - t.plan(1); - resolve(555, function (err, res, pkg) { - t.ok(err); - }); -}); diff --git a/node_modules/resolve/test/pathfilter.js b/node_modules/resolve/test/pathfilter.js deleted file mode 100644 index 16519ae..0000000 --- a/node_modules/resolve/test/pathfilter.js +++ /dev/null @@ -1,75 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -var resolverDir = path.join(__dirname, '/pathfilter/deep_ref'); - -var pathFilterFactory = function (t) { - return function (pkg, x, remainder) { - t.equal(pkg.version, '1.2.3'); - t.equal(x, path.join(resolverDir, 'node_modules/deep/ref')); - t.equal(remainder, 'ref'); - return 'alt'; - }; -}; - -test('#62: deep module references and the pathFilter', function (t) { - t.test('deep/ref.js', function (st) { - st.plan(3); - - resolve('deep/ref', { basedir: resolverDir }, function (err, res, pkg) { - if (err) st.fail(err); - - st.equal(pkg.version, '1.2.3'); - st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); - }); - - var res = resolve.sync('deep/ref', { basedir: resolverDir }); - st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); - }); - - t.test('deep/deeper/ref', function (st) { - st.plan(4); - - resolve( - 'deep/deeper/ref', - { basedir: resolverDir }, - function (err, res, pkg) { - if (err) t.fail(err); - st.notEqual(pkg, undefined); - st.equal(pkg.version, '1.2.3'); - st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); - } - ); - - var res = resolve.sync( - 'deep/deeper/ref', - { basedir: resolverDir } - ); - st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); - }); - - t.test('deep/ref alt', function (st) { - st.plan(8); - - var pathFilter = pathFilterFactory(st); - - var res = resolve.sync( - 'deep/ref', - { basedir: resolverDir, pathFilter: pathFilter } - ); - st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); - - resolve( - 'deep/ref', - { basedir: resolverDir, pathFilter: pathFilter }, - function (err, res, pkg) { - if (err) st.fail(err); - st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); - st.end(); - } - ); - }); - - t.end(); -}); diff --git a/node_modules/resolve/test/pathfilter/deep_ref/main.js b/node_modules/resolve/test/pathfilter/deep_ref/main.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/precedence.js b/node_modules/resolve/test/precedence.js deleted file mode 100644 index 2febb59..0000000 --- a/node_modules/resolve/test/precedence.js +++ /dev/null @@ -1,23 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('precedence', function (t) { - t.plan(3); - var dir = path.join(__dirname, 'precedence/aaa'); - - resolve('./', { basedir: dir }, function (err, res, pkg) { - t.ifError(err); - t.equal(res, path.join(dir, 'index.js')); - t.equal(pkg.name, 'resolve'); - }); -}); - -test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string - t.plan(1); - var dir = path.join(__dirname, 'precedence/bbb'); - - resolve('./', { basedir: dir }, function (err, res, pkg) { - t.ok(err); - }); -}); diff --git a/node_modules/resolve/test/precedence/aaa.js b/node_modules/resolve/test/precedence/aaa.js deleted file mode 100644 index b83a3e7..0000000 --- a/node_modules/resolve/test/precedence/aaa.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'wtf'; diff --git a/node_modules/resolve/test/precedence/aaa/index.js b/node_modules/resolve/test/precedence/aaa/index.js deleted file mode 100644 index e0f8f6a..0000000 --- a/node_modules/resolve/test/precedence/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'okok'; diff --git a/node_modules/resolve/test/precedence/aaa/main.js b/node_modules/resolve/test/precedence/aaa/main.js deleted file mode 100644 index 93542a9..0000000 --- a/node_modules/resolve/test/precedence/aaa/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('./')); diff --git a/node_modules/resolve/test/precedence/bbb.js b/node_modules/resolve/test/precedence/bbb.js deleted file mode 100644 index 2298f47..0000000 --- a/node_modules/resolve/test/precedence/bbb.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = '>_<'; diff --git a/node_modules/resolve/test/precedence/bbb/main.js b/node_modules/resolve/test/precedence/bbb/main.js deleted file mode 100644 index 716b81d..0000000 --- a/node_modules/resolve/test/precedence/bbb/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('./')); // should throw diff --git a/node_modules/resolve/test/resolver.js b/node_modules/resolve/test/resolver.js deleted file mode 100644 index df8211a..0000000 --- a/node_modules/resolve/test/resolver.js +++ /dev/null @@ -1,597 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var test = require('tape'); -var resolve = require('../'); -var async = require('../async'); - -test('`./async` entry point', function (t) { - t.equal(resolve, async, '`./async` entry point is the same as `main`'); - t.end(); -}); - -test('async foo', function (t) { - t.plan(12); - var dir = path.join(__dirname, 'resolver'); - - resolve('./foo', { basedir: dir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'foo.js')); - t.equal(pkg && pkg.name, 'resolve'); - }); - - resolve('./foo.js', { basedir: dir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'foo.js')); - t.equal(pkg && pkg.name, 'resolve'); - }); - - resolve('./foo', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'foo.js')); - t.equal(pkg && pkg.main, 'resolver'); - }); - - resolve('./foo.js', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'foo.js')); - t.equal(pkg.main, 'resolver'); - }); - - resolve('./foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'foo.js')); - }); - - resolve('foo', { basedir: dir }, function (err) { - t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - // Test that filename is reported as the "from" value when passed. - resolve('foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err) { - t.equal(err.message, "Cannot find module 'foo' from '" + path.join(dir, 'baz.js') + "'"); - }); -}); - -test('bar', function (t) { - t.plan(6); - var dir = path.join(__dirname, 'resolver'); - - resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); - t.equal(pkg, undefined); - }); - - resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); - t.equal(pkg, undefined); - }); - - resolve('foo', { basedir: dir + '/bar', 'package': { main: 'bar' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); - t.equal(pkg.main, 'bar'); - }); -}); - -test('baz', function (t) { - t.plan(4); - var dir = path.join(__dirname, 'resolver'); - - resolve('./baz', { basedir: dir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'baz/quux.js')); - t.equal(pkg.main, 'quux.js'); - }); - - resolve('./baz', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'baz/quux.js')); - t.equal(pkg.main, 'quux.js'); - }); -}); - -test('biz', function (t) { - t.plan(24); - var dir = path.join(__dirname, 'resolver/biz/node_modules'); - - resolve('./grux', { basedir: dir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'grux/index.js')); - t.equal(pkg, undefined); - }); - - resolve('./grux', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'grux/index.js')); - t.equal(pkg.main, 'biz'); - }); - - resolve('./garply', { basedir: dir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'garply/lib/index.js')); - t.equal(pkg.main, './lib'); - }); - - resolve('./garply', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'garply/lib/index.js')); - t.equal(pkg.main, './lib'); - }); - - resolve('tiv', { basedir: dir + '/grux' }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'tiv/index.js')); - t.equal(pkg, undefined); - }); - - resolve('tiv', { basedir: dir + '/grux', 'package': { main: 'grux' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'tiv/index.js')); - t.equal(pkg.main, 'grux'); - }); - - resolve('tiv', { basedir: dir + '/garply' }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'tiv/index.js')); - t.equal(pkg, undefined); - }); - - resolve('tiv', { basedir: dir + '/garply', 'package': { main: './lib' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'tiv/index.js')); - t.equal(pkg.main, './lib'); - }); - - resolve('grux', { basedir: dir + '/tiv' }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'grux/index.js')); - t.equal(pkg, undefined); - }); - - resolve('grux', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'grux/index.js')); - t.equal(pkg.main, 'tiv'); - }); - - resolve('garply', { basedir: dir + '/tiv' }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'garply/lib/index.js')); - t.equal(pkg.main, './lib'); - }); - - resolve('garply', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'garply/lib/index.js')); - t.equal(pkg.main, './lib'); - }); -}); - -test('quux', function (t) { - t.plan(2); - var dir = path.join(__dirname, 'resolver/quux'); - - resolve('./foo', { basedir: dir, 'package': { main: 'quux' } }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'foo/index.js')); - t.equal(pkg.main, 'quux'); - }); -}); - -test('normalize', function (t) { - t.plan(2); - var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); - - resolve('../grux', { basedir: dir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'index.js')); - t.equal(pkg, undefined); - }); -}); - -test('cup', function (t) { - t.plan(5); - var dir = path.join(__dirname, 'resolver'); - - resolve('./cup', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'cup.coffee')); - }); - - resolve('./cup.coffee', { basedir: dir }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'cup.coffee')); - }); - - resolve('./cup', { basedir: dir, extensions: ['.js'] }, function (err, res) { - t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - // Test that filename is reported as the "from" value when passed. - resolve('./cup', { basedir: dir, extensions: ['.js'], filename: path.join(dir, 'cupboard.js') }, function (err, res) { - t.equal(err.message, "Cannot find module './cup' from '" + path.join(dir, 'cupboard.js') + "'"); - }); -}); - -test('mug', function (t) { - t.plan(3); - var dir = path.join(__dirname, 'resolver'); - - resolve('./mug', { basedir: dir }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'mug.js')); - }); - - resolve('./mug', { basedir: dir, extensions: ['.coffee', '.js'] }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(dir, '/mug.coffee')); - }); - - resolve('./mug', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { - t.equal(res, path.join(dir, '/mug.js')); - }); -}); - -test('other path', function (t) { - t.plan(6); - var resolverDir = path.join(__dirname, 'resolver'); - var dir = path.join(resolverDir, 'bar'); - var otherDir = path.join(resolverDir, 'other_path'); - - resolve('root', { basedir: dir, paths: [otherDir] }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(resolverDir, 'other_path/root.js')); - }); - - resolve('lib/other-lib', { basedir: dir, paths: [otherDir] }, function (err, res) { - if (err) t.fail(err); - t.equal(res, path.join(resolverDir, 'other_path/lib/other-lib.js')); - }); - - resolve('root', { basedir: dir }, function (err, res) { - t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - resolve('zzz', { basedir: dir, paths: [otherDir] }, function (err, res) { - t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); -}); - -test('path iterator', function (t) { - t.plan(2); - - var resolverDir = path.join(__dirname, 'resolver'); - - var exactIterator = function (x, start, getPackageCandidates, opts) { - return [path.join(resolverDir, x)]; - }; - - resolve('baz', { packageIterator: exactIterator }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(resolverDir, 'baz/quux.js')); - t.equal(pkg && pkg.name, 'baz'); - }); -}); - -test('incorrect main', function (t) { - t.plan(1); - - var resolverDir = path.join(__dirname, 'resolver'); - var dir = path.join(resolverDir, 'incorrect_main'); - - resolve('./incorrect_main', { basedir: resolverDir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'index.js')); - }); -}); - -test('missing index', function (t) { - t.plan(2); - - var resolverDir = path.join(__dirname, 'resolver'); - resolve('./missing_index', { basedir: resolverDir }, function (err, res, pkg) { - t.ok(err instanceof Error); - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - }); -}); - -test('missing main', function (t) { - t.plan(1); - - var resolverDir = path.join(__dirname, 'resolver'); - - resolve('./missing_main', { basedir: resolverDir }, function (err, res, pkg) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - }); -}); - -test('null main', function (t) { - t.plan(1); - - var resolverDir = path.join(__dirname, 'resolver'); - - resolve('./null_main', { basedir: resolverDir }, function (err, res, pkg) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - }); -}); - -test('main: false', function (t) { - t.plan(2); - - var basedir = path.join(__dirname, 'resolver'); - var dir = path.join(basedir, 'false_main'); - resolve('./false_main', { basedir: basedir }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal( - res, - path.join(dir, 'index.js'), - '`"main": false`: resolves to `index.js`' - ); - t.deepEqual(pkg, { - name: 'false_main', - main: false - }); - }); -}); - -test('without basedir', function (t) { - t.plan(1); - - var dir = path.join(__dirname, 'resolver/without_basedir'); - var tester = require(path.join(dir, 'main.js')); // eslint-disable-line global-require - - tester(t, function (err, res, pkg) { - if (err) { - t.fail(err); - } else { - t.equal(res, path.join(dir, 'node_modules/mymodule.js')); - } - }); -}); - -test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { - t.plan(2); - - var dir = path.join(__dirname, 'resolver'); - - resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'same_names/foo.js')); - }); - - resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'same_names/foo/index.js')); - }); -}); - -test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { - t.plan(2); - - var dir = path.join(__dirname, 'resolver'); - - resolve('./', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'same_names/foo/index.js')); - }); - - resolve('.', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'same_names/foo/index.js')); - }); -}); - -test('async: #121 - treating an existing file as a dir when no basedir', function (t) { - var testFile = path.basename(__filename); - - t.test('sanity check', function (st) { - st.plan(1); - resolve('./' + testFile, function (err, res, pkg) { - if (err) t.fail(err); - st.equal(res, __filename, 'sanity check'); - }); - }); - - t.test('with a fake directory', function (st) { - st.plan(4); - - resolve('./' + testFile + '/blah', function (err, res, pkg) { - st.ok(err, 'there is an error'); - st.notOk(res, 'no result'); - - st.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); - st.equal( - err && err.message, - 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', - 'can not find nonexistent module' - ); - st.end(); - }); - }); - - t.end(); -}); - -test('async dot main', function (t) { - var start = new Date(); - t.plan(3); - resolve('./resolver/dot_main', function (err, ret) { - t.notOk(err); - t.equal(ret, path.join(__dirname, 'resolver/dot_main/index.js')); - t.ok(new Date() - start < 50, 'resolve.sync timedout'); - t.end(); - }); -}); - -test('async dot slash main', function (t) { - var start = new Date(); - t.plan(3); - resolve('./resolver/dot_slash_main', function (err, ret) { - t.notOk(err); - t.equal(ret, path.join(__dirname, 'resolver/dot_slash_main/index.js')); - t.ok(new Date() - start < 50, 'resolve.sync timedout'); - t.end(); - }); -}); - -test('not a directory', function (t) { - t.plan(6); - var path = './foo'; - resolve(path, { basedir: __filename }, function (err, res, pkg) { - t.ok(err, 'a non-directory errors'); - t.equal(arguments.length, 1); - t.equal(res, undefined); - t.equal(pkg, undefined); - - t.equal(err && err.message, 'Cannot find module \'' + path + '\' from \'' + __filename + '\''); - t.equal(err && err.code, 'MODULE_NOT_FOUND'); - }); -}); - -test('non-string "main" field in package.json', function (t) { - t.plan(5); - - var dir = path.join(__dirname, 'resolver'); - resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { - t.ok(err, 'errors on non-string main'); - t.equal(err.message, 'package “invalid_main” `main` must be a string'); - t.equal(err.code, 'INVALID_PACKAGE_MAIN'); - t.equal(res, undefined, 'res is undefined'); - t.equal(pkg, undefined, 'pkg is undefined'); - }); -}); - -test('non-string "main" field in package.json', function (t) { - t.plan(5); - - var dir = path.join(__dirname, 'resolver'); - resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { - t.ok(err, 'errors on non-string main'); - t.equal(err.message, 'package “invalid_main” `main` must be a string'); - t.equal(err.code, 'INVALID_PACKAGE_MAIN'); - t.equal(res, undefined, 'res is undefined'); - t.equal(pkg, undefined, 'pkg is undefined'); - }); -}); - -test('browser field in package.json', function (t) { - t.plan(3); - - var dir = path.join(__dirname, 'resolver'); - resolve( - './browser_field', - { - basedir: dir, - packageFilter: function packageFilter(pkg) { - if (pkg.browser) { - pkg.main = pkg.browser; // eslint-disable-line no-param-reassign - delete pkg.browser; // eslint-disable-line no-param-reassign - } - return pkg; - } - }, - function (err, res, pkg) { - if (err) t.fail(err); - t.equal(res, path.join(dir, 'browser_field', 'b.js')); - t.equal(pkg && pkg.main, 'b'); - t.equal(pkg && pkg.browser, undefined); - } - ); -}); - -test('absolute paths', function (t) { - t.plan(4); - - var extensionless = __filename.slice(0, -path.extname(__filename).length); - - resolve(__filename, function (err, res) { - t.equal( - res, - __filename, - 'absolute path to this file resolves' - ); - }); - resolve(extensionless, function (err, res) { - t.equal( - res, - __filename, - 'extensionless absolute path to this file resolves' - ); - }); - resolve(__filename, { basedir: process.cwd() }, function (err, res) { - t.equal( - res, - __filename, - 'absolute path to this file with a basedir resolves' - ); - }); - resolve(extensionless, { basedir: process.cwd() }, function (err, res) { - t.equal( - res, - __filename, - 'extensionless absolute path to this file with a basedir resolves' - ); - }); -}); - -var malformedDir = path.join(__dirname, 'resolver/malformed_package_json'); -test('malformed package.json', { skip: !fs.existsSync(malformedDir) }, function (t) { - /* eslint operator-linebreak: ["error", "before"], function-paren-newline: "off" */ - t.plan( - (3 * 3) // 3 sets of 3 assertions in the final callback - + 2 // 1 readPackage call with malformed package.json - ); - - var basedir = malformedDir; - var expected = path.join(basedir, 'index.js'); - - resolve('./index.js', { basedir: basedir }, function (err, res, pkg) { - t.error(err, 'no error'); - t.equal(res, expected, 'malformed package.json is silently ignored'); - t.equal(pkg, undefined, 'malformed package.json gives an undefined `pkg` argument'); - }); - - resolve( - './index.js', - { - basedir: basedir, - packageFilter: function (pkg, pkgfile, dir) { - t.fail('should not reach here'); - } - }, - function (err, res, pkg) { - t.error(err, 'with packageFilter: no error'); - t.equal(res, expected, 'with packageFilter: malformed package.json is silently ignored'); - t.equal(pkg, undefined, 'with packageFilter: malformed package.json gives an undefined `pkg` argument'); - } - ); - - resolve( - './index.js', - { - basedir: basedir, - readPackage: function (readFile, pkgfile, cb) { - t.equal(pkgfile, path.join(basedir, 'package.json'), 'readPackageSync: `pkgfile` is package.json path'); - readFile(pkgfile, function (err, result) { - try { - cb(null, JSON.parse(result)); - } catch (e) { - t.ok(e instanceof SyntaxError, 'readPackage: malformed package.json parses as a syntax error'); - cb(null); - } - }); - } - }, - function (err, res, pkg) { - t.error(err, 'with readPackage: no error'); - t.equal(res, expected, 'with readPackage: malformed package.json is silently ignored'); - t.equal(pkg, undefined, 'with readPackage: malformed package.json gives an undefined `pkg` argument'); - } - ); -}); diff --git a/node_modules/resolve/test/resolver/baz/doom.js b/node_modules/resolve/test/resolver/baz/doom.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/baz/package.json b/node_modules/resolve/test/resolver/baz/package.json deleted file mode 100644 index 2f77720..0000000 --- a/node_modules/resolve/test/resolver/baz/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "baz", - "main": "quux.js" -} diff --git a/node_modules/resolve/test/resolver/baz/quux.js b/node_modules/resolve/test/resolver/baz/quux.js deleted file mode 100644 index bd816ea..0000000 --- a/node_modules/resolve/test/resolver/baz/quux.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/browser_field/a.js b/node_modules/resolve/test/resolver/browser_field/a.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/browser_field/b.js b/node_modules/resolve/test/resolver/browser_field/b.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/browser_field/package.json b/node_modules/resolve/test/resolver/browser_field/package.json deleted file mode 100644 index bf406f0..0000000 --- a/node_modules/resolve/test/resolver/browser_field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "browser_field", - "main": "a", - "browser": "b" -} diff --git a/node_modules/resolve/test/resolver/cup.coffee b/node_modules/resolve/test/resolver/cup.coffee deleted file mode 100644 index 8b13789..0000000 --- a/node_modules/resolve/test/resolver/cup.coffee +++ /dev/null @@ -1 +0,0 @@ - diff --git a/node_modules/resolve/test/resolver/dot_main/index.js b/node_modules/resolve/test/resolver/dot_main/index.js deleted file mode 100644 index bd816ea..0000000 --- a/node_modules/resolve/test/resolver/dot_main/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/dot_main/package.json b/node_modules/resolve/test/resolver/dot_main/package.json deleted file mode 100644 index d7f4fc8..0000000 --- a/node_modules/resolve/test/resolver/dot_main/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/node_modules/resolve/test/resolver/dot_slash_main/index.js b/node_modules/resolve/test/resolver/dot_slash_main/index.js deleted file mode 100644 index bd816ea..0000000 --- a/node_modules/resolve/test/resolver/dot_slash_main/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/dot_slash_main/package.json b/node_modules/resolve/test/resolver/dot_slash_main/package.json deleted file mode 100644 index f51287b..0000000 --- a/node_modules/resolve/test/resolver/dot_slash_main/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/node_modules/resolve/test/resolver/false_main/index.js b/node_modules/resolve/test/resolver/false_main/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/false_main/package.json b/node_modules/resolve/test/resolver/false_main/package.json deleted file mode 100644 index a7416c0..0000000 --- a/node_modules/resolve/test/resolver/false_main/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "false_main", - "main": false -} diff --git a/node_modules/resolve/test/resolver/foo.js b/node_modules/resolve/test/resolver/foo.js deleted file mode 100644 index bd816ea..0000000 --- a/node_modules/resolve/test/resolver/foo.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/incorrect_main/index.js b/node_modules/resolve/test/resolver/incorrect_main/index.js deleted file mode 100644 index bc1fb0a..0000000 --- a/node_modules/resolve/test/resolver/incorrect_main/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/incorrect_main/package.json b/node_modules/resolve/test/resolver/incorrect_main/package.json deleted file mode 100644 index b718804..0000000 --- a/node_modules/resolve/test/resolver/incorrect_main/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "wrong.js" -} diff --git a/node_modules/resolve/test/resolver/invalid_main/package.json b/node_modules/resolve/test/resolver/invalid_main/package.json deleted file mode 100644 index 0590748..0000000 --- a/node_modules/resolve/test/resolver/invalid_main/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "invalid_main", - "main": [ - "why is this a thing", - "srsly omg wtf" - ] -} diff --git a/node_modules/resolve/test/resolver/mug.coffee b/node_modules/resolve/test/resolver/mug.coffee deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/mug.js b/node_modules/resolve/test/resolver/mug.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/multirepo/lerna.json b/node_modules/resolve/test/resolver/multirepo/lerna.json deleted file mode 100644 index d6707ca..0000000 --- a/node_modules/resolve/test/resolver/multirepo/lerna.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "packages": [ - "packages/*" - ], - "version": "0.0.0" -} diff --git a/node_modules/resolve/test/resolver/multirepo/package.json b/node_modules/resolve/test/resolver/multirepo/package.json deleted file mode 100644 index 4391d39..0000000 --- a/node_modules/resolve/test/resolver/multirepo/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "ljharb-monorepo-symlink-test", - "private": true, - "version": "0.0.0", - "description": "", - "main": "index.js", - "scripts": { - "postinstall": "lerna bootstrap", - "test": "node packages/package-a" - }, - "author": "", - "license": "MIT", - "dependencies": { - "jquery": "^3.3.1", - "resolve": "../../../" - }, - "devDependencies": { - "lerna": "^3.4.3" - } -} diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js b/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js deleted file mode 100644 index 8875a32..0000000 --- a/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var assert = require('assert'); -var path = require('path'); -var resolve = require('resolve'); - -var basedir = __dirname + '/node_modules/@my-scope/package-b'; - -var expected = path.join(__dirname, '../../node_modules/jquery/dist/jquery.js'); - -/* - * preserveSymlinks === false - * will search NPM package from - * - packages/package-b/node_modules - * - packages/node_modules - * - node_modules - */ -assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: false }), expected); -assert.equal(resolve.sync('../../node_modules/jquery', { basedir: basedir, preserveSymlinks: false }), expected); - -/* - * preserveSymlinks === true - * will search NPM package from - * - packages/package-a/node_modules/@my-scope/packages/package-b/node_modules - * - packages/package-a/node_modules/@my-scope/packages/node_modules - * - packages/package-a/node_modules/@my-scope/node_modules - * - packages/package-a/node_modules/node_modules - * - packages/package-a/node_modules - * - packages/node_modules - * - node_modules - */ -assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: true }), expected); -assert.equal(resolve.sync('../../../../../node_modules/jquery', { basedir: basedir, preserveSymlinks: true }), expected); - -console.log(' * all monorepo paths successfully resolved through symlinks'); diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json b/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json deleted file mode 100644 index 204de51..0000000 --- a/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@my-scope/package-a", - "version": "0.0.0", - "private": true, - "description": "", - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "echo \"Error: run tests from root\" && exit 1" - }, - "dependencies": { - "@my-scope/package-b": "^0.0.0" - } -} diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js b/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json b/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json deleted file mode 100644 index f57c3b5..0000000 --- a/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@my-scope/package-b", - "private": true, - "version": "0.0.0", - "description": "", - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "echo \"Error: run tests from root\" && exit 1" - }, - "dependencies": { - "@my-scope/package-a": "^0.0.0" - } -} diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js b/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js deleted file mode 100644 index 9b4846a..0000000 --- a/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +++ /dev/null @@ -1,26 +0,0 @@ -var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); -var b; -var c; - -var test = function test() { - console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); - console.log(b, ': preserveSymlinks true'); - console.log(c, ': preserveSymlinks false'); - - if (a !== b && a !== c) { - throw 'async: no match'; - } - console.log('async: success! a matched either b or c\n'); -}; - -require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) { - if (err) { throw err; } - b = result.replace(process.cwd(), '$CWD'); - if (b && c) { test(); } -}); -require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) { - if (err) { throw err; } - c = result.replace(process.cwd(), '$CWD'); - if (b && c) { test(); } -}); - diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json b/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json deleted file mode 100644 index acfe9e9..0000000 --- a/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "mylib", - "version": "0.0.0", - "description": "", - "private": true, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "buffer": "*" - } -} diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js b/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js deleted file mode 100644 index 3283efc..0000000 --- a/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js +++ /dev/null @@ -1,12 +0,0 @@ -var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); -var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD'); -var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD'); - -console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); -console.log(b, ': preserveSymlinks true'); -console.log(c, ': preserveSymlinks false'); - -if (a !== b && a !== c) { - throw 'sync: no match'; -} -console.log('sync: success! a matched either b or c\n'); diff --git a/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/node_modules/resolve/test/resolver/other_path/lib/other-lib.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/other_path/root.js b/node_modules/resolve/test/resolver/other_path/root.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/quux/foo/index.js b/node_modules/resolve/test/resolver/quux/foo/index.js deleted file mode 100644 index bd816ea..0000000 --- a/node_modules/resolve/test/resolver/quux/foo/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/same_names/foo.js b/node_modules/resolve/test/resolver/same_names/foo.js deleted file mode 100644 index 888cae3..0000000 --- a/node_modules/resolve/test/resolver/same_names/foo.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 42; diff --git a/node_modules/resolve/test/resolver/same_names/foo/index.js b/node_modules/resolve/test/resolver/same_names/foo/index.js deleted file mode 100644 index bd816ea..0000000 --- a/node_modules/resolve/test/resolver/same_names/foo/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js b/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/resolver/symlinked/package/bar.js b/node_modules/resolve/test/resolver/symlinked/package/bar.js deleted file mode 100644 index cb1c2c0..0000000 --- a/node_modules/resolve/test/resolver/symlinked/package/bar.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'bar'; diff --git a/node_modules/resolve/test/resolver/symlinked/package/package.json b/node_modules/resolve/test/resolver/symlinked/package/package.json deleted file mode 100644 index 8e1b585..0000000 --- a/node_modules/resolve/test/resolver/symlinked/package/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "bar.js" -} \ No newline at end of file diff --git a/node_modules/resolve/test/resolver/without_basedir/main.js b/node_modules/resolve/test/resolver/without_basedir/main.js deleted file mode 100644 index 5b31975..0000000 --- a/node_modules/resolve/test/resolver/without_basedir/main.js +++ /dev/null @@ -1,5 +0,0 @@ -var resolve = require('../../../'); - -module.exports = function (t, cb) { - resolve('mymodule', null, cb); -}; diff --git a/node_modules/resolve/test/resolver_sync.js b/node_modules/resolve/test/resolver_sync.js deleted file mode 100644 index a6df8ce..0000000 --- a/node_modules/resolve/test/resolver_sync.js +++ /dev/null @@ -1,730 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var test = require('tape'); - -var resolve = require('../'); -var sync = require('../sync'); - -var requireResolveSupportsPaths = require.resolve.length > 1 - && !(/^v12\.[012]\./).test(process.version); // broken in v12.0-12.2, see https://github.com/nodejs/node/issues/27794 - -var requireResolveDefaultPathsBroken = (/^v8\.9\.|^v9\.[01]\.0|^v9\.2\./).test(process.version); -// broken in node v8.9.x, v9.0, v9.1, v9.2.x. see https://github.com/nodejs/node/pull/17113 - -test('`./sync` entry point', function (t) { - t.equal(resolve.sync, sync, '`./sync` entry point is the same as `.sync` on `main`'); - t.end(); -}); - -test('foo', function (t) { - var dir = path.join(__dirname, 'resolver'); - - t.equal( - resolve.sync('./foo', { basedir: dir }), - path.join(dir, 'foo.js'), - './foo' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./foo', { basedir: dir }), - require.resolve('./foo', { paths: [dir] }), - './foo: resolve.sync === require.resolve' - ); - } - - t.equal( - resolve.sync('./foo.js', { basedir: dir }), - path.join(dir, 'foo.js'), - './foo.js' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./foo.js', { basedir: dir }), - require.resolve('./foo.js', { paths: [dir] }), - './foo.js: resolve.sync === require.resolve' - ); - } - - t.equal( - resolve.sync('./foo.js', { basedir: dir, filename: path.join(dir, 'bar.js') }), - path.join(dir, 'foo.js') - ); - - t.throws(function () { - resolve.sync('foo', { basedir: dir }); - }); - - // Test that filename is reported as the "from" value when passed. - t.throws( - function () { - resolve.sync('foo', { basedir: dir, filename: path.join(dir, 'bar.js') }); - }, - { - name: 'Error', - message: "Cannot find module 'foo' from '" + path.join(dir, 'bar.js') + "'" - } - ); - - t.end(); -}); - -test('bar', function (t) { - var dir = path.join(__dirname, 'resolver'); - - var basedir = path.join(dir, 'bar'); - - t.equal( - resolve.sync('foo', { basedir: basedir }), - path.join(dir, 'bar/node_modules/foo/index.js'), - 'foo in bar' - ); - if (!requireResolveDefaultPathsBroken && requireResolveSupportsPaths) { - t.equal( - resolve.sync('foo', { basedir: basedir }), - require.resolve('foo', { paths: [basedir] }), - 'foo in bar: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('baz', function (t) { - var dir = path.join(__dirname, 'resolver'); - - t.equal( - resolve.sync('./baz', { basedir: dir }), - path.join(dir, 'baz/quux.js'), - './baz' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./baz', { basedir: dir }), - require.resolve('./baz', { paths: [dir] }), - './baz: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('biz', function (t) { - var dir = path.join(__dirname, 'resolver/biz/node_modules'); - - t.equal( - resolve.sync('./grux', { basedir: dir }), - path.join(dir, 'grux/index.js') - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./grux', { basedir: dir }), - require.resolve('./grux', { paths: [dir] }), - './grux: resolve.sync === require.resolve' - ); - } - - var tivDir = path.join(dir, 'grux'); - t.equal( - resolve.sync('tiv', { basedir: tivDir }), - path.join(dir, 'tiv/index.js') - ); - if (!requireResolveDefaultPathsBroken && requireResolveSupportsPaths) { - t.equal( - resolve.sync('tiv', { basedir: tivDir }), - require.resolve('tiv', { paths: [tivDir] }), - 'tiv: resolve.sync === require.resolve' - ); - } - - var gruxDir = path.join(dir, 'tiv'); - t.equal( - resolve.sync('grux', { basedir: gruxDir }), - path.join(dir, 'grux/index.js') - ); - if (!requireResolveDefaultPathsBroken && requireResolveSupportsPaths) { - t.equal( - resolve.sync('grux', { basedir: gruxDir }), - require.resolve('grux', { paths: [gruxDir] }), - 'grux: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('normalize', function (t) { - var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); - - t.equal( - resolve.sync('../grux', { basedir: dir }), - path.join(dir, 'index.js') - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('../grux', { basedir: dir }), - require.resolve('../grux', { paths: [dir] }), - '../grux: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('cup', function (t) { - var dir = path.join(__dirname, 'resolver'); - - t.equal( - resolve.sync('./cup', { - basedir: dir, - extensions: ['.js', '.coffee'] - }), - path.join(dir, 'cup.coffee'), - './cup -> ./cup.coffee' - ); - - t.equal( - resolve.sync('./cup.coffee', { basedir: dir }), - path.join(dir, 'cup.coffee'), - './cup.coffee' - ); - - t.throws(function () { - resolve.sync('./cup', { - basedir: dir, - extensions: ['.js'] - }); - }); - - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./cup.coffee', { basedir: dir, extensions: ['.js', '.coffee'] }), - require.resolve('./cup.coffee', { paths: [dir] }), - './cup.coffee: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('mug', function (t) { - var dir = path.join(__dirname, 'resolver'); - - t.equal( - resolve.sync('./mug', { basedir: dir }), - path.join(dir, 'mug.js'), - './mug -> ./mug.js' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./mug', { basedir: dir }), - require.resolve('./mug', { paths: [dir] }), - './mug: resolve.sync === require.resolve' - ); - } - - t.equal( - resolve.sync('./mug', { - basedir: dir, - extensions: ['.coffee', '.js'] - }), - path.join(dir, 'mug.coffee'), - './mug -> ./mug.coffee' - ); - - t.equal( - resolve.sync('./mug', { - basedir: dir, - extensions: ['.js', '.coffee'] - }), - path.join(dir, 'mug.js'), - './mug -> ./mug.js' - ); - - t.end(); -}); - -test('other path', function (t) { - var resolverDir = path.join(__dirname, 'resolver'); - var dir = path.join(resolverDir, 'bar'); - var otherDir = path.join(resolverDir, 'other_path'); - - t.equal( - resolve.sync('root', { - basedir: dir, - paths: [otherDir] - }), - path.join(resolverDir, 'other_path/root.js') - ); - - t.equal( - resolve.sync('lib/other-lib', { - basedir: dir, - paths: [otherDir] - }), - path.join(resolverDir, 'other_path/lib/other-lib.js') - ); - - t.throws(function () { - resolve.sync('root', { basedir: dir }); - }); - - t.throws(function () { - resolve.sync('zzz', { - basedir: dir, - paths: [otherDir] - }); - }); - - t.end(); -}); - -test('path iterator', function (t) { - var resolverDir = path.join(__dirname, 'resolver'); - - var exactIterator = function (x, start, getPackageCandidates, opts) { - return [path.join(resolverDir, x)]; - }; - - t.equal( - resolve.sync('baz', { packageIterator: exactIterator }), - path.join(resolverDir, 'baz/quux.js') - ); - - t.end(); -}); - -test('incorrect main', function (t) { - var resolverDir = path.join(__dirname, 'resolver'); - var dir = path.join(resolverDir, 'incorrect_main'); - - t.equal( - resolve.sync('./incorrect_main', { basedir: resolverDir }), - path.join(dir, 'index.js') - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./incorrect_main', { basedir: resolverDir }), - require.resolve('./incorrect_main', { paths: [resolverDir] }), - './incorrect_main: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('missing index', function (t) { - t.plan(requireResolveSupportsPaths ? 2 : 1); - - var resolverDir = path.join(__dirname, 'resolver'); - try { - resolve.sync('./missing_index', { basedir: resolverDir }); - t.fail('did not fail'); - } catch (err) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - } - if (requireResolveSupportsPaths) { - try { - require.resolve('./missing_index', { basedir: resolverDir }); - t.fail('require.resolve did not fail'); - } catch (err) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - } - } -}); - -test('missing main', function (t) { - var resolverDir = path.join(__dirname, 'resolver'); - - try { - resolve.sync('./missing_main', { basedir: resolverDir }); - t.fail('require.resolve did not fail'); - } catch (err) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - } - if (requireResolveSupportsPaths) { - try { - resolve.sync('./missing_main', { basedir: resolverDir }); - t.fail('require.resolve did not fail'); - } catch (err) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - } - } - - t.end(); -}); - -test('null main', function (t) { - var resolverDir = path.join(__dirname, 'resolver'); - - try { - resolve.sync('./null_main', { basedir: resolverDir }); - t.fail('require.resolve did not fail'); - } catch (err) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - } - if (requireResolveSupportsPaths) { - try { - resolve.sync('./null_main', { basedir: resolverDir }); - t.fail('require.resolve did not fail'); - } catch (err) { - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); - } - } - - t.end(); -}); - -test('main: false', function (t) { - var basedir = path.join(__dirname, 'resolver'); - var dir = path.join(basedir, 'false_main'); - t.equal( - resolve.sync('./false_main', { basedir: basedir }), - path.join(dir, 'index.js'), - '`"main": false`: resolves to `index.js`' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./false_main', { basedir: basedir }), - require.resolve('./false_main', { paths: [basedir] }), - '`"main": false`: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -var stubStatSync = function stubStatSync(fn) { - var statSync = fs.statSync; - try { - fs.statSync = function () { - throw new EvalError('Unknown Error'); - }; - return fn(); - } finally { - fs.statSync = statSync; - } -}; - -test('#79 - re-throw non ENOENT errors from stat', function (t) { - var dir = path.join(__dirname, 'resolver'); - - stubStatSync(function () { - t.throws(function () { - resolve.sync('foo', { basedir: dir }); - }, /Unknown Error/); - }); - - t.end(); -}); - -test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { - var dir = path.join(__dirname, 'resolver'); - var basedir = path.join(dir, 'same_names'); - - t.equal( - resolve.sync('./foo', { basedir: basedir }), - path.join(dir, 'same_names/foo.js') - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./foo', { basedir: basedir }), - require.resolve('./foo', { paths: [basedir] }), - './foo: resolve.sync === require.resolve' - ); - } - - t.equal( - resolve.sync('./foo/', { basedir: basedir }), - path.join(dir, 'same_names/foo/index.js') - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./foo/', { basedir: basedir }), - require.resolve('./foo/', { paths: [basedir] }), - './foo/: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { - var dir = path.join(__dirname, 'resolver'); - var basedir = path.join(dir, 'same_names/foo'); - - t.equal( - resolve.sync('./', { basedir: basedir }), - path.join(dir, 'same_names/foo/index.js'), - './' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./', { basedir: basedir }), - require.resolve('./', { paths: [basedir] }), - './: resolve.sync === require.resolve' - ); - } - - t.equal( - resolve.sync('.', { basedir: basedir }), - path.join(dir, 'same_names/foo/index.js'), - '.' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('.', { basedir: basedir }), - require.resolve('.', { paths: [basedir] }), - '.: resolve.sync === require.resolve', - { todo: true } - ); - } - - t.end(); -}); - -test('sync: #121 - treating an existing file as a dir when no basedir', function (t) { - var testFile = path.basename(__filename); - - t.test('sanity check', function (st) { - st.equal( - resolve.sync('./' + testFile), - __filename, - 'sanity check' - ); - st.equal( - resolve.sync('./' + testFile), - require.resolve('./' + testFile), - 'sanity check: resolve.sync === require.resolve' - ); - - st.end(); - }); - - t.test('with a fake directory', function (st) { - function run() { return resolve.sync('./' + testFile + '/blah'); } - - st.throws(run, 'throws an error'); - - try { - run(); - } catch (e) { - st.equal(e.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); - st.equal( - e.message, - 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', - 'can not find nonexistent module' - ); - } - - st.end(); - }); - - t.end(); -}); - -test('sync dot main', function (t) { - var start = new Date(); - - t.equal( - resolve.sync('./resolver/dot_main'), - path.join(__dirname, 'resolver/dot_main/index.js'), - './resolver/dot_main' - ); - t.equal( - resolve.sync('./resolver/dot_main'), - require.resolve('./resolver/dot_main'), - './resolver/dot_main: resolve.sync === require.resolve' - ); - - t.ok(new Date() - start < 50, 'resolve.sync timedout'); - - t.end(); -}); - -test('sync dot slash main', function (t) { - var start = new Date(); - - t.equal( - resolve.sync('./resolver/dot_slash_main'), - path.join(__dirname, 'resolver/dot_slash_main/index.js') - ); - t.equal( - resolve.sync('./resolver/dot_slash_main'), - require.resolve('./resolver/dot_slash_main'), - './resolver/dot_slash_main: resolve.sync === require.resolve' - ); - - t.ok(new Date() - start < 50, 'resolve.sync timedout'); - - t.end(); -}); - -test('not a directory', function (t) { - var path = './foo'; - try { - resolve.sync(path, { basedir: __filename }); - t.fail(); - } catch (err) { - t.ok(err, 'a non-directory errors'); - t.equal(err && err.message, 'Cannot find module \'' + path + "' from '" + __filename + "'"); - t.equal(err && err.code, 'MODULE_NOT_FOUND'); - } - t.end(); -}); - -test('non-string "main" field in package.json', function (t) { - var dir = path.join(__dirname, 'resolver'); - try { - var result = resolve.sync('./invalid_main', { basedir: dir }); - t.equal(result, undefined, 'result should not exist'); - t.fail('should not get here'); - } catch (err) { - t.ok(err, 'errors on non-string main'); - t.equal(err.message, 'package “invalid_main” `main` must be a string'); - t.equal(err.code, 'INVALID_PACKAGE_MAIN'); - } - t.end(); -}); - -test('non-string "main" field in package.json', function (t) { - var dir = path.join(__dirname, 'resolver'); - try { - var result = resolve.sync('./invalid_main', { basedir: dir }); - t.equal(result, undefined, 'result should not exist'); - t.fail('should not get here'); - } catch (err) { - t.ok(err, 'errors on non-string main'); - t.equal(err.message, 'package “invalid_main” `main` must be a string'); - t.equal(err.code, 'INVALID_PACKAGE_MAIN'); - } - t.end(); -}); - -test('browser field in package.json', function (t) { - var dir = path.join(__dirname, 'resolver'); - var res = resolve.sync('./browser_field', { - basedir: dir, - packageFilter: function packageFilter(pkg) { - if (pkg.browser) { - pkg.main = pkg.browser; // eslint-disable-line no-param-reassign - delete pkg.browser; // eslint-disable-line no-param-reassign - } - return pkg; - } - }); - t.equal(res, path.join(dir, 'browser_field', 'b.js')); - t.end(); -}); - -test('absolute paths', function (t) { - var extensionless = __filename.slice(0, -path.extname(__filename).length); - - t.equal( - resolve.sync(__filename), - __filename, - 'absolute path to this file resolves' - ); - t.equal( - resolve.sync(__filename), - require.resolve(__filename), - 'absolute path to this file: resolve.sync === require.resolve' - ); - - t.equal( - resolve.sync(extensionless), - __filename, - 'extensionless absolute path to this file resolves' - ); - t.equal( - resolve.sync(__filename), - require.resolve(__filename), - 'absolute path to this file: resolve.sync === require.resolve' - ); - - t.equal( - resolve.sync(__filename, { basedir: process.cwd() }), - __filename, - 'absolute path to this file with a basedir resolves' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync(__filename, { basedir: process.cwd() }), - require.resolve(__filename, { paths: [process.cwd()] }), - 'absolute path to this file + basedir: resolve.sync === require.resolve' - ); - } - - t.equal( - resolve.sync(extensionless, { basedir: process.cwd() }), - __filename, - 'extensionless absolute path to this file with a basedir resolves' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync(extensionless, { basedir: process.cwd() }), - require.resolve(extensionless, { paths: [process.cwd()] }), - 'extensionless absolute path to this file + basedir: resolve.sync === require.resolve' - ); - } - - t.end(); -}); - -var malformedDir = path.join(__dirname, 'resolver/malformed_package_json'); -test('malformed package.json', { skip: !fs.existsSync(malformedDir) }, function (t) { - t.plan(5 + (requireResolveSupportsPaths ? 1 : 0)); - - var basedir = malformedDir; - var expected = path.join(basedir, 'index.js'); - - t.equal( - resolve.sync('./index.js', { basedir: basedir }), - expected, - 'malformed package.json is silently ignored' - ); - if (requireResolveSupportsPaths) { - t.equal( - resolve.sync('./index.js', { basedir: basedir }), - require.resolve('./index.js', { paths: [basedir] }), - 'malformed package.json: resolve.sync === require.resolve' - ); - } - - var res1 = resolve.sync( - './index.js', - { - basedir: basedir, - packageFilter: function (pkg, pkgfile, dir) { - t.fail('should not reach here'); - } - } - ); - - t.equal( - res1, - expected, - 'with packageFilter: malformed package.json is silently ignored' - ); - - var res2 = resolve.sync( - './index.js', - { - basedir: basedir, - readPackageSync: function (readFileSync, pkgfile) { - t.equal(pkgfile, path.join(basedir, 'package.json'), 'readPackageSync: `pkgfile` is package.json path'); - var result = String(readFileSync(pkgfile)); - try { - return JSON.parse(result); - } catch (e) { - t.ok(e instanceof SyntaxError, 'readPackageSync: malformed package.json parses as a syntax error'); - } - } - } - ); - - t.equal( - res2, - expected, - 'with readPackageSync: malformed package.json is silently ignored' - ); -}); diff --git a/node_modules/resolve/test/shadowed_core.js b/node_modules/resolve/test/shadowed_core.js deleted file mode 100644 index 3a5f4fc..0000000 --- a/node_modules/resolve/test/shadowed_core.js +++ /dev/null @@ -1,54 +0,0 @@ -var test = require('tape'); -var resolve = require('../'); -var path = require('path'); - -test('shadowed core modules still return core module', function (t) { - t.plan(2); - - resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { - t.ifError(err); - t.equal(res, 'util'); - }); -}); - -test('shadowed core modules still return core module [sync]', function (t) { - t.plan(1); - - var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') }); - - t.equal(res, 'util'); -}); - -test('shadowed core modules return shadow when appending `/`', function (t) { - t.plan(2); - - resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { - t.ifError(err); - t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); - }); -}); - -test('shadowed core modules return shadow when appending `/` [sync]', function (t) { - t.plan(1); - - var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') }); - - t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); -}); - -test('shadowed core modules return shadow with `includeCoreModules: false`', function (t) { - t.plan(2); - - resolve('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }, function (err, res) { - t.ifError(err); - t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); - }); -}); - -test('shadowed core modules return shadow with `includeCoreModules: false` [sync]', function (t) { - t.plan(1); - - var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }); - - t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); -}); diff --git a/node_modules/resolve/test/shadowed_core/node_modules/util/index.js b/node_modules/resolve/test/shadowed_core/node_modules/util/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/resolve/test/subdirs.js b/node_modules/resolve/test/subdirs.js deleted file mode 100644 index b7b8450..0000000 --- a/node_modules/resolve/test/subdirs.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tape'); -var resolve = require('../'); -var path = require('path'); - -test('subdirs', function (t) { - t.plan(2); - - var dir = path.join(__dirname, '/subdirs'); - resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { - t.ifError(err); - t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); - }); -}); diff --git a/node_modules/resolve/test/symlinks.js b/node_modules/resolve/test/symlinks.js deleted file mode 100644 index 35f881a..0000000 --- a/node_modules/resolve/test/symlinks.js +++ /dev/null @@ -1,176 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var test = require('tape'); -var map = require('array.prototype.map'); -var resolve = require('../'); - -var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); -var packageDir = path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'package'); -var modADir = path.join(__dirname, 'symlinks', 'source', 'node_modules', 'mod-a'); -var symlinkModADir = path.join(__dirname, 'symlinks', 'dest', 'node_modules', 'mod-a'); -try { - fs.unlinkSync(symlinkDir); -} catch (err) {} -try { - fs.unlinkSync(packageDir); -} catch (err) {} -try { - fs.unlinkSync(modADir); -} catch (err) {} -try { - fs.unlinkSync(symlinkModADir); -} catch (err) {} - -try { - fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); -} catch (err) { - // if fails then it is probably on Windows and lets try to create a junction - fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); -} -try { - fs.symlinkSync('../../package', packageDir, 'dir'); -} catch (err) { - // if fails then it is probably on Windows and lets try to create a junction - fs.symlinkSync(path.join(__dirname, '..', '..', 'package') + '\\', packageDir, 'junction'); -} -try { - fs.symlinkSync('../../source/node_modules/mod-a', symlinkModADir, 'dir'); -} catch (err) { - // if fails then it is probably on Windows and lets try to create a junction - fs.symlinkSync(path.join(__dirname, '..', '..', 'source', 'node_modules', 'mod-a') + '\\', symlinkModADir, 'junction'); -} - -test('symlink', function (t) { - t.plan(2); - - resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { - t.error(err); - t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); - }); -}); - -test('sync symlink when preserveSymlinks = true', function (t) { - t.plan(4); - - resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { - t.ok(err, 'there is an error'); - t.notOk(res, 'no result'); - - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); - t.equal( - err && err.message, - 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', - 'can not find nonexistent module' - ); - }); -}); - -test('sync symlink', function (t) { - var start = new Date(); - t.doesNotThrow(function () { - t.equal( - resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), - path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js') - ); - }); - t.ok(new Date() - start < 50, 'resolve.sync timedout'); - t.end(); -}); - -test('sync symlink when preserveSymlinks = true', function (t) { - t.throws(function () { - resolve.sync('foo', { basedir: symlinkDir }); - }, /Cannot find module 'foo'/); - t.end(); -}); - -test('sync symlink from node_modules to other dir when preserveSymlinks = false', function (t) { - var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); - var fn = resolve.sync('package', { basedir: basedir, preserveSymlinks: false }); - - t.equal(fn, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); - t.end(); -}); - -test('async symlink from node_modules to other dir when preserveSymlinks = false', function (t) { - t.plan(2); - var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); - resolve('package', { basedir: basedir, preserveSymlinks: false }, function (err, result) { - t.notOk(err, 'no error'); - t.equal(result, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); - }); -}); - -test('packageFilter', function (t) { - function relative(x) { - return path.relative(__dirname, x); - } - - function testPackageFilter(preserveSymlinks) { - return function (st) { - st.plan('is 1.x' ? 3 : 5); // eslint-disable-line no-constant-condition - - var destMain = 'symlinks/dest/node_modules/mod-a/index.js'; - var destPkg = 'symlinks/dest/node_modules/mod-a/package.json'; - var sourceMain = 'symlinks/source/node_modules/mod-a/index.js'; - var sourcePkg = 'symlinks/source/node_modules/mod-a/package.json'; - var destDir = path.join(__dirname, 'symlinks', 'dest'); - - /* eslint multiline-comment-style: 0 */ - /* v2.x will restore these tests - var packageFilterPath = []; - var actualPath = resolve.sync('mod-a', { - basedir: destDir, - preserveSymlinks: preserveSymlinks, - packageFilter: function (pkg, pkgfile, dir) { - packageFilterPath.push(pkgfile); - } - }); - st.equal( - relative(actualPath), - path.normalize(preserveSymlinks ? destMain : sourceMain), - 'sync: actual path is correct' - ); - st.deepEqual( - map(packageFilterPath, relative), - map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize), - 'sync: packageFilter pkgfile arg is correct' - ); - */ - - var asyncPackageFilterPath = []; - resolve( - 'mod-a', - { - basedir: destDir, - preserveSymlinks: preserveSymlinks, - packageFilter: function (pkg, pkgfile) { - asyncPackageFilterPath.push(pkgfile); - } - }, - function (err, actualPath) { - st.error(err, 'no error'); - st.equal( - relative(actualPath), - path.normalize(preserveSymlinks ? destMain : sourceMain), - 'async: actual path is correct' - ); - st.deepEqual( - map(asyncPackageFilterPath, relative), - map( - preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg], - path.normalize - ), - 'async: packageFilter pkgfile arg is correct' - ); - } - ); - }; - } - - t.test('preserveSymlinks: false', testPackageFilter(false)); - - t.test('preserveSymlinks: true', testPackageFilter(true)); - - t.end(); -}); diff --git a/node_modules/safe-buffer/LICENSE b/node_modules/safe-buffer/LICENSE deleted file mode 100644 index 0c068ce..0000000 --- a/node_modules/safe-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md deleted file mode 100644 index e9a81af..0000000 --- a/node_modules/safe-buffer/README.md +++ /dev/null @@ -1,584 +0,0 @@ -# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg -[travis-url]: https://travis-ci.org/feross/safe-buffer -[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg -[npm-url]: https://npmjs.org/package/safe-buffer -[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg -[downloads-url]: https://npmjs.org/package/safe-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### Safer Node.js Buffer API - -**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, -`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** - -**Uses the built-in implementation when available.** - -## install - -``` -npm install safe-buffer -``` - -## usage - -The goal of this package is to provide a safe replacement for the node.js `Buffer`. - -It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to -the top of your node.js modules: - -```js -var Buffer = require('safe-buffer').Buffer - -// Existing buffer code will continue to work without issues: - -new Buffer('hey', 'utf8') -new Buffer([1, 2, 3], 'utf8') -new Buffer(obj) -new Buffer(16) // create an uninitialized buffer (potentially unsafe) - -// But you can use these new explicit APIs to make clear what you want: - -Buffer.from('hey', 'utf8') // convert from many types to a Buffer -Buffer.alloc(16) // create a zero-filled buffer (safe) -Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) -``` - -## api - -### Class Method: Buffer.from(array) - - -* `array` {Array} - -Allocates a new `Buffer` using an `array` of octets. - -```js -const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -A `TypeError` will be thrown if `array` is not an `Array`. - -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) - - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or - a `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created `Buffer` will share the same allocated memory as the -TypedArray. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypedArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const ab = new ArrayBuffer(10); -const buf = Buffer.from(ab, 0, 2); -console.log(buf.length); - // Prints: 2 -``` - -A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. - -### Class Method: Buffer.from(buffer) - - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = Buffer.from('buffer'); -const buf2 = Buffer.from(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -A `TypeError` will be thrown if `buffer` is not a `Buffer`. - -### Class Method: Buffer.from(str[, encoding]) - - -* `str` {String} String to encode. -* `encoding` {String} Encoding to use, Default: `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the character encoding. -If not provided, `encoding` defaults to `'utf8'`. - -```js -const buf1 = Buffer.from('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -A `TypeError` will be thrown if `str` is not a string. - -### Class Method: Buffer.alloc(size[, fill[, encoding]]) - - -* `size` {Number} -* `fill` {Value} Default: `undefined` -* `encoding` {String} Default: `utf8` - -Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the -`Buffer` will be *zero-filled*. - -```js -const buf = Buffer.alloc(5); -console.log(buf); - // -``` - -The `size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -If `fill` is specified, the allocated `Buffer` will be initialized by calling -`buf.fill(fill)`. See [`buf.fill()`][] for more information. - -```js -const buf = Buffer.alloc(5, 'a'); -console.log(buf); - // -``` - -If both `fill` and `encoding` are specified, the allocated `Buffer` will be -initialized by calling `buf.fill(fill, encoding)`. For example: - -```js -const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); -console.log(buf); - // -``` - -Calling `Buffer.alloc(size)` can be significantly slower than the alternative -`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance -contents will *never contain sensitive data*. - -A `TypeError` will be thrown if `size` is not a number. - -### Class Method: Buffer.allocUnsafe(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must -be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. A zero-length Buffer will be created if a `size` less than or equal to -0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -```js -const buf = Buffer.allocUnsafe(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -A `TypeError` will be thrown if `size` is not a number. - -Note that the `Buffer` module pre-allocates an internal `Buffer` instance of -size `Buffer.poolSize` that is used as a pool for the fast allocation of new -`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated -`new Buffer(size)` constructor) only when `size` is less than or equal to -`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default -value of `Buffer.poolSize` is `8192` but can be modified. - -Use of this pre-allocated internal memory pool is a key difference between -calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. -Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer -pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal -Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The -difference is subtle but can be important when an application requires the -additional performance that `Buffer.allocUnsafe(size)` provides. - -### Class Method: Buffer.allocUnsafeSlow(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The -`size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, -allocations under 4KB are, by default, sliced from a single pre-allocated -`Buffer`. This allows applications to avoid the garbage collection overhead of -creating many individually allocated Buffers. This approach improves both -performance and memory usage by eliminating the need to track and cleanup as -many `Persistent` objects. - -However, in the case where a developer may need to retain a small chunk of -memory from a pool for an indeterminate amount of time, it may be appropriate -to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then -copy out the relevant bits. - -```js -// need to keep around a few small chunks of memory -const store = []; - -socket.on('readable', () => { - const data = socket.read(); - // allocate for retained data - const sb = Buffer.allocUnsafeSlow(10); - // copy the data into the new allocation - data.copy(sb, 0, 0, 10); - store.push(sb); -}); -``` - -Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* -a developer has observed undue memory retention in their applications. - -A `TypeError` will be thrown if `size` is not a number. - -### All the Rest - -The rest of the `Buffer` API is exactly the same as in node.js. -[See the docs](https://nodejs.org/api/buffer.html). - - -## Related links - -- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) -- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) - -## Why is `Buffer` unsafe? - -Today, the node.js `Buffer` constructor is overloaded to handle many different argument -types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), -`ArrayBuffer`, and also `Number`. - -The API is optimized for convenience: you can throw any type at it, and it will try to do -what you want. - -Because the Buffer constructor is so powerful, you often see code like this: - -```js -// Convert UTF-8 strings to hex -function toHex (str) { - return new Buffer(str).toString('hex') -} -``` - -***But what happens if `toHex` is called with a `Number` argument?*** - -### Remote Memory Disclosure - -If an attacker can make your program call the `Buffer` constructor with a `Number` -argument, then they can make it allocate uninitialized memory from the node.js process. -This could potentially disclose TLS private keys, user data, or database passwords. - -When the `Buffer` constructor is passed a `Number` argument, it returns an -**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like -this, you **MUST** overwrite the contents before returning it to the user. - -From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): - -> `new Buffer(size)` -> -> - `size` Number -> -> The underlying memory for `Buffer` instances created in this way is not initialized. -> **The contents of a newly created `Buffer` are unknown and could contain sensitive -> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. - -(Emphasis our own.) - -Whenever the programmer intended to create an uninitialized `Buffer` you often see code -like this: - -```js -var buf = new Buffer(16) - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### Would this ever be a problem in real code? - -Yes. It's surprisingly common to forget to check the type of your variables in a -dynamically-typed language like JavaScript. - -Usually the consequences of assuming the wrong type is that your program crashes with an -uncaught exception. But the failure mode for forgetting to check the type of arguments to -the `Buffer` constructor is more catastrophic. - -Here's an example of a vulnerable service that takes a JSON payload and converts it to -hex: - -```js -// Take a JSON payload {str: "some string"} and convert it to hex -var server = http.createServer(function (req, res) { - var data = '' - req.setEncoding('utf8') - req.on('data', function (chunk) { - data += chunk - }) - req.on('end', function () { - var body = JSON.parse(data) - res.end(new Buffer(body.str).toString('hex')) - }) -}) - -server.listen(8080) -``` - -In this example, an http client just has to send: - -```json -{ - "str": 1000 -} -``` - -and it will get back 1,000 bytes of uninitialized memory from the server. - -This is a very serious bug. It's similar in severity to the -[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process -memory by remote attackers. - - -### Which real-world packages were vulnerable? - -#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) - -[Mathias Buus](https://github.com/mafintosh) and I -([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, -[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow -anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get -them to reveal 20 bytes at a time of uninitialized memory from the node.js process. - -Here's -[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) -that fixed it. We released a new fixed version, created a -[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all -vulnerable versions on npm so users will get a warning to upgrade to a newer version. - -#### [`ws`](https://www.npmjs.com/package/ws) - -That got us wondering if there were other vulnerable packages. Sure enough, within a short -period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the -most popular WebSocket implementation in node.js. - -If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as -expected, then uninitialized server memory would be disclosed to the remote peer. - -These were the vulnerable methods: - -```js -socket.send(number) -socket.ping(number) -socket.pong(number) -``` - -Here's a vulnerable socket server with some echo functionality: - -```js -server.on('connection', function (socket) { - socket.on('message', function (message) { - message = JSON.parse(message) - if (message.type === 'echo') { - socket.send(message.data) // send back the user's message - } - }) -}) -``` - -`socket.send(number)` called on the server, will disclose server memory. - -Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue -was fixed, with a more detailed explanation. Props to -[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the -[Node Security Project disclosure](https://nodesecurity.io/advisories/67). - - -### What's the solution? - -It's important that node.js offers a fast way to get memory otherwise performance-critical -applications would needlessly get a lot slower. - -But we need a better way to *signal our intent* as programmers. **When we want -uninitialized memory, we should request it explicitly.** - -Sensitive functionality should not be packed into a developer-friendly API that loosely -accepts many different types. This type of API encourages the lazy practice of passing -variables in without checking the type very carefully. - -#### A new API: `Buffer.allocUnsafe(number)` - -The functionality of creating buffers with uninitialized memory should be part of another -API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that -frequently gets user input of all sorts of different types passed into it. - -```js -var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### How do we fix node.js core? - -We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as -`semver-major`) which defends against one case: - -```js -var str = 16 -new Buffer(str, 'utf8') -``` - -In this situation, it's implied that the programmer intended the first argument to be a -string, since they passed an encoding as a second argument. Today, node.js will allocate -uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not -what the programmer intended. - -But this is only a partial solution, since if the programmer does `new Buffer(variable)` -(without an `encoding` parameter) there's no way to know what they intended. If `variable` -is sometimes a number, then uninitialized memory will sometimes be returned. - -### What's the real long-term fix? - -We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when -we need uninitialized memory. But that would break 1000s of packages. - -~~We believe the best solution is to:~~ - -~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ - -~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ - -#### Update - -We now support adding three new APIs: - -- `Buffer.from(value)` - convert from any type to a buffer -- `Buffer.alloc(size)` - create a zero-filled buffer -- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size - -This solves the core problem that affected `ws` and `bittorrent-dht` which is -`Buffer(variable)` getting tricked into taking a number argument. - -This way, existing code continues working and the impact on the npm ecosystem will be -minimal. Over time, npm maintainers can migrate performance-critical code to use -`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. - - -### Conclusion - -We think there's a serious design issue with the `Buffer` API as it exists today. It -promotes insecure software by putting high-risk functionality into a convenient API -with friendly "developer ergonomics". - -This wasn't merely a theoretical exercise because we found the issue in some of the -most popular npm packages. - -Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of -`buffer`. - -```js -var Buffer = require('safe-buffer').Buffer -``` - -Eventually, we hope that node.js core can switch to this new, safer behavior. We believe -the impact on the ecosystem would be minimal since it's not a breaking change. -Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while -older, insecure packages would magically become safe from this attack vector. - - -## links - -- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) -- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) -- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) - - -## credit - -The original issues in `bittorrent-dht` -([disclosure](https://nodesecurity.io/advisories/68)) and -`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by -[Mathias Buus](https://github.com/mafintosh) and -[Feross Aboukhadijeh](http://feross.org/). - -Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues -and for his work running the [Node Security Project](https://nodesecurity.io/). - -Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and -auditing the code. - - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/safe-buffer/index.d.ts b/node_modules/safe-buffer/index.d.ts deleted file mode 100644 index e9fed80..0000000 --- a/node_modules/safe-buffer/index.d.ts +++ /dev/null @@ -1,187 +0,0 @@ -declare module "safe-buffer" { - export class Buffer { - length: number - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - constructor (str: string, encoding?: string); - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - constructor (size: number); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: Uint8Array); - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - constructor (arrayBuffer: ArrayBuffer); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: any[]); - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - constructor (buffer: Buffer); - prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - * - * @param array - */ - static from(array: any[]): Buffer; - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() - * @param byteOffset - * @param length - */ - static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Copies the passed {buffer} data onto a new Buffer instance. - * - * @param buffer - */ - static from(buffer: Buffer): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - * - * @param str - */ - static from(str: string, encoding?: string): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Buffer, buf2: Buffer): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initalizing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; - } -} \ No newline at end of file diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js deleted file mode 100644 index f8d3ec9..0000000 --- a/node_modules/safe-buffer/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype) - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json deleted file mode 100644 index f2869e2..0000000 --- a/node_modules/safe-buffer/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "safe-buffer", - "description": "Safer Node.js Buffer API", - "version": "5.2.1", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/safe-buffer/issues" - }, - "devDependencies": { - "standard": "*", - "tape": "^5.0.0" - }, - "homepage": "https://github.com/feross/safe-buffer", - "keywords": [ - "buffer", - "buffer allocate", - "node security", - "safe", - "safe-buffer", - "security", - "uninitialized" - ], - "license": "MIT", - "main": "index.js", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "git://github.com/feross/safe-buffer.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/node_modules/schema-utils/CHANGELOG.md b/node_modules/schema-utils/CHANGELOG.md deleted file mode 100644 index 38963a3..0000000 --- a/node_modules/schema-utils/CHANGELOG.md +++ /dev/null @@ -1,340 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -## [3.3.0](https://github.com/webpack/schema-utils/compare/v3.2.0...v3.3.0) (2023-06-14) - - -### Features - -* added API to disable and enable validation ([#183](https://github.com/webpack/schema-utils/issues/183)) ([d4d334f](https://github.com/webpack/schema-utils/commit/d4d334f0ba22eb6b6564b1119e8f3ea439e1f2bb)) - - -### Bug Fixes - -* **perf:** cache compiled schema ([#182](https://github.com/webpack/schema-utils/issues/182)) ([02aa068](https://github.com/webpack/schema-utils/commit/02aa068df80d99cc576a5ed385f947eb5204c5db)) - -## [3.2.0](https://github.com/webpack/schema-utils/compare/v3.1.2...v3.2.0) (2023-06-07) - - -### Features - -* implement `undefinedAsNull` keyword for `enum` type ([#176](https://github.com/webpack/schema-utils/issues/176)) ([95826eb](https://github.com/webpack/schema-utils/commit/95826eb9e14bc4b10ab95f962ac2bdca447880a3)) - -### [3.1.2](https://github.com/webpack/schema-utils/compare/v3.1.1...v3.1.2) (2023-04-15) - - -### Bug Fixes - -* **perf:** reduced initial start time ([#170](https://github.com/webpack/schema-utils/issues/170)) ([8d052e6](https://github.com/webpack/schema-utils/commit/8d052e6764dc9247e7d5b7b1ae8f87ca5047b2b0)) - -### [3.1.1](https://github.com/webpack/schema-utils/compare/v3.1.0...v3.1.1) (2021-07-19) - - -### Bug Fixes - -* update error message for `integer` ([#136](https://github.com/webpack/schema-utils/issues/136)) ([2daa97e](https://github.com/webpack/schema-utils/commit/2daa97eae87e6790b92711746a6a527b859ac13b)) - -## [3.1.0](https://github.com/webpack/schema-utils/compare/v3.0.0...v3.1.0) (2021-06-30) - - -### Features - -* added the `link` property in validation error ([589aa59](https://github.com/webpack/schema-utils/commit/589aa5993424a8bc45ec22b67dff55be92c456a9)) - - -### Bug Fixes - -* non-empty validation error message ([#116](https://github.com/webpack/schema-utils/issues/116)) ([c51abef](https://github.com/webpack/schema-utils/commit/c51abefa4d4d62e1346b3a105182d36675595077)) - -## [3.0.0](https://github.com/webpack/schema-utils/compare/v2.7.1...v3.0.0) (2020-10-05) - - -### ⚠ BREAKING CHANGES - -* minimum supported `Node.js` version is `10.13.0`, -* the packages exports was changed, please use `const { validate } = require('schema-utils');` -* the `ValidateError` export was removed in favor the `ValidationError` export, please use `const { ValidationError } = require('schema-utils');` - -### [2.7.1](https://github.com/webpack/schema-utils/compare/v2.7.0...v2.7.1) (2020-08-31) - - -### Bug Fixes - -* remove esModuleInterop from tsconfig ([#110](https://github.com/webpack/schema-utils/issues/110)) ([#111](https://github.com/webpack/schema-utils/issues/111)) ([2f40154](https://github.com/webpack/schema-utils/commit/2f40154b91e45b393258ae9dd8f10cc3b8590b7d)) - -## [2.7.0](https://github.com/webpack/schema-utils/compare/v2.6.6...v2.7.0) (2020-05-29) - - -### Features - -* improve hints ([a36e535](https://github.com/webpack/schema-utils/commit/a36e535faca1b01e27c3bfa3c8bee9227c3f836c)) -* smart not case ([#101](https://github.com/webpack/schema-utils/issues/101)) ([698d8b0](https://github.com/webpack/schema-utils/commit/698d8b05462d86aadb217e25a45c7b953a79a52e)) - - -### Bug Fixes - -* move @types/json-schema from devDependencies to dependencies ([#97](https://github.com/webpack/schema-utils/issues/97)) ([#98](https://github.com/webpack/schema-utils/issues/98)) ([945e67d](https://github.com/webpack/schema-utils/commit/945e67db5e19baf7ec7df72813b0739dd56f950d)) - -### [2.6.6](https://github.com/webpack/schema-utils/compare/v2.6.5...v2.6.6) (2020-04-17) - - -### Bug Fixes - -* improve perf - -### [2.6.5](https://github.com/webpack/schema-utils/compare/v2.6.4...v2.6.5) (2020-03-11) - - -### Bug Fixes - -* correct dots at end of sentence ([7284beb](https://github.com/webpack/schema-utils/commit/7284bebe00cd570f1bef2c15951a07b9794038e6)) - -### [2.6.4](https://github.com/webpack/schema-utils/compare/v2.6.3...v2.6.4) (2020-01-17) - - -### Bug Fixes - -* change `initialised` to `initialized` ([#87](https://github.com/webpack/schema-utils/issues/87)) ([70f12d3](https://github.com/webpack/schema-utils/commit/70f12d33a8eaa27249bc9c1a27f886724cf91ea7)) - -### [2.6.3](https://github.com/webpack/schema-utils/compare/v2.6.2...v2.6.3) (2020-01-17) - - -### Bug Fixes - -* prefer the `baseDataPath` option from arguments ([#86](https://github.com/webpack/schema-utils/issues/86)) ([e236859](https://github.com/webpack/schema-utils/commit/e236859e85b28e35e1294f86fc1ff596a5031cea)) - -### [2.6.2](https://github.com/webpack/schema-utils/compare/v2.6.1...v2.6.2) (2020-01-14) - - -### Bug Fixes - -* better handle Windows absolute paths ([#85](https://github.com/webpack/schema-utils/issues/85)) ([1fa2930](https://github.com/webpack/schema-utils/commit/1fa2930a161e907b9fc53a7233d605910afdb883)) - -### [2.6.1](https://github.com/webpack/schema-utils/compare/v2.6.0...v2.6.1) (2019-11-28) - - -### Bug Fixes - -* typescript declarations ([#84](https://github.com/webpack/schema-utils/issues/84)) ([89d55a9](https://github.com/webpack/schema-utils/commit/89d55a9a8edfa6a8ac8b112f226bb3154e260319)) - -## [2.6.0](https://github.com/webpack/schema-utils/compare/v2.5.0...v2.6.0) (2019-11-27) - - -### Features - -* support configuration via title ([#81](https://github.com/webpack/schema-utils/issues/81)) ([afddc10](https://github.com/webpack/schema-utils/commit/afddc109f6891cd37a9f1835d50862d119a072bf)) - - -### Bug Fixes - -* typescript definitions ([#70](https://github.com/webpack/schema-utils/issues/70)) ([f38158d](https://github.com/webpack/schema-utils/commit/f38158d6d040e2c701622778ae8122fb26a4f990)) - -## [2.5.0](https://github.com/webpack/schema-utils/compare/v2.4.1...v2.5.0) (2019-10-15) - - -### Bug Fixes - -* rework format for maxLength, minLength ([#67](https://github.com/webpack/schema-utils/issues/67)) ([0d12259](https://github.com/webpack/schema-utils/commit/0d12259)) -* support all cases with one number in range ([#64](https://github.com/webpack/schema-utils/issues/64)) ([7fc8069](https://github.com/webpack/schema-utils/commit/7fc8069)) -* typescript definition and export naming ([#69](https://github.com/webpack/schema-utils/issues/69)) ([a435b79](https://github.com/webpack/schema-utils/commit/a435b79)) - - -### Features - -* "smart" numbers range ([62fb107](https://github.com/webpack/schema-utils/commit/62fb107)) - -### [2.4.1](https://github.com/webpack/schema-utils/compare/v2.4.0...v2.4.1) (2019-09-27) - - -### Bug Fixes - -* publish definitions ([#58](https://github.com/webpack/schema-utils/issues/58)) ([1885faa](https://github.com/webpack/schema-utils/commit/1885faa)) - -## [2.4.0](https://github.com/webpack/schema-utils/compare/v2.3.0...v2.4.0) (2019-09-26) - - -### Features - -* better errors when the `type` keyword doesn't exist ([0988be2](https://github.com/webpack/schema-utils/commit/0988be2)) -* support $data reference ([#56](https://github.com/webpack/schema-utils/issues/56)) ([d2f11d6](https://github.com/webpack/schema-utils/commit/d2f11d6)) -* types definitions ([#52](https://github.com/webpack/schema-utils/issues/52)) ([facb431](https://github.com/webpack/schema-utils/commit/facb431)) - -## [2.3.0](https://github.com/webpack/schema-utils/compare/v2.2.0...v2.3.0) (2019-09-26) - - -### Features - -* support `not` keyword ([#53](https://github.com/webpack/schema-utils/issues/53)) ([765f458](https://github.com/webpack/schema-utils/commit/765f458)) - -## [2.2.0](https://github.com/webpack/schema-utils/compare/v2.1.0...v2.2.0) (2019-09-02) - - -### Features - -* better error output for `oneOf` and `anyOf` ([#48](https://github.com/webpack/schema-utils/issues/48)) ([#50](https://github.com/webpack/schema-utils/issues/50)) ([332242f](https://github.com/webpack/schema-utils/commit/332242f)) - -## [2.1.0](https://github.com/webpack-contrib/schema-utils/compare/v2.0.1...v2.1.0) (2019-08-07) - - -### Bug Fixes - -* throw error on sparse arrays ([#47](https://github.com/webpack-contrib/schema-utils/issues/47)) ([b85ac38](https://github.com/webpack-contrib/schema-utils/commit/b85ac38)) - - -### Features - -* export `ValidateError` ([#46](https://github.com/webpack-contrib/schema-utils/issues/46)) ([ff781d7](https://github.com/webpack-contrib/schema-utils/commit/ff781d7)) - - - -### [2.0.1](https://github.com/webpack-contrib/schema-utils/compare/v2.0.0...v2.0.1) (2019-07-18) - - -### Bug Fixes - -* error message for empty object ([#44](https://github.com/webpack-contrib/schema-utils/issues/44)) ([0b4b4a2](https://github.com/webpack-contrib/schema-utils/commit/0b4b4a2)) - - - -### [2.0.0](https://github.com/webpack-contrib/schema-utils/compare/v1.0.0...v2.0.0) (2019-07-17) - - -### BREAKING CHANGES - -* drop support for Node.js < 8.9.0 -* drop support `errorMessage`, please use `description` for links. -* api was changed, please look documentation. -* error messages was fully rewritten. - - - -# [1.0.0](https://github.com/webpack-contrib/schema-utils/compare/v0.4.7...v1.0.0) (2018-08-07) - - -### Features - -* **src:** add support for custom error messages ([#33](https://github.com/webpack-contrib/schema-utils/issues/33)) ([1cbe4ef](https://github.com/webpack-contrib/schema-utils/commit/1cbe4ef)) - - - - -## [0.4.7](https://github.com/webpack-contrib/schema-utils/compare/v0.4.6...v0.4.7) (2018-08-07) - - -### Bug Fixes - -* **src:** `node >= v4.0.0` support ([#32](https://github.com/webpack-contrib/schema-utils/issues/32)) ([cb13dd4](https://github.com/webpack-contrib/schema-utils/commit/cb13dd4)) - - - - -## [0.4.6](https://github.com/webpack-contrib/schema-utils/compare/v0.4.5...v0.4.6) (2018-08-06) - - -### Bug Fixes - -* **package:** remove lockfile ([#28](https://github.com/webpack-contrib/schema-utils/issues/28)) ([69f1a81](https://github.com/webpack-contrib/schema-utils/commit/69f1a81)) -* **package:** remove unnecessary `webpack` dependency ([#26](https://github.com/webpack-contrib/schema-utils/issues/26)) ([532eaa5](https://github.com/webpack-contrib/schema-utils/commit/532eaa5)) - - - - -## [0.4.5](https://github.com/webpack-contrib/schema-utils/compare/v0.4.4...v0.4.5) (2018-02-13) - - -### Bug Fixes - -* **CHANGELOG:** update broken links ([4483b9f](https://github.com/webpack-contrib/schema-utils/commit/4483b9f)) -* **package:** update broken links ([f2494ba](https://github.com/webpack-contrib/schema-utils/commit/f2494ba)) - - - - -## [0.4.4](https://github.com/webpack-contrib/schema-utils/compare/v0.4.3...v0.4.4) (2018-02-13) - - -### Bug Fixes - -* **package:** update `dependencies` ([#22](https://github.com/webpack-contrib/schema-utils/issues/22)) ([3aecac6](https://github.com/webpack-contrib/schema-utils/commit/3aecac6)) - - - - -## [0.4.3](https://github.com/webpack-contrib/schema-utils/compare/v0.4.2...v0.4.3) (2017-12-14) - - -### Bug Fixes - -* **validateOptions:** throw `err` instead of `process.exit(1)` ([#17](https://github.com/webpack-contrib/schema-utils/issues/17)) ([c595eda](https://github.com/webpack-contrib/schema-utils/commit/c595eda)) -* **ValidationError:** never return `this` in the ctor ([#16](https://github.com/webpack-contrib/schema-utils/issues/16)) ([c723791](https://github.com/webpack-contrib/schema-utils/commit/c723791)) - - - - -## [0.4.2](https://github.com/webpack-contrib/schema-utils/compare/v0.4.1...v0.4.2) (2017-11-09) - - -### Bug Fixes - -* **validateOptions:** catch `ValidationError` and handle it internally ([#15](https://github.com/webpack-contrib/schema-utils/issues/15)) ([9c5ef5e](https://github.com/webpack-contrib/schema-utils/commit/9c5ef5e)) - - - - -## [0.4.1](https://github.com/webpack-contrib/schema-utils/compare/v0.4.0...v0.4.1) (2017-11-03) - - -### Bug Fixes - -* **ValidationError:** use `Error.captureStackTrace` for `err.stack` handling ([#14](https://github.com/webpack-contrib/schema-utils/issues/14)) ([a6fb974](https://github.com/webpack-contrib/schema-utils/commit/a6fb974)) - - - - -# [0.4.0](https://github.com/webpack-contrib/schema-utils/compare/v0.3.0...v0.4.0) (2017-10-28) - - -### Features - -* add support for `typeof`, `instanceof` (`{Function\|RegExp}`) ([#10](https://github.com/webpack-contrib/schema-utils/issues/10)) ([9f01816](https://github.com/webpack-contrib/schema-utils/commit/9f01816)) - - - - -# [0.3.0](https://github.com/webpack-contrib/schema-utils/compare/v0.2.1...v0.3.0) (2017-04-29) - - -### Features - -* add ValidationError ([#8](https://github.com/webpack-contrib/schema-utils/issues/8)) ([d48f0fb](https://github.com/webpack-contrib/schema-utils/commit/d48f0fb)) - - - - -## [0.2.1](https://github.com/webpack-contrib/schema-utils/compare/v0.2.0...v0.2.1) (2017-03-13) - - -### Bug Fixes - -* Include .babelrc to `files` ([28f0363](https://github.com/webpack-contrib/schema-utils/commit/28f0363)) -* Include source to `files` ([43b0f2f](https://github.com/webpack-contrib/schema-utils/commit/43b0f2f)) - - - - -# [0.2.0](https://github.com/webpack-contrib/schema-utils/compare/v0.1.0...v0.2.0) (2017-03-12) - - -# 0.1.0 (2017-03-07) - - -### Features - -* **validations:** add validateOptions module ([ae9b47b](https://github.com/webpack-contrib/schema-utils/commit/ae9b47b)) - - - -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. diff --git a/node_modules/schema-utils/LICENSE b/node_modules/schema-utils/LICENSE deleted file mode 100644 index 8c11fc7..0000000 --- a/node_modules/schema-utils/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/schema-utils/README.md b/node_modules/schema-utils/README.md deleted file mode 100644 index b56ab02..0000000 --- a/node_modules/schema-utils/README.md +++ /dev/null @@ -1,290 +0,0 @@ - - -[![npm][npm]][npm-url] -[![node][node]][node-url] -[![deps][deps]][deps-url] -[![tests][tests]][tests-url] -[![coverage][cover]][cover-url] -[![chat][chat]][chat-url] -[![size][size]][size-url] - -# schema-utils - -Package for validate options in loaders and plugins. - -## Getting Started - -To begin, you'll need to install `schema-utils`: - -```console -npm install schema-utils -``` - -## API - -**schema.json** - -```json -{ - "type": "object", - "properties": { - "option": { - "type": "boolean" - } - }, - "additionalProperties": false -} -``` - -```js -import schema from "./path/to/schema.json"; -import { validate } from "schema-utils"; - -const options = { option: true }; -const configuration = { name: "Loader Name/Plugin Name/Name" }; - -validate(schema, options, configuration); -``` - -### `schema` - -Type: `String` - -JSON schema. - -Simple example of schema: - -```json -{ - "type": "object", - "properties": { - "name": { - "description": "This is description of option.", - "type": "string" - } - }, - "additionalProperties": false -} -``` - -### `options` - -Type: `Object` - -Object with options. - -```js -import schema from "./path/to/schema.json"; -import { validate } from "schema-utils"; - -const options = { foo: "bar" }; - -validate(schema, { name: 123 }, { name: "MyPlugin" }); -``` - -### `configuration` - -Allow to configure validator. - -There is an alternative method to configure the `name` and`baseDataPath` options via the `title` property in the schema. -For example: - -```json -{ - "title": "My Loader options", - "type": "object", - "properties": { - "name": { - "description": "This is description of option.", - "type": "string" - } - }, - "additionalProperties": false -} -``` - -The last word used for the `baseDataPath` option, other words used for the `name` option. -Based on the example above the `name` option equals `My Loader`, the `baseDataPath` option equals `options`. - -#### `name` - -Type: `Object` -Default: `"Object"` - -Allow to setup name in validation errors. - -```js -import schema from "./path/to/schema.json"; -import { validate } from "schema-utils"; - -const options = { foo: "bar" }; - -validate(schema, options, { name: "MyPlugin" }); -``` - -```shell -Invalid configuration object. MyPlugin has been initialised using a configuration object that does not match the API schema. - - configuration.optionName should be a integer. -``` - -#### `baseDataPath` - -Type: `String` -Default: `"configuration"` - -Allow to setup base data path in validation errors. - -```js -import schema from "./path/to/schema.json"; -import { validate } from "schema-utils"; - -const options = { foo: "bar" }; - -validate(schema, options, { name: "MyPlugin", baseDataPath: "options" }); -``` - -```shell -Invalid options object. MyPlugin has been initialised using an options object that does not match the API schema. - - options.optionName should be a integer. -``` - -#### `postFormatter` - -Type: `Function` -Default: `undefined` - -Allow to reformat errors. - -```js -import schema from "./path/to/schema.json"; -import { validate } from "schema-utils"; - -const options = { foo: "bar" }; - -validate(schema, options, { - name: "MyPlugin", - postFormatter: (formattedError, error) => { - if (error.keyword === "type") { - return `${formattedError}\nAdditional Information.`; - } - - return formattedError; - }, -}); -``` - -```shell -Invalid options object. MyPlugin has been initialized using an options object that does not match the API schema. - - options.optionName should be a integer. - Additional Information. -``` - -## Examples - -**schema.json** - -```json -{ - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "test": { - "anyOf": [ - { "type": "array" }, - { "type": "string" }, - { "instanceof": "RegExp" } - ] - }, - "transform": { - "instanceof": "Function" - }, - "sourceMap": { - "type": "boolean" - } - }, - "additionalProperties": false -} -``` - -### `Loader` - -```js -import { getOptions } from "loader-utils"; -import { validate } from "schema-utils"; - -import schema from "path/to/schema.json"; - -function loader(src, map) { - const options = getOptions(this); - - validate(schema, options, { - name: "Loader Name", - baseDataPath: "options", - }); - - // Code... -} - -export default loader; -``` - -### `Plugin` - -```js -import { validate } from "schema-utils"; - -import schema from "path/to/schema.json"; - -class Plugin { - constructor(options) { - validate(schema, options, { - name: "Plugin Name", - baseDataPath: "options", - }); - - this.options = options; - } - - apply(compiler) { - // Code... - } -} - -export default Plugin; -``` - -## Contributing - -Please take a moment to read our contributing guidelines if you haven't yet done so. - -[CONTRIBUTING](./.github/CONTRIBUTING.md) - -## License - -[MIT](./LICENSE) - -[npm]: https://img.shields.io/npm/v/schema-utils.svg -[npm-url]: https://npmjs.com/package/schema-utils -[node]: https://img.shields.io/node/v/schema-utils.svg -[node-url]: https://nodejs.org -[deps]: https://david-dm.org/webpack/schema-utils.svg -[deps-url]: https://david-dm.org/webpack/schema-utils -[tests]: https://github.com/webpack/schema-utils/workflows/schema-utils/badge.svg -[tests-url]: https://github.com/webpack/schema-utils/actions -[cover]: https://codecov.io/gh/webpack/schema-utils/branch/master/graph/badge.svg -[cover-url]: https://codecov.io/gh/webpack/schema-utils -[chat]: https://badges.gitter.im/webpack/webpack.svg -[chat-url]: https://gitter.im/webpack/webpack -[size]: https://packagephobia.com/badge?p=schema-utils -[size-url]: https://packagephobia.com/result?p=schema-utils diff --git a/node_modules/schema-utils/declarations/ValidationError.d.ts b/node_modules/schema-utils/declarations/ValidationError.d.ts deleted file mode 100644 index 55a8a9a..0000000 --- a/node_modules/schema-utils/declarations/ValidationError.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -export default ValidationError; -export type JSONSchema6 = import("json-schema").JSONSchema6; -export type JSONSchema7 = import("json-schema").JSONSchema7; -export type Schema = import("./validate").Schema; -export type ValidationErrorConfiguration = - import("./validate").ValidationErrorConfiguration; -export type PostFormatter = import("./validate").PostFormatter; -export type SchemaUtilErrorObject = import("./validate").SchemaUtilErrorObject; -declare class ValidationError extends Error { - /** - * @param {Array} errors - * @param {Schema} schema - * @param {ValidationErrorConfiguration} configuration - */ - constructor( - errors: Array, - schema: Schema, - configuration?: ValidationErrorConfiguration - ); - /** @type {Array} */ - errors: Array; - /** @type {Schema} */ - schema: Schema; - /** @type {string} */ - headerName: string; - /** @type {string} */ - baseDataPath: string; - /** @type {PostFormatter | null} */ - postFormatter: PostFormatter | null; - /** - * @param {string} path - * @returns {Schema} - */ - getSchemaPart(path: string): Schema; - /** - * @param {Schema} schema - * @param {boolean} logic - * @param {Array} prevSchemas - * @returns {string} - */ - formatSchema( - schema: Schema, - logic?: boolean, - prevSchemas?: Array - ): string; - /** - * @param {Schema=} schemaPart - * @param {(boolean | Array)=} additionalPath - * @param {boolean=} needDot - * @param {boolean=} logic - * @returns {string} - */ - getSchemaPartText( - schemaPart?: Schema | undefined, - additionalPath?: (boolean | Array) | undefined, - needDot?: boolean | undefined, - logic?: boolean | undefined - ): string; - /** - * @param {Schema=} schemaPart - * @returns {string} - */ - getSchemaPartDescription(schemaPart?: Schema | undefined): string; - /** - * @param {SchemaUtilErrorObject} error - * @returns {string} - */ - formatValidationError(error: SchemaUtilErrorObject): string; - /** - * @param {Array} errors - * @returns {string} - */ - formatValidationErrors(errors: Array): string; -} diff --git a/node_modules/schema-utils/declarations/index.d.ts b/node_modules/schema-utils/declarations/index.d.ts deleted file mode 100644 index def01ba..0000000 --- a/node_modules/schema-utils/declarations/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { validate } from "./validate"; -import { ValidationError } from "./validate"; -import { enableValidation } from "./validate"; -import { disableValidation } from "./validate"; -import { needValidate } from "./validate"; -export { - validate, - ValidationError, - enableValidation, - disableValidation, - needValidate, -}; diff --git a/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts b/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts deleted file mode 100644 index 0d16689..0000000 --- a/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default addAbsolutePathKeyword; -export type Ajv = import("ajv").Ajv; -export type ValidateFunction = import("ajv").ValidateFunction; -export type SchemaUtilErrorObject = import("../validate").SchemaUtilErrorObject; -/** - * - * @param {Ajv} ajv - * @returns {Ajv} - */ -declare function addAbsolutePathKeyword(ajv: Ajv): Ajv; diff --git a/node_modules/schema-utils/declarations/keywords/undefinedAsNull.d.ts b/node_modules/schema-utils/declarations/keywords/undefinedAsNull.d.ts deleted file mode 100644 index 3509652..0000000 --- a/node_modules/schema-utils/declarations/keywords/undefinedAsNull.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default addUndefinedAsNullKeyword; -export type Ajv = import("ajv").Ajv; -/** - * - * @param {Ajv} ajv - * @returns {Ajv} - */ -declare function addUndefinedAsNullKeyword(ajv: Ajv): Ajv; diff --git a/node_modules/schema-utils/declarations/util/Range.d.ts b/node_modules/schema-utils/declarations/util/Range.d.ts deleted file mode 100644 index 2ba97fc..0000000 --- a/node_modules/schema-utils/declarations/util/Range.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -export = Range; -/** - * @typedef {[number, boolean]} RangeValue - */ -/** - * @callback RangeValueCallback - * @param {RangeValue} rangeValue - * @returns {boolean} - */ -declare class Range { - /** - * @param {"left" | "right"} side - * @param {boolean} exclusive - * @returns {">" | ">=" | "<" | "<="} - */ - static getOperator( - side: "left" | "right", - exclusive: boolean - ): ">" | ">=" | "<" | "<="; - /** - * @param {number} value - * @param {boolean} logic is not logic applied - * @param {boolean} exclusive is range exclusive - * @returns {string} - */ - static formatRight(value: number, logic: boolean, exclusive: boolean): string; - /** - * @param {number} value - * @param {boolean} logic is not logic applied - * @param {boolean} exclusive is range exclusive - * @returns {string} - */ - static formatLeft(value: number, logic: boolean, exclusive: boolean): string; - /** - * @param {number} start left side value - * @param {number} end right side value - * @param {boolean} startExclusive is range exclusive from left side - * @param {boolean} endExclusive is range exclusive from right side - * @param {boolean} logic is not logic applied - * @returns {string} - */ - static formatRange( - start: number, - end: number, - startExclusive: boolean, - endExclusive: boolean, - logic: boolean - ): string; - /** - * @param {Array} values - * @param {boolean} logic is not logic applied - * @return {RangeValue} computed value and it's exclusive flag - */ - static getRangeValue(values: Array, logic: boolean): RangeValue; - /** @type {Array} */ - _left: Array; - /** @type {Array} */ - _right: Array; - /** - * @param {number} value - * @param {boolean=} exclusive - */ - left(value: number, exclusive?: boolean | undefined): void; - /** - * @param {number} value - * @param {boolean=} exclusive - */ - right(value: number, exclusive?: boolean | undefined): void; - /** - * @param {boolean} logic is not logic applied - * @return {string} "smart" range string representation - */ - format(logic?: boolean): string; -} -declare namespace Range { - export { RangeValue, RangeValueCallback }; -} -type RangeValue = [number, boolean]; -type RangeValueCallback = (rangeValue: RangeValue) => boolean; diff --git a/node_modules/schema-utils/declarations/util/hints.d.ts b/node_modules/schema-utils/declarations/util/hints.d.ts deleted file mode 100644 index e43e32a..0000000 --- a/node_modules/schema-utils/declarations/util/hints.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function stringHints(schema: Schema, logic: boolean): string[]; -export function numberHints(schema: Schema, logic: boolean): string[]; -export type Schema = import("../validate").Schema; diff --git a/node_modules/schema-utils/declarations/validate.d.ts b/node_modules/schema-utils/declarations/validate.d.ts deleted file mode 100644 index 7f1c87f..0000000 --- a/node_modules/schema-utils/declarations/validate.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export type JSONSchema4 = import("json-schema").JSONSchema4; -export type JSONSchema6 = import("json-schema").JSONSchema6; -export type JSONSchema7 = import("json-schema").JSONSchema7; -export type ErrorObject = import("ajv").ErrorObject; -export type ValidateFunction = import("ajv").ValidateFunction; -export type Extend = { - formatMinimum?: number | undefined; - formatMaximum?: number | undefined; - formatExclusiveMinimum?: boolean | undefined; - formatExclusiveMaximum?: boolean | undefined; - link?: string | undefined; - undefinedAsNull?: boolean | undefined; -}; -export type Schema = (JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend; -export type SchemaUtilErrorObject = ErrorObject & { - children?: Array; -}; -export type PostFormatter = ( - formattedError: string, - error: SchemaUtilErrorObject -) => string; -export type ValidationErrorConfiguration = { - name?: string | undefined; - baseDataPath?: string | undefined; - postFormatter?: PostFormatter | undefined; -}; -/** - * @param {Schema} schema - * @param {Array | object} options - * @param {ValidationErrorConfiguration=} configuration - * @returns {void} - */ -export function validate( - schema: Schema, - options: Array | object, - configuration?: ValidationErrorConfiguration | undefined -): void; -export function enableValidation(): void; -export function disableValidation(): void; -export function needValidate(): boolean; -import ValidationError from "./ValidationError"; -export { ValidationError }; diff --git a/node_modules/schema-utils/dist/ValidationError.js b/node_modules/schema-utils/dist/ValidationError.js deleted file mode 100644 index bd4086f..0000000 --- a/node_modules/schema-utils/dist/ValidationError.js +++ /dev/null @@ -1,1277 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -const { - stringHints, - numberHints -} = require("./util/hints"); -/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ - -/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ - -/** @typedef {import("./validate").Schema} Schema */ - -/** @typedef {import("./validate").ValidationErrorConfiguration} ValidationErrorConfiguration */ - -/** @typedef {import("./validate").PostFormatter} PostFormatter */ - -/** @typedef {import("./validate").SchemaUtilErrorObject} SchemaUtilErrorObject */ - -/** @enum {number} */ - - -const SPECIFICITY = { - type: 1, - not: 1, - oneOf: 1, - anyOf: 1, - if: 1, - enum: 1, - const: 1, - instanceof: 1, - required: 2, - pattern: 2, - patternRequired: 2, - format: 2, - formatMinimum: 2, - formatMaximum: 2, - minimum: 2, - exclusiveMinimum: 2, - maximum: 2, - exclusiveMaximum: 2, - multipleOf: 2, - uniqueItems: 2, - contains: 2, - minLength: 2, - maxLength: 2, - minItems: 2, - maxItems: 2, - minProperties: 2, - maxProperties: 2, - dependencies: 2, - propertyNames: 2, - additionalItems: 2, - additionalProperties: 2, - absolutePath: 2 -}; -/** - * - * @param {Array} array - * @param {(item: SchemaUtilErrorObject) => number} fn - * @returns {Array} - */ - -function filterMax(array, fn) { - const evaluatedMax = array.reduce((max, item) => Math.max(max, fn(item)), 0); - return array.filter(item => fn(item) === evaluatedMax); -} -/** - * - * @param {Array} children - * @returns {Array} - */ - - -function filterChildren(children) { - let newChildren = children; - newChildren = filterMax(newChildren, - /** - * - * @param {SchemaUtilErrorObject} error - * @returns {number} - */ - error => error.dataPath ? error.dataPath.length : 0); - newChildren = filterMax(newChildren, - /** - * @param {SchemaUtilErrorObject} error - * @returns {number} - */ - error => SPECIFICITY[ - /** @type {keyof typeof SPECIFICITY} */ - error.keyword] || 2); - return newChildren; -} -/** - * Find all children errors - * @param {Array} children - * @param {Array} schemaPaths - * @return {number} returns index of first child - */ - - -function findAllChildren(children, schemaPaths) { - let i = children.length - 1; - - const predicate = - /** - * @param {string} schemaPath - * @returns {boolean} - */ - schemaPath => children[i].schemaPath.indexOf(schemaPath) !== 0; - - while (i > -1 && !schemaPaths.every(predicate)) { - if (children[i].keyword === "anyOf" || children[i].keyword === "oneOf") { - const refs = extractRefs(children[i]); - const childrenStart = findAllChildren(children.slice(0, i), refs.concat(children[i].schemaPath)); - i = childrenStart - 1; - } else { - i -= 1; - } - } - - return i + 1; -} -/** - * Extracts all refs from schema - * @param {SchemaUtilErrorObject} error - * @return {Array} - */ - - -function extractRefs(error) { - const { - schema - } = error; - - if (!Array.isArray(schema)) { - return []; - } - - return schema.map(({ - $ref - }) => $ref).filter(s => s); -} -/** - * Groups children by their first level parent (assuming that error is root) - * @param {Array} children - * @return {Array} - */ - - -function groupChildrenByFirstChild(children) { - const result = []; - let i = children.length - 1; - - while (i > 0) { - const child = children[i]; - - if (child.keyword === "anyOf" || child.keyword === "oneOf") { - const refs = extractRefs(child); - const childrenStart = findAllChildren(children.slice(0, i), refs.concat(child.schemaPath)); - - if (childrenStart !== i) { - result.push(Object.assign({}, child, { - children: children.slice(childrenStart, i) - })); - i = childrenStart; - } else { - result.push(child); - } - } else { - result.push(child); - } - - i -= 1; - } - - if (i === 0) { - result.push(children[i]); - } - - return result.reverse(); -} -/** - * @param {string} str - * @param {string} prefix - * @returns {string} - */ - - -function indent(str, prefix) { - return str.replace(/\n(?!$)/g, `\n${prefix}`); -} -/** - * @param {Schema} schema - * @returns {schema is (Schema & {not: Schema})} - */ - - -function hasNotInSchema(schema) { - return !!schema.not; -} -/** - * @param {Schema} schema - * @return {Schema} - */ - - -function findFirstTypedSchema(schema) { - if (hasNotInSchema(schema)) { - return findFirstTypedSchema(schema.not); - } - - return schema; -} -/** - * @param {Schema} schema - * @return {boolean} - */ - - -function canApplyNot(schema) { - const typedSchema = findFirstTypedSchema(schema); - return likeNumber(typedSchema) || likeInteger(typedSchema) || likeString(typedSchema) || likeNull(typedSchema) || likeBoolean(typedSchema); -} -/** - * @param {any} maybeObj - * @returns {boolean} - */ - - -function isObject(maybeObj) { - return typeof maybeObj === "object" && maybeObj !== null; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeNumber(schema) { - return schema.type === "number" || typeof schema.minimum !== "undefined" || typeof schema.exclusiveMinimum !== "undefined" || typeof schema.maximum !== "undefined" || typeof schema.exclusiveMaximum !== "undefined" || typeof schema.multipleOf !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeInteger(schema) { - return schema.type === "integer" || typeof schema.minimum !== "undefined" || typeof schema.exclusiveMinimum !== "undefined" || typeof schema.maximum !== "undefined" || typeof schema.exclusiveMaximum !== "undefined" || typeof schema.multipleOf !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeString(schema) { - return schema.type === "string" || typeof schema.minLength !== "undefined" || typeof schema.maxLength !== "undefined" || typeof schema.pattern !== "undefined" || typeof schema.format !== "undefined" || typeof schema.formatMinimum !== "undefined" || typeof schema.formatMaximum !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeBoolean(schema) { - return schema.type === "boolean"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeArray(schema) { - return schema.type === "array" || typeof schema.minItems === "number" || typeof schema.maxItems === "number" || typeof schema.uniqueItems !== "undefined" || typeof schema.items !== "undefined" || typeof schema.additionalItems !== "undefined" || typeof schema.contains !== "undefined"; -} -/** - * @param {Schema & {patternRequired?: Array}} schema - * @returns {boolean} - */ - - -function likeObject(schema) { - return schema.type === "object" || typeof schema.minProperties !== "undefined" || typeof schema.maxProperties !== "undefined" || typeof schema.required !== "undefined" || typeof schema.properties !== "undefined" || typeof schema.patternProperties !== "undefined" || typeof schema.additionalProperties !== "undefined" || typeof schema.dependencies !== "undefined" || typeof schema.propertyNames !== "undefined" || typeof schema.patternRequired !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeNull(schema) { - return schema.type === "null"; -} -/** - * @param {string} type - * @returns {string} - */ - - -function getArticle(type) { - if (/^[aeiou]/i.test(type)) { - return "an"; - } - - return "a"; -} -/** - * @param {Schema=} schema - * @returns {string} - */ - - -function getSchemaNonTypes(schema) { - if (!schema) { - return ""; - } - - if (!schema.type) { - if (likeNumber(schema) || likeInteger(schema)) { - return " | should be any non-number"; - } - - if (likeString(schema)) { - return " | should be any non-string"; - } - - if (likeArray(schema)) { - return " | should be any non-array"; - } - - if (likeObject(schema)) { - return " | should be any non-object"; - } - } - - return ""; -} -/** - * @param {Array} hints - * @returns {string} - */ - - -function formatHints(hints) { - return hints.length > 0 ? `(${hints.join(", ")})` : ""; -} -/** - * @param {Schema} schema - * @param {boolean} logic - * @returns {string[]} - */ - - -function getHints(schema, logic) { - if (likeNumber(schema) || likeInteger(schema)) { - return numberHints(schema, logic); - } else if (likeString(schema)) { - return stringHints(schema, logic); - } - - return []; -} - -class ValidationError extends Error { - /** - * @param {Array} errors - * @param {Schema} schema - * @param {ValidationErrorConfiguration} configuration - */ - constructor(errors, schema, configuration = {}) { - super(); - /** @type {string} */ - - this.name = "ValidationError"; - /** @type {Array} */ - - this.errors = errors; - /** @type {Schema} */ - - this.schema = schema; - let headerNameFromSchema; - let baseDataPathFromSchema; - - if (schema.title && (!configuration.name || !configuration.baseDataPath)) { - const splittedTitleFromSchema = schema.title.match(/^(.+) (.+)$/); - - if (splittedTitleFromSchema) { - if (!configuration.name) { - [, headerNameFromSchema] = splittedTitleFromSchema; - } - - if (!configuration.baseDataPath) { - [,, baseDataPathFromSchema] = splittedTitleFromSchema; - } - } - } - /** @type {string} */ - - - this.headerName = configuration.name || headerNameFromSchema || "Object"; - /** @type {string} */ - - this.baseDataPath = configuration.baseDataPath || baseDataPathFromSchema || "configuration"; - /** @type {PostFormatter | null} */ - - this.postFormatter = configuration.postFormatter || null; - const header = `Invalid ${this.baseDataPath} object. ${this.headerName} has been initialized using ${getArticle(this.baseDataPath)} ${this.baseDataPath} object that does not match the API schema.\n`; - /** @type {string} */ - - this.message = `${header}${this.formatValidationErrors(errors)}`; - Error.captureStackTrace(this, this.constructor); - } - /** - * @param {string} path - * @returns {Schema} - */ - - - getSchemaPart(path) { - const newPath = path.split("/"); - let schemaPart = this.schema; - - for (let i = 1; i < newPath.length; i++) { - const inner = schemaPart[ - /** @type {keyof Schema} */ - newPath[i]]; - - if (!inner) { - break; - } - - schemaPart = inner; - } - - return schemaPart; - } - /** - * @param {Schema} schema - * @param {boolean} logic - * @param {Array} prevSchemas - * @returns {string} - */ - - - formatSchema(schema, logic = true, prevSchemas = []) { - let newLogic = logic; - - const formatInnerSchema = - /** - * - * @param {Object} innerSchema - * @param {boolean=} addSelf - * @returns {string} - */ - (innerSchema, addSelf) => { - if (!addSelf) { - return this.formatSchema(innerSchema, newLogic, prevSchemas); - } - - if (prevSchemas.includes(innerSchema)) { - return "(recursive)"; - } - - return this.formatSchema(innerSchema, newLogic, prevSchemas.concat(schema)); - }; - - if (hasNotInSchema(schema) && !likeObject(schema)) { - if (canApplyNot(schema.not)) { - newLogic = !logic; - return formatInnerSchema(schema.not); - } - - const needApplyLogicHere = !schema.not.not; - const prefix = logic ? "" : "non "; - newLogic = !logic; - return needApplyLogicHere ? prefix + formatInnerSchema(schema.not) : formatInnerSchema(schema.not); - } - - if ( - /** @type {Schema & {instanceof: string | Array}} */ - schema.instanceof) { - const { - instanceof: value - } = - /** @type {Schema & {instanceof: string | Array}} */ - schema; - const values = !Array.isArray(value) ? [value] : value; - return values.map( - /** - * @param {string} item - * @returns {string} - */ - item => item === "Function" ? "function" : item).join(" | "); - } - - if (schema.enum) { - const enumValues = - /** @type {Array} */ - schema.enum.map(item => { - if (item === null && schema.undefinedAsNull) { - return `${JSON.stringify(item)} | undefined`; - } - - return JSON.stringify(item); - }).join(" | "); - return `${enumValues}`; - } - - if (typeof schema.const !== "undefined") { - return JSON.stringify(schema.const); - } - - if (schema.oneOf) { - return ( - /** @type {Array} */ - schema.oneOf.map(item => formatInnerSchema(item, true)).join(" | ") - ); - } - - if (schema.anyOf) { - return ( - /** @type {Array} */ - schema.anyOf.map(item => formatInnerSchema(item, true)).join(" | ") - ); - } - - if (schema.allOf) { - return ( - /** @type {Array} */ - schema.allOf.map(item => formatInnerSchema(item, true)).join(" & ") - ); - } - - if ( - /** @type {JSONSchema7} */ - schema.if) { - const { - if: ifValue, - then: thenValue, - else: elseValue - } = - /** @type {JSONSchema7} */ - schema; - return `${ifValue ? `if ${formatInnerSchema(ifValue)}` : ""}${thenValue ? ` then ${formatInnerSchema(thenValue)}` : ""}${elseValue ? ` else ${formatInnerSchema(elseValue)}` : ""}`; - } - - if (schema.$ref) { - return formatInnerSchema(this.getSchemaPart(schema.$ref), true); - } - - if (likeNumber(schema) || likeInteger(schema)) { - const [type, ...hints] = getHints(schema, logic); - const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ""}`; - return logic ? str : hints.length > 0 ? `non-${type} | ${str}` : `non-${type}`; - } - - if (likeString(schema)) { - const [type, ...hints] = getHints(schema, logic); - const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ""}`; - return logic ? str : str === "string" ? "non-string" : `non-string | ${str}`; - } - - if (likeBoolean(schema)) { - return `${logic ? "" : "non-"}boolean`; - } - - if (likeArray(schema)) { - // not logic already applied in formatValidationError - newLogic = true; - const hints = []; - - if (typeof schema.minItems === "number") { - hints.push(`should not have fewer than ${schema.minItems} item${schema.minItems > 1 ? "s" : ""}`); - } - - if (typeof schema.maxItems === "number") { - hints.push(`should not have more than ${schema.maxItems} item${schema.maxItems > 1 ? "s" : ""}`); - } - - if (schema.uniqueItems) { - hints.push("should not have duplicate items"); - } - - const hasAdditionalItems = typeof schema.additionalItems === "undefined" || Boolean(schema.additionalItems); - let items = ""; - - if (schema.items) { - if (Array.isArray(schema.items) && schema.items.length > 0) { - items = `${ - /** @type {Array} */ - schema.items.map(item => formatInnerSchema(item)).join(", ")}`; - - if (hasAdditionalItems) { - if (schema.additionalItems && isObject(schema.additionalItems) && Object.keys(schema.additionalItems).length > 0) { - hints.push(`additional items should be ${formatInnerSchema(schema.additionalItems)}`); - } - } - } else if (schema.items && Object.keys(schema.items).length > 0) { - // "additionalItems" is ignored - items = `${formatInnerSchema(schema.items)}`; - } else { - // Fallback for empty `items` value - items = "any"; - } - } else { - // "additionalItems" is ignored - items = "any"; - } - - if (schema.contains && Object.keys(schema.contains).length > 0) { - hints.push(`should contains at least one ${this.formatSchema(schema.contains)} item`); - } - - return `[${items}${hasAdditionalItems ? ", ..." : ""}]${hints.length > 0 ? ` (${hints.join(", ")})` : ""}`; - } - - if (likeObject(schema)) { - // not logic already applied in formatValidationError - newLogic = true; - const hints = []; - - if (typeof schema.minProperties === "number") { - hints.push(`should not have fewer than ${schema.minProperties} ${schema.minProperties > 1 ? "properties" : "property"}`); - } - - if (typeof schema.maxProperties === "number") { - hints.push(`should not have more than ${schema.maxProperties} ${schema.minProperties && schema.minProperties > 1 ? "properties" : "property"}`); - } - - if (schema.patternProperties && Object.keys(schema.patternProperties).length > 0) { - const patternProperties = Object.keys(schema.patternProperties); - hints.push(`additional property names should match pattern${patternProperties.length > 1 ? "s" : ""} ${patternProperties.map(pattern => JSON.stringify(pattern)).join(" | ")}`); - } - - const properties = schema.properties ? Object.keys(schema.properties) : []; - const required = schema.required ? schema.required : []; - const allProperties = [...new Set( - /** @type {Array} */ - [].concat(required).concat(properties))]; - const objectStructure = allProperties.map(property => { - const isRequired = required.includes(property); // Some properties need quotes, maybe we should add check - // Maybe we should output type of property (`foo: string`), but it is looks very unreadable - - return `${property}${isRequired ? "" : "?"}`; - }).concat(typeof schema.additionalProperties === "undefined" || Boolean(schema.additionalProperties) ? schema.additionalProperties && isObject(schema.additionalProperties) ? [`: ${formatInnerSchema(schema.additionalProperties)}`] : ["…"] : []).join(", "); - const { - dependencies, - propertyNames, - patternRequired - } = - /** @type {Schema & {patternRequired?: Array;}} */ - schema; - - if (dependencies) { - Object.keys(dependencies).forEach(dependencyName => { - const dependency = dependencies[dependencyName]; - - if (Array.isArray(dependency)) { - hints.push(`should have ${dependency.length > 1 ? "properties" : "property"} ${dependency.map(dep => `'${dep}'`).join(", ")} when property '${dependencyName}' is present`); - } else { - hints.push(`should be valid according to the schema ${formatInnerSchema(dependency)} when property '${dependencyName}' is present`); - } - }); - } - - if (propertyNames && Object.keys(propertyNames).length > 0) { - hints.push(`each property name should match format ${JSON.stringify(schema.propertyNames.format)}`); - } - - if (patternRequired && patternRequired.length > 0) { - hints.push(`should have property matching pattern ${patternRequired.map( - /** - * @param {string} item - * @returns {string} - */ - item => JSON.stringify(item))}`); - } - - return `object {${objectStructure ? ` ${objectStructure} ` : ""}}${hints.length > 0 ? ` (${hints.join(", ")})` : ""}`; - } - - if (likeNull(schema)) { - return `${logic ? "" : "non-"}null`; - } - - if (Array.isArray(schema.type)) { - // not logic already applied in formatValidationError - return `${schema.type.join(" | ")}`; - } // Fallback for unknown keywords - // not logic already applied in formatValidationError - - /* istanbul ignore next */ - - - return JSON.stringify(schema, null, 2); - } - /** - * @param {Schema=} schemaPart - * @param {(boolean | Array)=} additionalPath - * @param {boolean=} needDot - * @param {boolean=} logic - * @returns {string} - */ - - - getSchemaPartText(schemaPart, additionalPath, needDot = false, logic = true) { - if (!schemaPart) { - return ""; - } - - if (Array.isArray(additionalPath)) { - for (let i = 0; i < additionalPath.length; i++) { - /** @type {Schema | undefined} */ - const inner = schemaPart[ - /** @type {keyof Schema} */ - additionalPath[i]]; - - if (inner) { - // eslint-disable-next-line no-param-reassign - schemaPart = inner; - } else { - break; - } - } - } - - while (schemaPart.$ref) { - // eslint-disable-next-line no-param-reassign - schemaPart = this.getSchemaPart(schemaPart.$ref); - } - - let schemaText = `${this.formatSchema(schemaPart, logic)}${needDot ? "." : ""}`; - - if (schemaPart.description) { - schemaText += `\n-> ${schemaPart.description}`; - } - - if (schemaPart.link) { - schemaText += `\n-> Read more at ${schemaPart.link}`; - } - - return schemaText; - } - /** - * @param {Schema=} schemaPart - * @returns {string} - */ - - - getSchemaPartDescription(schemaPart) { - if (!schemaPart) { - return ""; - } - - while (schemaPart.$ref) { - // eslint-disable-next-line no-param-reassign - schemaPart = this.getSchemaPart(schemaPart.$ref); - } - - let schemaText = ""; - - if (schemaPart.description) { - schemaText += `\n-> ${schemaPart.description}`; - } - - if (schemaPart.link) { - schemaText += `\n-> Read more at ${schemaPart.link}`; - } - - return schemaText; - } - /** - * @param {SchemaUtilErrorObject} error - * @returns {string} - */ - - - formatValidationError(error) { - const { - keyword, - dataPath: errorDataPath - } = error; - const dataPath = `${this.baseDataPath}${errorDataPath}`; - - switch (keyword) { - case "type": - { - const { - parentSchema, - params - } = error; // eslint-disable-next-line default-case - - switch ( - /** @type {import("ajv").TypeParams} */ - params.type) { - case "number": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "integer": - return `${dataPath} should be an ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "string": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "boolean": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "array": - return `${dataPath} should be an array:\n${this.getSchemaPartText(parentSchema)}`; - - case "object": - return `${dataPath} should be an object:\n${this.getSchemaPartText(parentSchema)}`; - - case "null": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - default: - return `${dataPath} should be:\n${this.getSchemaPartText(parentSchema)}`; - } - } - - case "instanceof": - { - const { - parentSchema - } = error; - return `${dataPath} should be an instance of ${this.getSchemaPartText(parentSchema, false, true)}`; - } - - case "pattern": - { - const { - params, - parentSchema - } = error; - const { - pattern - } = - /** @type {import("ajv").PatternParams} */ - params; - return `${dataPath} should match pattern ${JSON.stringify(pattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "format": - { - const { - params, - parentSchema - } = error; - const { - format - } = - /** @type {import("ajv").FormatParams} */ - params; - return `${dataPath} should match format ${JSON.stringify(format)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "formatMinimum": - case "formatMaximum": - { - const { - params, - parentSchema - } = error; - const { - comparison, - limit - } = - /** @type {import("ajv").ComparisonParams} */ - params; - return `${dataPath} should be ${comparison} ${JSON.stringify(limit)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minimum": - case "maximum": - case "exclusiveMinimum": - case "exclusiveMaximum": - { - const { - parentSchema, - params - } = error; - const { - comparison, - limit - } = - /** @type {import("ajv").ComparisonParams} */ - params; - const [, ...hints] = getHints( - /** @type {Schema} */ - parentSchema, true); - - if (hints.length === 0) { - hints.push(`should be ${comparison} ${limit}`); - } - - return `${dataPath} ${hints.join(" ")}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "multipleOf": - { - const { - params, - parentSchema - } = error; - const { - multipleOf - } = - /** @type {import("ajv").MultipleOfParams} */ - params; - return `${dataPath} should be multiple of ${multipleOf}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "patternRequired": - { - const { - params, - parentSchema - } = error; - const { - missingPattern - } = - /** @type {import("ajv").PatternRequiredParams} */ - params; - return `${dataPath} should have property matching pattern ${JSON.stringify(missingPattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minLength": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - - if (limit === 1) { - return `${dataPath} should be a non-empty string${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - const length = limit - 1; - return `${dataPath} should be longer than ${length} character${length > 1 ? "s" : ""}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minItems": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - - if (limit === 1) { - return `${dataPath} should be a non-empty array${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - return `${dataPath} should not have fewer than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minProperties": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - - if (limit === 1) { - return `${dataPath} should be a non-empty object${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - return `${dataPath} should not have fewer than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "maxLength": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - const max = limit + 1; - return `${dataPath} should be shorter than ${max} character${max > 1 ? "s" : ""}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "maxItems": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "maxProperties": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - return `${dataPath} should not have more than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "uniqueItems": - { - const { - params, - parentSchema - } = error; - const { - i - } = - /** @type {import("ajv").UniqueItemsParams} */ - params; - return `${dataPath} should not contain the item '${error.data[i]}' twice${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "additionalItems": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}. These items are valid:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "contains": - { - const { - parentSchema - } = error; - return `${dataPath} should contains at least one ${this.getSchemaPartText(parentSchema, ["contains"])} item${getSchemaNonTypes(parentSchema)}.`; - } - - case "required": - { - const { - parentSchema, - params - } = error; - const missingProperty = - /** @type {import("ajv").DependenciesParams} */ - params.missingProperty.replace(/^\./, ""); - const hasProperty = parentSchema && Boolean( - /** @type {Schema} */ - parentSchema.properties && - /** @type {Schema} */ - parentSchema.properties[missingProperty]); - return `${dataPath} misses the property '${missingProperty}'${getSchemaNonTypes(parentSchema)}.${hasProperty ? ` Should be:\n${this.getSchemaPartText(parentSchema, ["properties", missingProperty])}` : this.getSchemaPartDescription(parentSchema)}`; - } - - case "additionalProperties": - { - const { - params, - parentSchema - } = error; - const { - additionalProperty - } = - /** @type {import("ajv").AdditionalPropertiesParams} */ - params; - return `${dataPath} has an unknown property '${additionalProperty}'${getSchemaNonTypes(parentSchema)}. These properties are valid:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "dependencies": - { - const { - params, - parentSchema - } = error; - const { - property, - deps - } = - /** @type {import("ajv").DependenciesParams} */ - params; - const dependencies = deps.split(",").map( - /** - * @param {string} dep - * @returns {string} - */ - dep => `'${dep.trim()}'`).join(", "); - return `${dataPath} should have properties ${dependencies} when property '${property}' is present${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "propertyNames": - { - const { - params, - parentSchema, - schema - } = error; - const { - propertyName - } = - /** @type {import("ajv").PropertyNamesParams} */ - params; - return `${dataPath} property name '${propertyName}' is invalid${getSchemaNonTypes(parentSchema)}. Property names should be match format ${JSON.stringify(schema.format)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "enum": - { - const { - parentSchema - } = error; - - if (parentSchema && - /** @type {Schema} */ - parentSchema.enum && - /** @type {Schema} */ - parentSchema.enum.length === 1) { - return `${dataPath} should be ${this.getSchemaPartText(parentSchema, false, true)}`; - } - - return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "const": - { - const { - parentSchema - } = error; - return `${dataPath} should be equal to constant ${this.getSchemaPartText(parentSchema, false, true)}`; - } - - case "not": - { - const postfix = likeObject( - /** @type {Schema} */ - error.parentSchema) ? `\n${this.getSchemaPartText(error.parentSchema)}` : ""; - const schemaOutput = this.getSchemaPartText(error.schema, false, false, false); - - if (canApplyNot(error.schema)) { - return `${dataPath} should be any ${schemaOutput}${postfix}.`; - } - - const { - schema, - parentSchema - } = error; - return `${dataPath} should not be ${this.getSchemaPartText(schema, false, true)}${parentSchema && likeObject(parentSchema) ? `\n${this.getSchemaPartText(parentSchema)}` : ""}`; - } - - case "oneOf": - case "anyOf": - { - const { - parentSchema, - children - } = error; - - if (children && children.length > 0) { - if (error.schema.length === 1) { - const lastChild = children[children.length - 1]; - const remainingChildren = children.slice(0, children.length - 1); - return this.formatValidationError(Object.assign({}, lastChild, { - children: remainingChildren, - parentSchema: Object.assign({}, parentSchema, lastChild.parentSchema) - })); - } - - let filteredChildren = filterChildren(children); - - if (filteredChildren.length === 1) { - return this.formatValidationError(filteredChildren[0]); - } - - filteredChildren = groupChildrenByFirstChild(filteredChildren); - return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}\nDetails:\n${filteredChildren.map( - /** - * @param {SchemaUtilErrorObject} nestedError - * @returns {string} - */ - nestedError => ` * ${indent(this.formatValidationError(nestedError), " ")}`).join("\n")}`; - } - - return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "if": - { - const { - params, - parentSchema - } = error; - const { - failingKeyword - } = - /** @type {import("ajv").IfParams} */ - params; - return `${dataPath} should match "${failingKeyword}" schema:\n${this.getSchemaPartText(parentSchema, [failingKeyword])}`; - } - - case "absolutePath": - { - const { - message, - parentSchema - } = error; - return `${dataPath}: ${message}${this.getSchemaPartDescription(parentSchema)}`; - } - - /* istanbul ignore next */ - - default: - { - const { - message, - parentSchema - } = error; - const ErrorInJSON = JSON.stringify(error, null, 2); // For `custom`, `false schema`, `$ref` keywords - // Fallback for unknown keywords - - return `${dataPath} ${message} (${ErrorInJSON}).\n${this.getSchemaPartText(parentSchema, false)}`; - } - } - } - /** - * @param {Array} errors - * @returns {string} - */ - - - formatValidationErrors(errors) { - return errors.map(error => { - let formattedError = this.formatValidationError(error); - - if (this.postFormatter) { - formattedError = this.postFormatter(formattedError, error); - } - - return ` - ${indent(formattedError, " ")}`; - }).join("\n"); - } - -} - -var _default = ValidationError; -exports.default = _default; \ No newline at end of file diff --git a/node_modules/schema-utils/dist/index.js b/node_modules/schema-utils/dist/index.js deleted file mode 100644 index 94d676f..0000000 --- a/node_modules/schema-utils/dist/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -const { - validate, - ValidationError, - enableValidation, - disableValidation, - needValidate -} = require("./validate"); - -module.exports = { - validate, - ValidationError, - enableValidation, - disableValidation, - needValidate -}; \ No newline at end of file diff --git a/node_modules/schema-utils/dist/keywords/absolutePath.js b/node_modules/schema-utils/dist/keywords/absolutePath.js deleted file mode 100644 index 0a912da..0000000 --- a/node_modules/schema-utils/dist/keywords/absolutePath.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** @typedef {import("ajv").Ajv} Ajv */ - -/** @typedef {import("ajv").ValidateFunction} ValidateFunction */ - -/** @typedef {import("../validate").SchemaUtilErrorObject} SchemaUtilErrorObject */ - -/** - * @param {string} message - * @param {object} schema - * @param {string} data - * @returns {SchemaUtilErrorObject} - */ -function errorMessage(message, schema, data) { - return { - // @ts-ignore - // eslint-disable-next-line no-undefined - dataPath: undefined, - // @ts-ignore - // eslint-disable-next-line no-undefined - schemaPath: undefined, - keyword: "absolutePath", - params: { - absolutePath: data - }, - message, - parentSchema: schema - }; -} -/** - * @param {boolean} shouldBeAbsolute - * @param {object} schema - * @param {string} data - * @returns {SchemaUtilErrorObject} - */ - - -function getErrorFor(shouldBeAbsolute, schema, data) { - const message = shouldBeAbsolute ? `The provided value ${JSON.stringify(data)} is not an absolute path!` : `A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`; - return errorMessage(message, schema, data); -} -/** - * - * @param {Ajv} ajv - * @returns {Ajv} - */ - - -function addAbsolutePathKeyword(ajv) { - ajv.addKeyword("absolutePath", { - errors: true, - type: "string", - - compile(schema, parentSchema) { - /** @type {ValidateFunction} */ - const callback = data => { - let passes = true; - const isExclamationMarkPresent = data.includes("!"); - - if (isExclamationMarkPresent) { - callback.errors = [errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`, parentSchema, data)]; - passes = false; - } // ?:[A-Za-z]:\\ - Windows absolute path - // \\\\ - Windows network absolute path - // \/ - Unix-like OS absolute path - - - const isCorrectAbsolutePath = schema === /^(?:[A-Za-z]:(\\|\/)|\\\\|\/)/.test(data); - - if (!isCorrectAbsolutePath) { - callback.errors = [getErrorFor(schema, parentSchema, data)]; - passes = false; - } - - return passes; - }; - - callback.errors = []; - return callback; - } - - }); - return ajv; -} - -var _default = addAbsolutePathKeyword; -exports.default = _default; \ No newline at end of file diff --git a/node_modules/schema-utils/dist/keywords/undefinedAsNull.js b/node_modules/schema-utils/dist/keywords/undefinedAsNull.js deleted file mode 100644 index 1d54aab..0000000 --- a/node_modules/schema-utils/dist/keywords/undefinedAsNull.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** @typedef {import("ajv").Ajv} Ajv */ - -/** - * - * @param {Ajv} ajv - * @param {string} keyword - * @param {any} definition - */ -function addKeyword(ajv, keyword, definition) { - let customRuleCode; - - try { - // @ts-ignore - // eslint-disable-next-line global-require - customRuleCode = require("ajv/lib/dotjs/custom"); // @ts-ignore - - const { - RULES - } = ajv; - let ruleGroup; - - for (let i = 0; i < RULES.length; i++) { - const rg = RULES[i]; - - if (typeof rg.type === "undefined") { - ruleGroup = rg; - break; - } - } - - const rule = { - keyword, - definition, - custom: true, - code: customRuleCode, - implements: definition.implements - }; - ruleGroup.rules.unshift(rule); - RULES.custom[keyword] = rule; - RULES.keywords[keyword] = true; - RULES.all[keyword] = true; - } catch (e) {// Nothing, fallback - } -} -/** - * - * @param {Ajv} ajv - * @returns {Ajv} - */ - - -function addUndefinedAsNullKeyword(ajv) { - // There is workaround for old versions of ajv, where `before` is not implemented - addKeyword(ajv, "undefinedAsNull", { - modifying: true, - - /** - * @param {boolean} kwVal - * @param {unknown} data - * @param {any} parentSchema - * @param {string} dataPath - * @param {unknown} parentData - * @param {number | string} parentDataProperty - * @return {boolean} - */ - validate(kwVal, data, parentSchema, dataPath, parentData, parentDataProperty) { - if (kwVal && parentSchema && typeof parentSchema.enum !== "undefined" && parentData && typeof parentDataProperty === "number") { - const idx = - /** @type {number} */ - parentDataProperty; - const parentDataRef = - /** @type {any[]} */ - parentData; - - if (typeof parentDataRef[idx] === "undefined") { - parentDataRef[idx] = null; - } - } - - return true; - } - - }); - return ajv; -} - -var _default = addUndefinedAsNullKeyword; -exports.default = _default; \ No newline at end of file diff --git a/node_modules/schema-utils/dist/util/Range.js b/node_modules/schema-utils/dist/util/Range.js deleted file mode 100644 index 14b2431..0000000 --- a/node_modules/schema-utils/dist/util/Range.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; - -/** - * @typedef {[number, boolean]} RangeValue - */ - -/** - * @callback RangeValueCallback - * @param {RangeValue} rangeValue - * @returns {boolean} - */ -class Range { - /** - * @param {"left" | "right"} side - * @param {boolean} exclusive - * @returns {">" | ">=" | "<" | "<="} - */ - static getOperator(side, exclusive) { - if (side === "left") { - return exclusive ? ">" : ">="; - } - - return exclusive ? "<" : "<="; - } - /** - * @param {number} value - * @param {boolean} logic is not logic applied - * @param {boolean} exclusive is range exclusive - * @returns {string} - */ - - - static formatRight(value, logic, exclusive) { - if (logic === false) { - return Range.formatLeft(value, !logic, !exclusive); - } - - return `should be ${Range.getOperator("right", exclusive)} ${value}`; - } - /** - * @param {number} value - * @param {boolean} logic is not logic applied - * @param {boolean} exclusive is range exclusive - * @returns {string} - */ - - - static formatLeft(value, logic, exclusive) { - if (logic === false) { - return Range.formatRight(value, !logic, !exclusive); - } - - return `should be ${Range.getOperator("left", exclusive)} ${value}`; - } - /** - * @param {number} start left side value - * @param {number} end right side value - * @param {boolean} startExclusive is range exclusive from left side - * @param {boolean} endExclusive is range exclusive from right side - * @param {boolean} logic is not logic applied - * @returns {string} - */ - - - static formatRange(start, end, startExclusive, endExclusive, logic) { - let result = "should be"; - result += ` ${Range.getOperator(logic ? "left" : "right", logic ? startExclusive : !startExclusive)} ${start} `; - result += logic ? "and" : "or"; - result += ` ${Range.getOperator(logic ? "right" : "left", logic ? endExclusive : !endExclusive)} ${end}`; - return result; - } - /** - * @param {Array} values - * @param {boolean} logic is not logic applied - * @return {RangeValue} computed value and it's exclusive flag - */ - - - static getRangeValue(values, logic) { - let minMax = logic ? Infinity : -Infinity; - let j = -1; - const predicate = logic ? - /** @type {RangeValueCallback} */ - ([value]) => value <= minMax : - /** @type {RangeValueCallback} */ - ([value]) => value >= minMax; - - for (let i = 0; i < values.length; i++) { - if (predicate(values[i])) { - [minMax] = values[i]; - j = i; - } - } - - if (j > -1) { - return values[j]; - } - - return [Infinity, true]; - } - - constructor() { - /** @type {Array} */ - this._left = []; - /** @type {Array} */ - - this._right = []; - } - /** - * @param {number} value - * @param {boolean=} exclusive - */ - - - left(value, exclusive = false) { - this._left.push([value, exclusive]); - } - /** - * @param {number} value - * @param {boolean=} exclusive - */ - - - right(value, exclusive = false) { - this._right.push([value, exclusive]); - } - /** - * @param {boolean} logic is not logic applied - * @return {string} "smart" range string representation - */ - - - format(logic = true) { - const [start, leftExclusive] = Range.getRangeValue(this._left, logic); - const [end, rightExclusive] = Range.getRangeValue(this._right, !logic); - - if (!Number.isFinite(start) && !Number.isFinite(end)) { - return ""; - } - - const realStart = leftExclusive ? start + 1 : start; - const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6 - - if (realStart === realEnd) { - return `should be ${logic ? "" : "!"}= ${realStart}`; - } // e.g. 4 < x < ∞ - - - if (Number.isFinite(start) && !Number.isFinite(end)) { - return Range.formatLeft(start, logic, leftExclusive); - } // e.g. ∞ < x < 4 - - - if (!Number.isFinite(start) && Number.isFinite(end)) { - return Range.formatRight(end, logic, rightExclusive); - } - - return Range.formatRange(start, end, leftExclusive, rightExclusive, logic); - } - -} - -module.exports = Range; \ No newline at end of file diff --git a/node_modules/schema-utils/dist/util/hints.js b/node_modules/schema-utils/dist/util/hints.js deleted file mode 100644 index 4317b86..0000000 --- a/node_modules/schema-utils/dist/util/hints.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; - -const Range = require("./Range"); -/** @typedef {import("../validate").Schema} Schema */ - -/** - * @param {Schema} schema - * @param {boolean} logic - * @return {string[]} - */ - - -module.exports.stringHints = function stringHints(schema, logic) { - const hints = []; - let type = "string"; - const currentSchema = { ...schema - }; - - if (!logic) { - const tmpLength = currentSchema.minLength; - const tmpFormat = currentSchema.formatMinimum; - const tmpExclusive = currentSchema.formatExclusiveMaximum; - currentSchema.minLength = currentSchema.maxLength; - currentSchema.maxLength = tmpLength; - currentSchema.formatMinimum = currentSchema.formatMaximum; - currentSchema.formatMaximum = tmpFormat; - currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum; - currentSchema.formatExclusiveMinimum = !tmpExclusive; - } - - if (typeof currentSchema.minLength === "number") { - if (currentSchema.minLength === 1) { - type = "non-empty string"; - } else { - const length = Math.max(currentSchema.minLength - 1, 0); - hints.push(`should be longer than ${length} character${length > 1 ? "s" : ""}`); - } - } - - if (typeof currentSchema.maxLength === "number") { - if (currentSchema.maxLength === 0) { - type = "empty string"; - } else { - const length = currentSchema.maxLength + 1; - hints.push(`should be shorter than ${length} character${length > 1 ? "s" : ""}`); - } - } - - if (currentSchema.pattern) { - hints.push(`should${logic ? "" : " not"} match pattern ${JSON.stringify(currentSchema.pattern)}`); - } - - if (currentSchema.format) { - hints.push(`should${logic ? "" : " not"} match format ${JSON.stringify(currentSchema.format)}`); - } - - if (currentSchema.formatMinimum) { - hints.push(`should be ${currentSchema.formatExclusiveMinimum ? ">" : ">="} ${JSON.stringify(currentSchema.formatMinimum)}`); - } - - if (currentSchema.formatMaximum) { - hints.push(`should be ${currentSchema.formatExclusiveMaximum ? "<" : "<="} ${JSON.stringify(currentSchema.formatMaximum)}`); - } - - return [type].concat(hints); -}; -/** - * @param {Schema} schema - * @param {boolean} logic - * @return {string[]} - */ - - -module.exports.numberHints = function numberHints(schema, logic) { - const hints = [schema.type === "integer" ? "integer" : "number"]; - const range = new Range(); - - if (typeof schema.minimum === "number") { - range.left(schema.minimum); - } - - if (typeof schema.exclusiveMinimum === "number") { - range.left(schema.exclusiveMinimum, true); - } - - if (typeof schema.maximum === "number") { - range.right(schema.maximum); - } - - if (typeof schema.exclusiveMaximum === "number") { - range.right(schema.exclusiveMaximum, true); - } - - const rangeFormat = range.format(logic); - - if (rangeFormat) { - hints.push(rangeFormat); - } - - if (typeof schema.multipleOf === "number") { - hints.push(`should${logic ? "" : " not"} be multiple of ${schema.multipleOf}`); - } - - return hints; -}; \ No newline at end of file diff --git a/node_modules/schema-utils/dist/validate.js b/node_modules/schema-utils/dist/validate.js deleted file mode 100644 index cb09145..0000000 --- a/node_modules/schema-utils/dist/validate.js +++ /dev/null @@ -1,258 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.validate = validate; -exports.enableValidation = enableValidation; -exports.disableValidation = disableValidation; -exports.needValidate = needValidate; -Object.defineProperty(exports, "ValidationError", { - enumerable: true, - get: function () { - return _ValidationError.default; - } -}); - -var _absolutePath = _interopRequireDefault(require("./keywords/absolutePath")); - -var _undefinedAsNull = _interopRequireDefault(require("./keywords/undefinedAsNull")); - -var _ValidationError = _interopRequireDefault(require("./ValidationError")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @template T - * @param fn {(function(): any) | undefined} - * @returns {function(): T} - */ -const memoize = fn => { - let cache = false; - /** @type {T} */ - - let result; - return () => { - if (cache) { - return result; - } - - result = - /** @type {function(): any} */ - fn(); - cache = true; // Allow to clean up memory for fn - // and all dependent resources - // eslint-disable-next-line no-undefined, no-param-reassign - - fn = undefined; - return result; - }; -}; - -const getAjv = memoize(() => { - // Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110). - // eslint-disable-next-line global-require - const Ajv = require("ajv"); // eslint-disable-next-line global-require - - - const ajvKeywords = require("ajv-keywords"); - - const ajv = new Ajv({ - allErrors: true, - verbose: true, - $data: true - }); - ajvKeywords(ajv, ["instanceof", "formatMinimum", "formatMaximum", "patternRequired"]); // Custom keywords - - (0, _absolutePath.default)(ajv); - (0, _undefinedAsNull.default)(ajv); - return ajv; -}); -/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */ - -/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ - -/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ - -/** @typedef {import("ajv").ErrorObject} ErrorObject */ - -/** @typedef {import("ajv").ValidateFunction} ValidateFunction */ - -/** - * @typedef {Object} Extend - * @property {number=} formatMinimum - * @property {number=} formatMaximum - * @property {boolean=} formatExclusiveMinimum - * @property {boolean=} formatExclusiveMaximum - * @property {string=} link - * @property {boolean=} undefinedAsNull - */ - -/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */ - -/** @typedef {ErrorObject & { children?: Array}} SchemaUtilErrorObject */ - -/** - * @callback PostFormatter - * @param {string} formattedError - * @param {SchemaUtilErrorObject} error - * @returns {string} - */ - -/** - * @typedef {Object} ValidationErrorConfiguration - * @property {string=} name - * @property {string=} baseDataPath - * @property {PostFormatter=} postFormatter - */ - -/** - * @param {SchemaUtilErrorObject} error - * @param {number} idx - * @returns {SchemaUtilErrorObject} - */ - -function applyPrefix(error, idx) { - // eslint-disable-next-line no-param-reassign - error.dataPath = `[${idx}]${error.dataPath}`; - - if (error.children) { - error.children.forEach(err => applyPrefix(err, idx)); - } - - return error; -} - -let skipValidation = false; // We use `process.env.SKIP_VALIDATION` because you can have multiple `schema-utils` with different version, -// so we want to disable it globally, `process.env` doesn't supported by browsers, so we have the local `skipValidation` variables -// Enable validation - -function enableValidation() { - skipValidation = false; // Disable validation for any versions - - if (process && process.env) { - process.env.SKIP_VALIDATION = "n"; - } -} // Disable validation - - -function disableValidation() { - skipValidation = true; - - if (process && process.env) { - process.env.SKIP_VALIDATION = "y"; - } -} // Check if we need to confirm - - -function needValidate() { - if (skipValidation) { - return false; - } - - if (process && process.env && process.env.SKIP_VALIDATION) { - const value = process.env.SKIP_VALIDATION.trim(); - - if (/^(?:y|yes|true|1|on)$/i.test(value)) { - return false; - } - - if (/^(?:n|no|false|0|off)$/i.test(value)) { - return true; - } - } - - return true; -} -/** - * @param {Schema} schema - * @param {Array | object} options - * @param {ValidationErrorConfiguration=} configuration - * @returns {void} - */ - - -function validate(schema, options, configuration) { - if (!needValidate()) { - return; - } - - let errors = []; - - if (Array.isArray(options)) { - for (let i = 0; i <= options.length - 1; i++) { - errors.push(...validateObject(schema, options[i]).map(err => applyPrefix(err, i))); - } - } else { - errors = validateObject(schema, options); - } - - if (errors.length > 0) { - throw new _ValidationError.default(errors, schema, configuration); - } -} -/** @typedef {WeakMap} */ - - -const schemaCache = new WeakMap(); -/** - * @param {Schema} schema - * @param {Array | object} options - * @returns {Array} - */ - -function validateObject(schema, options) { - let compiledSchema = schemaCache.get(schema); - - if (!compiledSchema) { - compiledSchema = getAjv().compile(schema); - schemaCache.set(schema, compiledSchema); - } - - const valid = compiledSchema(options); - if (valid) return []; - return compiledSchema.errors ? filterErrors(compiledSchema.errors) : []; -} -/** - * @param {Array} errors - * @returns {Array} - */ - - -function filterErrors(errors) { - /** @type {Array} */ - let newErrors = []; - - for (const error of - /** @type {Array} */ - errors) { - const { - dataPath - } = error; - /** @type {Array} */ - - let children = []; - newErrors = newErrors.filter(oldError => { - if (oldError.dataPath.includes(dataPath)) { - if (oldError.children) { - children = children.concat(oldError.children.slice(0)); - } // eslint-disable-next-line no-undefined, no-param-reassign - - - oldError.children = undefined; - children.push(oldError); - return false; - } - - return true; - }); - - if (children.length) { - error.children = children; - } - - newErrors.push(error); - } - - return newErrors; -} \ No newline at end of file diff --git a/node_modules/schema-utils/package.json b/node_modules/schema-utils/package.json deleted file mode 100644 index 47943ef..0000000 --- a/node_modules/schema-utils/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "schema-utils", - "version": "3.3.0", - "description": "webpack Validation Utils", - "license": "MIT", - "repository": "webpack/schema-utils", - "author": "webpack Contrib (https://github.com/webpack-contrib)", - "homepage": "https://github.com/webpack/schema-utils", - "bugs": "https://github.com/webpack/schema-utils/issues", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "main": "dist/index.js", - "types": "declarations/index.d.ts", - "engines": { - "node": ">= 10.13.0" - }, - "scripts": { - "start": "npm run build -- -w", - "clean": "del-cli dist declarations", - "prebuild": "npm run clean", - "build:types": "tsc --declaration --emitDeclarationOnly --outDir declarations && prettier \"declarations/**/*.ts\" --write", - "build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files", - "build": "npm-run-all -p \"build:**\"", - "commitlint": "commitlint --from=master", - "security": "npm audit --production", - "fmt:check": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different", - "lint:js": "eslint --cache .", - "lint:types": "tsc --pretty --noEmit", - "lint": "npm-run-all lint:js lint:types fmt:check", - "fmt": "npm run fmt:check -- --write", - "fix:js": "npm run lint:js -- --fix", - "fix": "npm-run-all fix:js fmt", - "test:only": "cross-env NODE_ENV=test jest", - "test:watch": "npm run test:only -- --watch", - "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage", - "pretest": "npm run lint", - "test": "npm run test:coverage", - "prepare": "npm run build && husky install", - "release": "standard-version" - }, - "files": [ - "dist", - "declarations" - ], - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "devDependencies": { - "@babel/cli": "^7.14.3", - "@babel/core": "^7.14.6", - "@babel/preset-env": "^7.14.7", - "@commitlint/cli": "^12.1.4", - "@commitlint/config-conventional": "^12.1.4", - "@webpack-contrib/eslint-config-webpack": "^3.0.0", - "babel-jest": "^27.0.6", - "cross-env": "^7.0.3", - "del": "^6.0.0", - "del-cli": "^3.0.1", - "eslint": "^7.31.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.23.4", - "husky": "^6.0.0", - "jest": "^27.0.6", - "lint-staged": "^11.0.1", - "npm-run-all": "^4.1.5", - "prettier": "^2.3.2", - "standard-version": "^9.3.1", - "typescript": "^4.3.5", - "webpack": "^5.45.1" - }, - "keywords": [ - "webpack" - ] -} diff --git a/node_modules/serialize-javascript/LICENSE b/node_modules/serialize-javascript/LICENSE deleted file mode 100644 index 263382a..0000000 --- a/node_modules/serialize-javascript/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2014 Yahoo! Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the Yahoo! Inc. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/serialize-javascript/README.md b/node_modules/serialize-javascript/README.md deleted file mode 100644 index e6523ba..0000000 --- a/node_modules/serialize-javascript/README.md +++ /dev/null @@ -1,143 +0,0 @@ -Serialize JavaScript -==================== - -Serialize JavaScript to a _superset_ of JSON that includes regular expressions, dates and functions. - -[![npm Version][npm-badge]][npm] -[![Dependency Status][david-badge]][david] -![Test](https://github.com/yahoo/serialize-javascript/workflows/Test/badge.svg) - -## Overview - -The code in this package began its life as an internal module to [express-state][]. To expand its usefulness, it now lives as `serialize-javascript` — an independent package on npm. - -You're probably wondering: **What about `JSON.stringify()`!?** We've found that sometimes we need to serialize JavaScript **functions**, **regexps**, **dates**, **sets** or **maps**. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. But this module is also great for communicating between node processes. - -The string returned from this package's single export function is literal JavaScript which can be saved to a `.js` file, or be embedded into an HTML document by making the content of a `' -}); -``` - -The above will produce the following string, HTML-escaped output which is safe to put into an HTML document as it will not cause the inline script element to terminate: - -```js -'{"haxorXSS":"\\u003C\\u002Fscript\\u003E"}' -``` - -> You can pass an optional `unsafe` argument to `serialize()` for straight serialization. - -### Options - -The `serialize()` function accepts an `options` object as its second argument. All options are being defaulted to `undefined`: - -#### `options.space` - -This option is the same as the `space` argument that can be passed to [`JSON.stringify`][JSON.stringify]. It can be used to add whitespace and indentation to the serialized output to make it more readable. - -```js -serialize(obj, {space: 2}); -``` - -#### `options.isJSON` - -This option is a signal to `serialize()` that the object being serialized does not contain any function or regexps values. This enables a hot-path that allows serialization to be over 3x faster. If you're serializing a lot of data, and know its pure JSON, then you can enable this option for a speed-up. - -**Note:** That when using this option, the output will still be escaped to protect against XSS. - -```js -serialize(obj, {isJSON: true}); -``` - -#### `options.unsafe` - -This option is to signal `serialize()` that we want to do a straight conversion, without the XSS protection. This options needs to be explicitly set to `true`. HTML characters and JavaScript line terminators will not be escaped. You will have to roll your own. - -```js -serialize(obj, {unsafe: true}); -``` - -#### `options.ignoreFunction` - -This option is to signal `serialize()` that we do not want serialize JavaScript function. -Just treat function like `JSON.stringify` do, but other features will work as expected. - -```js -serialize(obj, {ignoreFunction: true}); -``` - -## Deserializing - -For some use cases you might also need to deserialize the string. This is explicitly not part of this module. However, you can easily write it yourself: - -```js -function deserialize(serializedJavascript){ - return eval('(' + serializedJavascript + ')'); -} -``` - -**Note:** Don't forget the parentheses around the serialized javascript, as the opening bracket `{` will be considered to be the start of a body. - -## License - -This software is free to use under the Yahoo! Inc. BSD license. -See the [LICENSE file][LICENSE] for license text and copyright information. - - -[npm]: https://www.npmjs.org/package/serialize-javascript -[npm-badge]: https://img.shields.io/npm/v/serialize-javascript.svg?style=flat-square -[david]: https://david-dm.org/yahoo/serialize-javascript -[david-badge]: https://img.shields.io/david/yahoo/serialize-javascript.svg?style=flat-square -[express-state]: https://github.com/yahoo/express-state -[JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify -[LICENSE]: https://github.com/yahoo/serialize-javascript/blob/main/LICENSE diff --git a/node_modules/serialize-javascript/index.js b/node_modules/serialize-javascript/index.js deleted file mode 100644 index 156f8f9..0000000 --- a/node_modules/serialize-javascript/index.js +++ /dev/null @@ -1,268 +0,0 @@ -/* -Copyright (c) 2014, Yahoo! Inc. All rights reserved. -Copyrights licensed under the New BSD License. -See the accompanying LICENSE file for terms. -*/ - -'use strict'; - -var randomBytes = require('randombytes'); - -// Generate an internal UID to make the regexp pattern harder to guess. -var UID_LENGTH = 16; -var UID = generateUID(); -var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|A|U|I|B|L)-' + UID + '-(\\d+)__@"', 'g'); - -var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g; -var IS_PURE_FUNCTION = /function.*?\(/; -var IS_ARROW_FUNCTION = /.*?=>.*?/; -var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g; - -var RESERVED_SYMBOLS = ['*', 'async']; - -// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their -// Unicode char counterparts which are safe to use in JavaScript strings. -var ESCAPED_CHARS = { - '<' : '\\u003C', - '>' : '\\u003E', - '/' : '\\u002F', - '\u2028': '\\u2028', - '\u2029': '\\u2029' -}; - -function escapeUnsafeChars(unsafeChar) { - return ESCAPED_CHARS[unsafeChar]; -} - -function generateUID() { - var bytes = randomBytes(UID_LENGTH); - var result = ''; - for(var i=0; i arg1+5 - if(IS_ARROW_FUNCTION.test(serializedFn)) { - return serializedFn; - } - - var argsStartsAt = serializedFn.indexOf('('); - var def = serializedFn.substr(0, argsStartsAt) - .trim() - .split(' ') - .filter(function(val) { return val.length > 0 }); - - var nonReservedSymbols = def.filter(function(val) { - return RESERVED_SYMBOLS.indexOf(val) === -1 - }); - - // enhanced literal objects, example: {key() {}} - if(nonReservedSymbols.length > 0) { - return (def.indexOf('async') > -1 ? 'async ' : '') + 'function' - + (def.join('').indexOf('*') > -1 ? '*' : '') - + serializedFn.substr(argsStartsAt); - } - - // arrow functions - return serializedFn; - } - - // Check if the parameter is function - if (options.ignoreFunction && typeof obj === "function") { - obj = undefined; - } - // Protects against `JSON.stringify()` returning `undefined`, by serializing - // to the literal string: "undefined". - if (obj === undefined) { - return String(obj); - } - - var str; - - // Creates a JSON string representation of the value. - // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args. - if (options.isJSON && !options.space) { - str = JSON.stringify(obj); - } else { - str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space); - } - - // Protects against `JSON.stringify()` returning `undefined`, by serializing - // to the literal string: "undefined". - if (typeof str !== 'string') { - return String(str); - } - - // Replace unsafe HTML and invalid JavaScript line terminator chars with - // their safe Unicode char counterpart. This _must_ happen before the - // regexps and functions are serialized and added back to the string. - if (options.unsafe !== true) { - str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars); - } - - if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && arrays.length === 0 && undefs.length === 0 && infinities.length === 0 && bigInts.length === 0 && urls.length === 0) { - return str; - } - - // Replaces all occurrences of function, regexp, date, map and set placeholders in the - // JSON string with their string representations. If the original value can - // not be found, then `undefined` is used. - return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) { - // The placeholder may not be preceded by a backslash. This is to prevent - // replacing things like `"a\"@__R--0__@"` and thus outputting - // invalid JS. - if (backSlash) { - return match; - } - - if (type === 'D') { - return "new Date(\"" + dates[valueIndex].toISOString() + "\")"; - } - - if (type === 'R') { - return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")"; - } - - if (type === 'M') { - return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")"; - } - - if (type === 'S') { - return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")"; - } - - if (type === 'A') { - return "Array.prototype.slice.call(" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + ")"; - } - - if (type === 'U') { - return 'undefined' - } - - if (type === 'I') { - return infinities[valueIndex]; - } - - if (type === 'B') { - return "BigInt(\"" + bigInts[valueIndex] + "\")"; - } - - if (type === 'L') { - return "new URL(" + serialize(urls[valueIndex].toString(), options) + ")"; - } - - var fn = functions[valueIndex]; - - return serializeFunc(fn); - }); -} diff --git a/node_modules/serialize-javascript/package.json b/node_modules/serialize-javascript/package.json deleted file mode 100644 index ee71672..0000000 --- a/node_modules/serialize-javascript/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "serialize-javascript", - "version": "6.0.2", - "description": "Serialize JavaScript to a superset of JSON that includes regular expressions and functions.", - "main": "index.js", - "scripts": { - "benchmark": "node -v && node test/benchmark/serialize.js", - "test": "nyc --reporter=lcov mocha test/unit" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/yahoo/serialize-javascript.git" - }, - "keywords": [ - "serialize", - "serialization", - "javascript", - "js", - "json" - ], - "author": "Eric Ferraiuolo ", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/yahoo/serialize-javascript/issues" - }, - "homepage": "https://github.com/yahoo/serialize-javascript", - "devDependencies": { - "benchmark": "^2.1.4", - "chai": "^4.1.0", - "mocha": "^10.0.0", - "nyc": "^15.0.0" - }, - "dependencies": { - "randombytes": "^2.1.0" - } -} diff --git a/node_modules/shallow-clone/LICENSE b/node_modules/shallow-clone/LICENSE deleted file mode 100644 index 7cccaf9..0000000 --- a/node_modules/shallow-clone/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-present, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/shallow-clone/README.md b/node_modules/shallow-clone/README.md deleted file mode 100644 index ea7514e..0000000 --- a/node_modules/shallow-clone/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# shallow-clone [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/shallow-clone.svg?style=flat)](https://www.npmjs.com/package/shallow-clone) [![NPM monthly downloads](https://img.shields.io/npm/dm/shallow-clone.svg?style=flat)](https://npmjs.org/package/shallow-clone) [![NPM total downloads](https://img.shields.io/npm/dt/shallow-clone.svg?style=flat)](https://npmjs.org/package/shallow-clone) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/shallow-clone.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/shallow-clone) - -> Creates a shallow clone of any JavaScript value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save shallow-clone -``` - -## Usage - -```js -const clone = require('shallow-clone'); -``` - -**Supports** - -* array buffers -* arrays -* buffers -* dates -* errors -* float32 arrays -* float64 arrays -* int16 arrays -* int32 arrays -* int8 arrays -* maps -* objects -* primitives -* regular expressions -* sets -* symbols -* uint16 arrays -* uint32 arrays -* uint8 arrays -* uint8clamped arrays - -## Arrays - -By default, only the array itself is cloned (shallow), use [clone-deep](https://github.com/jonschlinkert/clone-deep) if you also need the elements in the array to be cloned. - -```js -const arr = [{ a: 0 }, { b: 1 }]; -const foo = clone(arr); -// foo => [{ 'a': 0 }, { 'b': 1 }] - -// array is cloned -assert(actual === expected); // false - -// array elements are not -assert.deepEqual(actual[0], expected[0]); // true -``` - -## Objects - -Only the object is shallow cloned, use [clone-deep](https://github.com/jonschlinkert/clone-deep) if you also need the values in the object to be cloned. - -```js -console.log(clone({ a: 1, b: 2, c: 3 })); -//=> {a: 1, b: 2, c: 3 } -``` - -## RegExp - -Clones regular expressions and flags, and preserves the `.lastIndex`. - -```js -const regex = clone(/foo/g); //=> /foo/g -// you can manually reset lastIndex if necessary -regex.lastIndex = 0; -``` - -## Primitives - -Simply returns primitives unchanged. - -```js -clone(0); //=> 0 -clone('foo'); //=> 'foo' -``` - -## About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -### Related projects - -You might also be interested in these projects: - -* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the values of all enumerable-own-properties and symbols from one or more source objects… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the values of all enumerable-own-properties and symbols from one or more source objects to a target object. Returns the target object.") -* [clone-deep](https://www.npmjs.com/package/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. | [homepage](https://github.com/jonschlinkert/clone-deep "Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 20 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [doowb](https://github.com/doowb) | -| 1 | [jakub-g](https://github.com/jakub-g) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -### License - -Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 15, 2019._ \ No newline at end of file diff --git a/node_modules/shallow-clone/index.js b/node_modules/shallow-clone/index.js deleted file mode 100644 index 012746f..0000000 --- a/node_modules/shallow-clone/index.js +++ /dev/null @@ -1,83 +0,0 @@ -/*! - * shallow-clone - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -const valueOf = Symbol.prototype.valueOf; -const typeOf = require('kind-of'); - -function clone(val, deep) { - switch (typeOf(val)) { - case 'array': - return val.slice(); - case 'object': - return Object.assign({}, val); - case 'date': - return new val.constructor(Number(val)); - case 'map': - return new Map(val); - case 'set': - return new Set(val); - case 'buffer': - return cloneBuffer(val); - case 'symbol': - return cloneSymbol(val); - case 'arraybuffer': - return cloneArrayBuffer(val); - case 'float32array': - case 'float64array': - case 'int16array': - case 'int32array': - case 'int8array': - case 'uint16array': - case 'uint32array': - case 'uint8clampedarray': - case 'uint8array': - return cloneTypedArray(val); - case 'regexp': - return cloneRegExp(val); - case 'error': - return Object.create(val); - default: { - return val; - } - } -} - -function cloneRegExp(val) { - const flags = val.flags !== void 0 ? val.flags : (/\w+$/.exec(val) || void 0); - const re = new val.constructor(val.source, flags); - re.lastIndex = val.lastIndex; - return re; -} - -function cloneArrayBuffer(val) { - const res = new val.constructor(val.byteLength); - new Uint8Array(res).set(new Uint8Array(val)); - return res; -} - -function cloneTypedArray(val, deep) { - return new val.constructor(val.buffer, val.byteOffset, val.length); -} - -function cloneBuffer(val) { - const len = val.length; - const buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len); - val.copy(buf); - return buf; -} - -function cloneSymbol(val) { - return valueOf ? Object(valueOf.call(val)) : {}; -} - -/** - * Expose `clone` - */ - -module.exports = clone; diff --git a/node_modules/shallow-clone/package.json b/node_modules/shallow-clone/package.json deleted file mode 100644 index 91f281c..0000000 --- a/node_modules/shallow-clone/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "shallow-clone", - "description": "Creates a shallow clone of any JavaScript value.", - "version": "3.0.1", - "homepage": "https://github.com/jonschlinkert/shallow-clone", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "jonschlinkert/shallow-clone", - "bugs": { - "url": "https://github.com/jonschlinkert/shallow-clone/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "mocha" - }, - "dependencies": { - "kind-of": "^6.0.2" - }, - "devDependencies": { - "gulp-format-md": "^2.0.0", - "mocha": "^6.1.3" - }, - "keywords": [ - "array", - "clone", - "copy", - "extend", - "mixin", - "object", - "primitive", - "shallow" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "assign-deep", - "clone-deep", - "is-plain-object", - "kind-of" - ] - } - } -} diff --git a/node_modules/shebang-command/index.js b/node_modules/shebang-command/index.js deleted file mode 100644 index f35db30..0000000 --- a/node_modules/shebang-command/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -const shebangRegex = require('shebang-regex'); - -module.exports = (string = '') => { - const match = string.match(shebangRegex); - - if (!match) { - return null; - } - - const [path, argument] = match[0].replace(/#! ?/, '').split(' '); - const binary = path.split('/').pop(); - - if (binary === 'env') { - return argument; - } - - return argument ? `${binary} ${argument}` : binary; -}; diff --git a/node_modules/shebang-command/license b/node_modules/shebang-command/license deleted file mode 100644 index db6bc32..0000000 --- a/node_modules/shebang-command/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Kevin Mårtensson (github.com/kevva) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-command/package.json b/node_modules/shebang-command/package.json deleted file mode 100644 index 18e3c04..0000000 --- a/node_modules/shebang-command/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "shebang-command", - "version": "2.0.0", - "description": "Get the command from a shebang", - "license": "MIT", - "repository": "kevva/shebang-command", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "cmd", - "command", - "parse", - "shebang" - ], - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "devDependencies": { - "ava": "^2.3.0", - "xo": "^0.24.0" - } -} diff --git a/node_modules/shebang-command/readme.md b/node_modules/shebang-command/readme.md deleted file mode 100644 index 84feb44..0000000 --- a/node_modules/shebang-command/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) - -> Get the command from a shebang - - -## Install - -``` -$ npm install shebang-command -``` - - -## Usage - -```js -const shebangCommand = require('shebang-command'); - -shebangCommand('#!/usr/bin/env node'); -//=> 'node' - -shebangCommand('#!/bin/bash'); -//=> 'bash' -``` - - -## API - -### shebangCommand(string) - -#### string - -Type: `string` - -String containing a shebang. diff --git a/node_modules/shebang-regex/index.d.ts b/node_modules/shebang-regex/index.d.ts deleted file mode 100644 index 61d034b..0000000 --- a/node_modules/shebang-regex/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** -Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line. - -@example -``` -import shebangRegex = require('shebang-regex'); - -const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; - -shebangRegex.test(string); -//=> true - -shebangRegex.exec(string)[0]; -//=> '#!/usr/bin/env node' - -shebangRegex.exec(string)[1]; -//=> '/usr/bin/env node' -``` -*/ -declare const shebangRegex: RegExp; - -export = shebangRegex; diff --git a/node_modules/shebang-regex/index.js b/node_modules/shebang-regex/index.js deleted file mode 100644 index 63fc4a0..0000000 --- a/node_modules/shebang-regex/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = /^#!(.*)/; diff --git a/node_modules/shebang-regex/license b/node_modules/shebang-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/shebang-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-regex/package.json b/node_modules/shebang-regex/package.json deleted file mode 100644 index 00ab30f..0000000 --- a/node_modules/shebang-regex/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "shebang-regex", - "version": "3.0.0", - "description": "Regular expression for matching a shebang line", - "license": "MIT", - "repository": "sindresorhus/shebang-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "regex", - "regexp", - "shebang", - "match", - "test", - "line" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/shebang-regex/readme.md b/node_modules/shebang-regex/readme.md deleted file mode 100644 index 5ecf863..0000000 --- a/node_modules/shebang-regex/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) - -> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line - - -## Install - -``` -$ npm install shebang-regex -``` - - -## Usage - -```js -const shebangRegex = require('shebang-regex'); - -const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; - -shebangRegex.test(string); -//=> true - -shebangRegex.exec(string)[0]; -//=> '#!/usr/bin/env node' - -shebangRegex.exec(string)[1]; -//=> '/usr/bin/env node' -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/source-map-support/LICENSE.md b/node_modules/source-map-support/LICENSE.md deleted file mode 100644 index 6247ca9..0000000 --- a/node_modules/source-map-support/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Evan Wallace - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/source-map-support/README.md b/node_modules/source-map-support/README.md deleted file mode 100644 index 40228b7..0000000 --- a/node_modules/source-map-support/README.md +++ /dev/null @@ -1,284 +0,0 @@ -# Source Map Support -[![Build Status](https://travis-ci.org/evanw/node-source-map-support.svg?branch=master)](https://travis-ci.org/evanw/node-source-map-support) - -This module provides source map support for stack traces in node via the [V8 stack trace API](https://github.com/v8/v8/wiki/Stack-Trace-API). It uses the [source-map](https://github.com/mozilla/source-map) module to replace the paths and line numbers of source-mapped files with their original paths and line numbers. The output mimics node's stack trace format with the goal of making every compile-to-JS language more of a first-class citizen. Source maps are completely general (not specific to any one language) so you can use source maps with multiple compile-to-JS languages in the same node process. - -## Installation and Usage - -#### Node support - -``` -$ npm install source-map-support -``` - -Source maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, place a source mapping comment somewhere in the file (usually done automatically or with an option by your transpiler): - -``` -//# sourceMappingURL=path/to/source.map -``` - -If multiple sourceMappingURL comments exist in one file, the last sourceMappingURL comment will be -respected (e.g. if a file mentions the comment in code, or went through multiple transpilers). -The path should either be absolute or relative to the compiled file. - -From here you have two options. - -##### CLI Usage - -```bash -node -r source-map-support/register compiled.js -``` - -##### Programmatic Usage - -Put the following line at the top of the compiled file. - -```js -require('source-map-support').install(); -``` - -It is also possible to install the source map support directly by -requiring the `register` module which can be handy with ES6: - -```js -import 'source-map-support/register' - -// Instead of: -import sourceMapSupport from 'source-map-support' -sourceMapSupport.install() -``` -Note: if you're using babel-register, it includes source-map-support already. - -It is also very useful with Mocha: - -``` -$ mocha --require source-map-support/register tests/ -``` - -#### Browser support - -This library also works in Chrome. While the DevTools console already supports source maps, the V8 engine doesn't and `Error.prototype.stack` will be incorrect without this library. Everything will just work if you deploy your source files using [browserify](http://browserify.org/). Just make sure to pass the `--debug` flag to the browserify command so your source maps are included in the bundled code. - -This library also works if you use another build process or just include the source files directly. In this case, include the file `browser-source-map-support.js` in your page and call `sourceMapSupport.install()`. It contains the whole library already bundled for the browser using browserify. - -```html - - -``` - -This library also works if you use AMD (Asynchronous Module Definition), which is used in tools like [RequireJS](http://requirejs.org/). Just list `browser-source-map-support` as a dependency: - -```html - -``` - -## Options - -This module installs two things: a change to the `stack` property on `Error` objects and a handler for uncaught exceptions that mimics node's default exception handler (the handler can be seen in the demos below). You may want to disable the handler if you have your own uncaught exception handler. This can be done by passing an argument to the installer: - -```js -require('source-map-support').install({ - handleUncaughtExceptions: false -}); -``` - -This module loads source maps from the filesystem by default. You can provide alternate loading behavior through a callback as shown below. For example, [Meteor](https://github.com/meteor) keeps all source maps cached in memory to avoid disk access. - -```js -require('source-map-support').install({ - retrieveSourceMap: function(source) { - if (source === 'compiled.js') { - return { - url: 'original.js', - map: fs.readFileSync('compiled.js.map', 'utf8') - }; - } - return null; - } -}); -``` - -The module will by default assume a browser environment if XMLHttpRequest and window are defined. If either of these do not exist it will instead assume a node environment. -In some rare cases, e.g. when running a browser emulation and where both variables are also set, you can explictly specify the environment to be either 'browser' or 'node'. - -```js -require('source-map-support').install({ - environment: 'node' -}); -``` - -To support files with inline source maps, the `hookRequire` options can be specified, which will monitor all source files for inline source maps. - - -```js -require('source-map-support').install({ - hookRequire: true -}); -``` - -This monkey patches the `require` module loading chain, so is not enabled by default and is not recommended for any sort of production usage. - -## Demos - -#### Basic Demo - -original.js: - -```js -throw new Error('test'); // This is the original code -``` - -compiled.js: - -```js -require('source-map-support').install(); - -throw new Error('test'); // This is the compiled code -// The next line defines the sourceMapping. -//# sourceMappingURL=compiled.js.map -``` - -compiled.js.map: - -```json -{ - "version": 3, - "file": "compiled.js", - "sources": ["original.js"], - "names": [], - "mappings": ";;AAAA,MAAM,IAAI" -} -``` - -Run compiled.js using node (notice how the stack trace uses original.js instead of compiled.js): - -``` -$ node compiled.js - -original.js:1 -throw new Error('test'); // This is the original code - ^ -Error: test - at Object. (original.js:1:7) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### TypeScript Demo - -demo.ts: - -```typescript -declare function require(name: string); -require('source-map-support').install(); -class Foo { - constructor() { this.bar(); } - bar() { throw new Error('this is a demo'); } -} -new Foo(); -``` - -Compile and run the file using the TypeScript compiler from the terminal: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -There is also the option to use `-r source-map-support/register` with typescript, without the need add the `require('source-map-support').install()` in the code base: - -``` -$ npm install source-map-support typescript -$ node_modules/typescript/bin/tsc -sourcemap demo.ts -$ node -r source-map-support/register demo.js - -demo.ts:5 - bar() { throw new Error('this is a demo'); } - ^ -Error: this is a demo - at Foo.bar (demo.ts:5:17) - at new Foo (demo.ts:4:24) - at Object. (demo.ts:7:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) - at node.js:901:3 -``` - -#### CoffeeScript Demo - -demo.coffee: - -```coffee -require('source-map-support').install() -foo = -> - bar = -> throw new Error 'this is a demo' - bar() -foo() -``` - -Compile and run the file using the CoffeeScript compiler from the terminal: - -```sh -$ npm install source-map-support coffeescript -$ node_modules/.bin/coffee --map --compile demo.coffee -$ node demo.js - -demo.coffee:3 - bar = -> throw new Error 'this is a demo' - ^ -Error: this is a demo - at bar (demo.coffee:3:22) - at foo (demo.coffee:4:3) - at Object. (demo.coffee:5:1) - at Object. (demo.coffee:1:1) - at Module._compile (module.js:456:26) - at Object.Module._extensions..js (module.js:474:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Function.Module.runMain (module.js:497:10) - at startup (node.js:119:16) -``` - -## Tests - -This repo contains both automated tests for node and manual tests for the browser. The automated tests can be run using mocha (type `mocha` in the root directory). To run the manual tests: - -* Build the tests using `build.js` -* Launch the HTTP server (`npm run serve-tests`) and visit - * http://127.0.0.1:1336/amd-test - * http://127.0.0.1:1336/browser-test - * http://127.0.0.1:1336/browserify-test - **Currently not working** due to a bug with browserify (see [pull request #66](https://github.com/evanw/node-source-map-support/pull/66) for details). -* For `header-test`, run `server.js` inside that directory and visit http://127.0.0.1:1337/ - -## License - -This code is available under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/node_modules/source-map-support/browser-source-map-support.js b/node_modules/source-map-support/browser-source-map-support.js deleted file mode 100644 index 782da50..0000000 --- a/node_modules/source-map-support/browser-source-map-support.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Support for source maps in V8 stack traces - * https://github.com/evanw/node-source-map-support - */ -/* - The buffer module from node.js, for the browser. - - @author Feross Aboukhadijeh - license MIT -*/ -(this.define||function(R,U){this.sourceMapSupport=U()})("browser-source-map-support",function(R){(function e(C,J,A){function p(f,c){if(!J[f]){if(!C[f]){var l="function"==typeof require&&require;if(!c&&l)return l(f,!0);if(t)return t(f,!0);throw Error("Cannot find module '"+f+"'");}l=J[f]={exports:{}};C[f][0].call(l.exports,function(q){var r=C[f][1][q];return p(r?r:q)},l,l.exports,e,C,J,A)}return J[f].exports}for(var t="function"==typeof require&&require,m=0;mm)return-1;if(58>m)return m-48+52;if(91>m)return m-65;if(123>m)return m-97+26}var t="undefined"!==typeof Uint8Array?Uint8Array:Array;e.toByteArray=function(m){function f(d){q[k++]=d}if(0>16);f((u&65280)>>8);f(u&255)}2===l?(u=p(m.charAt(c))<<2|p(m.charAt(c+1))>>4,f(u&255)):1===l&&(u=p(m.charAt(c))<<10|p(m.charAt(c+1))<<4|p(m.charAt(c+2))>>2,f(u>>8&255),f(u&255));return q};e.fromByteArray=function(m){var f=m.length%3,c="",l;var q=0;for(l=m.length-f;q> -18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r&63);c+=r}switch(f){case 1:r=m[m.length-1];c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r<<4&63);c+="==";break;case 2:r=(m[m.length-2]<<8)+ -m[m.length-1],c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>10),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>4&63),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r<<2&63),c+="="}return c}})("undefined"===typeof A?this.base64js={}:A)},{}],3:[function(C,J,A){},{}],4:[function(C,J,A){(function(e){var p=Object.prototype.toString,t="function"===typeof e.alloc&&"function"===typeof e.allocUnsafe&&"function"=== -typeof e.from;J.exports=function(m,f,c){if("number"===typeof m)throw new TypeError('"value" argument must not be a number');if("ArrayBuffer"===p.call(m).slice(8,-1)){f>>>=0;var l=m.byteLength-f;if(0>l)throw new RangeError("'offset' is out of bounds");if(void 0===c)c=l;else if(c>>>=0,c>l)throw new RangeError("'length' is out of bounds");return t?e.from(m.slice(f,f+c)):new e(new Uint8Array(m.slice(f,f+c)))}if("string"===typeof m){c=f;if("string"!==typeof c||""===c)c="utf8";if(!e.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding'); -return t?e.from(m,c):new e(m,c)}return t?e.from(m):new e(m)}}).call(this,C("buffer").Buffer)},{buffer:5}],5:[function(C,J,A){function e(a,b,h){if(!(this instanceof e))return new e(a,b,h);var w=typeof a;if("number"===w)var y=0>>0:0;else if("string"===w){if("base64"===b)for(a=(a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")).replace(L,"");0!==a.length%4;)a+="=";y=e.byteLength(a,b)}else if("object"===w&&null!==a)"Buffer"===a.type&&z(a.data)&&(a=a.data),y=0<+a.length?Math.floor(+a.length):0;else throw new TypeError("must start with number, buffer, array or string"); -if(this.length>G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");if(e.TYPED_ARRAY_SUPPORT)var I=e._augment(new Uint8Array(y));else I=this,I.length=y,I._isBuffer=!0;if(e.TYPED_ARRAY_SUPPORT&&"number"===typeof a.byteLength)I._set(a);else{var K=a;if(z(K)||e.isBuffer(K)||K&&"object"===typeof K&&"number"===typeof K.length)if(e.isBuffer(a))for(b=0;ba)throw new RangeError("offset is not uint");if(a+b>h)throw new RangeError("Trying to access beyond buffer length");}function m(a,b,h,w,y,I){if(!e.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>y||ba.length)throw new TypeError("index out of range"); -}function f(a,b,h,w){0>b&&(b=65535+b+1);for(var y=0,I=Math.min(a.length-h,2);y>>8*(w?y:1-y)}function c(a,b,h,w){0>b&&(b=4294967295+b+1);for(var y=0,I=Math.min(a.length-h,4);y>>8*(w?y:3-y)&255}function l(a,b,h,w,y,I){if(b>y||ba.length)throw new TypeError("index out of range");}function q(a,b,h,w,y){y||l(a,b,h,4,3.4028234663852886E38,-3.4028234663852886E38);v.write(a,b,h,w,23,4);return h+4}function r(a, -b,h,w,y){y||l(a,b,h,8,1.7976931348623157E308,-1.7976931348623157E308);v.write(a,b,h,w,52,8);return h+8}function k(a){for(var b=[],h=0;h=w)b.push(w);else{var y=h;55296<=w&&57343>=w&&h++;w=encodeURIComponent(a.slice(y,h+1)).substr(1).split("%");for(y=0;y=b.length||y>=a.length);y++)b[y+ -h]=a[y];return y}function g(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}var n=C("base64-js"),v=C("ieee754"),z=C("is-array");A.Buffer=e;A.SlowBuffer=e;A.INSPECT_MAX_BYTES=50;e.poolSize=8192;var G=1073741823;e.TYPED_ARRAY_SUPPORT=function(){try{var a=new ArrayBuffer(0),b=new Uint8Array(a);b.foo=function(){return 42};return 42===b.foo()&&"function"===typeof b.subarray&&0===(new Uint8Array(1)).subarray(1,1).byteLength}catch(h){return!1}}();e.isBuffer=function(a){return!(null== -a||!a._isBuffer)};e.compare=function(a,b){if(!e.isBuffer(a)||!e.isBuffer(b))throw new TypeError("Arguments must be Buffers");for(var h=a.length,w=b.length,y=0,I=Math.min(h,w);y>>1;break;case "utf8":case "utf-8":h=k(a).length;break;case "base64":h=n.toByteArray(a).length; -break;default:h=a.length}return h};e.prototype.length=void 0;e.prototype.parent=void 0;e.prototype.toString=function(a,b,h){var w=!1;b>>>=0;h=void 0===h||Infinity===h?this.length:h>>>0;a||(a="utf8");0>b&&(b=0);h>this.length&&(h=this.length);if(h<=b)return"";for(;;)switch(a){case "hex":a=b;b=h;h=this.length;if(!a||0>a)a=0;if(!b||0>b||b>h)b=h;w="";for(h=a;hw?"0"+w.toString(16):w.toString(16),w=a+w;return w;case "utf8":case "utf-8":w=a="";for(h=Math.min(this.length,h);b= -this[b]?(a+=g(w)+String.fromCharCode(this[b]),w=""):w+="%"+this[b].toString(16);return a+g(w);case "ascii":return p(this,b,h);case "binary":return p(this,b,h);case "base64":return b=0===b&&h===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(b,h)),b;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":b=this.slice(b,h);h="";for(a=0;ab&&(a+=" ... "));return""};e.prototype.compare=function(a){if(!e.isBuffer(a))throw new TypeError("Argument must be a Buffer");return e.compare(this,a)};e.prototype.get=function(a){console.log(".get() is deprecated. Access using array indexes instead."); -return this.readUInt8(a)};e.prototype.set=function(a,b){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(a,b)};e.prototype.write=function(a,b,h,w){if(isFinite(b))isFinite(h)||(w=h,h=void 0);else{var y=w;w=b;b=h;h=y}b=Number(b)||0;y=this.length-b;h?(h=Number(h),h>y&&(h=y)):h=y;w=String(w||"utf8").toLowerCase();switch(w){case "hex":b=Number(b)||0;w=this.length-b;h?(h=Number(h),h>w&&(h=w)):h=w;w=a.length;if(0!==w%2)throw Error("Invalid hex string");h>w/ -2&&(h=w/2);for(w=0;w>8;K%=256;y.push(K);y.push(w)}a=d(y,this,b,h,2);break;default:throw new TypeError("Unknown encoding: "+ -w);}return a};e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};e.prototype.slice=function(a,b){var h=this.length;a=~~a;b=void 0===b?h:~~b;0>a?(a+=h,0>a&&(a=0)):a>h&&(a=h);0>b?(b+=h,0>b&&(b=0)):b>h&&(b=h);b>>=0;h||m(this,a,b,1,255,0);e.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a;return b+1};e.prototype.writeUInt16LE=function(a, -b,h){a=+a;b>>>=0;h||m(this,a,b,2,65535,0);e.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):f(this,a,b,!0);return b+2};e.prototype.writeUInt16BE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,2,65535,0);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):f(this,a,b,!1);return b+2};e.prototype.writeUInt32LE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,4,4294967295,0);e.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a):c(this,a,b,!0);return b+4};e.prototype.writeUInt32BE=function(a, -b,h){a=+a;b>>>=0;h||m(this,a,b,4,4294967295,0);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a):c(this,a,b,!1);return b+4};e.prototype.writeInt8=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,1,127,-128);e.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a;return b+1};e.prototype.writeInt16LE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,2,32767,-32768);e.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8):f(this,a,b,!0);return b+2};e.prototype.writeInt16BE=function(a, -b,h){a=+a;b>>>=0;h||m(this,a,b,2,32767,-32768);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a):f(this,a,b,!1);return b+2};e.prototype.writeInt32LE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,4,2147483647,-2147483648);e.TYPED_ARRAY_SUPPORT?(this[b]=a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):c(this,a,b,!0);return b+4};e.prototype.writeInt32BE=function(a,b,h){a=+a;b>>>=0;h||m(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);e.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+ -2]=a>>>8,this[b+3]=a):c(this,a,b,!1);return b+4};e.prototype.writeFloatLE=function(a,b,h){return q(this,a,b,!0,h)};e.prototype.writeFloatBE=function(a,b,h){return q(this,a,b,!1,h)};e.prototype.writeDoubleLE=function(a,b,h){return r(this,a,b,!0,h)};e.prototype.writeDoubleBE=function(a,b,h){return r(this,a,b,!1,h)};e.prototype.copy=function(a,b,h,w){h||(h=0);w||0===w||(w=this.length);b||(b=0);if(w!==h&&0!==a.length&&0!==this.length){if(wb||b>=a.length)throw new TypeError("targetStart out of bounds"); -if(0>h||h>=this.length)throw new TypeError("sourceStart out of bounds");if(0>w||w>this.length)throw new TypeError("sourceEnd out of bounds");w>this.length&&(w=this.length);a.length-bw||!e.TYPED_ARRAY_SUPPORT)for(var y=0;yb||b>=this.length)throw new TypeError("start out of bounds"); -if(0>h||h>this.length)throw new TypeError("end out of bounds");if("number"===typeof a)for(;b>1,r=-7;f=t?f-1:0;var k=t?-1:1,u=e[p+f];f+=k;t=u&(1<<-r)-1;u>>=-r;for(r+=c;0>=-r;for(r+=m;0>1,u=23===f?Math.pow(2,-24)-Math.pow(2,-77):0;c=m?0:c-1;var d=m?1:-1,g=0>p||0===p&&0>1/p?1:0;p=Math.abs(p);isNaN(p)||Infinity===p?(p=isNaN(p)?1:0,m=r):(m=Math.floor(Math.log(p)/Math.LN2),1>p*(l=Math.pow(2,-m))&&(m--,l*=2),p=1<=m+k?p+u/l:p+u*Math.pow(2,1-k),2<=p*l&&(m++,l/=2),m+k>=r?(p=0,m=r):1<=m+k?(p=(p*l-1)*Math.pow(2,f),m+=k):(p=p*Math.pow(2,k-1)*Math.pow(2,f),m=0));for(;8<=f;e[t+c]=p&255,c+= -d,p/=256,f-=8);m=m<z?[]:n.slice(v,z-v+1)}c=A.resolve(c).substr(1);l=A.resolve(l).substr(1); -for(var r=q(c.split("/")),k=q(l.split("/")),u=Math.min(r.length,k.length),d=u,g=0;gl&&(l=c.length+l);return c.substr(l,q)}}).call(this,C("g5I+bs"))},{"g5I+bs":9}],9:[function(C,J,A){function e(){}C=J.exports={};C.nextTick=function(){if("undefined"!==typeof window&&window.setImmediate)return function(t){return window.setImmediate(t)};if("undefined"!==typeof window&&window.postMessage&&window.addEventListener){var p=[];window.addEventListener("message",function(t){var m=t.source;m!==window&&null!== -m||"process-tick"!==t.data||(t.stopPropagation(),0p?(-p<<1)+1:p<<1;do p=m&31,m>>>=5,0=f)throw Error("Expected more digits in base 64 VLQ value.");var q=e.decode(p.charCodeAt(t++));if(-1===q)throw Error("Invalid base64 digit: "+p.charAt(t-1));var r=!!(q&32);q&=31;c+=q<>1;m.value=1===(c&1)?-p:p;m.rest=t}},{"./base64":12}],12:[function(C, -J,A){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");A.encode=function(p){if(0<=p&&p=p?p-65:97<=p&&122>=p?p-97+26:48<=p&&57>=p?p-48+52:43==p?62:47==p?63:-1}},{}],13:[function(C,J,A){function e(p,t,m,f,c,l){var q=Math.floor((t-p)/2)+p,r=c(m,f[q],!0);return 0===r?q:0p?-1:p}A.GREATEST_LOWER_BOUND=1;A.LEAST_UPPER_BOUND=2;A.search=function(p,t,m,f){if(0===t.length)return-1;p=e(-1,t.length,p,t,m,f||A.GREATEST_LOWER_BOUND);if(0>p)return-1;for(;0<=p-1&&0===m(t[p],t[p-1],!0);)--p;return p}},{}],14:[function(C,J,A){function e(){this._array=[];this._sorted=!0;this._last={generatedLine:-1,generatedColumn:0}}var p=C("./util");e.prototype.unsortedForEach=function(t,m){this._array.forEach(t,m)};e.prototype.add=function(t){var m=this._last,f=m.generatedLine, -c=t.generatedLine,l=m.generatedColumn,q=t.generatedColumn;c>f||c==f&&q>=l||0>=p.compareByGeneratedPositionsInflated(m,t)?this._last=t:this._sorted=!1;this._array.push(t)};e.prototype.toArray=function(){this._sorted||(this._array.sort(p.compareByGeneratedPositionsInflated),this._sorted=!0);return this._array};A.MappingList=e},{"./util":19}],15:[function(C,J,A){function e(t,m,f){var c=t[m];t[m]=t[f];t[f]=c}function p(t,m,f,c){if(f=m(t[r],q)&&(l+=1,e(t,l,r));e(t,l+1,r);l+=1;p(t,m,f,l-1);p(t,m,l+1,c)}}A.quickSort=function(t,m){p(t,m,0,t.length-1)}},{}],16:[function(C,J,A){function e(k,u){var d=k;"string"===typeof k&&(d=f.parseSourceMapInput(k));return null!=d.sections?new m(d,u):new p(d,u)}function p(k,u){var d=k;"string"===typeof k&&(d=f.parseSourceMapInput(k));var g=f.getArg(d,"version"),n=f.getArg(d,"sources"),v=f.getArg(d,"names",[]),z=f.getArg(d,"sourceRoot",null),G=f.getArg(d,"sourcesContent",null),D=f.getArg(d, -"mappings");d=f.getArg(d,"file",null);if(g!=this._version)throw Error("Unsupported version: "+g);z&&(z=f.normalize(z));n=n.map(String).map(f.normalize).map(function(L){return z&&f.isAbsolute(z)&&f.isAbsolute(L)?f.relative(z,L):L});this._names=l.fromArray(v.map(String),!0);this._sources=l.fromArray(n,!0);this.sourceRoot=z;this.sourcesContent=G;this._mappings=D;this._sourceMapURL=u;this.file=d}function t(){this.generatedColumn=this.generatedLine=0;this.name=this.originalColumn=this.originalLine=this.source= -null}function m(k,u){var d=k;"string"===typeof k&&(d=f.parseSourceMapInput(k));var g=f.getArg(d,"version");d=f.getArg(d,"sections");if(g!=this._version)throw Error("Unsupported version: "+g);this._sources=new l;this._names=new l;var n={line:-1,column:0};this._sections=d.map(function(v){if(v.url)throw Error("Support for url field in sections not implemented.");var z=f.getArg(v,"offset"),G=f.getArg(z,"line"),D=f.getArg(z,"column");if(G=k[d])throw new TypeError("Line must be greater than or equal to 1, got "+ -k[d]);if(0>k[g])throw new TypeError("Column must be greater than or equal to 0, got "+k[g]);return c.search(k,u,n,v)};p.prototype.computeColumnSpans=function(){for(var k=0;k=this._sources.size()&&!this.sourcesContent.some(function(k){return null==k}):!1};p.prototype.sourceContentFor=function(k,u){if(!this.sourcesContent)return null;var d=k;null!=this.sourceRoot&&(d=f.relative(this.sourceRoot,d));if(this._sources.has(d))return this.sourcesContent[this._sources.indexOf(d)]; -var g=this.sources,n;for(n=0;n -g||95!==d.charCodeAt(g-1)||95!==d.charCodeAt(g-2)||111!==d.charCodeAt(g-3)||116!==d.charCodeAt(g-4)||111!==d.charCodeAt(g-5)||114!==d.charCodeAt(g-6)||112!==d.charCodeAt(g-7)||95!==d.charCodeAt(g-8)||95!==d.charCodeAt(g-9))return!1;for(g-=10;0<=g;g--)if(36!==d.charCodeAt(g))return!1;return!0}function r(d,g){return d===g?0:null===d?1:null===g?-1:d>g?1:-1}A.getArg=function(d,g,n){if(g in d)return d[g];if(3===arguments.length)return n;throw Error('"'+g+'" is a required argument.');};var k=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/, -u=/^data:.+,.+$/;A.urlParse=e;A.urlGenerate=p;A.normalize=t;A.join=m;A.isAbsolute=function(d){return"/"===d.charAt(0)||k.test(d)};A.relative=function(d,g){""===d&&(d=".");d=d.replace(/\/$/,"");for(var n=0;0!==g.indexOf(d+"/");){var v=d.lastIndexOf("/");if(0>v)return g;d=d.slice(0,v);if(d.match(/^([^\/]+:\/)?\/*$/))return g;++n}return Array(n+1).join("../")+g.substr(d.length+1)};C=!("__proto__"in Object.create(null));A.toSetString=C?f:c;A.fromSetString=C?f:l;A.compareByOriginalPositions=function(d, -g,n){var v=r(d.source,g.source);if(0!==v)return v;v=d.originalLine-g.originalLine;if(0!==v)return v;v=d.originalColumn-g.originalColumn;if(0!==v||n)return v;v=d.generatedColumn-g.generatedColumn;if(0!==v)return v;v=d.generatedLine-g.generatedLine;return 0!==v?v:r(d.name,g.name)};A.compareByGeneratedPositionsDeflated=function(d,g,n){var v=d.generatedLine-g.generatedLine;if(0!==v)return v;v=d.generatedColumn-g.generatedColumn;if(0!==v||n)return v;v=r(d.source,g.source);if(0!==v)return v;v=d.originalLine- -g.originalLine;if(0!==v)return v;v=d.originalColumn-g.originalColumn;return 0!==v?v:r(d.name,g.name)};A.compareByGeneratedPositionsInflated=function(d,g){var n=d.generatedLine-g.generatedLine;if(0!==n)return n;n=d.generatedColumn-g.generatedColumn;if(0!==n)return n;n=r(d.source,g.source);if(0!==n)return n;n=d.originalLine-g.originalLine;if(0!==n)return n;n=d.originalColumn-g.originalColumn;return 0!==n?n:r(d.name,g.name)};A.parseSourceMapInput=function(d){return JSON.parse(d.replace(/^\)]}'[^\n]*\n/, -""))};A.computeSourceURL=function(d,g,n){g=g||"";d&&("/"!==d[d.length-1]&&"/"!==g[0]&&(d+="/"),g=d+g);if(n){d=e(n);if(!d)throw Error("sourceMapURL could not be parsed");d.path&&(n=d.path.lastIndexOf("/"),0<=n&&(d.path=d.path.substring(0,n+1)));g=m(p(d),g)}return t(g)}},{}],20:[function(C,J,A){A.SourceMapGenerator=C("./lib/source-map-generator").SourceMapGenerator;A.SourceMapConsumer=C("./lib/source-map-consumer").SourceMapConsumer;A.SourceNode=C("./lib/source-node").SourceNode},{"./lib/source-map-consumer":16, -"./lib/source-map-generator":17,"./lib/source-node":18}],21:[function(C,J,A){(function(e){function p(){return"browser"===a?!0:"node"===a?!1:"undefined"!==typeof window&&"function"===typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function t(x){return function(B){for(var F=0;F";B=this.getLineNumber();null!=B&&(x+=":"+B,(B= -this.getColumnNumber())&&(x+=":"+B))}B="";var F=this.getFunctionName(),E=!0,H=this.isConstructor();if(this.isToplevel()||H)H?B+="new "+(F||""):F?B+=F:(B+=x,E=!1);else{H=this.getTypeName();"[object Object]"===H&&(H="null");var M=this.getMethodName();F?(H&&0!=F.indexOf(H)&&(B+=H+"."),B+=F,M&&F.indexOf("."+M)!=F.length-M.length-1&&(B+=" [as "+M+"]")):B+=H+"."+(M||"")}E&&(B+=" ("+x+")");return B}function q(x){var B={};Object.getOwnPropertyNames(Object.getPrototypeOf(x)).forEach(function(F){B[F]= -/^(?:is|get)/.test(F)?function(){return x[F].call(x)}:x[F]});B.toString=l;return B}function r(x,B){void 0===B&&(B={nextPosition:null,curPosition:null});if(x.isNative())return B.curPosition=null,x;var F=x.getFileName()||x.getScriptNameOrSourceURL();if(F){var E=x.getLineNumber(),H=x.getColumnNumber()-1,M=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,S=M.test;var V="object"===typeof e&&null!==e?e.version:"";M=S.call(M,V)?0:62;1===E&&H>M&&!p()&&!x.isEval()&&(H-=M);var O= -f({source:F,line:E,column:H});B.curPosition=O;x=q(x);var T=x.getFunctionName;x.getFunctionName=function(){return null==B.nextPosition?T():B.nextPosition.name||T()};x.getFileName=function(){return O.source};x.getLineNumber=function(){return O.line};x.getColumnNumber=function(){return O.column+1};x.getScriptNameOrSourceURL=function(){return O.source};return x}var Q=x.isEval()&&x.getEvalOrigin();Q&&(Q=c(Q),x=q(x),x.getEvalOrigin=function(){return Q});return x}function k(x,B){L&&(b={},h={});for(var F= -(x.name||"Error")+": "+(x.message||""),E={nextPosition:null,curPosition:null},H=[],M=B.length-1;0<=M;M--)H.push("\n at "+r(B[M],E)),E.nextPosition=E.curPosition;E.curPosition=E.nextPosition=null;return F+H.reverse().join("")}function u(x){var B=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(x.stack);if(B){x=B[1];var F=+B[2];B=+B[3];var E=b[x];if(!E&&v&&v.existsSync(x))try{E=v.readFileSync(x,"utf8")}catch(H){E=""}if(E&&(E=E.split(/(?:\r\n|\r|\n)/)[F-1]))return x+":"+F+"\n"+E+"\n"+Array(B).join(" ")+ -"^"}return null}function d(){var x=e.emit;e.emit=function(B){if("uncaughtException"===B){var F=arguments[1]&&arguments[1].stack,E=0 C:/dir/file - '/'; // file:///root-dir/file -> /root-dir/file - }); - } - if (path in fileContentsCache) { - return fileContentsCache[path]; - } - - var contents = ''; - try { - if (!fs) { - // Use SJAX if we are in the browser - var xhr = new XMLHttpRequest(); - xhr.open('GET', path, /** async */ false); - xhr.send(null); - if (xhr.readyState === 4 && xhr.status === 200) { - contents = xhr.responseText; - } - } else if (fs.existsSync(path)) { - // Otherwise, use the filesystem - contents = fs.readFileSync(path, 'utf8'); - } - } catch (er) { - /* ignore any errors */ - } - - return fileContentsCache[path] = contents; -}); - -// Support URLs relative to a directory, but be careful about a protocol prefix -// in case we are in the browser (i.e. directories may start with "http://" or "file:///") -function supportRelativeURL(file, url) { - if (!file) return url; - var dir = path.dirname(file); - var match = /^\w+:\/\/[^\/]*/.exec(dir); - var protocol = match ? match[0] : ''; - var startPath = dir.slice(protocol.length); - if (protocol && /^\/\w\:/.test(startPath)) { - // handle file:///C:/ paths - protocol += '/'; - return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/'); - } - return protocol + path.resolve(dir.slice(protocol.length), url); -} - -function retrieveSourceMapURL(source) { - var fileData; - - if (isInBrowser()) { - try { - var xhr = new XMLHttpRequest(); - xhr.open('GET', source, false); - xhr.send(null); - fileData = xhr.readyState === 4 ? xhr.responseText : null; - - // Support providing a sourceMappingURL via the SourceMap header - var sourceMapHeader = xhr.getResponseHeader("SourceMap") || - xhr.getResponseHeader("X-SourceMap"); - if (sourceMapHeader) { - return sourceMapHeader; - } - } catch (e) { - } - } - - // Get the URL of the source map - fileData = retrieveFile(source); - var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg; - // Keep executing the search to find the *last* sourceMappingURL to avoid - // picking up sourceMappingURLs from comments, strings, etc. - var lastMatch, match; - while (match = re.exec(fileData)) lastMatch = match; - if (!lastMatch) return null; - return lastMatch[1]; -}; - -// Can be overridden by the retrieveSourceMap option to install. Takes a -// generated source filename; returns a {map, optional url} object, or null if -// there is no source map. The map field may be either a string or the parsed -// JSON object (ie, it must be a valid argument to the SourceMapConsumer -// constructor). -var retrieveSourceMap = handlerExec(retrieveMapHandlers); -retrieveMapHandlers.push(function(source) { - var sourceMappingURL = retrieveSourceMapURL(source); - if (!sourceMappingURL) return null; - - // Read the contents of the source map - var sourceMapData; - if (reSourceMap.test(sourceMappingURL)) { - // Support source map URL as a data url - var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1); - sourceMapData = bufferFrom(rawData, "base64").toString(); - sourceMappingURL = source; - } else { - // Support source map URLs relative to the source URL - sourceMappingURL = supportRelativeURL(source, sourceMappingURL); - sourceMapData = retrieveFile(sourceMappingURL); - } - - if (!sourceMapData) { - return null; - } - - return { - url: sourceMappingURL, - map: sourceMapData - }; -}); - -function mapSourcePosition(position) { - var sourceMap = sourceMapCache[position.source]; - if (!sourceMap) { - // Call the (overrideable) retrieveSourceMap function to get the source map. - var urlAndMap = retrieveSourceMap(position.source); - if (urlAndMap) { - sourceMap = sourceMapCache[position.source] = { - url: urlAndMap.url, - map: new SourceMapConsumer(urlAndMap.map) - }; - - // Load all sources stored inline with the source map into the file cache - // to pretend like they are already loaded. They may not exist on disk. - if (sourceMap.map.sourcesContent) { - sourceMap.map.sources.forEach(function(source, i) { - var contents = sourceMap.map.sourcesContent[i]; - if (contents) { - var url = supportRelativeURL(sourceMap.url, source); - fileContentsCache[url] = contents; - } - }); - } - } else { - sourceMap = sourceMapCache[position.source] = { - url: null, - map: null - }; - } - } - - // Resolve the source URL relative to the URL of the source map - if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') { - var originalPosition = sourceMap.map.originalPositionFor(position); - - // Only return the original position if a matching line was found. If no - // matching line is found then we return position instead, which will cause - // the stack trace to print the path and line for the compiled file. It is - // better to give a precise location in the compiled file than a vague - // location in the original file. - if (originalPosition.source !== null) { - originalPosition.source = supportRelativeURL( - sourceMap.url, originalPosition.source); - return originalPosition; - } - } - - return position; -} - -// Parses code generated by FormatEvalOrigin(), a function inside V8: -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js -function mapEvalOrigin(origin) { - // Most eval() calls are in this format - var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin); - if (match) { - var position = mapSourcePosition({ - source: match[2], - line: +match[3], - column: match[4] - 1 - }); - return 'eval at ' + match[1] + ' (' + position.source + ':' + - position.line + ':' + (position.column + 1) + ')'; - } - - // Parse nested eval() calls using recursion - match = /^eval at ([^(]+) \((.+)\)$/.exec(origin); - if (match) { - return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')'; - } - - // Make sure we still return useful information if we didn't find anything - return origin; -} - -// This is copied almost verbatim from the V8 source code at -// https://code.google.com/p/v8/source/browse/trunk/src/messages.js. The -// implementation of wrapCallSite() used to just forward to the actual source -// code of CallSite.prototype.toString but unfortunately a new release of V8 -// did something to the prototype chain and broke the shim. The only fix I -// could find was copy/paste. -function CallSiteToString() { - var fileName; - var fileLocation = ""; - if (this.isNative()) { - fileLocation = "native"; - } else { - fileName = this.getScriptNameOrSourceURL(); - if (!fileName && this.isEval()) { - fileLocation = this.getEvalOrigin(); - fileLocation += ", "; // Expecting source position to follow. - } - - if (fileName) { - fileLocation += fileName; - } else { - // Source code does not originate from a file and is not native, but we - // can still get the source position inside the source string, e.g. in - // an eval string. - fileLocation += ""; - } - var lineNumber = this.getLineNumber(); - if (lineNumber != null) { - fileLocation += ":" + lineNumber; - var columnNumber = this.getColumnNumber(); - if (columnNumber) { - fileLocation += ":" + columnNumber; - } - } - } - - var line = ""; - var functionName = this.getFunctionName(); - var addSuffix = true; - var isConstructor = this.isConstructor(); - var isMethodCall = !(this.isToplevel() || isConstructor); - if (isMethodCall) { - var typeName = this.getTypeName(); - // Fixes shim to be backward compatable with Node v0 to v4 - if (typeName === "[object Object]") { - typeName = "null"; - } - var methodName = this.getMethodName(); - if (functionName) { - if (typeName && functionName.indexOf(typeName) != 0) { - line += typeName + "."; - } - line += functionName; - if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) { - line += " [as " + methodName + "]"; - } - } else { - line += typeName + "." + (methodName || ""); - } - } else if (isConstructor) { - line += "new " + (functionName || ""); - } else if (functionName) { - line += functionName; - } else { - line += fileLocation; - addSuffix = false; - } - if (addSuffix) { - line += " (" + fileLocation + ")"; - } - return line; -} - -function cloneCallSite(frame) { - var object = {}; - Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) { - object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name]; - }); - object.toString = CallSiteToString; - return object; -} - -function wrapCallSite(frame, state) { - // provides interface backward compatibility - if (state === undefined) { - state = { nextPosition: null, curPosition: null } - } - if(frame.isNative()) { - state.curPosition = null; - return frame; - } - - // Most call sites will return the source file from getFileName(), but code - // passed to eval() ending in "//# sourceURL=..." will return the source file - // from getScriptNameOrSourceURL() instead - var source = frame.getFileName() || frame.getScriptNameOrSourceURL(); - if (source) { - var line = frame.getLineNumber(); - var column = frame.getColumnNumber() - 1; - - // Fix position in Node where some (internal) code is prepended. - // See https://github.com/evanw/node-source-map-support/issues/36 - // Header removed in node at ^10.16 || >=11.11.0 - // v11 is not an LTS candidate, we can just test the one version with it. - // Test node versions for: 10.16-19, 10.20+, 12-19, 20-99, 100+, or 11.11 - var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/; - var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62; - if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { - column -= headerLength; - } - - var position = mapSourcePosition({ - source: source, - line: line, - column: column - }); - state.curPosition = position; - frame = cloneCallSite(frame); - var originalFunctionName = frame.getFunctionName; - frame.getFunctionName = function() { - if (state.nextPosition == null) { - return originalFunctionName(); - } - return state.nextPosition.name || originalFunctionName(); - }; - frame.getFileName = function() { return position.source; }; - frame.getLineNumber = function() { return position.line; }; - frame.getColumnNumber = function() { return position.column + 1; }; - frame.getScriptNameOrSourceURL = function() { return position.source; }; - return frame; - } - - // Code called using eval() needs special handling - var origin = frame.isEval() && frame.getEvalOrigin(); - if (origin) { - origin = mapEvalOrigin(origin); - frame = cloneCallSite(frame); - frame.getEvalOrigin = function() { return origin; }; - return frame; - } - - // If we get here then we were unable to change the source position - return frame; -} - -// This function is part of the V8 stack trace API, for more info see: -// https://v8.dev/docs/stack-trace-api -function prepareStackTrace(error, stack) { - if (emptyCacheBetweenOperations) { - fileContentsCache = {}; - sourceMapCache = {}; - } - - var name = error.name || 'Error'; - var message = error.message || ''; - var errorString = name + ": " + message; - - var state = { nextPosition: null, curPosition: null }; - var processedStack = []; - for (var i = stack.length - 1; i >= 0; i--) { - processedStack.push('\n at ' + wrapCallSite(stack[i], state)); - state.nextPosition = state.curPosition; - } - state.curPosition = state.nextPosition = null; - return errorString + processedStack.reverse().join(''); -} - -// Generate position and snippet of original source with pointer -function getErrorSource(error) { - var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack); - if (match) { - var source = match[1]; - var line = +match[2]; - var column = +match[3]; - - // Support the inline sourceContents inside the source map - var contents = fileContentsCache[source]; - - // Support files on disk - if (!contents && fs && fs.existsSync(source)) { - try { - contents = fs.readFileSync(source, 'utf8'); - } catch (er) { - contents = ''; - } - } - - // Format the line from the original source code like node does - if (contents) { - var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; - if (code) { - return source + ':' + line + '\n' + code + '\n' + - new Array(column).join(' ') + '^'; - } - } - } - return null; -} - -function printErrorAndExit (error) { - var source = getErrorSource(error); - - // Ensure error is printed synchronously and not truncated - var stderr = globalProcessStderr(); - if (stderr && stderr._handle && stderr._handle.setBlocking) { - stderr._handle.setBlocking(true); - } - - if (source) { - console.error(); - console.error(source); - } - - console.error(error.stack); - globalProcessExit(1); -} - -function shimEmitUncaughtException () { - var origEmit = process.emit; - - process.emit = function (type) { - if (type === 'uncaughtException') { - var hasStack = (arguments[1] && arguments[1].stack); - var hasListeners = (this.listeners(type).length > 0); - - if (hasStack && !hasListeners) { - return printErrorAndExit(arguments[1]); - } - } - - return origEmit.apply(this, arguments); - }; -} - -var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0); -var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0); - -exports.wrapCallSite = wrapCallSite; -exports.getErrorSource = getErrorSource; -exports.mapSourcePosition = mapSourcePosition; -exports.retrieveSourceMap = retrieveSourceMap; - -exports.install = function(options) { - options = options || {}; - - if (options.environment) { - environment = options.environment; - if (["node", "browser", "auto"].indexOf(environment) === -1) { - throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}") - } - } - - // Allow sources to be found by methods other than reading the files - // directly from disk. - if (options.retrieveFile) { - if (options.overrideRetrieveFile) { - retrieveFileHandlers.length = 0; - } - - retrieveFileHandlers.unshift(options.retrieveFile); - } - - // Allow source maps to be found by methods other than reading the files - // directly from disk. - if (options.retrieveSourceMap) { - if (options.overrideRetrieveSourceMap) { - retrieveMapHandlers.length = 0; - } - - retrieveMapHandlers.unshift(options.retrieveSourceMap); - } - - // Support runtime transpilers that include inline source maps - if (options.hookRequire && !isInBrowser()) { - // Use dynamicRequire to avoid including in browser bundles - var Module = dynamicRequire(module, 'module'); - var $compile = Module.prototype._compile; - - if (!$compile.__sourceMapSupport) { - Module.prototype._compile = function(content, filename) { - fileContentsCache[filename] = content; - sourceMapCache[filename] = undefined; - return $compile.call(this, content, filename); - }; - - Module.prototype._compile.__sourceMapSupport = true; - } - } - - // Configure options - if (!emptyCacheBetweenOperations) { - emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ? - options.emptyCacheBetweenOperations : false; - } - - // Install the error reformatter - if (!errorFormatterInstalled) { - errorFormatterInstalled = true; - Error.prepareStackTrace = prepareStackTrace; - } - - if (!uncaughtShimInstalled) { - var installHandler = 'handleUncaughtExceptions' in options ? - options.handleUncaughtExceptions : true; - - // Do not override 'uncaughtException' with our own handler in Node.js - // Worker threads. Workers pass the error to the main thread as an event, - // rather than printing something to stderr and exiting. - try { - // We need to use `dynamicRequire` because `require` on it's own will be optimized by WebPack/Browserify. - var worker_threads = dynamicRequire(module, 'worker_threads'); - if (worker_threads.isMainThread === false) { - installHandler = false; - } - } catch(e) {} - - // Provide the option to not install the uncaught exception handler. This is - // to support other uncaught exception handlers (in test frameworks, for - // example). If this handler is not installed and there are no other uncaught - // exception handlers, uncaught exceptions will be caught by node's built-in - // exception handler and the process will still be terminated. However, the - // generated JavaScript code will be shown above the stack trace instead of - // the original source code. - if (installHandler && hasGlobalProcessEventEmitter()) { - uncaughtShimInstalled = true; - shimEmitUncaughtException(); - } - } -}; - -exports.resetRetrieveHandlers = function() { - retrieveFileHandlers.length = 0; - retrieveMapHandlers.length = 0; - - retrieveFileHandlers = originalRetrieveFileHandlers.slice(0); - retrieveMapHandlers = originalRetrieveMapHandlers.slice(0); - - retrieveSourceMap = handlerExec(retrieveMapHandlers); - retrieveFile = handlerExec(retrieveFileHandlers); -} diff --git a/node_modules/source-map/CHANGELOG.md b/node_modules/source-map/CHANGELOG.md deleted file mode 100644 index 3a8c066..0000000 --- a/node_modules/source-map/CHANGELOG.md +++ /dev/null @@ -1,301 +0,0 @@ -# Change Log - -## 0.5.6 - -* Fix for regression when people were using numbers as names in source maps. See - #236. - -## 0.5.5 - -* Fix "regression" of unsupported, implementation behavior that half the world - happens to have come to depend on. See #235. - -* Fix regression involving function hoisting in SpiderMonkey. See #233. - -## 0.5.4 - -* Large performance improvements to source-map serialization. See #228 and #229. - -## 0.5.3 - -* Do not include unnecessary distribution files. See - commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. - -## 0.5.2 - -* Include browser distributions of the library in package.json's `files`. See - issue #212. - -## 0.5.1 - -* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See - ff05274becc9e6e1295ed60f3ea090d31d843379. - -## 0.5.0 - -* Node 0.8 is no longer supported. - -* Use webpack instead of dryice for bundling. - -* Big speedups serializing source maps. See pull request #203. - -* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that - explicitly start with the source root. See issue #199. - -## 0.4.4 - -* Fix an issue where using a `SourceMapGenerator` after having created a - `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See - issue #191. - -* Fix an issue with where `SourceMapGenerator` would mistakenly consider - different mappings as duplicates of each other and avoid generating them. See - issue #192. - -## 0.4.3 - -* A very large number of performance improvements, particularly when parsing - source maps. Collectively about 75% of time shaved off of the source map - parsing benchmark! - -* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy - searching in the presence of a column option. See issue #177. - -* Fix a bug with joining a source and its source root when the source is above - the root. See issue #182. - -* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to - determine when all sources' contents are inlined into the source map. See - issue #190. - -## 0.4.2 - -* Add an `.npmignore` file so that the benchmarks aren't pulled down by - dependent projects. Issue #169. - -* Add an optional `column` argument to - `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines - with no mappings. Issues #172 and #173. - -## 0.4.1 - -* Fix accidentally defining a global variable. #170. - -## 0.4.0 - -* The default direction for fuzzy searching was changed back to its original - direction. See #164. - -* There is now a `bias` option you can supply to `SourceMapConsumer` to control - the fuzzy searching direction. See #167. - -* About an 8% speed up in parsing source maps. See #159. - -* Added a benchmark for parsing and generating source maps. - -## 0.3.0 - -* Change the default direction that searching for positions fuzzes when there is - not an exact match. See #154. - -* Support for environments using json2.js for JSON serialization. See #156. - -## 0.2.0 - -* Support for consuming "indexed" source maps which do not have any remote - sections. See pull request #127. This introduces a minor backwards - incompatibility if you are monkey patching `SourceMapConsumer.prototype` - methods. - -## 0.1.43 - -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue - #148 for some discussion and issues #150, #151, and #152 for implementations. - -## 0.1.42 - -* Fix an issue where `SourceNode`s from different versions of the source-map - library couldn't be used in conjunction with each other. See issue #142. - -## 0.1.41 - -* Fix a bug with getting the source content of relative sources with a "./" - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). - -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the - column span of each mapping. - -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find - all generated positions associated with a given original source and line. - -## 0.1.40 - -* Performance improvements for parsing source maps in SourceMapConsumer. - -## 0.1.39 - -* Fix a bug where setting a source's contents to null before any source content - had been set before threw a TypeError. See issue #131. - -## 0.1.38 - -* Fix a bug where finding relative paths from an empty path were creating - absolute paths. See issue #129. - -## 0.1.37 - -* Fix a bug where if the source root was an empty string, relative source paths - would turn into absolute source paths. Issue #124. - -## 0.1.36 - -* Allow the `names` mapping property to be an empty string. Issue #121. - -## 0.1.35 - -* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` - to specify a path that relative sources in the second parameter should be - relative to. Issue #105. - -* If no file property is given to a `SourceMapGenerator`, then the resulting - source map will no longer have a `null` file property. The property will - simply not exist. Issue #104. - -* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. - Issue #116. - -## 0.1.34 - -* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. - -* Fix bug involving source contents and the - `SourceMapGenerator.prototype.applySourceMap`. Issue #100. - -## 0.1.33 - -* Fix some edge cases surrounding path joining and URL resolution. - -* Add a third parameter for relative path to - `SourceMapGenerator.prototype.applySourceMap`. - -* Fix issues with mappings and EOLs. - -## 0.1.32 - -* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns - (issue 92). - -* Fixed test runner to actually report number of failed tests as its process - exit code. - -* Fixed a typo when reporting bad mappings (issue 87). - -## 0.1.31 - -* Delay parsing the mappings in SourceMapConsumer until queried for a source - location. - -* Support Sass source maps (which at the time of writing deviate from the spec - in small ways) in SourceMapConsumer. - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github issue 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. diff --git a/node_modules/source-map/LICENSE b/node_modules/source-map/LICENSE deleted file mode 100644 index ed1b7cf..0000000 --- a/node_modules/source-map/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/source-map/README.md b/node_modules/source-map/README.md deleted file mode 100644 index fea4beb..0000000 --- a/node_modules/source-map/README.md +++ /dev/null @@ -1,742 +0,0 @@ -# Source Map - -[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) - -[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) - -This is a library to generate and consume the source map format -[described here][format]. - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit - -## Use with Node - - $ npm install source-map - -## Use on the Web - - - --------------------------------------------------------------------------------- - - - - - -## Table of Contents - -- [Examples](#examples) - - [Consuming a source map](#consuming-a-source-map) - - [Generating a source map](#generating-a-source-map) - - [With SourceNode (high level API)](#with-sourcenode-high-level-api) - - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) -- [API](#api) - - [SourceMapConsumer](#sourcemapconsumer) - - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) - - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) - - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) - - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) - - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) - - [SourceMapGenerator](#sourcemapgenerator) - - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) - - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) - - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) - - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) - - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) - - [SourceNode](#sourcenode) - - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) - - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) - - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) - - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) - - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) - - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) - - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) - - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) - - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) - - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) - - - -## Examples - -### Consuming a source map - -```js -var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' -}; - -var smc = new SourceMapConsumer(rawSourceMap); - -console.log(smc.sources); -// [ 'http://example.com/www/js/one.js', -// 'http://example.com/www/js/two.js' ] - -console.log(smc.originalPositionFor({ - line: 2, - column: 28 -})); -// { source: 'http://example.com/www/js/two.js', -// line: 2, -// column: 10, -// name: 'n' } - -console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 -})); -// { line: 2, column: 28 } - -smc.eachMapping(function (m) { - // ... -}); -``` - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - -```js -function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } -} - -var ast = parse("40 + 2", "add.js"); -console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' -})); -// { code: '40 + 2', -// map: [object SourceMapGenerator] } -``` - -#### With SourceMapGenerator (low level API) - -```js -var map = new SourceMapGenerator({ - file: "source-mapped.js" -}); - -map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" -}); - -console.log(map.toString()); -// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' -``` - -## API - -Get a reference to the module: - -```js -// Node.js -var sourceMap = require('source-map'); - -// Browser builds -var sourceMap = window.sourceMap; - -// Inside Firefox -const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); -``` - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: Optional. The generated filename this source map is associated with. - -```js -var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -``` - -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - -```js -// Before: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] - -consumer.computeColumnSpans(); - -// After: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1, -// lastColumn: 9 }, -// { line: 2, -// column: 10, -// lastColumn: 19 }, -// { line: 2, -// column: 20, -// lastColumn: Infinity } ] - -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. Line numbers in - this library are 1-based (note that the underlying source map - specification uses 0-based line numbers -- this library handles the - translation). - -* `column`: The column number in the generated source. Column numbers - in this library are 0-based. - -* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or - `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest - element that is smaller than or greater than the one we are searching for, - respectively, if the exact element cannot be found. Defaults to - `SourceMapConsumer.GREATEST_LOWER_BOUND`. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. The line number is 1-based. - -* `column`: The column number in the original source, or null if this - information is not available. The column number is 0-based. - -* `name`: The original identifier, or null if this information is not available. - -```js -consumer.originalPositionFor({ line: 2, column: 10 }) -// { source: 'foo.coffee', -// line: 2, -// column: 2, -// name: null } - -consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) -// { source: null, -// line: null, -// column: null, -// name: null } -``` - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: The column number in the original source. The column - number is 0-based. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) -// { line: 1, -// column: 56 } -``` - -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source, line, -and column provided. If no column is provided, returns all mappings -corresponding to a either the line we are searching for or the next closest line -that has any mappings. Otherwise, returns all mappings corresponding to the -given line and either the column we are searching for or the next closest column -that has any offsets. - -The only argument is an object with the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: Optional. The column number in the original source. The - column number is 0-based. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] -``` - -#### SourceMapConsumer.prototype.hasContentsOfAllSources() - -Return true if we have the embedded source content for every source listed in -the source map, false otherwise. - -In other words, if this method returns `true`, then -`consumer.sourceContentFor(s)` will succeed for every source `s` in -`consumer.sources`. - -```js -// ... -if (consumer.hasContentsOfAllSources()) { - consumerReadyCallback(consumer); -} else { - fetchSources(consumer, consumerReadyCallback); -} -// ... -``` - -#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -If the source content for the given source is not found, then an error is -thrown. Optionally, pass `true` as the second param to have `null` returned -instead. - -```js -consumer.sources -// [ "my-cool-lib.clj" ] - -consumer.sourceContentFor("my-cool-lib.clj") -// "..." - -consumer.sourceContentFor("this is not in the source map"); -// Error: "this is not in the source map" is not in the source map - -consumer.sourceContentFor("this is not in the source map", true); -// null -``` - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -```js -consumer.eachMapping(function (m) { console.log(m); }) -// ... -// { source: 'illmatic.js', -// generatedLine: 1, -// generatedColumn: 0, -// originalLine: 1, -// originalColumn: 0, -// name: null } -// { source: 'illmatic.js', -// generatedLine: 2, -// generatedColumn: 0, -// originalLine: 2, -// originalColumn: 0, -// name: null } -// ... -``` -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator([startOfSourceMap]) - -You may pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: A root for all relative URLs in this source map. - -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -```js -generator.addMapping({ - source: "module-one.scm", - original: { line: 128, column: 0 }, - generated: { line: 3, column: 456 } -}) -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -```js -generator.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimum of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used, if it exists. - Otherwise an error will be thrown. - -* `sourceMapPath`: Optional. The dirname of the path to the SourceMap - to be applied. If relative, it is relative to the SourceMap. - - This parameter is needed when the two SourceMaps aren't in the same - directory, and the SourceMap to be applied contains relative source - paths. If so, those relative source paths need to be rewritten - relative to the SourceMap. - - If omitted, it is assumed that both SourceMaps are in the same directory, - thus not needing any rewriting. (Supplying `'.'` has the same effect.) - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -```js -generator.toString() -// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' -``` - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode([line, column, source[, chunk[, name]]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. The line number is 1-based. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. The column number - is 0-based. - -* `source`: The original source's filename; null if no filename is provided. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -```js -var node = new SourceNode(1, 2, "a.cpp", [ - new SourceNode(3, 4, "b.cpp", "extern int status;\n"), - new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), - new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), -]); -``` - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -* `relativePath` The optional path that relative sources in `sourceMapConsumer` - should be relative to. - -```js -var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); -var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), - consumer); -``` - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.add(" + "); -node.add(otherNode); -node.add([leftHandOperandNode, " + ", rightHandOperandNode]); -``` - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.prepend("/** Build Id: f783haef86324gf **/\n\n"); -``` - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -```js -node.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.walk(function (code, loc) { console.log("WALK:", code, loc); }) -// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } -// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } -// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } -// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } -``` - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -```js -var a = new SourceNode(1, 2, "a.js", "generated from a"); -a.setSourceContent("a.js", "original a"); -var b = new SourceNode(1, 2, "b.js", "generated from b"); -b.setSourceContent("b.js", "original b"); -var c = new SourceNode(1, 2, "c.js", "generated from c"); -c.setSourceContent("c.js", "original c"); - -var node = new SourceNode(null, null, null, [a, b, c]); -node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) -// WALK: a.js : original a -// WALK: b.js : original b -// WALK: c.js : original c -``` - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -```js -var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); -var operand = new SourceNode(3, 4, "a.rs", "="); -var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); - -var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); -var joinedNode = node.join(" "); -``` - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming white space from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -```js -// Trim trailing white space. -node.replaceRight(/\s*$/, ""); -``` - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toString() -// 'unodostresquatro' -``` - -#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toStringWithSourceMap({ file: "my-output-file.js" }) -// { code: 'unodostresquatro', -// map: [object SourceMapGenerator] } -``` diff --git a/node_modules/source-map/dist/source-map.debug.js b/node_modules/source-map/dist/source-map.debug.js deleted file mode 100644 index aad0620..0000000 --- a/node_modules/source-map/dist/source-map.debug.js +++ /dev/null @@ -1,3234 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0Lm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cbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBuZXh0ICs9ICcsJztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5nZW5lcmF0ZWRDb2x1bW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4pO1xuICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgaWYgKG1hcHBpbmcuc291cmNlICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlSWR4ID0gdGhpcy5fc291cmNlcy5pbmRleE9mKG1hcHBpbmcuc291cmNlKTtcbiAgICAgICAgbmV4dCArPSBiYXNlNjRWTFEuZW5jb2RlKHNvdXJjZUlkeCAtIHByZXZpb3VzU291cmNlKTtcbiAgICAgICAgcHJldmlvdXNTb3VyY2UgPSBzb3VyY2VJZHg7XG5cbiAgICAgICAgLy8gbGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkIGluIFNvdXJjZU1hcCBzcGVjIHZlcnNpb24gM1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbExpbmUgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNPcmlnaW5hbExpbmUpO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsTGluZSA9IG1hcHBpbmcub3JpZ2luYWxMaW5lIC0gMTtcblxuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29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nU2VwYXJhdG9yKGFTdHIsIGVuZCkpIHtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdHIgPSBhU3RyLnNsaWNlKGluZGV4LCBlbmQpO1xuXG4gICAgICAgIHNlZ21lbnQgPSBjYWNoZWRTZWdtZW50c1tzdHJdO1xuICAgICAgICBpZiAoc2VnbWVudCkge1xuICAgICAgICAgIGluZGV4ICs9IHN0ci5sZW5ndGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2VnbWVudCA9IFtdO1xuICAgICAgICAgIHdoaWxlIChpbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgYmFzZTY0VkxRLmRlY29kZShhU3RyLCBpbmRleCwgdGVtcCk7XG4gICAgICAgICAgICB2YWx1ZSA9IHRlbXAudmFsdWU7XG4gICAgICAgICAgICBpbmRleCA9IHRlbXAucmVzdDtcbiAgICAgICAgICAgIHNlZ21lbnQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAyKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlLCBidXQgbm8gbGluZSBhbmQgY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlIGFuZCBsaW5lLCBidXQgbm8gY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FjaGVkU2VnbWVudHNbc3RyXSA9IHNlZ21lbnQ7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZWQgY29sdW1uLlxuICAgICAgICBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbiA9IHByZXZpb3VzR2VuZXJhdGVkQ29sdW1uICsgc2VnbWVudFswXTtcbiAgICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291cmNlICs9IHNlZ21lbnRbMV07XG5cbiAgICAgICAgICAvLyBPcmlnaW5hbCBsaW5lLlxuICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxMaW5lID0gcHJldmlvdXNPcmlnaW5hbExpbmUgKyBzZWdtZW50WzJdO1xuICAgICAgICAgIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpbmU7XG4gICAgICAgICAgLy8gTGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkXG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbExpbmUgKz0gMTtcblxuICAgICAgICAgIC8vIE9yaWdpbmFsIGNvbHVtbi5cbiAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uID0gcHJldmlvdXNPcmlnaW5hbENvbHVtbiArIHNlZ21lbnRbM107XG4gICAgICAgICAgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IG1hcHBpbmcub3JpZ2luYWxDb2x1bW47XG5cbiAgICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAvLyBPcmlnaW5hbCBuYW1lLlxuICAgICAgICAgICAgbWFwcGluZy5uYW1lID0gcHJldmlvdXNOYW1lICsgc2VnbWVudFs0XTtcbiAgICAgICAgICAgIHByZXZpb3VzTmFtZSArPSBzZWdtZW50WzRdO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGdlbmVyYXRlZE1hcHBp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pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHNvdXJjZSA9IGFSZWxhdGl2ZVBhdGhcbiAgICAgICAgICA/IHV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBtYXBwaW5nLnNvdXJjZSlcbiAgICAgICAgICA6IG1hcHBpbmcuc291cmNlO1xuICAgICAgICBub2RlLmFkZChuZXcgU291cmNlTm9kZShtYXBwaW5nLm9yaWdpbmFsTGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5vcmlnaW5hbENvbHVtbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBwaW5nLm5hbWUpKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbi8qKlxuICogQWRkIGEgY2h1bmsgb2YgZ2VuZXJhdGVkIEpTIHRvIHRoaXMgc291cmNlIG5vZGUuXG4gKlxuICogQHBhcmFtIGFDaHVuayBBIHN0cmluZyBzbmlwcGV0IG9mIGdlbmVyYXRlZCBKUyBjb2RlLCBhbm90aGVyIGluc3RhbmNlIG9mXG4gKiAgICAgICAgU291cmNlTm9kZSwgb3IgYW4gYXJyYXkgd2hlcmUgZWFjaCBtZW1iZXIgaXMgb25lIG9mIHRob3NlIHRoaW5ncy5cbiAqL1xuU291cmNlTm9kZS5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gU291cmNlTm9kZV9hZGQoYUNodW5rKSB7XG4gIGlmIChBcnJheS5pc0FycmF5KGFDaHVuaykpIHtcbiAgICBhQ2h1bmsuZm9yRWFjaChmdW5jdGlvbiAoY2h1bmspIHtcbiAgICAgIHRoaXMuYWRkKGNodW5rKTtcbiAgICB9LCB0aGlzKTtcbiAgfVxuICBlbHNlIGlmIChhQ2h1bmtbaXNTb3VyY2VOb2RlXSB8fCB0eXBlb2YgYUN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ICAgICAgICBvcmlnaW5hbDoge1xuICAgICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgICBjb2x1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/node_modules/source-map/dist/source-map.js b/node_modules/source-map/dist/source-map.js deleted file mode 100644 index b4eb087..0000000 --- a/node_modules/source-map/dist/source-map.js +++ /dev/null @@ -1,3233 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["sourceMap"] = factory(); - else - root["sourceMap"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; - exports.SourceNode = __webpack_require__(10).SourceNode; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ = __webpack_require__(2); - var util = __webpack_require__(4); - var ArraySet = __webpack_require__(5).ArraySet; - var MappingList = __webpack_require__(6).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = __webpack_require__(3); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util = __webpack_require__(4); - var binarySearch = __webpack_require__(8); - var ArraySet = __webpack_require__(5).ArraySet; - var base64VLQ = __webpack_require__(2); - var quickSort = __webpack_require__(9).quickSort; - - function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - - /* -*- Mode: js; js-indent-level: 2; -*- */ - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; - var util = __webpack_require__(4); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - - -/***/ }) -/******/ ]) -}); -; \ No newline at end of file diff --git a/node_modules/source-map/dist/source-map.min.js b/node_modules/source-map/dist/source-map.min.js deleted file mode 100644 index c7c72da..0000000 --- a/node_modules/source-map/dist/source-map.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r 0 && aGenerated.column >= 0\n\t && !aOriginal && !aSource && !aName) {\n\t // Case 1.\n\t return;\n\t }\n\t else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n\t && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n\t && aGenerated.line > 0 && aGenerated.column >= 0\n\t && aOriginal.line > 0 && aOriginal.column >= 0\n\t && aSource) {\n\t // Cases 2 and 3.\n\t return;\n\t }\n\t else {\n\t throw new Error('Invalid mapping: ' + JSON.stringify({\n\t generated: aGenerated,\n\t source: aSource,\n\t original: aOriginal,\n\t name: aName\n\t }));\n\t }\n\t };\n\t\n\t/**\n\t * Serialize the accumulated mappings in to the stream of base 64 VLQs\n\t * specified by the source map format.\n\t */\n\tSourceMapGenerator.prototype._serializeMappings =\n\t function SourceMapGenerator_serializeMappings() {\n\t var previousGeneratedColumn = 0;\n\t var previousGeneratedLine = 1;\n\t var previousOriginalColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousName = 0;\n\t var previousSource = 0;\n\t var result = '';\n\t var next;\n\t var mapping;\n\t var nameIdx;\n\t var sourceIdx;\n\t\n\t var mappings = this._mappings.toArray();\n\t for (var i = 0, len = mappings.length; i < len; i++) {\n\t mapping = mappings[i];\n\t next = ''\n\t\n\t if (mapping.generatedLine !== previousGeneratedLine) {\n\t previousGeneratedColumn = 0;\n\t while (mapping.generatedLine !== previousGeneratedLine) {\n\t next += ';';\n\t previousGeneratedLine++;\n\t }\n\t }\n\t else {\n\t if (i > 0) {\n\t if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n\t continue;\n\t }\n\t next += ',';\n\t }\n\t }\n\t\n\t next += base64VLQ.encode(mapping.generatedColumn\n\t - previousGeneratedColumn);\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (mapping.source != null) {\n\t sourceIdx = this._sources.indexOf(mapping.source);\n\t next += base64VLQ.encode(sourceIdx - previousSource);\n\t previousSource = sourceIdx;\n\t\n\t // lines are stored 0-based in SourceMap spec version 3\n\t next += base64VLQ.encode(mapping.originalLine - 1\n\t - previousOriginalLine);\n\t previousOriginalLine = mapping.originalLine - 1;\n\t\n\t next += base64VLQ.encode(mapping.originalColumn\n\t - previousOriginalColumn);\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (mapping.name != null) {\n\t nameIdx = this._names.indexOf(mapping.name);\n\t next += base64VLQ.encode(nameIdx - previousName);\n\t previousName = nameIdx;\n\t }\n\t }\n\t\n\t result += next;\n\t }\n\t\n\t return result;\n\t };\n\t\n\tSourceMapGenerator.prototype._generateSourcesContent =\n\t function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n\t return aSources.map(function (source) {\n\t if (!this._sourcesContents) {\n\t return null;\n\t }\n\t if (aSourceRoot != null) {\n\t source = util.relative(aSourceRoot, source);\n\t }\n\t var key = util.toSetString(source);\n\t return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n\t ? this._sourcesContents[key]\n\t : null;\n\t }, this);\n\t };\n\t\n\t/**\n\t * Externalize the source map.\n\t */\n\tSourceMapGenerator.prototype.toJSON =\n\t function SourceMapGenerator_toJSON() {\n\t var map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\t\n\t return map;\n\t };\n\t\n\t/**\n\t * Render the source map being generated to a string.\n\t */\n\tSourceMapGenerator.prototype.toString =\n\t function SourceMapGenerator_toString() {\n\t return JSON.stringify(this.toJSON());\n\t };\n\t\n\texports.SourceMapGenerator = SourceMapGenerator;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t *\n\t * Based on the Base 64 VLQ implementation in Closure Compiler:\n\t * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n\t *\n\t * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * * Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t * * Neither the name of Google Inc. nor the names of its\n\t * contributors may be used to endorse or promote products derived\n\t * from this software without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\t * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\t * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\t * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\t * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\t * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\t * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\t * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\t * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t\n\tvar base64 = __webpack_require__(3);\n\t\n\t// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n\t// length quantities we use in the source map spec, the first bit is the sign,\n\t// the next four bits are the actual value, and the 6th bit is the\n\t// continuation bit. The continuation bit tells us whether there are more\n\t// digits in this value following this digit.\n\t//\n\t// Continuation\n\t// | Sign\n\t// | |\n\t// V V\n\t// 101011\n\t\n\tvar VLQ_BASE_SHIFT = 5;\n\t\n\t// binary: 100000\n\tvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\t\n\t// binary: 011111\n\tvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\t\n\t// binary: 100000\n\tvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\t\n\t/**\n\t * Converts from a two-complement value to a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n\t * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n\t */\n\tfunction toVLQSigned(aValue) {\n\t return aValue < 0\n\t ? ((-aValue) << 1) + 1\n\t : (aValue << 1) + 0;\n\t}\n\t\n\t/**\n\t * Converts to a two-complement value from a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n\t * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n\t */\n\tfunction fromVLQSigned(aValue) {\n\t var isNegative = (aValue & 1) === 1;\n\t var shifted = aValue >> 1;\n\t return isNegative\n\t ? -shifted\n\t : shifted;\n\t}\n\t\n\t/**\n\t * Returns the base 64 VLQ encoded value.\n\t */\n\texports.encode = function base64VLQ_encode(aValue) {\n\t var encoded = \"\";\n\t var digit;\n\t\n\t var vlq = toVLQSigned(aValue);\n\t\n\t do {\n\t digit = vlq & VLQ_BASE_MASK;\n\t vlq >>>= VLQ_BASE_SHIFT;\n\t if (vlq > 0) {\n\t // There are still more digits in this value, so we must make sure the\n\t // continuation bit is marked.\n\t digit |= VLQ_CONTINUATION_BIT;\n\t }\n\t encoded += base64.encode(digit);\n\t } while (vlq > 0);\n\t\n\t return encoded;\n\t};\n\t\n\t/**\n\t * Decodes the next base 64 VLQ value from the given string and returns the\n\t * value and the rest of the string via the out parameter.\n\t */\n\texports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n\t var strLen = aStr.length;\n\t var result = 0;\n\t var shift = 0;\n\t var continuation, digit;\n\t\n\t do {\n\t if (aIndex >= strLen) {\n\t throw new Error(\"Expected more digits in base 64 VLQ value.\");\n\t }\n\t\n\t digit = base64.decode(aStr.charCodeAt(aIndex++));\n\t if (digit === -1) {\n\t throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n\t }\n\t\n\t continuation = !!(digit & VLQ_CONTINUATION_BIT);\n\t digit &= VLQ_BASE_MASK;\n\t result = result + (digit << shift);\n\t shift += VLQ_BASE_SHIFT;\n\t } while (continuation);\n\t\n\t aOutParam.value = fromVLQSigned(result);\n\t aOutParam.rest = aIndex;\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\t\n\t/**\n\t * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n\t */\n\texports.encode = function (number) {\n\t if (0 <= number && number < intToCharMap.length) {\n\t return intToCharMap[number];\n\t }\n\t throw new TypeError(\"Must be between 0 and 63: \" + number);\n\t};\n\t\n\t/**\n\t * Decode a single base 64 character code digit to an integer. Returns -1 on\n\t * failure.\n\t */\n\texports.decode = function (charCode) {\n\t var bigA = 65; // 'A'\n\t var bigZ = 90; // 'Z'\n\t\n\t var littleA = 97; // 'a'\n\t var littleZ = 122; // 'z'\n\t\n\t var zero = 48; // '0'\n\t var nine = 57; // '9'\n\t\n\t var plus = 43; // '+'\n\t var slash = 47; // '/'\n\t\n\t var littleOffset = 26;\n\t var numberOffset = 52;\n\t\n\t // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\t if (bigA <= charCode && charCode <= bigZ) {\n\t return (charCode - bigA);\n\t }\n\t\n\t // 26 - 51: abcdefghijklmnopqrstuvwxyz\n\t if (littleA <= charCode && charCode <= littleZ) {\n\t return (charCode - littleA + littleOffset);\n\t }\n\t\n\t // 52 - 61: 0123456789\n\t if (zero <= charCode && charCode <= nine) {\n\t return (charCode - zero + numberOffset);\n\t }\n\t\n\t // 62: +\n\t if (charCode == plus) {\n\t return 62;\n\t }\n\t\n\t // 63: /\n\t if (charCode == slash) {\n\t return 63;\n\t }\n\t\n\t // Invalid base64 digit.\n\t return -1;\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t/**\n\t * This is a helper function for getting values from parameter/options\n\t * objects.\n\t *\n\t * @param args The object we are extracting values from\n\t * @param name The name of the property we are getting.\n\t * @param defaultValue An optional value to return if the property is missing\n\t * from the object. If this is not specified and the property is missing, an\n\t * error will be thrown.\n\t */\n\tfunction getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}\n\texports.getArg = getArg;\n\t\n\tvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\n\tvar dataUrlRegexp = /^data:.+\\,.+$/;\n\t\n\tfunction urlParse(aUrl) {\n\t var match = aUrl.match(urlRegexp);\n\t if (!match) {\n\t return null;\n\t }\n\t return {\n\t scheme: match[1],\n\t auth: match[2],\n\t host: match[3],\n\t port: match[4],\n\t path: match[5]\n\t };\n\t}\n\texports.urlParse = urlParse;\n\t\n\tfunction urlGenerate(aParsedUrl) {\n\t var url = '';\n\t if (aParsedUrl.scheme) {\n\t url += aParsedUrl.scheme + ':';\n\t }\n\t url += '//';\n\t if (aParsedUrl.auth) {\n\t url += aParsedUrl.auth + '@';\n\t }\n\t if (aParsedUrl.host) {\n\t url += aParsedUrl.host;\n\t }\n\t if (aParsedUrl.port) {\n\t url += \":\" + aParsedUrl.port\n\t }\n\t if (aParsedUrl.path) {\n\t url += aParsedUrl.path;\n\t }\n\t return url;\n\t}\n\texports.urlGenerate = urlGenerate;\n\t\n\t/**\n\t * Normalizes a path, or the path portion of a URL:\n\t *\n\t * - Replaces consecutive slashes with one slash.\n\t * - Removes unnecessary '.' parts.\n\t * - Removes unnecessary '/..' parts.\n\t *\n\t * Based on code in the Node.js 'path' core module.\n\t *\n\t * @param aPath The path or url to normalize.\n\t */\n\tfunction normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}\n\texports.normalize = normalize;\n\t\n\t/**\n\t * Joins two paths/URLs.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be joined with the root.\n\t *\n\t * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n\t * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n\t * first.\n\t * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n\t * is updated with the result and aRoot is returned. Otherwise the result\n\t * is returned.\n\t * - If aPath is absolute, the result is aPath.\n\t * - Otherwise the two paths are joined with a slash.\n\t * - Joining for example 'http://' and 'www.example.com' is also supported.\n\t */\n\tfunction join(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t if (aPath === \"\") {\n\t aPath = \".\";\n\t }\n\t var aPathUrl = urlParse(aPath);\n\t var aRootUrl = urlParse(aRoot);\n\t if (aRootUrl) {\n\t aRoot = aRootUrl.path || '/';\n\t }\n\t\n\t // `join(foo, '//www.example.org')`\n\t if (aPathUrl && !aPathUrl.scheme) {\n\t if (aRootUrl) {\n\t aPathUrl.scheme = aRootUrl.scheme;\n\t }\n\t return urlGenerate(aPathUrl);\n\t }\n\t\n\t if (aPathUrl || aPath.match(dataUrlRegexp)) {\n\t return aPath;\n\t }\n\t\n\t // `join('http://', 'www.example.com')`\n\t if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n\t aRootUrl.host = aPath;\n\t return urlGenerate(aRootUrl);\n\t }\n\t\n\t var joined = aPath.charAt(0) === '/'\n\t ? aPath\n\t : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\t\n\t if (aRootUrl) {\n\t aRootUrl.path = joined;\n\t return urlGenerate(aRootUrl);\n\t }\n\t return joined;\n\t}\n\texports.join = join;\n\t\n\texports.isAbsolute = function (aPath) {\n\t return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n\t};\n\t\n\t/**\n\t * Make a path relative to a URL or another path.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be made relative to aRoot.\n\t */\n\tfunction relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // It is possible for the path to be above the root. In this case, simply\n\t // checking whether the root is a prefix of the path won't work. Instead, we\n\t // need to remove components from the root one by one, until either we find\n\t // a prefix that fits, or we run out of components to remove.\n\t var level = 0;\n\t while (aPath.indexOf(aRoot + '/') !== 0) {\n\t var index = aRoot.lastIndexOf(\"/\");\n\t if (index < 0) {\n\t return aPath;\n\t }\n\t\n\t // If the only part of the root that is left is the scheme (i.e. http://,\n\t // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n\t // have exhausted all components, so the path is not relative to the root.\n\t aRoot = aRoot.slice(0, index);\n\t if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n\t return aPath;\n\t }\n\t\n\t ++level;\n\t }\n\t\n\t // Make sure we add a \"../\" for each component we removed from the root.\n\t return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n\t}\n\texports.relative = relative;\n\t\n\tvar supportsNullProto = (function () {\n\t var obj = Object.create(null);\n\t return !('__proto__' in obj);\n\t}());\n\t\n\tfunction identity (s) {\n\t return s;\n\t}\n\t\n\t/**\n\t * Because behavior goes wacky when you set `__proto__` on objects, we\n\t * have to prefix all the strings in our set with an arbitrary character.\n\t *\n\t * See https://github.com/mozilla/source-map/pull/31 and\n\t * https://github.com/mozilla/source-map/issues/30\n\t *\n\t * @param String aStr\n\t */\n\tfunction toSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return '$' + aStr;\n\t }\n\t\n\t return aStr;\n\t}\n\texports.toSetString = supportsNullProto ? identity : toSetString;\n\t\n\tfunction fromSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return aStr.slice(1);\n\t }\n\t\n\t return aStr;\n\t}\n\texports.fromSetString = supportsNullProto ? identity : fromSetString;\n\t\n\tfunction isProtoString(s) {\n\t if (!s) {\n\t return false;\n\t }\n\t\n\t var length = s.length;\n\t\n\t if (length < 9 /* \"__proto__\".length */) {\n\t return false;\n\t }\n\t\n\t if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n\t s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n\t s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n\t s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 9) !== 95 /* '_' */) {\n\t return false;\n\t }\n\t\n\t for (var i = length - 10; i >= 0; i--) {\n\t if (s.charCodeAt(i) !== 36 /* '$' */) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings where the original positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same original source/line/column, but different generated\n\t * line and column the same. Useful when searching for a mapping with a\n\t * stubbed out mapping.\n\t */\n\tfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n\t var cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0 || onlyCompareOriginal) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByOriginalPositions = compareByOriginalPositions;\n\t\n\t/**\n\t * Comparator between two mappings with deflated source and name indices where\n\t * the generated positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same generated line and column, but different\n\t * source/name/original line and column the same. Useful when searching for a\n\t * mapping with a stubbed out mapping.\n\t */\n\tfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0 || onlyCompareGenerated) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\t\n\tfunction strcmp(aStr1, aStr2) {\n\t if (aStr1 === aStr2) {\n\t return 0;\n\t }\n\t\n\t if (aStr1 === null) {\n\t return 1; // aStr2 !== null\n\t }\n\t\n\t if (aStr2 === null) {\n\t return -1; // aStr1 !== null\n\t }\n\t\n\t if (aStr1 > aStr2) {\n\t return 1;\n\t }\n\t\n\t return -1;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings with inflated source and name strings where\n\t * the generated positions are compared.\n\t */\n\tfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\t\n\t/**\n\t * Strip any JSON XSSI avoidance prefix from the string (as documented\n\t * in the source maps specification), and then parse the string as\n\t * JSON.\n\t */\n\tfunction parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}\n\texports.parseSourceMapInput = parseSourceMapInput;\n\t\n\t/**\n\t * Compute the URL of a source given the the source root, the source's\n\t * URL, and the source map's URL.\n\t */\n\tfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n\t sourceURL = sourceURL || '';\n\t\n\t if (sourceRoot) {\n\t // This follows what Chrome does.\n\t if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n\t sourceRoot += '/';\n\t }\n\t // The spec says:\n\t // Line 4: An optional source root, useful for relocating source\n\t // files on a server or removing repeated values in the\n\t // “sources” entry. This value is prepended to the individual\n\t // entries in the “source” field.\n\t sourceURL = sourceRoot + sourceURL;\n\t }\n\t\n\t // Historically, SourceMapConsumer did not take the sourceMapURL as\n\t // a parameter. This mode is still somewhat supported, which is why\n\t // this code block is conditional. However, it's preferable to pass\n\t // the source map URL to SourceMapConsumer, so that this function\n\t // can implement the source URL resolution algorithm as outlined in\n\t // the spec. This block is basically the equivalent of:\n\t // new URL(sourceURL, sourceMapURL).toString()\n\t // ... except it avoids using URL, which wasn't available in the\n\t // older releases of node still supported by this library.\n\t //\n\t // The spec says:\n\t // If the sources are not absolute URLs after prepending of the\n\t // “sourceRoot”, the sources are resolved relative to the\n\t // SourceMap (like resolving script src in a html document).\n\t if (sourceMapURL) {\n\t var parsed = urlParse(sourceMapURL);\n\t if (!parsed) {\n\t throw new Error(\"sourceMapURL could not be parsed\");\n\t }\n\t if (parsed.path) {\n\t // Strip the last path component, but keep the \"/\".\n\t var index = parsed.path.lastIndexOf('/');\n\t if (index >= 0) {\n\t parsed.path = parsed.path.substring(0, index + 1);\n\t }\n\t }\n\t sourceURL = join(urlGenerate(parsed), sourceURL);\n\t }\n\t\n\t return normalize(sourceURL);\n\t}\n\texports.computeSourceURL = computeSourceURL;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar hasNativeMap = typeof Map !== \"undefined\";\n\t\n\t/**\n\t * A data structure which is a combination of an array and a set. Adding a new\n\t * member is O(1), testing for membership is O(1), and finding the index of an\n\t * element is O(1). Removing elements from the set is not supported. Only\n\t * strings are supported for membership.\n\t */\n\tfunction ArraySet() {\n\t this._array = [];\n\t this._set = hasNativeMap ? new Map() : Object.create(null);\n\t}\n\t\n\t/**\n\t * Static method for creating ArraySet instances from an existing array.\n\t */\n\tArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n\t var set = new ArraySet();\n\t for (var i = 0, len = aArray.length; i < len; i++) {\n\t set.add(aArray[i], aAllowDuplicates);\n\t }\n\t return set;\n\t};\n\t\n\t/**\n\t * Return how many unique items are in this ArraySet. If duplicates have been\n\t * added, than those do not count towards the size.\n\t *\n\t * @returns Number\n\t */\n\tArraySet.prototype.size = function ArraySet_size() {\n\t return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n\t};\n\t\n\t/**\n\t * Add the given string to this set.\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n\t var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n\t var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n\t var idx = this._array.length;\n\t if (!isDuplicate || aAllowDuplicates) {\n\t this._array.push(aStr);\n\t }\n\t if (!isDuplicate) {\n\t if (hasNativeMap) {\n\t this._set.set(aStr, idx);\n\t } else {\n\t this._set[sStr] = idx;\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Is the given string a member of this set?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.has = function ArraySet_has(aStr) {\n\t if (hasNativeMap) {\n\t return this._set.has(aStr);\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t return has.call(this._set, sStr);\n\t }\n\t};\n\t\n\t/**\n\t * What is the index of the given string in the array?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n\t if (hasNativeMap) {\n\t var idx = this._set.get(aStr);\n\t if (idx >= 0) {\n\t return idx;\n\t }\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t if (has.call(this._set, sStr)) {\n\t return this._set[sStr];\n\t }\n\t }\n\t\n\t throw new Error('\"' + aStr + '\" is not in the set.');\n\t};\n\t\n\t/**\n\t * What is the element at the given index?\n\t *\n\t * @param Number aIdx\n\t */\n\tArraySet.prototype.at = function ArraySet_at(aIdx) {\n\t if (aIdx >= 0 && aIdx < this._array.length) {\n\t return this._array[aIdx];\n\t }\n\t throw new Error('No element indexed by ' + aIdx);\n\t};\n\t\n\t/**\n\t * Returns the array representation of this set (which has the proper indices\n\t * indicated by indexOf). Note that this is a copy of the internal array used\n\t * for storing the members so that no one can mess with internal state.\n\t */\n\tArraySet.prototype.toArray = function ArraySet_toArray() {\n\t return this._array.slice();\n\t};\n\t\n\texports.ArraySet = ArraySet;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2014 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\t\n\t/**\n\t * Determine whether mappingB is after mappingA with respect to generated\n\t * position.\n\t */\n\tfunction generatedPositionAfter(mappingA, mappingB) {\n\t // Optimized for most common case\n\t var lineA = mappingA.generatedLine;\n\t var lineB = mappingB.generatedLine;\n\t var columnA = mappingA.generatedColumn;\n\t var columnB = mappingB.generatedColumn;\n\t return lineB > lineA || lineB == lineA && columnB >= columnA ||\n\t util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n\t}\n\t\n\t/**\n\t * A data structure to provide a sorted view of accumulated mappings in a\n\t * performance conscious manner. It trades a neglibable overhead in general\n\t * case for a large speedup in case of mappings being added in order.\n\t */\n\tfunction MappingList() {\n\t this._array = [];\n\t this._sorted = true;\n\t // Serves as infimum\n\t this._last = {generatedLine: -1, generatedColumn: 0};\n\t}\n\t\n\t/**\n\t * Iterate through internal items. This method takes the same arguments that\n\t * `Array.prototype.forEach` takes.\n\t *\n\t * NOTE: The order of the mappings is NOT guaranteed.\n\t */\n\tMappingList.prototype.unsortedForEach =\n\t function MappingList_forEach(aCallback, aThisArg) {\n\t this._array.forEach(aCallback, aThisArg);\n\t };\n\t\n\t/**\n\t * Add the given source mapping.\n\t *\n\t * @param Object aMapping\n\t */\n\tMappingList.prototype.add = function MappingList_add(aMapping) {\n\t if (generatedPositionAfter(this._last, aMapping)) {\n\t this._last = aMapping;\n\t this._array.push(aMapping);\n\t } else {\n\t this._sorted = false;\n\t this._array.push(aMapping);\n\t }\n\t};\n\t\n\t/**\n\t * Returns the flat, sorted array of mappings. The mappings are sorted by\n\t * generated position.\n\t *\n\t * WARNING: This method returns internal data without copying, for\n\t * performance. The return value must NOT be mutated, and should be treated as\n\t * an immutable borrow. If you want to take ownership, you must make your own\n\t * copy.\n\t */\n\tMappingList.prototype.toArray = function MappingList_toArray() {\n\t if (!this._sorted) {\n\t this._array.sort(util.compareByGeneratedPositionsInflated);\n\t this._sorted = true;\n\t }\n\t return this._array;\n\t};\n\t\n\texports.MappingList = MappingList;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar binarySearch = __webpack_require__(8);\n\tvar ArraySet = __webpack_require__(5).ArraySet;\n\tvar base64VLQ = __webpack_require__(2);\n\tvar quickSort = __webpack_require__(9).quickSort;\n\t\n\tfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t return sourceMap.sections != null\n\t ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n\t : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n\t}\n\t\n\tSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n\t return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n\t}\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tSourceMapConsumer.prototype._version = 3;\n\t\n\t// `__generatedMappings` and `__originalMappings` are arrays that hold the\n\t// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n\t// are lazily instantiated, accessed via the `_generatedMappings` and\n\t// `_originalMappings` getters respectively, and we only parse the mappings\n\t// and create these arrays once queried for a source location. We jump through\n\t// these hoops because there can be many thousands of mappings, and parsing\n\t// them is expensive, so we only want to do it if we must.\n\t//\n\t// Each object in the arrays is of the form:\n\t//\n\t// {\n\t// generatedLine: The line number in the generated code,\n\t// generatedColumn: The column number in the generated code,\n\t// source: The path to the original source file that generated this\n\t// chunk of code,\n\t// originalLine: The line number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// originalColumn: The column number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// name: The name of the original symbol which generated this chunk of\n\t// code.\n\t// }\n\t//\n\t// All properties except for `generatedLine` and `generatedColumn` can be\n\t// `null`.\n\t//\n\t// `_generatedMappings` is ordered by the generated positions.\n\t//\n\t// `_originalMappings` is ordered by the original positions.\n\t\n\tSourceMapConsumer.prototype.__generatedMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__generatedMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__generatedMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype.__originalMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__originalMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__originalMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype._charIsMappingSeparator =\n\t function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n\t var c = aStr.charAt(index);\n\t return c === \";\" || c === \",\";\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t throw new Error(\"Subclasses must implement _parseMappings\");\n\t };\n\t\n\tSourceMapConsumer.GENERATED_ORDER = 1;\n\tSourceMapConsumer.ORIGINAL_ORDER = 2;\n\t\n\tSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\n\tSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Iterate over each mapping between an original source/line/column and a\n\t * generated line/column in this source map.\n\t *\n\t * @param Function aCallback\n\t * The function that is called with each mapping.\n\t * @param Object aContext\n\t * Optional. If specified, this object will be the value of `this` every\n\t * time that `aCallback` is called.\n\t * @param aOrder\n\t * Either `SourceMapConsumer.GENERATED_ORDER` or\n\t * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n\t * iterate over the mappings sorted by the generated file's line/column\n\t * order or the original's source/line/column order, respectively. Defaults to\n\t * `SourceMapConsumer.GENERATED_ORDER`.\n\t */\n\tSourceMapConsumer.prototype.eachMapping =\n\t function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n\t var context = aContext || null;\n\t var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\t\n\t var mappings;\n\t switch (order) {\n\t case SourceMapConsumer.GENERATED_ORDER:\n\t mappings = this._generatedMappings;\n\t break;\n\t case SourceMapConsumer.ORIGINAL_ORDER:\n\t mappings = this._originalMappings;\n\t break;\n\t default:\n\t throw new Error(\"Unknown order of iteration.\");\n\t }\n\t\n\t var sourceRoot = this.sourceRoot;\n\t mappings.map(function (mapping) {\n\t var source = mapping.source === null ? null : this._sources.at(mapping.source);\n\t source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n\t return {\n\t source: source,\n\t generatedLine: mapping.generatedLine,\n\t generatedColumn: mapping.generatedColumn,\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: mapping.name === null ? null : this._names.at(mapping.name)\n\t };\n\t }, this).forEach(aCallback, context);\n\t };\n\t\n\t/**\n\t * Returns all generated line and column information for the original source,\n\t * line, and column provided. If no column is provided, returns all mappings\n\t * corresponding to a either the line we are searching for or the next\n\t * closest line that has any mappings. Otherwise, returns all mappings\n\t * corresponding to the given line and either the column we are searching for\n\t * or the next closest column that has any offsets.\n\t *\n\t * The only argument is an object with the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number is 1-based.\n\t * - column: Optional. the column number in the original source.\n\t * The column number is 0-based.\n\t *\n\t * and an array of objects is returned, each with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tSourceMapConsumer.prototype.allGeneratedPositionsFor =\n\t function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n\t var line = util.getArg(aArgs, 'line');\n\t\n\t // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n\t // returns the index of the closest mapping less than the needle. By\n\t // setting needle.originalColumn to 0, we thus find the last mapping for\n\t // the given line, provided such a mapping exists.\n\t var needle = {\n\t source: util.getArg(aArgs, 'source'),\n\t originalLine: line,\n\t originalColumn: util.getArg(aArgs, 'column', 0)\n\t };\n\t\n\t needle.source = this._findSourceIndex(needle.source);\n\t if (needle.source < 0) {\n\t return [];\n\t }\n\t\n\t var mappings = [];\n\t\n\t var index = this._findMapping(needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t binarySearch.LEAST_UPPER_BOUND);\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (aArgs.column === undefined) {\n\t var originalLine = mapping.originalLine;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we found. Since\n\t // mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we found.\n\t while (mapping && mapping.originalLine === originalLine) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t } else {\n\t var originalColumn = mapping.originalColumn;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we were searching for.\n\t // Since mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we are searching for.\n\t while (mapping &&\n\t mapping.originalLine === line &&\n\t mapping.originalColumn == originalColumn) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t }\n\t }\n\t\n\t return mappings;\n\t };\n\t\n\texports.SourceMapConsumer = SourceMapConsumer;\n\t\n\t/**\n\t * A BasicSourceMapConsumer instance represents a parsed source map which we can\n\t * query for information about the original file positions by giving it a file\n\t * position in the generated source.\n\t *\n\t * The first parameter is the raw source map (either as a JSON string, or\n\t * already parsed to an object). According to the spec, source maps have the\n\t * following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - sources: An array of URLs to the original source files.\n\t * - names: An array of identifiers which can be referrenced by individual mappings.\n\t * - sourceRoot: Optional. The URL root from which all sources are relative.\n\t * - sourcesContent: Optional. An array of contents of the original source files.\n\t * - mappings: A string of base64 VLQs which contain the actual mappings.\n\t * - file: Optional. The generated file this source map is associated with.\n\t *\n\t * Here is an example source map, taken from the source map spec[0]:\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"out.js\",\n\t * sourceRoot : \"\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AA,AB;;ABCDE;\"\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n\t */\n\tfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sources = util.getArg(sourceMap, 'sources');\n\t // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n\t // requires the array) to play nice here.\n\t var names = util.getArg(sourceMap, 'names', []);\n\t var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n\t var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n\t var mappings = util.getArg(sourceMap, 'mappings');\n\t var file = util.getArg(sourceMap, 'file', null);\n\t\n\t // Once again, Sass deviates from the spec and supplies the version as a\n\t // string rather than a number, so we use loose equality checking here.\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t if (sourceRoot) {\n\t sourceRoot = util.normalize(sourceRoot);\n\t }\n\t\n\t sources = sources\n\t .map(String)\n\t // Some source maps produce relative source paths like \"./foo.js\" instead of\n\t // \"foo.js\". Normalize these first so that future comparisons will succeed.\n\t // See bugzil.la/1090768.\n\t .map(util.normalize)\n\t // Always ensure that absolute sources are internally stored relative to\n\t // the source root, if the source root is absolute. Not doing this would\n\t // be particularly problematic when the source root is a prefix of the\n\t // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n\t .map(function (source) {\n\t return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n\t ? util.relative(sourceRoot, source)\n\t : source;\n\t });\n\t\n\t // Pass `true` below to allow duplicate names and sources. While source maps\n\t // are intended to be compressed and deduplicated, the TypeScript compiler\n\t // sometimes generates source maps with duplicates in them. See Github issue\n\t // #72 and bugzil.la/889492.\n\t this._names = ArraySet.fromArray(names.map(String), true);\n\t this._sources = ArraySet.fromArray(sources, true);\n\t\n\t this._absoluteSources = this._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t this.sourceRoot = sourceRoot;\n\t this.sourcesContent = sourcesContent;\n\t this._mappings = mappings;\n\t this._sourceMapURL = aSourceMapURL;\n\t this.file = file;\n\t}\n\t\n\tBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\t\n\t/**\n\t * Utility function to find the index of a source. Returns -1 if not\n\t * found.\n\t */\n\tBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t if (this._sources.has(relativeSource)) {\n\t return this._sources.indexOf(relativeSource);\n\t }\n\t\n\t // Maybe aSource is an absolute URL as returned by |sources|. In\n\t // this case we can't simply undo the transform.\n\t var i;\n\t for (i = 0; i < this._absoluteSources.length; ++i) {\n\t if (this._absoluteSources[i] == aSource) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t};\n\t\n\t/**\n\t * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n\t *\n\t * @param SourceMapGenerator aSourceMap\n\t * The source map that will be consumed.\n\t * @param String aSourceMapURL\n\t * The URL at which the source map can be found (optional)\n\t * @returns BasicSourceMapConsumer\n\t */\n\tBasicSourceMapConsumer.fromSourceMap =\n\t function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n\t var smc = Object.create(BasicSourceMapConsumer.prototype);\n\t\n\t var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n\t var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n\t smc.sourceRoot = aSourceMap._sourceRoot;\n\t smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n\t smc.sourceRoot);\n\t smc.file = aSourceMap._file;\n\t smc._sourceMapURL = aSourceMapURL;\n\t smc._absoluteSources = smc._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t // Because we are modifying the entries (by converting string sources and\n\t // names to indices into the sources and names ArraySets), we have to make\n\t // a copy of the entry or else bad things happen. Shared mutable state\n\t // strikes again! See github issue #191.\n\t\n\t var generatedMappings = aSourceMap._mappings.toArray().slice();\n\t var destGeneratedMappings = smc.__generatedMappings = [];\n\t var destOriginalMappings = smc.__originalMappings = [];\n\t\n\t for (var i = 0, length = generatedMappings.length; i < length; i++) {\n\t var srcMapping = generatedMappings[i];\n\t var destMapping = new Mapping;\n\t destMapping.generatedLine = srcMapping.generatedLine;\n\t destMapping.generatedColumn = srcMapping.generatedColumn;\n\t\n\t if (srcMapping.source) {\n\t destMapping.source = sources.indexOf(srcMapping.source);\n\t destMapping.originalLine = srcMapping.originalLine;\n\t destMapping.originalColumn = srcMapping.originalColumn;\n\t\n\t if (srcMapping.name) {\n\t destMapping.name = names.indexOf(srcMapping.name);\n\t }\n\t\n\t destOriginalMappings.push(destMapping);\n\t }\n\t\n\t destGeneratedMappings.push(destMapping);\n\t }\n\t\n\t quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\t\n\t return smc;\n\t };\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tBasicSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t return this._absoluteSources.slice();\n\t }\n\t});\n\t\n\t/**\n\t * Provide the JIT with a nice shape / hidden class.\n\t */\n\tfunction Mapping() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tBasicSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t var generatedLine = 1;\n\t var previousGeneratedColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousOriginalColumn = 0;\n\t var previousSource = 0;\n\t var previousName = 0;\n\t var length = aStr.length;\n\t var index = 0;\n\t var cachedSegments = {};\n\t var temp = {};\n\t var originalMappings = [];\n\t var generatedMappings = [];\n\t var mapping, str, segment, end, value;\n\t\n\t while (index < length) {\n\t if (aStr.charAt(index) === ';') {\n\t generatedLine++;\n\t index++;\n\t previousGeneratedColumn = 0;\n\t }\n\t else if (aStr.charAt(index) === ',') {\n\t index++;\n\t }\n\t else {\n\t mapping = new Mapping();\n\t mapping.generatedLine = generatedLine;\n\t\n\t // Because each offset is encoded relative to the previous one,\n\t // many segments often have the same encoding. We can exploit this\n\t // fact by caching the parsed variable length fields of each segment,\n\t // allowing us to avoid a second parse if we encounter the same\n\t // segment again.\n\t for (end = index; end < length; end++) {\n\t if (this._charIsMappingSeparator(aStr, end)) {\n\t break;\n\t }\n\t }\n\t str = aStr.slice(index, end);\n\t\n\t segment = cachedSegments[str];\n\t if (segment) {\n\t index += str.length;\n\t } else {\n\t segment = [];\n\t while (index < end) {\n\t base64VLQ.decode(aStr, index, temp);\n\t value = temp.value;\n\t index = temp.rest;\n\t segment.push(value);\n\t }\n\t\n\t if (segment.length === 2) {\n\t throw new Error('Found a source, but no line and column');\n\t }\n\t\n\t if (segment.length === 3) {\n\t throw new Error('Found a source and line, but no column');\n\t }\n\t\n\t cachedSegments[str] = segment;\n\t }\n\t\n\t // Generated column.\n\t mapping.generatedColumn = previousGeneratedColumn + segment[0];\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (segment.length > 1) {\n\t // Original source.\n\t mapping.source = previousSource + segment[1];\n\t previousSource += segment[1];\n\t\n\t // Original line.\n\t mapping.originalLine = previousOriginalLine + segment[2];\n\t previousOriginalLine = mapping.originalLine;\n\t // Lines are stored 0-based\n\t mapping.originalLine += 1;\n\t\n\t // Original column.\n\t mapping.originalColumn = previousOriginalColumn + segment[3];\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (segment.length > 4) {\n\t // Original name.\n\t mapping.name = previousName + segment[4];\n\t previousName += segment[4];\n\t }\n\t }\n\t\n\t generatedMappings.push(mapping);\n\t if (typeof mapping.originalLine === 'number') {\n\t originalMappings.push(mapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t this.__generatedMappings = generatedMappings;\n\t\n\t quickSort(originalMappings, util.compareByOriginalPositions);\n\t this.__originalMappings = originalMappings;\n\t };\n\t\n\t/**\n\t * Find the mapping that best matches the hypothetical \"needle\" mapping that\n\t * we are searching for in the given \"haystack\" of mappings.\n\t */\n\tBasicSourceMapConsumer.prototype._findMapping =\n\t function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n\t aColumnName, aComparator, aBias) {\n\t // To return the position we are searching for, we must first find the\n\t // mapping for the given position and then return the opposite position it\n\t // points to. Because the mappings are sorted, we can use binary search to\n\t // find the best mapping.\n\t\n\t if (aNeedle[aLineName] <= 0) {\n\t throw new TypeError('Line must be greater than or equal to 1, got '\n\t + aNeedle[aLineName]);\n\t }\n\t if (aNeedle[aColumnName] < 0) {\n\t throw new TypeError('Column must be greater than or equal to 0, got '\n\t + aNeedle[aColumnName]);\n\t }\n\t\n\t return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n\t };\n\t\n\t/**\n\t * Compute the last column for each generated mapping. The last column is\n\t * inclusive.\n\t */\n\tBasicSourceMapConsumer.prototype.computeColumnSpans =\n\t function SourceMapConsumer_computeColumnSpans() {\n\t for (var index = 0; index < this._generatedMappings.length; ++index) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t // Mappings do not contain a field for the last generated columnt. We\n\t // can come up with an optimistic estimate, however, by assuming that\n\t // mappings are contiguous (i.e. given two consecutive mappings, the\n\t // first mapping ends where the second one starts).\n\t if (index + 1 < this._generatedMappings.length) {\n\t var nextMapping = this._generatedMappings[index + 1];\n\t\n\t if (mapping.generatedLine === nextMapping.generatedLine) {\n\t mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n\t continue;\n\t }\n\t }\n\t\n\t // The last mapping for each line spans the entire line.\n\t mapping.lastGeneratedColumn = Infinity;\n\t }\n\t };\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.originalPositionFor =\n\t function SourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._generatedMappings,\n\t \"generatedLine\",\n\t \"generatedColumn\",\n\t util.compareByGeneratedPositionsDeflated,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t if (mapping.generatedLine === needle.generatedLine) {\n\t var source = util.getArg(mapping, 'source', null);\n\t if (source !== null) {\n\t source = this._sources.at(source);\n\t source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n\t }\n\t var name = util.getArg(mapping, 'name', null);\n\t if (name !== null) {\n\t name = this._names.at(name);\n\t }\n\t return {\n\t source: source,\n\t line: util.getArg(mapping, 'originalLine', null),\n\t column: util.getArg(mapping, 'originalColumn', null),\n\t name: name\n\t };\n\t }\n\t }\n\t\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function BasicSourceMapConsumer_hasContentsOfAllSources() {\n\t if (!this.sourcesContent) {\n\t return false;\n\t }\n\t return this.sourcesContent.length >= this._sources.size() &&\n\t !this.sourcesContent.some(function (sc) { return sc == null; });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tBasicSourceMapConsumer.prototype.sourceContentFor =\n\t function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t if (!this.sourcesContent) {\n\t return null;\n\t }\n\t\n\t var index = this._findSourceIndex(aSource);\n\t if (index >= 0) {\n\t return this.sourcesContent[index];\n\t }\n\t\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t var url;\n\t if (this.sourceRoot != null\n\t && (url = util.urlParse(this.sourceRoot))) {\n\t // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n\t // many users. We can help them out when they expect file:// URIs to\n\t // behave like it would if they were running a local HTTP server. See\n\t // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n\t var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n\t if (url.scheme == \"file\"\n\t && this._sources.has(fileUriAbsPath)) {\n\t return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n\t }\n\t\n\t if ((!url.path || url.path == \"/\")\n\t && this._sources.has(\"/\" + relativeSource)) {\n\t return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n\t }\n\t }\n\t\n\t // This function is used recursively from\n\t // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n\t // don't want to throw if we can't find the source - we just want to\n\t // return null, so we provide a flag to exit gracefully.\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tBasicSourceMapConsumer.prototype.generatedPositionFor =\n\t function SourceMapConsumer_generatedPositionFor(aArgs) {\n\t var source = util.getArg(aArgs, 'source');\n\t source = this._findSourceIndex(source);\n\t if (source < 0) {\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t }\n\t\n\t var needle = {\n\t source: source,\n\t originalLine: util.getArg(aArgs, 'line'),\n\t originalColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (mapping.source === needle.source) {\n\t return {\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t };\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t };\n\t\n\texports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\t\n\t/**\n\t * An IndexedSourceMapConsumer instance represents a parsed source map which\n\t * we can query for information. It differs from BasicSourceMapConsumer in\n\t * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n\t * input.\n\t *\n\t * The first parameter is a raw source map (either as a JSON string, or already\n\t * parsed to an object). According to the spec for indexed source maps, they\n\t * have the following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - file: Optional. The generated file this source map is associated with.\n\t * - sections: A list of section definitions.\n\t *\n\t * Each value under the \"sections\" field has two fields:\n\t * - offset: The offset into the original specified at which this section\n\t * begins to apply, defined as an object with a \"line\" and \"column\"\n\t * field.\n\t * - map: A source map definition. This source map could also be indexed,\n\t * but doesn't have to be.\n\t *\n\t * Instead of the \"map\" field, it's also possible to have a \"url\" field\n\t * specifying a URL to retrieve a source map from, but that's currently\n\t * unsupported.\n\t *\n\t * Here's an example source map, taken from the source map spec[0], but\n\t * modified to omit a section which uses the \"url\" field.\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"app.js\",\n\t * sections: [{\n\t * offset: {line:100, column:10},\n\t * map: {\n\t * version : 3,\n\t * file: \"section.js\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AAAA,E;;ABCDE;\"\n\t * }\n\t * }],\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n\t */\n\tfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sections = util.getArg(sourceMap, 'sections');\n\t\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t this._sources = new ArraySet();\n\t this._names = new ArraySet();\n\t\n\t var lastOffset = {\n\t line: -1,\n\t column: 0\n\t };\n\t this._sections = sections.map(function (s) {\n\t if (s.url) {\n\t // The url field will require support for asynchronicity.\n\t // See https://github.com/mozilla/source-map/issues/16\n\t throw new Error('Support for url field in sections not implemented.');\n\t }\n\t var offset = util.getArg(s, 'offset');\n\t var offsetLine = util.getArg(offset, 'line');\n\t var offsetColumn = util.getArg(offset, 'column');\n\t\n\t if (offsetLine < lastOffset.line ||\n\t (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n\t throw new Error('Section offsets must be ordered and non-overlapping.');\n\t }\n\t lastOffset = offset;\n\t\n\t return {\n\t generatedOffset: {\n\t // The offset fields are 0-based, but we use 1-based indices when\n\t // encoding/decoding from VLQ.\n\t generatedLine: offsetLine + 1,\n\t generatedColumn: offsetColumn + 1\n\t },\n\t consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n\t }\n\t });\n\t}\n\t\n\tIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tIndexedSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t var sources = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n\t sources.push(this._sections[i].consumer.sources[j]);\n\t }\n\t }\n\t return sources;\n\t }\n\t});\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.originalPositionFor =\n\t function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t // Find the section containing the generated position we're trying to map\n\t // to an original position.\n\t var sectionIndex = binarySearch.search(needle, this._sections,\n\t function(needle, section) {\n\t var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n\t if (cmp) {\n\t return cmp;\n\t }\n\t\n\t return (needle.generatedColumn -\n\t section.generatedOffset.generatedColumn);\n\t });\n\t var section = this._sections[sectionIndex];\n\t\n\t if (!section) {\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t }\n\t\n\t return section.consumer.originalPositionFor({\n\t line: needle.generatedLine -\n\t (section.generatedOffset.generatedLine - 1),\n\t column: needle.generatedColumn -\n\t (section.generatedOffset.generatedLine === needle.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t bias: aArgs.bias\n\t });\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n\t return this._sections.every(function (s) {\n\t return s.consumer.hasContentsOfAllSources();\n\t });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tIndexedSourceMapConsumer.prototype.sourceContentFor =\n\t function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t var content = section.consumer.sourceContentFor(aSource, true);\n\t if (content) {\n\t return content;\n\t }\n\t }\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based. \n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tIndexedSourceMapConsumer.prototype.generatedPositionFor =\n\t function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t // Only consider this section if the requested source is in the list of\n\t // sources of the consumer.\n\t if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n\t continue;\n\t }\n\t var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n\t if (generatedPosition) {\n\t var ret = {\n\t line: generatedPosition.line +\n\t (section.generatedOffset.generatedLine - 1),\n\t column: generatedPosition.column +\n\t (section.generatedOffset.generatedLine === generatedPosition.line\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0)\n\t };\n\t return ret;\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null\n\t };\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tIndexedSourceMapConsumer.prototype._parseMappings =\n\t function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t this.__generatedMappings = [];\n\t this.__originalMappings = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t var sectionMappings = section.consumer._generatedMappings;\n\t for (var j = 0; j < sectionMappings.length; j++) {\n\t var mapping = sectionMappings[j];\n\t\n\t var source = section.consumer._sources.at(mapping.source);\n\t source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n\t this._sources.add(source);\n\t source = this._sources.indexOf(source);\n\t\n\t var name = null;\n\t if (mapping.name) {\n\t name = section.consumer._names.at(mapping.name);\n\t this._names.add(name);\n\t name = this._names.indexOf(name);\n\t }\n\t\n\t // The mappings coming from the consumer for the section have\n\t // generated positions relative to the start of the section, so we\n\t // need to offset them to be relative to the start of the concatenated\n\t // generated file.\n\t var adjustedMapping = {\n\t source: source,\n\t generatedLine: mapping.generatedLine +\n\t (section.generatedOffset.generatedLine - 1),\n\t generatedColumn: mapping.generatedColumn +\n\t (section.generatedOffset.generatedLine === mapping.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: name\n\t };\n\t\n\t this.__generatedMappings.push(adjustedMapping);\n\t if (typeof adjustedMapping.originalLine === 'number') {\n\t this.__originalMappings.push(adjustedMapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t quickSort(this.__originalMappings, util.compareByOriginalPositions);\n\t };\n\t\n\texports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\texports.GREATEST_LOWER_BOUND = 1;\n\texports.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Recursive implementation of binary search.\n\t *\n\t * @param aLow Indices here and lower do not contain the needle.\n\t * @param aHigh Indices here and higher do not contain the needle.\n\t * @param aNeedle The element being searched for.\n\t * @param aHaystack The non-empty array being searched.\n\t * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t */\n\tfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n\t // This function terminates when one of the following is true:\n\t //\n\t // 1. We find the exact element we are looking for.\n\t //\n\t // 2. We did not find the exact element, but we can return the index of\n\t // the next-closest element.\n\t //\n\t // 3. We did not find the exact element, and there is no next-closest\n\t // element than the one we are searching for, so we return -1.\n\t var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n\t var cmp = aCompare(aNeedle, aHaystack[mid], true);\n\t if (cmp === 0) {\n\t // Found the element we are looking for.\n\t return mid;\n\t }\n\t else if (cmp > 0) {\n\t // Our needle is greater than aHaystack[mid].\n\t if (aHigh - mid > 1) {\n\t // The element is in the upper half.\n\t return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // The exact needle element was not found in this haystack. Determine if\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return aHigh < aHaystack.length ? aHigh : -1;\n\t } else {\n\t return mid;\n\t }\n\t }\n\t else {\n\t // Our needle is less than aHaystack[mid].\n\t if (mid - aLow > 1) {\n\t // The element is in the lower half.\n\t return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return mid;\n\t } else {\n\t return aLow < 0 ? -1 : aLow;\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * This is an implementation of binary search which will always try and return\n\t * the index of the closest element if there is no exact hit. This is because\n\t * mappings between original and generated line/col pairs are single points,\n\t * and there is an implicit region between each of them, so a miss just means\n\t * that you aren't on the very start of a region.\n\t *\n\t * @param aNeedle The element you are looking for.\n\t * @param aHaystack The array that is being searched.\n\t * @param aCompare A function which takes the needle and an element in the\n\t * array and returns -1, 0, or 1 depending on whether the needle is less\n\t * than, equal to, or greater than the element, respectively.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n\t */\n\texports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n\t if (aHaystack.length === 0) {\n\t return -1;\n\t }\n\t\n\t var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n\t aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n\t if (index < 0) {\n\t return -1;\n\t }\n\t\n\t // We have found either the exact element, or the next-closest element than\n\t // the one we are searching for. However, there may be more than one such\n\t // element. Make sure we always return the smallest of these.\n\t while (index - 1 >= 0) {\n\t if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n\t break;\n\t }\n\t --index;\n\t }\n\t\n\t return index;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t// It turns out that some (most?) JavaScript engines don't self-host\n\t// `Array.prototype.sort`. This makes sense because C++ will likely remain\n\t// faster than JS when doing raw CPU-intensive sorting. However, when using a\n\t// custom comparator function, calling back and forth between the VM's C++ and\n\t// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n\t// worse generated code for the comparator function than would be optimal. In\n\t// fact, when sorting with a comparator, these costs outweigh the benefits of\n\t// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n\t// a ~3500ms mean speed-up in `bench/bench.html`.\n\t\n\t/**\n\t * Swap the elements indexed by `x` and `y` in the array `ary`.\n\t *\n\t * @param {Array} ary\n\t * The array.\n\t * @param {Number} x\n\t * The index of the first item.\n\t * @param {Number} y\n\t * The index of the second item.\n\t */\n\tfunction swap(ary, x, y) {\n\t var temp = ary[x];\n\t ary[x] = ary[y];\n\t ary[y] = temp;\n\t}\n\t\n\t/**\n\t * Returns a random integer within the range `low .. high` inclusive.\n\t *\n\t * @param {Number} low\n\t * The lower bound on the range.\n\t * @param {Number} high\n\t * The upper bound on the range.\n\t */\n\tfunction randomIntInRange(low, high) {\n\t return Math.round(low + (Math.random() * (high - low)));\n\t}\n\t\n\t/**\n\t * The Quick Sort algorithm.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t * @param {Number} p\n\t * Start index of the array\n\t * @param {Number} r\n\t * End index of the array\n\t */\n\tfunction doQuickSort(ary, comparator, p, r) {\n\t // If our lower bound is less than our upper bound, we (1) partition the\n\t // array into two pieces and (2) recurse on each half. If it is not, this is\n\t // the empty array and our base case.\n\t\n\t if (p < r) {\n\t // (1) Partitioning.\n\t //\n\t // The partitioning chooses a pivot between `p` and `r` and moves all\n\t // elements that are less than or equal to the pivot to the before it, and\n\t // all the elements that are greater than it after it. The effect is that\n\t // once partition is done, the pivot is in the exact place it will be when\n\t // the array is put in sorted order, and it will not need to be moved\n\t // again. This runs in O(n) time.\n\t\n\t // Always choose a random pivot so that an input array which is reverse\n\t // sorted does not cause O(n^2) running time.\n\t var pivotIndex = randomIntInRange(p, r);\n\t var i = p - 1;\n\t\n\t swap(ary, pivotIndex, r);\n\t var pivot = ary[r];\n\t\n\t // Immediately after `j` is incremented in this loop, the following hold\n\t // true:\n\t //\n\t // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n\t //\n\t // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n\t for (var j = p; j < r; j++) {\n\t if (comparator(ary[j], pivot) <= 0) {\n\t i += 1;\n\t swap(ary, i, j);\n\t }\n\t }\n\t\n\t swap(ary, i + 1, j);\n\t var q = i + 1;\n\t\n\t // (2) Recurse on each half.\n\t\n\t doQuickSort(ary, comparator, p, q - 1);\n\t doQuickSort(ary, comparator, q + 1, r);\n\t }\n\t}\n\t\n\t/**\n\t * Sort the given array in-place with the given comparator function.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t */\n\texports.quickSort = function (ary, comparator) {\n\t doQuickSort(ary, comparator, 0, ary.length - 1);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;\n\tvar util = __webpack_require__(4);\n\t\n\t// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n\t// operating systems these days (capturing the result).\n\tvar REGEX_NEWLINE = /(\\r?\\n)/;\n\t\n\t// Newline character code for charCodeAt() comparisons\n\tvar NEWLINE_CODE = 10;\n\t\n\t// Private symbol for identifying `SourceNode`s when multiple versions of\n\t// the source-map library are loaded. This MUST NOT CHANGE across\n\t// versions!\n\tvar isSourceNode = \"$$$isSourceNode$$$\";\n\t\n\t/**\n\t * SourceNodes provide a way to abstract over interpolating/concatenating\n\t * snippets of generated JavaScript source code while maintaining the line and\n\t * column information associated with the original source code.\n\t *\n\t * @param aLine The original line number.\n\t * @param aColumn The original column number.\n\t * @param aSource The original source's filename.\n\t * @param aChunks Optional. An array of strings which are snippets of\n\t * generated JS, or other SourceNodes.\n\t * @param aName The original identifier.\n\t */\n\tfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n\t this.children = [];\n\t this.sourceContents = {};\n\t this.line = aLine == null ? null : aLine;\n\t this.column = aColumn == null ? null : aColumn;\n\t this.source = aSource == null ? null : aSource;\n\t this.name = aName == null ? null : aName;\n\t this[isSourceNode] = true;\n\t if (aChunks != null) this.add(aChunks);\n\t}\n\t\n\t/**\n\t * Creates a SourceNode from generated code and a SourceMapConsumer.\n\t *\n\t * @param aGeneratedCode The generated code\n\t * @param aSourceMapConsumer The SourceMap for the generated code\n\t * @param aRelativePath Optional. The path that relative sources in the\n\t * SourceMapConsumer should be relative to.\n\t */\n\tSourceNode.fromStringWithSourceMap =\n\t function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n\t // The SourceNode we want to fill with the generated code\n\t // and the SourceMap\n\t var node = new SourceNode();\n\t\n\t // All even indices of this array are one line of the generated code,\n\t // while all odd indices are the newlines between two adjacent lines\n\t // (since `REGEX_NEWLINE` captures its match).\n\t // Processed fragments are accessed by calling `shiftNextLine`.\n\t var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n\t var remainingLinesIndex = 0;\n\t var shiftNextLine = function() {\n\t var lineContents = getNextLine();\n\t // The last line of a file might not have a newline.\n\t var newLine = getNextLine() || \"\";\n\t return lineContents + newLine;\n\t\n\t function getNextLine() {\n\t return remainingLinesIndex < remainingLines.length ?\n\t remainingLines[remainingLinesIndex++] : undefined;\n\t }\n\t };\n\t\n\t // We need to remember the position of \"remainingLines\"\n\t var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\t\n\t // The generate SourceNodes we need a code range.\n\t // To extract it current and last mapping is used.\n\t // Here we store the last mapping.\n\t var lastMapping = null;\n\t\n\t aSourceMapConsumer.eachMapping(function (mapping) {\n\t if (lastMapping !== null) {\n\t // We add the code from \"lastMapping\" to \"mapping\":\n\t // First check if there is a new line in between.\n\t if (lastGeneratedLine < mapping.generatedLine) {\n\t // Associate first line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t lastGeneratedLine++;\n\t lastGeneratedColumn = 0;\n\t // The remaining code is added without mapping\n\t } else {\n\t // There is no new line in between.\n\t // Associate the code between \"lastGeneratedColumn\" and\n\t // \"mapping.generatedColumn\" with \"lastMapping\"\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t var code = nextLine.substr(0, mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t addMappingWithCode(lastMapping, code);\n\t // No more remaining code, continue\n\t lastMapping = mapping;\n\t return;\n\t }\n\t }\n\t // We add the generated code until the first mapping\n\t // to the SourceNode without any mapping.\n\t // Each line is added as separate string.\n\t while (lastGeneratedLine < mapping.generatedLine) {\n\t node.add(shiftNextLine());\n\t lastGeneratedLine++;\n\t }\n\t if (lastGeneratedColumn < mapping.generatedColumn) {\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t node.add(nextLine.substr(0, mapping.generatedColumn));\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t }\n\t lastMapping = mapping;\n\t }, this);\n\t // We have processed all mappings.\n\t if (remainingLinesIndex < remainingLines.length) {\n\t if (lastMapping) {\n\t // Associate the remaining code in the current line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t }\n\t // and add the remaining lines without any mapping\n\t node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n\t }\n\t\n\t // Copy sourcesContent into SourceNode\n\t aSourceMapConsumer.sources.forEach(function (sourceFile) {\n\t var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\t if (content != null) {\n\t if (aRelativePath != null) {\n\t sourceFile = util.join(aRelativePath, sourceFile);\n\t }\n\t node.setSourceContent(sourceFile, content);\n\t }\n\t });\n\t\n\t return node;\n\t\n\t function addMappingWithCode(mapping, code) {\n\t if (mapping === null || mapping.source === undefined) {\n\t node.add(code);\n\t } else {\n\t var source = aRelativePath\n\t ? util.join(aRelativePath, mapping.source)\n\t : mapping.source;\n\t node.add(new SourceNode(mapping.originalLine,\n\t mapping.originalColumn,\n\t source,\n\t code,\n\t mapping.name));\n\t }\n\t }\n\t };\n\t\n\t/**\n\t * Add a chunk of generated JS to this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.add = function SourceNode_add(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t aChunk.forEach(function (chunk) {\n\t this.add(chunk);\n\t }, this);\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t if (aChunk) {\n\t this.children.push(aChunk);\n\t }\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a chunk of generated JS to the beginning of this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t for (var i = aChunk.length-1; i >= 0; i--) {\n\t this.prepend(aChunk[i]);\n\t }\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t this.children.unshift(aChunk);\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Walk over the tree of JS snippets in this node and its children. The\n\t * walking function is called once for each snippet of JS and is passed that\n\t * snippet and the its original associated source's line/column location.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n\t var chunk;\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t chunk = this.children[i];\n\t if (chunk[isSourceNode]) {\n\t chunk.walk(aFn);\n\t }\n\t else {\n\t if (chunk !== '') {\n\t aFn(chunk, { source: this.source,\n\t line: this.line,\n\t column: this.column,\n\t name: this.name });\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n\t * each of `this.children`.\n\t *\n\t * @param aSep The separator.\n\t */\n\tSourceNode.prototype.join = function SourceNode_join(aSep) {\n\t var newChildren;\n\t var i;\n\t var len = this.children.length;\n\t if (len > 0) {\n\t newChildren = [];\n\t for (i = 0; i < len-1; i++) {\n\t newChildren.push(this.children[i]);\n\t newChildren.push(aSep);\n\t }\n\t newChildren.push(this.children[i]);\n\t this.children = newChildren;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Call String.prototype.replace on the very right-most source snippet. Useful\n\t * for trimming whitespace from the end of a source node, etc.\n\t *\n\t * @param aPattern The pattern to replace.\n\t * @param aReplacement The thing to replace the pattern with.\n\t */\n\tSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n\t var lastChild = this.children[this.children.length - 1];\n\t if (lastChild[isSourceNode]) {\n\t lastChild.replaceRight(aPattern, aReplacement);\n\t }\n\t else if (typeof lastChild === 'string') {\n\t this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n\t }\n\t else {\n\t this.children.push(''.replace(aPattern, aReplacement));\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the source content for a source file. This will be added to the SourceMapGenerator\n\t * in the sourcesContent field.\n\t *\n\t * @param aSourceFile The filename of the source file\n\t * @param aSourceContent The content of the source file\n\t */\n\tSourceNode.prototype.setSourceContent =\n\t function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n\t this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n\t };\n\t\n\t/**\n\t * Walk over the tree of SourceNodes. The walking function is called for each\n\t * source file content and is passed the filename and source content.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walkSourceContents =\n\t function SourceNode_walkSourceContents(aFn) {\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t if (this.children[i][isSourceNode]) {\n\t this.children[i].walkSourceContents(aFn);\n\t }\n\t }\n\t\n\t var sources = Object.keys(this.sourceContents);\n\t for (var i = 0, len = sources.length; i < len; i++) {\n\t aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n\t }\n\t };\n\t\n\t/**\n\t * Return the string representation of this source node. Walks over the tree\n\t * and concatenates all the various snippets together to one string.\n\t */\n\tSourceNode.prototype.toString = function SourceNode_toString() {\n\t var str = \"\";\n\t this.walk(function (chunk) {\n\t str += chunk;\n\t });\n\t return str;\n\t};\n\t\n\t/**\n\t * Returns the string representation of this source node along with a source\n\t * map.\n\t */\n\tSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n\t var generated = {\n\t code: \"\",\n\t line: 1,\n\t column: 0\n\t };\n\t var map = new SourceMapGenerator(aArgs);\n\t var sourceMappingActive = false;\n\t var lastOriginalSource = null;\n\t var lastOriginalLine = null;\n\t var lastOriginalColumn = null;\n\t var lastOriginalName = null;\n\t this.walk(function (chunk, original) {\n\t generated.code += chunk;\n\t if (original.source !== null\n\t && original.line !== null\n\t && original.column !== null) {\n\t if(lastOriginalSource !== original.source\n\t || lastOriginalLine !== original.line\n\t || lastOriginalColumn !== original.column\n\t || lastOriginalName !== original.name) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t lastOriginalSource = original.source;\n\t lastOriginalLine = original.line;\n\t lastOriginalColumn = original.column;\n\t lastOriginalName = original.name;\n\t sourceMappingActive = true;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t }\n\t });\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t }\n\t for (var idx = 0, length = chunk.length; idx < length; idx++) {\n\t if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n\t generated.line++;\n\t generated.column = 0;\n\t // Mappings end at eol\n\t if (idx + 1 === length) {\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t } else {\n\t generated.column++;\n\t }\n\t }\n\t });\n\t this.walkSourceContents(function (sourceFile, sourceContent) {\n\t map.setSourceContent(sourceFile, sourceContent);\n\t });\n\t\n\t return { code: generated.code, map: map };\n\t};\n\t\n\texports.SourceNode = SourceNode;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// source-map.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0fd5815da764db5fb9fe","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./source-map.js\n// module id = 0\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-generator.js\n// module id = 1\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64-vlq.js\n// module id = 2\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64.js\n// module id = 3\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/util.js\n// module id = 4\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/array-set.js\n// module id = 5\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/mapping-list.js\n// module id = 6\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-consumer.js\n// module id = 7\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/binary-search.js\n// module id = 8\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/quick-sort.js\n// module id = 9\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-node.js\n// module id = 10\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/source-map/lib/array-set.js b/node_modules/source-map/lib/array-set.js deleted file mode 100644 index fbd5c81..0000000 --- a/node_modules/source-map/lib/array-set.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var has = Object.prototype.hasOwnProperty; -var hasNativeMap = typeof Map !== "undefined"; - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); -} - -/** - * Static method for creating ArraySet instances from an existing array. - */ -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; -}; - -/** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ -ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; -}; - -/** - * Add the given string to this set. - * - * @param String aStr - */ -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } -}; - -/** - * Is the given string a member of this set? - * - * @param String aStr - */ -ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } -}; - -/** - * What is the index of the given string in the array? - * - * @param String aStr - */ -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; diff --git a/node_modules/source-map/lib/base64-vlq.js b/node_modules/source-map/lib/base64-vlq.js deleted file mode 100644 index 612b404..0000000 --- a/node_modules/source-map/lib/base64-vlq.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = require('./base64'); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; diff --git a/node_modules/source-map/lib/base64.js b/node_modules/source-map/lib/base64.js deleted file mode 100644 index 8aa86b3..0000000 --- a/node_modules/source-map/lib/base64.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; diff --git a/node_modules/source-map/lib/binary-search.js b/node_modules/source-map/lib/binary-search.js deleted file mode 100644 index 010ac94..0000000 --- a/node_modules/source-map/lib/binary-search.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; diff --git a/node_modules/source-map/lib/mapping-list.js b/node_modules/source-map/lib/mapping-list.js deleted file mode 100644 index 06d1274..0000000 --- a/node_modules/source-map/lib/mapping-list.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; diff --git a/node_modules/source-map/lib/quick-sort.js b/node_modules/source-map/lib/quick-sort.js deleted file mode 100644 index 6a7caad..0000000 --- a/node_modules/source-map/lib/quick-sort.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ -exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); -}; diff --git a/node_modules/source-map/lib/source-map-consumer.js b/node_modules/source-map/lib/source-map-consumer.js deleted file mode 100644 index 7b99d1d..0000000 --- a/node_modules/source-map/lib/source-map-consumer.js +++ /dev/null @@ -1,1145 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var binarySearch = require('./binary-search'); -var ArraySet = require('./array-set').ArraySet; -var base64VLQ = require('./base64-vlq'); -var quickSort = require('./quick-sort').quickSort; - -function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ -BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; -}; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/source-map/lib/source-map-generator.js b/node_modules/source-map/lib/source-map-generator.js deleted file mode 100644 index 508bcfb..0000000 --- a/node_modules/source-map/lib/source-map-generator.js +++ /dev/null @@ -1,425 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = require('./base64-vlq'); -var util = require('./util'); -var ArraySet = require('./array-set').ArraySet; -var MappingList = require('./mapping-list').MappingList; - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/source-map/lib/source-node.js b/node_modules/source-map/lib/source-node.js deleted file mode 100644 index 8bcdbe3..0000000 --- a/node_modules/source-map/lib/source-node.js +++ /dev/null @@ -1,413 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; -var util = require('./util'); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; diff --git a/node_modules/source-map/lib/util.js b/node_modules/source-map/lib/util.js deleted file mode 100644 index 3ca92e5..0000000 --- a/node_modules/source-map/lib/util.js +++ /dev/null @@ -1,488 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -} -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/source-map/package.json b/node_modules/source-map/package.json deleted file mode 100644 index 2466341..0000000 --- a/node_modules/source-map/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "source-map", - "description": "Generates and consumes source maps", - "version": "0.6.1", - "homepage": "https://github.com/mozilla/source-map", - "author": "Nick Fitzgerald ", - "contributors": [ - "Tobias Koppers ", - "Duncan Beevers ", - "Stephen Crane ", - "Ryan Seddon ", - "Miles Elam ", - "Mihai Bazon ", - "Michael Ficarra ", - "Todd Wolfson ", - "Alexander Solovyov ", - "Felix Gnass ", - "Conrad Irwin ", - "usrbincc ", - "David Glasser ", - "Chase Douglas ", - "Evan Wallace ", - "Heather Arthur ", - "Hugh Kennedy ", - "David Glasser ", - "Simon Lydell ", - "Jmeas Smith ", - "Michael Z Goddard ", - "azu ", - "John Gozde ", - "Adam Kirkton ", - "Chris Montgomery ", - "J. Ryan Stinnett ", - "Jack Herrington ", - "Chris Truter ", - "Daniel Espeset ", - "Jamie Wong ", - "Eddy Bruël ", - "Hawken Rives ", - "Gilad Peleg ", - "djchie ", - "Gary Ye ", - "Nicolas Lalevée " - ], - "repository": { - "type": "git", - "url": "http://github.com/mozilla/source-map.git" - }, - "main": "./source-map.js", - "files": [ - "source-map.js", - "source-map.d.ts", - "lib/", - "dist/source-map.debug.js", - "dist/source-map.js", - "dist/source-map.min.js", - "dist/source-map.min.js.map" - ], - "engines": { - "node": ">=0.10.0" - }, - "license": "BSD-3-Clause", - "scripts": { - "test": "npm run build && node test/run-tests.js", - "build": "webpack --color", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "devDependencies": { - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "typings": "source-map" -} diff --git a/node_modules/source-map/source-map.d.ts b/node_modules/source-map/source-map.d.ts deleted file mode 100644 index 8f972b0..0000000 --- a/node_modules/source-map/source-map.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -export interface StartOfSourceMap { - file?: string; - sourceRoot?: string; -} - -export interface RawSourceMap extends StartOfSourceMap { - version: string; - sources: string[]; - names: string[]; - sourcesContent?: string[]; - mappings: string; -} - -export interface Position { - line: number; - column: number; -} - -export interface LineRange extends Position { - lastColumn: number; -} - -export interface FindPosition extends Position { - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND - bias?: number; -} - -export interface SourceFindPosition extends FindPosition { - source: string; -} - -export interface MappedPosition extends Position { - source: string; - name?: string; -} - -export interface MappingItem { - source: string; - generatedLine: number; - generatedColumn: number; - originalLine: number; - originalColumn: number; - name: string; -} - -export class SourceMapConsumer { - static GENERATED_ORDER: number; - static ORIGINAL_ORDER: number; - - static GREATEST_LOWER_BOUND: number; - static LEAST_UPPER_BOUND: number; - - constructor(rawSourceMap: RawSourceMap); - computeColumnSpans(): void; - originalPositionFor(generatedPosition: FindPosition): MappedPosition; - generatedPositionFor(originalPosition: SourceFindPosition): LineRange; - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; - hasContentsOfAllSources(): boolean; - sourceContentFor(source: string, returnNullOnMissing?: boolean): string; - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; -} - -export interface Mapping { - generated: Position; - original: Position; - source: string; - name?: string; -} - -export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - addMapping(mapping: Mapping): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - toString(): string; -} - -export interface CodeWithSourceMap { - code: string; - map: SourceMapGenerator; -} - -export class SourceNode { - constructor(); - constructor(line: number, column: number, source: string); - constructor(line: number, column: number, source: string, chunk?: string, name?: string); - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - add(chunk: string): void; - prepend(chunk: string): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - walkSourceContents(fn: (file: string, content: string) => void): void; - join(sep: string): SourceNode; - replaceRight(pattern: string, replacement: string): SourceNode; - toString(): string; - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; -} diff --git a/node_modules/source-map/source-map.js b/node_modules/source-map/source-map.js deleted file mode 100644 index bc88fe8..0000000 --- a/node_modules/source-map/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js deleted file mode 100644 index f097aec..0000000 --- a/node_modules/supports-color/browser.js +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-env browser */ -'use strict'; - -function getChromeVersion() { - const matches = /(Chrome|Chromium)\/(?\d+)\./.exec(navigator.userAgent); - - if (!matches) { - return; - } - - return Number.parseInt(matches.groups.chromeVersion, 10); -} - -const colorSupport = getChromeVersion() >= 69 ? { - level: 1, - hasBasic: true, - has256: false, - has16m: false -} : false; - -module.exports = { - stdout: colorSupport, - stderr: colorSupport -}; diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js deleted file mode 100644 index 2dd2fcb..0000000 --- a/node_modules/supports-color/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict'; -const os = require('os'); -const tty = require('tty'); -const hasFlag = require('has-flag'); - -const {env} = process; - -let flagForceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - flagForceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - flagForceColor = 1; -} - -function envForceColor() { - if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - return 1; - } - - if (env.FORCE_COLOR === 'false') { - return 0; - } - - return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { - const noFlagForceColor = envForceColor(); - if (noFlagForceColor !== undefined) { - flagForceColor = noFlagForceColor; - } - - const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; - - if (forceColor === 0) { - return 0; - } - - if (sniffFlags) { - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream, options = {}) { - const level = supportsColor(stream, { - streamIsTTY: stream && stream.isTTY, - ...options - }); - - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: getSupportLevel({isTTY: tty.isatty(1)}), - stderr: getSupportLevel({isTTY: tty.isatty(2)}) -}; diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license deleted file mode 100644 index fa7ceba..0000000 --- a/node_modules/supports-color/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json deleted file mode 100644 index a97bf2a..0000000 --- a/node_modules/supports-color/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "supports-color", - "version": "8.1.1", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "funding": "https://github.com/chalk/supports-color?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "exports": { - "node": "./index.js", - "default": "./browser.js" - }, - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^4.0.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "import-fresh": "^3.2.2", - "xo": "^0.35.0" - }, - "browser": "browser.js" -} diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md deleted file mode 100644 index 3eedd1c..0000000 --- a/node_modules/supports-color/readme.md +++ /dev/null @@ -1,77 +0,0 @@ -# supports-color - -> Detect whether a terminal supports color - -## Install - -``` -$ npm install supports-color -``` - -## Usage - -```js -const supportsColor = require('supports-color'); - -if (supportsColor.stdout) { - console.log('Terminal stdout supports color'); -} - -if (supportsColor.stdout.has256) { - console.log('Terminal stdout supports 256 colors'); -} - -if (supportsColor.stderr.has16m) { - console.log('Terminal stderr supports 16 million colors (truecolor)'); -} -``` - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. - -The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - -- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) -- `.level = 2` and `.has256 = true`: 256 color support -- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) - -### `require('supports-color').supportsColor(stream, options?)` - -Additionally, `supports-color` exposes the `.supportsColor()` function that takes an arbitrary write stream (e.g. `process.stdout`) and an optional options object to (re-)evaluate color support for an arbitrary stream. - -For example, `require('supports-color').stdout` is the equivalent of `require('supports-color').supportsColor(process.stdout)`. - -The options object supports a single boolean property `sniffFlags`. By default it is `true`, which instructs `supportsColor()` to sniff `process.argv` for the multitude of `--color` flags (see _Info_ below). If `false`, then `process.argv` is not considered when determining color support. - -## Info - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. - -Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- diff --git a/node_modules/supports-preserve-symlinks-flag/.eslintrc b/node_modules/supports-preserve-symlinks-flag/.eslintrc deleted file mode 100644 index 346ffec..0000000 --- a/node_modules/supports-preserve-symlinks-flag/.eslintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "env": { - "browser": true, - "node": true, - }, - - "rules": { - "id-length": "off", - }, -} diff --git a/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml b/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml deleted file mode 100644 index e8d64f3..0000000 --- a/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/supports-preserve-symlink-flag -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/supports-preserve-symlinks-flag/.nycrc b/node_modules/supports-preserve-symlinks-flag/.nycrc deleted file mode 100644 index bdd626c..0000000 --- a/node_modules/supports-preserve-symlinks-flag/.nycrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md b/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md deleted file mode 100644 index 61f607f..0000000 --- a/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +++ /dev/null @@ -1,22 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## v1.0.0 - 2022-01-02 - -### Commits - -- Tests [`e2f59ad`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/e2f59ad74e2ae0f5f4899fcde6a6f693ab7cc074) -- Initial commit [`dc222aa`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/dc222aad3c0b940d8d3af1ca9937d108bd2dc4b9) -- [meta] do not publish workflow files [`5ef77f7`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/5ef77f7cb6946d16ee38672be9ec0f1bbdf63262) -- npm init [`992b068`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/992b068503a461f7e8676f40ca2aab255fd8d6ff) -- read me [`6c9afa9`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/6c9afa9fabc8eaf0814aaed6dd01e6df0931b76d) -- Initial implementation [`2f98925`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/2f9892546396d4ab0ad9f1ff83e76c3f01234ae8) -- [meta] add `auto-changelog` [`6c476ae`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/6c476ae1ed7ce68b0480344f090ac2844f35509d) -- [Dev Deps] add `eslint`, `@ljharb/eslint-config` [`d0fffc8`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/d0fffc886d25fba119355520750a909d64da0087) -- Only apps should have lockfiles [`ab318ed`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/ab318ed7ae62f6c2c0e80a50398d40912afd8f69) -- [meta] add `safe-publish-latest` [`2bb23b3`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/2bb23b3ebab02dc4135c4cdf0217db82835b9fca) -- [meta] add `sideEffects` flag [`600223b`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/600223ba24f30779f209d9097721eff35ed62741) diff --git a/node_modules/supports-preserve-symlinks-flag/LICENSE b/node_modules/supports-preserve-symlinks-flag/LICENSE deleted file mode 100644 index 2e7b9a3..0000000 --- a/node_modules/supports-preserve-symlinks-flag/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Inspect JS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/supports-preserve-symlinks-flag/README.md b/node_modules/supports-preserve-symlinks-flag/README.md deleted file mode 100644 index eb05b12..0000000 --- a/node_modules/supports-preserve-symlinks-flag/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# node-supports-preserve-symlinks-flag [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Determine if the current node version supports the `--preserve-symlinks` flag. - -## Example - -```js -var supportsPreserveSymlinks = require('node-supports-preserve-symlinks-flag'); -var assert = require('assert'); - -assert.equal(supportsPreserveSymlinks, null); // in a browser -assert.equal(supportsPreserveSymlinks, false); // in node < v6.2 -assert.equal(supportsPreserveSymlinks, true); // in node v6.2+ -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/node-supports-preserve-symlinks-flag -[npm-version-svg]: https://versionbadg.es/inspect-js/node-supports-preserve-symlinks-flag.svg -[deps-svg]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag.svg -[deps-url]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag -[dev-deps-svg]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag/dev-status.svg -[dev-deps-url]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/node-supports-preserve-symlinks-flag.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/node-supports-preserve-symlinks-flag.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/node-supports-preserve-symlinks-flag.svg -[downloads-url]: https://npm-stat.com/charts.html?package=node-supports-preserve-symlinks-flag -[codecov-image]: https://codecov.io/gh/inspect-js/node-supports-preserve-symlinks-flag/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/inspect-js/node-supports-preserve-symlinks-flag/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/node-supports-preserve-symlinks-flag -[actions-url]: https://github.com/inspect-js/node-supports-preserve-symlinks-flag/actions diff --git a/node_modules/supports-preserve-symlinks-flag/browser.js b/node_modules/supports-preserve-symlinks-flag/browser.js deleted file mode 100644 index 087be1f..0000000 --- a/node_modules/supports-preserve-symlinks-flag/browser.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = null; diff --git a/node_modules/supports-preserve-symlinks-flag/index.js b/node_modules/supports-preserve-symlinks-flag/index.js deleted file mode 100644 index 86fd5d3..0000000 --- a/node_modules/supports-preserve-symlinks-flag/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = ( -// node 12+ - process.allowedNodeEnvironmentFlags && process.allowedNodeEnvironmentFlags.has('--preserve-symlinks') -) || ( -// node v6.2 - v11 - String(module.constructor._findPath).indexOf('preserveSymlinks') >= 0 // eslint-disable-line no-underscore-dangle -); diff --git a/node_modules/supports-preserve-symlinks-flag/package.json b/node_modules/supports-preserve-symlinks-flag/package.json deleted file mode 100644 index 56edadc..0000000 --- a/node_modules/supports-preserve-symlinks-flag/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "supports-preserve-symlinks-flag", - "version": "1.0.0", - "description": "Determine if the current node version supports the `--preserve-symlinks` flag.", - "main": "./index.js", - "browser": "./browser.js", - "exports": { - ".": [ - { - "browser": "./browser.js", - "default": "./index.js" - }, - "./index.js" - ], - "./package.json": "./package.json" - }, - "sideEffects": false, - "scripts": { - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "lint": "eslint --ext=js,mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/inspect-js/node-supports-preserve-symlinks-flag.git" - }, - "keywords": [ - "node", - "flag", - "symlink", - "symlinks", - "preserve-symlinks" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/inspect-js/node-supports-preserve-symlinks-flag/issues" - }, - "homepage": "https://github.com/inspect-js/node-supports-preserve-symlinks-flag#readme", - "devDependencies": { - "@ljharb/eslint-config": "^20.1.0", - "aud": "^1.1.5", - "auto-changelog": "^2.3.0", - "eslint": "^8.6.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "semver": "^6.3.0", - "tape": "^5.4.0" - }, - "engines": { - "node": ">= 0.4" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - } -} diff --git a/node_modules/supports-preserve-symlinks-flag/test/index.js b/node_modules/supports-preserve-symlinks-flag/test/index.js deleted file mode 100644 index 9938d67..0000000 --- a/node_modules/supports-preserve-symlinks-flag/test/index.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var test = require('tape'); -var semver = require('semver'); - -var supportsPreserveSymlinks = require('../'); -var browser = require('../browser'); - -test('supportsPreserveSymlinks', function (t) { - t.equal(typeof supportsPreserveSymlinks, 'boolean', 'is a boolean'); - - t.equal(browser, null, 'browser file is `null`'); - t.equal( - supportsPreserveSymlinks, - null, - 'in a browser, is null', - { skip: typeof window === 'undefined' } - ); - - var expected = semver.satisfies(process.version, '>= 6.2'); - t.equal( - supportsPreserveSymlinks, - expected, - 'is true in node v6.2+, false otherwise (actual: ' + supportsPreserveSymlinks + ', expected ' + expected + ')', - { skip: typeof window !== 'undefined' } - ); - - t.end(); -}); diff --git a/node_modules/tapable/LICENSE b/node_modules/tapable/LICENSE deleted file mode 100644 index 03c083c..0000000 --- a/node_modules/tapable/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/tapable/README.md b/node_modules/tapable/README.md deleted file mode 100644 index 1377197..0000000 --- a/node_modules/tapable/README.md +++ /dev/null @@ -1,296 +0,0 @@ -# Tapable - -The tapable package expose many Hook classes, which can be used to create hooks for plugins. - -``` javascript -const { - SyncHook, - SyncBailHook, - SyncWaterfallHook, - SyncLoopHook, - AsyncParallelHook, - AsyncParallelBailHook, - AsyncSeriesHook, - AsyncSeriesBailHook, - AsyncSeriesWaterfallHook - } = require("tapable"); -``` - -## Installation - -``` shell -npm install --save tapable -``` - -## Usage - -All Hook constructors take one optional argument, which is a list of argument names as strings. - -``` js -const hook = new SyncHook(["arg1", "arg2", "arg3"]); -``` - -The best practice is to expose all hooks of a class in a `hooks` property: - -``` js -class Car { - constructor() { - this.hooks = { - accelerate: new SyncHook(["newSpeed"]), - brake: new SyncHook(), - calculateRoutes: new AsyncParallelHook(["source", "target", "routesList"]) - }; - } - - /* ... */ -} -``` - -Other people can now use these hooks: - -``` js -const myCar = new Car(); - -// Use the tap method to add a consument -myCar.hooks.brake.tap("WarningLampPlugin", () => warningLamp.on()); -``` - -It's required to pass a name to identify the plugin/reason. - -You may receive arguments: - -``` js -myCar.hooks.accelerate.tap("LoggerPlugin", newSpeed => console.log(`Accelerating to ${newSpeed}`)); -``` - -For sync hooks, `tap` is the only valid method to add a plugin. Async hooks also support async plugins: - -``` js -myCar.hooks.calculateRoutes.tapPromise("GoogleMapsPlugin", (source, target, routesList) => { - // return a promise - return google.maps.findRoute(source, target).then(route => { - routesList.add(route); - }); -}); -myCar.hooks.calculateRoutes.tapAsync("BingMapsPlugin", (source, target, routesList, callback) => { - bing.findRoute(source, target, (err, route) => { - if(err) return callback(err); - routesList.add(route); - // call the callback - callback(); - }); -}); - -// You can still use sync plugins -myCar.hooks.calculateRoutes.tap("CachedRoutesPlugin", (source, target, routesList) => { - const cachedRoute = cache.get(source, target); - if(cachedRoute) - routesList.add(cachedRoute); -}) -``` -The class declaring these hooks need to call them: - -``` js -class Car { - /** - * You won't get returned value from SyncHook or AsyncParallelHook, - * to do that, use SyncWaterfallHook and AsyncSeriesWaterfallHook respectively - **/ - - setSpeed(newSpeed) { - // following call returns undefined even when you returned values - this.hooks.accelerate.call(newSpeed); - } - - useNavigationSystemPromise(source, target) { - const routesList = new List(); - return this.hooks.calculateRoutes.promise(source, target, routesList).then((res) => { - // res is undefined for AsyncParallelHook - return routesList.getRoutes(); - }); - } - - useNavigationSystemAsync(source, target, callback) { - const routesList = new List(); - this.hooks.calculateRoutes.callAsync(source, target, routesList, err => { - if(err) return callback(err); - callback(null, routesList.getRoutes()); - }); - } -} -``` - -The Hook will compile a method with the most efficient way of running your plugins. It generates code depending on: -* The number of registered plugins (none, one, many) -* The kind of registered plugins (sync, async, promise) -* The used call method (sync, async, promise) -* The number of arguments -* Whether interception is used - -This ensures fastest possible execution. - -## Hook types - -Each hook can be tapped with one or several functions. How they are executed depends on the hook type: - -* Basic hook (without “Waterfall”, “Bail” or “Loop” in its name). This hook simply calls every function it tapped in a row. - -* __Waterfall__. A waterfall hook also calls each tapped function in a row. Unlike the basic hook, it passes a return value from each function to the next function. - -* __Bail__. A bail hook allows exiting early. When any of the tapped function returns anything, the bail hook will stop executing the remaining ones. - -* __Loop__. When a plugin in a loop hook returns a non-undefined value the hook will restart from the first plugin. It will loop until all plugins return undefined. - -Additionally, hooks can be synchronous or asynchronous. To reflect this, there’re “Sync”, “AsyncSeries”, and “AsyncParallel” hook classes: - -* __Sync__. A sync hook can only be tapped with synchronous functions (using `myHook.tap()`). - -* __AsyncSeries__. An async-series hook can be tapped with synchronous, callback-based and promise-based functions (using `myHook.tap()`, `myHook.tapAsync()` and `myHook.tapPromise()`). They call each async method in a row. - -* __AsyncParallel__. An async-parallel hook can also be tapped with synchronous, callback-based and promise-based functions (using `myHook.tap()`, `myHook.tapAsync()` and `myHook.tapPromise()`). However, they run each async method in parallel. - -The hook type is reflected in its class name. E.g., `AsyncSeriesWaterfallHook` allows asynchronous functions and runs them in series, passing each function’s return value into the next function. - - -## Interception - -All Hooks offer an additional interception API: - -``` js -myCar.hooks.calculateRoutes.intercept({ - call: (source, target, routesList) => { - console.log("Starting to calculate routes"); - }, - register: (tapInfo) => { - // tapInfo = { type: "promise", name: "GoogleMapsPlugin", fn: ... } - console.log(`${tapInfo.name} is doing its job`); - return tapInfo; // may return a new tapInfo object - } -}) -``` - -**call**: `(...args) => void` Adding `call` to your interceptor will trigger when hooks are triggered. You have access to the hooks arguments. - -**tap**: `(tap: Tap) => void` Adding `tap` to your interceptor will trigger when a plugin taps into a hook. Provided is the `Tap` object. `Tap` object can't be changed. - -**loop**: `(...args) => void` Adding `loop` to your interceptor will trigger for each loop of a looping hook. - -**register**: `(tap: Tap) => Tap | undefined` Adding `register` to your interceptor will trigger for each added `Tap` and allows to modify it. - -## Context - -Plugins and interceptors can opt-in to access an optional `context` object, which can be used to pass arbitrary values to subsequent plugins and interceptors. - -``` js -myCar.hooks.accelerate.intercept({ - context: true, - tap: (context, tapInfo) => { - // tapInfo = { type: "sync", name: "NoisePlugin", fn: ... } - console.log(`${tapInfo.name} is doing it's job`); - - // `context` starts as an empty object if at least one plugin uses `context: true`. - // If no plugins use `context: true`, then `context` is undefined. - if (context) { - // Arbitrary properties can be added to `context`, which plugins can then access. - context.hasMuffler = true; - } - } -}); - -myCar.hooks.accelerate.tap({ - name: "NoisePlugin", - context: true -}, (context, newSpeed) => { - if (context && context.hasMuffler) { - console.log("Silence..."); - } else { - console.log("Vroom!"); - } -}); -``` - -## HookMap - -A HookMap is a helper class for a Map with Hooks - -``` js -const keyedHook = new HookMap(key => new SyncHook(["arg"])) -``` - -``` js -keyedHook.for("some-key").tap("MyPlugin", (arg) => { /* ... */ }); -keyedHook.for("some-key").tapAsync("MyPlugin", (arg, callback) => { /* ... */ }); -keyedHook.for("some-key").tapPromise("MyPlugin", (arg) => { /* ... */ }); -``` - -``` js -const hook = keyedHook.get("some-key"); -if(hook !== undefined) { - hook.callAsync("arg", err => { /* ... */ }); -} -``` - -## Hook/HookMap interface - -Public: - -``` ts -interface Hook { - tap: (name: string | Tap, fn: (context?, ...args) => Result) => void, - tapAsync: (name: string | Tap, fn: (context?, ...args, callback: (err, result: Result) => void) => void) => void, - tapPromise: (name: string | Tap, fn: (context?, ...args) => Promise) => void, - intercept: (interceptor: HookInterceptor) => void -} - -interface HookInterceptor { - call: (context?, ...args) => void, - loop: (context?, ...args) => void, - tap: (context?, tap: Tap) => void, - register: (tap: Tap) => Tap, - context: boolean -} - -interface HookMap { - for: (key: any) => Hook, - intercept: (interceptor: HookMapInterceptor) => void -} - -interface HookMapInterceptor { - factory: (key: any, hook: Hook) => Hook -} - -interface Tap { - name: string, - type: string - fn: Function, - stage: number, - context: boolean, - before?: string | Array -} -``` - -Protected (only for the class containing the hook): - -``` ts -interface Hook { - isUsed: () => boolean, - call: (...args) => Result, - promise: (...args) => Promise, - callAsync: (...args, callback: (err, result: Result) => void) => void, -} - -interface HookMap { - get: (key: any) => Hook | undefined, - for: (key: any) => Hook -} -``` - -## MultiHook - -A helper Hook-like class to redirect taps to multiple other hooks: - -``` js -const { MultiHook } = require("tapable"); - -this.hooks.allHooks = new MultiHook([this.hooks.hookA, this.hooks.hookB]); -``` diff --git a/node_modules/tapable/lib/AsyncParallelBailHook.js b/node_modules/tapable/lib/AsyncParallelBailHook.js deleted file mode 100644 index 45eca33..0000000 --- a/node_modules/tapable/lib/AsyncParallelBailHook.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class AsyncParallelBailHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, onDone }) { - let code = ""; - code += `var _results = new Array(${this.options.taps.length});\n`; - code += "var _checkDone = function() {\n"; - code += "for(var i = 0; i < _results.length; i++) {\n"; - code += "var item = _results[i];\n"; - code += "if(item === undefined) return false;\n"; - code += "if(item.result !== undefined) {\n"; - code += onResult("item.result"); - code += "return true;\n"; - code += "}\n"; - code += "if(item.error) {\n"; - code += onError("item.error"); - code += "return true;\n"; - code += "}\n"; - code += "}\n"; - code += "return false;\n"; - code += "}\n"; - code += this.callTapsParallel({ - onError: (i, err, done, doneBreak) => { - let code = ""; - code += `if(${i} < _results.length && ((_results.length = ${i + - 1}), (_results[${i}] = { error: ${err} }), _checkDone())) {\n`; - code += doneBreak(true); - code += "} else {\n"; - code += done(); - code += "}\n"; - return code; - }, - onResult: (i, result, done, doneBreak) => { - let code = ""; - code += `if(${i} < _results.length && (${result} !== undefined && (_results.length = ${i + - 1}), (_results[${i}] = { result: ${result} }), _checkDone())) {\n`; - code += doneBreak(true); - code += "} else {\n"; - code += done(); - code += "}\n"; - return code; - }, - onTap: (i, run, done, doneBreak) => { - let code = ""; - if (i > 0) { - code += `if(${i} >= _results.length) {\n`; - code += done(); - code += "} else {\n"; - } - code += run(); - if (i > 0) code += "}\n"; - return code; - }, - onDone - }); - return code; - } -} - -const factory = new AsyncParallelBailHookCodeFactory(); - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function AsyncParallelBailHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = AsyncParallelBailHook; - hook.compile = COMPILE; - hook._call = undefined; - hook.call = undefined; - return hook; -} - -AsyncParallelBailHook.prototype = null; - -module.exports = AsyncParallelBailHook; diff --git a/node_modules/tapable/lib/AsyncParallelHook.js b/node_modules/tapable/lib/AsyncParallelHook.js deleted file mode 100644 index b7a3631..0000000 --- a/node_modules/tapable/lib/AsyncParallelHook.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class AsyncParallelHookCodeFactory extends HookCodeFactory { - content({ onError, onDone }) { - return this.callTapsParallel({ - onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true), - onDone - }); - } -} - -const factory = new AsyncParallelHookCodeFactory(); - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function AsyncParallelHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = AsyncParallelHook; - hook.compile = COMPILE; - hook._call = undefined; - hook.call = undefined; - return hook; -} - -AsyncParallelHook.prototype = null; - -module.exports = AsyncParallelHook; diff --git a/node_modules/tapable/lib/AsyncSeriesBailHook.js b/node_modules/tapable/lib/AsyncSeriesBailHook.js deleted file mode 100644 index 5df66df..0000000 --- a/node_modules/tapable/lib/AsyncSeriesBailHook.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class AsyncSeriesBailHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, resultReturns, onDone }) { - return this.callTapsSeries({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onResult: (i, result, next) => - `if(${result} !== undefined) {\n${onResult( - result - )}\n} else {\n${next()}}\n`, - resultReturns, - onDone - }); - } -} - -const factory = new AsyncSeriesBailHookCodeFactory(); - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function AsyncSeriesBailHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = AsyncSeriesBailHook; - hook.compile = COMPILE; - hook._call = undefined; - hook.call = undefined; - return hook; -} - -AsyncSeriesBailHook.prototype = null; - -module.exports = AsyncSeriesBailHook; diff --git a/node_modules/tapable/lib/AsyncSeriesHook.js b/node_modules/tapable/lib/AsyncSeriesHook.js deleted file mode 100644 index 3edad00..0000000 --- a/node_modules/tapable/lib/AsyncSeriesHook.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class AsyncSeriesHookCodeFactory extends HookCodeFactory { - content({ onError, onDone }) { - return this.callTapsSeries({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onDone - }); - } -} - -const factory = new AsyncSeriesHookCodeFactory(); - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function AsyncSeriesHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = AsyncSeriesHook; - hook.compile = COMPILE; - hook._call = undefined; - hook.call = undefined; - return hook; -} - -AsyncSeriesHook.prototype = null; - -module.exports = AsyncSeriesHook; diff --git a/node_modules/tapable/lib/AsyncSeriesLoopHook.js b/node_modules/tapable/lib/AsyncSeriesLoopHook.js deleted file mode 100644 index fb5f067..0000000 --- a/node_modules/tapable/lib/AsyncSeriesLoopHook.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class AsyncSeriesLoopHookCodeFactory extends HookCodeFactory { - content({ onError, onDone }) { - return this.callTapsLooping({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onDone - }); - } -} - -const factory = new AsyncSeriesLoopHookCodeFactory(); - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function AsyncSeriesLoopHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = AsyncSeriesLoopHook; - hook.compile = COMPILE; - hook._call = undefined; - hook.call = undefined; - return hook; -} - -AsyncSeriesLoopHook.prototype = null; - -module.exports = AsyncSeriesLoopHook; diff --git a/node_modules/tapable/lib/AsyncSeriesWaterfallHook.js b/node_modules/tapable/lib/AsyncSeriesWaterfallHook.js deleted file mode 100644 index 910b536..0000000 --- a/node_modules/tapable/lib/AsyncSeriesWaterfallHook.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class AsyncSeriesWaterfallHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, onDone }) { - return this.callTapsSeries({ - onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), - onResult: (i, result, next) => { - let code = ""; - code += `if(${result} !== undefined) {\n`; - code += `${this._args[0]} = ${result};\n`; - code += `}\n`; - code += next(); - return code; - }, - onDone: () => onResult(this._args[0]) - }); - } -} - -const factory = new AsyncSeriesWaterfallHookCodeFactory(); - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function AsyncSeriesWaterfallHook(args = [], name = undefined) { - if (args.length < 1) - throw new Error("Waterfall hooks must have at least one argument"); - const hook = new Hook(args, name); - hook.constructor = AsyncSeriesWaterfallHook; - hook.compile = COMPILE; - hook._call = undefined; - hook.call = undefined; - return hook; -} - -AsyncSeriesWaterfallHook.prototype = null; - -module.exports = AsyncSeriesWaterfallHook; diff --git a/node_modules/tapable/lib/Hook.js b/node_modules/tapable/lib/Hook.js deleted file mode 100644 index db04426..0000000 --- a/node_modules/tapable/lib/Hook.js +++ /dev/null @@ -1,175 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const util = require("util"); - -const deprecateContext = util.deprecate(() => {}, -"Hook.context is deprecated and will be removed"); - -const CALL_DELEGATE = function(...args) { - this.call = this._createCall("sync"); - return this.call(...args); -}; -const CALL_ASYNC_DELEGATE = function(...args) { - this.callAsync = this._createCall("async"); - return this.callAsync(...args); -}; -const PROMISE_DELEGATE = function(...args) { - this.promise = this._createCall("promise"); - return this.promise(...args); -}; - -class Hook { - constructor(args = [], name = undefined) { - this._args = args; - this.name = name; - this.taps = []; - this.interceptors = []; - this._call = CALL_DELEGATE; - this.call = CALL_DELEGATE; - this._callAsync = CALL_ASYNC_DELEGATE; - this.callAsync = CALL_ASYNC_DELEGATE; - this._promise = PROMISE_DELEGATE; - this.promise = PROMISE_DELEGATE; - this._x = undefined; - - this.compile = this.compile; - this.tap = this.tap; - this.tapAsync = this.tapAsync; - this.tapPromise = this.tapPromise; - } - - compile(options) { - throw new Error("Abstract: should be overridden"); - } - - _createCall(type) { - return this.compile({ - taps: this.taps, - interceptors: this.interceptors, - args: this._args, - type: type - }); - } - - _tap(type, options, fn) { - if (typeof options === "string") { - options = { - name: options.trim() - }; - } else if (typeof options !== "object" || options === null) { - throw new Error("Invalid tap options"); - } - if (typeof options.name !== "string" || options.name === "") { - throw new Error("Missing name for tap"); - } - if (typeof options.context !== "undefined") { - deprecateContext(); - } - options = Object.assign({ type, fn }, options); - options = this._runRegisterInterceptors(options); - this._insert(options); - } - - tap(options, fn) { - this._tap("sync", options, fn); - } - - tapAsync(options, fn) { - this._tap("async", options, fn); - } - - tapPromise(options, fn) { - this._tap("promise", options, fn); - } - - _runRegisterInterceptors(options) { - for (const interceptor of this.interceptors) { - if (interceptor.register) { - const newOptions = interceptor.register(options); - if (newOptions !== undefined) { - options = newOptions; - } - } - } - return options; - } - - withOptions(options) { - const mergeOptions = opt => - Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); - - return { - name: this.name, - tap: (opt, fn) => this.tap(mergeOptions(opt), fn), - tapAsync: (opt, fn) => this.tapAsync(mergeOptions(opt), fn), - tapPromise: (opt, fn) => this.tapPromise(mergeOptions(opt), fn), - intercept: interceptor => this.intercept(interceptor), - isUsed: () => this.isUsed(), - withOptions: opt => this.withOptions(mergeOptions(opt)) - }; - } - - isUsed() { - return this.taps.length > 0 || this.interceptors.length > 0; - } - - intercept(interceptor) { - this._resetCompilation(); - this.interceptors.push(Object.assign({}, interceptor)); - if (interceptor.register) { - for (let i = 0; i < this.taps.length; i++) { - this.taps[i] = interceptor.register(this.taps[i]); - } - } - } - - _resetCompilation() { - this.call = this._call; - this.callAsync = this._callAsync; - this.promise = this._promise; - } - - _insert(item) { - this._resetCompilation(); - let before; - if (typeof item.before === "string") { - before = new Set([item.before]); - } else if (Array.isArray(item.before)) { - before = new Set(item.before); - } - let stage = 0; - if (typeof item.stage === "number") { - stage = item.stage; - } - let i = this.taps.length; - while (i > 0) { - i--; - const x = this.taps[i]; - this.taps[i + 1] = x; - const xStage = x.stage || 0; - if (before) { - if (before.has(x.name)) { - before.delete(x.name); - continue; - } - if (before.size > 0) { - continue; - } - } - if (xStage > stage) { - continue; - } - i++; - break; - } - this.taps[i] = item; - } -} - -Object.setPrototypeOf(Hook.prototype, null); - -module.exports = Hook; diff --git a/node_modules/tapable/lib/HookCodeFactory.js b/node_modules/tapable/lib/HookCodeFactory.js deleted file mode 100644 index c9f5340..0000000 --- a/node_modules/tapable/lib/HookCodeFactory.js +++ /dev/null @@ -1,468 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -class HookCodeFactory { - constructor(config) { - this.config = config; - this.options = undefined; - this._args = undefined; - } - - create(options) { - this.init(options); - let fn; - switch (this.options.type) { - case "sync": - fn = new Function( - this.args(), - '"use strict";\n' + - this.header() + - this.contentWithInterceptors({ - onError: err => `throw ${err};\n`, - onResult: result => `return ${result};\n`, - resultReturns: true, - onDone: () => "", - rethrowIfPossible: true - }) - ); - break; - case "async": - fn = new Function( - this.args({ - after: "_callback" - }), - '"use strict";\n' + - this.header() + - this.contentWithInterceptors({ - onError: err => `_callback(${err});\n`, - onResult: result => `_callback(null, ${result});\n`, - onDone: () => "_callback();\n" - }) - ); - break; - case "promise": - let errorHelperUsed = false; - const content = this.contentWithInterceptors({ - onError: err => { - errorHelperUsed = true; - return `_error(${err});\n`; - }, - onResult: result => `_resolve(${result});\n`, - onDone: () => "_resolve();\n" - }); - let code = ""; - code += '"use strict";\n'; - code += this.header(); - code += "return new Promise((function(_resolve, _reject) {\n"; - if (errorHelperUsed) { - code += "var _sync = true;\n"; - code += "function _error(_err) {\n"; - code += "if(_sync)\n"; - code += - "_resolve(Promise.resolve().then((function() { throw _err; })));\n"; - code += "else\n"; - code += "_reject(_err);\n"; - code += "};\n"; - } - code += content; - if (errorHelperUsed) { - code += "_sync = false;\n"; - } - code += "}));\n"; - fn = new Function(this.args(), code); - break; - } - this.deinit(); - return fn; - } - - setup(instance, options) { - instance._x = options.taps.map(t => t.fn); - } - - /** - * @param {{ type: "sync" | "promise" | "async", taps: Array, interceptors: Array }} options - */ - init(options) { - this.options = options; - this._args = options.args.slice(); - } - - deinit() { - this.options = undefined; - this._args = undefined; - } - - contentWithInterceptors(options) { - if (this.options.interceptors.length > 0) { - const onError = options.onError; - const onResult = options.onResult; - const onDone = options.onDone; - let code = ""; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.call) { - code += `${this.getInterceptor(i)}.call(${this.args({ - before: interceptor.context ? "_context" : undefined - })});\n`; - } - } - code += this.content( - Object.assign(options, { - onError: - onError && - (err => { - let code = ""; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.error) { - code += `${this.getInterceptor(i)}.error(${err});\n`; - } - } - code += onError(err); - return code; - }), - onResult: - onResult && - (result => { - let code = ""; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.result) { - code += `${this.getInterceptor(i)}.result(${result});\n`; - } - } - code += onResult(result); - return code; - }), - onDone: - onDone && - (() => { - let code = ""; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.done) { - code += `${this.getInterceptor(i)}.done();\n`; - } - } - code += onDone(); - return code; - }) - }) - ); - return code; - } else { - return this.content(options); - } - } - - header() { - let code = ""; - if (this.needContext()) { - code += "var _context = {};\n"; - } else { - code += "var _context;\n"; - } - code += "var _x = this._x;\n"; - if (this.options.interceptors.length > 0) { - code += "var _taps = this.taps;\n"; - code += "var _interceptors = this.interceptors;\n"; - } - return code; - } - - needContext() { - for (const tap of this.options.taps) if (tap.context) return true; - return false; - } - - callTap(tapIndex, { onError, onResult, onDone, rethrowIfPossible }) { - let code = ""; - let hasTapCached = false; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.tap) { - if (!hasTapCached) { - code += `var _tap${tapIndex} = ${this.getTap(tapIndex)};\n`; - hasTapCached = true; - } - code += `${this.getInterceptor(i)}.tap(${ - interceptor.context ? "_context, " : "" - }_tap${tapIndex});\n`; - } - } - code += `var _fn${tapIndex} = ${this.getTapFn(tapIndex)};\n`; - const tap = this.options.taps[tapIndex]; - switch (tap.type) { - case "sync": - if (!rethrowIfPossible) { - code += `var _hasError${tapIndex} = false;\n`; - code += "try {\n"; - } - if (onResult) { - code += `var _result${tapIndex} = _fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined - })});\n`; - } else { - code += `_fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined - })});\n`; - } - if (!rethrowIfPossible) { - code += "} catch(_err) {\n"; - code += `_hasError${tapIndex} = true;\n`; - code += onError("_err"); - code += "}\n"; - code += `if(!_hasError${tapIndex}) {\n`; - } - if (onResult) { - code += onResult(`_result${tapIndex}`); - } - if (onDone) { - code += onDone(); - } - if (!rethrowIfPossible) { - code += "}\n"; - } - break; - case "async": - let cbCode = ""; - if (onResult) - cbCode += `(function(_err${tapIndex}, _result${tapIndex}) {\n`; - else cbCode += `(function(_err${tapIndex}) {\n`; - cbCode += `if(_err${tapIndex}) {\n`; - cbCode += onError(`_err${tapIndex}`); - cbCode += "} else {\n"; - if (onResult) { - cbCode += onResult(`_result${tapIndex}`); - } - if (onDone) { - cbCode += onDone(); - } - cbCode += "}\n"; - cbCode += "})"; - code += `_fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined, - after: cbCode - })});\n`; - break; - case "promise": - code += `var _hasResult${tapIndex} = false;\n`; - code += `var _promise${tapIndex} = _fn${tapIndex}(${this.args({ - before: tap.context ? "_context" : undefined - })});\n`; - code += `if (!_promise${tapIndex} || !_promise${tapIndex}.then)\n`; - code += ` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${tapIndex} + ')');\n`; - code += `_promise${tapIndex}.then((function(_result${tapIndex}) {\n`; - code += `_hasResult${tapIndex} = true;\n`; - if (onResult) { - code += onResult(`_result${tapIndex}`); - } - if (onDone) { - code += onDone(); - } - code += `}), function(_err${tapIndex}) {\n`; - code += `if(_hasResult${tapIndex}) throw _err${tapIndex};\n`; - code += onError(`_err${tapIndex}`); - code += "});\n"; - break; - } - return code; - } - - callTapsSeries({ - onError, - onResult, - resultReturns, - onDone, - doneReturns, - rethrowIfPossible - }) { - if (this.options.taps.length === 0) return onDone(); - const firstAsync = this.options.taps.findIndex(t => t.type !== "sync"); - const somethingReturns = resultReturns || doneReturns; - let code = ""; - let current = onDone; - let unrollCounter = 0; - for (let j = this.options.taps.length - 1; j >= 0; j--) { - const i = j; - const unroll = - current !== onDone && - (this.options.taps[i].type !== "sync" || unrollCounter++ > 20); - if (unroll) { - unrollCounter = 0; - code += `function _next${i}() {\n`; - code += current(); - code += `}\n`; - current = () => `${somethingReturns ? "return " : ""}_next${i}();\n`; - } - const done = current; - const doneBreak = skipDone => { - if (skipDone) return ""; - return onDone(); - }; - const content = this.callTap(i, { - onError: error => onError(i, error, done, doneBreak), - onResult: - onResult && - (result => { - return onResult(i, result, done, doneBreak); - }), - onDone: !onResult && done, - rethrowIfPossible: - rethrowIfPossible && (firstAsync < 0 || i < firstAsync) - }); - current = () => content; - } - code += current(); - return code; - } - - callTapsLooping({ onError, onDone, rethrowIfPossible }) { - if (this.options.taps.length === 0) return onDone(); - const syncOnly = this.options.taps.every(t => t.type === "sync"); - let code = ""; - if (!syncOnly) { - code += "var _looper = (function() {\n"; - code += "var _loopAsync = false;\n"; - } - code += "var _loop;\n"; - code += "do {\n"; - code += "_loop = false;\n"; - for (let i = 0; i < this.options.interceptors.length; i++) { - const interceptor = this.options.interceptors[i]; - if (interceptor.loop) { - code += `${this.getInterceptor(i)}.loop(${this.args({ - before: interceptor.context ? "_context" : undefined - })});\n`; - } - } - code += this.callTapsSeries({ - onError, - onResult: (i, result, next, doneBreak) => { - let code = ""; - code += `if(${result} !== undefined) {\n`; - code += "_loop = true;\n"; - if (!syncOnly) code += "if(_loopAsync) _looper();\n"; - code += doneBreak(true); - code += `} else {\n`; - code += next(); - code += `}\n`; - return code; - }, - onDone: - onDone && - (() => { - let code = ""; - code += "if(!_loop) {\n"; - code += onDone(); - code += "}\n"; - return code; - }), - rethrowIfPossible: rethrowIfPossible && syncOnly - }); - code += "} while(_loop);\n"; - if (!syncOnly) { - code += "_loopAsync = true;\n"; - code += "});\n"; - code += "_looper();\n"; - } - return code; - } - - callTapsParallel({ - onError, - onResult, - onDone, - rethrowIfPossible, - onTap = (i, run) => run() - }) { - if (this.options.taps.length <= 1) { - return this.callTapsSeries({ - onError, - onResult, - onDone, - rethrowIfPossible - }); - } - let code = ""; - code += "do {\n"; - code += `var _counter = ${this.options.taps.length};\n`; - if (onDone) { - code += "var _done = (function() {\n"; - code += onDone(); - code += "});\n"; - } - for (let i = 0; i < this.options.taps.length; i++) { - const done = () => { - if (onDone) return "if(--_counter === 0) _done();\n"; - else return "--_counter;"; - }; - const doneBreak = skipDone => { - if (skipDone || !onDone) return "_counter = 0;\n"; - else return "_counter = 0;\n_done();\n"; - }; - code += "if(_counter <= 0) break;\n"; - code += onTap( - i, - () => - this.callTap(i, { - onError: error => { - let code = ""; - code += "if(_counter > 0) {\n"; - code += onError(i, error, done, doneBreak); - code += "}\n"; - return code; - }, - onResult: - onResult && - (result => { - let code = ""; - code += "if(_counter > 0) {\n"; - code += onResult(i, result, done, doneBreak); - code += "}\n"; - return code; - }), - onDone: - !onResult && - (() => { - return done(); - }), - rethrowIfPossible - }), - done, - doneBreak - ); - } - code += "} while(false);\n"; - return code; - } - - args({ before, after } = {}) { - let allArgs = this._args; - if (before) allArgs = [before].concat(allArgs); - if (after) allArgs = allArgs.concat(after); - if (allArgs.length === 0) { - return ""; - } else { - return allArgs.join(", "); - } - } - - getTapFn(idx) { - return `_x[${idx}]`; - } - - getTap(idx) { - return `_taps[${idx}]`; - } - - getInterceptor(idx) { - return `_interceptors[${idx}]`; - } -} - -module.exports = HookCodeFactory; diff --git a/node_modules/tapable/lib/HookMap.js b/node_modules/tapable/lib/HookMap.js deleted file mode 100644 index 129ad6a..0000000 --- a/node_modules/tapable/lib/HookMap.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const util = require("util"); - -const defaultFactory = (key, hook) => hook; - -class HookMap { - constructor(factory, name = undefined) { - this._map = new Map(); - this.name = name; - this._factory = factory; - this._interceptors = []; - } - - get(key) { - return this._map.get(key); - } - - for(key) { - const hook = this.get(key); - if (hook !== undefined) { - return hook; - } - let newHook = this._factory(key); - const interceptors = this._interceptors; - for (let i = 0; i < interceptors.length; i++) { - newHook = interceptors[i].factory(key, newHook); - } - this._map.set(key, newHook); - return newHook; - } - - intercept(interceptor) { - this._interceptors.push( - Object.assign( - { - factory: defaultFactory - }, - interceptor - ) - ); - } -} - -HookMap.prototype.tap = util.deprecate(function(key, options, fn) { - return this.for(key).tap(options, fn); -}, "HookMap#tap(key,…) is deprecated. Use HookMap#for(key).tap(…) instead."); - -HookMap.prototype.tapAsync = util.deprecate(function(key, options, fn) { - return this.for(key).tapAsync(options, fn); -}, "HookMap#tapAsync(key,…) is deprecated. Use HookMap#for(key).tapAsync(…) instead."); - -HookMap.prototype.tapPromise = util.deprecate(function(key, options, fn) { - return this.for(key).tapPromise(options, fn); -}, "HookMap#tapPromise(key,…) is deprecated. Use HookMap#for(key).tapPromise(…) instead."); - -module.exports = HookMap; diff --git a/node_modules/tapable/lib/MultiHook.js b/node_modules/tapable/lib/MultiHook.js deleted file mode 100644 index e4fc2ce..0000000 --- a/node_modules/tapable/lib/MultiHook.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); - -class MultiHook { - constructor(hooks, name = undefined) { - this.hooks = hooks; - this.name = name; - } - - tap(options, fn) { - for (const hook of this.hooks) { - hook.tap(options, fn); - } - } - - tapAsync(options, fn) { - for (const hook of this.hooks) { - hook.tapAsync(options, fn); - } - } - - tapPromise(options, fn) { - for (const hook of this.hooks) { - hook.tapPromise(options, fn); - } - } - - isUsed() { - for (const hook of this.hooks) { - if (hook.isUsed()) return true; - } - return false; - } - - intercept(interceptor) { - for (const hook of this.hooks) { - hook.intercept(interceptor); - } - } - - withOptions(options) { - return new MultiHook( - this.hooks.map(h => h.withOptions(options)), - this.name - ); - } -} - -module.exports = MultiHook; diff --git a/node_modules/tapable/lib/SyncBailHook.js b/node_modules/tapable/lib/SyncBailHook.js deleted file mode 100644 index bdd5b45..0000000 --- a/node_modules/tapable/lib/SyncBailHook.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class SyncBailHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, resultReturns, onDone, rethrowIfPossible }) { - return this.callTapsSeries({ - onError: (i, err) => onError(err), - onResult: (i, result, next) => - `if(${result} !== undefined) {\n${onResult( - result - )};\n} else {\n${next()}}\n`, - resultReturns, - onDone, - rethrowIfPossible - }); - } -} - -const factory = new SyncBailHookCodeFactory(); - -const TAP_ASYNC = () => { - throw new Error("tapAsync is not supported on a SyncBailHook"); -}; - -const TAP_PROMISE = () => { - throw new Error("tapPromise is not supported on a SyncBailHook"); -}; - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function SyncBailHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = SyncBailHook; - hook.tapAsync = TAP_ASYNC; - hook.tapPromise = TAP_PROMISE; - hook.compile = COMPILE; - return hook; -} - -SyncBailHook.prototype = null; - -module.exports = SyncBailHook; diff --git a/node_modules/tapable/lib/SyncHook.js b/node_modules/tapable/lib/SyncHook.js deleted file mode 100644 index e2512be..0000000 --- a/node_modules/tapable/lib/SyncHook.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class SyncHookCodeFactory extends HookCodeFactory { - content({ onError, onDone, rethrowIfPossible }) { - return this.callTapsSeries({ - onError: (i, err) => onError(err), - onDone, - rethrowIfPossible - }); - } -} - -const factory = new SyncHookCodeFactory(); - -const TAP_ASYNC = () => { - throw new Error("tapAsync is not supported on a SyncHook"); -}; - -const TAP_PROMISE = () => { - throw new Error("tapPromise is not supported on a SyncHook"); -}; - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function SyncHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = SyncHook; - hook.tapAsync = TAP_ASYNC; - hook.tapPromise = TAP_PROMISE; - hook.compile = COMPILE; - return hook; -} - -SyncHook.prototype = null; - -module.exports = SyncHook; diff --git a/node_modules/tapable/lib/SyncLoopHook.js b/node_modules/tapable/lib/SyncLoopHook.js deleted file mode 100644 index be0e4fd..0000000 --- a/node_modules/tapable/lib/SyncLoopHook.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class SyncLoopHookCodeFactory extends HookCodeFactory { - content({ onError, onDone, rethrowIfPossible }) { - return this.callTapsLooping({ - onError: (i, err) => onError(err), - onDone, - rethrowIfPossible - }); - } -} - -const factory = new SyncLoopHookCodeFactory(); - -const TAP_ASYNC = () => { - throw new Error("tapAsync is not supported on a SyncLoopHook"); -}; - -const TAP_PROMISE = () => { - throw new Error("tapPromise is not supported on a SyncLoopHook"); -}; - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function SyncLoopHook(args = [], name = undefined) { - const hook = new Hook(args, name); - hook.constructor = SyncLoopHook; - hook.tapAsync = TAP_ASYNC; - hook.tapPromise = TAP_PROMISE; - hook.compile = COMPILE; - return hook; -} - -SyncLoopHook.prototype = null; - -module.exports = SyncLoopHook; diff --git a/node_modules/tapable/lib/SyncWaterfallHook.js b/node_modules/tapable/lib/SyncWaterfallHook.js deleted file mode 100644 index c878b7f..0000000 --- a/node_modules/tapable/lib/SyncWaterfallHook.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const Hook = require("./Hook"); -const HookCodeFactory = require("./HookCodeFactory"); - -class SyncWaterfallHookCodeFactory extends HookCodeFactory { - content({ onError, onResult, resultReturns, rethrowIfPossible }) { - return this.callTapsSeries({ - onError: (i, err) => onError(err), - onResult: (i, result, next) => { - let code = ""; - code += `if(${result} !== undefined) {\n`; - code += `${this._args[0]} = ${result};\n`; - code += `}\n`; - code += next(); - return code; - }, - onDone: () => onResult(this._args[0]), - doneReturns: resultReturns, - rethrowIfPossible - }); - } -} - -const factory = new SyncWaterfallHookCodeFactory(); - -const TAP_ASYNC = () => { - throw new Error("tapAsync is not supported on a SyncWaterfallHook"); -}; - -const TAP_PROMISE = () => { - throw new Error("tapPromise is not supported on a SyncWaterfallHook"); -}; - -const COMPILE = function(options) { - factory.setup(this, options); - return factory.create(options); -}; - -function SyncWaterfallHook(args = [], name = undefined) { - if (args.length < 1) - throw new Error("Waterfall hooks must have at least one argument"); - const hook = new Hook(args, name); - hook.constructor = SyncWaterfallHook; - hook.tapAsync = TAP_ASYNC; - hook.tapPromise = TAP_PROMISE; - hook.compile = COMPILE; - return hook; -} - -SyncWaterfallHook.prototype = null; - -module.exports = SyncWaterfallHook; diff --git a/node_modules/tapable/lib/index.js b/node_modules/tapable/lib/index.js deleted file mode 100644 index 0a94a53..0000000 --- a/node_modules/tapable/lib/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -exports.__esModule = true; -exports.SyncHook = require("./SyncHook"); -exports.SyncBailHook = require("./SyncBailHook"); -exports.SyncWaterfallHook = require("./SyncWaterfallHook"); -exports.SyncLoopHook = require("./SyncLoopHook"); -exports.AsyncParallelHook = require("./AsyncParallelHook"); -exports.AsyncParallelBailHook = require("./AsyncParallelBailHook"); -exports.AsyncSeriesHook = require("./AsyncSeriesHook"); -exports.AsyncSeriesBailHook = require("./AsyncSeriesBailHook"); -exports.AsyncSeriesLoopHook = require("./AsyncSeriesLoopHook"); -exports.AsyncSeriesWaterfallHook = require("./AsyncSeriesWaterfallHook"); -exports.HookMap = require("./HookMap"); -exports.MultiHook = require("./MultiHook"); diff --git a/node_modules/tapable/lib/util-browser.js b/node_modules/tapable/lib/util-browser.js deleted file mode 100644 index ee4fb9a..0000000 --- a/node_modules/tapable/lib/util-browser.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -exports.deprecate = (fn, msg) => { - let once = true; - return function() { - if (once) { - console.warn("DeprecationWarning: " + msg); - once = false; - } - return fn.apply(this, arguments); - }; -}; diff --git a/node_modules/tapable/package.json b/node_modules/tapable/package.json deleted file mode 100644 index 3c13120..0000000 --- a/node_modules/tapable/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "tapable", - "version": "2.2.1", - "author": "Tobias Koppers @sokra", - "description": "Just a little module for plugins.", - "license": "MIT", - "homepage": "https://github.com/webpack/tapable", - "repository": { - "type": "git", - "url": "http://github.com/webpack/tapable.git" - }, - "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/preset-env": "^7.4.4", - "babel-jest": "^24.8.0", - "codecov": "^3.5.0", - "jest": "^24.8.0", - "prettier": "^1.17.1" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "lib", - "!lib/__tests__", - "tapable.d.ts" - ], - "main": "lib/index.js", - "types": "./tapable.d.ts", - "browser": { - "util": "./lib/util-browser.js" - }, - "scripts": { - "test": "jest", - "travis": "yarn pretty-lint && jest --coverage && codecov", - "pretty-lint": "prettier --check lib/*.js lib/__tests__/*.js", - "pretty": "prettier --loglevel warn --write lib/*.js lib/__tests__/*.js" - }, - "jest": { - "transform": { - "__tests__[\\\\/].+\\.js$": "babel-jest" - } - } -} diff --git a/node_modules/tapable/tapable.d.ts b/node_modules/tapable/tapable.d.ts deleted file mode 100644 index 0201c9a..0000000 --- a/node_modules/tapable/tapable.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -type FixedSizeArray = T extends 0 - ? void[] - : ReadonlyArray & { - 0: U; - length: T; - }; -type Measure = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - ? T - : never; -type Append = { - 0: [U]; - 1: [T[0], U]; - 2: [T[0], T[1], U]; - 3: [T[0], T[1], T[2], U]; - 4: [T[0], T[1], T[2], T[3], U]; - 5: [T[0], T[1], T[2], T[3], T[4], U]; - 6: [T[0], T[1], T[2], T[3], T[4], T[5], U]; - 7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U]; - 8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U]; -}[Measure]; -type AsArray = T extends any[] ? T : [T]; - -declare class UnsetAdditionalOptions { - _UnsetAdditionalOptions: true -} -type IfSet = X extends UnsetAdditionalOptions ? {} : X; - -type Callback = (error: E | null, result?: T) => void; -type InnerCallback = (error?: E | null | false, result?: T) => void; - -type FullTap = Tap & { - type: "sync" | "async" | "promise", - fn: Function -} - -type Tap = TapOptions & { - name: string; -}; - -type TapOptions = { - before?: string; - stage?: number; -}; - -interface HookInterceptor { - name?: string; - tap?: (tap: FullTap & IfSet) => void; - call?: (...args: any[]) => void; - loop?: (...args: any[]) => void; - error?: (err: Error) => void; - result?: (result: R) => void; - done?: () => void; - register?: (tap: FullTap & IfSet) => FullTap & IfSet; -} - -type ArgumentNames = FixedSizeArray; - -declare class Hook { - constructor(args?: ArgumentNames>, name?: string); - name: string | undefined; - taps: FullTap[]; - intercept(interceptor: HookInterceptor): void; - isUsed(): boolean; - callAsync(...args: Append, Callback>): void; - promise(...args: AsArray): Promise; - tap(options: string | Tap & IfSet, fn: (...args: AsArray) => R): void; - withOptions(options: TapOptions & IfSet): Omit; -} - -export class SyncHook extends Hook { - call(...args: AsArray): R; -} - -export class SyncBailHook extends SyncHook {} -export class SyncLoopHook extends SyncHook {} -export class SyncWaterfallHook extends SyncHook[0], AdditionalOptions> {} - -declare class AsyncHook extends Hook { - tapAsync( - options: string | Tap & IfSet, - fn: (...args: Append, InnerCallback>) => void - ): void; - tapPromise( - options: string | Tap & IfSet, - fn: (...args: AsArray) => Promise - ): void; -} - -export class AsyncParallelHook extends AsyncHook {} -export class AsyncParallelBailHook extends AsyncHook {} -export class AsyncSeriesHook extends AsyncHook {} -export class AsyncSeriesBailHook extends AsyncHook {} -export class AsyncSeriesLoopHook extends AsyncHook {} -export class AsyncSeriesWaterfallHook extends AsyncHook[0], AdditionalOptions> {} - -type HookFactory = (key: any, hook?: H) => H; - -interface HookMapInterceptor { - factory?: HookFactory; -} - -export class HookMap { - constructor(factory: HookFactory, name?: string); - name: string | undefined; - get(key: any): H | undefined; - for(key: any): H; - intercept(interceptor: HookMapInterceptor): void; -} - -export class MultiHook { - constructor(hooks: H[], name?: string); - name: string | undefined; - tap(options: string | Tap, fn?: Function): void; - tapAsync(options: string | Tap, fn?: Function): void; - tapPromise(options: string | Tap, fn?: Function): void; -} diff --git a/node_modules/terser-webpack-plugin/LICENSE b/node_modules/terser-webpack-plugin/LICENSE deleted file mode 100644 index 8c11fc7..0000000 --- a/node_modules/terser-webpack-plugin/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/terser-webpack-plugin/README.md b/node_modules/terser-webpack-plugin/README.md deleted file mode 100644 index a3c24e3..0000000 --- a/node_modules/terser-webpack-plugin/README.md +++ /dev/null @@ -1,934 +0,0 @@ - - -[![npm][npm]][npm-url] -[![node][node]][node-url] -[![tests][tests]][tests-url] -[![cover][cover]][cover-url] -[![discussion][discussion]][discussion-url] -[![size][size]][size-url] - -# terser-webpack-plugin - -This plugin uses [terser](https://github.com/terser/terser) to minify/minimize your JavaScript. - -## Getting Started - -Webpack v5 comes with the latest `terser-webpack-plugin` out of the box. If you are using Webpack v5 or above and wish to customize the options, you will still need to install `terser-webpack-plugin`. Using Webpack v4, you have to install `terser-webpack-plugin` v4. - -To begin, you'll need to install `terser-webpack-plugin`: - -```console -npm install terser-webpack-plugin --save-dev -``` - -or - -```console -yarn add -D terser-webpack-plugin -``` - -or - -```console -pnpm add -D terser-webpack-plugin -``` - -Then add the plugin to your `webpack` config. For example: - -**webpack.config.js** - -```js -const TerserPlugin = require("terser-webpack-plugin"); - -module.exports = { - optimization: { - minimize: true, - minimizer: [new TerserPlugin()], - }, -}; -``` - -And run `webpack` via your preferred method. - -## Note about source maps - -**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.** - -Why? - -- `eval` wraps modules in `eval("string")` and the minimizer does not handle strings. -- `cheap` has not column information and minimizer generate only a single line, which leave only a single mapping. - -Using supported `devtool` values enable source map generation. - -## Options - -- **[`test`](#test)** -- **[`include`](#include)** -- **[`exclude`](#exclude)** -- **[`parallel`](#parallel)** -- **[`minify`](#minify)** -- **[`terserOptions`](#terseroptions)** -- **[`extractComments`](#extractcomments)** - -### `test` - -Type: - -```ts -type test = string | RegExp | Array; -``` - -Default: `/\.m?js(\?.*)?$/i` - -Test to match files against. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - test: /\.js(\?.*)?$/i, - }), - ], - }, -}; -``` - -### `include` - -Type: - -```ts -type include = string | RegExp | Array; -``` - -Default: `undefined` - -Files to include. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - include: /\/includes/, - }), - ], - }, -}; -``` - -### `exclude` - -Type: - -```ts -type exclude = string | RegExp | Array; -``` - -Default: `undefined` - -Files to exclude. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - exclude: /\/excludes/, - }), - ], - }, -}; -``` - -### `parallel` - -Type: - -```ts -type parallel = boolean | number; -``` - -Default: `true` - -Use multi-process parallel running to improve the build speed. -Default number of concurrent runs: `os.cpus().length - 1`. - -> **Note** -> -> Parallelization can speedup your build significantly and is therefore **highly recommended**. - -> **Warning** -> -> If you use **Circle CI** or any other environment that doesn't provide real available count of CPUs then you need to setup explicitly number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack-contrib/terser-webpack-plugin/issues/143), [#202](https://github.com/webpack-contrib/terser-webpack-plugin/issues/202)). - -#### `boolean` - -Enable/disable multi-process parallel running. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - parallel: true, - }), - ], - }, -}; -``` - -#### `number` - -Enable multi-process parallel running and set number of concurrent runs. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - parallel: 4, - }), - ], - }, -}; -``` - -### `minify` - -Type: - -```ts -type minify = ( - input: { - [file: string]: string; - }, - sourceMap: import("@jridgewell/trace-mapping").SourceMapInput | undefined, - minifyOptions: { - module?: boolean | undefined; - ecma?: import("terser").ECMA | undefined; - }, - extractComments: - | boolean - | "all" - | "some" - | RegExp - | (( - astNode: any, - comment: { - value: string; - type: "comment1" | "comment2" | "comment3" | "comment4"; - pos: number; - line: number; - col: number; - } - ) => boolean) - | { - condition?: - | boolean - | "all" - | "some" - | RegExp - | (( - astNode: any, - comment: { - value: string; - type: "comment1" | "comment2" | "comment3" | "comment4"; - pos: number; - line: number; - col: number; - } - ) => boolean) - | undefined; - filename?: string | ((fileData: any) => string) | undefined; - banner?: - | string - | boolean - | ((commentsFile: string) => string) - | undefined; - } - | undefined -) => Promise<{ - code: string; - map?: import("@jridgewell/trace-mapping").SourceMapInput | undefined; - errors?: (string | Error)[] | undefined; - warnings?: (string | Error)[] | undefined; - extractedComments?: string[] | undefined; -}>; -``` - -Default: `TerserPlugin.terserMinify` - -Allows you to override default minify function. -By default plugin uses [terser](https://github.com/terser/terser) package. -Useful for using and testing unpublished versions or forks. - -> **Warning** -> -> **Always use `require` inside `minify` function when `parallel` option enabled**. - -**webpack.config.js** - -```js -// Can be async -const minify = (input, sourceMap, minimizerOptions, extractsComments) => { - // The `minimizerOptions` option contains option from the `terserOptions` option - // You can use `minimizerOptions.myCustomOption` - - // Custom logic for extract comments - const { map, code } = require("uglify-module") // Or require('./path/to/uglify-module') - .minify(input, { - /* Your options for minification */ - }); - - return { map, code, warnings: [], errors: [], extractedComments: [] }; -}; - -// Used to regenerate `fullhash`/`chunkhash` between different implementation -// Example: you fix a bug in custom minimizer/custom function, but unfortunately webpack doesn't know about it, so you will get the same fullhash/chunkhash -// to avoid this you can provide version of your custom minimizer -// You don't need if you use only `contenthash` -minify.getMinimizerVersion = () => { - let packageJson; - - try { - // eslint-disable-next-line global-require, import/no-extraneous-dependencies - packageJson = require("uglify-module/package.json"); - } catch (error) { - // Ignore - } - - return packageJson && packageJson.version; -}; - -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - terserOptions: { - myCustomOption: true, - }, - minify, - }), - ], - }, -}; -``` - -### `terserOptions` - -Type: - -```ts -type terserOptions = { - compress?: boolean | CompressOptions; - ecma?: ECMA; - enclose?: boolean | string; - ie8?: boolean; - keep_classnames?: boolean | RegExp; - keep_fnames?: boolean | RegExp; - mangle?: boolean | MangleOptions; - module?: boolean; - nameCache?: object; - format?: FormatOptions; - /** @deprecated */ - output?: FormatOptions; - parse?: ParseOptions; - safari10?: boolean; - sourceMap?: boolean | SourceMapOptions; - toplevel?: boolean; -}; -``` - -Default: [default](https://github.com/terser/terser#minify-options) - -Terser [options](https://github.com/terser/terser#minify-options). - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - terserOptions: { - ecma: undefined, - parse: {}, - compress: {}, - mangle: true, // Note `mangle.properties` is `false` by default. - module: false, - // Deprecated - output: null, - format: null, - toplevel: false, - nameCache: null, - ie8: false, - keep_classnames: undefined, - keep_fnames: false, - safari10: false, - }, - }), - ], - }, -}; -``` - -### `extractComments` - -Type: - -```ts -type extractComments = - | boolean - | string - | RegExp - | (( - astNode: any, - comment: { - value: string; - type: "comment1" | "comment2" | "comment3" | "comment4"; - pos: number; - line: number; - col: number; - } - ) => boolean) - | { - condition?: - | boolean - | "all" - | "some" - | RegExp - | (( - astNode: any, - comment: { - value: string; - type: "comment1" | "comment2" | "comment3" | "comment4"; - pos: number; - line: number; - col: number; - } - ) => boolean) - | undefined; - filename?: string | ((fileData: any) => string) | undefined; - banner?: - | string - | boolean - | ((commentsFile: string) => string) - | undefined; - }; -``` - -Default: `true` - -Whether comments shall be extracted to a separate file, (see [details](https://github.com/webpack/webpack/commit/71933e979e51c533b432658d5e37917f9e71595a)). -By default extract only comments using `/^\**!|@preserve|@license|@cc_on/i` regexp condition and remove remaining comments. -If the original file is named `foo.js`, then the comments will be stored to `foo.js.LICENSE.txt`. -The `terserOptions.format.comments` option specifies whether the comment will be preserved, i.e. it is possible to preserve some comments (e.g. annotations) while extracting others or even preserving comments that have been extracted. - -#### `boolean` - -Enable/disable extracting comments. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: true, - }), - ], - }, -}; -``` - -#### `string` - -Extract `all` or `some` (use `/^\**!|@preserve|@license|@cc_on/i` RegExp) comments. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: "all", - }), - ], - }, -}; -``` - -#### `RegExp` - -All comments that match the given expression will be extracted to the separate file. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: /@extract/i, - }), - ], - }, -}; -``` - -#### `function` - -All comments that match the given expression will be extracted to the separate file. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: (astNode, comment) => { - if (/@extract/i.test(comment.value)) { - return true; - } - - return false; - }, - }), - ], - }, -}; -``` - -#### `object` - -Allow to customize condition for extract comments, specify extracted file name and banner. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: { - condition: /^\**!|@preserve|@license|@cc_on/i, - filename: (fileData) => { - // The "fileData" argument contains object with "filename", "basename", "query" and "hash" - return `${fileData.filename}.LICENSE.txt${fileData.query}`; - }, - banner: (licenseFile) => { - return `License information can be found in ${licenseFile}`; - }, - }, - }), - ], - }, -}; -``` - -##### `condition` - -Type: - -```ts -type condition = - | boolean - | "all" - | "some" - | RegExp - | (( - astNode: any, - comment: { - value: string; - type: "comment1" | "comment2" | "comment3" | "comment4"; - pos: number; - line: number; - col: number; - } - ) => boolean) - | undefined; -``` - -Condition what comments you need extract. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: { - condition: "some", - filename: (fileData) => { - // The "fileData" argument contains object with "filename", "basename", "query" and "hash" - return `${fileData.filename}.LICENSE.txt${fileData.query}`; - }, - banner: (licenseFile) => { - return `License information can be found in ${licenseFile}`; - }, - }, - }), - ], - }, -}; -``` - -##### `filename` - -Type: - -```ts -type filename = string | ((fileData: any) => string) | undefined; -``` - -Default: `[file].LICENSE.txt[query]` - -Available placeholders: `[file]`, `[query]` and `[filebase]` (`[base]` for webpack 5). - -The file where the extracted comments will be stored. -Default is to append the suffix `.LICENSE.txt` to the original filename. - -> **Warning** -> -> We highly recommend using the `txt` extension. Using `js`/`cjs`/`mjs` extensions may conflict with existing assets which leads to broken code. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: { - condition: /^\**!|@preserve|@license|@cc_on/i, - filename: "extracted-comments.js", - banner: (licenseFile) => { - return `License information can be found in ${licenseFile}`; - }, - }, - }), - ], - }, -}; -``` - -##### `banner` - -Type: - -```ts -type banner = string | boolean | ((commentsFile: string) => string) | undefined; -``` - -Default: `/*! For license information please see ${commentsFile} */` - -The banner text that points to the extracted file and will be added on top of the original file. -Can be `false` (no banner), a `String`, or a `Function<(string) -> String>` that will be called with the filename where extracted comments have been stored. -Will be wrapped into comment. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: { - condition: true, - filename: (fileData) => { - // The "fileData" argument contains object with "filename", "basename", "query" and "hash" - return `${fileData.filename}.LICENSE.txt${fileData.query}`; - }, - banner: (commentsFile) => { - return `My custom banner about license information ${commentsFile}`; - }, - }, - }), - ], - }, -}; -``` - -## Examples - -### Preserve Comments - -Extract all legal comments (i.e. `/^\**!|@preserve|@license|@cc_on/i`) and preserve `/@license/i` comments. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - terserOptions: { - format: { - comments: /@license/i, - }, - }, - extractComments: true, - }), - ], - }, -}; -``` - -### Remove Comments - -If you avoid building with comments, use this config: - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - terserOptions: { - format: { - comments: false, - }, - }, - extractComments: false, - }), - ], - }, -}; -``` - -### [`uglify-js`](https://github.com/mishoo/UglifyJS) - -[`UglifyJS`](https://github.com/mishoo/UglifyJS) is a JavaScript parser, minifier, compressor and beautifier toolkit. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - minify: TerserPlugin.uglifyJsMinify, - // `terserOptions` options will be passed to `uglify-js` - // Link to options - https://github.com/mishoo/UglifyJS#minify-options - terserOptions: {}, - }), - ], - }, -}; -``` - -### [`swc`](https://github.com/swc-project/swc) - -[`swc`](https://github.com/swc-project/swc) is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript. - -> **Warning** -> -> the `extractComments` option is not supported and all comments will be removed by default, it will be fixed in future - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - minify: TerserPlugin.swcMinify, - // `terserOptions` options will be passed to `swc` (`@swc/core`) - // Link to options - https://swc.rs/docs/config-js-minify - terserOptions: {}, - }), - ], - }, -}; -``` - -### [`esbuild`](https://github.com/evanw/esbuild) - -[`esbuild`](https://github.com/evanw/esbuild) is an extremely fast JavaScript bundler and minifier. - -> **Warning** -> -> the `extractComments` option is not supported and all legal comments (i.e. copyright, licenses and etc) will be preserved - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - minify: TerserPlugin.esbuildMinify, - // `terserOptions` options will be passed to `esbuild` - // Link to options - https://esbuild.github.io/api/#minify - // Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use: - // terserOptions: { - // minify: false, - // minifyWhitespace: true, - // minifyIdentifiers: false, - // minifySyntax: true, - // }, - terserOptions: {}, - }), - ], - }, -}; -``` - -### Custom Minify Function - -Override default minify function - use `uglify-js` for minification. - -**webpack.config.js** - -```js -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - minify: (file, sourceMap) => { - // https://github.com/mishoo/UglifyJS2#minify-options - const uglifyJsOptions = { - /* your `uglify-js` package options */ - }; - - if (sourceMap) { - uglifyJsOptions.sourceMap = { - content: sourceMap, - }; - } - - return require("uglify-js").minify(file, uglifyJsOptions); - }, - }), - ], - }, -}; -``` - -### Typescript - -With default terser minify function: - -```ts -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - terserOptions: { - compress: true, - }, - }), - ], - }, -}; -``` - -With built-in minify functions: - -```ts -import type { JsMinifyOptions as SwcOptions } from "@swc/core"; -import type { MinifyOptions as UglifyJSOptions } from "uglify-js"; -import type { TransformOptions as EsbuildOptions } from "esbuild"; -import type { MinifyOptions as TerserOptions } from "terser"; - -module.exports = { - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - minify: TerserPlugin.swcMinify, - terserOptions: { - // `swc` options - }, - }), - new TerserPlugin({ - minify: TerserPlugin.uglifyJsMinify, - terserOptions: { - // `uglif-js` options - }, - }), - new TerserPlugin({ - minify: TerserPlugin.esbuildMinify, - terserOptions: { - // `esbuild` options - }, - }), - - // Alternative usage: - new TerserPlugin({ - minify: TerserPlugin.terserMinify, - terserOptions: { - // `terser` options - }, - }), - ], - }, -}; -``` - -## Contributing - -Please take a moment to read our contributing guidelines if you haven't yet done so. - -[CONTRIBUTING](./.github/CONTRIBUTING.md) - -## License - -[MIT](./LICENSE) - -[npm]: https://img.shields.io/npm/v/terser-webpack-plugin.svg -[npm-url]: https://npmjs.com/package/terser-webpack-plugin -[node]: https://img.shields.io/node/v/terser-webpack-plugin.svg -[node-url]: https://nodejs.org -[tests]: https://github.com/webpack-contrib/terser-webpack-plugin/workflows/terser-webpack-plugin/badge.svg -[tests-url]: https://github.com/webpack-contrib/terser-webpack-plugin/actions -[cover]: https://codecov.io/gh/webpack-contrib/terser-webpack-plugin/branch/master/graph/badge.svg -[cover-url]: https://codecov.io/gh/webpack-contrib/terser-webpack-plugin -[discussion]: https://img.shields.io/github/discussions/webpack/webpack -[discussion-url]: https://github.com/webpack/webpack/discussions -[size]: https://packagephobia.now.sh/badge?p=terser-webpack-plugin -[size-url]: https://packagephobia.now.sh/result?p=terser-webpack-plugin diff --git a/node_modules/terser-webpack-plugin/dist/index.js b/node_modules/terser-webpack-plugin/dist/index.js deleted file mode 100644 index 7c54448..0000000 --- a/node_modules/terser-webpack-plugin/dist/index.js +++ /dev/null @@ -1,692 +0,0 @@ -"use strict"; - -const path = require("path"); -const os = require("os"); -const { - validate -} = require("schema-utils"); -const { - throttleAll, - memoize, - terserMinify, - uglifyJsMinify, - swcMinify, - esbuildMinify -} = require("./utils"); -const schema = require("./options.json"); -const { - minify -} = require("./minify"); - -/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */ -/** @typedef {import("webpack").Compiler} Compiler */ -/** @typedef {import("webpack").Compilation} Compilation */ -/** @typedef {import("webpack").WebpackError} WebpackError */ -/** @typedef {import("webpack").Asset} Asset */ -/** @typedef {import("./utils.js").TerserECMA} TerserECMA */ -/** @typedef {import("./utils.js").TerserOptions} TerserOptions */ -/** @typedef {import("jest-worker").Worker} JestWorker */ -/** @typedef {import("@jridgewell/trace-mapping").SourceMapInput} SourceMapInput */ -/** @typedef {import("@jridgewell/trace-mapping").TraceMap} TraceMap */ - -/** @typedef {RegExp | string} Rule */ -/** @typedef {Rule[] | Rule} Rules */ - -/** - * @callback ExtractCommentsFunction - * @param {any} astNode - * @param {{ value: string, type: 'comment1' | 'comment2' | 'comment3' | 'comment4', pos: number, line: number, col: number }} comment - * @returns {boolean} - */ - -/** - * @typedef {boolean | 'all' | 'some' | RegExp | ExtractCommentsFunction} ExtractCommentsCondition - */ - -/** - * @typedef {string | ((fileData: any) => string)} ExtractCommentsFilename - */ - -/** - * @typedef {boolean | string | ((commentsFile: string) => string)} ExtractCommentsBanner - */ - -/** - * @typedef {Object} ExtractCommentsObject - * @property {ExtractCommentsCondition} [condition] - * @property {ExtractCommentsFilename} [filename] - * @property {ExtractCommentsBanner} [banner] - */ - -/** - * @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions - */ - -/** - * @typedef {Object} MinimizedResult - * @property {string} code - * @property {SourceMapInput} [map] - * @property {Array} [errors] - * @property {Array} [warnings] - * @property {Array} [extractedComments] - */ - -/** - * @typedef {{ [file: string]: string }} Input - */ - -/** - * @typedef {{ [key: string]: any }} CustomOptions - */ - -/** - * @template T - * @typedef {T extends infer U ? U : CustomOptions} InferDefaultType - */ - -/** - * @typedef {Object} PredefinedOptions - * @property {boolean} [module] - * @property {TerserECMA} [ecma] - */ - -/** - * @template T - * @typedef {PredefinedOptions & InferDefaultType} MinimizerOptions - */ - -/** - * @template T - * @callback BasicMinimizerImplementation - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {MinimizerOptions} minifyOptions - * @param {ExtractCommentsOptions | undefined} extractComments - * @returns {Promise} - */ - -/** - * @typedef {object} MinimizeFunctionHelpers - * @property {() => string | undefined} [getMinimizerVersion] - */ - -/** - * @template T - * @typedef {BasicMinimizerImplementation & MinimizeFunctionHelpers} MinimizerImplementation - */ - -/** - * @template T - * @typedef {Object} InternalOptions - * @property {string} name - * @property {string} input - * @property {SourceMapInput | undefined} inputSourceMap - * @property {ExtractCommentsOptions | undefined} extractComments - * @property {{ implementation: MinimizerImplementation, options: MinimizerOptions }} minimizer - */ - -/** - * @template T - * @typedef {JestWorker & { transform: (options: string) => MinimizedResult, minify: (options: InternalOptions) => MinimizedResult }} MinimizerWorker - */ - -/** - * @typedef {undefined | boolean | number} Parallel - */ - -/** - * @typedef {Object} BasePluginOptions - * @property {Rules} [test] - * @property {Rules} [include] - * @property {Rules} [exclude] - * @property {ExtractCommentsOptions} [extractComments] - * @property {Parallel} [parallel] - */ - -/** - * @template T - * @typedef {T extends TerserOptions ? { minify?: MinimizerImplementation | undefined, terserOptions?: MinimizerOptions | undefined } : { minify: MinimizerImplementation, terserOptions?: MinimizerOptions | undefined }} DefinedDefaultMinimizerAndOptions - */ - -/** - * @template T - * @typedef {BasePluginOptions & { minimizer: { implementation: MinimizerImplementation, options: MinimizerOptions } }} InternalPluginOptions - */ - -const getTraceMapping = memoize(() => -// eslint-disable-next-line global-require -require("@jridgewell/trace-mapping")); -const getSerializeJavascript = memoize(() => -// eslint-disable-next-line global-require -require("serialize-javascript")); - -/** - * @template [T=TerserOptions] - */ -class TerserPlugin { - /** - * @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions} [options] - */ - constructor(options) { - validate( /** @type {Schema} */schema, options || {}, { - name: "Terser Plugin", - baseDataPath: "options" - }); - - // TODO make `minimizer` option instead `minify` and `terserOptions` in the next major release, also rename `terserMinify` to `terserMinimize` - const { - minify = ( /** @type {MinimizerImplementation} */terserMinify), - terserOptions = ( /** @type {MinimizerOptions} */{}), - test = /\.[cm]?js(\?.*)?$/i, - extractComments = true, - parallel = true, - include, - exclude - } = options || {}; - - /** - * @private - * @type {InternalPluginOptions} - */ - this.options = { - test, - extractComments, - parallel, - include, - exclude, - minimizer: { - implementation: minify, - options: terserOptions - } - }; - } - - /** - * @private - * @param {any} input - * @returns {boolean} - */ - static isSourceMap(input) { - // All required options for `new TraceMap(...options)` - // https://github.com/jridgewell/trace-mapping#usage - return Boolean(input && input.version && input.sources && Array.isArray(input.sources) && typeof input.mappings === "string"); - } - - /** - * @private - * @param {unknown} warning - * @param {string} file - * @returns {Error} - */ - static buildWarning(warning, file) { - /** - * @type {Error & { hideStack: true, file: string }} - */ - // @ts-ignore - const builtWarning = new Error(warning.toString()); - builtWarning.name = "Warning"; - builtWarning.hideStack = true; - builtWarning.file = file; - return builtWarning; - } - - /** - * @private - * @param {any} error - * @param {string} file - * @param {TraceMap} [sourceMap] - * @param {Compilation["requestShortener"]} [requestShortener] - * @returns {Error} - */ - static buildError(error, file, sourceMap, requestShortener) { - /** - * @type {Error & { file?: string }} - */ - let builtError; - if (typeof error === "string") { - builtError = new Error(`${file} from Terser plugin\n${error}`); - builtError.file = file; - return builtError; - } - if (error.line) { - const original = sourceMap && getTraceMapping().originalPositionFor(sourceMap, { - line: error.line, - column: error.col - }); - if (original && original.source && requestShortener) { - builtError = new Error(`${file} from Terser plugin\n${error.message} [${requestShortener.shorten(original.source)}:${original.line},${original.column}][${file}:${error.line},${error.col}]${error.stack ? `\n${error.stack.split("\n").slice(1).join("\n")}` : ""}`); - builtError.file = file; - return builtError; - } - builtError = new Error(`${file} from Terser plugin\n${error.message} [${file}:${error.line},${error.col}]${error.stack ? `\n${error.stack.split("\n").slice(1).join("\n")}` : ""}`); - builtError.file = file; - return builtError; - } - if (error.stack) { - builtError = new Error(`${file} from Terser plugin\n${typeof error.message !== "undefined" ? error.message : ""}\n${error.stack}`); - builtError.file = file; - return builtError; - } - builtError = new Error(`${file} from Terser plugin\n${error.message}`); - builtError.file = file; - return builtError; - } - - /** - * @private - * @param {Parallel} parallel - * @returns {number} - */ - static getAvailableNumberOfCores(parallel) { - // In some cases cpus() returns undefined - // https://github.com/nodejs/node/issues/19022 - const cpus = os.cpus() || { - length: 1 - }; - return parallel === true ? cpus.length - 1 : Math.min(Number(parallel) || 0, cpus.length - 1); - } - - /** - * @private - * @param {Compiler} compiler - * @param {Compilation} compilation - * @param {Record} assets - * @param {{availableNumberOfCores: number}} optimizeOptions - * @returns {Promise} - */ - async optimize(compiler, compilation, assets, optimizeOptions) { - const cache = compilation.getCache("TerserWebpackPlugin"); - let numberOfAssets = 0; - const assetsForMinify = await Promise.all(Object.keys(assets).filter(name => { - const { - info - } = /** @type {Asset} */compilation.getAsset(name); - if ( - // Skip double minimize assets from child compilation - info.minimized || - // Skip minimizing for extracted comments assets - info.extractedComments) { - return false; - } - if (!compiler.webpack.ModuleFilenameHelpers.matchObject.bind( - // eslint-disable-next-line no-undefined - undefined, this.options)(name)) { - return false; - } - return true; - }).map(async name => { - const { - info, - source - } = /** @type {Asset} */ - compilation.getAsset(name); - const eTag = cache.getLazyHashedEtag(source); - const cacheItem = cache.getItemCache(name, eTag); - const output = await cacheItem.getPromise(); - if (!output) { - numberOfAssets += 1; - } - return { - name, - info, - inputSource: source, - output, - cacheItem - }; - })); - if (assetsForMinify.length === 0) { - return; - } - - /** @type {undefined | (() => MinimizerWorker)} */ - let getWorker; - /** @type {undefined | MinimizerWorker} */ - let initializedWorker; - /** @type {undefined | number} */ - let numberOfWorkers; - if (optimizeOptions.availableNumberOfCores > 0) { - // Do not create unnecessary workers when the number of files is less than the available cores, it saves memory - numberOfWorkers = Math.min(numberOfAssets, optimizeOptions.availableNumberOfCores); - // eslint-disable-next-line consistent-return - getWorker = () => { - if (initializedWorker) { - return initializedWorker; - } - - // eslint-disable-next-line global-require - const { - Worker - } = require("jest-worker"); - initializedWorker = /** @type {MinimizerWorker} */ - - new Worker(require.resolve("./minify"), { - numWorkers: numberOfWorkers, - enableWorkerThreads: true - }); - - // https://github.com/facebook/jest/issues/8872#issuecomment-524822081 - const workerStdout = initializedWorker.getStdout(); - if (workerStdout) { - workerStdout.on("data", chunk => process.stdout.write(chunk)); - } - const workerStderr = initializedWorker.getStderr(); - if (workerStderr) { - workerStderr.on("data", chunk => process.stderr.write(chunk)); - } - return initializedWorker; - }; - } - const { - SourceMapSource, - ConcatSource, - RawSource - } = compiler.webpack.sources; - - /** @typedef {{ extractedCommentsSource : import("webpack").sources.RawSource, commentsFilename: string }} ExtractedCommentsInfo */ - /** @type {Map} */ - const allExtractedComments = new Map(); - const scheduledTasks = []; - for (const asset of assetsForMinify) { - scheduledTasks.push(async () => { - const { - name, - inputSource, - info, - cacheItem - } = asset; - let { - output - } = asset; - if (!output) { - let input; - /** @type {SourceMapInput | undefined} */ - let inputSourceMap; - const { - source: sourceFromInputSource, - map - } = inputSource.sourceAndMap(); - input = sourceFromInputSource; - if (map) { - if (!TerserPlugin.isSourceMap(map)) { - compilation.warnings.push( /** @type {WebpackError} */ - new Error(`${name} contains invalid source map`)); - } else { - inputSourceMap = /** @type {SourceMapInput} */map; - } - } - if (Buffer.isBuffer(input)) { - input = input.toString(); - } - - /** - * @type {InternalOptions} - */ - const options = { - name, - input, - inputSourceMap, - minimizer: { - implementation: this.options.minimizer.implementation, - // @ts-ignore https://github.com/Microsoft/TypeScript/issues/10727 - options: { - ...this.options.minimizer.options - } - }, - extractComments: this.options.extractComments - }; - if (typeof options.minimizer.options.module === "undefined") { - if (typeof info.javascriptModule !== "undefined") { - options.minimizer.options.module = info.javascriptModule; - } else if (/\.mjs(\?.*)?$/i.test(name)) { - options.minimizer.options.module = true; - } else if (/\.cjs(\?.*)?$/i.test(name)) { - options.minimizer.options.module = false; - } - } - if (typeof options.minimizer.options.ecma === "undefined") { - options.minimizer.options.ecma = TerserPlugin.getEcmaVersion(compiler.options.output.environment || {}); - } - try { - output = await (getWorker ? getWorker().transform(getSerializeJavascript()(options)) : minify(options)); - } catch (error) { - const hasSourceMap = inputSourceMap && TerserPlugin.isSourceMap(inputSourceMap); - compilation.errors.push( /** @type {WebpackError} */ - - TerserPlugin.buildError(error, name, hasSourceMap ? new (getTraceMapping().TraceMap)( /** @type {SourceMapInput} */inputSourceMap) : - // eslint-disable-next-line no-undefined - undefined, - // eslint-disable-next-line no-undefined - hasSourceMap ? compilation.requestShortener : undefined)); - return; - } - if (typeof output.code === "undefined") { - compilation.errors.push( /** @type {WebpackError} */ - - new Error(`${name} from Terser plugin\nMinimizer doesn't return result`)); - return; - } - if (output.warnings && output.warnings.length > 0) { - output.warnings = output.warnings.map( - /** - * @param {Error | string} item - */ - item => TerserPlugin.buildWarning(item, name)); - } - if (output.errors && output.errors.length > 0) { - const hasSourceMap = inputSourceMap && TerserPlugin.isSourceMap(inputSourceMap); - output.errors = output.errors.map( - /** - * @param {Error | string} item - */ - item => TerserPlugin.buildError(item, name, hasSourceMap ? new (getTraceMapping().TraceMap)( /** @type {SourceMapInput} */inputSourceMap) : - // eslint-disable-next-line no-undefined - undefined, - // eslint-disable-next-line no-undefined - hasSourceMap ? compilation.requestShortener : undefined)); - } - let shebang; - if ( /** @type {ExtractCommentsObject} */ - this.options.extractComments.banner !== false && output.extractedComments && output.extractedComments.length > 0 && output.code.startsWith("#!")) { - const firstNewlinePosition = output.code.indexOf("\n"); - shebang = output.code.substring(0, firstNewlinePosition); - output.code = output.code.substring(firstNewlinePosition + 1); - } - if (output.map) { - output.source = new SourceMapSource(output.code, name, output.map, input, /** @type {SourceMapInput} */inputSourceMap, true); - } else { - output.source = new RawSource(output.code); - } - if (output.extractedComments && output.extractedComments.length > 0) { - const commentsFilename = /** @type {ExtractCommentsObject} */ - this.options.extractComments.filename || "[file].LICENSE.txt[query]"; - let query = ""; - let filename = name; - const querySplit = filename.indexOf("?"); - if (querySplit >= 0) { - query = filename.slice(querySplit); - filename = filename.slice(0, querySplit); - } - const lastSlashIndex = filename.lastIndexOf("/"); - const basename = lastSlashIndex === -1 ? filename : filename.slice(lastSlashIndex + 1); - const data = { - filename, - basename, - query - }; - output.commentsFilename = compilation.getPath(commentsFilename, data); - let banner; - - // Add a banner to the original file - if ( /** @type {ExtractCommentsObject} */ - this.options.extractComments.banner !== false) { - banner = /** @type {ExtractCommentsObject} */ - this.options.extractComments.banner || `For license information please see ${path.relative(path.dirname(name), output.commentsFilename).replace(/\\/g, "/")}`; - if (typeof banner === "function") { - banner = banner(output.commentsFilename); - } - if (banner) { - output.source = new ConcatSource(shebang ? `${shebang}\n` : "", `/*! ${banner} */\n`, output.source); - } - } - const extractedCommentsString = output.extractedComments.sort().join("\n\n"); - output.extractedCommentsSource = new RawSource(`${extractedCommentsString}\n`); - } - await cacheItem.storePromise({ - source: output.source, - errors: output.errors, - warnings: output.warnings, - commentsFilename: output.commentsFilename, - extractedCommentsSource: output.extractedCommentsSource - }); - } - if (output.warnings && output.warnings.length > 0) { - for (const warning of output.warnings) { - compilation.warnings.push( /** @type {WebpackError} */warning); - } - } - if (output.errors && output.errors.length > 0) { - for (const error of output.errors) { - compilation.errors.push( /** @type {WebpackError} */error); - } - } - - /** @type {Record} */ - const newInfo = { - minimized: true - }; - const { - source, - extractedCommentsSource - } = output; - - // Write extracted comments to commentsFilename - if (extractedCommentsSource) { - const { - commentsFilename - } = output; - newInfo.related = { - license: commentsFilename - }; - allExtractedComments.set(name, { - extractedCommentsSource, - commentsFilename - }); - } - compilation.updateAsset(name, source, newInfo); - }); - } - const limit = getWorker && numberOfAssets > 0 ? ( /** @type {number} */numberOfWorkers) : scheduledTasks.length; - await throttleAll(limit, scheduledTasks); - if (initializedWorker) { - await initializedWorker.end(); - } - - /** @typedef {{ source: import("webpack").sources.Source, commentsFilename: string, from: string }} ExtractedCommentsInfoWIthFrom */ - await Array.from(allExtractedComments).sort().reduce( - /** - * @param {Promise} previousPromise - * @param {[string, ExtractedCommentsInfo]} extractedComments - * @returns {Promise} - */ - async (previousPromise, [from, value]) => { - const previous = /** @type {ExtractedCommentsInfoWIthFrom | undefined} **/ - await previousPromise; - const { - commentsFilename, - extractedCommentsSource - } = value; - if (previous && previous.commentsFilename === commentsFilename) { - const { - from: previousFrom, - source: prevSource - } = previous; - const mergedName = `${previousFrom}|${from}`; - const name = `${commentsFilename}|${mergedName}`; - const eTag = [prevSource, extractedCommentsSource].map(item => cache.getLazyHashedEtag(item)).reduce((previousValue, currentValue) => cache.mergeEtags(previousValue, currentValue)); - let source = await cache.getPromise(name, eTag); - if (!source) { - source = new ConcatSource(Array.from(new Set([... /** @type {string}*/prevSource.source().split("\n\n"), ... /** @type {string}*/extractedCommentsSource.source().split("\n\n")])).join("\n\n")); - await cache.storePromise(name, eTag, source); - } - compilation.updateAsset(commentsFilename, source); - return { - source, - commentsFilename, - from: mergedName - }; - } - const existingAsset = compilation.getAsset(commentsFilename); - if (existingAsset) { - return { - source: existingAsset.source, - commentsFilename, - from: commentsFilename - }; - } - compilation.emitAsset(commentsFilename, extractedCommentsSource, { - extractedComments: true - }); - return { - source: extractedCommentsSource, - commentsFilename, - from - }; - }, /** @type {Promise} */Promise.resolve()); - } - - /** - * @private - * @param {any} environment - * @returns {TerserECMA} - */ - static getEcmaVersion(environment) { - // ES 6th - if (environment.arrowFunction || environment.const || environment.destructuring || environment.forOf || environment.module) { - return 2015; - } - - // ES 11th - if (environment.bigIntLiteral || environment.dynamicImport) { - return 2020; - } - return 5; - } - - /** - * @param {Compiler} compiler - * @returns {void} - */ - apply(compiler) { - const pluginName = this.constructor.name; - const availableNumberOfCores = TerserPlugin.getAvailableNumberOfCores(this.options.parallel); - compiler.hooks.compilation.tap(pluginName, compilation => { - const hooks = compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation); - const data = getSerializeJavascript()({ - minimizer: typeof this.options.minimizer.implementation.getMinimizerVersion !== "undefined" ? this.options.minimizer.implementation.getMinimizerVersion() || "0.0.0" : "0.0.0", - options: this.options.minimizer.options - }); - hooks.chunkHash.tap(pluginName, (chunk, hash) => { - hash.update("TerserPlugin"); - hash.update(data); - }); - compilation.hooks.processAssets.tapPromise({ - name: pluginName, - stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE, - additionalAssets: true - }, assets => this.optimize(compiler, compilation, assets, { - availableNumberOfCores - })); - compilation.hooks.statsPrinter.tap(pluginName, stats => { - stats.hooks.print.for("asset.info.minimized").tap("terser-webpack-plugin", (minimized, { - green, - formatFlag - }) => minimized ? /** @type {Function} */green( /** @type {Function} */formatFlag("minimized")) : ""); - }); - }); - } -} -TerserPlugin.terserMinify = terserMinify; -TerserPlugin.uglifyJsMinify = uglifyJsMinify; -TerserPlugin.swcMinify = swcMinify; -TerserPlugin.esbuildMinify = esbuildMinify; -module.exports = TerserPlugin; \ No newline at end of file diff --git a/node_modules/terser-webpack-plugin/dist/minify.js b/node_modules/terser-webpack-plugin/dist/minify.js deleted file mode 100644 index 69c56f4..0000000 --- a/node_modules/terser-webpack-plugin/dist/minify.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -/** @typedef {import("./index.js").MinimizedResult} MinimizedResult */ -/** @typedef {import("./index.js").CustomOptions} CustomOptions */ - -/** - * @template T - * @param {import("./index.js").InternalOptions} options - * @returns {Promise} - */ -async function minify(options) { - const { - name, - input, - inputSourceMap, - extractComments - } = options; - const { - implementation, - options: minimizerOptions - } = options.minimizer; - return implementation({ - [name]: input - }, inputSourceMap, minimizerOptions, extractComments); -} - -/** - * @param {string} options - * @returns {Promise} - */ -async function transform(options) { - // 'use strict' => this === undefined (Clean Scope) - // Safer for possible security issues, albeit not critical at all here - // eslint-disable-next-line no-param-reassign - const evaluatedOptions = - /** - * @template T - * @type {import("./index.js").InternalOptions} - * */ - - // eslint-disable-next-line no-new-func - new Function("exports", "require", "module", "__filename", "__dirname", `'use strict'\nreturn ${options}`)(exports, require, module, __filename, __dirname); - return minify(evaluatedOptions); -} -module.exports = { - minify, - transform -}; \ No newline at end of file diff --git a/node_modules/terser-webpack-plugin/dist/options.json b/node_modules/terser-webpack-plugin/dist/options.json deleted file mode 100644 index 83d2cfd..0000000 --- a/node_modules/terser-webpack-plugin/dist/options.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "definitions": { - "Rule": { - "description": "Filtering rule as regex or string.", - "anyOf": [ - { - "instanceof": "RegExp", - "tsType": "RegExp" - }, - { - "type": "string", - "minLength": 1 - } - ] - }, - "Rules": { - "description": "Filtering rules.", - "anyOf": [ - { - "type": "array", - "items": { - "description": "A rule condition.", - "oneOf": [ - { - "$ref": "#/definitions/Rule" - } - ] - } - }, - { - "$ref": "#/definitions/Rule" - } - ] - } - }, - "title": "TerserPluginOptions", - "type": "object", - "additionalProperties": false, - "properties": { - "test": { - "description": "Include all modules that pass test assertion.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#test", - "oneOf": [ - { - "$ref": "#/definitions/Rules" - } - ] - }, - "include": { - "description": "Include all modules matching any of these conditions.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#include", - "oneOf": [ - { - "$ref": "#/definitions/Rules" - } - ] - }, - "exclude": { - "description": "Exclude all modules matching any of these conditions.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#exclude", - "oneOf": [ - { - "$ref": "#/definitions/Rules" - } - ] - }, - "terserOptions": { - "description": "Options for `terser` (by default) or custom `minify` function.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions", - "additionalProperties": true, - "type": "object" - }, - "extractComments": { - "description": "Whether comments shall be extracted to a separate file.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#extractcomments", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "minLength": 1 - }, - { - "instanceof": "RegExp" - }, - { - "instanceof": "Function" - }, - { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "minLength": 1 - }, - { - "instanceof": "RegExp" - }, - { - "instanceof": "Function" - } - ], - "description": "Condition what comments you need extract.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#condition" - }, - "filename": { - "anyOf": [ - { - "type": "string", - "minLength": 1 - }, - { - "instanceof": "Function" - } - ], - "description": "The file where the extracted comments will be stored. Default is to append the suffix .LICENSE.txt to the original filename.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#filename" - }, - "banner": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "minLength": 1 - }, - { - "instanceof": "Function" - } - ], - "description": "The banner text that points to the extracted file and will be added on top of the original file", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#banner" - } - }, - "type": "object" - } - ] - }, - "parallel": { - "description": "Use multi-process parallel running to improve the build speed.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#parallel", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - } - ] - }, - "minify": { - "description": "Allows you to override default minify function.", - "link": "https://github.com/webpack-contrib/terser-webpack-plugin#number", - "instanceof": "Function" - } - } -} diff --git a/node_modules/terser-webpack-plugin/dist/utils.js b/node_modules/terser-webpack-plugin/dist/utils.js deleted file mode 100644 index 65e5780..0000000 --- a/node_modules/terser-webpack-plugin/dist/utils.js +++ /dev/null @@ -1,637 +0,0 @@ -"use strict"; - -/** @typedef {import("@jridgewell/trace-mapping").SourceMapInput} SourceMapInput */ -/** @typedef {import("terser").FormatOptions} TerserFormatOptions */ -/** @typedef {import("terser").MinifyOptions} TerserOptions */ -/** @typedef {import("terser").CompressOptions} TerserCompressOptions */ -/** @typedef {import("terser").ECMA} TerserECMA */ -/** @typedef {import("./index.js").ExtractCommentsOptions} ExtractCommentsOptions */ -/** @typedef {import("./index.js").ExtractCommentsFunction} ExtractCommentsFunction */ -/** @typedef {import("./index.js").ExtractCommentsCondition} ExtractCommentsCondition */ -/** @typedef {import("./index.js").Input} Input */ -/** @typedef {import("./index.js").MinimizedResult} MinimizedResult */ -/** @typedef {import("./index.js").PredefinedOptions} PredefinedOptions */ -/** @typedef {import("./index.js").CustomOptions} CustomOptions */ - -/** - * @typedef {Array} ExtractedComments - */ - -const notSettled = Symbol(`not-settled`); - -/** - * @template T - * @typedef {() => Promise} Task - */ - -/** - * Run tasks with limited concurrency. - * @template T - * @param {number} limit - Limit of tasks that run at once. - * @param {Task[]} tasks - List of tasks to run. - * @returns {Promise} A promise that fulfills to an array of the results - */ -function throttleAll(limit, tasks) { - if (!Number.isInteger(limit) || limit < 1) { - throw new TypeError(`Expected \`limit\` to be a finite number > 0, got \`${limit}\` (${typeof limit})`); - } - if (!Array.isArray(tasks) || !tasks.every(task => typeof task === `function`)) { - throw new TypeError(`Expected \`tasks\` to be a list of functions returning a promise`); - } - return new Promise((resolve, reject) => { - const result = Array(tasks.length).fill(notSettled); - const entries = tasks.entries(); - const next = () => { - const { - done, - value - } = entries.next(); - if (done) { - const isLast = !result.includes(notSettled); - if (isLast) resolve( /** @type{T[]} **/result); - return; - } - const [index, task] = value; - - /** - * @param {T} x - */ - const onFulfilled = x => { - result[index] = x; - next(); - }; - task().then(onFulfilled, reject); - }; - Array(limit).fill(0).forEach(next); - }); -} - -/* istanbul ignore next */ -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @param {ExtractCommentsOptions | undefined} extractComments - * @return {Promise} - */ -async function terserMinify(input, sourceMap, minimizerOptions, extractComments) { - /** - * @param {any} value - * @returns {boolean} - */ - const isObject = value => { - const type = typeof value; - return value != null && (type === "object" || type === "function"); - }; - - /** - * @param {TerserOptions & { sourceMap: undefined } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })} terserOptions - * @param {ExtractedComments} extractedComments - * @returns {ExtractCommentsFunction} - */ - const buildComments = (terserOptions, extractedComments) => { - /** @type {{ [index: string]: ExtractCommentsCondition }} */ - const condition = {}; - let comments; - if (terserOptions.format) { - ({ - comments - } = terserOptions.format); - } else if (terserOptions.output) { - ({ - comments - } = terserOptions.output); - } - condition.preserve = typeof comments !== "undefined" ? comments : false; - if (typeof extractComments === "boolean" && extractComments) { - condition.extract = "some"; - } else if (typeof extractComments === "string" || extractComments instanceof RegExp) { - condition.extract = extractComments; - } else if (typeof extractComments === "function") { - condition.extract = extractComments; - } else if (extractComments && isObject(extractComments)) { - condition.extract = typeof extractComments.condition === "boolean" && extractComments.condition ? "some" : typeof extractComments.condition !== "undefined" ? extractComments.condition : "some"; - } else { - // No extract - // Preserve using "commentsOpts" or "some" - condition.preserve = typeof comments !== "undefined" ? comments : "some"; - condition.extract = false; - } - - // Ensure that both conditions are functions - ["preserve", "extract"].forEach(key => { - /** @type {undefined | string} */ - let regexStr; - /** @type {undefined | RegExp} */ - let regex; - switch (typeof condition[key]) { - case "boolean": - condition[key] = condition[key] ? () => true : () => false; - break; - case "function": - break; - case "string": - if (condition[key] === "all") { - condition[key] = () => true; - break; - } - if (condition[key] === "some") { - condition[key] = /** @type {ExtractCommentsFunction} */ - (astNode, comment) => (comment.type === "comment2" || comment.type === "comment1") && /@preserve|@lic|@cc_on|^\**!/i.test(comment.value); - break; - } - regexStr = /** @type {string} */condition[key]; - condition[key] = /** @type {ExtractCommentsFunction} */ - (astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value); - break; - default: - regex = /** @type {RegExp} */condition[key]; - condition[key] = /** @type {ExtractCommentsFunction} */ - (astNode, comment) => /** @type {RegExp} */regex.test(comment.value); - } - }); - - // Redefine the comments function to extract and preserve - // comments according to the two conditions - return (astNode, comment) => { - if ( /** @type {{ extract: ExtractCommentsFunction }} */ - condition.extract(astNode, comment)) { - const commentText = comment.type === "comment2" ? `/*${comment.value}*/` : `//${comment.value}`; - - // Don't include duplicate comments - if (!extractedComments.includes(commentText)) { - extractedComments.push(commentText); - } - } - return /** @type {{ preserve: ExtractCommentsFunction }} */condition.preserve(astNode, comment); - }; - }; - - /** - * @param {PredefinedOptions & TerserOptions} [terserOptions={}] - * @returns {TerserOptions & { sourceMap: undefined } & { compress: TerserCompressOptions } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })} - */ - const buildTerserOptions = (terserOptions = {}) => { - // Need deep copy objects to avoid https://github.com/terser/terser/issues/366 - return { - ...terserOptions, - compress: typeof terserOptions.compress === "boolean" ? terserOptions.compress ? {} : false : { - ...terserOptions.compress - }, - // ecma: terserOptions.ecma, - // ie8: terserOptions.ie8, - // keep_classnames: terserOptions.keep_classnames, - // keep_fnames: terserOptions.keep_fnames, - mangle: terserOptions.mangle == null ? true : typeof terserOptions.mangle === "boolean" ? terserOptions.mangle : { - ...terserOptions.mangle - }, - // module: terserOptions.module, - // nameCache: { ...terserOptions.toplevel }, - // the `output` option is deprecated - ...(terserOptions.format ? { - format: { - beautify: false, - ...terserOptions.format - } - } : { - output: { - beautify: false, - ...terserOptions.output - } - }), - parse: { - ...terserOptions.parse - }, - // safari10: terserOptions.safari10, - // Ignoring sourceMap from options - // eslint-disable-next-line no-undefined - sourceMap: undefined - // toplevel: terserOptions.toplevel - }; - }; - - // eslint-disable-next-line global-require - const { - minify - } = require("terser"); - // Copy `terser` options - const terserOptions = buildTerserOptions(minimizerOptions); - - // Let terser generate a SourceMap - if (sourceMap) { - // @ts-ignore - terserOptions.sourceMap = { - asObject: true - }; - } - - /** @type {ExtractedComments} */ - const extractedComments = []; - if (terserOptions.output) { - terserOptions.output.comments = buildComments(terserOptions, extractedComments); - } else if (terserOptions.format) { - terserOptions.format.comments = buildComments(terserOptions, extractedComments); - } - if (terserOptions.compress) { - // More optimizations - if (typeof terserOptions.compress.ecma === "undefined") { - terserOptions.compress.ecma = terserOptions.ecma; - } - - // https://github.com/webpack/webpack/issues/16135 - if (terserOptions.ecma === 5 && typeof terserOptions.compress.arrows === "undefined") { - terserOptions.compress.arrows = false; - } - } - const [[filename, code]] = Object.entries(input); - const result = await minify({ - [filename]: code - }, terserOptions); - return { - code: ( /** @type {string} **/result.code), - // @ts-ignore - // eslint-disable-next-line no-undefined - map: result.map ? ( /** @type {SourceMapInput} **/result.map) : undefined, - extractedComments - }; -} - -/** - * @returns {string | undefined} - */ -terserMinify.getMinimizerVersion = () => { - let packageJson; - try { - // eslint-disable-next-line global-require - packageJson = require("terser/package.json"); - } catch (error) { - // Ignore - } - return packageJson && packageJson.version; -}; - -/* istanbul ignore next */ -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @param {ExtractCommentsOptions | undefined} extractComments - * @return {Promise} - */ -async function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComments) { - /** - * @param {any} value - * @returns {boolean} - */ - const isObject = value => { - const type = typeof value; - return value != null && (type === "object" || type === "function"); - }; - - /** - * @param {import("uglify-js").MinifyOptions & { sourceMap: undefined } & { output: import("uglify-js").OutputOptions & { beautify: boolean }}} uglifyJsOptions - * @param {ExtractedComments} extractedComments - * @returns {ExtractCommentsFunction} - */ - const buildComments = (uglifyJsOptions, extractedComments) => { - /** @type {{ [index: string]: ExtractCommentsCondition }} */ - const condition = {}; - const { - comments - } = uglifyJsOptions.output; - condition.preserve = typeof comments !== "undefined" ? comments : false; - if (typeof extractComments === "boolean" && extractComments) { - condition.extract = "some"; - } else if (typeof extractComments === "string" || extractComments instanceof RegExp) { - condition.extract = extractComments; - } else if (typeof extractComments === "function") { - condition.extract = extractComments; - } else if (extractComments && isObject(extractComments)) { - condition.extract = typeof extractComments.condition === "boolean" && extractComments.condition ? "some" : typeof extractComments.condition !== "undefined" ? extractComments.condition : "some"; - } else { - // No extract - // Preserve using "commentsOpts" or "some" - condition.preserve = typeof comments !== "undefined" ? comments : "some"; - condition.extract = false; - } - - // Ensure that both conditions are functions - ["preserve", "extract"].forEach(key => { - /** @type {undefined | string} */ - let regexStr; - /** @type {undefined | RegExp} */ - let regex; - switch (typeof condition[key]) { - case "boolean": - condition[key] = condition[key] ? () => true : () => false; - break; - case "function": - break; - case "string": - if (condition[key] === "all") { - condition[key] = () => true; - break; - } - if (condition[key] === "some") { - condition[key] = /** @type {ExtractCommentsFunction} */ - (astNode, comment) => (comment.type === "comment2" || comment.type === "comment1") && /@preserve|@lic|@cc_on|^\**!/i.test(comment.value); - break; - } - regexStr = /** @type {string} */condition[key]; - condition[key] = /** @type {ExtractCommentsFunction} */ - (astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value); - break; - default: - regex = /** @type {RegExp} */condition[key]; - condition[key] = /** @type {ExtractCommentsFunction} */ - (astNode, comment) => /** @type {RegExp} */regex.test(comment.value); - } - }); - - // Redefine the comments function to extract and preserve - // comments according to the two conditions - return (astNode, comment) => { - if ( /** @type {{ extract: ExtractCommentsFunction }} */ - condition.extract(astNode, comment)) { - const commentText = comment.type === "comment2" ? `/*${comment.value}*/` : `//${comment.value}`; - - // Don't include duplicate comments - if (!extractedComments.includes(commentText)) { - extractedComments.push(commentText); - } - } - return /** @type {{ preserve: ExtractCommentsFunction }} */condition.preserve(astNode, comment); - }; - }; - - /** - * @param {PredefinedOptions & import("uglify-js").MinifyOptions} [uglifyJsOptions={}] - * @returns {import("uglify-js").MinifyOptions & { sourceMap: undefined } & { output: import("uglify-js").OutputOptions & { beautify: boolean }}} - */ - const buildUglifyJsOptions = (uglifyJsOptions = {}) => { - // eslint-disable-next-line no-param-reassign - delete minimizerOptions.ecma; - // eslint-disable-next-line no-param-reassign - delete minimizerOptions.module; - - // Need deep copy objects to avoid https://github.com/terser/terser/issues/366 - return { - ...uglifyJsOptions, - // warnings: uglifyJsOptions.warnings, - parse: { - ...uglifyJsOptions.parse - }, - compress: typeof uglifyJsOptions.compress === "boolean" ? uglifyJsOptions.compress : { - ...uglifyJsOptions.compress - }, - mangle: uglifyJsOptions.mangle == null ? true : typeof uglifyJsOptions.mangle === "boolean" ? uglifyJsOptions.mangle : { - ...uglifyJsOptions.mangle - }, - output: { - beautify: false, - ...uglifyJsOptions.output - }, - // Ignoring sourceMap from options - // eslint-disable-next-line no-undefined - sourceMap: undefined - // toplevel: uglifyJsOptions.toplevel - // nameCache: { ...uglifyJsOptions.toplevel }, - // ie8: uglifyJsOptions.ie8, - // keep_fnames: uglifyJsOptions.keep_fnames, - }; - }; - - // eslint-disable-next-line global-require, import/no-extraneous-dependencies - const { - minify - } = require("uglify-js"); - - // Copy `uglify-js` options - const uglifyJsOptions = buildUglifyJsOptions(minimizerOptions); - - // Let terser generate a SourceMap - if (sourceMap) { - // @ts-ignore - uglifyJsOptions.sourceMap = true; - } - - /** @type {ExtractedComments} */ - const extractedComments = []; - - // @ts-ignore - uglifyJsOptions.output.comments = buildComments(uglifyJsOptions, extractedComments); - const [[filename, code]] = Object.entries(input); - const result = await minify({ - [filename]: code - }, uglifyJsOptions); - return { - code: result.code, - // eslint-disable-next-line no-undefined - map: result.map ? JSON.parse(result.map) : undefined, - errors: result.error ? [result.error] : [], - warnings: result.warnings || [], - extractedComments - }; -} - -/** - * @returns {string | undefined} - */ -uglifyJsMinify.getMinimizerVersion = () => { - let packageJson; - try { - // eslint-disable-next-line global-require, import/no-extraneous-dependencies - packageJson = require("uglify-js/package.json"); - } catch (error) { - // Ignore - } - return packageJson && packageJson.version; -}; - -/* istanbul ignore next */ -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @return {Promise} - */ -async function swcMinify(input, sourceMap, minimizerOptions) { - /** - * @param {PredefinedOptions & import("@swc/core").JsMinifyOptions} [swcOptions={}] - * @returns {import("@swc/core").JsMinifyOptions & { sourceMap: undefined } & { compress: import("@swc/core").TerserCompressOptions }} - */ - const buildSwcOptions = (swcOptions = {}) => { - // Need deep copy objects to avoid https://github.com/terser/terser/issues/366 - return { - ...swcOptions, - compress: typeof swcOptions.compress === "boolean" ? swcOptions.compress ? {} : false : { - ...swcOptions.compress - }, - mangle: swcOptions.mangle == null ? true : typeof swcOptions.mangle === "boolean" ? swcOptions.mangle : { - ...swcOptions.mangle - }, - // ecma: swcOptions.ecma, - // keep_classnames: swcOptions.keep_classnames, - // keep_fnames: swcOptions.keep_fnames, - // module: swcOptions.module, - // safari10: swcOptions.safari10, - // toplevel: swcOptions.toplevel - // eslint-disable-next-line no-undefined - sourceMap: undefined - }; - }; - - // eslint-disable-next-line import/no-extraneous-dependencies, global-require - const swc = require("@swc/core"); - // Copy `swc` options - const swcOptions = buildSwcOptions(minimizerOptions); - - // Let `swc` generate a SourceMap - if (sourceMap) { - // @ts-ignore - swcOptions.sourceMap = true; - } - if (swcOptions.compress) { - // More optimizations - if (typeof swcOptions.compress.ecma === "undefined") { - swcOptions.compress.ecma = swcOptions.ecma; - } - - // https://github.com/webpack/webpack/issues/16135 - if (swcOptions.ecma === 5 && typeof swcOptions.compress.arrows === "undefined") { - swcOptions.compress.arrows = false; - } - } - const [[filename, code]] = Object.entries(input); - const result = await swc.minify(code, swcOptions); - let map; - if (result.map) { - map = JSON.parse(result.map); - - // TODO workaround for swc because `filename` is not preset as in `swc` signature as for `terser` - map.sources = [filename]; - delete map.sourcesContent; - } - return { - code: result.code, - map - }; -} - -/** - * @returns {string | undefined} - */ -swcMinify.getMinimizerVersion = () => { - let packageJson; - try { - // eslint-disable-next-line global-require, import/no-extraneous-dependencies - packageJson = require("@swc/core/package.json"); - } catch (error) { - // Ignore - } - return packageJson && packageJson.version; -}; - -/* istanbul ignore next */ -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @return {Promise} - */ -async function esbuildMinify(input, sourceMap, minimizerOptions) { - /** - * @param {PredefinedOptions & import("esbuild").TransformOptions} [esbuildOptions={}] - * @returns {import("esbuild").TransformOptions} - */ - const buildEsbuildOptions = (esbuildOptions = {}) => { - // eslint-disable-next-line no-param-reassign - delete esbuildOptions.ecma; - if (esbuildOptions.module) { - // eslint-disable-next-line no-param-reassign - esbuildOptions.format = "esm"; - } - - // eslint-disable-next-line no-param-reassign - delete esbuildOptions.module; - - // Need deep copy objects to avoid https://github.com/terser/terser/issues/366 - return { - minify: true, - legalComments: "inline", - ...esbuildOptions, - sourcemap: false - }; - }; - - // eslint-disable-next-line import/no-extraneous-dependencies, global-require - const esbuild = require("esbuild"); - - // Copy `esbuild` options - const esbuildOptions = buildEsbuildOptions(minimizerOptions); - - // Let `esbuild` generate a SourceMap - if (sourceMap) { - esbuildOptions.sourcemap = true; - esbuildOptions.sourcesContent = false; - } - const [[filename, code]] = Object.entries(input); - esbuildOptions.sourcefile = filename; - const result = await esbuild.transform(code, esbuildOptions); - return { - code: result.code, - // eslint-disable-next-line no-undefined - map: result.map ? JSON.parse(result.map) : undefined, - warnings: result.warnings.length > 0 ? result.warnings.map(item => { - const plugin = item.pluginName ? `\nPlugin Name: ${item.pluginName}` : ""; - const location = item.location ? `\n\n${item.location.file}:${item.location.line}:${item.location.column}:\n ${item.location.line} | ${item.location.lineText}\n\nSuggestion: ${item.location.suggestion}` : ""; - const notes = item.notes.length > 0 ? `\n\nNotes:\n${item.notes.map(note => `${note.location ? `[${note.location.file}:${note.location.line}:${note.location.column}] ` : ""}${note.text}${note.location ? `\nSuggestion: ${note.location.suggestion}` : ""}${note.location ? `\nLine text:\n${note.location.lineText}\n` : ""}`).join("\n")}` : ""; - return `${item.text} [${item.id}]${plugin}${location}${item.detail ? `\nDetails:\n${item.detail}` : ""}${notes}`; - }) : [] - }; -} - -/** - * @returns {string | undefined} - */ -esbuildMinify.getMinimizerVersion = () => { - let packageJson; - try { - // eslint-disable-next-line global-require, import/no-extraneous-dependencies - packageJson = require("esbuild/package.json"); - } catch (error) { - // Ignore - } - return packageJson && packageJson.version; -}; - -/** - * @template T - * @param fn {(function(): any) | undefined} - * @returns {function(): T} - */ -function memoize(fn) { - let cache = false; - /** @type {T} */ - let result; - return () => { - if (cache) { - return result; - } - result = /** @type {function(): any} */fn(); - cache = true; - // Allow to clean up memory for fn - // and all dependent resources - // eslint-disable-next-line no-undefined, no-param-reassign - fn = undefined; - return result; - }; -} -module.exports = { - throttleAll, - memoize, - terserMinify, - uglifyJsMinify, - swcMinify, - esbuildMinify -}; \ No newline at end of file diff --git a/node_modules/terser-webpack-plugin/package.json b/node_modules/terser-webpack-plugin/package.json deleted file mode 100644 index c6fafc3..0000000 --- a/node_modules/terser-webpack-plugin/package.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "name": "terser-webpack-plugin", - "version": "5.3.10", - "description": "Terser plugin for webpack", - "license": "MIT", - "repository": "webpack-contrib/terser-webpack-plugin", - "author": "webpack Contrib Team", - "homepage": "https://github.com/webpack-contrib/terser-webpack-plugin", - "bugs": "https://github.com/webpack-contrib/terser-webpack-plugin/issues", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "main": "dist/index.js", - "types": "types/index.d.ts", - "engines": { - "node": ">= 10.13.0" - }, - "scripts": { - "clean": "del-cli dist types", - "prebuild": "npm run clean", - "build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write", - "build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files", - "build": "npm-run-all -p \"build:**\"", - "commitlint": "commitlint --from=master", - "security": "npm audit --production", - "lint:prettier": "prettier --list-different .", - "lint:js": "eslint --cache .", - "lint:spelling": "cspell \"**/*.*\"", - "lint:types": "tsc --pretty --noEmit", - "lint": "npm-run-all -l -p \"lint:**\"", - "fix:js": "npm run lint:js -- --fix", - "fix:prettier": "npm run lint:prettier -- --write", - "fix": "npm-run-all -l fix:js fix:prettier", - "test:only": "cross-env NODE_ENV=test jest", - "test:watch": "npm run test:only -- --watch", - "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage", - "pretest": "npm run lint", - "test": "npm run test:coverage", - "prepare": "husky install && npm run build", - "release": "standard-version" - }, - "files": [ - "dist", - "types" - ], - "peerDependencies": { - "webpack": "^5.1.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "uglify-js": { - "optional": true - }, - "esbuild": { - "optional": true - } - }, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.20", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" - }, - "devDependencies": { - "@babel/cli": "^7.22.15", - "@babel/core": "^7.22.17", - "@babel/preset-env": "^7.22.15", - "@commitlint/cli": "^17.7.1", - "@commitlint/config-conventional": "^17.7.0", - "@swc/core": "^1.3.84", - "@types/node": "^18.15.11", - "@types/serialize-javascript": "^5.0.2", - "@types/uglify-js": "^3.17.1", - "@webpack-contrib/eslint-config-webpack": "^3.0.0", - "babel-jest": "^28.1.2", - "copy-webpack-plugin": "^9.0.1", - "cross-env": "^7.0.3", - "cspell": "^6.31.2", - "del": "^6.0.0", - "del-cli": "^3.0.1", - "esbuild": "^0.19.10", - "eslint": "^7.32.0", - "eslint-config-prettier": "^8.9.0", - "eslint-plugin-import": "^2.28.1", - "file-loader": "^6.2.0", - "husky": "^7.0.2", - "jest": "^27.5.1", - "lint-staged": "^13.2.3", - "memfs": "^3.4.13", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.7", - "standard-version": "^9.3.1", - "typescript": "^4.9.5", - "uglify-js": "^3.17.4", - "webpack": "^5.88.2", - "webpack-cli": "^4.10.0", - "worker-loader": "^3.0.8" - }, - "keywords": [ - "uglify", - "uglify-js", - "uglify-es", - "terser", - "webpack", - "webpack-plugin", - "minification", - "compress", - "compressor", - "min", - "minification", - "minifier", - "minify", - "optimize", - "optimizer" - ] -} diff --git a/node_modules/terser-webpack-plugin/types/index.d.ts b/node_modules/terser-webpack-plugin/types/index.d.ts deleted file mode 100644 index 6e80237..0000000 --- a/node_modules/terser-webpack-plugin/types/index.d.ts +++ /dev/null @@ -1,219 +0,0 @@ -export = TerserPlugin; -/** - * @template [T=TerserOptions] - */ -declare class TerserPlugin { - /** - * @private - * @param {any} input - * @returns {boolean} - */ - private static isSourceMap; - /** - * @private - * @param {unknown} warning - * @param {string} file - * @returns {Error} - */ - private static buildWarning; - /** - * @private - * @param {any} error - * @param {string} file - * @param {TraceMap} [sourceMap] - * @param {Compilation["requestShortener"]} [requestShortener] - * @returns {Error} - */ - private static buildError; - /** - * @private - * @param {Parallel} parallel - * @returns {number} - */ - private static getAvailableNumberOfCores; - /** - * @private - * @param {any} environment - * @returns {TerserECMA} - */ - private static getEcmaVersion; - /** - * @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions} [options] - */ - constructor( - options?: - | (BasePluginOptions & DefinedDefaultMinimizerAndOptions) - | undefined - ); - /** - * @private - * @type {InternalPluginOptions} - */ - private options; - /** - * @private - * @param {Compiler} compiler - * @param {Compilation} compilation - * @param {Record} assets - * @param {{availableNumberOfCores: number}} optimizeOptions - * @returns {Promise} - */ - private optimize; - /** - * @param {Compiler} compiler - * @returns {void} - */ - apply(compiler: Compiler): void; -} -declare namespace TerserPlugin { - export { - terserMinify, - uglifyJsMinify, - swcMinify, - esbuildMinify, - Schema, - Compiler, - Compilation, - WebpackError, - Asset, - TerserECMA, - TerserOptions, - JestWorker, - SourceMapInput, - TraceMap, - Rule, - Rules, - ExtractCommentsFunction, - ExtractCommentsCondition, - ExtractCommentsFilename, - ExtractCommentsBanner, - ExtractCommentsObject, - ExtractCommentsOptions, - MinimizedResult, - Input, - CustomOptions, - InferDefaultType, - PredefinedOptions, - MinimizerOptions, - BasicMinimizerImplementation, - MinimizeFunctionHelpers, - MinimizerImplementation, - InternalOptions, - MinimizerWorker, - Parallel, - BasePluginOptions, - DefinedDefaultMinimizerAndOptions, - InternalPluginOptions, - }; -} -type Compiler = import("webpack").Compiler; -type BasePluginOptions = { - test?: Rules | undefined; - include?: Rules | undefined; - exclude?: Rules | undefined; - extractComments?: ExtractCommentsOptions | undefined; - parallel?: Parallel; -}; -type DefinedDefaultMinimizerAndOptions = T extends TerserOptions - ? { - minify?: MinimizerImplementation | undefined; - terserOptions?: MinimizerOptions | undefined; - } - : { - minify: MinimizerImplementation; - terserOptions?: MinimizerOptions | undefined; - }; -import { terserMinify } from "./utils"; -import { uglifyJsMinify } from "./utils"; -import { swcMinify } from "./utils"; -import { esbuildMinify } from "./utils"; -type Schema = import("schema-utils/declarations/validate").Schema; -type Compilation = import("webpack").Compilation; -type WebpackError = import("webpack").WebpackError; -type Asset = import("webpack").Asset; -type TerserECMA = import("./utils.js").TerserECMA; -type TerserOptions = import("./utils.js").TerserOptions; -type JestWorker = import("jest-worker").Worker; -type SourceMapInput = import("@jridgewell/trace-mapping").SourceMapInput; -type TraceMap = import("@jridgewell/trace-mapping").TraceMap; -type Rule = RegExp | string; -type Rules = Rule[] | Rule; -type ExtractCommentsFunction = ( - astNode: any, - comment: { - value: string; - type: "comment1" | "comment2" | "comment3" | "comment4"; - pos: number; - line: number; - col: number; - } -) => boolean; -type ExtractCommentsCondition = - | boolean - | "all" - | "some" - | RegExp - | ExtractCommentsFunction; -type ExtractCommentsFilename = string | ((fileData: any) => string); -type ExtractCommentsBanner = - | string - | boolean - | ((commentsFile: string) => string); -type ExtractCommentsObject = { - condition?: ExtractCommentsCondition | undefined; - filename?: ExtractCommentsFilename | undefined; - banner?: ExtractCommentsBanner | undefined; -}; -type ExtractCommentsOptions = ExtractCommentsCondition | ExtractCommentsObject; -type MinimizedResult = { - code: string; - map?: import("@jridgewell/trace-mapping").SourceMapInput | undefined; - errors?: (string | Error)[] | undefined; - warnings?: (string | Error)[] | undefined; - extractedComments?: string[] | undefined; -}; -type Input = { - [file: string]: string; -}; -type CustomOptions = { - [key: string]: any; -}; -type InferDefaultType = T extends infer U ? U : CustomOptions; -type PredefinedOptions = { - module?: boolean | undefined; - ecma?: import("terser").ECMA | undefined; -}; -type MinimizerOptions = PredefinedOptions & InferDefaultType; -type BasicMinimizerImplementation = ( - input: Input, - sourceMap: SourceMapInput | undefined, - minifyOptions: MinimizerOptions, - extractComments: ExtractCommentsOptions | undefined -) => Promise; -type MinimizeFunctionHelpers = { - getMinimizerVersion?: (() => string | undefined) | undefined; -}; -type MinimizerImplementation = BasicMinimizerImplementation & - MinimizeFunctionHelpers; -type InternalOptions = { - name: string; - input: string; - inputSourceMap: SourceMapInput | undefined; - extractComments: ExtractCommentsOptions | undefined; - minimizer: { - implementation: MinimizerImplementation; - options: MinimizerOptions; - }; -}; -type MinimizerWorker = import("jest-worker").Worker & { - transform: (options: string) => MinimizedResult; - minify: (options: InternalOptions) => MinimizedResult; -}; -type Parallel = undefined | boolean | number; -type InternalPluginOptions = BasePluginOptions & { - minimizer: { - implementation: MinimizerImplementation; - options: MinimizerOptions; - }; -}; -import { minify } from "./minify"; diff --git a/node_modules/terser-webpack-plugin/types/minify.d.ts b/node_modules/terser-webpack-plugin/types/minify.d.ts deleted file mode 100644 index 0213d74..0000000 --- a/node_modules/terser-webpack-plugin/types/minify.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export type MinimizedResult = import("./index.js").MinimizedResult; -export type CustomOptions = import("./index.js").CustomOptions; -/** @typedef {import("./index.js").MinimizedResult} MinimizedResult */ -/** @typedef {import("./index.js").CustomOptions} CustomOptions */ -/** - * @template T - * @param {import("./index.js").InternalOptions} options - * @returns {Promise} - */ -export function minify( - options: import("./index.js").InternalOptions -): Promise; -/** - * @param {string} options - * @returns {Promise} - */ -export function transform(options: string): Promise; diff --git a/node_modules/terser-webpack-plugin/types/utils.d.ts b/node_modules/terser-webpack-plugin/types/utils.d.ts deleted file mode 100644 index a654e91..0000000 --- a/node_modules/terser-webpack-plugin/types/utils.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -export type Task = () => Promise; -export type SourceMapInput = import("@jridgewell/trace-mapping").SourceMapInput; -export type TerserFormatOptions = import("terser").FormatOptions; -export type TerserOptions = import("terser").MinifyOptions; -export type TerserCompressOptions = import("terser").CompressOptions; -export type TerserECMA = import("terser").ECMA; -export type ExtractCommentsOptions = - import("./index.js").ExtractCommentsOptions; -export type ExtractCommentsFunction = - import("./index.js").ExtractCommentsFunction; -export type ExtractCommentsCondition = - import("./index.js").ExtractCommentsCondition; -export type Input = import("./index.js").Input; -export type MinimizedResult = import("./index.js").MinimizedResult; -export type PredefinedOptions = import("./index.js").PredefinedOptions; -export type CustomOptions = import("./index.js").CustomOptions; -export type ExtractedComments = Array; -/** - * @template T - * @typedef {() => Promise} Task - */ -/** - * Run tasks with limited concurrency. - * @template T - * @param {number} limit - Limit of tasks that run at once. - * @param {Task[]} tasks - List of tasks to run. - * @returns {Promise} A promise that fulfills to an array of the results - */ -export function throttleAll(limit: number, tasks: Task[]): Promise; -/** - * @template T - * @param fn {(function(): any) | undefined} - * @returns {function(): T} - */ -export function memoize(fn: (() => any) | undefined): () => T; -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @param {ExtractCommentsOptions | undefined} extractComments - * @return {Promise} - */ -export function terserMinify( - input: Input, - sourceMap: SourceMapInput | undefined, - minimizerOptions: PredefinedOptions & CustomOptions, - extractComments: ExtractCommentsOptions | undefined -): Promise; -export namespace terserMinify { - /** - * @returns {string | undefined} - */ - function getMinimizerVersion(): string | undefined; -} -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @param {ExtractCommentsOptions | undefined} extractComments - * @return {Promise} - */ -export function uglifyJsMinify( - input: Input, - sourceMap: SourceMapInput | undefined, - minimizerOptions: PredefinedOptions & CustomOptions, - extractComments: ExtractCommentsOptions | undefined -): Promise; -export namespace uglifyJsMinify { - /** - * @returns {string | undefined} - */ - function getMinimizerVersion(): string | undefined; -} -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @return {Promise} - */ -export function swcMinify( - input: Input, - sourceMap: SourceMapInput | undefined, - minimizerOptions: PredefinedOptions & CustomOptions -): Promise; -export namespace swcMinify { - /** - * @returns {string | undefined} - */ - function getMinimizerVersion(): string | undefined; -} -/** - * @param {Input} input - * @param {SourceMapInput | undefined} sourceMap - * @param {PredefinedOptions & CustomOptions} minimizerOptions - * @return {Promise} - */ -export function esbuildMinify( - input: Input, - sourceMap: SourceMapInput | undefined, - minimizerOptions: PredefinedOptions & CustomOptions -): Promise; -export namespace esbuildMinify { - /** - * @returns {string | undefined} - */ - function getMinimizerVersion(): string | undefined; -} diff --git a/node_modules/terser/CHANGELOG.md b/node_modules/terser/CHANGELOG.md deleted file mode 100644 index 9faaec7..0000000 --- a/node_modules/terser/CHANGELOG.md +++ /dev/null @@ -1,683 +0,0 @@ -# Changelog - -## v5.27.0 - - Created `minify_sync()` alternative to `minify()` since there's no async code left. - -## v5.26.0 - - Do not take the `/*#__PURE__*/` annotation into account when the `side_effects` compress option is off. - - The `preserve_annotations` option now automatically opts annotation comments in, instead of requiring the `comments` option to be configured for this. - - Refuse to parse empty parenthesized expressions (`()`) - -## v5.25.0 - - Regex properties added to reserved property mangler (#1471) - - `pure_new` option added to drop unused `new` expressions. - -## v5.24.0 - - Improve formatting performance in V8 by keeping a small work string and a large output string - -## v5.23.0 - - When top_retain will keep a variable assignment around, inline the assignee when it's shorter than the name (#1434) - - Remove empty class `static {}` blocks. - -## v5.22.0 - - Do not `unsafe`ly shorten expressions like a?.toString() when they're conditional. - - Avoid running drop_unused in nodes that aren't scopes. Fixes a rare crash. - - When 'module' is enabled, assume strict mode when figuring out scopes. - -## v5.21.0 - - Do not inline functions that would be retained in the toplevel (as this would cause code duplication). - - Fix precedence of arrow function and ternary operator when formatting output. - -## v5.20.0 - - Passing `minify()` zero files will now throw a clean exception (#1450) - - `drop_console` supports passing in an array of `console.*` method names (#1445) - - New DOM properties from the WebGPU API have been added for use in the property mangler (#1436) - - Internal code simplification (#1437) - -## v5.19.4 - - Prevent creating very deeply nested ternaries from a long list of `if..return` - - Prevent inlining classes into other functions, to avoid constructors being compared. - -## v5.19.3 - - Fix side effect detection of `optional?.chains`. - - Add roundRect to domprops.js (#1426) - -## v5.19.2 - - fix performance hit from avoiding HTML comments in the output - -## v5.19.1 - - Better avoid outputting `` and HTML comments. - - Fix unused variables in class static blocks not being dropped correctly. - - Fix sourcemap names of methods that are `async` or `static` - -## v5.19.0 - - Allow `/*@__MANGLE_PROP__*/` annotation in `object.property`, in addition to property declarations. - -## v5.18.2 - - Stop using recursion in hoisted defuns fix. - -## v5.18.1 - - Fix major performance issue caused by hoisted defuns' scopes bugfix. - -## v5.18.0 - - Add new `/*@__MANGLE_PROP__*/` annotation, to mark properties that should be mangled. - -## v5.17.7 - - Update some dependencies - - Add consistent sorting for `v` RegExp flag - - Add `inert` DOM attribute to domprops - -## v5.17.6 - - Fixes to mozilla AST input and output, for class properties, private properties and static blocks - - Fix outputting a shorthand property in quotes when safari10 and ecma=2015 options are enabled - - `configurable` and `enumerable`, used in Object.defineProperty, added to domprops (#1393) - -## v5.17.5 - - Take into account the non-deferred bits of a class, such as static properties, while dropping unused code. - -## v5.17.4 - - - Fix crash when trying to negate a class (`!class{}`) - - Avoid outputting comments between `yield`/`await` and its argument - - Fix detection of left-hand-side of assignment, to avoid optimizing it like any other expression in some edge cases - -## v5.17.3 - - - Fix issue with trimming a static class property's contents accessing the class as `this`. - -## v5.17.2 - - Be less conservative when detecting use-before-definition of `var` in hoisted functions. - - Support unusual (but perfectly valid) initializers of for-in and for-of loops. - - Fix issue where hoisted function would be dropped if it was after a `continue` statement - -## v5.17.1 - - Fix evaluating `.length` when the source array might've been mutated - -## v5.17.0 - - Drop vestigial `= undefined` default argument in IIFE calls (#1366) - - Evaluate known arrays' `.length` property when statically determinable - - Add `@__KEY__` annotation to mangle string literals (#1365) - -## v5.16.9 - - Fix parentheses in output of optional chains (`a?.b`) (#1374) - - More documentation on source maps (#1368) - - New `lhs_constants` option, allowing to stop Terser from swapping comparison operands (#1361) - -## v5.16.8 - - - Become even less conservative around function definitions for `reduce_vars` - - Fix parsing context of `import.meta` expressions such that method calls are allowed - -## v5.16.6 - - - Become less conservative with analyzing function definitions for `reduce_vars` - - Parse `import.meta` as a real AST node and not an `object.property` - -## v5.16.5 - - - Correctly handle AST transform functions that mutate children arrays - - Don't mutate the options object passed to Terser (#1342) - - Do not treat BigInt like a number - -## v5.16.4 - - - Keep `(defaultArg = undefined) => ...`, because default args don't count for function length - - Prevent inlining variables into `?.` optional chains - - Avoid removing unused arguments while transforming - - Optimize iterating AST node lists - - Make sure `catch` and `finally` aren't children of `try` in the AST - - Use modern unicode property escapes (`\p{...}`) to parse identifiers when available - -## v5.16.3 - - - Ensure function definitions, don't assume the values of variables defined after them. - -## v5.16.2 - - - Fix sourcemaps with non-ascii characters (#1318) - - Support string module name and export * as (#1336) - - Do not move `let` out of `for` initializers, as it can change scoping - - Fix a corner case that would generate the invalid syntax `if (something) let x` ("let" in braceless if body) - - Knowledge of more native object properties (#1330) - - Got rid of Travis (#1323) - - Added semi-secret `asObject` sourcemap option to typescript defs (#1321) - -## v5.16.1 - - - Properly handle references in destructurings (`const { [reference]: val } = ...`) - - Allow parsing of `.#privatefield` in nested classes - - Do not evaluate operations that return large strings if that would make the output code larger - - Make `collapse_vars` handle block scope correctly - - Internal improvements: Typos (#1311), more tests, small-scale refactoring - -## v5.16.0 - - - Disallow private fields in object bodies (#1011) - - Parse `#privatefield in object` (#1279) - - Compress `#privatefield in object` - -## v5.15.1 - - - Fixed missing parentheses around optional chains - - Avoid bare `let` or `const` as the bodies of `if` statements (#1253) - - Small internal fixes (#1271) - - Avoid inlining a class twice and creating two equivalent but `!==` classes. - -## v5.15.0 - - Basic support for ES2022 class static initializer blocks. - - Add `AudioWorkletNode` constructor options to domprops list (#1230) - - Make identity function inliner not inline `id(...expandedArgs)` - -## v5.14.2 - - - Security fix for RegExps that should not be evaluated (regexp DDOS) - - Source maps improvements (#1211) - - Performance improvements in long property access evaluation (#1213) - -## v5.14.1 - - keep_numbers option added to TypeScript defs (#1208) - - Fixed parsing of nested template strings (#1204) - -## v5.14.0 - - Switched to @jridgewell/source-map for sourcemap generation (#1190, #1181) - - Fixed source maps with non-terminated segments (#1106) - - Enabled typescript types to be imported from the package (#1194) - - Extra DOM props have been added (#1191) - - Delete the AST while generating code, as a means to save RAM - -## v5.13.1 - - Removed self-assignments (`varname=varname`) (closes #1081) - - Separated inlining code (for inlining things into references, or removing IIFEs) - - Allow multiple identifiers with the same name in `var` destructuring (eg `var { a, a } = x`) (#1176) - -## v5.13.0 - - - All calls to eval() were removed (#1171, #1184) - - `source-map` was updated to 0.8.0-beta.0 (#1164) - - NavigatorUAData was added to domprops to avoid property mangling (#1166) - -## v5.12.1 - - - Fixed an issue with function definitions inside blocks (#1155) - - Fixed parens of `new` in some situations (closes #1159) - -## v5.12.0 - - - `TERSER_DEBUG_DIR` environment variable - - @copyright comments are now preserved with the comments="some" option (#1153) - -## v5.11.0 - - - Unicode code point escapes (`\u{abcde}`) are not emitted inside RegExp literals anymore (#1147) - - acorn is now a regular dependency - -## v5.10.0 - - - Massive optimization to max_line_len (#1109) - - Basic support for import assertions - - Marked ES2022 Object.hasOwn as a pure function - - Fix `delete optional?.property` - - New CI/CD pipeline with github actions (#1057) - - Fix reordering of switch branches (#1092), (#1084) - - Fix error when creating a class property called `get` - - Acorn dependency is now an optional peerDependency - - Fix mangling collision with exported variables (#1072) - - Fix an issue with `return someVariable = (async () => { ... })()` (#1073) - -## v5.9.0 - - - Collapsing switch cases with the same bodies (even if they're not next to each other) (#1070). - - Fix evaluation of optional chain expressions (#1062) - - Fix mangling collision in ESM exports (#1063) - - Fix issue with mutating function objects after a second pass (#1047) - - Fix for inlining object spread `{ ...obj }` (#1071) - - Typescript typings fix (#1069) - -## v5.8.0 - - - Fixed shadowing variables while moving code in some cases (#1065) - - Stop mangling computed & quoted properties when keep_quoted is enabled. - - Fix for mangling private getter/setter and .#private access (#1060, #1068) - - Array.from has a new optimization when the unsafe option is set (#737) - - Mangle/propmangle let you generate your own identifiers through the nth_identifier option (#1061) - - More optimizations to switch statements (#1044) - -## v5.7.2 - - - Fixed issues with compressing functions defined in `global_defs` option (#1036) - - New recipe for using Terser in gulp was added to RECIPES.md (#1035) - - Fixed issues with `??` and `?.` (#1045) - - Future reserved words such as `package` no longer require you to disable strict mode to be used as names. - - Refactored huge compressor file into multiple more focused files. - - Avoided unparenthesized `in` operator in some for loops (it breaks parsing because of for..in loops) - - Improved documentation (#1021, #1025) - - More type definitions (#1021) - -## v5.7.1 - - - Avoided collapsing assignments together if it would place a chain assignment on the left hand side, which is invalid syntax (`a?.b = c`) - - Removed undefined from object expansions (`{ ...void 0 }` -> `{}`) - - Fix crash when checking if something is nullish or undefined (#1009) - - Fixed comparison of private class properties (#1015) - - Minor performance improvements (#993) - - Fixed scope of function defs in strict mode (they are block scoped) - -## v5.7.0 - - - Several compile-time evaluation and inlining fixes - - Allow `reduce_funcs` to be disabled again. - - Add `spidermonkey` options to parse and format (#974) - - Accept `{get = "default val"}` and `{set = "default val"}` in destructuring arguments. - - Change package.json export map to help require.resolve (#971) - - Improve docs - - Fix `export default` of an anonymous class with `extends` - -## v5.6.1 - - - Mark assignments to the `.prototype` of a class as pure - - Parenthesize `await` on the left of `**` (while accepting legacy non-parenthesised input) - - Avoided outputting NUL bytes in optimized RegExps, to stop the output from breaking other tools - - Added `exports` to domprops (#939) - - Fixed a crash when spreading `...this` - - Fixed the computed size of arrow functions, which improves their inlining - -## v5.6.0 - - - Added top-level await - - Beautify option has been removed in #895 - - Private properties, getters and setters have been added in #913 and some more commits - - Docs improvements: #896, #903, #916 - -## v5.5.1 - - - Fixed object properties with unicode surrogates on safari. - -## v5.5.0 - - - Fixed crash when inlining uninitialized variable into template string. - - The sourcemap for dist was removed for being too large. - -## v5.4.0 - - - Logical assignment - - Change `let x = undefined` to just `let x` - - Removed some optimizations for template strings, placing them behind `unsafe` options. Reason: adding strings is not equivalent to template strings, due to valueOf differences. - - The AST_Token class was slimmed down in order to use less memory. - -## v5.3.8 - - - Restore node 13 support - -## v5.3.7 - -Hotfix release, fixes package.json "engines" syntax - -## v5.3.6 - - - Fixed parentheses when outputting `??` mixed with `||` and `&&` - - Improved hygiene of the symbol generator - -## v5.3.5 - - - Avoid moving named functions into default exports. - - Enabled transform() for chain expressions. This allows AST transformers to reach inside chain expressions. - -## v5.3.4 - - - Fixed a crash when hoisting (with `hoist_vars`) a destructuring variable declaration - -## v5.3.3 - - - `source-map` library has been updated, bringing memory usage and CPU time improvements when reading input source maps (the SourceMapConsumer is now WASM based). - - The `wrap_func_args` option now also wraps arrow functions, as opposed to only function expressions. - -## v5.3.2 - - - Prevented spread operations from being expanded when the expanded array/object contains getters, setters, or array holes. - - Fixed _very_ slow self-recursion in some cases of removing extraneous parentheses from `+` operations. - -## v5.3.1 - - - An issue with destructuring declarations when `pure_getters` is enabled has been fixed - - Fixed a crash when chain expressions need to be shallowly compared - - Made inlining functions more conservative to make sure a function that contains a reference to itself isn't moved into a place that can create multiple instances of itself. - -## v5.3.0 - - - Fixed a crash when compressing object spreads in some cases - - Fixed compiletime evaluation of optional chains (caused typeof a?.b to always return "object") - - domprops has been updated to contain every single possible prop - -## v5.2.1 - - - The parse step now doesn't accept an `ecma` option, so that all ES code is accepted. - - Optional dotted chains now accept keywords, just like dotted expressions (`foo?.default`) - -## v5.2.0 - - - Optional chaining syntax is now supported. - - Consecutive await expressions don't have unnecessary parens - - Taking the variable name's length (after mangling) into consideration when deciding to inline - -## v5.1.0 - - - `import.meta` is now supported - - Typescript typings have been improved - -## v5.0.0 - - - `in` operator now taken into account during property mangle. - - Fixed infinite loop in face of a reference loop in some situations. - - Kept exports and imports around even if there's something which will throw before them. - - The main exported bundle for commonjs, dist/bundle.min.js is no longer minified. - -## v5.0.0-beta.0 - - - BREAKING: `minify()` is now async and rejects a promise instead of returning an error. - - BREAKING: Internal AST is no longer exposed, so that it can be improved without releasing breaking changes. - - BREAKING: Lowest supported node version is 10 - - BREAKING: There are no more warnings being emitted - - Module is now distributed as a dual package - You can `import` and `require()` too. - - Inline improvements were made - - ------ - -## v4.8.1 (backport) - - - Security fix for RegExps that should not be evaluated (regexp DDOS) - -## v4.8.0 - - - Support for numeric separators (`million = 1_000_000`) was added. - - Assigning properties to a class is now assumed to be pure. - - Fixed bug where `yield` wasn't considered a valid property key in generators. - -## v4.7.0 - - - A bug was fixed where an arrow function would have the wrong size - - `arguments` object is now considered safe to retrieve properties from (useful for `length`, or `0`) even when `pure_getters` is not set. - - Fixed erroneous `const` declarations without value (which is invalid) in some corner cases when using `collapse_vars`. - -## v4.6.13 - - - Fixed issue where ES5 object properties were being turned into ES6 object properties due to more lax unicode rules. - - Fixed parsing of BigInt with lowercase `e` in them. - -## v4.6.12 - - - Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]` - - Printing of unicode identifiers has been improved - -## v4.6.11 - - - Read unused classes' properties and method keys, to figure out if they use other variables. - - Prevent inlining into block scopes when there are name collisions - - Functions are no longer inlined into parameter defaults, because they live in their own special scope. - - When inlining identity functions, take into account the fact they may be used to drop `this` in function calls. - - Nullish coalescing operator (`x ?? y`), plus basic optimization for it. - - Template literals in binary expressions such as `+` have been further optimized - -## v4.6.10 - - - Do not use reduce_vars when classes are present - -## v4.6.9 - - - Check if block scopes actually exist in blocks - -## v4.6.8 - - - Take into account "executed bits" of classes like static properties or computed keys, when checking if a class evaluation might throw or have side effects. - -## v4.6.7 - - - Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first. - - An issue with setting `--comments` to `false` in the CLI has been fixed. - - Fixed some issues with inlining - - `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()` - - Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6). - -## v4.6.6 - -(hotfix release) - - - Reverted code to 4.6.4 to allow for more time to investigate an issue. - -## v4.6.5 (REVERTED) - - - Improved compress performance through using a new method to see if two nodes are equivalent, instead of printing them to a string. - -## v4.6.4 - - - The `"some"` value in the `comments` output option now preserves `@lic` and other important comments when using `//` - - `` is now better escaped in regex, and in comments, when using the `inline_script` output option - - Fixed an issue when transforming `new RegExp` into `/.../` when slashes are included in the source - - `AST_Node.prototype.constructor` now exists, allowing for easier debugging of crashes - - Multiple if statements with the same consequents are now collapsed - - Typescript typings improvements - - Optimizations while looking for surrogate pairs in strings - -## v4.6.3 - - - Annotations such as `/*#__NOINLINE__*/` and `/*#__PURE__*/` may now be preserved using the `preserve_annotations` output option - - A TypeScript definition update for the `keep_quoted` output option. - -## v4.6.2 - - - A bug where functions were inlined into other functions with scope conflicts has been fixed. - - `/*#__NOINLINE__*/` annotation fixed for more use cases where inlining happens. - -## v4.6.1 - - - Fixed an issue where a class is duplicated by reduce_vars when there's a recursive reference to the class. - -## v4.6.0 - - - Fixed issues with recursive class references. - - BigInt evaluation has been prevented, stopping Terser from evaluating BigInts like it would do regular numbers. - - Class property support has been added - -## v4.5.1 - -(hotfix release) - - - Fixed issue where `() => ({})[something]` was not parenthesised correctly. - -## v4.5.0 - - - Inlining has been improved - - An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed - - You can now set the ES version through their year - - The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such - - Internal small optimisations and refactors - -## v4.4.3 - - - Number and BigInt parsing has been fixed - - `/*#__INLINE__*/` annotation fixed for arrow functions with non-block bodies. - - Functional tests have been added, using [this repository](https://github.com/terser/terser-functional-tests). - - A memory leak, where the entire AST lives on after compression, has been plugged. - -## v4.4.2 - - - Fixed a problem with inlining identity functions - -## v4.4.1 - -*note:* This introduced a feature, therefore it should have been a minor release. - - - Fixed a crash when `unsafe` was enabled. - - An issue has been fixed where `let` statements might be collapsed out of their scope. - - Some error messages have been improved by adding quotes around variable names. - -## v4.4.0 - - - Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining. - -## v4.3.11 - - - Fixed a problem where `window` was considered safe to access, even though there are situations where it isn't (Node.js, workers...) - - Fixed an error where `++` and `--` were considered side-effect free - - `Number(x)` now needs both `unsafe` and and `unsafe_math` to be compressed into `+x` because `x` might be a `BigInt` - - `keep_fnames` now correctly supports regexes when the function is in a variable declaration - -## v4.3.10 - - - Fixed syntax error when repeated semicolons were encountered in classes - - Fixed invalid output caused by the creation of empty sequences internally - - Scopes are now updated when scopes are inlined into them - -## v4.3.9 - - Fixed issue with mangle's `keep_fnames` option, introduced when adding code to keep variable names of anonymous functions - -## v4.3.8 - - - Typescript typings fix - -## v4.3.7 - - - Parsing of regex options in the CLI (which broke in v4.3.5) was fixed. - - typescript definition updates - -## v4.3.6 - -(crash hotfix) - -## v4.3.5 - - - Fixed an issue with DOS line endings strings separated by `\` and a new line. - - Improved fix for the output size regression related to unused references within the extends section of a class. - - Variable names of anonymous functions (eg: `const x = () => { ... }` or `var func = function () {...}`) are now preserved when keep_fnames is true. - - Fixed performance degradation introduced for large payloads in v4.2.0 - -## v4.3.4 - - - Fixed a regression where the output size was increased when unused classes were referred to in the extends clause of a class. - - Small typescript typings fixes. - - Comments with `@preserve`, `@license`, `@cc_on` as well as comments starting with `/*!` and `/**!` are now preserved by default. - -## v4.3.3 - - - Fixed a problem where parsing template strings would mix up octal notation and a slash followed by a zero representing a null character. - - Started accepting the name `async` in destructuring arguments with default value. - - Now Terser takes into account side effects inside class `extends` clauses. - - Added parens whenever there's a comment between a return statement and the returned value, to prevent issues with ASI. - - Stopped using raw RegExp objects, since the spec is going to continue to evolve. This ensures Terser is able to process new, unknown RegExp flags and features. This is a breaking change in the AST node AST_RegExp. - -## v4.3.2 - - - Typescript typing fix - - Ensure that functions can't be inlined, by reduce_vars, into places where they're accessing variables with the same name, but from somewhere else. - -## v4.3.1 - - - Fixed an issue from 4.3.0 where any block scope within a for loop erroneously had its parent set to the function scopee - - Fixed an issue where compressing IIFEs with argument expansions would result in some parameters becoming undefined - - addEventListener options argument's properties are now part of the DOM properties list. - -## v4.3.0 - - - Do not drop computed object keys with side effects - - Functions passed to other functions in calls are now wrapped in parentheses by default, which speeds up loading most modules - - Objects with computed properties are now less likely to be hoisted - - Speed and memory efficiency optimizations - - Fixed scoping issues with `try` and `switch` - -## v4.2.1 - - - Minor refactors - - Fixed a bug similar to #369 in collapse_vars - - Functions can no longer be inlined into a place where they're going to be compared with themselves. - - reduce_funcs option is now legacy, as using reduce_vars without reduce_funcs caused some weird corner cases. As a result, it is now implied in reduce_vars and can't be turned off without turning off reduce_vars. - - Bug which would cause a random stack overflow has now been fixed. - -## v4.2.0 - - - When the source map URL is `inline`, don't write it to a file. - - Fixed output parens when a lambda literal is the tag on a tagged template string. - - The `mangle.properties.undeclared` option was added. This enables the property mangler to mangle properties of variables which can be found in the name cache, but whose properties are not known to this Terser run. - - The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed. - - Now we're guaranteed to not have duplicate comments in the output - - Domprops updates - -## v4.1.4 - - - Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables. - -## v4.1.3 - - - Several issues with the `reduce_vars` option were fixed. - - Starting this version, we only have a dist/bundle.min.js - -## v4.1.2 - - - The hotfix was hotfixed - -## v4.1.1 - - - Fixed a bug where toplevel scopes were being mixed up with lambda scopes - -## v4.1.0 - - - Internal functions were replaced by `Object.assign`, `Array.prototype.some`, `Array.prototype.find` and `Array.prototype.every`. - - A serious issue where some ESM-native code was broken was fixed. - - Performance improvements were made. - - Support for BigInt was added. - - Inline efficiency was improved. Functions are now being inlined more proactively instead of being inlined only after another Compressor pass. - -## v4.0.2 - -(Hotfix release. Reverts unmapped segments PR [#342](https://github.com/terser/terser/pull/342), which will be put back on Terser when the upstream issue is resolved) - -## v4.0.1 - - - Collisions between the arguments of inlined functions and names in the outer scope are now being avoided while inlining - - Unmapped segments are now preserved when compressing a file which has source maps - - Default values of functions are now correctly converted from Mozilla AST to Terser AST - - JSON ⊂ ECMAScript spec (if you don't know what this is you don't need to) - - Export AST_* classes to library users - - Fixed issue with `collapse_vars` when functions are created with the same name as a variable which already exists - - Added `MutationObserverInit` (Object with options for initialising a mutation observer) properties to the DOM property list - - Custom `Error` subclasses are now internally used instead of old-school Error inheritance hacks. - - Documentation fixes - - Performance optimizations - -## v4.0.0 - - - **breaking change**: The `variables` property of all scopes has become a standard JavaScript `Map` as opposed to the old bespoke `Dictionary` object. - - Typescript definitions were fixed - - `terser --help` was fixed - - The public interface was cleaned up - - Fixed optimisation of `Array` and `new Array` - - Added the `keep_quoted=strict` mode to mangle_props, which behaves more like Google Closure Compiler by mangling all unquoted property names, instead of reserving quoted property names automatically. - - Fixed parent functions' parameters being shadowed in some cases - - Allowed Terser to run in a situation where there are custom functions attached to Object.prototype - - And more bug fixes, optimisations and internal changes - -## v3.17.0 - - - More DOM properties added to --mangle-properties's DOM property list - - Closed issue where if 2 functions had the same argument name, Terser would not inline them together properly - - Fixed issue with `hasOwnProperty.call` - - You can now list files to minify in a Terser config file - - Started replacing `new Array()` with an array literal - - Started using ES6 capabilities like `Set` and the `includes` method for strings and arrays - -## v3.16.1 - - - Fixed issue where Terser being imported with `import` would cause it not to work due to the `__esModule` property. (PR #254 was submitted, which was nice, but since it wasn't a pure commonJS approach I decided to go with my own solution) - -## v3.16.0 - - - No longer leaves names like Array or Object or window as a SimpleStatement (statement which is just a single expression). - - Add support for sections sourcemaps (IndexedSourceMapConsumer) - - Drops node.js v4 and starts using commonJS - - Is now built with rollup - -## v3.15.0 - - - Inlined spread syntax (`[...[1, 2, 3], 4, 5] => [1, 2, 3, 4, 5]`) in arrays and objects. - - Fixed typo in compressor warning - - Fixed inline source map input bug - - Fixed parsing of template literals with unnecessary escapes (Like `\\a`) diff --git a/node_modules/terser/LICENSE b/node_modules/terser/LICENSE deleted file mode 100644 index 3b07e94..0000000 --- a/node_modules/terser/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2012-2018 (c) Mihai Bazon - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. diff --git a/node_modules/terser/PATRONS.md b/node_modules/terser/PATRONS.md deleted file mode 100644 index 3df7715..0000000 --- a/node_modules/terser/PATRONS.md +++ /dev/null @@ -1,15 +0,0 @@ -# Our patrons - -These are the first-tier patrons from Patreon (notice: **The Terser Patreon is shutting down in favor of opencollective**). My appreciation goes to everyone on this list for supporting the project! - - * 38elements - * Alan Orozco - * Aria Buckles - * CKEditor - * Mariusz Nowak - * Nakshatra Mukhopadhyay - * Philippe Léger - * Piotrek Koszuliński - * Serhiy Shyyko - * Viktor Hubert - * 龙腾道 diff --git a/node_modules/terser/README.md b/node_modules/terser/README.md deleted file mode 100644 index 84541c8..0000000 --- a/node_modules/terser/README.md +++ /dev/null @@ -1,1421 +0,0 @@ -

Terser

- - [![NPM Version][npm-image]][npm-url] - [![NPM Downloads][downloads-image]][downloads-url] - [![CI pipeline][ci-image]][ci-url] - [![Opencollective financial contributors][opencollective-contributors]][opencollective-url] - -A JavaScript mangler/compressor toolkit for ES6+. - -*note*: You can support this project on patreon: [link] **The Terser Patreon is shutting down in favor of opencollective**. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons. - -Terser recommends you use RollupJS to bundle your modules, as that produces smaller code overall. - -*Beautification* has been undocumented and is *being removed* from terser, we recommend you use [prettier](https://npmjs.com/package/prettier). - -Find the changelog in [CHANGELOG.md](https://github.com/terser/terser/blob/master/CHANGELOG.md) - - - -[npm-image]: https://img.shields.io/npm/v/terser.svg -[npm-url]: https://npmjs.org/package/terser -[downloads-image]: https://img.shields.io/npm/dm/terser.svg -[downloads-url]: https://npmjs.org/package/terser -[ci-image]: https://github.com/terser/terser/actions/workflows/ci.yml/badge.svg -[ci-url]: https://github.com/terser/terser/actions/workflows/ci.yml -[opencollective-contributors]: https://opencollective.com/terser/tiers/badge.svg -[opencollective-url]: https://opencollective.com/terser - -Why choose terser? ------------------- - -`uglify-es` is [no longer maintained](https://github.com/mishoo/UglifyJS2/issues/3156#issuecomment-392943058) and `uglify-js` does not support ES6+. - -**`terser`** is a fork of `uglify-es` that mostly retains API and CLI compatibility -with `uglify-es` and `uglify-js@3`. - -Install -------- - -First make sure you have installed the latest version of [node.js](http://nodejs.org/) -(You may need to restart your computer after this step). - -From NPM for use as a command line app: - - npm install terser -g - -From NPM for programmatic use: - - npm install terser - -# Command line usage - - - -``` -terser [input files] [options] -``` - -Terser can take multiple input files. It's recommended that you pass the -input files first, then pass the options. Terser will parse input files -in sequence and apply any compression options. The files are parsed in the -same global scope, that is, a reference from a file to some -variable/function declared in another file will be matched properly. - -Command line arguments that take options (like --parse, --compress, --mangle and ---format) can take in a comma-separated list of default option overrides. For -instance: - - terser input.js --compress ecma=2015,computed_props=false - -If no input file is specified, Terser will read from STDIN. - -If you wish to pass your options before the input files, separate the two with -a double dash to prevent input files being used as option arguments: - - terser --compress --mangle -- input.js - -### Command line options - -``` - -h, --help Print usage information. - `--help options` for details on available options. - -V, --version Print version number. - -p, --parse Specify parser options: - `acorn` Use Acorn for parsing. - `bare_returns` Allow return outside of functions. - Useful when minifying CommonJS - modules and Userscripts that may - be anonymous function wrapped (IIFE) - by the .user.js engine `caller`. - `expression` Parse a single expression, rather than - a program (for parsing JSON). - `spidermonkey` Assume input files are SpiderMonkey - AST format (as JSON). - -c, --compress [options] Enable compressor/specify compressor options: - `pure_funcs` List of functions that can be safely - removed when their return values are - not used. - -m, --mangle [options] Mangle names/specify mangler options: - `reserved` List of names that should not be mangled. - --mangle-props [options] Mangle properties/specify mangler options: - `builtins` Mangle property names that overlaps - with standard JavaScript globals and DOM - API props. - `debug` Add debug prefix and suffix. - `keep_quoted` Only mangle unquoted properties, quoted - properties are automatically reserved. - `strict` disables quoted properties - being automatically reserved. - `regex` Only mangle matched property names. - `only_annotated` Only mangle properties defined with /*@__MANGLE_PROP__*/. - `reserved` List of names that should not be mangled. - -f, --format [options] Specify format options. - `preamble` Preamble to prepend to the output. You - can use this to insert a comment, for - example for licensing information. - This will not be parsed, but the source - map will adjust for its presence. - `quote_style` Quote style: - 0 - auto - 1 - single - 2 - double - 3 - original - `wrap_iife` Wrap IIFEs in parenthesis. Note: you may - want to disable `negate_iife` under - compressor options. - `wrap_func_args` Wrap function arguments in parenthesis. - -o, --output Output file path (default STDOUT). Specify `ast` or - `spidermonkey` to write Terser or SpiderMonkey AST - as JSON to STDOUT respectively. - --comments [filter] Preserve copyright comments in the output. By - default this works like Google Closure, keeping - JSDoc-style comments that contain e.g. "@license", - or start with "!". You can optionally pass one of the - following arguments to this flag: - - "all" to keep all comments - - `false` to omit comments in the output - - a valid JS RegExp like `/foo/` or `/^!/` to - keep only matching comments. - Note that currently not *all* comments can be - kept when compression is on, because of dead - code removal or cascading statements into - sequences. - --config-file Read `minify()` options from JSON file. - -d, --define [=value] Global definitions. - --ecma Specify ECMAScript release: 5, 2015, 2016, etc. - -e, --enclose [arg[:value]] Embed output in a big function with configurable - arguments and values. - --ie8 Support non-standard Internet Explorer 8. - Equivalent to setting `ie8: true` in `minify()` - for `compress`, `mangle` and `format` options. - By default Terser will not try to be IE-proof. - --keep-classnames Do not mangle/drop class names. - --keep-fnames Do not mangle/drop function names. Useful for - code relying on Function.prototype.name. - --module Input is an ES6 module. If `compress` or `mangle` is - enabled then the `toplevel` option, as well as strict mode, - will be enabled. - --name-cache File to hold mangled name mappings. - --safari10 Support non-standard Safari 10/11. - Equivalent to setting `safari10: true` in `minify()` - for `mangle` and `format` options. - By default `terser` will not work around - Safari 10/11 bugs. - --source-map [options] Enable source map/specify source map options: - `base` Path to compute relative paths from input files. - `content` Input source map, useful if you're compressing - JS that was generated from some other original - code. Specify "inline" if the source map is - included within the sources. - `filename` Name and/or location of the output source. - `includeSources` Pass this flag if you want to include - the content of source files in the - source map as sourcesContent property. - `root` Path to the original source to be included in - the source map. - `url` If specified, path to the source map to append in - `//# sourceMappingURL`. - --timings Display operations run time on STDERR. - --toplevel Compress and/or mangle variables in top level scope. - --wrap Embed everything in a big function, making the - “exports” and “global” variables available. You - need to pass an argument to this option to - specify the name that your module will take - when included in, say, a browser. -``` - -Specify `--output` (`-o`) to declare the output file. Otherwise the output -goes to STDOUT. - -## CLI source map options - -Terser can generate a source map file, which is highly useful for -debugging your compressed JavaScript. To get a source map, pass -`--source-map --output output.js` (source map will be written out to -`output.js.map`). - -Additional options: - -- `--source-map "filename=''"` to specify the name of the source map. - -- `--source-map "root=''"` to pass the URL where the original files can be found. - -- `--source-map "url=''"` to specify the URL where the source map can be found. - Otherwise Terser assumes HTTP `X-SourceMap` is being used and will omit the - `//# sourceMappingURL=` directive. - -For example: - - terser js/file1.js js/file2.js \ - -o foo.min.js -c -m \ - --source-map "root='http://foo.com/src',url='foo.min.js.map'" - -The above will compress and mangle `file1.js` and `file2.js`, will drop the -output in `foo.min.js` and the source map in `foo.min.js.map`. The source -mapping will refer to `http://foo.com/src/js/file1.js` and -`http://foo.com/src/js/file2.js` (in fact it will list `http://foo.com/src` -as the source map root, and the original files as `js/file1.js` and -`js/file2.js`). - -### Composed source map - -When you're compressing JS code that was output by a compiler such as -CoffeeScript, mapping to the JS code won't be too helpful. Instead, you'd -like to map back to the original code (i.e. CoffeeScript). Terser has an -option to take an input source map. Assuming you have a mapping from -CoffeeScript → compiled JS, Terser can generate a map from CoffeeScript → -compressed JS by mapping every token in the compiled JS to its original -location. - -To use this feature pass `--source-map "content='/path/to/input/source.map'"` -or `--source-map "content=inline"` if the source map is included inline with -the sources. - -## CLI compress options - -You need to pass `--compress` (`-c`) to enable the compressor. Optionally -you can pass a comma-separated list of [compress options](#compress-options). - -Options are in the form `foo=bar`, or just `foo` (the latter implies -a boolean option that you want to set `true`; it's effectively a -shortcut for `foo=true`). - -Example: - - terser file.js -c toplevel,sequences=false - -## CLI mangle options - -To enable the mangler you need to pass `--mangle` (`-m`). The following -(comma-separated) options are supported: - -- `toplevel` (default `false`) -- mangle names declared in the top level scope. - -- `eval` (default `false`) -- mangle names visible in scopes where `eval` or `with` are used. - -When mangling is enabled but you want to prevent certain names from being -mangled, you can declare those names with `--mangle reserved` — pass a -comma-separated list of names. For example: - - terser ... -m reserved=['$','require','exports'] - -to prevent the `require`, `exports` and `$` names from being changed. - -### CLI mangling property names (`--mangle-props`) - -**Note:** THIS **WILL** BREAK YOUR CODE. A good rule of thumb is not to use this unless you know exactly what you're doing and how this works and read this section until the end. - -Mangling property names is a separate step, different from variable name mangling. Pass -`--mangle-props` to enable it. The least dangerous -way to use this is to use the `regex` option like so: - -``` -terser example.js -c -m --mangle-props regex=/_$/ -``` - -This will mangle all properties that end with an -underscore. So you can use it to mangle internal methods. - -By default, it will mangle all properties in the -input code with the exception of built in DOM properties and properties -in core JavaScript classes, which is what will break your code if you don't: - -1. Control all the code you're mangling -2. Avoid using a module bundler, as they usually will call Terser on each file individually, making it impossible to pass mangled objects between modules. -3. Avoid calling functions like `defineProperty` or `hasOwnProperty`, because they refer to object properties using strings and will break your code if you don't know what you are doing. - -An example: - -```javascript -// example.js -var x = { - baz_: 0, - foo_: 1, - calc: function() { - return this.foo_ + this.baz_; - } -}; -x.bar_ = 2; -x["baz_"] = 3; -console.log(x.calc()); -``` -Mangle all properties (except for JavaScript `builtins`) (**very** unsafe): -```bash -$ terser example.js -c passes=2 -m --mangle-props -``` -```javascript -var x={o:3,t:1,i:function(){return this.t+this.o},s:2};console.log(x.i()); -``` -Mangle all properties except for `reserved` properties (still very unsafe): -```bash -$ terser example.js -c passes=2 -m --mangle-props reserved=[foo_,bar_] -``` -```javascript -var x={o:3,foo_:1,t:function(){return this.foo_+this.o},bar_:2};console.log(x.t()); -``` -Mangle all properties matching a `regex` (not as unsafe but still unsafe): -```bash -$ terser example.js -c passes=2 -m --mangle-props regex=/_$/ -``` -```javascript -var x={o:3,t:1,calc:function(){return this.t+this.o},i:2};console.log(x.calc()); -``` - -Combining mangle properties options: -```bash -$ terser example.js -c passes=2 -m --mangle-props regex=/_$/,reserved=[bar_] -``` -```javascript -var x={o:3,t:1,calc:function(){return this.t+this.o},bar_:2};console.log(x.calc()); -``` - -In order for this to be of any use, we avoid mangling standard JS names and DOM -API properties by default (`--mangle-props builtins` to override). - -A regular expression can be used to define which property names should be -mangled. For example, `--mangle-props regex=/^_/` will only mangle property -names that start with an underscore. - -When you compress multiple files using this option, in order for them to -work together in the end we need to ensure somehow that one property gets -mangled to the same name in all of them. For this, pass `--name-cache filename.json` -and Terser will maintain these mappings in a file which can then be reused. -It should be initially empty. Example: - -```bash -$ rm -f /tmp/cache.json # start fresh -$ terser file1.js file2.js --mangle-props --name-cache /tmp/cache.json -o part1.js -$ terser file3.js file4.js --mangle-props --name-cache /tmp/cache.json -o part2.js -``` - -Now, `part1.js` and `part2.js` will be consistent with each other in terms -of mangled property names. - -Using the name cache is not necessary if you compress all your files in a -single call to Terser. - -### Mangling unquoted names (`--mangle-props keep_quoted`) - -Using quoted property name (`o["foo"]`) reserves the property name (`foo`) -so that it is not mangled throughout the entire script even when used in an -unquoted style (`o.foo`). Example: - -```javascript -// stuff.js -var o = { - "foo": 1, - bar: 3 -}; -o.foo += o.bar; -console.log(o.foo); -``` -```bash -$ terser stuff.js --mangle-props keep_quoted -c -m -``` -```javascript -var o={foo:1,o:3};o.foo+=o.o,console.log(o.foo); -``` - -### Debugging property name mangling - -You can also pass `--mangle-props debug` in order to mangle property names -without completely obscuring them. For example the property `o.foo` -would mangle to `o._$foo$_` with this option. This allows property mangling -of a large codebase while still being able to debug the code and identify -where mangling is breaking things. - -```bash -$ terser stuff.js --mangle-props debug -c -m -``` -```javascript -var o={_$foo$_:1,_$bar$_:3};o._$foo$_+=o._$bar$_,console.log(o._$foo$_); -``` - -You can also pass a custom suffix using `--mangle-props debug=XYZ`. This would then -mangle `o.foo` to `o._$foo$XYZ_`. You can change this each time you compile a -script to identify how a property got mangled. One technique is to pass a -random number on every compile to simulate mangling changing with different -inputs (e.g. as you update the input script with new properties), and to help -identify mistakes like writing mangled keys to storage. - - - -# API Reference - - - -Assuming installation via NPM, you can load Terser in your application -like this: - -```javascript -const { minify } = require("terser"); -``` - -Or, - -```javascript -import { minify } from "terser"; -``` - -Browser loading is also supported. It exposes a global variable `Terser` containing a `.minify` property: -```html - - -``` - -There is an async high level function, **`async minify(code, options)`**, -which will perform all minification [phases](#minify-options) in a configurable -manner. By default `minify()` will enable [`compress`](#compress-options) -and [`mangle`](#mangle-options). Example: -```javascript -var code = "function add(first, second) { return first + second; }"; -var result = await minify(code, { sourceMap: true }); -console.log(result.code); // minified output: function add(n,d){return n+d} -console.log(result.map); // source map -``` - -There is also a `minify_sync()` alternative version of it, which returns instantly. - -You can `minify` more than one JavaScript file at a time by using an object -for the first argument where the keys are file names and the values are source -code: -```javascript -var code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; -var result = await minify(code); -console.log(result.code); -// function add(d,n){return d+n}console.log(add(3,7)); -``` - -The `toplevel` option: -```javascript -var code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; -var options = { toplevel: true }; -var result = await minify(code, options); -console.log(result.code); -// console.log(3+7); -``` - -The `nameCache` option: -```javascript -var options = { - mangle: { - toplevel: true, - }, - nameCache: {} -}; -var result1 = await minify({ - "file1.js": "function add(first, second) { return first + second; }" -}, options); -var result2 = await minify({ - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}, options); -console.log(result1.code); -// function n(n,r){return n+r} -console.log(result2.code); -// console.log(n(3,7)); -``` - -You may persist the name cache to the file system in the following way: -```javascript -var cacheFileName = "/tmp/cache.json"; -var options = { - mangle: { - properties: true, - }, - nameCache: JSON.parse(fs.readFileSync(cacheFileName, "utf8")) -}; -fs.writeFileSync("part1.js", await minify({ - "file1.js": fs.readFileSync("file1.js", "utf8"), - "file2.js": fs.readFileSync("file2.js", "utf8") -}, options).code, "utf8"); -fs.writeFileSync("part2.js", await minify({ - "file3.js": fs.readFileSync("file3.js", "utf8"), - "file4.js": fs.readFileSync("file4.js", "utf8") -}, options).code, "utf8"); -fs.writeFileSync(cacheFileName, JSON.stringify(options.nameCache), "utf8"); -``` - -An example of a combination of `minify()` options: -```javascript -var code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; -var options = { - toplevel: true, - compress: { - global_defs: { - "@console.log": "alert" - }, - passes: 2 - }, - format: { - preamble: "/* minified */" - } -}; -var result = await minify(code, options); -console.log(result.code); -// /* minified */ -// alert(10);" -``` - -An error example: -```javascript -try { - const result = await minify({"foo.js" : "if (0) else console.log(1);"}); - // Do something with result -} catch (error) { - const { message, filename, line, col, pos } = error; - // Do something with error -} -``` - -## Minify options - -- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override - `compress` and `format`'s `ecma` options. - -- `enclose` (default `false`) - pass `true`, or a string in the format - of `"args[:values]"`, where `args` and `values` are comma-separated - argument names and values, respectively, to embed the output in a big - function with the configurable arguments and values. - -- `parse` (default `{}`) — pass an object if you wish to specify some - additional [parse options](#parse-options). - -- `compress` (default `{}`) — pass `false` to skip compressing entirely. - Pass an object to specify custom [compress options](#compress-options). - -- `mangle` (default `true`) — pass `false` to skip mangling names, or pass - an object to specify [mangle options](#mangle-options) (see below). - - - `mangle.properties` (default `false`) — a subcategory of the mangle option. - Pass an object to specify custom [mangle property options](#mangle-properties-options). - -- `module` (default `false`) — Use when minifying an ES6 module. "use strict" - is implied and names can be mangled on the top scope. If `compress` or - `mangle` is enabled then the `toplevel` option will be enabled. - -- `format` or `output` (default `null`) — pass an object if you wish to specify - additional [format options](#format-options). The defaults are optimized - for best compression. - -- `sourceMap` (default `false`) - pass an object if you wish to specify - [source map options](#source-map-options). - -- `toplevel` (default `false`) - set to `true` if you wish to enable top level - variable and function name mangling and to drop unused variables and functions. - -- `nameCache` (default `null`) - pass an empty object `{}` or a previously - used `nameCache` object if you wish to cache mangled variable and - property names across multiple invocations of `minify()`. Note: this is - a read/write property. `minify()` will read the name cache state of this - object and update it during minification so that it may be - reused or externally persisted by the user. - -- `ie8` (default `false`) - set to `true` to support IE8. - -- `keep_classnames` (default: `undefined`) - pass `true` to prevent discarding or mangling - of class names. Pass a regular expression to only keep class names matching that regex. - -- `keep_fnames` (default: `false`) - pass `true` to prevent discarding or mangling - of function names. Pass a regular expression to only keep function names matching that regex. - Useful for code relying on `Function.prototype.name`. If the top level minify option - `keep_classnames` is `undefined` it will be overridden with the value of the top level - minify option `keep_fnames`. - -- `safari10` (default: `false`) - pass `true` to work around Safari 10/11 bugs in - loop scoping and `await`. See `safari10` options in [`mangle`](#mangle-options) - and [`format`](#format-options) for details. - -## Minify options structure - -```javascript -{ - parse: { - // parse options - }, - compress: { - // compress options - }, - mangle: { - // mangle options - - properties: { - // mangle property options - } - }, - format: { - // format options (can also use `output` for backwards compatibility) - }, - sourceMap: { - // source map options - }, - ecma: 5, // specify one of: 5, 2015, 2016, etc. - enclose: false, // or specify true, or "args:values" - keep_classnames: false, - keep_fnames: false, - ie8: false, - module: false, - nameCache: null, // or specify a name cache object - safari10: false, - toplevel: false -} -``` - -### Source map options - -To generate a source map: -```javascript -var result = await minify({"file1.js": "var a = function() {};"}, { - sourceMap: { - filename: "out.js", - url: "out.js.map" - } -}); -console.log(result.code); // minified output -console.log(result.map); // source map -``` - -Note that the source map is not saved in a file, it's just returned in -`result.map`. The value passed for `sourceMap.url` is only used to set -`//# sourceMappingURL=out.js.map` in `result.code`. The value of -`filename` is only used to set `file` attribute (see [the spec][sm-spec]) -in source map file. - -You can set option `sourceMap.url` to be `"inline"` and source map will -be appended to code. - -You can also specify sourceRoot property to be included in source map: -```javascript -var result = await minify({"file1.js": "var a = function() {};"}, { - sourceMap: { - root: "http://example.com/src", - url: "out.js.map" - } -}); -``` - -If you're compressing compiled JavaScript and have a source map for it, you -can use `sourceMap.content`: -```javascript -var result = await minify({"compiled.js": "compiled code"}, { - sourceMap: { - content: "content from compiled.js.map", - url: "minified.js.map" - } -}); -// same as before, it returns `code` and `map` -``` - -If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.url`. - -If you happen to need the source map as a raw object, set `sourceMap.asObject` to `true`. - - - - - -## Parse options - -- `bare_returns` (default `false`) -- support top level `return` statements - -- `html5_comments` (default `true`) - -- `shebang` (default `true`) -- support `#!command` as the first line - -- `spidermonkey` (default `false`) -- accept a Spidermonkey (Mozilla) AST - -## Compress options - -- `defaults` (default: `true`) -- Pass `false` to disable most default - enabled `compress` transforms. Useful when you only want to enable a few - `compress` options while disabling the rest. - -- `arrows` (default: `true`) -- Class and object literal methods are converted - will also be converted to arrow expressions if the resultant code is shorter: - `m(){return x}` becomes `m:()=>x`. To do this to regular ES5 functions which - don't use `this` or `arguments`, see `unsafe_arrows`. - -- `arguments` (default: `false`) -- replace `arguments[index]` with function - parameter name whenever possible. - -- `booleans` (default: `true`) -- various optimizations for boolean context, - for example `!!a ? b : c → a ? b : c` - -- `booleans_as_integers` (default: `false`) -- Turn booleans into 0 and 1, also - makes comparisons with booleans use `==` and `!=` instead of `===` and `!==`. - -- `collapse_vars` (default: `true`) -- Collapse single-use non-constant variables, - side effects permitting. - -- `comparisons` (default: `true`) -- apply certain optimizations to binary nodes, - e.g. `!(a <= b) → a > b` (only when `unsafe_comps`), attempts to negate binary - nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc. Note: `comparisons` - works best with `lhs_constants` enabled. - -- `computed_props` (default: `true`) -- Transforms constant computed properties - into regular ones: `{["computed"]: 1}` is converted to `{computed: 1}`. - -- `conditionals` (default: `true`) -- apply optimizations for `if`-s and conditional - expressions - -- `dead_code` (default: `true`) -- remove unreachable code - -- `directives` (default: `true`) -- remove redundant or non-standard directives - -- `drop_console` (default: `false`) -- Pass `true` to discard calls to - `console.*` functions. If you only want to discard a portion of console, - you can pass an array like this `['log', 'info']`, which will only discard `console.log`、 `console.info`. - -- `drop_debugger` (default: `true`) -- remove `debugger;` statements - -- `ecma` (default: `5`) -- Pass `2015` or greater to enable `compress` options that - will transform ES5 code into smaller ES6+ equivalent forms. - -- `evaluate` (default: `true`) -- attempt to evaluate constant expressions - -- `expression` (default: `false`) -- Pass `true` to preserve completion values - from terminal statements without `return`, e.g. in bookmarklets. - -- `global_defs` (default: `{}`) -- see [conditional compilation](#conditional-compilation) - -- `hoist_funs` (default: `false`) -- hoist function declarations - -- `hoist_props` (default: `true`) -- hoist properties from constant object and - array literals into regular variables subject to a set of constraints. For example: - `var o={p:1, q:2}; f(o.p, o.q);` is converted to `f(1, 2);`. Note: `hoist_props` - works best with `mangle` enabled, the `compress` option `passes` set to `2` or higher, - and the `compress` option `toplevel` enabled. - -- `hoist_vars` (default: `false`) -- hoist `var` declarations (this is `false` - by default because it seems to increase the size of the output in general) - -- `if_return` (default: `true`) -- optimizations for if/return and if/continue - -- `inline` (default: `true`) -- inline calls to function with simple/`return` statement: - - `false` -- same as `0` - - `0` -- disabled inlining - - `1` -- inline simple functions - - `2` -- inline functions with arguments - - `3` -- inline functions with arguments and variables - - `true` -- same as `3` - -- `join_vars` (default: `true`) -- join consecutive `var`, `let` and `const` statements - -- `keep_classnames` (default: `false`) -- Pass `true` to prevent the compressor from - discarding class names. Pass a regular expression to only keep class names matching - that regex. See also: the `keep_classnames` [mangle option](#mangle-options). - -- `keep_fargs` (default: `true`) -- Prevents the compressor from discarding unused - function arguments. You need this for code which relies on `Function.length`. - -- `keep_fnames` (default: `false`) -- Pass `true` to prevent the - compressor from discarding function names. Pass a regular expression to only keep - function names matching that regex. Useful for code relying on `Function.prototype.name`. - See also: the `keep_fnames` [mangle option](#mangle-options). - -- `keep_infinity` (default: `false`) -- Pass `true` to prevent `Infinity` from - being compressed into `1/0`, which may cause performance issues on Chrome. - -- `lhs_constants` (default: `true`) -- Moves constant values to the left-hand side - of binary nodes. `foo == 42 → 42 == foo` - -- `loops` (default: `true`) -- optimizations for `do`, `while` and `for` loops - when we can statically determine the condition. - -- `module` (default `false`) -- Pass `true` when compressing an ES6 module. Strict - mode is implied and the `toplevel` option as well. - -- `negate_iife` (default: `true`) -- negate "Immediately-Called Function Expressions" - where the return value is discarded, to avoid the parens that the - code generator would insert. - -- `passes` (default: `1`) -- The maximum number of times to run compress. - In some cases more than one pass leads to further compressed code. Keep in - mind more passes will take more time. - -- `properties` (default: `true`) -- rewrite property access using the dot notation, for - example `foo["bar"] → foo.bar` - -- `pure_funcs` (default: `null`) -- You can pass an array of names and - Terser will assume that those functions do not produce side - effects. DANGER: will not check if the name is redefined in scope. - An example case here, for instance `var q = Math.floor(a/b)`. If - variable `q` is not used elsewhere, Terser will drop it, but will - still keep the `Math.floor(a/b)`, not knowing what it does. You can - pass `pure_funcs: [ 'Math.floor' ]` to let it know that this - function won't produce any side effect, in which case the whole - statement would get discarded. The current implementation adds some - overhead (compression will be slower). - -- `pure_getters` (default: `"strict"`) -- If you pass `true` for - this, Terser will assume that object property access - (e.g. `foo.bar` or `foo["bar"]`) doesn't have any side effects. - Specify `"strict"` to treat `foo.bar` as side-effect-free only when - `foo` is certain to not throw, i.e. not `null` or `undefined`. - -- `pure_new` (default: `false`) -- Set to `true` to assume `new X()` never has - side effects. - -- `reduce_vars` (default: `true`) -- Improve optimization on variables assigned with and - used as constant values. - -- `reduce_funcs` (default: `true`) -- Inline single-use functions when - possible. Depends on `reduce_vars` being enabled. Disabling this option - sometimes improves performance of the output code. - -- `sequences` (default: `true`) -- join consecutive simple statements using the - comma operator. May be set to a positive integer to specify the maximum number - of consecutive comma sequences that will be generated. If this option is set to - `true` then the default `sequences` limit is `200`. Set option to `false` or `0` - to disable. The smallest `sequences` length is `2`. A `sequences` value of `1` - is grandfathered to be equivalent to `true` and as such means `200`. On rare - occasions the default sequences limit leads to very slow compress times in which - case a value of `20` or less is recommended. - -- `side_effects` (default: `true`) -- Remove expressions which have no side effects - and whose results aren't used. - -- `switches` (default: `true`) -- de-duplicate and remove unreachable `switch` branches - -- `toplevel` (default: `false`) -- drop unreferenced functions (`"funcs"`) and/or - variables (`"vars"`) in the top level scope (`false` by default, `true` to drop - both unreferenced functions and variables) - -- `top_retain` (default: `null`) -- prevent specific toplevel functions and - variables from `unused` removal (can be array, comma-separated, RegExp or - function. Implies `toplevel`) - -- `typeofs` (default: `true`) -- Transforms `typeof foo == "undefined"` into - `foo === void 0`. Note: recommend to set this value to `false` for IE10 and - earlier versions due to known issues. - -- `unsafe` (default: `false`) -- apply "unsafe" transformations - ([details](#the-unsafe-compress-option)). - -- `unsafe_arrows` (default: `false`) -- Convert ES5 style anonymous function - expressions to arrow functions if the function body does not reference `this`. - Note: it is not always safe to perform this conversion if code relies on the - the function having a `prototype`, which arrow functions lack. - This transform requires that the `ecma` compress option is set to `2015` or greater. - -- `unsafe_comps` (default: `false`) -- Reverse `<` and `<=` to `>` and `>=` to - allow improved compression. This might be unsafe when an at least one of two - operands is an object with computed values due the use of methods like `get`, - or `valueOf`. This could cause change in execution order after operands in the - comparison are switching. Compression only works if both `comparisons` and - `unsafe_comps` are both set to true. - -- `unsafe_Function` (default: `false`) -- compress and mangle `Function(args, code)` - when both `args` and `code` are string literals. - -- `unsafe_math` (default: `false`) -- optimize numerical expressions like - `2 * x * 3` into `6 * x`, which may give imprecise floating point results. - -- `unsafe_symbols` (default: `false`) -- removes keys from native Symbol - declarations, e.g `Symbol("kDog")` becomes `Symbol()`. - -- `unsafe_methods` (default: false) -- Converts `{ m: function(){} }` to - `{ m(){} }`. `ecma` must be set to `6` or greater to enable this transform. - If `unsafe_methods` is a RegExp then key/value pairs with keys matching the - RegExp will be converted to concise methods. - Note: if enabled there is a risk of getting a "`` is not a - constructor" TypeError should any code try to `new` the former function. - -- `unsafe_proto` (default: `false`) -- optimize expressions like - `Array.prototype.slice.call(a)` into `[].slice.call(a)` - -- `unsafe_regexp` (default: `false`) -- enable substitutions of variables with - `RegExp` values the same way as if they are constants. - -- `unsafe_undefined` (default: `false`) -- substitute `void 0` if there is a - variable named `undefined` in scope (variable name will be mangled, typically - reduced to a single character) - -- `unused` (default: `true`) -- drop unreferenced functions and variables (simple - direct variable assignments do not count as references unless set to `"keep_assign"`) - -## Mangle options - -- `eval` (default `false`) -- Pass `true` to mangle names visible in scopes - where `eval` or `with` are used. - -- `keep_classnames` (default `false`) -- Pass `true` to not mangle class names. - Pass a regular expression to only keep class names matching that regex. - See also: the `keep_classnames` [compress option](#compress-options). - -- `keep_fnames` (default `false`) -- Pass `true` to not mangle function names. - Pass a regular expression to only keep function names matching that regex. - Useful for code relying on `Function.prototype.name`. See also: the `keep_fnames` - [compress option](#compress-options). - -- `module` (default `false`) -- Pass `true` an ES6 modules, where the toplevel - scope is not the global scope. Implies `toplevel` and assumes input code is strict mode JS. - -- `nth_identifier` (default: an internal mangler that weights based on character - frequency analysis) -- Pass an object with a `get(n)` function that converts an - ordinal into the nth most favored (usually shortest) identifier. - Optionally also provide `reset()`, `sort()`, and `consider(chars, delta)` to - use character frequency analysis of the source code. - -- `reserved` (default `[]`) -- Pass an array of identifiers that should be - excluded from mangling. Example: `["foo", "bar"]`. - -- `toplevel` (default `false`) -- Pass `true` to mangle names declared in the - top level scope. - -- `safari10` (default `false`) -- Pass `true` to work around the Safari 10 loop - iterator [bug](https://bugs.webkit.org/show_bug.cgi?id=171041) - "Cannot declare a let variable twice". - See also: the `safari10` [format option](#format-options). - -Examples: - -```javascript -// test.js -var globalVar; -function funcName(firstLongName, anotherLongName) { - var myVariable = firstLongName + anotherLongName; -} -``` -```javascript -var code = fs.readFileSync("test.js", "utf8"); - -await minify(code).code; -// 'function funcName(a,n){}var globalVar;' - -await minify(code, { mangle: { reserved: ['firstLongName'] } }).code; -// 'function funcName(firstLongName,a){}var globalVar;' - -await minify(code, { mangle: { toplevel: true } }).code; -// 'function n(n,a){}var a;' -``` - -### Mangle properties options - -- `builtins` (default: `false`) — Use `true` to allow the mangling of builtin - DOM properties. Not recommended to override this setting. - -- `debug` (default: `false`) — Mangle names with the original name still present. - Pass an empty string `""` to enable, or a non-empty string to set the debug suffix. - -- `keep_quoted` (default: `false`) — How quoting properties (`{"prop": ...}` and `obj["prop"]`) controls what gets mangled. - - `"strict"` (recommended) -- `obj.prop` is mangled. - - `false` -- `obj["prop"]` is mangled. - - `true` -- `obj.prop` is mangled unless there is `obj["prop"]` elsewhere in the code. - -- `nth_identifer` (default: an internal mangler that weights based on character - frequency analysis) -- Pass an object with a `get(n)` function that converts an - ordinal into the nth most favored (usually shortest) identifier. - Optionally also provide `reset()`, `sort()`, and `consider(chars, delta)` to - use character frequency analysis of the source code. - -- `regex` (default: `null`) — Pass a [RegExp literal or pattern string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) to only mangle property matching the regular expression. - -- `reserved` (default: `[]`) — Do not mangle property names listed in the - `reserved` array. - -- `undeclared` (default: `false`) - Mangle those names when they are accessed - as properties of known top level variables but their declarations are never - found in input code. May be useful when only minifying parts of a project. - See [#397](https://github.com/terser/terser/issues/397) for more details. - - -## Format options - -These options control the format of Terser's output code. Previously known -as "output options". - -- `ascii_only` (default `false`) -- escape Unicode characters in strings and - regexps (affects directives with non-ascii characters becoming invalid) - -- `beautify` (default `false`) -- (DEPRECATED) whether to beautify the output. - When using the legacy `-b` CLI flag, this is set to true by default. - -- `braces` (default `false`) -- always insert braces in `if`, `for`, - `do`, `while` or `with` statements, even if their body is a single - statement. - -- `comments` (default `"some"`) -- by default it keeps JSDoc-style comments - that contain "@license", "@copyright", "@preserve" or start with `!`, pass `true` - or `"all"` to preserve all comments, `false` to omit comments in the output, - a regular expression string (e.g. `/^!/`) or a function. - -- `ecma` (default `5`) -- set desired EcmaScript standard version for output. - Set `ecma` to `2015` or greater to emit shorthand object properties - i.e.: - `{a}` instead of `{a: a}`. The `ecma` option will only change the output in - direct control of the beautifier. Non-compatible features in your input will - still be output as is. For example: an `ecma` setting of `5` will **not** - convert modern code to ES5. - -- `indent_level` (default `4`) - -- `indent_start` (default `0`) -- prefix all lines by that many spaces - -- `inline_script` (default `true`) -- escape HTML comments and the slash in - occurrences of `` in strings - -- `keep_numbers` (default `false`) -- keep number literals as it was in original code - (disables optimizations like converting `1000000` into `1e6`) - -- `keep_quoted_props` (default `false`) -- when turned on, prevents stripping - quotes from property names in object literals. - -- `max_line_len` (default `false`) -- maximum line length (for minified code) - -- `preamble` (default `null`) -- when passed it must be a string and - it will be prepended to the output literally. The source map will - adjust for this text. Can be used to insert a comment containing - licensing information, for example. - -- `quote_keys` (default `false`) -- pass `true` to quote all keys in literal - objects - -- `quote_style` (default `0`) -- preferred quote style for strings (affects - quoted property names and directives as well): - - `0` -- prefers double quotes, switches to single quotes when there are - more double quotes in the string itself. `0` is best for gzip size. - - `1` -- always use single quotes - - `2` -- always use double quotes - - `3` -- always use the original quotes - -- `preserve_annotations` -- (default `false`) -- Preserve [Terser annotations](#annotations) in the output. - -- `safari10` (default `false`) -- set this option to `true` to work around - the [Safari 10/11 await bug](https://bugs.webkit.org/show_bug.cgi?id=176685). - See also: the `safari10` [mangle option](#mangle-options). - -- `semicolons` (default `true`) -- separate statements with semicolons. If - you pass `false` then whenever possible we will use a newline instead of a - semicolon, leading to more readable output of minified code (size before - gzip could be smaller; size after gzip insignificantly larger). - -- `shebang` (default `true`) -- preserve shebang `#!` in preamble (bash scripts) - -- `spidermonkey` (default `false`) -- produce a Spidermonkey (Mozilla) AST - -- `webkit` (default `false`) -- enable workarounds for WebKit bugs. - PhantomJS users should set this option to `true`. - -- `wrap_iife` (default `false`) -- pass `true` to wrap immediately invoked - function expressions. See - [#640](https://github.com/mishoo/UglifyJS2/issues/640) for more details. - -- `wrap_func_args` (default `true`) -- pass `false` if you do not want to wrap - function expressions that are passed as arguments, in parenthesis. See - [OptimizeJS](https://github.com/nolanlawson/optimize-js) for more details. - - - - - -# Miscellaneous - - - -### Keeping copyright notices or other comments - -You can pass `--comments` to retain certain comments in the output. By -default it will keep comments starting with "!" and JSDoc-style comments that -contain "@preserve", "@copyright", "@license" or "@cc_on" (conditional compilation for IE). -You can pass `--comments all` to keep all the comments, or a valid JavaScript regexp to -keep only comments that match this regexp. For example `--comments /^!/` -will keep comments like `/*! Copyright Notice */`. - -Note, however, that there might be situations where comments are lost. For -example: -```javascript -function f() { - /** @preserve Foo Bar */ - function g() { - // this function is never called - } - return something(); -} -``` - -Even though it has "@preserve", the comment will be lost because the inner -function `g` (which is the AST node to which the comment is attached to) is -discarded by the compressor as not referenced. - -The safest comments where to place copyright information (or other info that -needs to be kept in the output) are comments attached to toplevel nodes. - -### The `unsafe` `compress` option - -It enables some transformations that *might* break code logic in certain -contrived cases, but should be fine for most code. It assumes that standard -built-in ECMAScript functions and classes have not been altered or replaced. -You might want to try it on your own code; it should reduce the minified size. -Some examples of the optimizations made when this option is enabled: - -- `new Array(1, 2, 3)` or `Array(1, 2, 3)` → `[ 1, 2, 3 ]` -- `Array.from([1, 2, 3])` → `[1, 2, 3]` -- `new Object()` → `{}` -- `String(exp)` or `exp.toString()` → `"" + exp` -- `new Object/RegExp/Function/Error/Array (...)` → we discard the `new` -- `"foo bar".substr(4)` → `"bar"` - -### Conditional compilation - -You can use the `--define` (`-d`) switch in order to declare global -variables that Terser will assume to be constants (unless defined in -scope). For example if you pass `--define DEBUG=false` then, coupled with -dead code removal Terser will discard the following from the output: -```javascript -if (DEBUG) { - console.log("debug stuff"); -} -``` - -You can specify nested constants in the form of `--define env.DEBUG=false`. - -Another way of doing that is to declare your globals as constants in a -separate file and include it into the build. For example you can have a -`build/defines.js` file with the following: -```javascript -var DEBUG = false; -var PRODUCTION = true; -// etc. -``` - -and build your code like this: - - terser build/defines.js js/foo.js js/bar.js... -c - -Terser will notice the constants and, since they cannot be altered, it -will evaluate references to them to the value itself and drop unreachable -code as usual. The build will contain the `const` declarations if you use -them. If you are targeting < ES6 environments which does not support `const`, -using `var` with `reduce_vars` (enabled by default) should suffice. - -### Conditional compilation API - -You can also use conditional compilation via the programmatic API. With the difference that the -property name is `global_defs` and is a compressor property: - -```javascript -var result = await minify(fs.readFileSync("input.js", "utf8"), { - compress: { - dead_code: true, - global_defs: { - DEBUG: false - } - } -}); -``` - -To replace an identifier with an arbitrary non-constant expression it is -necessary to prefix the `global_defs` key with `"@"` to instruct Terser -to parse the value as an expression: -```javascript -await minify("alert('hello');", { - compress: { - global_defs: { - "@alert": "console.log" - } - } -}).code; -// returns: 'console.log("hello");' -``` - -Otherwise it would be replaced as string literal: -```javascript -await minify("alert('hello');", { - compress: { - global_defs: { - "alert": "console.log" - } - } -}).code; -// returns: '"console.log"("hello");' -``` - -### Annotations - -Annotations in Terser are a way to tell it to treat a certain function call differently. The following annotations are available: - - * `/*@__INLINE__*/` - forces a function to be inlined somewhere. - * `/*@__NOINLINE__*/` - Makes sure the called function is not inlined into the call site. - * `/*@__PURE__*/` - Marks a function call as pure. That means, it can safely be dropped. - * `/*@__KEY__*/` - Marks a string literal as a property to also mangle it when mangling properties. - * `/*@__MANGLE_PROP__*/` - Opts-in an object property (or class field) for mangling, when the property mangler is enabled. - -You can use either a `@` sign at the start, or a `#`. - -Here are some examples on how to use them: - -```javascript -/*@__INLINE__*/ -function_always_inlined_here() - -/*#__NOINLINE__*/ -function_cant_be_inlined_into_here() - -const x = /*#__PURE__*/i_am_dropped_if_x_is_not_used() - -function lookup(object, key) { return object[key]; } -lookup({ i_will_be_mangled_too: "bar" }, /*@__KEY__*/ "i_will_be_mangled_too"); -``` - -### ESTree / SpiderMonkey AST - -Terser has its own abstract syntax tree format; for -[practical reasons](http://lisperator.net/blog/uglifyjs-why-not-switching-to-spidermonkey-ast/) -we can't easily change to using the SpiderMonkey AST internally. However, -Terser now has a converter which can import a SpiderMonkey AST. - -For example [Acorn][acorn] is a super-fast parser that produces a -SpiderMonkey AST. It has a small CLI utility that parses one file and dumps -the AST in JSON on the standard output. To use Terser to mangle and -compress that: - - acorn file.js | terser -p spidermonkey -m -c - -The `-p spidermonkey` option tells Terser that all input files are not -JavaScript, but JS code described in SpiderMonkey AST in JSON. Therefore we -don't use our own parser in this case, but just transform that AST into our -internal AST. - -`spidermonkey` is also available in `minify` as `parse` and `format` options to -accept and/or produce a spidermonkey AST. - -### Use Acorn for parsing - -More for fun, I added the `-p acorn` option which will use Acorn to do all -the parsing. If you pass this option, Terser will `require("acorn")`. - -Acorn is really fast (e.g. 250ms instead of 380ms on some 650K code), but -converting the SpiderMonkey tree that Acorn produces takes another 150ms so -in total it's a bit more than just using Terser's own parser. - -[acorn]: https://github.com/ternjs/acorn -[sm-spec]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k - -### Terser Fast Minify Mode - -It's not well known, but whitespace removal and symbol mangling accounts -for 95% of the size reduction in minified code for most JavaScript - not -elaborate code transforms. One can simply disable `compress` to speed up -Terser builds by 3 to 4 times. - -| d3.js | size | gzip size | time (s) | -| --- | ---: | ---: | ---: | -| original | 451,131 | 108,733 | - | -| terser@3.7.5 mangle=false, compress=false | 316,600 | 85,245 | 0.82 | -| terser@3.7.5 mangle=true, compress=false | 220,216 | 72,730 | 1.45 | -| terser@3.7.5 mangle=true, compress=true | 212,046 | 70,954 | 5.87 | -| babili@0.1.4 | 210,713 | 72,140 | 12.64 | -| babel-minify@0.4.3 | 210,321 | 72,242 | 48.67 | -| babel-minify@0.5.0-alpha.01eac1c3 | 210,421 | 72,238 | 14.17 | - -To enable fast minify mode from the CLI use: -``` -terser file.js -m -``` -To enable fast minify mode with the API use: -```js -await minify(code, { compress: false, mangle: true }); -``` - -#### Source maps and debugging - -Various `compress` transforms that simplify, rearrange, inline and remove code -are known to have an adverse effect on debugging with source maps. This is -expected as code is optimized and mappings are often simply not possible as -some code no longer exists. For highest fidelity in source map debugging -disable the `compress` option and just use `mangle`. - -When debugging, make sure you enable the **"map scopes"** feature to map mangled variable names back to their original names. -Without this, all variable values will be `undefined`. See https://github.com/terser/terser/issues/1367 for more details. -

- -![image](https://user-images.githubusercontent.com/27283110/230441652-ac5cf6b0-5dc5-4ffc-9d8b-bd02875484f4.png) - -### Compiler assumptions - -To allow for better optimizations, the compiler makes various assumptions: - -- `.toString()` and `.valueOf()` don't have side effects, and for built-in - objects they have not been overridden. -- `undefined`, `NaN` and `Infinity` have not been externally redefined. -- `arguments.callee`, `arguments.caller` and `Function.prototype.caller` are not used. -- The code doesn't expect the contents of `Function.prototype.toString()` or - `Error.prototype.stack` to be anything in particular. -- Getting and setting properties on a plain object does not cause other side effects - (using `.watch()` or `Proxy`). -- Object properties can be added, removed and modified (not prevented with - `Object.defineProperty()`, `Object.defineProperties()`, `Object.freeze()`, - `Object.preventExtensions()` or `Object.seal()`). -- `document.all` is not `== null` -- Assigning properties to a class doesn't have side effects and does not throw. - -### Build Tools and Adaptors using Terser - -https://www.npmjs.com/browse/depended/terser - -### Replacing `uglify-es` with `terser` in a project using `yarn` - -A number of JS bundlers and uglify wrappers are still using buggy versions -of `uglify-es` and have not yet upgraded to `terser`. If you are using `yarn` -you can add the following alias to your project's `package.json` file: - -```js - "resolutions": { - "uglify-es": "npm:terser" - } -``` - -to use `terser` instead of `uglify-es` in all deeply nested dependencies -without changing any code. - -Note: for this change to take effect you must run the following commands -to remove the existing `yarn` lock file and reinstall all packages: - -``` -$ rm -rf node_modules yarn.lock -$ yarn -``` - - - -# Reporting issues - - - -## A minimal, reproducible example - -You're expected to provide a [minimal reproducible example] of input code that will demonstrate your issue. - -To get to this example, you can remove bits of your code and stop if your issue ceases to reproduce. - -## Obtaining the source code given to Terser - -Because users often don't control the call to `await minify()` or its arguments, Terser provides a `TERSER_DEBUG_DIR` environment variable to make terser output some debug logs. - -These logs will contain the input code and options of each `minify()` call. - -```bash -TERSER_DEBUG_DIR=/tmp/terser-log-dir command-that-uses-terser -ls /tmp/terser-log-dir -terser-debug-123456.log -``` - -If you're not sure how to set an environment variable on your shell (the above example works in bash), you can try using cross-env: - -``` -> npx cross-env TERSER_DEBUG_DIR=/path/to/logs command-that-uses-terser -``` - -## Stack traces - -In the terser CLI we use [source-map-support](https://npmjs.com/source-map-support) to produce good error stacks. In your own app, you're expected to enable source-map-support (read their docs) to have nice stack traces that will help you write good issues. - - - -# README.md Patrons: - -*note*: You can support this project on patreon: [link] **The Terser Patreon is shutting down in favor of opencollective**. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons. - -These are the second-tier patrons. Great thanks for your support! - - * CKEditor ![](https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/15452278/f8548dcf48d740619071e8d614459280/1?token-time=2145916800&token-hash=SIQ54PhIPHv3M7CVz9LxS8_8v4sOw4H304HaXsXj8MM%3D) - * 38elements ![](https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12501844/88e7fc5dd62d45c6a5626533bbd48cfb/1?token-time=2145916800&token-hash=c3AsQ5T0IQWic0zKxFHu-bGGQJkXQFvafvJ4bPerFR4%3D) - -## Contributors - -### Code Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - - -### Financial Contributors - -Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/terser/contribute)] - -#### Individuals - - - -#### Organizations - -Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/terser/contribute)] - - - - - - - - - - - diff --git a/node_modules/terser/bin/package.json b/node_modules/terser/bin/package.json deleted file mode 100644 index d937a6f..0000000 --- a/node_modules/terser/bin/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "bin", - "private": true, - "version": "1.0.0", - "main": "terser", - "type": "commonjs", - "author": "", - "license": "BSD-2-Clause", - "description": "A package to hold the Terser bin bundle as commonjs while keeping the rest of it ESM." -} diff --git a/node_modules/terser/bin/terser b/node_modules/terser/bin/terser deleted file mode 100644 index b0cdc7c..0000000 --- a/node_modules/terser/bin/terser +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node - -"use strict"; - -require("../tools/exit.cjs"); - -try { - require("source-map-support").install(); -} catch (err) {} - -const fs = require("fs"); -const path = require("path"); -const program = require("commander"); - -const packageJson = require("../package.json"); -const { _run_cli: run_cli } = require(".."); - -run_cli({ program, packageJson, fs, path }).catch((error) => { - console.error(error); - process.exitCode = 1; -}); diff --git a/node_modules/terser/bin/uglifyjs b/node_modules/terser/bin/uglifyjs deleted file mode 100644 index f193025..0000000 --- a/node_modules/terser/bin/uglifyjs +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node -// -*- js -*- -/* eslint-env node */ - -"use strict"; - -process.stderr.write( "DEPRECATION WARNING: uglifyjs binary will soon be discontinued!\n"); -process.stderr.write("Please use \"terser\" instead.\n\n"); - -require("./terser"); diff --git a/node_modules/terser/dist/.gitkeep b/node_modules/terser/dist/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/terser/dist/bundle.min.js b/node_modules/terser/dist/bundle.min.js deleted file mode 100644 index 9f98bb3..0000000 --- a/node_modules/terser/dist/bundle.min.js +++ /dev/null @@ -1,31368 +0,0 @@ -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/source-map')) : -typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/source-map'], factory) : -(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Terser = {}, global.sourceMap)); -})(this, (function (exports, sourceMap) { 'use strict'; - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -function characters(str) { - return str.split(""); -} - -function member(name, array) { - return array.includes(name); -} - -class DefaultsError extends Error { - constructor(msg, defs) { - super(); - - this.name = "DefaultsError"; - this.message = msg; - this.defs = defs; - } -} - -function defaults(args, defs, croak) { - if (args === true) { - args = {}; - } else if (args != null && typeof args === "object") { - args = {...args}; - } - - const ret = args || {}; - - if (croak) for (const i in ret) if (HOP(ret, i) && !HOP(defs, i)) { - throw new DefaultsError("`" + i + "` is not a supported option", defs); - } - - for (const i in defs) if (HOP(defs, i)) { - if (!args || !HOP(args, i)) { - ret[i] = defs[i]; - } else if (i === "ecma") { - let ecma = args[i] | 0; - if (ecma > 5 && ecma < 2015) ecma += 2009; - ret[i] = ecma; - } else { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - } - - return ret; -} - -function noop() {} -function return_false() { return false; } -function return_true() { return true; } -function return_this() { return this; } -function return_null() { return null; } - -var MAP = (function() { - function MAP(a, tw, allow_splicing = true) { - const new_a = []; - - for (let i = 0; i < a.length; ++i) { - let item = a[i]; - let ret = item.transform(tw, allow_splicing); - - if (ret instanceof AST_Node) { - new_a.push(ret); - } else if (ret instanceof Splice) { - new_a.push(...ret.v); - } - } - - return new_a; - } - - MAP.splice = function(val) { return new Splice(val); }; - MAP.skip = {}; - function Splice(val) { this.v = val; } - return MAP; -})(); - -function make_node(ctor, orig, props) { - if (!props) props = {}; - if (orig) { - if (!props.start) props.start = orig.start; - if (!props.end) props.end = orig.end; - } - return new ctor(props); -} - -function push_uniq(array, el) { - if (!array.includes(el)) - array.push(el); -} - -function string_template(text, props) { - return text.replace(/{(.+?)}/g, function(str, p) { - return props && props[p]; - }); -} - -function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } -} - -function mergeSort(array, cmp) { - if (array.length < 2) return array.slice(); - function merge(a, b) { - var r = [], ai = 0, bi = 0, i = 0; - while (ai < a.length && bi < b.length) { - cmp(a[ai], b[bi]) <= 0 - ? r[i++] = a[ai++] - : r[i++] = b[bi++]; - } - if (ai < a.length) r.push.apply(r, a.slice(ai)); - if (bi < b.length) r.push.apply(r, b.slice(bi)); - return r; - } - function _ms(a) { - if (a.length <= 1) - return a; - var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); - left = _ms(left); - right = _ms(right); - return merge(left, right); - } - return _ms(array); -} - -function makePredicate(words) { - if (!Array.isArray(words)) words = words.split(" "); - - return new Set(words.sort()); -} - -function map_add(map, key, value) { - if (map.has(key)) { - map.get(key).push(value); - } else { - map.set(key, [ value ]); - } -} - -function map_from_object(obj) { - var map = new Map(); - for (var key in obj) { - if (HOP(obj, key) && key.charAt(0) === "$") { - map.set(key.substr(1), obj[key]); - } - } - return map; -} - -function map_to_object(map) { - var obj = Object.create(null); - map.forEach(function (value, key) { - obj["$" + key] = value; - }); - return obj; -} - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -function keep_name(keep_setting, name) { - return keep_setting === true - || (keep_setting instanceof RegExp && keep_setting.test(name)); -} - -var lineTerminatorEscape = { - "\0": "0", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029", -}; -function regexp_source_fix(source) { - // V8 does not escape line terminators in regexp patterns in node 12 - // We'll also remove literal \0 - return source.replace(/[\0\n\r\u2028\u2029]/g, function (match, offset) { - var escaped = source[offset - 1] == "\\" - && (source[offset - 2] != "\\" - || /(?:^|[^\\])(?:\\{2})*$/.test(source.slice(0, offset - 1))); - return (escaped ? "" : "\\") + lineTerminatorEscape[match]; - }); -} - -// Subset of regexps that is not going to cause regexp based DDOS -// https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS -const re_safe_regexp = /^[\\/|\0\s\w^$.[\]()]*$/; - -/** Check if the regexp is safe for Terser to create without risking a RegExp DOS */ -const regexp_is_safe = (source) => re_safe_regexp.test(source); - -const all_flags = "dgimsuyv"; -function sort_regexp_flags(flags) { - const existing_flags = new Set(flags.split("")); - let out = ""; - for (const flag of all_flags) { - if (existing_flags.has(flag)) { - out += flag; - existing_flags.delete(flag); - } - } - if (existing_flags.size) { - // Flags Terser doesn't know about - existing_flags.forEach(flag => { out += flag; }); - } - return out; -} - -function has_annotation(node, annotation) { - return node._annotations & annotation; -} - -function set_annotation(node, annotation) { - node._annotations |= annotation; -} - -function clear_annotation(node, annotation) { - node._annotations &= ~annotation; -} - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -var LATEST_RAW = ""; // Only used for numbers and template strings -var TEMPLATE_RAWS = new Map(); // Raw template strings - -var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; -var KEYWORDS_ATOM = "false null true"; -var RESERVED_WORDS = "enum import super this " + KEYWORDS_ATOM + " " + KEYWORDS; -var ALL_RESERVED_WORDS = "implements interface package private protected public static " + RESERVED_WORDS; -var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case yield await"; - -KEYWORDS = makePredicate(KEYWORDS); -RESERVED_WORDS = makePredicate(RESERVED_WORDS); -KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); -KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); -ALL_RESERVED_WORDS = makePredicate(ALL_RESERVED_WORDS); - -var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^")); - -var RE_NUM_LITERAL = /[0-9a-f]/i; -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_ES6_OCT_NUMBER = /^0o[0-7]+$/i; -var RE_BIN_NUMBER = /^0b[01]+$/i; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; -var RE_BIG_INT = /^(0[xob])?[0-9a-f]+n$/i; - -var OPERATORS = makePredicate([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "**", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "||=", - "&&=", - "??=", - "/=", - "*=", - "**=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "??", - "||", -]); - -var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\uFEFF")); - -var NEWLINE_CHARS = makePredicate(characters("\n\r\u2028\u2029")); - -var PUNC_AFTER_EXPRESSION = makePredicate(characters(";]),:")); - -var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,;:")); - -var PUNC_CHARS = makePredicate(characters("[]{}(),;:")); - -/* -----[ Tokenizer ]----- */ - -// surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property -var UNICODE = { - ID_Start: /[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - ID_Continue: /(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\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A7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E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\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC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uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/, -}; - -try { - UNICODE = { - // https://262.ecma-international.org/13.0/#prod-IdentifierStartChar - // $, _, ID_Start - ID_Start: new RegExp("[_$\\p{ID_Start}]", "u"), - // https://262.ecma-international.org/13.0/#prod-IdentifierPartChar - // $, zero-width-joiner, zero-width-non-joiner, ID_Continue - ID_Continue: new RegExp("[$\\u200C\\u200D\\p{ID_Continue}]+", "u"), - }; -} catch(e) { - // Could not use modern JS \p{...}. UNICODE is already defined above so let's continue -} - -function get_full_char(str, pos) { - if (is_surrogate_pair_head(str.charCodeAt(pos))) { - if (is_surrogate_pair_tail(str.charCodeAt(pos + 1))) { - return str.charAt(pos) + str.charAt(pos + 1); - } - } else if (is_surrogate_pair_tail(str.charCodeAt(pos))) { - if (is_surrogate_pair_head(str.charCodeAt(pos - 1))) { - return str.charAt(pos - 1) + str.charAt(pos); - } - } - return str.charAt(pos); -} - -function get_full_char_code(str, pos) { - // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates - if (is_surrogate_pair_head(str.charCodeAt(pos))) { - return 0x10000 + (str.charCodeAt(pos) - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00; - } - return str.charCodeAt(pos); -} - -function get_full_char_length(str) { - var surrogates = 0; - - for (var i = 0; i < str.length; i++) { - if (is_surrogate_pair_head(str.charCodeAt(i)) && is_surrogate_pair_tail(str.charCodeAt(i + 1))) { - surrogates++; - i++; - } - } - - return str.length - surrogates; -} - -function from_char_code(code) { - // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js - if (code > 0xFFFF) { - code -= 0x10000; - return (String.fromCharCode((code >> 10) + 0xD800) + - String.fromCharCode((code % 0x400) + 0xDC00)); - } - return String.fromCharCode(code); -} - -function is_surrogate_pair_head(code) { - return code >= 0xd800 && code <= 0xdbff; -} - -function is_surrogate_pair_tail(code) { - return code >= 0xdc00 && code <= 0xdfff; -} - -function is_digit(code) { - return code >= 48 && code <= 57; -} - -function is_identifier_start(ch) { - return UNICODE.ID_Start.test(ch); -} - -function is_identifier_char(ch) { - return UNICODE.ID_Continue.test(ch); -} - -const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i; - -function is_basic_identifier_string(str) { - return BASIC_IDENT.test(str); -} - -function is_identifier_string(str, allow_surrogates) { - if (BASIC_IDENT.test(str)) { - return true; - } - if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) { - return false; - } - var match = UNICODE.ID_Start.exec(str); - if (!match || match.index !== 0) { - return false; - } - - str = str.slice(match[0].length); - if (!str) { - return true; - } - - match = UNICODE.ID_Continue.exec(str); - return !!match && match[0].length === str.length; -} - -function parse_js_number(num, allow_e = true) { - if (!allow_e && num.includes("e")) { - return NaN; - } - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_ES6_OCT_NUMBER.test(num)) { - return parseInt(num.substr(2), 8); - } else if (RE_BIN_NUMBER.test(num)) { - return parseInt(num.substr(2), 2); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } else { - var val = parseFloat(num); - if (val == num) return val; - } -} - -class JS_Parse_Error extends Error { - constructor(message, filename, line, col, pos) { - super(); - - this.name = "SyntaxError"; - this.message = message; - this.filename = filename; - this.line = line; - this.col = col; - this.pos = pos; - } -} - -function js_error(message, filename, line, col, pos) { - throw new JS_Parse_Error(message, filename, line, col, pos); -} - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -} - -var EX_EOF = {}; - -function tokenizer($TEXT, filename, html5_comments, shebang) { - var S = { - text : $TEXT, - filename : filename, - pos : 0, - tokpos : 0, - line : 1, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - brace_counter : 0, - template_braces : [], - comments_before : [], - directives : {}, - directive_stack : [] - }; - - function peek() { return get_full_char(S.text, S.pos); } - - // Used because parsing ?. involves a lookahead for a digit - function is_option_chain_op() { - const must_be_dot = S.text.charCodeAt(S.pos + 1) === 46; - if (!must_be_dot) return false; - - const cannot_be_digit = S.text.charCodeAt(S.pos + 2); - return cannot_be_digit < 48 || cannot_be_digit > 57; - } - - function next(signal_eof, in_string) { - var ch = get_full_char(S.text, S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (NEWLINE_CHARS.has(ch)) { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - if (ch == "\r" && peek() == "\n") { - // treat a \r\n sequence as a single \n - ++S.pos; - ch = "\n"; - } - } else { - if (ch.length > 1) { - ++S.pos; - ++S.col; - } - ++S.col; - } - return ch; - } - - function forward(i) { - while (i--) next(); - } - - function looking_at(str) { - return S.text.substr(S.pos, str.length) == str; - } - - function find_eol() { - var text = S.text; - for (var i = S.pos, n = S.text.length; i < n; ++i) { - var ch = text[i]; - if (NEWLINE_CHARS.has(ch)) - return i; - } - return -1; - } - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - } - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - } - - var prev_was_dot = false; - var previous_token = null; - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX.has(value)) || - (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION.has(value)) || - (type == "punc" && PUNC_BEFORE_EXPRESSION.has(value))) || - (type == "arrow"); - if (type == "punc" && (value == "." || value == "?.")) { - prev_was_dot = true; - } else if (!is_comment) { - prev_was_dot = false; - } - const line = S.tokline; - const col = S.tokcol; - const pos = S.tokpos; - const nlb = S.newline_before; - const file = filename; - let comments_before = []; - let comments_after = []; - - if (!is_comment) { - comments_before = S.comments_before; - comments_after = S.comments_before = []; - } - S.newline_before = false; - const tok = new AST_Token(type, value, line, col, pos, nlb, comments_before, comments_after, file); - - if (!is_comment) previous_token = tok; - return tok; - } - - function skip_whitespace() { - while (WHITESPACE_CHARS.has(peek())) - next(); - } - - function read_while(pred) { - var ret = "", ch, i = 0; - while ((ch = peek()) && pred(ch, i++)) - ret += next(); - return ret; - } - - function parse_error(err) { - js_error(err, filename, S.tokline, S.tokcol, S.tokpos); - } - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".", is_big_int = false, numeric_separator = false; - var num = read_while(function(ch, i) { - if (is_big_int) return false; - - var code = ch.charCodeAt(0); - switch (code) { - case 95: // _ - return (numeric_separator = true); - case 98: case 66: // bB - return (has_x = true); // Can occur in hex sequence, don't return false yet - case 111: case 79: // oO - case 120: case 88: // xX - return has_x ? false : (has_x = true); - case 101: case 69: // eE - return has_x ? true : has_e ? false : (has_e = after_e = true); - case 45: // - - return after_e || (i == 0 && !prefix); - case 43: // + - return after_e; - case (after_e = false, 46): // . - return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false; - } - - if (ch === "n") { - is_big_int = true; - - return true; - } - - return RE_NUM_LITERAL.test(ch); - }); - if (prefix) num = prefix + num; - - LATEST_RAW = num; - - if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { - parse_error("Legacy octal literals are not allowed in strict mode"); - } - if (numeric_separator) { - if (num.endsWith("_")) { - parse_error("Numeric separators are not allowed at the end of numeric literals"); - } else if (num.includes("__")) { - parse_error("Only one underscore is allowed as numeric separator"); - } - num = num.replace(/_/g, ""); - } - if (num.endsWith("n")) { - const without_n = num.slice(0, -1); - const allow_e = RE_HEX_NUMBER.test(without_n); - const valid = parse_js_number(without_n, allow_e); - if (!has_dot && RE_BIG_INT.test(num) && !isNaN(valid)) - return token("big_int", without_n); - parse_error("Invalid or unexpected token"); - } - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - } - - function is_octal(ch) { - return ch >= "0" && ch <= "7"; - } - - function read_escaped_char(in_string, strict_hex, template_string) { - var ch = next(true, in_string); - switch (ch.charCodeAt(0)) { - case 110 : return "\n"; - case 114 : return "\r"; - case 116 : return "\t"; - case 98 : return "\b"; - case 118 : return "\u000b"; // \v - case 102 : return "\f"; - case 120 : return String.fromCharCode(hex_bytes(2, strict_hex)); // \x - case 117 : // \u - if (peek() == "{") { - next(true); - if (peek() === "}") - parse_error("Expecting hex-character between {}"); - while (peek() == "0") next(true); // No significance - var result, length = find("}", true) - S.pos; - // Avoid 32 bit integer overflow (1 << 32 === 1) - // We know first character isn't 0 and thus out of range anyway - if (length > 6 || (result = hex_bytes(length, strict_hex)) > 0x10FFFF) { - parse_error("Unicode reference out of bounds"); - } - next(true); - return from_char_code(result); - } - return String.fromCharCode(hex_bytes(4, strict_hex)); - case 10 : return ""; // newline - case 13 : // \r - if (peek() == "\n") { // DOS newline - next(true, in_string); - return ""; - } - } - if (is_octal(ch)) { - if (template_string && strict_hex) { - const represents_null_character = ch === "0" && !is_octal(peek()); - if (!represents_null_character) { - parse_error("Octal escape sequences are not allowed in template strings"); - } - } - return read_octal_escape_sequence(ch, strict_hex); - } - return ch; - } - - function read_octal_escape_sequence(ch, strict_octal) { - // Read - var p = peek(); - if (p >= "0" && p <= "7") { - ch += next(true); - if (ch[0] <= "3" && (p = peek()) >= "0" && p <= "7") - ch += next(true); - } - - // Parse - if (ch === "0") return "\0"; - if (ch.length > 0 && next_token.has_directive("use strict") && strict_octal) - parse_error("Legacy octal escape sequences are not allowed in strict mode"); - return String.fromCharCode(parseInt(ch, 8)); - } - - function hex_bytes(n, strict_hex) { - var num = 0; - for (; n > 0; --n) { - if (!strict_hex && isNaN(parseInt(peek(), 16))) { - return parseInt(num, 16) || ""; - } - var digit = next(true); - if (isNaN(parseInt(digit, 16))) - parse_error("Invalid hex-character pattern in string"); - num += digit; - } - return parseInt(num, 16); - } - - var read_string = with_eof_error("Unterminated string constant", function() { - const start_pos = S.pos; - var quote = next(), ret = []; - for (;;) { - var ch = next(true, true); - if (ch == "\\") ch = read_escaped_char(true, true); - else if (ch == "\r" || ch == "\n") parse_error("Unterminated string constant"); - else if (ch == quote) break; - ret.push(ch); - } - var tok = token("string", ret.join("")); - LATEST_RAW = S.text.slice(start_pos, S.pos); - tok.quote = quote; - return tok; - }); - - var read_template_characters = with_eof_error("Unterminated template", function(begin) { - if (begin) { - S.template_braces.push(S.brace_counter); - } - var content = "", raw = "", ch, tok; - next(true, true); - while ((ch = next(true, true)) != "`") { - if (ch == "\r") { - if (peek() == "\n") ++S.pos; - ch = "\n"; - } else if (ch == "$" && peek() == "{") { - next(true, true); - S.brace_counter++; - tok = token(begin ? "template_head" : "template_substitution", content); - TEMPLATE_RAWS.set(tok, raw); - tok.template_end = false; - return tok; - } - - raw += ch; - if (ch == "\\") { - var tmp = S.pos; - var prev_is_tag = previous_token && (previous_token.type === "name" || previous_token.type === "punc" && (previous_token.value === ")" || previous_token.value === "]")); - ch = read_escaped_char(true, !prev_is_tag, true); - raw += S.text.substr(tmp, S.pos - tmp); - } - - content += ch; - } - S.template_braces.pop(); - tok = token(begin ? "template_head" : "template_substitution", content); - TEMPLATE_RAWS.set(tok, raw); - tok.template_end = true; - return tok; - }); - - function skip_line_comment(type) { - var regex_allowed = S.regex_allowed; - var i = find_eol(), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - S.col = S.tokcol + (S.pos - S.tokpos); - S.comments_before.push(token(type, ret, true)); - S.regex_allowed = regex_allowed; - return next_token; - } - - var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function() { - var regex_allowed = S.regex_allowed; - var i = find("*/", true); - var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n"); - // update stream position - forward(get_full_char_length(text) /* text length doesn't count \r\n as 2 char while S.pos - i does */ + 2); - S.comments_before.push(token("comment2", text, true)); - S.newline_before = S.newline_before || text.includes("\n"); - S.regex_allowed = regex_allowed; - return next_token; - }); - - var read_name = with_eof_error("Unterminated identifier name", function() { - var name = [], ch, escaped = false; - var read_escaped_identifier_char = function() { - escaped = true; - next(); - if (peek() !== "u") { - parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"); - } - return read_escaped_char(false, true); - }; - - // Read first character (ID_Start) - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_start(ch)) { - parse_error("First identifier char is an invalid identifier char"); - } - } else if (is_identifier_start(ch)) { - next(); - } else { - return ""; - } - - name.push(ch); - - // Read ID_Continue - while ((ch = peek()) != null) { - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_char(ch)) { - parse_error("Invalid escaped identifier char"); - } - } else { - if (!is_identifier_char(ch)) { - break; - } - next(); - } - name.push(ch); - } - const name_str = name.join(""); - if (RESERVED_WORDS.has(name_str) && escaped) { - parse_error("Escaped characters are not allowed in keywords"); - } - return name_str; - }); - - var read_regexp = with_eof_error("Unterminated regular expression", function(source) { - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (NEWLINE_CHARS.has(ch)) { - parse_error("Unexpected line terminator"); - } else if (prev_backslash) { - source += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - source += ch; - } else if (ch == "]" && in_class) { - in_class = false; - source += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - source += ch; - } - const flags = read_name(); - return token("regexp", "/" + source + "/" + flags); - }); - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (OPERATORS.has(bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - } - return token("operator", grow(prefix || next())); - } - - function handle_slash() { - next(); - switch (peek()) { - case "/": - next(); - return skip_line_comment("comment1"); - case "*": - next(); - return skip_multiline_comment(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - } - - function handle_eq_sign() { - next(); - if (peek() === ">") { - next(); - return token("arrow", "=>"); - } else { - return read_operator("="); - } - } - - function handle_dot() { - next(); - if (is_digit(peek().charCodeAt(0))) { - return read_num("."); - } - if (peek() === ".") { - next(); // Consume second dot - next(); // Consume third dot - return token("expand", "..."); - } - - return token("punc", "."); - } - - function read_word() { - var word = read_name(); - if (prev_was_dot) return token("name", word); - return KEYWORDS_ATOM.has(word) ? token("atom", word) - : !KEYWORDS.has(word) ? token("name", word) - : OPERATORS.has(word) ? token("operator", word) - : token("keyword", word); - } - - function read_private_word() { - next(); - return token("privatename", read_name()); - } - - function with_eof_error(eof_error, cont) { - return function(x) { - try { - return cont(x); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - } - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - if (shebang && S.pos == 0 && looking_at("#!")) { - start_token(); - forward(2); - skip_line_comment("comment5"); - } - for (;;) { - skip_whitespace(); - start_token(); - if (html5_comments) { - if (looking_at("") && S.newline_before) { - forward(3); - skip_line_comment("comment4"); - continue; - } - } - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: case 39: return read_string(); - case 46: return handle_dot(); - case 47: { - var tok = handle_slash(); - if (tok === next_token) continue; - return tok; - } - case 61: return handle_eq_sign(); - case 63: { - if (!is_option_chain_op()) break; // Handled below - - next(); // ? - next(); // . - - return token("punc", "?."); - } - case 96: return read_template_characters(true); - case 123: - S.brace_counter++; - break; - case 125: - S.brace_counter--; - if (S.template_braces.length > 0 - && S.template_braces[S.template_braces.length - 1] === S.brace_counter) - return read_template_characters(false); - break; - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS.has(ch)) return token("punc", next()); - if (OPERATOR_CHARS.has(ch)) return read_operator(); - if (code == 92 || is_identifier_start(ch)) return read_word(); - if (code == 35) return read_private_word(); - break; - } - parse_error("Unexpected character '" + ch + "'"); - } - - next_token.next = next; - next_token.peek = peek; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - next_token.add_directive = function(directive) { - S.directive_stack[S.directive_stack.length - 1].push(directive); - - if (S.directives[directive] === undefined) { - S.directives[directive] = 1; - } else { - S.directives[directive]++; - } - }; - - next_token.push_directives_stack = function() { - S.directive_stack.push([]); - }; - - next_token.pop_directives_stack = function() { - var directives = S.directive_stack[S.directive_stack.length - 1]; - - for (var i = 0; i < directives.length; i++) { - S.directives[directives[i]]--; - } - - S.directive_stack.pop(); - }; - - next_token.has_directive = function(directive) { - return S.directives[directive] > 0; - }; - - return next_token; - -} - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = makePredicate([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = makePredicate([ "--", "++" ]); - -var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "??=", "&&=", "||=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var LOGICAL_ASSIGNMENT = makePredicate([ "??=", "&&=", "||=" ]); - -var PRECEDENCE = (function(a, ret) { - for (var i = 0; i < a.length; ++i) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = i + 1; - } - } - return ret; -})( - [ - ["||"], - ["??"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"], - ["**"] - ], - {} -); - -var ATOMIC_START_TOKEN = makePredicate([ "atom", "num", "big_int", "string", "regexp", "name"]); - -/* -----[ Parser ]----- */ - -function parse($TEXT, options) { - // maps start tokens to count of comments found outside of their parens - // Example: /* I count */ ( /* I don't */ foo() ) - // Useful because comments_before property of call with parens outside - // contains both comments inside and outside these parens. Used to find the - - const outer_comments_before_counts = new WeakMap(); - - options = defaults(options, { - bare_returns : false, - ecma : null, // Legacy - expression : false, - filename : null, - html5_comments : true, - module : false, - shebang : true, - strict : false, - toplevel : null, - }, true); - - var S = { - input : (typeof $TEXT == "string" - ? tokenizer($TEXT, options.filename, - options.html5_comments, options.shebang) - : $TEXT), - token : null, - prev : null, - peeked : null, - in_function : 0, - in_async : -1, - in_generator : -1, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - } - - function peek() { return S.peeked || (S.peeked = S.input()); } - - function next() { - S.prev = S.token; - - if (!S.peeked) peek(); - S.token = S.peeked; - S.peeked = null; - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - } - - function prev() { - return S.prev; - } - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - ctx.filename, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - } - - function token_error(token, msg) { - croak(msg, token.line, token.col); - } - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - } - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); - } - - function expect(punc) { return expect_token("punc", punc); } - - function has_newline_before(token) { - return token.nlb || !token.comments_before.every((comment) => !comment.nlb); - } - - function can_insert_semicolon() { - return !options.strict - && (is("eof") || is("punc", "}") || has_newline_before(S.token)); - } - - function is_in_generator() { - return S.in_generator === S.in_function; - } - - function is_in_async() { - return S.in_async === S.in_function; - } - - function can_await() { - return ( - S.in_async === S.in_function - || S.in_function === 0 && S.input.has_directive("use strict") - ); - } - - function semicolon(optional) { - if (is("punc", ";")) next(); - else if (!optional && !can_insert_semicolon()) unexpected(); - } - - function parenthesised() { - expect("("); - var exp = expression(true); - expect(")"); - return exp; - } - - function embed_tokens(parser) { - return function _embed_tokens_wrapper(...args) { - const start = S.token; - const expr = parser(...args); - expr.start = start; - expr.end = prev(); - return expr; - }; - } - - function handle_regexp() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - } - - var statement = embed_tokens(function statement(is_export_default, is_for_body, is_if_body) { - handle_regexp(); - switch (S.token.type) { - case "string": - if (S.in_directives) { - var token = peek(); - if (!LATEST_RAW.includes("\\") - && (is_token(token, "punc", ";") - || is_token(token, "punc", "}") - || has_newline_before(token) - || is_token(token, "eof"))) { - S.input.add_directive(S.token.value); - } else { - S.in_directives = false; - } - } - var dir = S.in_directives, stat = simple_statement(); - return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat; - case "template_head": - case "num": - case "big_int": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - case "privatename": - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - - if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { - next(); - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(AST_Defun, false, true, is_export_default); - } - if (S.token.value == "import" && !is_token(peek(), "punc", "(") && !is_token(peek(), "punc", ".")) { - next(); - var node = import_statement(); - semicolon(); - return node; - } - return is_token(peek(), "punc", ":") - ? labeled_statement() - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new AST_BlockStatement({ - start : S.token, - body : block_(), - end : prev() - }); - case "[": - case "(": - return simple_statement(); - case ";": - S.in_directives = false; - next(); - return new AST_EmptyStatement(); - default: - unexpected(); - } - - case "keyword": - switch (S.token.value) { - case "break": - next(); - return break_cont(AST_Break); - - case "continue": - next(); - return break_cont(AST_Continue); - - case "debugger": - next(); - semicolon(); - return new AST_Debugger(); - - case "do": - next(); - var body = in_loop(statement); - expect_token("keyword", "while"); - var condition = parenthesised(); - semicolon(true); - return new AST_Do({ - body : body, - condition : condition - }); - - case "while": - next(); - return new AST_While({ - condition : parenthesised(), - body : in_loop(function() { return statement(false, true); }) - }); - - case "for": - next(); - return for_(); - - case "class": - next(); - if (is_for_body) { - croak("classes are not allowed as the body of a loop"); - } - if (is_if_body) { - croak("classes are not allowed as the body of an if"); - } - return class_(AST_DefClass, is_export_default); - - case "function": - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(AST_Defun, false, false, is_export_default); - - case "if": - next(); - return if_(); - - case "return": - if (S.in_function == 0 && !options.bare_returns) - croak("'return' outside of function"); - next(); - var value = null; - if (is("punc", ";")) { - next(); - } else if (!can_insert_semicolon()) { - value = expression(true); - semicolon(); - } - return new AST_Return({ - value: value - }); - - case "switch": - next(); - return new AST_Switch({ - expression : parenthesised(), - body : in_loop(switch_body_) - }); - - case "throw": - next(); - if (has_newline_before(S.token)) - croak("Illegal newline after 'throw'"); - var value = expression(true); - semicolon(); - return new AST_Throw({ - value: value - }); - - case "try": - next(); - return try_(); - - case "var": - next(); - var node = var_(); - semicolon(); - return node; - - case "let": - next(); - var node = let_(); - semicolon(); - return node; - - case "const": - next(); - var node = const_(); - semicolon(); - return node; - - case "with": - if (S.input.has_directive("use strict")) { - croak("Strict mode may not include a with statement"); - } - next(); - return new AST_With({ - expression : parenthesised(), - body : statement() - }); - - case "export": - if (!is_token(peek(), "punc", "(")) { - next(); - var node = export_statement(); - if (is("punc", ";")) semicolon(); - return node; - } - } - } - unexpected(); - }); - - function labeled_statement() { - var label = as_symbol(AST_Label); - if (label.name === "await" && is_in_async()) { - token_error(S.prev, "await cannot be used as label inside async function"); - } - if (S.labels.some((l) => l.name === label.name)) { - // ECMA-262, 12.12: An ECMAScript program is considered - // syntactically incorrect if it contains a - // LabelledStatement that is enclosed by a - // LabelledStatement with the same Identifier as label. - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - if (!(stat instanceof AST_IterationStatement)) { - // check for `continue` that refers to this label. - // those should be reported as syntax errors. - // https://github.com/mishoo/UglifyJS2/issues/287 - label.references.forEach(function(ref) { - if (ref instanceof AST_Continue) { - ref = ref.label.start; - croak("Continue label `" + label.name + "` refers to non-IterationStatement.", - ref.line, ref.col, ref.pos); - } - }); - } - return new AST_LabeledStatement({ body: stat, label: label }); - } - - function simple_statement(tmp) { - return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); - } - - function break_cont(type) { - var label = null, ldef; - if (!can_insert_semicolon()) { - label = as_symbol(AST_LabelRef, true); - } - if (label != null) { - ldef = S.labels.find((l) => l.name === label.name); - if (!ldef) - croak("Undefined label " + label.name); - label.thedef = ldef; - } else if (S.in_loop == 0) - croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - var stat = new type({ label: label }); - if (ldef) ldef.references.push(stat); - return stat; - } - - function for_() { - var for_await_error = "`for await` invalid in this context"; - var await_tok = S.token; - if (await_tok.type == "name" && await_tok.value == "await") { - if (!can_await()) { - token_error(await_tok, for_await_error); - } - next(); - } else { - await_tok = false; - } - expect("("); - var init = null; - if (!is("punc", ";")) { - init = - is("keyword", "var") ? (next(), var_(true)) : - is("keyword", "let") ? (next(), let_(true)) : - is("keyword", "const") ? (next(), const_(true)) : - expression(true, true); - var is_in = is("operator", "in"); - var is_of = is("name", "of"); - if (await_tok && !is_of) { - token_error(await_tok, for_await_error); - } - if (is_in || is_of) { - if (init instanceof AST_Definitions) { - if (init.definitions.length > 1) - token_error(init.start, "Only one variable declaration allowed in for..in loop"); - } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) { - token_error(init.start, "Invalid left-hand side in for..in loop"); - } - next(); - if (is_in) { - return for_in(init); - } else { - return for_of(init, !!await_tok); - } - } - } else if (await_tok) { - token_error(await_tok, for_await_error); - } - return regular_for(init); - } - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(true); - expect(";"); - var step = is("punc", ")") ? null : expression(true); - expect(")"); - return new AST_For({ - init : init, - condition : test, - step : step, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_of(init, is_await) { - var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null; - var obj = expression(true); - expect(")"); - return new AST_ForOf({ - await : is_await, - init : init, - name : lhs, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_in(init) { - var obj = expression(true); - expect(")"); - return new AST_ForIn({ - init : init, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - var arrow_function = function(start, argnames, is_async) { - if (has_newline_before(S.token)) { - croak("Unexpected newline before arrow (=>)"); - } - - expect_token("arrow", "=>"); - - var body = _function_body(is("punc", "{"), false, is_async); - - var end = - body instanceof Array && body.length ? body[body.length - 1].end : - body instanceof Array ? start : - body.end; - - return new AST_Arrow({ - start : start, - end : end, - async : is_async, - argnames : argnames, - body : body - }); - }; - - var function_ = function(ctor, is_generator_property, is_async, is_export_default) { - var in_statement = ctor === AST_Defun; - var is_generator = is("operator", "*"); - if (is_generator) { - next(); - } - - var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null; - if (in_statement && !name) { - if (is_export_default) { - ctor = AST_Function; - } else { - unexpected(); - } - } - - if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) - unexpected(prev()); - - var args = []; - var body = _function_body(true, is_generator || is_generator_property, is_async, name, args); - return new ctor({ - start : args.start, - end : body.end, - is_generator: is_generator, - async : is_async, - name : name, - argnames: args, - body : body - }); - }; - - class UsedParametersTracker { - constructor(is_parameter, strict, duplicates_ok = false) { - this.is_parameter = is_parameter; - this.duplicates_ok = duplicates_ok; - this.parameters = new Set(); - this.duplicate = null; - this.default_assignment = false; - this.spread = false; - this.strict_mode = !!strict; - } - add_parameter(token) { - if (this.parameters.has(token.value)) { - if (this.duplicate === null) { - this.duplicate = token; - } - this.check_strict(); - } else { - this.parameters.add(token.value); - if (this.is_parameter) { - switch (token.value) { - case "arguments": - case "eval": - case "yield": - if (this.strict_mode) { - token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); - } - break; - default: - if (RESERVED_WORDS.has(token.value)) { - unexpected(); - } - } - } - } - } - mark_default_assignment(token) { - if (this.default_assignment === false) { - this.default_assignment = token; - } - } - mark_spread(token) { - if (this.spread === false) { - this.spread = token; - } - } - mark_strict_mode() { - this.strict_mode = true; - } - is_strict() { - return this.default_assignment !== false || this.spread !== false || this.strict_mode; - } - check_strict() { - if (this.is_strict() && this.duplicate !== null && !this.duplicates_ok) { - token_error(this.duplicate, "Parameter " + this.duplicate.value + " was used already"); - } - } - } - - function parameters(params) { - var used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); - - expect("("); - - while (!is("punc", ")")) { - var param = parameter(used_parameters); - params.push(param); - - if (!is("punc", ")")) { - expect(","); - } - - if (param instanceof AST_Expansion) { - break; - } - } - - next(); - } - - function parameter(used_parameters, symbol_type) { - var param; - var expand = false; - if (used_parameters === undefined) { - used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); - } - if (is("expand", "...")) { - expand = S.token; - used_parameters.mark_spread(S.token); - next(); - } - param = binding_element(used_parameters, symbol_type); - - if (is("operator", "=") && expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - param = new AST_DefaultAssign({ - start: param.start, - left: param, - operator: "=", - right: expression(false), - end: S.token - }); - } - - if (expand !== false) { - if (!is("punc", ")")) { - unexpected(); - } - param = new AST_Expansion({ - start: expand, - expression: param, - end: expand - }); - } - used_parameters.check_strict(); - - return param; - } - - function binding_element(used_parameters, symbol_type) { - var elements = []; - var first = true; - var is_expand = false; - var expand_token; - var first_token = S.token; - if (used_parameters === undefined) { - const strict = S.input.has_directive("use strict"); - const duplicates_ok = symbol_type === AST_SymbolVar; - used_parameters = new UsedParametersTracker(false, strict, duplicates_ok); - } - symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type; - if (is("punc", "[")) { - next(); - while (!is("punc", "]")) { - if (first) { - first = false; - } else { - expect(","); - } - - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("punc")) { - switch (S.token.value) { - case ",": - elements.push(new AST_Hole({ - start: S.token, - end: S.token - })); - continue; - case "]": // Trailing comma after last element - break; - case "[": - case "{": - elements.push(binding_element(used_parameters, symbol_type)); - break; - default: - unexpected(); - } - } else if (is("name")) { - used_parameters.add_parameter(S.token); - elements.push(as_symbol(symbol_type)); - } else { - croak("Invalid function parameter"); - } - if (is("operator", "=") && is_expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1] = new AST_DefaultAssign({ - start: elements[elements.length - 1].start, - left: elements[elements.length - 1], - operator: "=", - right: expression(false), - end: S.token - }); - } - if (is_expand) { - if (!is("punc", "]")) { - croak("Rest element must be last element"); - } - elements[elements.length - 1] = new AST_Expansion({ - start: expand_token, - expression: elements[elements.length - 1], - end: expand_token - }); - } - } - expect("]"); - used_parameters.check_strict(); - return new AST_Destructuring({ - start: first_token, - names: elements, - is_array: true, - end: prev() - }); - } else if (is("punc", "{")) { - next(); - while (!is("punc", "}")) { - if (first) { - first = false; - } else { - expect(","); - } - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].includes(peek().value)) { - used_parameters.add_parameter(S.token); - var start = prev(); - var value = as_symbol(symbol_type); - if (is_expand) { - elements.push(new AST_Expansion({ - start: expand_token, - expression: value, - end: value.end, - })); - } else { - elements.push(new AST_ObjectKeyVal({ - start: start, - key: value.name, - value: value, - end: value.end, - })); - } - } else if (is("punc", "}")) { - continue; // Allow trailing hole - } else { - var property_token = S.token; - var property = as_property_name(); - if (property === null) { - unexpected(prev()); - } else if (prev().type === "name" && !is("punc", ":")) { - elements.push(new AST_ObjectKeyVal({ - start: prev(), - key: property, - value: new symbol_type({ - start: prev(), - name: property, - end: prev() - }), - end: prev() - })); - } else { - expect(":"); - elements.push(new AST_ObjectKeyVal({ - start: property_token, - quote: property_token.quote, - key: property, - value: binding_element(used_parameters, symbol_type), - end: prev() - })); - } - } - if (is_expand) { - if (!is("punc", "}")) { - croak("Rest element must be last element"); - } - } else if (is("operator", "=")) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1].value = new AST_DefaultAssign({ - start: elements[elements.length - 1].value.start, - left: elements[elements.length - 1].value, - operator: "=", - right: expression(false), - end: S.token - }); - } - } - expect("}"); - used_parameters.check_strict(); - return new AST_Destructuring({ - start: first_token, - names: elements, - is_array: false, - end: prev() - }); - } else if (is("name")) { - used_parameters.add_parameter(S.token); - return as_symbol(symbol_type); - } else { - croak("Invalid function parameter"); - } - } - - function params_or_seq_(allow_arrows, maybe_sequence) { - var spread_token; - var invalid_sequence; - var trailing_comma; - var a = []; - expect("("); - while (!is("punc", ")")) { - if (spread_token) unexpected(spread_token); - if (is("expand", "...")) { - spread_token = S.token; - if (maybe_sequence) invalid_sequence = S.token; - next(); - a.push(new AST_Expansion({ - start: prev(), - expression: expression(), - end: S.token, - })); - } else { - a.push(expression()); - } - if (!is("punc", ")")) { - expect(","); - if (is("punc", ")")) { - trailing_comma = prev(); - if (maybe_sequence) invalid_sequence = trailing_comma; - } - } - } - expect(")"); - if (allow_arrows && is("arrow", "=>")) { - if (spread_token && trailing_comma) unexpected(trailing_comma); - } else if (invalid_sequence) { - unexpected(invalid_sequence); - } - return a; - } - - function _function_body(block, generator, is_async, name, args) { - var loop = S.in_loop; - var labels = S.labels; - var current_generator = S.in_generator; - var current_async = S.in_async; - ++S.in_function; - if (generator) - S.in_generator = S.in_function; - if (is_async) - S.in_async = S.in_function; - if (args) parameters(args); - if (block) - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - if (block) { - S.input.push_directives_stack(); - var a = block_(); - if (name) _verify_symbol(name); - if (args) args.forEach(_verify_symbol); - S.input.pop_directives_stack(); - } else { - var a = [new AST_Return({ - start: S.token, - value: expression(false), - end: S.token - })]; - } - --S.in_function; - S.in_loop = loop; - S.labels = labels; - S.in_generator = current_generator; - S.in_async = current_async; - return a; - } - - function _await_expression() { - // Previous token must be "await" and not be interpreted as an identifier - if (!can_await()) { - croak("Unexpected await expression outside async function", - S.prev.line, S.prev.col, S.prev.pos); - } - // the await expression is parsed as a unary expression in Babel - return new AST_Await({ - start: prev(), - end: S.token, - expression : maybe_unary(true), - }); - } - - function _yield_expression() { - // Previous token must be keyword yield and not be interpret as an identifier - if (!is_in_generator()) { - croak("Unexpected yield expression outside generator function", - S.prev.line, S.prev.col, S.prev.pos); - } - var start = S.token; - var star = false; - var has_expression = true; - - // Attempt to get expression or star (and then the mandatory expression) - // behind yield on the same line. - // - // If nothing follows on the same line of the yieldExpression, - // it should default to the value `undefined` for yield to return. - // In that case, the `undefined` stored as `null` in ast. - // - // Note 1: It isn't allowed for yield* to close without an expression - // Note 2: If there is a nlb between yield and star, it is interpret as - // yield * - if (can_insert_semicolon() || - (is("punc") && PUNC_AFTER_EXPRESSION.has(S.token.value))) { - has_expression = false; - - } else if (is("operator", "*")) { - star = true; - next(); - } - - return new AST_Yield({ - start : start, - is_star : star, - expression : has_expression ? expression() : null, - end : prev() - }); - } - - function if_() { - var cond = parenthesised(), body = statement(false, false, true), belse = null; - if (is("keyword", "else")) { - next(); - belse = statement(false, false, true); - } - return new AST_If({ - condition : cond, - body : body, - alternative : belse - }); - } - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - } - - function switch_body_() { - expect("{"); - var a = [], cur = null, branch = null, tmp; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Case({ - start : (tmp = S.token, next(), tmp), - expression : expression(true), - body : cur - }); - a.push(branch); - expect(":"); - } else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Default({ - start : (tmp = S.token, next(), expect(":"), tmp), - body : cur - }); - a.push(branch); - } else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - } - - function try_() { - var body, bcatch = null, bfinally = null; - body = new AST_TryBlock({ - start : S.token, - body : block_(), - end : prev(), - }); - if (is("keyword", "catch")) { - var start = S.token; - next(); - if (is("punc", "{")) { - var name = null; - } else { - expect("("); - var name = parameter(undefined, AST_SymbolCatch); - expect(")"); - } - bcatch = new AST_Catch({ - start : start, - argname : name, - body : block_(), - end : prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new AST_Finally({ - start : start, - body : block_(), - end : prev() - }); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return new AST_Try({ - body : body, - bcatch : bcatch, - bfinally : bfinally - }); - } - - /** - * var - * vardef1 = 2, - * vardef2 = 3; - */ - function vardefs(no_in, kind) { - var var_defs = []; - var def; - for (;;) { - var sym_type = - kind === "var" ? AST_SymbolVar : - kind === "const" ? AST_SymbolConst : - kind === "let" ? AST_SymbolLet : null; - // var { a } = b - if (is("punc", "{") || is("punc", "[")) { - def = new AST_VarDef({ - start: S.token, - name: binding_element(undefined, sym_type), - value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, - end: prev() - }); - } else { - def = new AST_VarDef({ - start : S.token, - name : as_symbol(sym_type), - value : is("operator", "=") - ? (next(), expression(false, no_in)) - : !no_in && kind === "const" - ? croak("Missing initializer in const declaration") : null, - end : prev() - }); - if (def.name.name == "import") croak("Unexpected token: import"); - } - var_defs.push(def); - if (!is("punc", ",")) - break; - next(); - } - return var_defs; - } - - var var_ = function(no_in) { - return new AST_Var({ - start : prev(), - definitions : vardefs(no_in, "var"), - end : prev() - }); - }; - - var let_ = function(no_in) { - return new AST_Let({ - start : prev(), - definitions : vardefs(no_in, "let"), - end : prev() - }); - }; - - var const_ = function(no_in) { - return new AST_Const({ - start : prev(), - definitions : vardefs(no_in, "const"), - end : prev() - }); - }; - - var new_ = function(allow_calls) { - var start = S.token; - expect_token("operator", "new"); - if (is("punc", ".")) { - next(); - expect_token("name", "target"); - return subscripts(new AST_NewTarget({ - start : start, - end : prev() - }), allow_calls); - } - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")", true); - } else { - args = []; - } - var call = new AST_New({ - start : start, - expression : newexp, - args : args, - end : prev() - }); - annotate(call); - return subscripts(call, allow_calls); - }; - - function as_atom_node() { - var tok = S.token, ret; - switch (tok.type) { - case "name": - ret = _make_symbol(AST_SymbolRef); - break; - case "num": - ret = new AST_Number({ - start: tok, - end: tok, - value: tok.value, - raw: LATEST_RAW - }); - break; - case "big_int": - ret = new AST_BigInt({ start: tok, end: tok, value: tok.value }); - break; - case "string": - ret = new AST_String({ - start : tok, - end : tok, - value : tok.value, - quote : tok.quote - }); - annotate(ret); - break; - case "regexp": - const [_, source, flags] = tok.value.match(/^\/(.*)\/(\w*)$/); - - ret = new AST_RegExp({ start: tok, end: tok, value: { source, flags } }); - break; - case "atom": - switch (tok.value) { - case "false": - ret = new AST_False({ start: tok, end: tok }); - break; - case "true": - ret = new AST_True({ start: tok, end: tok }); - break; - case "null": - ret = new AST_Null({ start: tok, end: tok }); - break; - } - break; - } - next(); - return ret; - } - - function to_fun_args(ex, default_seen_above) { - var insert_default = function(ex, default_value) { - if (default_value) { - return new AST_DefaultAssign({ - start: ex.start, - left: ex, - operator: "=", - right: default_value, - end: default_value.end - }); - } - return ex; - }; - if (ex instanceof AST_Object) { - return insert_default(new AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: false, - names: ex.properties.map(prop => to_fun_args(prop)) - }), default_seen_above); - } else if (ex instanceof AST_ObjectKeyVal) { - ex.value = to_fun_args(ex.value); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_Hole) { - return ex; - } else if (ex instanceof AST_Destructuring) { - ex.names = ex.names.map(name => to_fun_args(name)); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_SymbolRef) { - return insert_default(new AST_SymbolFunarg({ - name: ex.name, - start: ex.start, - end: ex.end - }), default_seen_above); - } else if (ex instanceof AST_Expansion) { - ex.expression = to_fun_args(ex.expression); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_Array) { - return insert_default(new AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: true, - names: ex.elements.map(elm => to_fun_args(elm)) - }), default_seen_above); - } else if (ex instanceof AST_Assign) { - return insert_default(to_fun_args(ex.left, ex.right), default_seen_above); - } else if (ex instanceof AST_DefaultAssign) { - ex.left = to_fun_args(ex.left); - return ex; - } else { - croak("Invalid function parameter", ex.start.line, ex.start.col); - } - } - - var expr_atom = function(allow_calls, allow_arrows) { - if (is("operator", "new")) { - return new_(allow_calls); - } - if (is("name", "import") && is_token(peek(), "punc", ".")) { - return import_meta(allow_calls); - } - var start = S.token; - var peeked; - var async = is("name", "async") - && (peeked = peek()).value != "[" - && peeked.type != "arrow" - && as_atom_node(); - if (is("punc")) { - switch (S.token.value) { - case "(": - if (async && !allow_calls) break; - var exprs = params_or_seq_(allow_arrows, !async); - if (allow_arrows && is("arrow", "=>")) { - return arrow_function(start, exprs.map(e => to_fun_args(e)), !!async); - } - var ex = async ? new AST_Call({ - expression: async, - args: exprs - }) : to_expr_or_sequence(start, exprs); - if (ex.start) { - const outer_comments_before = start.comments_before.length; - outer_comments_before_counts.set(start, outer_comments_before); - ex.start.comments_before.unshift(...start.comments_before); - start.comments_before = ex.start.comments_before; - if (outer_comments_before == 0 && start.comments_before.length > 0) { - var comment = start.comments_before[0]; - if (!comment.nlb) { - comment.nlb = start.nlb; - start.nlb = false; - } - } - start.comments_after = ex.start.comments_after; - } - ex.start = start; - var end = prev(); - if (ex.end) { - end.comments_before = ex.end.comments_before; - ex.end.comments_after.push(...end.comments_after); - end.comments_after = ex.end.comments_after; - } - ex.end = end; - if (ex instanceof AST_Call) annotate(ex); - return subscripts(ex, allow_calls); - case "[": - return subscripts(array_(), allow_calls); - case "{": - return subscripts(object_or_destructuring_(), allow_calls); - } - if (!async) unexpected(); - } - if (allow_arrows && is("name") && is_token(peek(), "arrow")) { - var param = new AST_SymbolFunarg({ - name: S.token.value, - start: start, - end: start, - }); - next(); - return arrow_function(start, [param], !!async); - } - if (is("keyword", "function")) { - next(); - var func = function_(AST_Function, false, !!async); - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (async) return subscripts(async, allow_calls); - if (is("keyword", "class")) { - next(); - var cls = class_(AST_ClassExpression); - cls.start = start; - cls.end = prev(); - return subscripts(cls, allow_calls); - } - if (is("template_head")) { - return subscripts(template_string(), allow_calls); - } - if (is("privatename")) { - if(!S.in_class) { - croak("Private field must be used in an enclosing class"); - } - - const start = S.token; - const key = new AST_SymbolPrivateProperty({ - start, - name: start.value, - end: start - }); - next(); - expect_token("operator", "in"); - - const private_in = new AST_PrivateIn({ - start, - key, - value: subscripts(as_atom_node(), allow_calls), - end: prev() - }); - - return subscripts(private_in, allow_calls); - } - if (ATOMIC_START_TOKEN.has(S.token.type)) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - - function template_string() { - var segments = [], start = S.token; - - segments.push(new AST_TemplateSegment({ - start: S.token, - raw: TEMPLATE_RAWS.get(S.token), - value: S.token.value, - end: S.token - })); - - while (!S.token.template_end) { - next(); - handle_regexp(); - segments.push(expression(true)); - - segments.push(new AST_TemplateSegment({ - start: S.token, - raw: TEMPLATE_RAWS.get(S.token), - value: S.token.value, - end: S.token - })); - } - next(); - - return new AST_TemplateString({ - start: start, - segments: segments, - end: S.token - }); - } - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push(new AST_Hole({ start: S.token, end: S.token })); - } else if (is("expand", "...")) { - next(); - a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token})); - } else { - a.push(expression(false)); - } - } - next(); - return a; - } - - var array_ = embed_tokens(function() { - expect("["); - return new AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - - var create_accessor = embed_tokens((is_generator, is_async) => { - return function_(AST_Accessor, is_generator, is_async); - }); - - var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() { - var start = S.token, first = true, a = []; - expect("{"); - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!options.strict && is("punc", "}")) - // allow trailing comma - break; - - start = S.token; - if (start.type == "expand") { - next(); - a.push(new AST_Expansion({ - start: start, - expression: expression(false), - end: prev(), - })); - continue; - } - if(is("privatename")) { - croak("private fields are not allowed in an object"); - } - var name = as_property_name(); - var value; - - // Check property and fetch value - if (!is("punc", ":")) { - var concise = concise_method_or_getset(name, start); - if (concise) { - a.push(concise); - continue; - } - - value = new AST_SymbolRef({ - start: prev(), - name: name, - end: prev() - }); - } else if (name === null) { - unexpected(prev()); - } else { - next(); // `:` - see first condition - value = expression(false); - } - - // Check for default value and alter value accordingly if necessary - if (is("operator", "=")) { - next(); - value = new AST_Assign({ - start: start, - left: value, - operator: "=", - right: expression(false), - logical: false, - end: prev() - }); - } - - // Create property - const kv = new AST_ObjectKeyVal({ - start: start, - quote: start.quote, - key: name instanceof AST_Node ? name : "" + name, - value: value, - end: prev() - }); - a.push(annotate(kv)); - } - next(); - return new AST_Object({ properties: a }); - }); - - function class_(KindOfClass, is_export_default) { - var start, method, class_name, extends_, a = []; - - S.input.push_directives_stack(); // Push directive stack, but not scope stack - S.input.add_directive("use strict"); - - if (S.token.type == "name" && S.token.value != "extends") { - class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass); - } - - if (KindOfClass === AST_DefClass && !class_name) { - if (is_export_default) { - KindOfClass = AST_ClassExpression; - } else { - unexpected(); - } - } - - if (S.token.value == "extends") { - next(); - extends_ = expression(true); - } - - expect("{"); - // mark in class feild, - const save_in_class = S.in_class; - S.in_class = true; - while (is("punc", ";")) { next(); } // Leading semicolons are okay in class bodies. - while (!is("punc", "}")) { - start = S.token; - method = concise_method_or_getset(as_property_name(), start, true); - if (!method) { unexpected(); } - a.push(method); - while (is("punc", ";")) { next(); } - } - // mark in class feild, - S.in_class = save_in_class; - - S.input.pop_directives_stack(); - - next(); - - return new KindOfClass({ - start: start, - name: class_name, - extends: extends_, - properties: a, - end: prev(), - }); - } - - function concise_method_or_getset(name, start, is_class) { - const get_symbol_ast = (name, SymbolClass = AST_SymbolMethod) => { - if (typeof name === "string" || typeof name === "number") { - return new SymbolClass({ - start, - name: "" + name, - end: prev() - }); - } else if (name === null) { - unexpected(); - } - return name; - }; - - const is_not_method_start = () => - !is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "="); - - var is_async = false; - var is_static = false; - var is_generator = false; - var is_private = false; - var accessor_type = null; - - if (is_class && name === "static" && is_not_method_start()) { - const static_block = class_static_block(); - if (static_block != null) { - return static_block; - } - is_static = true; - name = as_property_name(); - } - if (name === "async" && is_not_method_start()) { - is_async = true; - name = as_property_name(); - } - if (prev().type === "operator" && prev().value === "*") { - is_generator = true; - name = as_property_name(); - } - if ((name === "get" || name === "set") && is_not_method_start()) { - accessor_type = name; - name = as_property_name(); - } - if (prev().type === "privatename") { - is_private = true; - } - - const property_token = prev(); - - if (accessor_type != null) { - if (!is_private) { - const AccessorClass = accessor_type === "get" - ? AST_ObjectGetter - : AST_ObjectSetter; - - name = get_symbol_ast(name); - return annotate(new AccessorClass({ - start, - static: is_static, - key: name, - quote: name instanceof AST_SymbolMethod ? property_token.quote : undefined, - value: create_accessor(), - end: prev() - })); - } else { - const AccessorClass = accessor_type === "get" - ? AST_PrivateGetter - : AST_PrivateSetter; - - return annotate(new AccessorClass({ - start, - static: is_static, - key: get_symbol_ast(name), - value: create_accessor(), - end: prev(), - })); - } - } - - if (is("punc", "(")) { - name = get_symbol_ast(name); - const AST_MethodVariant = is_private - ? AST_PrivateMethod - : AST_ConciseMethod; - var node = new AST_MethodVariant({ - start : start, - static : is_static, - is_generator: is_generator, - async : is_async, - key : name, - quote : name instanceof AST_SymbolMethod ? - property_token.quote : undefined, - value : create_accessor(is_generator, is_async), - end : prev() - }); - return annotate(node); - } - - if (is_class) { - const key = get_symbol_ast(name, AST_SymbolClassProperty); - const quote = key instanceof AST_SymbolClassProperty - ? property_token.quote - : undefined; - const AST_ClassPropertyVariant = is_private - ? AST_ClassPrivateProperty - : AST_ClassProperty; - if (is("operator", "=")) { - next(); - return annotate( - new AST_ClassPropertyVariant({ - start, - static: is_static, - quote, - key, - value: expression(false), - end: prev() - }) - ); - } else if ( - is("name") - || is("privatename") - || is("operator", "*") - || is("punc", ";") - || is("punc", "}") - ) { - return annotate( - new AST_ClassPropertyVariant({ - start, - static: is_static, - quote, - key, - end: prev() - }) - ); - } - } - } - - function class_static_block() { - if (!is("punc", "{")) { - return null; - } - - const start = S.token; - const body = []; - - next(); - - while (!is("punc", "}")) { - body.push(statement()); - } - - next(); - - return new AST_ClassStaticBlock({ start, body, end: prev() }); - } - - function maybe_import_assertion() { - if (is("name", "assert") && !has_newline_before(S.token)) { - next(); - return object_or_destructuring_(); - } - return null; - } - - function import_statement() { - var start = prev(); - - var imported_name; - var imported_names; - if (is("name")) { - imported_name = as_symbol(AST_SymbolImport); - } - - if (is("punc", ",")) { - next(); - } - - imported_names = map_names(true); - - if (imported_names || imported_name) { - expect_token("name", "from"); - } - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - const assert_clause = maybe_import_assertion(); - - return new AST_Import({ - start, - imported_name, - imported_names, - module_name: new AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - assert_clause, - end: S.token, - }); - } - - function import_meta(allow_calls) { - var start = S.token; - expect_token("name", "import"); - expect_token("punc", "."); - expect_token("name", "meta"); - return subscripts(new AST_ImportMeta({ - start: start, - end: prev() - }), allow_calls); - } - - function map_name(is_import) { - function make_symbol(type, quote) { - return new type({ - name: as_property_name(), - quote: quote || undefined, - start: prev(), - end: prev() - }); - } - - var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; - var type = is_import ? AST_SymbolImport : AST_SymbolExport; - var start = S.token; - var foreign_name; - var name; - - if (is_import) { - foreign_name = make_symbol(foreign_type, start.quote); - } else { - name = make_symbol(type, start.quote); - } - if (is("name", "as")) { - next(); // The "as" word - if (is_import) { - name = make_symbol(type); - } else { - foreign_name = make_symbol(foreign_type, S.token.quote); - } - } else if (is_import) { - name = new type(foreign_name); - } else { - foreign_name = new foreign_type(name); - } - - return new AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: prev(), - }); - } - - function map_nameAsterisk(is_import, import_or_export_foreign_name) { - var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; - var type = is_import ? AST_SymbolImport : AST_SymbolExport; - var start = S.token; - var name, foreign_name; - var end = prev(); - - if (is_import) { - name = import_or_export_foreign_name; - } else { - foreign_name = import_or_export_foreign_name; - } - - name = name || new type({ - start: start, - name: "*", - end: end, - }); - - foreign_name = foreign_name || new foreign_type({ - start: start, - name: "*", - end: end, - }); - - return new AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: end, - }); - } - - function map_names(is_import) { - var names; - if (is("punc", "{")) { - next(); - names = []; - while (!is("punc", "}")) { - names.push(map_name(is_import)); - if (is("punc", ",")) { - next(); - } - } - next(); - } else if (is("operator", "*")) { - var name; - next(); - if (is("name", "as")) { - next(); // The "as" word - name = is_import ? as_symbol(AST_SymbolImport) : as_symbol_or_string(AST_SymbolExportForeign); - } - names = [map_nameAsterisk(is_import, name)]; - } - return names; - } - - function export_statement() { - var start = S.token; - var is_default; - var exported_names; - - if (is("keyword", "default")) { - is_default = true; - next(); - } else if (exported_names = map_names(false)) { - if (is("name", "from")) { - next(); - - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - const assert_clause = maybe_import_assertion(); - - return new AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - module_name: new AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - end: prev(), - assert_clause - }); - } else { - return new AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - end: prev(), - }); - } - } - - var node; - var exported_value; - var exported_definition; - if (is("punc", "{") - || is_default - && (is("keyword", "class") || is("keyword", "function")) - && is_token(peek(), "punc")) { - exported_value = expression(false); - semicolon(); - } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) { - unexpected(node.start); - } else if ( - node instanceof AST_Definitions - || node instanceof AST_Defun - || node instanceof AST_DefClass - ) { - exported_definition = node; - } else if ( - node instanceof AST_ClassExpression - || node instanceof AST_Function - ) { - exported_value = node; - } else if (node instanceof AST_SimpleStatement) { - exported_value = node.body; - } else { - unexpected(node.start); - } - - return new AST_Export({ - start: start, - is_default: is_default, - exported_value: exported_value, - exported_definition: exported_definition, - end: prev(), - assert_clause: null - }); - } - - function as_property_name() { - var tmp = S.token; - switch (tmp.type) { - case "punc": - if (tmp.value === "[") { - next(); - var ex = expression(false); - expect("]"); - return ex; - } else unexpected(tmp); - case "operator": - if (tmp.value === "*") { - next(); - return null; - } - if (!["delete", "in", "instanceof", "new", "typeof", "void"].includes(tmp.value)) { - unexpected(tmp); - } - /* falls through */ - case "name": - case "privatename": - case "string": - case "num": - case "big_int": - case "keyword": - case "atom": - next(); - return tmp.value; - default: - unexpected(tmp); - } - } - - function as_name() { - var tmp = S.token; - if (tmp.type != "name" && tmp.type != "privatename") unexpected(); - next(); - return tmp.value; - } - - function _make_symbol(type) { - var name = S.token.value; - return new (name == "this" ? AST_This : - name == "super" ? AST_Super : - type)({ - name : String(name), - start : S.token, - end : S.token - }); - } - - function _verify_symbol(sym) { - var name = sym.name; - if (is_in_generator() && name == "yield") { - token_error(sym.start, "Yield cannot be used as identifier inside generators"); - } - if (S.input.has_directive("use strict")) { - if (name == "yield") { - token_error(sym.start, "Unexpected yield identifier inside strict mode"); - } - if (sym instanceof AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { - token_error(sym.start, "Unexpected " + name + " in strict mode"); - } - } - } - - function as_symbol(type, noerror) { - if (!is("name")) { - if (!noerror) croak("Name expected"); - return null; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - function as_symbol_or_string(type) { - if (!is("name")) { - if (!is("string")) { - croak("Name or string expected"); - } - var tok = S.token; - var ret = new type({ - start : tok, - end : tok, - name : tok.value, - quote : tok.quote - }); - next(); - return ret; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - // Annotate AST_Call, AST_Lambda or AST_New with the special comments - function annotate(node, before_token = node.start) { - var comments = before_token.comments_before; - const comments_outside_parens = outer_comments_before_counts.get(before_token); - var i = comments_outside_parens != null ? comments_outside_parens : comments.length; - while (--i >= 0) { - var comment = comments[i]; - if (/[@#]__/.test(comment.value)) { - if (/[@#]__PURE__/.test(comment.value)) { - set_annotation(node, _PURE); - break; - } - if (/[@#]__INLINE__/.test(comment.value)) { - set_annotation(node, _INLINE); - break; - } - if (/[@#]__NOINLINE__/.test(comment.value)) { - set_annotation(node, _NOINLINE); - break; - } - if (/[@#]__KEY__/.test(comment.value)) { - set_annotation(node, _KEY); - break; - } - if (/[@#]__MANGLE_PROP__/.test(comment.value)) { - set_annotation(node, _MANGLEPROP); - break; - } - } - } - return node; - } - - var subscripts = function(expr, allow_calls, is_chain) { - var start = expr.start; - if (is("punc", ".")) { - next(); - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - const AST_DotVariant = is("privatename") ? AST_DotHash : AST_Dot; - return annotate(subscripts(new AST_DotVariant({ - start : start, - expression : expr, - optional : false, - property : as_name(), - end : prev() - }), allow_calls, is_chain)); - } - if (is("punc", "[")) { - next(); - var prop = expression(true); - expect("]"); - return annotate(subscripts(new AST_Sub({ - start : start, - expression : expr, - optional : false, - property : prop, - end : prev() - }), allow_calls, is_chain)); - } - if (allow_calls && is("punc", "(")) { - next(); - var call = new AST_Call({ - start : start, - expression : expr, - optional : false, - args : call_args(), - end : prev() - }); - annotate(call); - return subscripts(call, true, is_chain); - } - - if (is("punc", "?.")) { - next(); - - let chain_contents; - - if (allow_calls && is("punc", "(")) { - next(); - - const call = new AST_Call({ - start, - optional: true, - expression: expr, - args: call_args(), - end: prev() - }); - annotate(call); - - chain_contents = subscripts(call, true, true); - } else if (is("name") || is("privatename")) { - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - const AST_DotVariant = is("privatename") ? AST_DotHash : AST_Dot; - chain_contents = annotate(subscripts(new AST_DotVariant({ - start, - expression: expr, - optional: true, - property: as_name(), - end: prev() - }), allow_calls, true)); - } else if (is("punc", "[")) { - next(); - const property = expression(true); - expect("]"); - chain_contents = annotate(subscripts(new AST_Sub({ - start, - expression: expr, - optional: true, - property, - end: prev() - }), allow_calls, true)); - } - - if (!chain_contents) unexpected(); - - if (chain_contents instanceof AST_Chain) return chain_contents; - - return new AST_Chain({ - start, - expression: chain_contents, - end: prev() - }); - } - - if (is("template_head")) { - if (is_chain) { - // a?.b`c` is a syntax error - unexpected(); - } - - return subscripts(new AST_PrefixedTemplateString({ - start: start, - prefix: expr, - template_string: template_string(), - end: prev() - }), allow_calls); - } - return expr; - }; - - function call_args() { - var args = []; - while (!is("punc", ")")) { - if (is("expand", "...")) { - next(); - args.push(new AST_Expansion({ - start: prev(), - expression: expression(false), - end: prev() - })); - } else { - args.push(expression(false)); - } - if (!is("punc", ")")) { - expect(","); - } - } - next(); - return args; - } - - var maybe_unary = function(allow_calls, allow_arrows) { - var start = S.token; - if (start.type == "name" && start.value == "await" && can_await()) { - next(); - return _await_expression(); - } - if (is("operator") && UNARY_PREFIX.has(start.value)) { - next(); - handle_regexp(); - var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(allow_calls, allow_arrows); - while (is("operator") && UNARY_POSTFIX.has(S.token.value) && !has_newline_before(S.token)) { - if (val instanceof AST_Arrow) unexpected(); - val = make_unary(AST_UnaryPostfix, S.token, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - }; - - function make_unary(ctor, token, expr) { - var op = token.value; - switch (op) { - case "++": - case "--": - if (!is_assignable(expr)) - croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); - break; - case "delete": - if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) - croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); - break; - } - return new ctor({ operator: op, expression: expr }); - } - - var expr_op = function(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - if (op == "**" && left instanceof AST_UnaryPrefix - /* unary token in front not allowed - parenthesis required */ - && !is_token(left.start, "punc", "(") - && left.operator !== "--" && left.operator !== "++") - unexpected(left.start); - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && (prec > min_prec || (op === "**" && min_prec === prec))) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(new AST_Binary({ - start : left.start, - left : left, - operator : op, - right : right, - end : right.end - }), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(true, true), 0, no_in); - } - - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return new AST_Conditional({ - start : start, - condition : expr, - consequent : yes, - alternative : expression(false, no_in), - end : prev() - }); - } - return expr; - }; - - function is_assignable(expr) { - return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef; - } - - function to_destructuring(node) { - if (node instanceof AST_Object) { - node = new AST_Destructuring({ - start: node.start, - names: node.properties.map(to_destructuring), - is_array: false, - end: node.end - }); - } else if (node instanceof AST_Array) { - var names = []; - - for (var i = 0; i < node.elements.length; i++) { - // Only allow expansion as last element - if (node.elements[i] instanceof AST_Expansion) { - if (i + 1 !== node.elements.length) { - token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); - } - node.elements[i].expression = to_destructuring(node.elements[i].expression); - } - - names.push(to_destructuring(node.elements[i])); - } - - node = new AST_Destructuring({ - start: node.start, - names: names, - is_array: true, - end: node.end - }); - } else if (node instanceof AST_ObjectProperty) { - node.value = to_destructuring(node.value); - } else if (node instanceof AST_Assign) { - node = new AST_DefaultAssign({ - start: node.start, - left: node.left, - operator: "=", - right: node.right, - end: node.end - }); - } - return node; - } - - // In ES6, AssignmentExpression can also be an ArrowFunction - var maybe_assign = function(no_in) { - handle_regexp(); - var start = S.token; - - if (start.type == "name" && start.value == "yield") { - if (is_in_generator()) { - next(); - return _yield_expression(); - } else if (S.input.has_directive("use strict")) { - token_error(S.token, "Unexpected yield identifier inside strict mode"); - } - } - - var left = maybe_conditional(no_in); - var val = S.token.value; - - if (is("operator") && ASSIGNMENT.has(val)) { - if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { - next(); - - return new AST_Assign({ - start : start, - left : left, - operator : val, - right : maybe_assign(no_in), - logical : LOGICAL_ASSIGNMENT.has(val), - end : prev() - }); - } - croak("Invalid assignment"); - } - return left; - }; - - var to_expr_or_sequence = function(start, exprs) { - if (exprs.length === 1) { - return exprs[0]; - } else if (exprs.length > 1) { - return new AST_Sequence({ start, expressions: exprs, end: peek() }); - } else { - croak("Invalid parenthesized expression"); - } - }; - - var expression = function(commas, no_in) { - var start = S.token; - var exprs = []; - while (true) { - exprs.push(maybe_assign(no_in)); - if (!commas || !is("punc", ",")) break; - next(); - commas = true; - } - return to_expr_or_sequence(start, exprs); - }; - - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - } - - if (options.expression) { - return expression(true); - } - - return (function parse_toplevel() { - var start = S.token; - var body = []; - S.input.push_directives_stack(); - if (options.module) S.input.add_directive("use strict"); - while (!is("eof")) { - body.push(statement()); - } - S.input.pop_directives_stack(); - var end = prev(); - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new AST_Toplevel({ start: start, body: body, end: end }); - } - TEMPLATE_RAWS = new Map(); - return toplevel; - })(); - -} - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -function DEFNODE(type, props, ctor, methods, base = AST_Node) { - if (!props) props = []; - else props = props.split(/\s+/); - var self_props = props; - if (base && base.PROPS) - props = props.concat(base.PROPS); - const proto = base && Object.create(base.prototype); - if (proto) { - ctor.prototype = proto; - ctor.BASE = base; - } - if (base) base.SUBCLASSES.push(ctor); - ctor.prototype.CTOR = ctor; - ctor.prototype.constructor = ctor; - ctor.PROPS = props || null; - ctor.SELF_PROPS = self_props; - ctor.SUBCLASSES = []; - if (type) { - ctor.prototype.TYPE = ctor.TYPE = type; - } - if (methods) for (let i in methods) if (HOP(methods, i)) { - if (i[0] === "$") { - ctor[i.substr(1)] = methods[i]; - } else { - ctor.prototype[i] = methods[i]; - } - } - ctor.DEFMETHOD = function(name, method) { - this.prototype[name] = method; - }; - return ctor; -} - -const has_tok_flag = (tok, flag) => Boolean(tok.flags & flag); -const set_tok_flag = (tok, flag, truth) => { - if (truth) { - tok.flags |= flag; - } else { - tok.flags &= ~flag; - } -}; - -const TOK_FLAG_NLB = 0b0001; -const TOK_FLAG_QUOTE_SINGLE = 0b0010; -const TOK_FLAG_QUOTE_EXISTS = 0b0100; -const TOK_FLAG_TEMPLATE_END = 0b1000; - -class AST_Token { - constructor(type, value, line, col, pos, nlb, comments_before, comments_after, file) { - this.flags = (nlb ? 1 : 0); - - this.type = type; - this.value = value; - this.line = line; - this.col = col; - this.pos = pos; - this.comments_before = comments_before; - this.comments_after = comments_after; - this.file = file; - - Object.seal(this); - } - - // Return a string summary of the token for node.js console.log - [Symbol.for("nodejs.util.inspect.custom")](_depth, options) { - const special = str => options.stylize(str, "special"); - const quote = typeof this.value === "string" && this.value.includes("`") ? "'" : "`"; - const value = `${quote}${this.value}${quote}`; - return `${special("[AST_Token")} ${value} at ${this.line}:${this.col}${special("]")}`; - } - - get nlb() { - return has_tok_flag(this, TOK_FLAG_NLB); - } - - set nlb(new_nlb) { - set_tok_flag(this, TOK_FLAG_NLB, new_nlb); - } - - get quote() { - return !has_tok_flag(this, TOK_FLAG_QUOTE_EXISTS) - ? "" - : (has_tok_flag(this, TOK_FLAG_QUOTE_SINGLE) ? "'" : '"'); - } - - set quote(quote_type) { - set_tok_flag(this, TOK_FLAG_QUOTE_SINGLE, quote_type === "'"); - set_tok_flag(this, TOK_FLAG_QUOTE_EXISTS, !!quote_type); - } - - get template_end() { - return has_tok_flag(this, TOK_FLAG_TEMPLATE_END); - } - - set template_end(new_template_end) { - set_tok_flag(this, TOK_FLAG_TEMPLATE_END, new_template_end); - } -} - -var AST_Node = DEFNODE("Node", "start end", function AST_Node(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - _clone: function(deep) { - if (deep) { - var self = this.clone(); - return self.transform(new TreeTransformer(function(node) { - if (node !== self) { - return node.clone(true); - } - })); - } - return new this.CTOR(this); - }, - clone: function(deep) { - return this._clone(deep); - }, - $documentation: "Base class of all AST nodes", - $propdoc: { - start: "[AST_Token] The first token of this node", - end: "[AST_Token] The last token of this node" - }, - _walk: function(visitor) { - return visitor._visit(this); - }, - walk: function(visitor) { - return this._walk(visitor); // not sure the indirection will be any help - }, - _children_backwards: () => {} -}, null); - -/* -----[ statements ]----- */ - -var AST_Statement = DEFNODE("Statement", null, function AST_Statement(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class of all statements", -}); - -var AST_Debugger = DEFNODE("Debugger", null, function AST_Debugger(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Represents a debugger statement", -}, AST_Statement); - -var AST_Directive = DEFNODE("Directive", "value quote", function AST_Directive(props) { - if (props) { - this.value = props.value; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Represents a directive, like \"use strict\";", - $propdoc: { - value: "[string] The value of this directive as a plain string (it's not an AST_String!)", - quote: "[string] the original quote character" - }, -}, AST_Statement); - -var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", function AST_SimpleStatement(props) { - if (props) { - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", - $propdoc: { - body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - } -}, AST_Statement); - -function walk_body(node, visitor) { - const body = node.body; - for (var i = 0, len = body.length; i < len; i++) { - body[i]._walk(visitor); - } -} - -function clone_block_scope(deep) { - var clone = this._clone(deep); - if (this.block_scope) { - clone.block_scope = this.block_scope.clone(); - } - return clone; -} - -var AST_Block = DEFNODE("Block", "body block_scope", function AST_Block(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A body of statements (usually braced)", - $propdoc: { - body: "[AST_Statement*] an array of statements", - block_scope: "[AST_Scope] the block scope" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - }, - clone: clone_block_scope -}, AST_Statement); - -var AST_BlockStatement = DEFNODE("BlockStatement", null, function AST_BlockStatement(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A block statement", -}, AST_Block); - -var AST_EmptyStatement = DEFNODE("EmptyStatement", null, function AST_EmptyStatement(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The empty statement (empty block or simply a semicolon)" -}, AST_Statement); - -var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", function AST_StatementWithBody(props) { - if (props) { - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", - $propdoc: { - body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" - } -}, AST_Statement); - -var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", function AST_LabeledStatement(props) { - if (props) { - this.label = props.label; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Statement with a label", - $propdoc: { - label: "[AST_Label] a label definition" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.label._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.label); - }, - clone: function(deep) { - var node = this._clone(deep); - if (deep) { - var label = node.label; - var def = this.label; - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_LoopControl - && node.label && node.label.thedef === def) { - node.label.thedef = label; - label.references.push(node); - } - })); - } - return node; - } -}, AST_StatementWithBody); - -var AST_IterationStatement = DEFNODE( - "IterationStatement", - "block_scope", - function AST_IterationStatement(props) { - if (props) { - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Internal class. All loops inherit from it.", - $propdoc: { - block_scope: "[AST_Scope] the block scope for this iteration statement." - }, - clone: clone_block_scope - }, - AST_StatementWithBody -); - -var AST_DWLoop = DEFNODE("DWLoop", "condition", function AST_DWLoop(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for do/while statements", - $propdoc: { - condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - } -}, AST_IterationStatement); - -var AST_Do = DEFNODE("Do", null, function AST_Do(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `do` statement", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - this.condition._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.condition); - push(this.body); - } -}, AST_DWLoop); - -var AST_While = DEFNODE("While", null, function AST_While(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `while` statement", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.condition); - }, -}, AST_DWLoop); - -var AST_For = DEFNODE("For", "init condition step", function AST_For(props) { - if (props) { - this.init = props.init; - this.condition = props.condition; - this.step = props.step; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for` statement", - $propdoc: { - init: "[AST_Node?] the `for` initialization code, or null if empty", - condition: "[AST_Node?] the `for` termination clause, or null if empty", - step: "[AST_Node?] the `for` update clause, or null if empty" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.init) this.init._walk(visitor); - if (this.condition) this.condition._walk(visitor); - if (this.step) this.step._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - if (this.step) push(this.step); - if (this.condition) push(this.condition); - if (this.init) push(this.init); - }, -}, AST_IterationStatement); - -var AST_ForIn = DEFNODE("ForIn", "init object", function AST_ForIn(props) { - if (props) { - this.init = props.init; - this.object = props.object; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for ... in` statement", - $propdoc: { - init: "[AST_Node] the `for/in` initialization code", - object: "[AST_Node] the object that we're looping through" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.init._walk(visitor); - this.object._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - if (this.object) push(this.object); - if (this.init) push(this.init); - }, -}, AST_IterationStatement); - -var AST_ForOf = DEFNODE("ForOf", "await", function AST_ForOf(props) { - if (props) { - this.await = props.await; - this.init = props.init; - this.object = props.object; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for ... of` statement", -}, AST_ForIn); - -var AST_With = DEFNODE("With", "expression", function AST_With(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `with` statement", - $propdoc: { - expression: "[AST_Node] the `with` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.expression); - }, -}, AST_StatementWithBody); - -/* -----[ scope and functions ]----- */ - -var AST_Scope = DEFNODE( - "Scope", - "variables uses_with uses_eval parent_scope enclosed cname", - function AST_Scope(props) { - if (props) { - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for all statements introducing a lexical scope", - $propdoc: { - variables: "[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope", - uses_with: "[boolean/S] tells whether this scope uses the `with` statement", - uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", - parent_scope: "[AST_Scope?/S] link to the parent scope", - enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", - cname: "[integer/S] current index for mangling variables (used internally by the mangler)", - }, - get_defun_scope: function() { - var self = this; - while (self.is_block_scope()) { - self = self.parent_scope; - } - return self; - }, - clone: function(deep, toplevel) { - var node = this._clone(deep); - if (deep && this.variables && toplevel && !this._block_scope) { - node.figure_out_scope({}, { - toplevel: toplevel, - parent_scope: this.parent_scope - }); - } else { - if (this.variables) node.variables = new Map(this.variables); - if (this.enclosed) node.enclosed = this.enclosed.slice(); - if (this._block_scope) node._block_scope = this._block_scope; - } - return node; - }, - pinned: function() { - return this.uses_eval || this.uses_with; - } - }, - AST_Block -); - -var AST_Toplevel = DEFNODE("Toplevel", "globals", function AST_Toplevel(props) { - if (props) { - this.globals = props.globals; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The toplevel scope", - $propdoc: { - globals: "[Map/S] a map of name -> SymbolDef for all undeclared names", - }, - wrap_commonjs: function(name) { - var body = this.body; - var wrapped_tl = "(function(exports){'$ORIG';})(typeof " + name + "=='undefined'?(" + name + "={}):" + name + ");"; - wrapped_tl = parse(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return MAP.splice(body); - } - })); - return wrapped_tl; - }, - wrap_enclose: function(args_values) { - if (typeof args_values != "string") args_values = ""; - var index = args_values.indexOf(":"); - if (index < 0) index = args_values.length; - var body = this.body; - return parse([ - "(function(", - args_values.slice(0, index), - '){"$ORIG"})(', - args_values.slice(index + 1), - ")" - ].join("")).transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return MAP.splice(body); - } - })); - } -}, AST_Scope); - -var AST_Expansion = DEFNODE("Expansion", "expression", function AST_Expansion(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list", - $propdoc: { - expression: "[AST_Node] the thing to be expanded" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression.walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Lambda = DEFNODE( - "Lambda", - "name argnames uses_arguments is_generator async", - function AST_Lambda(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for functions", - $propdoc: { - name: "[AST_SymbolDeclaration?] the name of this function", - argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments", - uses_arguments: "[boolean/S] tells whether this function accesses the arguments array", - is_generator: "[boolean] is this a generator method", - async: "[boolean] is this method async", - }, - args_as_names: function () { - var out = []; - for (var i = 0; i < this.argnames.length; i++) { - if (this.argnames[i] instanceof AST_Destructuring) { - out.push(...this.argnames[i].all_symbols()); - } else { - out.push(this.argnames[i]); - } - } - return out; - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) this.name._walk(visitor); - var argnames = this.argnames; - for (var i = 0, len = argnames.length; i < len; i++) { - argnames[i]._walk(visitor); - } - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - - i = this.argnames.length; - while (i--) push(this.argnames[i]); - - if (this.name) push(this.name); - }, - is_braceless() { - return this.body[0] instanceof AST_Return && this.body[0].value; - }, - // Default args and expansion don't count, so .argnames.length doesn't cut it - length_property() { - let length = 0; - - for (const arg of this.argnames) { - if (arg instanceof AST_SymbolFunarg || arg instanceof AST_Destructuring) { - length++; - } - } - - return length; - } - }, - AST_Scope -); - -var AST_Accessor = DEFNODE("Accessor", null, function AST_Accessor(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A setter/getter function. The `name` property is always null." -}, AST_Lambda); - -var AST_Function = DEFNODE("Function", null, function AST_Function(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A function expression" -}, AST_Lambda); - -var AST_Arrow = DEFNODE("Arrow", null, function AST_Arrow(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An ES6 Arrow function ((a) => b)" -}, AST_Lambda); - -var AST_Defun = DEFNODE("Defun", null, function AST_Defun(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A function definition" -}, AST_Lambda); - -/* -----[ DESTRUCTURING ]----- */ -var AST_Destructuring = DEFNODE("Destructuring", "names is_array", function AST_Destructuring(props) { - if (props) { - this.names = props.names; - this.is_array = props.is_array; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A destructuring of several names. Used in destructuring assignment and with destructuring function argument names", - $propdoc: { - "names": "[AST_Node*] Array of properties or elements", - "is_array": "[Boolean] Whether the destructuring represents an object or array" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.names.forEach(function(name) { - name._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.names.length; - while (i--) push(this.names[i]); - }, - all_symbols: function() { - var out = []; - walk(this, node => { - if (node instanceof AST_SymbolDeclaration) { - out.push(node); - } - if (node instanceof AST_Lambda) { - return true; - } - }); - return out; - } -}); - -var AST_PrefixedTemplateString = DEFNODE( - "PrefixedTemplateString", - "template_string prefix", - function AST_PrefixedTemplateString(props) { - if (props) { - this.template_string = props.template_string; - this.prefix = props.prefix; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "A templatestring with a prefix, such as String.raw`foobarbaz`", - $propdoc: { - template_string: "[AST_TemplateString] The template string", - prefix: "[AST_Node] The prefix, which will get called." - }, - _walk: function(visitor) { - return visitor._visit(this, function () { - this.prefix._walk(visitor); - this.template_string._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.template_string); - push(this.prefix); - }, - } -); - -var AST_TemplateString = DEFNODE("TemplateString", "segments", function AST_TemplateString(props) { - if (props) { - this.segments = props.segments; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A template string literal", - $propdoc: { - segments: "[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.segments.forEach(function(seg) { - seg._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.segments.length; - while (i--) push(this.segments[i]); - } -}); - -var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", function AST_TemplateSegment(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A segment of a template string literal", - $propdoc: { - value: "Content of the segment", - raw: "Raw source of the segment", - } -}); - -/* -----[ JUMPS ]----- */ - -var AST_Jump = DEFNODE("Jump", null, function AST_Jump(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" -}, AST_Statement); - -/** Base class for “exits” (`return` and `throw`) */ -var AST_Exit = DEFNODE("Exit", "value", function AST_Exit(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for “exits” (`return` and `throw`)", - $propdoc: { - value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" - }, - _walk: function(visitor) { - return visitor._visit(this, this.value && function() { - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value) push(this.value); - }, -}, AST_Jump); - -var AST_Return = DEFNODE("Return", null, function AST_Return(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `return` statement" -}, AST_Exit); - -var AST_Throw = DEFNODE("Throw", null, function AST_Throw(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `throw` statement" -}, AST_Exit); - -var AST_LoopControl = DEFNODE("LoopControl", "label", function AST_LoopControl(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for loop control statements (`break` and `continue`)", - $propdoc: { - label: "[AST_LabelRef?] the label, or null if none", - }, - _walk: function(visitor) { - return visitor._visit(this, this.label && function() { - this.label._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.label) push(this.label); - }, -}, AST_Jump); - -var AST_Break = DEFNODE("Break", null, function AST_Break(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `break` statement" -}, AST_LoopControl); - -var AST_Continue = DEFNODE("Continue", null, function AST_Continue(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `continue` statement" -}, AST_LoopControl); - -var AST_Await = DEFNODE("Await", "expression", function AST_Await(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An `await` statement", - $propdoc: { - expression: "[AST_Node] the mandatory expression being awaited", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Yield = DEFNODE("Yield", "expression is_star", function AST_Yield(props) { - if (props) { - this.expression = props.expression; - this.is_star = props.is_star; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `yield` statement", - $propdoc: { - expression: "[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false", - is_star: "[Boolean] Whether this is a yield or yield* statement" - }, - _walk: function(visitor) { - return visitor._visit(this, this.expression && function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.expression) push(this.expression); - } -}); - -/* -----[ IF ]----- */ - -var AST_If = DEFNODE("If", "condition alternative", function AST_If(props) { - if (props) { - this.condition = props.condition; - this.alternative = props.alternative; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `if` statement", - $propdoc: { - condition: "[AST_Node] the `if` condition", - alternative: "[AST_Statement?] the `else` part, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - if (this.alternative) this.alternative._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.alternative) { - push(this.alternative); - } - push(this.body); - push(this.condition); - } -}, AST_StatementWithBody); - -/* -----[ SWITCH ]----- */ - -var AST_Switch = DEFNODE("Switch", "expression", function AST_Switch(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `switch` statement", - $propdoc: { - expression: "[AST_Node] the `switch` “discriminant”" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - push(this.expression); - } -}, AST_Block); - -var AST_SwitchBranch = DEFNODE("SwitchBranch", null, function AST_SwitchBranch(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for `switch` branches", -}, AST_Block); - -var AST_Default = DEFNODE("Default", null, function AST_Default(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `default` switch branch", -}, AST_SwitchBranch); - -var AST_Case = DEFNODE("Case", "expression", function AST_Case(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `case` switch branch", - $propdoc: { - expression: "[AST_Node] the `case` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - push(this.expression); - }, -}, AST_SwitchBranch); - -/* -----[ EXCEPTIONS ]----- */ - -var AST_Try = DEFNODE("Try", "body bcatch bfinally", function AST_Try(props) { - if (props) { - this.body = props.body; - this.bcatch = props.bcatch; - this.bfinally = props.bfinally; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `try` statement", - $propdoc: { - body: "[AST_TryBlock] the try block", - bcatch: "[AST_Catch?] the catch block, or null if not present", - bfinally: "[AST_Finally?] the finally block, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - if (this.bcatch) this.bcatch._walk(visitor); - if (this.bfinally) this.bfinally._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.bfinally) push(this.bfinally); - if (this.bcatch) push(this.bcatch); - push(this.body); - }, -}, AST_Statement); - -var AST_TryBlock = DEFNODE("TryBlock", null, function AST_TryBlock(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `try` block of a try statement" -}, AST_Block); - -var AST_Catch = DEFNODE("Catch", "argname", function AST_Catch(props) { - if (props) { - this.argname = props.argname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `catch` node; only makes sense as part of a `try` statement", - $propdoc: { - argname: "[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.argname) this.argname._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - if (this.argname) push(this.argname); - }, -}, AST_Block); - -var AST_Finally = DEFNODE("Finally", null, function AST_Finally(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `finally` node; only makes sense as part of a `try` statement" -}, AST_Block); - -/* -----[ VAR/CONST ]----- */ - -var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definitions(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", - $propdoc: { - definitions: "[AST_VarDef*] array of variable definitions" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var definitions = this.definitions; - for (var i = 0, len = definitions.length; i < len; i++) { - definitions[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.definitions.length; - while (i--) push(this.definitions[i]); - }, -}, AST_Statement); - -var AST_Var = DEFNODE("Var", null, function AST_Var(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `var` statement" -}, AST_Definitions); - -var AST_Let = DEFNODE("Let", null, function AST_Let(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `let` statement" -}, AST_Definitions); - -var AST_Const = DEFNODE("Const", null, function AST_Const(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `const` statement" -}, AST_Definitions); - -var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef(props) { - if (props) { - this.name = props.name; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A variable declaration; only appears in a AST_Definitions node", - $propdoc: { - name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable", - value: "[AST_Node?] initializer, or null of there's no initializer" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.name._walk(visitor); - if (this.value) this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value) push(this.value); - push(this.name); - }, - declarations_as_names() { - if (this.name instanceof AST_SymbolDeclaration) { - return [this]; - } else { - return this.name.all_symbols(); - } - } -}); - -var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", function AST_NameMapping(props) { - if (props) { - this.foreign_name = props.foreign_name; - this.name = props.name; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The part of the export/import statement that declare names from a module.", - $propdoc: { - foreign_name: "[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)", - name: "[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module." - }, - _walk: function (visitor) { - return visitor._visit(this, function() { - this.foreign_name._walk(visitor); - this.name._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.name); - push(this.foreign_name); - }, -}); - -var AST_Import = DEFNODE( - "Import", - "imported_name imported_names module_name assert_clause", - function AST_Import(props) { - if (props) { - this.imported_name = props.imported_name; - this.imported_names = props.imported_names; - this.module_name = props.module_name; - this.assert_clause = props.assert_clause; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "An `import` statement", - $propdoc: { - imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.", - imported_names: "[AST_NameMapping*] The names of non-default imported variables", - module_name: "[AST_String] String literal describing where this module came from", - assert_clause: "[AST_Object?] The import assertion" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.imported_name) { - this.imported_name._walk(visitor); - } - if (this.imported_names) { - this.imported_names.forEach(function(name_import) { - name_import._walk(visitor); - }); - } - this.module_name._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.module_name); - if (this.imported_names) { - let i = this.imported_names.length; - while (i--) push(this.imported_names[i]); - } - if (this.imported_name) push(this.imported_name); - }, - } -); - -var AST_ImportMeta = DEFNODE("ImportMeta", null, function AST_ImportMeta(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A reference to import.meta", -}); - -var AST_Export = DEFNODE( - "Export", - "exported_definition exported_value is_default exported_names module_name assert_clause", - function AST_Export(props) { - if (props) { - this.exported_definition = props.exported_definition; - this.exported_value = props.exported_value; - this.is_default = props.is_default; - this.exported_names = props.exported_names; - this.module_name = props.module_name; - this.assert_clause = props.assert_clause; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "An `export` statement", - $propdoc: { - exported_definition: "[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition", - exported_value: "[AST_Node?] An exported value", - exported_names: "[AST_NameMapping*?] List of exported names", - module_name: "[AST_String?] Name of the file to load exports from", - is_default: "[Boolean] Whether this is the default exported value of this module", - assert_clause: "[AST_Object?] The import assertion" - }, - _walk: function (visitor) { - return visitor._visit(this, function () { - if (this.exported_definition) { - this.exported_definition._walk(visitor); - } - if (this.exported_value) { - this.exported_value._walk(visitor); - } - if (this.exported_names) { - this.exported_names.forEach(function(name_export) { - name_export._walk(visitor); - }); - } - if (this.module_name) { - this.module_name._walk(visitor); - } - }); - }, - _children_backwards(push) { - if (this.module_name) push(this.module_name); - if (this.exported_names) { - let i = this.exported_names.length; - while (i--) push(this.exported_names[i]); - } - if (this.exported_value) push(this.exported_value); - if (this.exported_definition) push(this.exported_definition); - } - }, - AST_Statement -); - -/* -----[ OTHER ]----- */ - -var AST_Call = DEFNODE( - "Call", - "expression args optional _annotations", - function AST_Call(props) { - if (props) { - this.expression = props.expression; - this.args = props.args; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; - }, - { - $documentation: "A function call expression", - $propdoc: { - expression: "[AST_Node] expression to invoke as function", - args: "[AST_Node*] array of arguments", - optional: "[boolean] whether this is an optional call (IE ?.() )", - _annotations: "[number] bitfield containing information about the call" - }, - initialize() { - if (this._annotations == null) this._annotations = 0; - }, - _walk(visitor) { - return visitor._visit(this, function() { - var args = this.args; - for (var i = 0, len = args.length; i < len; i++) { - args[i]._walk(visitor); - } - this.expression._walk(visitor); // TODO why do we need to crawl this last? - }); - }, - _children_backwards(push) { - let i = this.args.length; - while (i--) push(this.args[i]); - push(this.expression); - }, - } -); - -var AST_New = DEFNODE("New", null, function AST_New(props) { - if (props) { - this.expression = props.expression; - this.args = props.args; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; -}, { - $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" -}, AST_Call); - -var AST_Sequence = DEFNODE("Sequence", "expressions", function AST_Sequence(props) { - if (props) { - this.expressions = props.expressions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A sequence expression (comma-separated expressions)", - $propdoc: { - expressions: "[AST_Node*] array of expressions (at least two)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expressions.forEach(function(node) { - node._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.expressions.length; - while (i--) push(this.expressions[i]); - }, -}); - -var AST_PropAccess = DEFNODE( - "PropAccess", - "expression property optional", - function AST_PropAccess(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", - $propdoc: { - expression: "[AST_Node] the “container” expression", - property: "[AST_Node|string] the property to access. For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node", - - optional: "[boolean] whether this is an optional property access (IE ?.)" - } - } -); - -var AST_Dot = DEFNODE("Dot", "quote", function AST_Dot(props) { - if (props) { - this.quote = props.quote; - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A dotted property access expression", - $propdoc: { - quote: "[string] the original quote character when transformed from AST_Sub", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}, AST_PropAccess); - -var AST_DotHash = DEFNODE("DotHash", "", function AST_DotHash(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A dotted property access to a private property", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}, AST_PropAccess); - -var AST_Sub = DEFNODE("Sub", null, function AST_Sub(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Index-style property access, i.e. `a[\"foo\"]`", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.property._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.property); - push(this.expression); - }, -}, AST_PropAccess); - -var AST_Chain = DEFNODE("Chain", "expression", function AST_Chain(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A chain expression like a?.b?.(c)?.[d]", - $propdoc: { - expression: "[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element." - }, - _walk: function (visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Unary = DEFNODE("Unary", "operator expression", function AST_Unary(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for unary expressions", - $propdoc: { - operator: "[string] the operator", - expression: "[AST_Node] expression that this unary operator applies to" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, function AST_UnaryPrefix(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" -}, AST_Unary); - -var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, function AST_UnaryPostfix(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Unary postfix expression, i.e. `i++`" -}, AST_Unary); - -var AST_Binary = DEFNODE("Binary", "operator left right", function AST_Binary(props) { - if (props) { - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Binary expression, i.e. `a + b`", - $propdoc: { - left: "[AST_Node] left-hand side expression", - operator: "[string] the operator", - right: "[AST_Node] right-hand side expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.left._walk(visitor); - this.right._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.right); - push(this.left); - }, -}); - -var AST_Conditional = DEFNODE( - "Conditional", - "condition consequent alternative", - function AST_Conditional(props) { - if (props) { - this.condition = props.condition; - this.consequent = props.consequent; - this.alternative = props.alternative; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", - $propdoc: { - condition: "[AST_Node]", - consequent: "[AST_Node]", - alternative: "[AST_Node]" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.consequent._walk(visitor); - this.alternative._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.alternative); - push(this.consequent); - push(this.condition); - }, - } -); - -var AST_Assign = DEFNODE("Assign", "logical", function AST_Assign(props) { - if (props) { - this.logical = props.logical; - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An assignment expression — `a = b + 5`", - $propdoc: { - logical: "Whether it's a logical assignment" - } -}, AST_Binary); - -var AST_DefaultAssign = DEFNODE("DefaultAssign", null, function AST_DefaultAssign(props) { - if (props) { - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A default assignment expression like in `(a = 3) => a`" -}, AST_Binary); - -/* -----[ LITERALS ]----- */ - -var AST_Array = DEFNODE("Array", "elements", function AST_Array(props) { - if (props) { - this.elements = props.elements; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An array literal", - $propdoc: { - elements: "[AST_Node*] array of elements" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var elements = this.elements; - for (var i = 0, len = elements.length; i < len; i++) { - elements[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.elements.length; - while (i--) push(this.elements[i]); - }, -}); - -var AST_Object = DEFNODE("Object", "properties", function AST_Object(props) { - if (props) { - this.properties = props.properties; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An object literal", - $propdoc: { - properties: "[AST_ObjectProperty*] array of properties" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var properties = this.properties; - for (var i = 0, len = properties.length; i < len; i++) { - properties[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.properties.length; - while (i--) push(this.properties[i]); - }, -}); - -var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", function AST_ObjectProperty(props) { - if (props) { - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "Base class for literal object properties", - $propdoc: { - key: "[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.", - value: "[AST_Node] property value. For getters and setters this is an AST_Accessor." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.key instanceof AST_Node) - this.key._walk(visitor); - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.value); - if (this.key instanceof AST_Node) push(this.key); - } -}); - -var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", "quote", function AST_ObjectKeyVal(props) { - if (props) { - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A key: value object property", - $propdoc: { - quote: "[string] the original quote character" - }, - computed_key() { - return this.key instanceof AST_Node; - } -}, AST_ObjectProperty); - -var AST_PrivateSetter = DEFNODE("PrivateSetter", "static", function AST_PrivateSetter(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - static: "[boolean] whether this is a static private setter" - }, - $documentation: "A private setter property", - computed_key() { - return false; - } -}, AST_ObjectProperty); - -var AST_PrivateGetter = DEFNODE("PrivateGetter", "static", function AST_PrivateGetter(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - static: "[boolean] whether this is a static private getter" - }, - $documentation: "A private getter property", - computed_key() { - return false; - } -}, AST_ObjectProperty); - -var AST_ObjectSetter = DEFNODE("ObjectSetter", "quote static", function AST_ObjectSetter(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] whether this is a static setter (classes only)" - }, - $documentation: "An object setter property", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_ObjectGetter = DEFNODE("ObjectGetter", "quote static", function AST_ObjectGetter(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] whether this is a static getter (classes only)" - }, - $documentation: "An object getter property", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_ConciseMethod = DEFNODE( - "ConciseMethod", - "quote static is_generator async", - function AST_ConciseMethod(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.is_generator = props.is_generator; - this.async = props.async; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; - }, - { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] is this method static (classes only)", - is_generator: "[boolean] is this a generator method", - async: "[boolean] is this method async", - }, - $documentation: "An ES6 concise method inside an object or class", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } - }, - AST_ObjectProperty -); - -var AST_PrivateMethod = DEFNODE("PrivateMethod", "", function AST_PrivateMethod(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.is_generator = props.is_generator; - this.async = props.async; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A private class method inside a class", -}, AST_ConciseMethod); - -var AST_Class = DEFNODE("Class", "name extends properties", function AST_Class(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - name: "[AST_SymbolClass|AST_SymbolDefClass?] optional class name.", - extends: "[AST_Node]? optional parent class", - properties: "[AST_ObjectProperty*] array of properties" - }, - $documentation: "An ES6 class", - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) { - this.name._walk(visitor); - } - if (this.extends) { - this.extends._walk(visitor); - } - this.properties.forEach((prop) => prop._walk(visitor)); - }); - }, - _children_backwards(push) { - let i = this.properties.length; - while (i--) push(this.properties[i]); - if (this.extends) push(this.extends); - if (this.name) push(this.name); - }, - /** go through the bits that are executed instantly, not when the class is `new`'d. Doesn't walk the name. */ - visit_nondeferred_class_parts(visitor) { - if (this.extends) { - this.extends._walk(visitor); - } - this.properties.forEach((prop) => { - if (prop instanceof AST_ClassStaticBlock) { - prop._walk(visitor); - return; - } - if (prop.computed_key()) { - visitor.push(prop); - prop.key._walk(visitor); - visitor.pop(); - } - if ((prop instanceof AST_ClassPrivateProperty || prop instanceof AST_ClassProperty) && prop.static && prop.value) { - visitor.push(prop); - prop.value._walk(visitor); - visitor.pop(); - } - }); - }, - /** go through the bits that are executed later, when the class is `new`'d or a static method is called */ - visit_deferred_class_parts(visitor) { - this.properties.forEach((prop) => { - if (prop instanceof AST_ConciseMethod) { - prop.walk(visitor); - } else if (prop instanceof AST_ClassProperty && !prop.static && prop.value) { - visitor.push(prop); - prop.value._walk(visitor); - visitor.pop(); - } - }); - }, -}, AST_Scope /* TODO a class might have a scope but it's not a scope */); - -var AST_ClassProperty = DEFNODE("ClassProperty", "static quote", function AST_ClassProperty(props) { - if (props) { - this.static = props.static; - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A class property", - $propdoc: { - static: "[boolean] whether this is a static key", - quote: "[string] which quote is being used" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.key instanceof AST_Node) - this.key._walk(visitor); - if (this.value instanceof AST_Node) - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value instanceof AST_Node) push(this.value); - if (this.key instanceof AST_Node) push(this.key); - }, - computed_key() { - return !(this.key instanceof AST_SymbolClassProperty); - } -}, AST_ObjectProperty); - -var AST_ClassPrivateProperty = DEFNODE("ClassPrivateProperty", "", function AST_ClassPrivateProperty(props) { - if (props) { - this.static = props.static; - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class property for a private property", -}, AST_ClassProperty); - -var AST_PrivateIn = DEFNODE("PrivateIn", "key value", function AST_PrivateIn(props) { - if (props) { - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An `in` binop when the key is private, eg #x in this", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.key._walk(visitor); - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.value); - push(this.key); - }, -}); - -var AST_DefClass = DEFNODE("DefClass", null, function AST_DefClass(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class definition", -}, AST_Class); - -var AST_ClassStaticBlock = DEFNODE("ClassStaticBlock", "body block_scope", function AST_ClassStaticBlock (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; -}, { - $documentation: "A block containing statements to be executed in the context of the class", - $propdoc: { - body: "[AST_Statement*] an array of statements", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - }, - clone: clone_block_scope, - computed_key: () => false -}, AST_Scope); - -var AST_ClassExpression = DEFNODE("ClassExpression", null, function AST_ClassExpression(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class expression." -}, AST_Class); - -var AST_Symbol = DEFNODE("Symbol", "scope name thedef", function AST_Symbol(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - name: "[string] name of this symbol", - scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", - thedef: "[SymbolDef/S] the definition of this symbol" - }, - $documentation: "Base class for all symbols" -}); - -var AST_NewTarget = DEFNODE("NewTarget", null, function AST_NewTarget(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A reference to new.target" -}); - -var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", function AST_SymbolDeclaration(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", -}, AST_Symbol); - -var AST_SymbolVar = DEFNODE("SymbolVar", null, function AST_SymbolVar(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol defining a variable", -}, AST_SymbolDeclaration); - -var AST_SymbolBlockDeclaration = DEFNODE( - "SymbolBlockDeclaration", - null, - function AST_SymbolBlockDeclaration(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for block-scoped declaration symbols" - }, - AST_SymbolDeclaration -); - -var AST_SymbolConst = DEFNODE("SymbolConst", null, function AST_SymbolConst(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A constant declaration" -}, AST_SymbolBlockDeclaration); - -var AST_SymbolLet = DEFNODE("SymbolLet", null, function AST_SymbolLet(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A block-scoped `let` declaration" -}, AST_SymbolBlockDeclaration); - -var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, function AST_SymbolFunarg(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a function argument", -}, AST_SymbolVar); - -var AST_SymbolDefun = DEFNODE("SymbolDefun", null, function AST_SymbolDefun(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol defining a function", -}, AST_SymbolDeclaration); - -var AST_SymbolMethod = DEFNODE("SymbolMethod", null, function AST_SymbolMethod(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol in an object defining a method", -}, AST_Symbol); - -var AST_SymbolClassProperty = DEFNODE("SymbolClassProperty", null, function AST_SymbolClassProperty(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol for a class property", -}, AST_Symbol); - -var AST_SymbolLambda = DEFNODE("SymbolLambda", null, function AST_SymbolLambda(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a function expression", -}, AST_SymbolDeclaration); - -var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, function AST_SymbolDefClass(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class." -}, AST_SymbolBlockDeclaration); - -var AST_SymbolClass = DEFNODE("SymbolClass", null, function AST_SymbolClass(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a class's name. Lexically scoped to the class." -}, AST_SymbolDeclaration); - -var AST_SymbolCatch = DEFNODE("SymbolCatch", null, function AST_SymbolCatch(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming the exception in catch", -}, AST_SymbolBlockDeclaration); - -var AST_SymbolImport = DEFNODE("SymbolImport", null, function AST_SymbolImport(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol referring to an imported name", -}, AST_SymbolBlockDeclaration); - -var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", null, function AST_SymbolImportForeign(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes", -}, AST_Symbol); - -var AST_Label = DEFNODE("Label", "references", function AST_Label(props) { - if (props) { - this.references = props.references; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a label (declaration)", - $propdoc: { - references: "[AST_LoopControl*] a list of nodes referring to this label" - }, - initialize: function() { - this.references = []; - this.thedef = this; - } -}, AST_Symbol); - -var AST_SymbolRef = DEFNODE("SymbolRef", null, function AST_SymbolRef(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Reference to some symbol (not definition/declaration)", -}, AST_Symbol); - -var AST_SymbolExport = DEFNODE("SymbolExport", null, function AST_SymbolExport(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol referring to a name to export", -}, AST_SymbolRef); - -var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", null, function AST_SymbolExportForeign(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes", -}, AST_Symbol); - -var AST_LabelRef = DEFNODE("LabelRef", null, function AST_LabelRef(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Reference to a label symbol", -}, AST_Symbol); - -var AST_SymbolPrivateProperty = DEFNODE("SymbolPrivateProperty", null, function AST_SymbolPrivateProperty(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol that refers to a private property", -}, AST_Symbol); - -var AST_This = DEFNODE("This", null, function AST_This(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `this` symbol", -}, AST_Symbol); - -var AST_Super = DEFNODE("Super", null, function AST_Super(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `super` symbol", -}, AST_This); - -var AST_Constant = DEFNODE("Constant", null, function AST_Constant(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for all constants", - getValue: function() { - return this.value; - } -}); - -var AST_String = DEFNODE("String", "value quote", function AST_String(props) { - if (props) { - this.value = props.value; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A string literal", - $propdoc: { - value: "[string] the contents of this string", - quote: "[string] the original quote character" - } -}, AST_Constant); - -var AST_Number = DEFNODE("Number", "value raw", function AST_Number(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A number literal", - $propdoc: { - value: "[number] the numeric value", - raw: "[string] numeric value as string" - } -}, AST_Constant); - -var AST_BigInt = DEFNODE("BigInt", "value", function AST_BigInt(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A big int literal", - $propdoc: { - value: "[string] big int value" - } -}, AST_Constant); - -var AST_RegExp = DEFNODE("RegExp", "value", function AST_RegExp(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A regexp literal", - $propdoc: { - value: "[RegExp] the actual regexp", - } -}, AST_Constant); - -var AST_Atom = DEFNODE("Atom", null, function AST_Atom(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for atoms", -}, AST_Constant); - -var AST_Null = DEFNODE("Null", null, function AST_Null(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `null` atom", - value: null -}, AST_Atom); - -var AST_NaN = DEFNODE("NaN", null, function AST_NaN(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The impossible value", - value: 0/0 -}, AST_Atom); - -var AST_Undefined = DEFNODE("Undefined", null, function AST_Undefined(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `undefined` value", - value: (function() {}()) -}, AST_Atom); - -var AST_Hole = DEFNODE("Hole", null, function AST_Hole(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A hole in an array", - value: (function() {}()) -}, AST_Atom); - -var AST_Infinity = DEFNODE("Infinity", null, function AST_Infinity(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `Infinity` value", - value: 1/0 -}, AST_Atom); - -var AST_Boolean = DEFNODE("Boolean", null, function AST_Boolean(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for booleans", -}, AST_Atom); - -var AST_False = DEFNODE("False", null, function AST_False(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `false` atom", - value: false -}, AST_Boolean); - -var AST_True = DEFNODE("True", null, function AST_True(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `true` atom", - value: true -}, AST_Boolean); - -/* -----[ Walk function ]---- */ - -/** - * Walk nodes in depth-first search fashion. - * Callback can return `walk_abort` symbol to stop iteration. - * It can also return `true` to stop iteration just for child nodes. - * Iteration can be stopped and continued by passing the `to_visit` argument, - * which is given to the callback in the second argument. - **/ -function walk(node, cb, to_visit = [node]) { - const push = to_visit.push.bind(to_visit); - while (to_visit.length) { - const node = to_visit.pop(); - const ret = cb(node, to_visit); - - if (ret) { - if (ret === walk_abort) return true; - continue; - } - - node._children_backwards(push); - } - return false; -} - -/** - * Walks an AST node and its children. - * - * {cb} can return `walk_abort` to interrupt the walk. - * - * @param node - * @param cb {(node, info: { parent: (nth) => any }) => (boolean | undefined)} - * - * @returns {boolean} whether the walk was aborted - * - * @example - * const found_some_cond = walk_parent(my_ast_node, (node, { parent }) => { - * if (some_cond(node, parent())) return walk_abort - * }); - */ -function walk_parent(node, cb, initial_stack) { - const to_visit = [node]; - const push = to_visit.push.bind(to_visit); - const stack = initial_stack ? initial_stack.slice() : []; - const parent_pop_indices = []; - - let current; - - const info = { - parent: (n = 0) => { - if (n === -1) { - return current; - } - - // [ p1 p0 ] [ 1 0 ] - if (initial_stack && n >= stack.length) { - n -= stack.length; - return initial_stack[ - initial_stack.length - (n + 1) - ]; - } - - return stack[stack.length - (1 + n)]; - }, - }; - - while (to_visit.length) { - current = to_visit.pop(); - - while ( - parent_pop_indices.length && - to_visit.length == parent_pop_indices[parent_pop_indices.length - 1] - ) { - stack.pop(); - parent_pop_indices.pop(); - } - - const ret = cb(current, info); - - if (ret) { - if (ret === walk_abort) return true; - continue; - } - - const visit_length = to_visit.length; - - current._children_backwards(push); - - // Push only if we're going to traverse the children - if (to_visit.length > visit_length) { - stack.push(current); - parent_pop_indices.push(visit_length - 1); - } - } - - return false; -} - -const walk_abort = Symbol("abort walk"); - -/* -----[ TreeWalker ]----- */ - -class TreeWalker { - constructor(callback) { - this.visit = callback; - this.stack = []; - this.directives = Object.create(null); - } - - _visit(node, descend) { - this.push(node); - var ret = this.visit(node, descend ? function() { - descend.call(node); - } : noop); - if (!ret && descend) { - descend.call(node); - } - this.pop(); - return ret; - } - - parent(n) { - return this.stack[this.stack.length - 2 - (n || 0)]; - } - - push(node) { - if (node instanceof AST_Lambda) { - this.directives = Object.create(this.directives); - } else if (node instanceof AST_Directive && !this.directives[node.value]) { - this.directives[node.value] = node; - } else if (node instanceof AST_Class) { - this.directives = Object.create(this.directives); - if (!this.directives["use strict"]) { - this.directives["use strict"] = node; - } - } - this.stack.push(node); - } - - pop() { - var node = this.stack.pop(); - if (node instanceof AST_Lambda || node instanceof AST_Class) { - this.directives = Object.getPrototypeOf(this.directives); - } - } - - self() { - return this.stack[this.stack.length - 1]; - } - - find_parent(type) { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof type) return x; - } - } - - find_scope() { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - const p = stack[i]; - if (p instanceof AST_Toplevel) return p; - if (p instanceof AST_Lambda) return p; - if (p.block_scope) return p.block_scope; - } - } - - has_directive(type) { - var dir = this.directives[type]; - if (dir) return dir; - var node = this.stack[this.stack.length - 1]; - if (node instanceof AST_Scope && node.body) { - for (var i = 0; i < node.body.length; ++i) { - var st = node.body[i]; - if (!(st instanceof AST_Directive)) break; - if (st.value == type) return st; - } - } - } - - loopcontrol_target(node) { - var stack = this.stack; - if (node.label) for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) - return x.body; - } else for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_IterationStatement - || node instanceof AST_Break && x instanceof AST_Switch) - return x; - } - } -} - -// Tree transformer helpers. -class TreeTransformer extends TreeWalker { - constructor(before, after) { - super(); - this.before = before; - this.after = after; - } -} - -const _PURE = 0b00000001; -const _INLINE = 0b00000010; -const _NOINLINE = 0b00000100; -const _KEY = 0b00001000; -const _MANGLEPROP = 0b00010000; - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -function def_transform(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list) { - let transformed = undefined; - tw.push(this); - if (tw.before) transformed = tw.before(this, descend, in_list); - if (transformed === undefined) { - transformed = this; - descend(transformed, tw); - if (tw.after) { - const after_ret = tw.after(transformed, in_list); - if (after_ret !== undefined) transformed = after_ret; - } - } - tw.pop(); - return transformed; - }); -} - -def_transform(AST_Node, noop); - -def_transform(AST_LabeledStatement, function(self, tw) { - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_SimpleStatement, function(self, tw) { - self.body = self.body.transform(tw); -}); - -def_transform(AST_Block, function(self, tw) { - self.body = MAP(self.body, tw); -}); - -def_transform(AST_Do, function(self, tw) { - self.body = self.body.transform(tw); - self.condition = self.condition.transform(tw); -}); - -def_transform(AST_While, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_For, function(self, tw) { - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_ForIn, function(self, tw) { - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_With, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_Exit, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(AST_LoopControl, function(self, tw) { - if (self.label) self.label = self.label.transform(tw); -}); - -def_transform(AST_If, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); -}); - -def_transform(AST_Switch, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = MAP(self.body, tw); -}); - -def_transform(AST_Case, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = MAP(self.body, tw); -}); - -def_transform(AST_Try, function(self, tw) { - self.body = self.body.transform(tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); -}); - -def_transform(AST_Catch, function(self, tw) { - if (self.argname) self.argname = self.argname.transform(tw); - self.body = MAP(self.body, tw); -}); - -def_transform(AST_Definitions, function(self, tw) { - self.definitions = MAP(self.definitions, tw); -}); - -def_transform(AST_VarDef, function(self, tw) { - self.name = self.name.transform(tw); - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(AST_Destructuring, function(self, tw) { - self.names = MAP(self.names, tw); -}); - -def_transform(AST_Lambda, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - self.argnames = MAP(self.argnames, tw, /* allow_splicing */ false); - if (self.body instanceof AST_Node) { - self.body = self.body.transform(tw); - } else { - self.body = MAP(self.body, tw); - } -}); - -def_transform(AST_Call, function(self, tw) { - self.expression = self.expression.transform(tw); - self.args = MAP(self.args, tw, /* allow_splicing */ false); -}); - -def_transform(AST_Sequence, function(self, tw) { - const result = MAP(self.expressions, tw); - self.expressions = result.length - ? result - : [new AST_Number({ value: 0 })]; -}); - -def_transform(AST_PropAccess, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Sub, function(self, tw) { - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); -}); - -def_transform(AST_Chain, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Yield, function(self, tw) { - if (self.expression) self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Await, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Unary, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Binary, function(self, tw) { - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); -}); - -def_transform(AST_PrivateIn, function(self, tw) { - self.key = self.key.transform(tw); - self.value = self.value.transform(tw); -}); - -def_transform(AST_Conditional, function(self, tw) { - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); -}); - -def_transform(AST_Array, function(self, tw) { - self.elements = MAP(self.elements, tw); -}); - -def_transform(AST_Object, function(self, tw) { - self.properties = MAP(self.properties, tw); -}); - -def_transform(AST_ObjectProperty, function(self, tw) { - if (self.key instanceof AST_Node) { - self.key = self.key.transform(tw); - } - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(AST_Class, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - if (self.extends) self.extends = self.extends.transform(tw); - self.properties = MAP(self.properties, tw); -}); - -def_transform(AST_ClassStaticBlock, function(self, tw) { - self.body = MAP(self.body, tw); -}); - -def_transform(AST_Expansion, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_NameMapping, function(self, tw) { - self.foreign_name = self.foreign_name.transform(tw); - self.name = self.name.transform(tw); -}); - -def_transform(AST_Import, function(self, tw) { - if (self.imported_name) self.imported_name = self.imported_name.transform(tw); - if (self.imported_names) MAP(self.imported_names, tw); - self.module_name = self.module_name.transform(tw); -}); - -def_transform(AST_Export, function(self, tw) { - if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw); - if (self.exported_value) self.exported_value = self.exported_value.transform(tw); - if (self.exported_names) MAP(self.exported_names, tw); - if (self.module_name) self.module_name = self.module_name.transform(tw); -}); - -def_transform(AST_TemplateString, function(self, tw) { - self.segments = MAP(self.segments, tw); -}); - -def_transform(AST_PrefixedTemplateString, function(self, tw) { - self.prefix = self.prefix.transform(tw); - self.template_string = self.template_string.transform(tw); -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -(function() { - - var normalize_directives = function(body) { - for (var i = 0; i < body.length; i++) { - if (body[i] instanceof AST_Statement && body[i].body instanceof AST_String) { - body[i] = new AST_Directive({ - start: body[i].start, - end: body[i].end, - value: body[i].body.value - }); - } else { - return body; - } - } - - return body; - }; - - const assert_clause_from_moz = (assertions) => { - if (assertions && assertions.length > 0) { - return new AST_Object({ - start: my_start_token(assertions), - end: my_end_token(assertions), - properties: assertions.map((assertion_kv) => - new AST_ObjectKeyVal({ - start: my_start_token(assertion_kv), - end: my_end_token(assertion_kv), - key: assertion_kv.key.name || assertion_kv.key.value, - value: from_moz(assertion_kv.value) - }) - ) - }); - } - return null; - }; - - var MOZ_TO_ME = { - Program: function(M) { - return new AST_Toplevel({ - start: my_start_token(M), - end: my_end_token(M), - body: normalize_directives(M.body.map(from_moz)) - }); - }, - - ArrayPattern: function(M) { - return new AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.elements.map(function(elm) { - if (elm === null) { - return new AST_Hole(); - } - return from_moz(elm); - }), - is_array: true - }); - }, - - ObjectPattern: function(M) { - return new AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.properties.map(from_moz), - is_array: false - }); - }, - - AssignmentPattern: function(M) { - return new AST_DefaultAssign({ - start: my_start_token(M), - end: my_end_token(M), - left: from_moz(M.left), - operator: "=", - right: from_moz(M.right) - }); - }, - - SpreadElement: function(M) { - return new AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - RestElement: function(M) { - return new AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - TemplateElement: function(M) { - return new AST_TemplateSegment({ - start: my_start_token(M), - end: my_end_token(M), - value: M.value.cooked, - raw: M.value.raw - }); - }, - - TemplateLiteral: function(M) { - var segments = []; - for (var i = 0; i < M.quasis.length; i++) { - segments.push(from_moz(M.quasis[i])); - if (M.expressions[i]) { - segments.push(from_moz(M.expressions[i])); - } - } - return new AST_TemplateString({ - start: my_start_token(M), - end: my_end_token(M), - segments: segments - }); - }, - - TaggedTemplateExpression: function(M) { - return new AST_PrefixedTemplateString({ - start: my_start_token(M), - end: my_end_token(M), - template_string: from_moz(M.quasi), - prefix: from_moz(M.tag) - }); - }, - - FunctionDeclaration: function(M) { - return new AST_Defun({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: M.params.map(from_moz), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - - FunctionExpression: function(M) { - return new AST_Function({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: M.params.map(from_moz), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - - ArrowFunctionExpression: function(M) { - const body = M.body.type === "BlockStatement" - ? from_moz(M.body).body - : [make_node(AST_Return, {}, { value: from_moz(M.body) })]; - return new AST_Arrow({ - start: my_start_token(M), - end: my_end_token(M), - argnames: M.params.map(from_moz), - body, - async: M.async, - }); - }, - - ExpressionStatement: function(M) { - return new AST_SimpleStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: from_moz(M.expression) - }); - }, - - TryStatement: function(M) { - var handlers = M.handlers || [M.handler]; - if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { - throw new Error("Multiple catch clauses are not supported."); - } - return new AST_Try({ - start : my_start_token(M), - end : my_end_token(M), - body : new AST_TryBlock(from_moz(M.block)), - bcatch : from_moz(handlers[0]), - bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null - }); - }, - - Property: function(M) { - var key = M.key; - var args = { - start : my_start_token(key || M.value), - end : my_end_token(M.value), - key : key.type == "Identifier" ? key.name : key.value, - value : from_moz(M.value) - }; - if (M.computed) { - args.key = from_moz(M.key); - } - if (M.method) { - args.is_generator = M.value.generator; - args.async = M.value.async; - if (!M.computed) { - args.key = new AST_SymbolMethod({ name: args.key }); - } else { - args.key = from_moz(M.key); - } - return new AST_ConciseMethod(args); - } - if (M.kind == "init") { - if (key.type != "Identifier" && key.type != "Literal") { - args.key = from_moz(key); - } - return new AST_ObjectKeyVal(args); - } - if (typeof args.key === "string" || typeof args.key === "number") { - args.key = new AST_SymbolMethod({ - name: args.key - }); - } - args.value = new AST_Accessor(args.value); - if (M.kind == "get") return new AST_ObjectGetter(args); - if (M.kind == "set") return new AST_ObjectSetter(args); - if (M.kind == "method") { - args.async = M.value.async; - args.is_generator = M.value.generator; - args.quote = M.computed ? "\"" : null; - return new AST_ConciseMethod(args); - } - }, - - MethodDefinition: function(M) { - const is_private = M.key.type === "PrivateIdentifier"; - const key = M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }); - - var args = { - start : my_start_token(M), - end : my_end_token(M), - key, - value : from_moz(M.value), - static : M.static, - }; - if (M.kind == "get") { - return new (is_private ? AST_PrivateGetter : AST_ObjectGetter)(args); - } - if (M.kind == "set") { - return new (is_private ? AST_PrivateSetter : AST_ObjectSetter)(args); - } - args.is_generator = M.value.generator; - args.async = M.value.async; - return new (is_private ? AST_PrivateMethod : AST_ConciseMethod)(args); - }, - - FieldDefinition: function(M) { - let key; - if (M.computed) { - key = from_moz(M.key); - } else { - if (M.key.type !== "Identifier") throw new Error("Non-Identifier key in FieldDefinition"); - key = from_moz(M.key); - } - return new AST_ClassProperty({ - start : my_start_token(M), - end : my_end_token(M), - key, - value : from_moz(M.value), - static : M.static, - }); - }, - - PropertyDefinition: function(M) { - let key; - if (M.computed) { - key = from_moz(M.key); - } else if (M.key.type === "PrivateIdentifier") { - return new AST_ClassPrivateProperty({ - start : my_start_token(M), - end : my_end_token(M), - key : from_moz(M.key), - value : from_moz(M.value), - static : M.static, - }); - } else { - if (M.key.type !== "Identifier") { - throw new Error("Non-Identifier key in PropertyDefinition"); - } - key = from_moz(M.key); - } - - return new AST_ClassProperty({ - start : my_start_token(M), - end : my_end_token(M), - key, - value : from_moz(M.value), - static : M.static, - }); - }, - - PrivateIdentifier: function (M) { - return new AST_SymbolPrivateProperty({ - start: my_start_token(M), - end: my_end_token(M), - name: M.name - }); - }, - - StaticBlock: function(M) { - return new AST_ClassStaticBlock({ - start : my_start_token(M), - end : my_end_token(M), - body : M.body.map(from_moz), - }); - }, - - ArrayExpression: function(M) { - return new AST_Array({ - start : my_start_token(M), - end : my_end_token(M), - elements : M.elements.map(function(elem) { - return elem === null ? new AST_Hole() : from_moz(elem); - }) - }); - }, - - ObjectExpression: function(M) { - return new AST_Object({ - start : my_start_token(M), - end : my_end_token(M), - properties : M.properties.map(function(prop) { - if (prop.type === "SpreadElement") { - return from_moz(prop); - } - prop.type = "Property"; - return from_moz(prop); - }) - }); - }, - - SequenceExpression: function(M) { - return new AST_Sequence({ - start : my_start_token(M), - end : my_end_token(M), - expressions: M.expressions.map(from_moz) - }); - }, - - MemberExpression: function(M) { - if (M.property.type === "PrivateIdentifier") { - return new AST_DotHash({ - start : my_start_token(M), - end : my_end_token(M), - property : M.property.name, - expression : from_moz(M.object), - optional : M.optional || false - }); - } - return new (M.computed ? AST_Sub : AST_Dot)({ - start : my_start_token(M), - end : my_end_token(M), - property : M.computed ? from_moz(M.property) : M.property.name, - expression : from_moz(M.object), - optional : M.optional || false - }); - }, - - ChainExpression: function(M) { - return new AST_Chain({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.expression) - }); - }, - - SwitchCase: function(M) { - return new (M.test ? AST_Case : AST_Default)({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.test), - body : M.consequent.map(from_moz) - }); - }, - - VariableDeclaration: function(M) { - return new (M.kind === "const" ? AST_Const : - M.kind === "let" ? AST_Let : AST_Var)({ - start : my_start_token(M), - end : my_end_token(M), - definitions : M.declarations.map(from_moz) - }); - }, - - ImportDeclaration: function(M) { - var imported_name = null; - var imported_names = null; - M.specifiers.forEach(function (specifier) { - if (specifier.type === "ImportSpecifier" || specifier.type === "ImportNamespaceSpecifier") { - if (!imported_names) { imported_names = []; } - imported_names.push(from_moz(specifier)); - } else if (specifier.type === "ImportDefaultSpecifier") { - imported_name = from_moz(specifier); - } - }); - return new AST_Import({ - start : my_start_token(M), - end : my_end_token(M), - imported_name: imported_name, - imported_names : imported_names, - module_name : from_moz(M.source), - assert_clause: assert_clause_from_moz(M.assertions) - }); - }, - - ImportSpecifier: function(M) { - return new AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: from_moz(M.imported), - name: from_moz(M.local) - }); - }, - - ImportDefaultSpecifier: function(M) { - return from_moz(M.local); - }, - - ImportNamespaceSpecifier: function(M) { - return new AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: new AST_SymbolImportForeign({ name: "*" }), - name: from_moz(M.local) - }); - }, - - ExportAllDeclaration: function(M) { - var foreign_name = M.exported == null ? - new AST_SymbolExportForeign({ name: "*" }) : - from_moz(M.exported); - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_names: [ - new AST_NameMapping({ - name: new AST_SymbolExportForeign({ name: "*" }), - foreign_name: foreign_name - }) - ], - module_name: from_moz(M.source), - assert_clause: assert_clause_from_moz(M.assertions) - }); - }, - - ExportNamedDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_definition: from_moz(M.declaration), - exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function (specifier) { - return from_moz(specifier); - }) : null, - module_name: from_moz(M.source), - assert_clause: assert_clause_from_moz(M.assertions) - }); - }, - - ExportDefaultDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_value: from_moz(M.declaration), - is_default: true - }); - }, - - ExportSpecifier: function(M) { - return new AST_NameMapping({ - foreign_name: from_moz(M.exported), - name: from_moz(M.local) - }); - }, - - Literal: function(M) { - var val = M.value, args = { - start : my_start_token(M), - end : my_end_token(M) - }; - var rx = M.regex; - if (rx && rx.pattern) { - // RegExpLiteral as per ESTree AST spec - args.value = { - source: rx.pattern, - flags: rx.flags - }; - return new AST_RegExp(args); - } else if (rx) { - // support legacy RegExp - const rx_source = M.raw || val; - const match = rx_source.match(/^\/(.*)\/(\w*)$/); - if (!match) throw new Error("Invalid regex source " + rx_source); - const [_, source, flags] = match; - args.value = { source, flags }; - return new AST_RegExp(args); - } - if (val === null) return new AST_Null(args); - switch (typeof val) { - case "string": - args.quote = "\""; - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - if (p.type == "ImportSpecifier") { - args.name = val; - return new AST_SymbolImportForeign(args); - } else if (p.type == "ExportSpecifier") { - args.name = val; - if (M == p.exported) { - return new AST_SymbolExportForeign(args); - } else { - return new AST_SymbolExport(args); - } - } else if (p.type == "ExportAllDeclaration" && M == p.exported) { - args.name = val; - return new AST_SymbolExportForeign(args); - } - args.value = val; - return new AST_String(args); - case "number": - args.value = val; - args.raw = M.raw || val.toString(); - return new AST_Number(args); - case "boolean": - return new (val ? AST_True : AST_False)(args); - } - }, - - MetaProperty: function(M) { - if (M.meta.name === "new" && M.property.name === "target") { - return new AST_NewTarget({ - start: my_start_token(M), - end: my_end_token(M) - }); - } else if (M.meta.name === "import" && M.property.name === "meta") { - return new AST_ImportMeta({ - start: my_start_token(M), - end: my_end_token(M) - }); - } - }, - - Identifier: function(M) { - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - return new ( p.type == "LabeledStatement" ? AST_Label - : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : p.kind == "let" ? AST_SymbolLet : AST_SymbolVar) - : /Import.*Specifier/.test(p.type) ? (p.local === M ? AST_SymbolImport : AST_SymbolImportForeign) - : p.type == "ExportSpecifier" ? (p.local === M ? AST_SymbolExport : AST_SymbolExportForeign) - : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg) - : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg) - : p.type == "ArrowFunctionExpression" ? (p.params.includes(M)) ? AST_SymbolFunarg : AST_SymbolRef - : p.type == "ClassExpression" ? (p.id === M ? AST_SymbolClass : AST_SymbolRef) - : p.type == "Property" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod) - : p.type == "PropertyDefinition" || p.type === "FieldDefinition" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolClassProperty) - : p.type == "ClassDeclaration" ? (p.id === M ? AST_SymbolDefClass : AST_SymbolRef) - : p.type == "MethodDefinition" ? (p.computed ? AST_SymbolRef : AST_SymbolMethod) - : p.type == "CatchClause" ? AST_SymbolCatch - : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef - : AST_SymbolRef)({ - start : my_start_token(M), - end : my_end_token(M), - name : M.name - }); - }, - - BigIntLiteral(M) { - return new AST_BigInt({ - start : my_start_token(M), - end : my_end_token(M), - value : M.value - }); - }, - - EmptyStatement: function(M) { - return new AST_EmptyStatement({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - BlockStatement: function(M) { - return new AST_BlockStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: M.body.map(from_moz) - }); - }, - - IfStatement: function(M) { - return new AST_If({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.consequent), - alternative: from_moz(M.alternate) - }); - }, - - LabeledStatement: function(M) { - return new AST_LabeledStatement({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz(M.label), - body: from_moz(M.body) - }); - }, - - BreakStatement: function(M) { - return new AST_Break({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz(M.label) - }); - }, - - ContinueStatement: function(M) { - return new AST_Continue({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz(M.label) - }); - }, - - WithStatement: function(M) { - return new AST_With({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.object), - body: from_moz(M.body) - }); - }, - - SwitchStatement: function(M) { - return new AST_Switch({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.discriminant), - body: M.cases.map(from_moz) - }); - }, - - ReturnStatement: function(M) { - return new AST_Return({ - start: my_start_token(M), - end: my_end_token(M), - value: from_moz(M.argument) - }); - }, - - ThrowStatement: function(M) { - return new AST_Throw({ - start: my_start_token(M), - end: my_end_token(M), - value: from_moz(M.argument) - }); - }, - - WhileStatement: function(M) { - return new AST_While({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.body) - }); - }, - - DoWhileStatement: function(M) { - return new AST_Do({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.body) - }); - }, - - ForStatement: function(M) { - return new AST_For({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.init), - condition: from_moz(M.test), - step: from_moz(M.update), - body: from_moz(M.body) - }); - }, - - ForInStatement: function(M) { - return new AST_ForIn({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body) - }); - }, - - ForOfStatement: function(M) { - return new AST_ForOf({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body), - await: M.await - }); - }, - - AwaitExpression: function(M) { - return new AST_Await({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - YieldExpression: function(M) { - return new AST_Yield({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument), - is_star: M.delegate - }); - }, - - DebuggerStatement: function(M) { - return new AST_Debugger({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - VariableDeclarator: function(M) { - return new AST_VarDef({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - value: from_moz(M.init) - }); - }, - - CatchClause: function(M) { - return new AST_Catch({ - start: my_start_token(M), - end: my_end_token(M), - argname: from_moz(M.param), - body: from_moz(M.body).body - }); - }, - - ThisExpression: function(M) { - return new AST_This({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - Super: function(M) { - return new AST_Super({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - BinaryExpression: function(M) { - if (M.left.type === "PrivateIdentifier") { - return new AST_PrivateIn({ - start: my_start_token(M), - end: my_end_token(M), - key: new AST_SymbolPrivateProperty({ - start: my_start_token(M.left), - end: my_end_token(M.left), - name: M.left.name - }), - value: from_moz(M.right), - }); - } - return new AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - LogicalExpression: function(M) { - return new AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - AssignmentExpression: function(M) { - return new AST_Assign({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - ConditionalExpression: function(M) { - return new AST_Conditional({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - consequent: from_moz(M.consequent), - alternative: from_moz(M.alternate) - }); - }, - - NewExpression: function(M) { - return new AST_New({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.callee), - args: M.arguments.map(from_moz) - }); - }, - - CallExpression: function(M) { - return new AST_Call({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.callee), - optional: M.optional, - args: M.arguments.map(from_moz) - }); - } - }; - - MOZ_TO_ME.UpdateExpression = - MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix - : M.type == "UnaryExpression" ? true : false; - return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ - start : my_start_token(M), - end : my_end_token(M), - operator : M.operator, - expression : from_moz(M.argument) - }); - }; - - MOZ_TO_ME.ClassDeclaration = - MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) { - return new (M.type === "ClassDeclaration" ? AST_DefClass : AST_ClassExpression)({ - start : my_start_token(M), - end : my_end_token(M), - name : from_moz(M.id), - extends : from_moz(M.superClass), - properties: M.body.body.map(from_moz) - }); - }; - - def_to_moz(AST_EmptyStatement, function To_Moz_EmptyStatement() { - return { - type: "EmptyStatement" - }; - }); - def_to_moz(AST_BlockStatement, function To_Moz_BlockStatement(M) { - return { - type: "BlockStatement", - body: M.body.map(to_moz) - }; - }); - def_to_moz(AST_If, function To_Moz_IfStatement(M) { - return { - type: "IfStatement", - test: to_moz(M.condition), - consequent: to_moz(M.body), - alternate: to_moz(M.alternative) - }; - }); - def_to_moz(AST_LabeledStatement, function To_Moz_LabeledStatement(M) { - return { - type: "LabeledStatement", - label: to_moz(M.label), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_Break, function To_Moz_BreakStatement(M) { - return { - type: "BreakStatement", - label: to_moz(M.label) - }; - }); - def_to_moz(AST_Continue, function To_Moz_ContinueStatement(M) { - return { - type: "ContinueStatement", - label: to_moz(M.label) - }; - }); - def_to_moz(AST_With, function To_Moz_WithStatement(M) { - return { - type: "WithStatement", - object: to_moz(M.expression), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_Switch, function To_Moz_SwitchStatement(M) { - return { - type: "SwitchStatement", - discriminant: to_moz(M.expression), - cases: M.body.map(to_moz) - }; - }); - def_to_moz(AST_Return, function To_Moz_ReturnStatement(M) { - return { - type: "ReturnStatement", - argument: to_moz(M.value) - }; - }); - def_to_moz(AST_Throw, function To_Moz_ThrowStatement(M) { - return { - type: "ThrowStatement", - argument: to_moz(M.value) - }; - }); - def_to_moz(AST_While, function To_Moz_WhileStatement(M) { - return { - type: "WhileStatement", - test: to_moz(M.condition), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_Do, function To_Moz_DoWhileStatement(M) { - return { - type: "DoWhileStatement", - test: to_moz(M.condition), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_For, function To_Moz_ForStatement(M) { - return { - type: "ForStatement", - init: to_moz(M.init), - test: to_moz(M.condition), - update: to_moz(M.step), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_ForIn, function To_Moz_ForInStatement(M) { - return { - type: "ForInStatement", - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_ForOf, function To_Moz_ForOfStatement(M) { - return { - type: "ForOfStatement", - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body), - await: M.await - }; - }); - def_to_moz(AST_Await, function To_Moz_AwaitExpression(M) { - return { - type: "AwaitExpression", - argument: to_moz(M.expression) - }; - }); - def_to_moz(AST_Yield, function To_Moz_YieldExpression(M) { - return { - type: "YieldExpression", - argument: to_moz(M.expression), - delegate: M.is_star - }; - }); - def_to_moz(AST_Debugger, function To_Moz_DebuggerStatement() { - return { - type: "DebuggerStatement" - }; - }); - def_to_moz(AST_VarDef, function To_Moz_VariableDeclarator(M) { - return { - type: "VariableDeclarator", - id: to_moz(M.name), - init: to_moz(M.value) - }; - }); - def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: to_moz(M.argname), - body: to_moz_block(M) - }; - }); - - def_to_moz(AST_This, function To_Moz_ThisExpression() { - return { - type: "ThisExpression" - }; - }); - def_to_moz(AST_Super, function To_Moz_Super() { - return { - type: "Super" - }; - }); - def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { - return { - type: "BinaryExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - def_to_moz(AST_Binary, function To_Moz_LogicalExpression(M) { - return { - type: "LogicalExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - def_to_moz(AST_Assign, function To_Moz_AssignmentExpression(M) { - return { - type: "AssignmentExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - def_to_moz(AST_Conditional, function To_Moz_ConditionalExpression(M) { - return { - type: "ConditionalExpression", - test: to_moz(M.condition), - consequent: to_moz(M.consequent), - alternate: to_moz(M.alternative) - }; - }); - def_to_moz(AST_New, function To_Moz_NewExpression(M) { - return { - type: "NewExpression", - callee: to_moz(M.expression), - arguments: M.args.map(to_moz) - }; - }); - def_to_moz(AST_Call, function To_Moz_CallExpression(M) { - return { - type: "CallExpression", - callee: to_moz(M.expression), - optional: M.optional, - arguments: M.args.map(to_moz) - }; - }); - - def_to_moz(AST_Toplevel, function To_Moz_Program(M) { - return to_moz_scope("Program", M); - }); - - def_to_moz(AST_Expansion, function To_Moz_Spread(M) { - return { - type: to_moz_in_destructuring() ? "RestElement" : "SpreadElement", - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) { - return { - type: "TaggedTemplateExpression", - tag: to_moz(M.prefix), - quasi: to_moz(M.template_string) - }; - }); - - def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) { - var quasis = []; - var expressions = []; - for (var i = 0; i < M.segments.length; i++) { - if (i % 2 !== 0) { - expressions.push(to_moz(M.segments[i])); - } else { - quasis.push({ - type: "TemplateElement", - value: { - raw: M.segments[i].raw, - cooked: M.segments[i].value - }, - tail: i === M.segments.length - 1 - }); - } - } - return { - type: "TemplateLiteral", - quasis: quasis, - expressions: expressions - }; - }); - - def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) { - return { - type: "FunctionDeclaration", - id: to_moz(M.name), - params: M.argnames.map(to_moz), - generator: M.is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) { - var is_generator = parent.is_generator !== undefined ? - parent.is_generator : M.is_generator; - return { - type: "FunctionExpression", - id: to_moz(M.name), - params: M.argnames.map(to_moz), - generator: is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) { - var body = { - type: "BlockStatement", - body: M.body.map(to_moz) - }; - return { - type: "ArrowFunctionExpression", - params: M.argnames.map(to_moz), - async: M.async, - body: body - }; - }); - - def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) { - if (M.is_array) { - return { - type: "ArrayPattern", - elements: M.names.map(to_moz) - }; - } - return { - type: "ObjectPattern", - properties: M.names.map(to_moz) - }; - }); - - def_to_moz(AST_Directive, function To_Moz_Directive(M) { - return { - type: "ExpressionStatement", - expression: { - type: "Literal", - value: M.value, - raw: M.print_to_string() - }, - directive: M.value - }; - }); - - def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) { - return { - type: "ExpressionStatement", - expression: to_moz(M.body) - }; - }); - - def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) { - return { - type: "SwitchCase", - test: to_moz(M.expression), - consequent: M.body.map(to_moz) - }; - }); - - def_to_moz(AST_Try, function To_Moz_TryStatement(M) { - return { - type: "TryStatement", - block: to_moz_block(M.body), - handler: to_moz(M.bcatch), - guardedHandlers: [], - finalizer: to_moz(M.bfinally) - }; - }); - - def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: to_moz(M.argname), - guard: null, - body: to_moz_block(M) - }; - }); - - def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) { - return { - type: "VariableDeclaration", - kind: - M instanceof AST_Const ? "const" : - M instanceof AST_Let ? "let" : "var", - declarations: M.definitions.map(to_moz) - }; - }); - - const assert_clause_to_moz = assert_clause => { - const assertions = []; - if (assert_clause) { - for (const { key, value } of assert_clause.properties) { - const key_moz = is_basic_identifier_string(key) - ? { type: "Identifier", name: key } - : { type: "Literal", value: key, raw: JSON.stringify(key) }; - assertions.push({ - type: "ImportAttribute", - key: key_moz, - value: to_moz(value) - }); - } - } - return assertions; - }; - - def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) { - if (M.exported_names) { - var first_exported = M.exported_names[0]; - var first_exported_name = first_exported.name; - if (first_exported_name.name === "*" && !first_exported_name.quote) { - var foreign_name = first_exported.foreign_name; - var exported = foreign_name.name === "*" && !foreign_name.quote - ? null - : to_moz(foreign_name); - return { - type: "ExportAllDeclaration", - source: to_moz(M.module_name), - exported: exported, - assertions: assert_clause_to_moz(M.assert_clause) - }; - } - return { - type: "ExportNamedDeclaration", - specifiers: M.exported_names.map(function (name_mapping) { - return { - type: "ExportSpecifier", - exported: to_moz(name_mapping.foreign_name), - local: to_moz(name_mapping.name) - }; - }), - declaration: to_moz(M.exported_definition), - source: to_moz(M.module_name), - assertions: assert_clause_to_moz(M.assert_clause) - }; - } - return { - type: M.is_default ? "ExportDefaultDeclaration" : "ExportNamedDeclaration", - declaration: to_moz(M.exported_value || M.exported_definition) - }; - }); - - def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) { - var specifiers = []; - if (M.imported_name) { - specifiers.push({ - type: "ImportDefaultSpecifier", - local: to_moz(M.imported_name) - }); - } - if (M.imported_names) { - var first_imported_foreign_name = M.imported_names[0].foreign_name; - if (first_imported_foreign_name.name === "*" && !first_imported_foreign_name.quote) { - specifiers.push({ - type: "ImportNamespaceSpecifier", - local: to_moz(M.imported_names[0].name) - }); - } else { - M.imported_names.forEach(function(name_mapping) { - specifiers.push({ - type: "ImportSpecifier", - local: to_moz(name_mapping.name), - imported: to_moz(name_mapping.foreign_name) - }); - }); - } - } - return { - type: "ImportDeclaration", - specifiers: specifiers, - source: to_moz(M.module_name), - assertions: assert_clause_to_moz(M.assert_clause) - }; - }); - - def_to_moz(AST_ImportMeta, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "import" - }, - property: { - type: "Identifier", - name: "meta" - } - }; - }); - - def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) { - return { - type: "SequenceExpression", - expressions: M.expressions.map(to_moz) - }; - }); - - def_to_moz(AST_DotHash, function To_Moz_PrivateMemberExpression(M) { - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: false, - property: { - type: "PrivateIdentifier", - name: M.property - }, - optional: M.optional - }; - }); - - def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) { - var isComputed = M instanceof AST_Sub; - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: isComputed, - property: isComputed ? to_moz(M.property) : {type: "Identifier", name: M.property}, - optional: M.optional - }; - }); - - def_to_moz(AST_Chain, function To_Moz_ChainExpression(M) { - return { - type: "ChainExpression", - expression: to_moz(M.expression) - }; - }); - - def_to_moz(AST_Unary, function To_Moz_Unary(M) { - return { - type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", - operator: M.operator, - prefix: M instanceof AST_UnaryPrefix, - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { - if (M.operator == "=" && to_moz_in_destructuring()) { - return { - type: "AssignmentPattern", - left: to_moz(M.left), - right: to_moz(M.right) - }; - } - - const type = M.operator == "&&" || M.operator == "||" || M.operator === "??" - ? "LogicalExpression" - : "BinaryExpression"; - - return { - type, - left: to_moz(M.left), - operator: M.operator, - right: to_moz(M.right) - }; - }); - - def_to_moz(AST_PrivateIn, function To_Moz_BinaryExpression_PrivateIn(M) { - return { - type: "BinaryExpression", - left: { type: "PrivateIdentifier", name: M.key.name }, - operator: "in", - right: to_moz(M.value), - }; - }); - - def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { - return { - type: "ArrayExpression", - elements: M.elements.map(to_moz) - }; - }); - - def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) { - return { - type: "ObjectExpression", - properties: M.properties.map(to_moz) - }; - }); - - def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) { - var key = M.key instanceof AST_Node ? to_moz(M.key) : { - type: "Identifier", - value: M.key - }; - if (typeof M.key === "number") { - key = { - type: "Literal", - value: Number(M.key) - }; - } - if (typeof M.key === "string") { - key = { - type: "Identifier", - name: M.key - }; - } - var kind; - var string_or_num = typeof M.key === "string" || typeof M.key === "number"; - var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef; - if (M instanceof AST_ObjectKeyVal) { - kind = "init"; - computed = !string_or_num; - } else - if (M instanceof AST_ObjectGetter) { - kind = "get"; - } else - if (M instanceof AST_ObjectSetter) { - kind = "set"; - } - if (M instanceof AST_PrivateGetter || M instanceof AST_PrivateSetter) { - const kind = M instanceof AST_PrivateGetter ? "get" : "set"; - return { - type: "MethodDefinition", - computed: false, - kind: kind, - static: M.static, - key: { - type: "PrivateIdentifier", - name: M.key.name - }, - value: to_moz(M.value) - }; - } - if (M instanceof AST_ClassPrivateProperty) { - return { - type: "PropertyDefinition", - key: { - type: "PrivateIdentifier", - name: M.key.name - }, - value: to_moz(M.value), - computed: false, - static: M.static - }; - } - if (M instanceof AST_ClassProperty) { - return { - type: "PropertyDefinition", - key, - value: to_moz(M.value), - computed, - static: M.static - }; - } - if (parent instanceof AST_Class) { - return { - type: "MethodDefinition", - computed: computed, - kind: kind, - static: M.static, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - return { - type: "Property", - computed: computed, - kind: kind, - key: key, - value: to_moz(M.value) - }; - }); - - def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) { - if (parent instanceof AST_Object) { - return { - type: "Property", - computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, - kind: "init", - method: true, - shorthand: false, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - - const key = M instanceof AST_PrivateMethod - ? { - type: "PrivateIdentifier", - name: M.key.name - } - : to_moz(M.key); - - return { - type: "MethodDefinition", - kind: M.key === "constructor" ? "constructor" : "method", - key, - value: to_moz(M.value), - computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, - static: M.static, - }; - }); - - def_to_moz(AST_Class, function To_Moz_Class(M) { - var type = M instanceof AST_ClassExpression ? "ClassExpression" : "ClassDeclaration"; - return { - type: type, - superClass: to_moz(M.extends), - id: M.name ? to_moz(M.name) : null, - body: { - type: "ClassBody", - body: M.properties.map(to_moz) - } - }; - }); - - def_to_moz(AST_ClassStaticBlock, function To_Moz_StaticBlock(M) { - return { - type: "StaticBlock", - body: M.body.map(to_moz), - }; - }); - - def_to_moz(AST_NewTarget, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "new" - }, - property: { - type: "Identifier", - name: "target" - } - }; - }); - - def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) { - if ( - (M instanceof AST_SymbolMethod && parent.quote) || - (( - M instanceof AST_SymbolImportForeign || - M instanceof AST_SymbolExportForeign || - M instanceof AST_SymbolExport - ) && M.quote) - ) { - return { - type: "Literal", - value: M.name - }; - } - var def = M.definition(); - return { - type: "Identifier", - name: def ? def.mangled_name || def.name : M.name - }; - }); - - def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) { - const pattern = M.value.source; - const flags = M.value.flags; - return { - type: "Literal", - value: null, - raw: M.print_to_string(), - regex: { pattern, flags } - }; - }); - - def_to_moz(AST_Constant, function To_Moz_Literal(M) { - var value = M.value; - return { - type: "Literal", - value: value, - raw: M.raw || M.print_to_string() - }; - }); - - def_to_moz(AST_Atom, function To_Moz_Atom(M) { - return { - type: "Identifier", - name: String(M.value) - }; - }); - - def_to_moz(AST_BigInt, M => ({ - type: "BigIntLiteral", - value: M.value - })); - - AST_Boolean.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); - AST_Null.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); - AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null; }); - - AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast); - AST_Lambda.DEFMETHOD("to_mozilla_ast", AST_Function.prototype.to_mozilla_ast); - - /* -----[ tools ]----- */ - - function my_start_token(moznode) { - var loc = moznode.loc, start = loc && loc.start; - var range = moznode.range; - return new AST_Token( - "", - "", - start && start.line || 0, - start && start.column || 0, - range ? range [0] : moznode.start, - false, - [], - [], - loc && loc.source, - ); - } - - function my_end_token(moznode) { - var loc = moznode.loc, end = loc && loc.end; - var range = moznode.range; - return new AST_Token( - "", - "", - end && end.line || 0, - end && end.column || 0, - range ? range [0] : moznode.end, - false, - [], - [], - loc && loc.source, - ); - } - - var FROM_MOZ_STACK = null; - - function from_moz(node) { - FROM_MOZ_STACK.push(node); - var ret = node != null ? MOZ_TO_ME[node.type](node) : null; - FROM_MOZ_STACK.pop(); - return ret; - } - - AST_Node.from_mozilla_ast = function(node) { - var save_stack = FROM_MOZ_STACK; - FROM_MOZ_STACK = []; - var ast = from_moz(node); - FROM_MOZ_STACK = save_stack; - return ast; - }; - - function set_moz_loc(mynode, moznode) { - var start = mynode.start; - var end = mynode.end; - if (!(start && end)) { - return moznode; - } - if (start.pos != null && end.endpos != null) { - moznode.range = [start.pos, end.endpos]; - } - if (start.line) { - moznode.loc = { - start: {line: start.line, column: start.col}, - end: end.endline ? {line: end.endline, column: end.endcol} : null - }; - if (start.file) { - moznode.loc.source = start.file; - } - } - return moznode; - } - - function def_to_moz(mytype, handler) { - mytype.DEFMETHOD("to_mozilla_ast", function(parent) { - return set_moz_loc(this, handler(this, parent)); - }); - } - - var TO_MOZ_STACK = null; - - function to_moz(node) { - if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; } - TO_MOZ_STACK.push(node); - var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null; - TO_MOZ_STACK.pop(); - if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; } - return ast; - } - - function to_moz_in_destructuring() { - var i = TO_MOZ_STACK.length; - while (i--) { - if (TO_MOZ_STACK[i] instanceof AST_Destructuring) { - return true; - } - } - return false; - } - - function to_moz_block(node) { - return { - type: "BlockStatement", - body: node.body.map(to_moz) - }; - } - - function to_moz_scope(type, node) { - var body = node.body.map(to_moz); - if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) { - body.unshift(to_moz(new AST_EmptyStatement(node.body[0]))); - } - return { - type: type, - body: body - }; - } -})(); - -// return true if the node at the top of the stack (that means the -// innermost node in the current output) is lexically the first in -// a statement. -function first_in_statement(stack) { - let node = stack.parent(-1); - for (let i = 0, p; p = stack.parent(i); i++) { - if (p instanceof AST_Statement && p.body === node) - return true; - if ((p instanceof AST_Sequence && p.expressions[0] === node) || - (p.TYPE === "Call" && p.expression === node) || - (p instanceof AST_PrefixedTemplateString && p.prefix === node) || - (p instanceof AST_Dot && p.expression === node) || - (p instanceof AST_Sub && p.expression === node) || - (p instanceof AST_Chain && p.expression === node) || - (p instanceof AST_Conditional && p.condition === node) || - (p instanceof AST_Binary && p.left === node) || - (p instanceof AST_UnaryPostfix && p.expression === node) - ) { - node = p; - } else { - return false; - } - } -} - -// Returns whether the leftmost item in the expression is an object -function left_is_object(node) { - if (node instanceof AST_Object) return true; - if (node instanceof AST_Sequence) return left_is_object(node.expressions[0]); - if (node.TYPE === "Call") return left_is_object(node.expression); - if (node instanceof AST_PrefixedTemplateString) return left_is_object(node.prefix); - if (node instanceof AST_Dot || node instanceof AST_Sub) return left_is_object(node.expression); - if (node instanceof AST_Chain) return left_is_object(node.expression); - if (node instanceof AST_Conditional) return left_is_object(node.condition); - if (node instanceof AST_Binary) return left_is_object(node.left); - if (node instanceof AST_UnaryPostfix) return left_is_object(node.expression); - return false; -} - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -const CODE_LINE_BREAK = 10; -const CODE_SPACE = 32; - -const r_annotation = /[@#]__(PURE|INLINE|NOINLINE)__/; - -function is_some_comments(comment) { - // multiline comment - return ( - (comment.type === "comment2" || comment.type === "comment1") - && /@preserve|@copyright|@lic|@cc_on|^\**!/i.test(comment.value) - ); -} - -const ROPE_COMMIT_WHEN = 8 * 1000; -class Rope { - constructor() { - this.committed = ""; - this.current = ""; - } - - append(str) { - /** When `this.current` is too long, commit it. */ - if (this.current.length > ROPE_COMMIT_WHEN) { - this.committed += this.current + str; - this.current = ""; - } else { - this.current += str; - } - } - - insertAt(char, index) { - const { committed, current } = this; - if (index < committed.length) { - this.committed = committed.slice(0, index) + char + committed.slice(index); - } else if (index === committed.length) { - this.committed += char; - } else { - index -= committed.length; - this.committed += current.slice(0, index) + char; - this.current = current.slice(index); - } - } - - charAt(index) { - const { committed } = this; - if (index < committed.length) return committed[index]; - return this.current[index - committed.length]; - } - - charCodeAt(index) { - const { committed } = this; - if (index < committed.length) return committed.charCodeAt(index); - return this.current.charCodeAt(index - committed.length); - } - - length() { - return this.committed.length + this.current.length; - } - - expectDirective() { - // /^$|[;{][\s\n]*$/ - - let ch, n = this.length(); - - if (n <= 0) return true; - - // Skip N whitespace from the end - while ( - (ch = this.charCodeAt(--n)) - && (ch == CODE_SPACE || ch == CODE_LINE_BREAK) - ); - - // either ";", or "{", or the string ended - return !ch || ch === 59 || ch === 123; - } - - hasNLB() { - let n = this.length() - 1; - while (n >= 0) { - const code = this.charCodeAt(n--); - - if (code === CODE_LINE_BREAK) return true; - if (code !== CODE_SPACE) return false; - } - return true; - } - - - toString() { - return this.committed + this.current; - } -} - -function OutputStream(options) { - - var readonly = !options; - options = defaults(options, { - ascii_only : false, - beautify : false, - braces : false, - comments : "some", - ecma : 5, - ie8 : false, - indent_level : 4, - indent_start : 0, - inline_script : true, - keep_numbers : false, - keep_quoted_props : false, - max_line_len : false, - preamble : null, - preserve_annotations : false, - quote_keys : false, - quote_style : 0, - safari10 : false, - semicolons : true, - shebang : true, - shorthand : undefined, - source_map : null, - webkit : false, - width : 80, - wrap_iife : false, - wrap_func_args : true, - - _destroy_ast : false - }, true); - - if (options.shorthand === undefined) - options.shorthand = options.ecma > 5; - - // Convert comment option to RegExp if necessary and set up comments filter - var comment_filter = return_false; // Default case, throw all comments away - if (options.comments) { - let comments = options.comments; - if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { - var regex_pos = options.comments.lastIndexOf("/"); - comments = new RegExp( - options.comments.substr(1, regex_pos - 1), - options.comments.substr(regex_pos + 1) - ); - } - if (comments instanceof RegExp) { - comment_filter = function(comment) { - return comment.type != "comment5" && comments.test(comment.value); - }; - } else if (typeof comments === "function") { - comment_filter = function(comment) { - return comment.type != "comment5" && comments(this, comment); - }; - } else if (comments === "some") { - comment_filter = is_some_comments; - } else { // NOTE includes "all" option - comment_filter = return_true; - } - } - - if (options.preserve_annotations) { - let prev_comment_filter = comment_filter; - comment_filter = function (comment) { - return r_annotation.test(comment.value) || prev_comment_filter.apply(this, arguments); - }; - } - - var indentation = 0; - var current_col = 0; - var current_line = 1; - var current_pos = 0; - var OUTPUT = new Rope(); - let printed_comments = new Set(); - - var to_utf8 = options.ascii_only ? function(str, identifier = false, regexp = false) { - if (options.ecma >= 2015 && !options.safari10 && !regexp) { - str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { - var code = get_full_char_code(ch, 0).toString(16); - return "\\u{" + code + "}"; - }); - } - return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - } : function(str) { - return str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) { - if (lone) { - return "\\u" + lone.charCodeAt(0).toString(16); - } - return match; - }); - }; - - function make_string(str, quote) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, - function(s, i) { - switch (s) { - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\\": return "\\\\"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\x0B": return options.ie8 ? "\\x0B" : "\\v"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case "\ufeff": return "\\ufeff"; - case "\0": - return /[0-9]/.test(get_full_char(str, i+1)) ? "\\x00" : "\\0"; - } - return s; - }); - function quote_single() { - return "'" + str.replace(/\x27/g, "\\'") + "'"; - } - function quote_double() { - return '"' + str.replace(/\x22/g, '\\"') + '"'; - } - function quote_template() { - return "`" + str.replace(/`/g, "\\`") + "`"; - } - str = to_utf8(str); - if (quote === "`") return quote_template(); - switch (options.quote_style) { - case 1: - return quote_single(); - case 2: - return quote_double(); - case 3: - return quote == "'" ? quote_single() : quote_double(); - default: - return dq > sq ? quote_single() : quote_double(); - } - } - - function encode_string(str, quote) { - var ret = make_string(str, quote); - if (options.inline_script) { - ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); - ret = ret.replace(/\x3c!--/g, "\\x3c!--"); - ret = ret.replace(/--\x3e/g, "--\\x3e"); - } - return ret; - } - - function make_name(name) { - name = name.toString(); - name = to_utf8(name, true); - return name; - } - - function make_indent(back) { - return " ".repeat(options.indent_start + indentation - back * options.indent_level); - } - - /* -----[ beautification/minification ]----- */ - - var has_parens = false; - var might_need_space = false; - var might_need_semicolon = false; - var might_add_newline = 0; - var need_newline_indented = false; - var need_space = false; - var newline_insert = -1; - var last = ""; - var mapping_token, mapping_name, mappings = options.source_map && []; - - var do_add_mapping = mappings ? function() { - mappings.forEach(function(mapping) { - try { - let { name, token } = mapping; - if (name !== false) { - if (token.type == "name" || token.type === "privatename") { - name = token.value; - } else if (name instanceof AST_Symbol) { - name = token.type === "string" ? token.value : name.name; - } - } - options.source_map.add( - mapping.token.file, - mapping.line, mapping.col, - mapping.token.line, mapping.token.col, - is_basic_identifier_string(name) ? name : undefined - ); - } catch(ex) { - // Ignore bad mapping - } - }); - mappings = []; - } : noop; - - var ensure_line_len = options.max_line_len ? function() { - if (current_col > options.max_line_len) { - if (might_add_newline) { - OUTPUT.insertAt("\n", might_add_newline); - const len_after_newline = OUTPUT.length() - might_add_newline - 1; - if (mappings) { - var delta = len_after_newline - current_col; - mappings.forEach(function(mapping) { - mapping.line++; - mapping.col += delta; - }); - } - current_line++; - current_pos++; - current_col = len_after_newline; - } - } - if (might_add_newline) { - might_add_newline = 0; - do_add_mapping(); - } - } : noop; - - var requireSemicolonChars = makePredicate("( [ + * / - , . `"); - - function print(str) { - str = String(str); - var ch = get_full_char(str, 0); - if (need_newline_indented && ch) { - need_newline_indented = false; - if (ch !== "\n") { - print("\n"); - indent(); - } - } - if (need_space && ch) { - need_space = false; - if (!/[\s;})]/.test(ch)) { - space(); - } - } - newline_insert = -1; - var prev = last.charAt(last.length - 1); - if (might_need_semicolon) { - might_need_semicolon = false; - - if (prev === ":" && ch === "}" || (!ch || !";}".includes(ch)) && prev !== ";") { - if (options.semicolons || requireSemicolonChars.has(ch)) { - OUTPUT.append(";"); - current_col++; - current_pos++; - } else { - ensure_line_len(); - if (current_col > 0) { - OUTPUT.append("\n"); - current_pos++; - current_line++; - current_col = 0; - } - - if (/^\s+$/.test(str)) { - // reset the semicolon flag, since we didn't print one - // now and might still have to later - might_need_semicolon = true; - } - } - - if (!options.beautify) - might_need_space = false; - } - } - - if (might_need_space) { - if ((is_identifier_char(prev) - && (is_identifier_char(ch) || ch == "\\")) - || (ch == "/" && ch == prev) - || ((ch == "+" || ch == "-") && ch == last) - ) { - OUTPUT.append(" "); - current_col++; - current_pos++; - } - might_need_space = false; - } - - if (mapping_token) { - mappings.push({ - token: mapping_token, - name: mapping_name, - line: current_line, - col: current_col - }); - mapping_token = false; - if (!might_add_newline) do_add_mapping(); - } - - OUTPUT.append(str); - has_parens = str[str.length - 1] == "("; - current_pos += str.length; - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - current_col += a[0].length; - if (n > 0) { - ensure_line_len(); - current_col = a[n].length; - } - last = str; - } - - var star = function() { - print("*"); - }; - - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - - var indent = options.beautify ? function(half) { - if (options.beautify) { - print(make_indent(half ? 0.5 : 0)); - } - } : noop; - - var with_indent = options.beautify ? function(col, cont) { - if (col === true) col = next_indent(); - var save_indentation = indentation; - indentation = col; - var ret = cont(); - indentation = save_indentation; - return ret; - } : function(col, cont) { return cont(); }; - - var newline = options.beautify ? function() { - if (newline_insert < 0) return print("\n"); - if (OUTPUT.charAt(newline_insert) != "\n") { - OUTPUT.insertAt("\n", newline_insert); - current_pos++; - current_line++; - } - newline_insert++; - } : options.max_line_len ? function() { - ensure_line_len(); - might_add_newline = OUTPUT.length(); - } : noop; - - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - - function force_semicolon() { - might_need_semicolon = false; - print(";"); - } - - function next_indent() { - return indentation + options.indent_level; - } - - function with_block(cont) { - var ret; - print("{"); - newline(); - with_indent(next_indent(), function() { - ret = cont(); - }); - indent(); - print("}"); - return ret; - } - - function with_parens(cont) { - print("("); - //XXX: still nice to have that for argument lists - //var ret = with_indent(current_col, cont); - var ret = cont(); - print(")"); - return ret; - } - - function with_square(cont) { - print("["); - //var ret = with_indent(current_col, cont); - var ret = cont(); - print("]"); - return ret; - } - - function comma() { - print(","); - space(); - } - - function colon() { - print(":"); - space(); - } - - var add_mapping = mappings ? function(token, name) { - mapping_token = token; - mapping_name = name; - } : noop; - - function get() { - if (might_add_newline) { - ensure_line_len(); - } - return OUTPUT.toString(); - } - - function filter_comment(comment) { - if (!options.preserve_annotations) { - comment = comment.replace(r_annotation, " "); - } - if (/^\s*$/.test(comment)) { - return ""; - } - return comment.replace(/(<\s*\/\s*)(script)/i, "<\\/$2"); - } - - function prepend_comments(node) { - var self = this; - var start = node.start; - if (!start) return; - var printed_comments = self.printed_comments; - - // There cannot be a newline between return/yield and its value. - const keyword_with_value = - node instanceof AST_Exit && node.value - || (node instanceof AST_Await || node instanceof AST_Yield) - && node.expression; - - if ( - start.comments_before - && printed_comments.has(start.comments_before) - ) { - if (keyword_with_value) { - start.comments_before = []; - } else { - return; - } - } - - var comments = start.comments_before; - if (!comments) { - comments = start.comments_before = []; - } - printed_comments.add(comments); - - if (keyword_with_value) { - var tw = new TreeWalker(function(node) { - var parent = tw.parent(); - if (parent instanceof AST_Exit - || parent instanceof AST_Await - || parent instanceof AST_Yield - || parent instanceof AST_Binary && parent.left === node - || parent.TYPE == "Call" && parent.expression === node - || parent instanceof AST_Conditional && parent.condition === node - || parent instanceof AST_Dot && parent.expression === node - || parent instanceof AST_Sequence && parent.expressions[0] === node - || parent instanceof AST_Sub && parent.expression === node - || parent instanceof AST_UnaryPostfix) { - if (!node.start) return; - var text = node.start.comments_before; - if (text && !printed_comments.has(text)) { - printed_comments.add(text); - comments = comments.concat(text); - } - } else { - return true; - } - }); - tw.push(node); - keyword_with_value.walk(tw); - } - - if (current_pos == 0) { - if (comments.length > 0 && options.shebang && comments[0].type === "comment5" - && !printed_comments.has(comments[0])) { - print("#!" + comments.shift().value + "\n"); - indent(); - } - var preamble = options.preamble; - if (preamble) { - print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); - } - } - - comments = comments.filter(comment_filter, node).filter(c => !printed_comments.has(c)); - if (comments.length == 0) return; - var last_nlb = OUTPUT.hasNLB(); - comments.forEach(function(c, i) { - printed_comments.add(c); - if (!last_nlb) { - if (c.nlb) { - print("\n"); - indent(); - last_nlb = true; - } else if (i > 0) { - space(); - } - } - - if (/comment[134]/.test(c.type)) { - var value = filter_comment(c.value); - if (value) { - print("//" + value + "\n"); - indent(); - } - last_nlb = true; - } else if (c.type == "comment2") { - var value = filter_comment(c.value); - if (value) { - print("/*" + value + "*/"); - } - last_nlb = false; - } - }); - if (!last_nlb) { - if (start.nlb) { - print("\n"); - indent(); - } else { - space(); - } - } - } - - function append_comments(node, tail) { - var self = this; - var token = node.end; - if (!token) return; - var printed_comments = self.printed_comments; - var comments = token[tail ? "comments_before" : "comments_after"]; - if (!comments || printed_comments.has(comments)) return; - if (!(node instanceof AST_Statement || comments.every((c) => - !/comment[134]/.test(c.type) - ))) return; - printed_comments.add(comments); - var insert = OUTPUT.length(); - comments.filter(comment_filter, node).forEach(function(c, i) { - if (printed_comments.has(c)) return; - printed_comments.add(c); - need_space = false; - if (need_newline_indented) { - print("\n"); - indent(); - need_newline_indented = false; - } else if (c.nlb && (i > 0 || !OUTPUT.hasNLB())) { - print("\n"); - indent(); - } else if (i > 0 || !tail) { - space(); - } - if (/comment[134]/.test(c.type)) { - const value = filter_comment(c.value); - if (value) { - print("//" + value); - } - need_newline_indented = true; - } else if (c.type == "comment2") { - const value = filter_comment(c.value); - if (value) { - print("/*" + value + "*/"); - } - need_space = true; - } - }); - if (OUTPUT.length() > insert) newline_insert = insert; - } - - /** - * When output.option("_destroy_ast") is enabled, destroy the function. - * Call this after printing it. - */ - const gc_scope = - options["_destroy_ast"] - ? function gc_scope(scope) { - scope.body.length = 0; - scope.argnames.length = 0; - } - : noop; - - var stack = []; - return { - get : get, - toString : get, - indent : indent, - in_directive : false, - use_asm : null, - active_scope : null, - indentation : function() { return indentation; }, - current_width : function() { return current_col - indentation; }, - should_break : function() { return options.width && this.current_width() >= options.width; }, - has_parens : function() { return has_parens; }, - newline : newline, - print : print, - star : star, - space : space, - comma : comma, - colon : colon, - last : function() { return last; }, - semicolon : semicolon, - force_semicolon : force_semicolon, - to_utf8 : to_utf8, - print_name : function(name) { print(make_name(name)); }, - print_string : function(str, quote, escape_directive) { - var encoded = encode_string(str, quote); - if (escape_directive === true && !encoded.includes("\\")) { - // Insert semicolons to break directive prologue - if (!OUTPUT.expectDirective()) { - force_semicolon(); - } - force_semicolon(); - } - print(encoded); - }, - print_template_string_chars: function(str) { - var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); - return print(encoded.substr(1, encoded.length - 2)); - }, - encode_string : encode_string, - next_indent : next_indent, - with_indent : with_indent, - with_block : with_block, - with_parens : with_parens, - with_square : with_square, - add_mapping : add_mapping, - option : function(opt) { return options[opt]; }, - gc_scope, - printed_comments: printed_comments, - prepend_comments: readonly ? noop : prepend_comments, - append_comments : readonly || comment_filter === return_false ? noop : append_comments, - line : function() { return current_line; }, - col : function() { return current_col; }, - pos : function() { return current_pos; }, - push_node : function(node) { stack.push(node); }, - pop_node : function() { return stack.pop(); }, - parent : function(n) { - return stack[stack.length - 2 - (n || 0)]; - } - }; - -} - -/* -----[ code generators ]----- */ - -(function() { - - /* -----[ utils ]----- */ - - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - } - - AST_Node.DEFMETHOD("print", function(output, force_parens) { - var self = this, generator = self._codegen; - if (self instanceof AST_Scope) { - output.active_scope = self; - } else if (!output.use_asm && self instanceof AST_Directive && self.value == "use asm") { - output.use_asm = output.active_scope; - } - function doit() { - output.prepend_comments(self); - self.add_source_map(output); - generator(self, output); - output.append_comments(self); - } - output.push_node(self); - if (force_parens || self.needs_parens(output)) { - output.with_parens(doit); - } else { - doit(); - } - output.pop_node(); - if (self === output.use_asm) { - output.use_asm = null; - } - }); - AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); - - AST_Node.DEFMETHOD("print_to_string", function(options) { - var output = OutputStream(options); - this.print(output); - return output.get(); - }); - - /* -----[ PARENTHESES ]----- */ - - function PARENS(nodetype, func) { - if (Array.isArray(nodetype)) { - nodetype.forEach(function(nodetype) { - PARENS(nodetype, func); - }); - } else { - nodetype.DEFMETHOD("needs_parens", func); - } - } - - PARENS(AST_Node, return_false); - - // a function expression needs parens around it when it's provably - // the first token to appear in a statement. - PARENS(AST_Function, function(output) { - if (!output.has_parens() && first_in_statement(output)) { - return true; - } - - if (output.option("webkit")) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - return true; - } - } - - if (output.option("wrap_iife")) { - var p = output.parent(); - if (p instanceof AST_Call && p.expression === this) { - return true; - } - } - - if (output.option("wrap_func_args")) { - var p = output.parent(); - if (p instanceof AST_Call && p.args.includes(this)) { - return true; - } - } - - return false; - }); - - PARENS(AST_Arrow, function(output) { - var p = output.parent(); - - if ( - output.option("wrap_func_args") - && p instanceof AST_Call - && p.args.includes(this) - ) { - return true; - } - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Conditional && p.condition === this; - }); - - // same goes for an object literal (as in AST_Function), because - // otherwise {...} would be interpreted as a block of code. - PARENS(AST_Object, function(output) { - return !output.has_parens() && first_in_statement(output); - }); - - PARENS(AST_ClassExpression, first_in_statement); - - PARENS(AST_Unary, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Call && p.expression === this - || p instanceof AST_Binary - && p.operator === "**" - && this instanceof AST_UnaryPrefix - && p.left === this - && this.operator !== "++" - && this.operator !== "--"; - }); - - PARENS(AST_Await, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Call && p.expression === this - || p instanceof AST_Binary && p.operator === "**" && p.left === this - || output.option("safari10") && p instanceof AST_UnaryPrefix; - }); - - PARENS(AST_Sequence, function(output) { - var p = output.parent(); - return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) - || p instanceof AST_Unary // !(foo, bar, baz) - || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8 - || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 - || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2 - || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] - || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 - || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) - * ==> 20 (side effect, set a := 10 and b := 20) */ - || p instanceof AST_Arrow // x => (x, x) - || p instanceof AST_DefaultAssign // x => (x = (0, function(){})) - || p instanceof AST_Expansion // [...(a, b)] - || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {} - || p instanceof AST_Yield // yield (foo, bar) - || p instanceof AST_Export // export default (foo, bar) - ; - }); - - PARENS(AST_Binary, function(output) { - var p = output.parent(); - // (foo && bar)() - if (p instanceof AST_Call && p.expression === this) - return true; - // typeof (foo && bar) - if (p instanceof AST_Unary) - return true; - // (foo && bar)["prop"], (foo && bar).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // this deals with precedence: 3 * (2 + 1) - if (p instanceof AST_Binary) { - const po = p.operator; - const so = this.operator; - - if (so === "??" && (po === "||" || po === "&&")) { - return true; - } - - if (po === "??" && (so === "||" || so === "&&")) { - return true; - } - - const pp = PRECEDENCE[po]; - const sp = PRECEDENCE[so]; - if (pp > sp - || (pp == sp - && (this === p.right || po == "**"))) { - return true; - } - } - }); - - PARENS(AST_Yield, function(output) { - var p = output.parent(); - // (yield 1) + (yield 2) - // a = yield 3 - if (p instanceof AST_Binary && p.operator !== "=") - return true; - // (yield 1)() - // new (yield 1)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (yield 1) ? yield 2 : yield 3 - if (p instanceof AST_Conditional && p.condition === this) - return true; - // -(yield 4) - if (p instanceof AST_Unary) - return true; - // (yield x).foo - // (yield x)['foo'] - if (p instanceof AST_PropAccess && p.expression === this) - return true; - }); - - PARENS(AST_Chain, function(output) { - var p = output.parent(); - if (!(p instanceof AST_Call || p instanceof AST_PropAccess)) return false; - return p.expression === this; - }); - - PARENS(AST_PropAccess, function(output) { - var p = output.parent(); - if (p instanceof AST_New && p.expression === this) { - // i.e. new (foo.bar().baz) - // - // if there's one call into this subtree, then we need - // parens around it too, otherwise the call will be - // interpreted as passing the arguments to the upper New - // expression. - return walk(this, node => { - if (node instanceof AST_Scope) return true; - if (node instanceof AST_Call) { - return walk_abort; // makes walk() return true. - } - }); - } - }); - - PARENS(AST_Call, function(output) { - var p = output.parent(), p1; - if (p instanceof AST_New && p.expression === this - || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function) - return true; - - // workaround for Safari bug. - // https://bugs.webkit.org/show_bug.cgi?id=123506 - return this.expression instanceof AST_Function - && p instanceof AST_PropAccess - && p.expression === this - && (p1 = output.parent(1)) instanceof AST_Assign - && p1.left === p; - }); - - PARENS(AST_New, function(output) { - var p = output.parent(); - if (this.args.length === 0 - && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() - || p instanceof AST_Call && p.expression === this - || p instanceof AST_PrefixedTemplateString && p.prefix === this)) // (new foo)(bar) - return true; - }); - - PARENS(AST_Number, function(output) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value < 0 || /^0/.test(make_num(value))) { - return true; - } - } - }); - - PARENS(AST_BigInt, function(output) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value.startsWith("-")) { - return true; - } - } - }); - - PARENS([ AST_Assign, AST_Conditional ], function(output) { - var p = output.parent(); - // !(a = false) → true - if (p instanceof AST_Unary) - return true; - // 1 + (a = 2) + 3 → 6, side effect setting a = 2 - if (p instanceof AST_Binary && !(p instanceof AST_Assign)) - return true; - // (a = func)() —or— new (a = Object)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (a = foo) ? bar : baz - if (p instanceof AST_Conditional && p.condition === this) - return true; - // (a = foo)["prop"] —or— (a = foo).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // ({a, b} = {a: 1, b: 2}), a destructuring assignment - if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false) - return true; - }); - - /* -----[ PRINTERS ]----- */ - - DEFPRINT(AST_Directive, function(self, output) { - output.print_string(self.value, self.quote); - output.semicolon(); - }); - - DEFPRINT(AST_Expansion, function (self, output) { - output.print("..."); - self.expression.print(output); - }); - - DEFPRINT(AST_Destructuring, function (self, output) { - output.print(self.is_array ? "[" : "{"); - var len = self.names.length; - self.names.forEach(function (name, i) { - if (i > 0) output.comma(); - name.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i == len - 1 && name instanceof AST_Hole) output.comma(); - }); - output.print(self.is_array ? "]" : "}"); - }); - - DEFPRINT(AST_Debugger, function(self, output) { - output.print("debugger"); - output.semicolon(); - }); - - /* -----[ statements ]----- */ - - function display_body(body, is_toplevel, output, allow_directives) { - var last = body.length - 1; - output.in_directive = allow_directives; - body.forEach(function(stmt, i) { - if (output.in_directive === true && !(stmt instanceof AST_Directive || - stmt instanceof AST_EmptyStatement || - (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) - )) { - output.in_directive = false; - } - if (!(stmt instanceof AST_EmptyStatement)) { - output.indent(); - stmt.print(output); - if (!(i == last && is_toplevel)) { - output.newline(); - if (is_toplevel) output.newline(); - } - } - if (output.in_directive === true && - stmt instanceof AST_SimpleStatement && - stmt.body instanceof AST_String - ) { - output.in_directive = false; - } - }); - output.in_directive = false; - } - - AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { - print_maybe_braced_body(this.body, output); - }); - - DEFPRINT(AST_Statement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - DEFPRINT(AST_Toplevel, function(self, output) { - display_body(self.body, true, output, true); - output.print(""); - }); - DEFPRINT(AST_LabeledStatement, function(self, output) { - self.label.print(output); - output.colon(); - self.body.print(output); - }); - DEFPRINT(AST_SimpleStatement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - function print_braced_empty(self, output) { - output.print("{"); - output.with_indent(output.next_indent(), function() { - output.append_comments(self, true); - }); - output.add_mapping(self.end); - output.print("}"); - } - function print_braced(self, output, allow_directives) { - if (self.body.length > 0) { - output.with_block(function() { - display_body(self.body, false, output, allow_directives); - output.add_mapping(self.end); - }); - } else print_braced_empty(self, output); - } - DEFPRINT(AST_BlockStatement, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(AST_EmptyStatement, function(self, output) { - output.semicolon(); - }); - DEFPRINT(AST_Do, function(self, output) { - output.print("do"); - output.space(); - make_block(self.body, output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(AST_While, function(self, output) { - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_For, function(self, output) { - output.print("for"); - output.space(); - output.with_parens(function() { - if (self.init) { - if (self.init instanceof AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_noin(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_ForIn, function(self, output) { - output.print("for"); - if (self.await) { - output.space(); - output.print("await"); - } - output.space(); - output.with_parens(function() { - self.init.print(output); - output.space(); - output.print(self instanceof AST_ForOf ? "of" : "in"); - output.space(); - self.object.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_With, function(self, output) { - output.print("with"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - self._do_print_body(output); - }); - - /* -----[ functions ]----- */ - AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { - var self = this; - if (!nokeyword) { - if (self.async) { - output.print("async"); - output.space(); - } - output.print("function"); - if (self.is_generator) { - output.star(); - } - if (self.name) { - output.space(); - } - } - if (self.name instanceof AST_Symbol) { - self.name.print(output); - } else if (nokeyword && self.name instanceof AST_Node) { - output.with_square(function() { - self.name.print(output); // Computed method name - }); - } - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - output.space(); - print_braced(self, output, true); - }); - DEFPRINT(AST_Lambda, function(self, output) { - self._do_print(output); - output.gc_scope(self); - }); - - DEFPRINT(AST_PrefixedTemplateString, function(self, output) { - var tag = self.prefix; - var parenthesize_tag = tag instanceof AST_Lambda - || tag instanceof AST_Binary - || tag instanceof AST_Conditional - || tag instanceof AST_Sequence - || tag instanceof AST_Unary - || tag instanceof AST_Dot && tag.expression instanceof AST_Object; - if (parenthesize_tag) output.print("("); - self.prefix.print(output); - if (parenthesize_tag) output.print(")"); - self.template_string.print(output); - }); - DEFPRINT(AST_TemplateString, function(self, output) { - var is_tagged = output.parent() instanceof AST_PrefixedTemplateString; - - output.print("`"); - for (var i = 0; i < self.segments.length; i++) { - if (!(self.segments[i] instanceof AST_TemplateSegment)) { - output.print("${"); - self.segments[i].print(output); - output.print("}"); - } else if (is_tagged) { - output.print(self.segments[i].raw); - } else { - output.print_template_string_chars(self.segments[i].value); - } - } - output.print("`"); - }); - DEFPRINT(AST_TemplateSegment, function(self, output) { - output.print_template_string_chars(self.value); - }); - - AST_Arrow.DEFMETHOD("_do_print", function(output) { - var self = this; - var parent = output.parent(); - var needs_parens = (parent instanceof AST_Binary && !(parent instanceof AST_Assign)) || - parent instanceof AST_Unary || - (parent instanceof AST_Call && self === parent.expression); - if (needs_parens) { output.print("("); } - if (self.async) { - output.print("async"); - output.space(); - } - if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) { - self.argnames[0].print(output); - } else { - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - } - output.space(); - output.print("=>"); - output.space(); - const first_statement = self.body[0]; - if ( - self.body.length === 1 - && first_statement instanceof AST_Return - ) { - const returned = first_statement.value; - if (!returned) { - output.print("{}"); - } else if (left_is_object(returned)) { - output.print("("); - returned.print(output); - output.print(")"); - } else { - returned.print(output); - } - } else { - print_braced(self, output); - } - if (needs_parens) { output.print(")"); } - output.gc_scope(self); - }); - - /* -----[ exits ]----- */ - AST_Exit.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.value) { - output.space(); - const comments = this.value.start.comments_before; - if (comments && comments.length && !output.printed_comments.has(comments)) { - output.print("("); - this.value.print(output); - output.print(")"); - } else { - this.value.print(output); - } - } - output.semicolon(); - }); - DEFPRINT(AST_Return, function(self, output) { - self._do_print(output, "return"); - }); - DEFPRINT(AST_Throw, function(self, output) { - self._do_print(output, "throw"); - }); - - /* -----[ yield ]----- */ - - DEFPRINT(AST_Yield, function(self, output) { - var star = self.is_star ? "*" : ""; - output.print("yield" + star); - if (self.expression) { - output.space(); - self.expression.print(output); - } - }); - - DEFPRINT(AST_Await, function(self, output) { - output.print("await"); - output.space(); - var e = self.expression; - var parens = !( - e instanceof AST_Call - || e instanceof AST_SymbolRef - || e instanceof AST_PropAccess - || e instanceof AST_Unary - || e instanceof AST_Constant - || e instanceof AST_Await - || e instanceof AST_Object - ); - if (parens) output.print("("); - self.expression.print(output); - if (parens) output.print(")"); - }); - - /* -----[ loop control ]----- */ - AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.label) { - output.space(); - this.label.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Break, function(self, output) { - self._do_print(output, "break"); - }); - DEFPRINT(AST_Continue, function(self, output) { - self._do_print(output, "continue"); - }); - - /* -----[ if ]----- */ - function make_then(self, output) { - var b = self.body; - if (output.option("braces") - || output.option("ie8") && b instanceof AST_Do) - return make_block(b, output); - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block braces if needed. - if (!b) return output.force_semicolon(); - while (true) { - if (b instanceof AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } else if (b instanceof AST_StatementWithBody) { - b = b.body; - } else break; - } - print_maybe_braced_body(self.body, output); - } - DEFPRINT(AST_If, function(self, output) { - output.print("if"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - output.space(); - if (self.alternative instanceof AST_If) - self.alternative.print(output); - else - print_maybe_braced_body(self.alternative, output); - } else { - self._do_print_body(output); - } - }); - - /* -----[ switch ]----- */ - DEFPRINT(AST_Switch, function(self, output) { - output.print("switch"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - var last = self.body.length - 1; - if (last < 0) print_braced_empty(self, output); - else output.with_block(function() { - self.body.forEach(function(branch, i) { - output.indent(true); - branch.print(output); - if (i < last && branch.body.length > 0) - output.newline(); - }); - }); - }); - AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { - output.newline(); - this.body.forEach(function(stmt) { - output.indent(); - stmt.print(output); - output.newline(); - }); - }); - DEFPRINT(AST_Default, function(self, output) { - output.print("default:"); - self._do_print_body(output); - }); - DEFPRINT(AST_Case, function(self, output) { - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - self._do_print_body(output); - }); - - /* -----[ exceptions ]----- */ - DEFPRINT(AST_Try, function(self, output) { - output.print("try"); - output.space(); - self.body.print(output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(AST_TryBlock, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(AST_Catch, function(self, output) { - output.print("catch"); - if (self.argname) { - output.space(); - output.with_parens(function() { - self.argname.print(output); - }); - } - output.space(); - print_braced(self, output); - }); - DEFPRINT(AST_Finally, function(self, output) { - output.print("finally"); - output.space(); - print_braced(self, output); - }); - - /* -----[ var/const ]----- */ - AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - output.space(); - this.definitions.forEach(function(def, i) { - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - var in_for = p instanceof AST_For || p instanceof AST_ForIn; - var output_semicolon = !in_for || p && p.init !== this; - if (output_semicolon) - output.semicolon(); - }); - DEFPRINT(AST_Let, function(self, output) { - self._do_print(output, "let"); - }); - DEFPRINT(AST_Var, function(self, output) { - self._do_print(output, "var"); - }); - DEFPRINT(AST_Const, function(self, output) { - self._do_print(output, "const"); - }); - DEFPRINT(AST_Import, function(self, output) { - output.print("import"); - output.space(); - if (self.imported_name) { - self.imported_name.print(output); - } - if (self.imported_name && self.imported_names) { - output.print(","); - output.space(); - } - if (self.imported_names) { - if (self.imported_names.length === 1 && - self.imported_names[0].foreign_name.name === "*" && - !self.imported_names[0].foreign_name.quote) { - self.imported_names[0].print(output); - } else { - output.print("{"); - self.imported_names.forEach(function (name_import, i) { - output.space(); - name_import.print(output); - if (i < self.imported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } - if (self.imported_name || self.imported_names) { - output.space(); - output.print("from"); - output.space(); - } - self.module_name.print(output); - if (self.assert_clause) { - output.print("assert"); - self.assert_clause.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_ImportMeta, function(self, output) { - output.print("import.meta"); - }); - - DEFPRINT(AST_NameMapping, function(self, output) { - var is_import = output.parent() instanceof AST_Import; - var definition = self.name.definition(); - var foreign_name = self.foreign_name; - var names_are_different = - (definition && definition.mangled_name || self.name.name) !== - foreign_name.name; - if (!names_are_different && - foreign_name.name === "*" && - foreign_name.quote != self.name.quote) { - // export * as "*" - names_are_different = true; - } - var foreign_name_is_name = foreign_name.quote == null; - if (names_are_different) { - if (is_import) { - if (foreign_name_is_name) { - output.print(foreign_name.name); - } else { - output.print_string(foreign_name.name, foreign_name.quote); - } - } else { - if (self.name.quote == null) { - self.name.print(output); - } else { - output.print_string(self.name.name, self.name.quote); - } - - } - output.space(); - output.print("as"); - output.space(); - if (is_import) { - self.name.print(output); - } else { - if (foreign_name_is_name) { - output.print(foreign_name.name); - } else { - output.print_string(foreign_name.name, foreign_name.quote); - } - } - } else { - if (self.name.quote == null) { - self.name.print(output); - } else { - output.print_string(self.name.name, self.name.quote); - } - } - }); - - DEFPRINT(AST_Export, function(self, output) { - output.print("export"); - output.space(); - if (self.is_default) { - output.print("default"); - output.space(); - } - if (self.exported_names) { - if (self.exported_names.length === 1 && - self.exported_names[0].name.name === "*" && - !self.exported_names[0].name.quote) { - self.exported_names[0].print(output); - } else { - output.print("{"); - self.exported_names.forEach(function(name_export, i) { - output.space(); - name_export.print(output); - if (i < self.exported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } else if (self.exported_value) { - self.exported_value.print(output); - } else if (self.exported_definition) { - self.exported_definition.print(output); - if (self.exported_definition instanceof AST_Definitions) return; - } - if (self.module_name) { - output.space(); - output.print("from"); - output.space(); - self.module_name.print(output); - } - if (self.assert_clause) { - output.print("assert"); - self.assert_clause.print(output); - } - if (self.exported_value - && !(self.exported_value instanceof AST_Defun || - self.exported_value instanceof AST_Function || - self.exported_value instanceof AST_Class) - || self.module_name - || self.exported_names - ) { - output.semicolon(); - } - }); - - function parenthesize_for_noin(node, output, noin) { - var parens = false; - // need to take some precautions here: - // https://github.com/mishoo/UglifyJS2/issues/60 - if (noin) { - parens = walk(node, node => { - // Don't go into scopes -- except arrow functions: - // https://github.com/terser/terser/issues/1019#issuecomment-877642607 - if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) { - return true; - } - if ( - node instanceof AST_Binary && node.operator == "in" - || node instanceof AST_PrivateIn - ) { - return walk_abort; // makes walk() return true - } - }); - } - node.print(output, parens); - } - - DEFPRINT(AST_VarDef, function(self, output) { - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var noin = p instanceof AST_For || p instanceof AST_ForIn; - parenthesize_for_noin(self.value, output, noin); - } - }); - - /* -----[ other expressions ]----- */ - DEFPRINT(AST_Call, function(self, output) { - self.expression.print(output); - if (self instanceof AST_New && self.args.length === 0) - return; - if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) { - output.add_mapping(self.start); - } - if (self.optional) output.print("?."); - output.with_parens(function() { - self.args.forEach(function(expr, i) { - if (i) output.comma(); - expr.print(output); - }); - }); - }); - DEFPRINT(AST_New, function(self, output) { - output.print("new"); - output.space(); - AST_Call.prototype._codegen(self, output); - }); - - AST_Sequence.DEFMETHOD("_do_print", function(output) { - this.expressions.forEach(function(node, index) { - if (index > 0) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - } - node.print(output); - }); - }); - DEFPRINT(AST_Sequence, function(self, output) { - self._do_print(output); - // var p = output.parent(); - // if (p instanceof AST_Statement) { - // output.with_indent(output.next_indent(), function(){ - // self._do_print(output); - // }); - // } else { - // self._do_print(output); - // } - }); - DEFPRINT(AST_Dot, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - var print_computed = ALL_RESERVED_WORDS.has(prop) - ? output.option("ie8") - : !is_identifier_string( - prop, - output.option("ecma") >= 2015 && !output.option("safari10") - ); - - if (self.optional) output.print("?."); - - if (print_computed) { - output.print("["); - output.add_mapping(self.end); - output.print_string(prop); - output.print("]"); - } else { - if (expr instanceof AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.)]/i.test(output.last())) { - output.print("."); - } - } - if (!self.optional) output.print("."); - // the name after dot would be mapped about here. - output.add_mapping(self.end); - output.print_name(prop); - } - }); - DEFPRINT(AST_DotHash, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - - if (self.optional) output.print("?"); - output.print(".#"); - output.add_mapping(self.end); - output.print_name(prop); - }); - DEFPRINT(AST_Sub, function(self, output) { - self.expression.print(output); - if (self.optional) output.print("?."); - output.print("["); - self.property.print(output); - output.print("]"); - }); - DEFPRINT(AST_Chain, function(self, output) { - self.expression.print(output); - }); - DEFPRINT(AST_UnaryPrefix, function(self, output) { - var op = self.operator; - if (op === "--" && output.last().endsWith("!")) { - // avoid printing " - output.print(" "); - } else { - // the space is optional depending on "beautify" - output.space(); - } - output.print(op); - output.space(); - self.right.print(output); - }); - DEFPRINT(AST_Conditional, function(self, output) { - self.condition.print(output); - output.space(); - output.print("?"); - output.space(); - self.consequent.print(output); - output.space(); - output.colon(); - self.alternative.print(output); - }); - - /* -----[ literals ]----- */ - DEFPRINT(AST_Array, function(self, output) { - output.with_square(function() { - var a = self.elements, len = a.length; - if (len > 0) output.space(); - a.forEach(function(exp, i) { - if (i) output.comma(); - exp.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i === len - 1 && exp instanceof AST_Hole) - output.comma(); - }); - if (len > 0) output.space(); - }); - }); - DEFPRINT(AST_Object, function(self, output) { - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else print_braced_empty(self, output); - }); - DEFPRINT(AST_Class, function(self, output) { - output.print("class"); - output.space(); - if (self.name) { - self.name.print(output); - output.space(); - } - if (self.extends) { - var parens = ( - !(self.extends instanceof AST_SymbolRef) - && !(self.extends instanceof AST_PropAccess) - && !(self.extends instanceof AST_ClassExpression) - && !(self.extends instanceof AST_Function) - ); - output.print("extends"); - if (parens) { - output.print("("); - } else { - output.space(); - } - self.extends.print(output); - if (parens) { - output.print(")"); - } else { - output.space(); - } - } - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else output.print("{}"); - }); - DEFPRINT(AST_NewTarget, function(self, output) { - output.print("new.target"); - }); - - /** Prints a prop name. Returns whether it can be used as a shorthand. */ - function print_property_name(key, quote, output) { - if (output.option("quote_keys")) { - output.print_string(key); - return false; - } - if ("" + +key == key && key >= 0) { - if (output.option("keep_numbers")) { - output.print(key); - return false; - } - output.print(make_num(key)); - return false; - } - var print_string = ALL_RESERVED_WORDS.has(key) - ? output.option("ie8") - : ( - output.option("ecma") < 2015 || output.option("safari10") - ? !is_basic_identifier_string(key) - : !is_identifier_string(key, true) - ); - if (print_string || (quote && output.option("keep_quoted_props"))) { - output.print_string(key, quote); - return false; - } - output.print_name(key); - return true; - } - - DEFPRINT(AST_ObjectKeyVal, function(self, output) { - function get_name(self) { - var def = self.definition(); - return def ? def.mangled_name || def.name : self.name; - } - - const try_shorthand = output.option("shorthand") && !(self.key instanceof AST_Node); - if ( - try_shorthand - && self.value instanceof AST_Symbol - && get_name(self.value) === self.key - && !ALL_RESERVED_WORDS.has(self.key) - ) { - const was_shorthand = print_property_name(self.key, self.quote, output); - if (!was_shorthand) { - output.colon(); - self.value.print(output); - } - } else if ( - try_shorthand - && self.value instanceof AST_DefaultAssign - && self.value.left instanceof AST_Symbol - && get_name(self.value.left) === self.key - ) { - const was_shorthand = print_property_name(self.key, self.quote, output); - if (!was_shorthand) { - output.colon(); - self.value.left.print(output); - } - output.space(); - output.print("="); - output.space(); - self.value.right.print(output); - } else { - if (!(self.key instanceof AST_Node)) { - print_property_name(self.key, self.quote, output); - } else { - output.with_square(function() { - self.key.print(output); - }); - } - output.colon(); - self.value.print(output); - } - }); - DEFPRINT(AST_ClassPrivateProperty, (self, output) => { - if (self.static) { - output.print("static"); - output.space(); - } - - output.print("#"); - - print_property_name(self.key.name, self.quote, output); - - if (self.value) { - output.print("="); - self.value.print(output); - } - - output.semicolon(); - }); - DEFPRINT(AST_ClassProperty, (self, output) => { - if (self.static) { - output.print("static"); - output.space(); - } - - if (self.key instanceof AST_SymbolClassProperty) { - print_property_name(self.key.name, self.quote, output); - } else { - output.print("["); - self.key.print(output); - output.print("]"); - } - - if (self.value) { - output.print("="); - self.value.print(output); - } - - output.semicolon(); - }); - AST_ObjectProperty.DEFMETHOD("_print_getter_setter", function(type, is_private, output) { - var self = this; - if (self.static) { - output.print("static"); - output.space(); - } - if (type) { - output.print(type); - output.space(); - } - if (self.key instanceof AST_SymbolMethod) { - if (is_private) output.print("#"); - print_property_name(self.key.name, self.quote, output); - self.key.add_source_map(output); - } else { - output.with_square(function() { - self.key.print(output); - }); - } - self.value._do_print(output, true); - }); - DEFPRINT(AST_ObjectSetter, function(self, output) { - self._print_getter_setter("set", false, output); - }); - DEFPRINT(AST_ObjectGetter, function(self, output) { - self._print_getter_setter("get", false, output); - }); - DEFPRINT(AST_PrivateSetter, function(self, output) { - self._print_getter_setter("set", true, output); - }); - DEFPRINT(AST_PrivateGetter, function(self, output) { - self._print_getter_setter("get", true, output); - }); - DEFPRINT(AST_PrivateMethod, function(self, output) { - var type; - if (self.is_generator && self.async) { - type = "async*"; - } else if (self.is_generator) { - type = "*"; - } else if (self.async) { - type = "async"; - } - self._print_getter_setter(type, true, output); - }); - DEFPRINT(AST_PrivateIn, function(self, output) { - self.key.print(output); - output.space(); - output.print("in"); - output.space(); - self.value.print(output); - }); - DEFPRINT(AST_SymbolPrivateProperty, function(self, output) { - output.print("#" + self.name); - }); - DEFPRINT(AST_ConciseMethod, function(self, output) { - var type; - if (self.is_generator && self.async) { - type = "async*"; - } else if (self.is_generator) { - type = "*"; - } else if (self.async) { - type = "async"; - } - self._print_getter_setter(type, false, output); - }); - DEFPRINT(AST_ClassStaticBlock, function (self, output) { - output.print("static"); - output.space(); - print_braced(self, output); - }); - AST_Symbol.DEFMETHOD("_do_print", function(output) { - var def = this.definition(); - output.print_name(def ? def.mangled_name || def.name : this.name); - }); - DEFPRINT(AST_Symbol, function (self, output) { - self._do_print(output); - }); - DEFPRINT(AST_Hole, noop); - DEFPRINT(AST_This, function(self, output) { - output.print("this"); - }); - DEFPRINT(AST_Super, function(self, output) { - output.print("super"); - }); - DEFPRINT(AST_Constant, function(self, output) { - output.print(self.getValue()); - }); - DEFPRINT(AST_String, function(self, output) { - output.print_string(self.getValue(), self.quote, output.in_directive); - }); - DEFPRINT(AST_Number, function(self, output) { - if ((output.option("keep_numbers") || output.use_asm) && self.raw) { - output.print(self.raw); - } else { - output.print(make_num(self.getValue())); - } - }); - DEFPRINT(AST_BigInt, function(self, output) { - output.print(self.getValue() + "n"); - }); - - const r_slash_script = /(<\s*\/\s*script)/i; - const r_starts_with_script = /^\s*script/i; - const slash_script_replace = (_, $1) => $1.replace("/", "\\/"); - DEFPRINT(AST_RegExp, function(self, output) { - let { source, flags } = self.getValue(); - source = regexp_source_fix(source); - flags = flags ? sort_regexp_flags(flags) : ""; - - // Avoid outputting end of script tag - source = source.replace(r_slash_script, slash_script_replace); - if (r_starts_with_script.test(source) && output.last().endsWith("<")) { - output.print(" "); - } - - output.print(output.to_utf8(`/${source}/${flags}`, false, true)); - - const parent = output.parent(); - if ( - parent instanceof AST_Binary - && /^\w/.test(parent.operator) - && parent.left === self - ) { - output.print(" "); - } - }); - - /** if, for, while, may or may not have braces surrounding its body */ - function print_maybe_braced_body(stat, output) { - if (output.option("braces")) { - make_block(stat, output); - } else { - if (!stat || stat instanceof AST_EmptyStatement) - output.force_semicolon(); - else if (stat instanceof AST_Let || stat instanceof AST_Const || stat instanceof AST_Class) - make_block(stat, output); - else - stat.print(output); - } - } - - function best_of(a) { - var best = a[0], len = best.length; - for (var i = 1; i < a.length; ++i) { - if (a[i].length < len) { - best = a[i]; - len = best.length; - } - } - return best; - } - - function make_num(num) { - var str = num.toString(10).replace(/^0\./, ".").replace("e+", "e"); - var candidates = [ str ]; - if (Math.floor(num) === num) { - if (num < 0) { - candidates.push("-0x" + (-num).toString(16).toLowerCase()); - } else { - candidates.push("0x" + num.toString(16).toLowerCase()); - } - } - var match, len, digits; - if (match = /^\.0+/.exec(str)) { - len = match[0].length; - digits = str.slice(len); - candidates.push(digits + "e-" + (digits.length + len - 1)); - } else if (match = /0+$/.exec(str)) { - len = match[0].length; - candidates.push(str.slice(0, -len) + "e" + len); - } else if (match = /^(\d)\.(\d+)e(-?\d+)$/.exec(str)) { - candidates.push(match[1] + match[2] + "e" + (match[3] - match[2].length)); - } - return best_of(candidates); - } - - function make_block(stmt, output) { - if (!stmt || stmt instanceof AST_EmptyStatement) - output.print("{}"); - else if (stmt instanceof AST_BlockStatement) - stmt.print(output); - else output.with_block(function() { - output.indent(); - stmt.print(output); - output.newline(); - }); - } - - /* -----[ source map generators ]----- */ - - function DEFMAP(nodetype, generator) { - nodetype.forEach(function(nodetype) { - nodetype.DEFMETHOD("add_source_map", generator); - }); - } - - DEFMAP([ - // We could easily add info for ALL nodes, but it seems to me that - // would be quite wasteful, hence this noop in the base class. - AST_Node, - // since the label symbol will mark it - AST_LabeledStatement, - AST_Toplevel, - ], noop); - - // XXX: I'm not exactly sure if we need it for all of these nodes, - // or if we should add even more. - DEFMAP([ - AST_Array, - AST_BlockStatement, - AST_Catch, - AST_Class, - AST_Constant, - AST_Debugger, - AST_Definitions, - AST_Directive, - AST_Finally, - AST_Jump, - AST_Lambda, - AST_New, - AST_Object, - AST_StatementWithBody, - AST_Symbol, - AST_Switch, - AST_SwitchBranch, - AST_TemplateString, - AST_TemplateSegment, - AST_Try, - ], function(output) { - output.add_mapping(this.start); - }); - - DEFMAP([ - AST_ObjectGetter, - AST_ObjectSetter, - AST_PrivateGetter, - AST_PrivateSetter, - AST_ConciseMethod, - AST_PrivateMethod, - ], function(output) { - output.add_mapping(this.start, false /*name handled below*/); - }); - - DEFMAP([ - AST_SymbolMethod, - AST_SymbolPrivateProperty - ], function(output) { - const tok_type = this.end && this.end.type; - if (tok_type === "name" || tok_type === "privatename") { - output.add_mapping(this.end, this.name); - } else { - output.add_mapping(this.end); - } - }); - - DEFMAP([ AST_ObjectProperty ], function(output) { - output.add_mapping(this.start, this.key); - }); -})(); - -const shallow_cmp = (node1, node2) => { - return ( - node1 === null && node2 === null - || node1.TYPE === node2.TYPE && node1.shallow_cmp(node2) - ); -}; - -const equivalent_to = (tree1, tree2) => { - if (!shallow_cmp(tree1, tree2)) return false; - const walk_1_state = [tree1]; - const walk_2_state = [tree2]; - - const walk_1_push = walk_1_state.push.bind(walk_1_state); - const walk_2_push = walk_2_state.push.bind(walk_2_state); - - while (walk_1_state.length && walk_2_state.length) { - const node_1 = walk_1_state.pop(); - const node_2 = walk_2_state.pop(); - - if (!shallow_cmp(node_1, node_2)) return false; - - node_1._children_backwards(walk_1_push); - node_2._children_backwards(walk_2_push); - - if (walk_1_state.length !== walk_2_state.length) { - // Different number of children - return false; - } - } - - return walk_1_state.length == 0 && walk_2_state.length == 0; -}; - -const pass_through = () => true; - -AST_Node.prototype.shallow_cmp = function () { - throw new Error("did not find a shallow_cmp function for " + this.constructor.name); -}; - -AST_Debugger.prototype.shallow_cmp = pass_through; - -AST_Directive.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_SimpleStatement.prototype.shallow_cmp = pass_through; - -AST_Block.prototype.shallow_cmp = pass_through; - -AST_EmptyStatement.prototype.shallow_cmp = pass_through; - -AST_LabeledStatement.prototype.shallow_cmp = function(other) { - return this.label.name === other.label.name; -}; - -AST_Do.prototype.shallow_cmp = pass_through; - -AST_While.prototype.shallow_cmp = pass_through; - -AST_For.prototype.shallow_cmp = function(other) { - return (this.init == null ? other.init == null : this.init === other.init) && (this.condition == null ? other.condition == null : this.condition === other.condition) && (this.step == null ? other.step == null : this.step === other.step); -}; - -AST_ForIn.prototype.shallow_cmp = pass_through; - -AST_ForOf.prototype.shallow_cmp = pass_through; - -AST_With.prototype.shallow_cmp = pass_through; - -AST_Toplevel.prototype.shallow_cmp = pass_through; - -AST_Expansion.prototype.shallow_cmp = pass_through; - -AST_Lambda.prototype.shallow_cmp = function(other) { - return this.is_generator === other.is_generator && this.async === other.async; -}; - -AST_Destructuring.prototype.shallow_cmp = function(other) { - return this.is_array === other.is_array; -}; - -AST_PrefixedTemplateString.prototype.shallow_cmp = pass_through; - -AST_TemplateString.prototype.shallow_cmp = pass_through; - -AST_TemplateSegment.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_Jump.prototype.shallow_cmp = pass_through; - -AST_LoopControl.prototype.shallow_cmp = pass_through; - -AST_Await.prototype.shallow_cmp = pass_through; - -AST_Yield.prototype.shallow_cmp = function(other) { - return this.is_star === other.is_star; -}; - -AST_If.prototype.shallow_cmp = function(other) { - return this.alternative == null ? other.alternative == null : this.alternative === other.alternative; -}; - -AST_Switch.prototype.shallow_cmp = pass_through; - -AST_SwitchBranch.prototype.shallow_cmp = pass_through; - -AST_Try.prototype.shallow_cmp = function(other) { - return (this.body === other.body) && (this.bcatch == null ? other.bcatch == null : this.bcatch === other.bcatch) && (this.bfinally == null ? other.bfinally == null : this.bfinally === other.bfinally); -}; - -AST_Catch.prototype.shallow_cmp = function(other) { - return this.argname == null ? other.argname == null : this.argname === other.argname; -}; - -AST_Finally.prototype.shallow_cmp = pass_through; - -AST_Definitions.prototype.shallow_cmp = pass_through; - -AST_VarDef.prototype.shallow_cmp = function(other) { - return this.value == null ? other.value == null : this.value === other.value; -}; - -AST_NameMapping.prototype.shallow_cmp = pass_through; - -AST_Import.prototype.shallow_cmp = function(other) { - return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names); -}; - -AST_ImportMeta.prototype.shallow_cmp = pass_through; - -AST_Export.prototype.shallow_cmp = function(other) { - return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && this.module_name === other.module_name && this.is_default === other.is_default; -}; - -AST_Call.prototype.shallow_cmp = pass_through; - -AST_Sequence.prototype.shallow_cmp = pass_through; - -AST_PropAccess.prototype.shallow_cmp = pass_through; - -AST_Chain.prototype.shallow_cmp = pass_through; - -AST_Dot.prototype.shallow_cmp = function(other) { - return this.property === other.property; -}; - -AST_DotHash.prototype.shallow_cmp = function(other) { - return this.property === other.property; -}; - -AST_Unary.prototype.shallow_cmp = function(other) { - return this.operator === other.operator; -}; - -AST_Binary.prototype.shallow_cmp = function(other) { - return this.operator === other.operator; -}; - -AST_Conditional.prototype.shallow_cmp = pass_through; - -AST_Array.prototype.shallow_cmp = pass_through; - -AST_Object.prototype.shallow_cmp = pass_through; - -AST_ObjectProperty.prototype.shallow_cmp = pass_through; - -AST_ObjectKeyVal.prototype.shallow_cmp = function(other) { - return this.key === other.key; -}; - -AST_ObjectSetter.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -AST_ObjectGetter.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -AST_ConciseMethod.prototype.shallow_cmp = function(other) { - return this.static === other.static && this.is_generator === other.is_generator && this.async === other.async; -}; - -AST_Class.prototype.shallow_cmp = function(other) { - return (this.name == null ? other.name == null : this.name === other.name) && (this.extends == null ? other.extends == null : this.extends === other.extends); -}; - -AST_ClassProperty.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -AST_Symbol.prototype.shallow_cmp = function(other) { - return this.name === other.name; -}; - -AST_NewTarget.prototype.shallow_cmp = pass_through; - -AST_This.prototype.shallow_cmp = pass_through; - -AST_Super.prototype.shallow_cmp = pass_through; - -AST_String.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_Number.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_BigInt.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_RegExp.prototype.shallow_cmp = function (other) { - return ( - this.value.flags === other.value.flags - && this.value.source === other.value.source - ); -}; - -AST_Atom.prototype.shallow_cmp = pass_through; - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -const MASK_EXPORT_DONT_MANGLE = 1 << 0; -const MASK_EXPORT_WANT_MANGLE = 1 << 1; - -let function_defs = null; -let unmangleable_names = null; -/** - * When defined, there is a function declaration somewhere that's inside of a block. - * See https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-block-level-function-declarations-web-legacy-compatibility-semantics -*/ -let scopes_with_block_defuns = null; - -class SymbolDef { - constructor(scope, orig, init) { - this.name = orig.name; - this.orig = [ orig ]; - this.init = init; - this.eliminated = 0; - this.assignments = 0; - this.scope = scope; - this.replaced = 0; - this.global = false; - this.export = 0; - this.mangled_name = null; - this.undeclared = false; - this.id = SymbolDef.next_id++; - this.chained = false; - this.direct_access = false; - this.escaped = 0; - this.recursive_refs = 0; - this.references = []; - this.should_replace = undefined; - this.single_use = false; - this.fixed = false; - Object.seal(this); - } - fixed_value() { - if (!this.fixed || this.fixed instanceof AST_Node) return this.fixed; - return this.fixed(); - } - unmangleable(options) { - if (!options) options = {}; - - if ( - function_defs && - function_defs.has(this.id) && - keep_name(options.keep_fnames, this.orig[0].name) - ) return true; - - return this.global && !options.toplevel - || (this.export & MASK_EXPORT_DONT_MANGLE) - || this.undeclared - || !options.eval && this.scope.pinned() - || (this.orig[0] instanceof AST_SymbolLambda - || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name) - || this.orig[0] instanceof AST_SymbolMethod - || (this.orig[0] instanceof AST_SymbolClass - || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name); - } - mangle(options) { - const cache = options.cache && options.cache.props; - if (this.global && cache && cache.has(this.name)) { - this.mangled_name = cache.get(this.name); - } else if (!this.mangled_name && !this.unmangleable(options)) { - var s = this.scope; - var sym = this.orig[0]; - if (options.ie8 && sym instanceof AST_SymbolLambda) - s = s.parent_scope; - const redefinition = redefined_catch_def(this); - this.mangled_name = redefinition - ? redefinition.mangled_name || redefinition.name - : s.next_mangled(options, this); - if (this.global && cache) { - cache.set(this.name, this.mangled_name); - } - } - } -} - -SymbolDef.next_id = 1; - -function redefined_catch_def(def) { - if (def.orig[0] instanceof AST_SymbolCatch - && def.scope.is_block_scope() - ) { - return def.scope.get_defun_scope().variables.get(def.name); - } -} - -AST_Scope.DEFMETHOD("figure_out_scope", function(options, { parent_scope = null, toplevel = this } = {}) { - options = defaults(options, { - cache: null, - ie8: false, - safari10: false, - module: false, - }); - - if (!(toplevel instanceof AST_Toplevel)) { - throw new Error("Invalid toplevel scope"); - } - - // pass 1: setup scope chaining and handle definitions - var scope = this.parent_scope = parent_scope; - var labels = new Map(); - var defun = null; - var in_destructuring = null; - var for_scopes = []; - var tw = new TreeWalker((node, descend) => { - if (node.is_block_scope()) { - const save_scope = scope; - node.block_scope = scope = new AST_Scope(node); - scope._block_scope = true; - scope.init_scope_vars(save_scope); - scope.uses_with = save_scope.uses_with; - scope.uses_eval = save_scope.uses_eval; - - if (options.safari10) { - if (node instanceof AST_For || node instanceof AST_ForIn || node instanceof AST_ForOf) { - for_scopes.push(scope); - } - } - - if (node instanceof AST_Switch) { - // XXX: HACK! Ensure the switch expression gets the correct scope (the parent scope) and the body gets the contained scope - // AST_Switch has a scope within the body, but it itself "is a block scope" - // This means the switched expression has to belong to the outer scope - // while the body inside belongs to the switch itself. - // This is pretty nasty and warrants an AST change - const the_block_scope = scope; - scope = save_scope; - node.expression.walk(tw); - scope = the_block_scope; - for (let i = 0; i < node.body.length; i++) { - node.body[i].walk(tw); - } - } else { - descend(); - } - scope = save_scope; - return true; - } - if (node instanceof AST_Destructuring) { - const save_destructuring = in_destructuring; - in_destructuring = node; - descend(); - in_destructuring = save_destructuring; - return true; - } - if (node instanceof AST_Scope) { - node.init_scope_vars(scope); - var save_scope = scope; - var save_defun = defun; - var save_labels = labels; - defun = scope = node; - labels = new Map(); - descend(); - scope = save_scope; - defun = save_defun; - labels = save_labels; - return true; // don't descend again in TreeWalker - } - if (node instanceof AST_LabeledStatement) { - var l = node.label; - if (labels.has(l.name)) { - throw new Error(string_template("Label {name} defined twice", l)); - } - labels.set(l.name, l); - descend(); - labels.delete(l.name); - return true; // no descend again - } - if (node instanceof AST_With) { - for (var s = scope; s; s = s.parent_scope) - s.uses_with = true; - return; - } - if (node instanceof AST_Symbol) { - node.scope = scope; - } - if (node instanceof AST_Label) { - node.thedef = node; - node.references = []; - } - if (node instanceof AST_SymbolLambda) { - defun.def_function(node, node.name == "arguments" ? undefined : defun); - } else if (node instanceof AST_SymbolDefun) { - // Careful here, the scope where this should be defined is - // the parent scope. The reason is that we enter a new - // scope when we encounter the AST_Defun node (which is - // instanceof AST_Scope) but we get to the symbol a bit - // later. - const closest_scope = defun.parent_scope; - - // In strict mode, function definitions are block-scoped - node.scope = tw.directives["use strict"] - ? closest_scope - : closest_scope.get_defun_scope(); - - mark_export(node.scope.def_function(node, defun), 1); - } else if (node instanceof AST_SymbolClass) { - mark_export(defun.def_variable(node, defun), 1); - } else if (node instanceof AST_SymbolImport) { - scope.def_variable(node); - } else if (node instanceof AST_SymbolDefClass) { - // This deals with the name of the class being available - // inside the class. - mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); - } else if ( - node instanceof AST_SymbolVar - || node instanceof AST_SymbolLet - || node instanceof AST_SymbolConst - || node instanceof AST_SymbolCatch - ) { - var def; - if (node instanceof AST_SymbolBlockDeclaration) { - def = scope.def_variable(node, null); - } else { - def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined); - } - if (!def.orig.every((sym) => { - if (sym === node) return true; - if (node instanceof AST_SymbolBlockDeclaration) { - return sym instanceof AST_SymbolLambda; - } - return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst); - })) { - js_error( - `"${node.name}" is redeclared`, - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2); - if (defun !== scope) { - node.mark_enclosed(); - var def = scope.find_variable(node); - if (node.thedef !== def) { - node.thedef = def; - node.reference(); - } - } - } else if (node instanceof AST_LabelRef) { - var sym = labels.get(node.name); - if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { - name: node.name, - line: node.start.line, - col: node.start.col - })); - node.thedef = sym; - } - if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) { - js_error( - `"${node.TYPE}" statement may only appear at the top level`, - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - }); - - if (options.module) { - tw.directives["use strict"] = true; - } - - this.walk(tw); - - function mark_export(def, level) { - if (in_destructuring) { - var i = 0; - do { - level++; - } while (tw.parent(i++) !== in_destructuring); - } - var node = tw.parent(level); - if (def.export = node instanceof AST_Export ? MASK_EXPORT_DONT_MANGLE : 0) { - var exported = node.exported_definition; - if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) { - def.export = MASK_EXPORT_WANT_MANGLE; - } - } - } - - // pass 2: find back references and eval - const is_toplevel = this instanceof AST_Toplevel; - if (is_toplevel) { - this.globals = new Map(); - } - - var tw = new TreeWalker(node => { - if (node instanceof AST_LoopControl && node.label) { - node.label.thedef.references.push(node); - return true; - } - if (node instanceof AST_SymbolRef) { - var name = node.name; - if (name == "eval" && tw.parent() instanceof AST_Call) { - for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { - s.uses_eval = true; - } - } - var sym; - if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name - || !(sym = node.scope.find_variable(name))) { - - sym = toplevel.def_global(node); - if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; - } else if (sym.scope instanceof AST_Lambda && name == "arguments") { - sym.scope.get_defun_scope().uses_arguments = true; - } - node.thedef = sym; - node.reference(); - if (node.scope.is_block_scope() - && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) { - node.scope = node.scope.get_defun_scope(); - } - return true; - } - // ensure mangling works if catch reuses a scope variable - var def; - if (node instanceof AST_SymbolCatch && (def = redefined_catch_def(node.definition()))) { - var s = node.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } - } - }); - this.walk(tw); - - // pass 3: work around IE8 and Safari catch scope bugs - if (options.ie8 || options.safari10) { - walk(this, node => { - if (node instanceof AST_SymbolCatch) { - var name = node.name; - var refs = node.thedef.references; - var scope = node.scope.get_defun_scope(); - var def = scope.find_variable(name) - || toplevel.globals.get(name) - || scope.def_variable(node); - refs.forEach(function(ref) { - ref.thedef = def; - ref.reference(); - }); - node.thedef = def; - node.reference(); - return true; - } - }); - } - - // pass 4: add symbol definitions to loop scopes - // Safari/Webkit bug workaround - loop init let variable shadowing argument. - // https://github.com/mishoo/UglifyJS2/issues/1753 - // https://bugs.webkit.org/show_bug.cgi?id=171041 - if (options.safari10) { - for (const scope of for_scopes) { - scope.parent_scope.variables.forEach(function(def) { - push_uniq(scope.enclosed, def); - }); - } - } -}); - -AST_Toplevel.DEFMETHOD("def_global", function(node) { - var globals = this.globals, name = node.name; - if (globals.has(name)) { - return globals.get(name); - } else { - var g = new SymbolDef(this, node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - return g; - } -}); - -AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { - this.variables = new Map(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) - this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement - this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` - this.parent_scope = parent_scope; // the parent scope - this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes - this.cname = -1; // the current index for mangling functions/variables -}); - -AST_Scope.DEFMETHOD("conflicting_def", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - || (this.parent_scope && this.parent_scope.conflicting_def(name)) - ); -}); - -AST_Scope.DEFMETHOD("conflicting_def_shallow", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - ); -}); - -AST_Scope.DEFMETHOD("add_child_scope", function (scope) { - // `scope` is going to be moved into `this` right now. - // Update the required scopes' information - - if (scope.parent_scope === this) return; - - scope.parent_scope = this; - - // Propagate to this.uses_arguments from arrow functions - if ((scope instanceof AST_Arrow) && !this.uses_arguments) { - this.uses_arguments = walk(scope, node => { - if ( - node instanceof AST_SymbolRef - && node.scope instanceof AST_Lambda - && node.name === "arguments" - ) { - return walk_abort; - } - - if (node instanceof AST_Lambda && !(node instanceof AST_Arrow)) { - return true; - } - }); - } - - this.uses_with = this.uses_with || scope.uses_with; - this.uses_eval = this.uses_eval || scope.uses_eval; - - const scope_ancestry = (() => { - const ancestry = []; - let cur = this; - do { - ancestry.push(cur); - } while ((cur = cur.parent_scope)); - ancestry.reverse(); - return ancestry; - })(); - - const new_scope_enclosed_set = new Set(scope.enclosed); - const to_enclose = []; - for (const scope_topdown of scope_ancestry) { - to_enclose.forEach(e => push_uniq(scope_topdown.enclosed, e)); - for (const def of scope_topdown.variables.values()) { - if (new_scope_enclosed_set.has(def)) { - push_uniq(to_enclose, def); - push_uniq(scope_topdown.enclosed, def); - } - } - } -}); - -function find_scopes_visible_from(scopes) { - const found_scopes = new Set(); - - for (const scope of new Set(scopes)) { - (function bubble_up(scope) { - if (scope == null || found_scopes.has(scope)) return; - - found_scopes.add(scope); - - bubble_up(scope.parent_scope); - })(scope); - } - - return [...found_scopes]; -} - -// Creates a symbol during compression -AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { - source, - tentative_name, - scope, - conflict_scopes = [scope], - init = null -} = {}) { - let symbol_name; - - conflict_scopes = find_scopes_visible_from(conflict_scopes); - - if (tentative_name) { - // Implement hygiene (no new names are conflicting with existing names) - tentative_name = - symbol_name = - tentative_name.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); - - let i = 0; - while (conflict_scopes.find(s => s.conflicting_def_shallow(symbol_name))) { - symbol_name = tentative_name + "$" + i++; - } - } - - if (!symbol_name) { - throw new Error("No symbol name could be generated in create_symbol()"); - } - - const symbol = make_node(SymClass, source, { - name: symbol_name, - scope - }); - - this.def_variable(symbol, init || null); - - symbol.mark_enclosed(); - - return symbol; -}); - - -AST_Node.DEFMETHOD("is_block_scope", return_false); -AST_Class.DEFMETHOD("is_block_scope", return_false); -AST_Lambda.DEFMETHOD("is_block_scope", return_false); -AST_Toplevel.DEFMETHOD("is_block_scope", return_false); -AST_SwitchBranch.DEFMETHOD("is_block_scope", return_false); -AST_Block.DEFMETHOD("is_block_scope", return_true); -AST_Scope.DEFMETHOD("is_block_scope", function () { - return this._block_scope || false; -}); -AST_IterationStatement.DEFMETHOD("is_block_scope", return_true); - -AST_Lambda.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; - this.def_variable(new AST_SymbolFunarg({ - name: "arguments", - start: this.start, - end: this.end - })); -}); - -AST_Arrow.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; -}); - -AST_Symbol.DEFMETHOD("mark_enclosed", function() { - var def = this.definition(); - var s = this.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } -}); - -AST_Symbol.DEFMETHOD("reference", function() { - this.definition().references.push(this); - this.mark_enclosed(); -}); - -AST_Scope.DEFMETHOD("find_variable", function(name) { - if (name instanceof AST_Symbol) name = name.name; - return this.variables.get(name) - || (this.parent_scope && this.parent_scope.find_variable(name)); -}); - -AST_Scope.DEFMETHOD("def_function", function(symbol, init) { - var def = this.def_variable(symbol, init); - if (!def.init || def.init instanceof AST_Defun) def.init = init; - return def; -}); - -AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { - var def = this.variables.get(symbol.name); - if (def) { - def.orig.push(symbol); - if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) { - def.init = init; - } - } else { - def = new SymbolDef(this, symbol, init); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } - return symbol.thedef = def; -}); - -function next_mangled(scope, options) { - let defun_scope; - if ( - scopes_with_block_defuns - && (defun_scope = scope.get_defun_scope()) - && scopes_with_block_defuns.has(defun_scope) - ) { - scope = defun_scope; - } - - var ext = scope.enclosed; - var nth_identifier = options.nth_identifier; - out: while (true) { - var m = nth_identifier.get(++scope.cname); - if (ALL_RESERVED_WORDS.has(m)) continue; // skip over "do" - - // https://github.com/mishoo/UglifyJS2/issues/242 -- do not - // shadow a name reserved from mangling. - if (options.reserved.has(m)) continue; - - // Functions with short names might collide with base54 output - // and therefore cause collisions when keep_fnames is true. - if (unmangleable_names && unmangleable_names.has(m)) continue out; - - // we must ensure that the mangled name does not shadow a name - // from some parent scope that is referenced in this or in - // inner scopes. - for (let i = ext.length; --i >= 0;) { - const def = ext[i]; - const name = def.mangled_name || (def.unmangleable(options) && def.name); - if (m == name) continue out; - } - return m; - } -} - -AST_Scope.DEFMETHOD("next_mangled", function(options) { - return next_mangled(this, options); -}); - -AST_Toplevel.DEFMETHOD("next_mangled", function(options) { - let name; - const mangled_names = this.mangled_names; - do { - name = next_mangled(this, options); - } while (mangled_names.has(name)); - return name; -}); - -AST_Function.DEFMETHOD("next_mangled", function(options, def) { - // #179, #326 - // in Safari strict mode, something like (function x(x){...}) is a syntax error; - // a function expression's argument cannot shadow the function expression's name - - var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition(); - - // the function's mangled_name is null when keep_fnames is true - var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; - - while (true) { - var name = next_mangled(this, options); - if (!tricky_name || tricky_name != name) - return name; - } -}); - -AST_Symbol.DEFMETHOD("unmangleable", function(options) { - var def = this.definition(); - return !def || def.unmangleable(options); -}); - -// labels are always mangleable -AST_Label.DEFMETHOD("unmangleable", return_false); - -AST_Symbol.DEFMETHOD("unreferenced", function() { - return !this.definition().references.length && !this.scope.pinned(); -}); - -AST_Symbol.DEFMETHOD("definition", function() { - return this.thedef; -}); - -AST_Symbol.DEFMETHOD("global", function() { - return this.thedef.global; -}); - -/** - * Format the mangler options (if any) into their appropriate types - */ -function format_mangler_options(options) { - options = defaults(options, { - eval : false, - nth_identifier : base54, - ie8 : false, - keep_classnames: false, - keep_fnames : false, - module : false, - reserved : [], - toplevel : false, - }); - if (options.module) options.toplevel = true; - if (!Array.isArray(options.reserved) - && !(options.reserved instanceof Set) - ) { - options.reserved = []; - } - options.reserved = new Set(options.reserved); - // Never mangle arguments - options.reserved.add("arguments"); - return options; -} - -AST_Toplevel.DEFMETHOD("mangle_names", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - - // We only need to mangle declaration nodes. Special logic wired - // into the code generator will display the mangled name if it's - // present (and for AST_SymbolRef-s it'll use the mangled name of - // the AST_SymbolDeclaration that it points to). - var lname = -1; - var to_mangle = []; - - if (options.keep_fnames) { - function_defs = new Set(); - } - - const mangled_names = this.mangled_names = new Set(); - unmangleable_names = new Set(); - - if (options.cache) { - this.globals.forEach(collect); - if (options.cache.props) { - options.cache.props.forEach(function(mangled_name) { - mangled_names.add(mangled_name); - }); - } - } - - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_LabeledStatement) { - // lname is incremented when we get to the AST_Label - var save_nesting = lname; - descend(); - lname = save_nesting; - return true; // don't descend again in TreeWalker - } - if ( - node instanceof AST_Defun - && !(tw.parent() instanceof AST_Scope) - ) { - scopes_with_block_defuns = scopes_with_block_defuns || new Set(); - scopes_with_block_defuns.add(node.parent_scope.get_defun_scope()); - } - if (node instanceof AST_Scope) { - node.variables.forEach(collect); - return; - } - if (node.is_block_scope()) { - node.block_scope.variables.forEach(collect); - return; - } - if ( - function_defs - && node instanceof AST_VarDef - && node.value instanceof AST_Lambda - && !node.value.name - && keep_name(options.keep_fnames, node.name.name) - ) { - function_defs.add(node.name.definition().id); - return; - } - if (node instanceof AST_Label) { - let name; - do { - name = nth_identifier.get(++lname); - } while (ALL_RESERVED_WORDS.has(name)); - node.mangled_name = name; - return true; - } - if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) { - to_mangle.push(node.definition()); - return; - } - }); - - this.walk(tw); - - if (options.keep_fnames || options.keep_classnames) { - // Collect a set of short names which are unmangleable, - // for use in avoiding collisions in next_mangled. - to_mangle.forEach(def => { - if (def.name.length < 6 && def.unmangleable(options)) { - unmangleable_names.add(def.name); - } - }); - } - - to_mangle.forEach(def => { def.mangle(options); }); - - function_defs = null; - unmangleable_names = null; - scopes_with_block_defuns = null; - - function collect(symbol) { - if (symbol.export & MASK_EXPORT_DONT_MANGLE) { - unmangleable_names.add(symbol.name); - } else if (!options.reserved.has(symbol.name)) { - to_mangle.push(symbol); - } - } -}); - -AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { - const cache = options.cache && options.cache.props; - const avoid = new Set(); - options.reserved.forEach(to_avoid); - this.globals.forEach(add_def); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope) node.variables.forEach(add_def); - if (node instanceof AST_SymbolCatch) add_def(node.definition()); - })); - return avoid; - - function to_avoid(name) { - avoid.add(name); - } - - function add_def(def) { - var name = def.name; - if (def.global && cache && cache.has(name)) name = cache.get(name); - else if (!def.unmangleable(options)) return; - to_avoid(name); - } -}); - -AST_Toplevel.DEFMETHOD("expand_names", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - if (nth_identifier.reset && nth_identifier.sort) { - nth_identifier.reset(); - nth_identifier.sort(); - } - var avoid = this.find_colliding_names(options); - var cname = 0; - this.globals.forEach(rename); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope) node.variables.forEach(rename); - if (node instanceof AST_SymbolCatch) rename(node.definition()); - })); - - function next_name() { - var name; - do { - name = nth_identifier.get(cname++); - } while (avoid.has(name) || ALL_RESERVED_WORDS.has(name)); - return name; - } - - function rename(def) { - if (def.global && options.cache) return; - if (def.unmangleable(options)) return; - if (options.reserved.has(def.name)) return; - const redefinition = redefined_catch_def(def); - const name = def.name = redefinition ? redefinition.name : next_name(); - def.orig.forEach(function(sym) { - sym.name = name; - }); - def.references.forEach(function(sym) { - sym.name = name; - }); - } -}); - -AST_Node.DEFMETHOD("tail_node", return_this); -AST_Sequence.DEFMETHOD("tail_node", function() { - return this.expressions[this.expressions.length - 1]; -}); - -AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - if (!nth_identifier.reset || !nth_identifier.consider || !nth_identifier.sort) { - // If the identifier mangler is invariant, skip computing character frequency. - return; - } - nth_identifier.reset(); - - try { - AST_Node.prototype.print = function(stream, force_parens) { - this._print(stream, force_parens); - if (this instanceof AST_Symbol && !this.unmangleable(options)) { - nth_identifier.consider(this.name, -1); - } else if (options.properties) { - if (this instanceof AST_DotHash) { - nth_identifier.consider("#" + this.property, -1); - } else if (this instanceof AST_Dot) { - nth_identifier.consider(this.property, -1); - } else if (this instanceof AST_Sub) { - skip_string(this.property); - } - } - }; - nth_identifier.consider(this.print_to_string(), 1); - } finally { - AST_Node.prototype.print = AST_Node.prototype._print; - } - nth_identifier.sort(); - - function skip_string(node) { - if (node instanceof AST_String) { - nth_identifier.consider(node.value, -1); - } else if (node instanceof AST_Conditional) { - skip_string(node.consequent); - skip_string(node.alternative); - } else if (node instanceof AST_Sequence) { - skip_string(node.tail_node()); - } - } -}); - -const base54 = (() => { - const leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); - const digits = "0123456789".split(""); - let chars; - let frequency; - function reset() { - frequency = new Map(); - leading.forEach(function(ch) { - frequency.set(ch, 0); - }); - digits.forEach(function(ch) { - frequency.set(ch, 0); - }); - } - function consider(str, delta) { - for (var i = str.length; --i >= 0;) { - frequency.set(str[i], frequency.get(str[i]) + delta); - } - } - function compare(a, b) { - return frequency.get(b) - frequency.get(a); - } - function sort() { - chars = mergeSort(leading, compare).concat(mergeSort(digits, compare)); - } - // Ensure this is in a usable initial state. - reset(); - sort(); - function base54(num) { - var ret = "", base = 54; - num++; - do { - num--; - ret += chars[num % base]; - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - } - - return { - get: base54, - consider, - reset, - sort - }; -})(); - -let mangle_options = undefined; -AST_Node.prototype.size = function (compressor, stack) { - mangle_options = compressor && compressor._mangle_options; - - let size = 0; - walk_parent(this, (node, info) => { - size += node._size(info); - - // Braceless arrow functions have fake "return" statements - if (node instanceof AST_Arrow && node.is_braceless()) { - size += node.body[0].value._size(info); - return true; - } - }, stack || (compressor && compressor.stack)); - - // just to save a bit of memory - mangle_options = undefined; - - return size; -}; - -AST_Node.prototype._size = () => 0; - -AST_Debugger.prototype._size = () => 8; - -AST_Directive.prototype._size = function () { - // TODO string encoding stuff - return 2 + this.value.length; -}; - -/** Count commas/semicolons necessary to show a list of expressions/statements */ -const list_overhead = (array) => array.length && array.length - 1; - -AST_Block.prototype._size = function () { - return 2 + list_overhead(this.body); -}; - -AST_Toplevel.prototype._size = function() { - return list_overhead(this.body); -}; - -AST_EmptyStatement.prototype._size = () => 1; - -AST_LabeledStatement.prototype._size = () => 2; // x: - -AST_Do.prototype._size = () => 9; - -AST_While.prototype._size = () => 7; - -AST_For.prototype._size = () => 8; - -AST_ForIn.prototype._size = () => 8; -// AST_ForOf inherits ^ - -AST_With.prototype._size = () => 6; - -AST_Expansion.prototype._size = () => 3; - -const lambda_modifiers = func => - (func.is_generator ? 1 : 0) + (func.async ? 6 : 0); - -AST_Accessor.prototype._size = function () { - return lambda_modifiers(this) + 4 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -AST_Function.prototype._size = function (info) { - const first = !!first_in_statement(info); - return (first * 2) + lambda_modifiers(this) + 12 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -AST_Defun.prototype._size = function () { - return lambda_modifiers(this) + 13 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -AST_Arrow.prototype._size = function () { - let args_and_arrow = 2 + list_overhead(this.argnames); - - if ( - !( - this.argnames.length === 1 - && this.argnames[0] instanceof AST_Symbol - ) - ) { - args_and_arrow += 2; // parens around the args - } - - const body_overhead = this.is_braceless() ? 0 : list_overhead(this.body) + 2; - - return lambda_modifiers(this) + args_and_arrow + body_overhead; -}; - -AST_Destructuring.prototype._size = () => 2; - -AST_TemplateString.prototype._size = function () { - return 2 + (Math.floor(this.segments.length / 2) * 3); /* "${}" */ -}; - -AST_TemplateSegment.prototype._size = function () { - return this.value.length; -}; - -AST_Return.prototype._size = function () { - return this.value ? 7 : 6; -}; - -AST_Throw.prototype._size = () => 6; - -AST_Break.prototype._size = function () { - return this.label ? 6 : 5; -}; - -AST_Continue.prototype._size = function () { - return this.label ? 9 : 8; -}; - -AST_If.prototype._size = () => 4; - -AST_Switch.prototype._size = function () { - return 8 + list_overhead(this.body); -}; - -AST_Case.prototype._size = function () { - return 5 + list_overhead(this.body); -}; - -AST_Default.prototype._size = function () { - return 8 + list_overhead(this.body); -}; - -AST_Try.prototype._size = () => 3; - -AST_Catch.prototype._size = function () { - let size = 7 + list_overhead(this.body); - if (this.argname) { - size += 2; - } - return size; -}; - -AST_Finally.prototype._size = function () { - return 7 + list_overhead(this.body); -}; - -AST_Var.prototype._size = function () { - return 4 + list_overhead(this.definitions); -}; - -AST_Let.prototype._size = function () { - return 4 + list_overhead(this.definitions); -}; - -AST_Const.prototype._size = function () { - return 6 + list_overhead(this.definitions); -}; - -AST_VarDef.prototype._size = function () { - return this.value ? 1 : 0; -}; - -AST_NameMapping.prototype._size = function () { - // foreign name isn't mangled - return this.name ? 4 : 0; -}; - -AST_Import.prototype._size = function () { - // import - let size = 6; - - if (this.imported_name) size += 1; - - // from - if (this.imported_name || this.imported_names) size += 5; - - // braces, and the commas - if (this.imported_names) { - size += 2 + list_overhead(this.imported_names); - } - - return size; -}; - -AST_ImportMeta.prototype._size = () => 11; - -AST_Export.prototype._size = function () { - let size = 7 + (this.is_default ? 8 : 0); - - if (this.exported_value) { - size += this.exported_value._size(); - } - - if (this.exported_names) { - // Braces and commas - size += 2 + list_overhead(this.exported_names); - } - - if (this.module_name) { - // "from " - size += 5; - } - - return size; -}; - -AST_Call.prototype._size = function () { - if (this.optional) { - return 4 + list_overhead(this.args); - } - return 2 + list_overhead(this.args); -}; - -AST_New.prototype._size = function () { - return 6 + list_overhead(this.args); -}; - -AST_Sequence.prototype._size = function () { - return list_overhead(this.expressions); -}; - -AST_Dot.prototype._size = function () { - if (this.optional) { - return this.property.length + 2; - } - return this.property.length + 1; -}; - -AST_DotHash.prototype._size = function () { - if (this.optional) { - return this.property.length + 3; - } - return this.property.length + 2; -}; - -AST_Sub.prototype._size = function () { - return this.optional ? 4 : 2; -}; - -AST_Unary.prototype._size = function () { - if (this.operator === "typeof") return 7; - if (this.operator === "void") return 5; - return this.operator.length; -}; - -AST_Binary.prototype._size = function (info) { - if (this.operator === "in") return 4; - - let size = this.operator.length; - - if ( - (this.operator === "+" || this.operator === "-") - && this.right instanceof AST_Unary && this.right.operator === this.operator - ) { - // 1+ +a > needs space between the + - size += 1; - } - - if (this.needs_parens(info)) { - size += 2; - } - - return size; -}; - -AST_Conditional.prototype._size = () => 3; - -AST_Array.prototype._size = function () { - return 2 + list_overhead(this.elements); -}; - -AST_Object.prototype._size = function (info) { - let base = 2; - if (first_in_statement(info)) { - base += 2; // parens - } - return base + list_overhead(this.properties); -}; - -/*#__INLINE__*/ -const key_size = key => - typeof key === "string" ? key.length : 0; - -AST_ObjectKeyVal.prototype._size = function () { - return key_size(this.key) + 1; -}; - -/*#__INLINE__*/ -const static_size = is_static => is_static ? 7 : 0; - -AST_ObjectGetter.prototype._size = function () { - return 5 + static_size(this.static) + key_size(this.key); -}; - -AST_ObjectSetter.prototype._size = function () { - return 5 + static_size(this.static) + key_size(this.key); -}; - -AST_ConciseMethod.prototype._size = function () { - return static_size(this.static) + key_size(this.key) + lambda_modifiers(this); -}; - -AST_PrivateMethod.prototype._size = function () { - return AST_ConciseMethod.prototype._size.call(this) + 1; -}; - -AST_PrivateGetter.prototype._size = AST_PrivateSetter.prototype._size = function () { - return AST_ConciseMethod.prototype._size.call(this) + 4; -}; - -AST_PrivateIn.prototype._size = function () { - return 5; // "#", and " in " -}; - -AST_Class.prototype._size = function () { - return ( - (this.name ? 8 : 7) - + (this.extends ? 8 : 0) - ); -}; - -AST_ClassStaticBlock.prototype._size = function () { - // "class{}" + semicolons - return 7 + list_overhead(this.body); -}; - -AST_ClassProperty.prototype._size = function () { - return ( - static_size(this.static) - + (typeof this.key === "string" ? this.key.length + 2 : 0) - + (this.value ? 1 : 0) - ); -}; - -AST_ClassPrivateProperty.prototype._size = function () { - return AST_ClassProperty.prototype._size.call(this) + 1; -}; - -AST_Symbol.prototype._size = function () { - if (!(mangle_options && this.thedef && !this.thedef.unmangleable(mangle_options))) { - return this.name.length; - } else { - return 1; - } -}; - -// TODO take propmangle into account -AST_SymbolClassProperty.prototype._size = function () { - return this.name.length; -}; - -AST_SymbolRef.prototype._size = AST_SymbolDeclaration.prototype._size = function () { - if (this.name === "arguments") return 9; - - return AST_Symbol.prototype._size.call(this); -}; - -AST_NewTarget.prototype._size = () => 10; - -AST_SymbolImportForeign.prototype._size = function () { - return this.name.length; -}; - -AST_SymbolExportForeign.prototype._size = function () { - return this.name.length; -}; - -AST_This.prototype._size = () => 4; - -AST_Super.prototype._size = () => 5; - -AST_String.prototype._size = function () { - return this.value.length + 2; -}; - -AST_Number.prototype._size = function () { - const { value } = this; - if (value === 0) return 1; - if (value > 0 && Math.floor(value) === value) { - return Math.floor(Math.log10(value) + 1); - } - return value.toString().length; -}; - -AST_BigInt.prototype._size = function () { - return this.value.length; -}; - -AST_RegExp.prototype._size = function () { - return this.value.toString().length; -}; - -AST_Null.prototype._size = () => 4; - -AST_NaN.prototype._size = () => 3; - -AST_Undefined.prototype._size = () => 6; // "void 0" - -AST_Hole.prototype._size = () => 0; // comma is taken into account by list_overhead() - -AST_Infinity.prototype._size = () => 8; - -AST_True.prototype._size = () => 4; - -AST_False.prototype._size = () => 5; - -AST_Await.prototype._size = () => 6; - -AST_Yield.prototype._size = () => 6; - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// bitfield flags to be stored in node.flags. -// These are set and unset during compression, and store information in the node without requiring multiple fields. -const UNUSED = 0b00000001; -const TRUTHY = 0b00000010; -const FALSY = 0b00000100; -const UNDEFINED = 0b00001000; -const INLINED = 0b00010000; - -// Nodes to which values are ever written. Used when keep_assign is part of the unused option string. -const WRITE_ONLY = 0b00100000; - -// information specific to a single compression pass -const SQUEEZED = 0b0000000100000000; -const OPTIMIZED = 0b0000001000000000; -const TOP = 0b0000010000000000; -const CLEAR_BETWEEN_PASSES = SQUEEZED | OPTIMIZED | TOP; - -const has_flag = (node, flag) => node.flags & flag; -const set_flag = (node, flag) => { node.flags |= flag; }; -const clear_flag = (node, flag) => { node.flags &= ~flag; }; - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -function merge_sequence(array, node) { - if (node instanceof AST_Sequence) { - array.push(...node.expressions); - } else { - array.push(node); - } - return array; -} - -function make_sequence(orig, expressions) { - if (expressions.length == 1) return expressions[0]; - if (expressions.length == 0) throw new Error("trying to create a sequence with length zero!"); - return make_node(AST_Sequence, orig, { - expressions: expressions.reduce(merge_sequence, []) - }); -} - -function make_node_from_constant(val, orig) { - switch (typeof val) { - case "string": - return make_node(AST_String, orig, { - value: val - }); - case "number": - if (isNaN(val)) return make_node(AST_NaN, orig); - if (isFinite(val)) { - return 1 / val < 0 ? make_node(AST_UnaryPrefix, orig, { - operator: "-", - expression: make_node(AST_Number, orig, { value: -val }) - }) : make_node(AST_Number, orig, { value: val }); - } - return val < 0 ? make_node(AST_UnaryPrefix, orig, { - operator: "-", - expression: make_node(AST_Infinity, orig) - }) : make_node(AST_Infinity, orig); - case "boolean": - return make_node(val ? AST_True : AST_False, orig); - case "undefined": - return make_node(AST_Undefined, orig); - default: - if (val === null) { - return make_node(AST_Null, orig, { value: null }); - } - if (val instanceof RegExp) { - return make_node(AST_RegExp, orig, { - value: { - source: regexp_source_fix(val.source), - flags: val.flags - } - }); - } - throw new Error(string_template("Can't handle constant of type: {type}", { - type: typeof val - })); - } -} - -function best_of_expression(ast1, ast2) { - return ast1.size() > ast2.size() ? ast2 : ast1; -} - -function best_of_statement(ast1, ast2) { - return best_of_expression( - make_node(AST_SimpleStatement, ast1, { - body: ast1 - }), - make_node(AST_SimpleStatement, ast2, { - body: ast2 - }) - ).body; -} - -/** Find which node is smaller, and return that */ -function best_of(compressor, ast1, ast2) { - if (first_in_statement(compressor)) { - return best_of_statement(ast1, ast2); - } else { - return best_of_expression(ast1, ast2); - } -} - -/** Simplify an object property's key, if possible */ -function get_simple_key(key) { - if (key instanceof AST_Constant) { - return key.getValue(); - } - if (key instanceof AST_UnaryPrefix - && key.operator == "void" - && key.expression instanceof AST_Constant) { - return; - } - return key; -} - -function read_property(obj, key) { - key = get_simple_key(key); - if (key instanceof AST_Node) return; - - var value; - if (obj instanceof AST_Array) { - var elements = obj.elements; - if (key == "length") return make_node_from_constant(elements.length, obj); - if (typeof key == "number" && key in elements) value = elements[key]; - } else if (obj instanceof AST_Object) { - key = "" + key; - var props = obj.properties; - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - if (!(prop instanceof AST_ObjectKeyVal)) return; - if (!value && props[i].key === key) value = props[i].value; - } - } - - return value instanceof AST_SymbolRef && value.fixed_value() || value; -} - -function has_break_or_continue(loop, parent) { - var found = false; - var tw = new TreeWalker(function(node) { - if (found || node instanceof AST_Scope) return true; - if (node instanceof AST_LoopControl && tw.loopcontrol_target(node) === loop) { - return found = true; - } - }); - if (parent instanceof AST_LabeledStatement) tw.push(parent); - tw.push(loop); - loop.body.walk(tw); - return found; -} - -// we shouldn't compress (1,func)(something) to -// func(something) because that changes the meaning of -// the func (becomes lexical instead of global). -function maintain_this_binding(parent, orig, val) { - if ( - parent instanceof AST_UnaryPrefix && parent.operator == "delete" - || parent instanceof AST_Call && parent.expression === orig - && ( - val instanceof AST_Chain - || val instanceof AST_PropAccess - || val instanceof AST_SymbolRef && val.name == "eval" - ) - ) { - const zero = make_node(AST_Number, orig, { value: 0 }); - return make_sequence(orig, [ zero, val ]); - } else { - return val; - } -} - -function is_func_expr(node) { - return node instanceof AST_Arrow || node instanceof AST_Function; -} - -/** - * Used to determine whether the node can benefit from negation. - * Not the case with arrow functions (you need an extra set of parens). */ -function is_iife_call(node) { - if (node.TYPE != "Call") return false; - return node.expression instanceof AST_Function || is_iife_call(node.expression); -} - -function is_empty(thing) { - if (thing === null) return true; - if (thing instanceof AST_EmptyStatement) return true; - if (thing instanceof AST_BlockStatement) return thing.body.length == 0; - return false; -} - -const identifier_atom = makePredicate("Infinity NaN undefined"); -function is_identifier_atom(node) { - return node instanceof AST_Infinity - || node instanceof AST_NaN - || node instanceof AST_Undefined; -} - -/** Check if this is a SymbolRef node which has one def of a certain AST type */ -function is_ref_of(ref, type) { - if (!(ref instanceof AST_SymbolRef)) return false; - var orig = ref.definition().orig; - for (var i = orig.length; --i >= 0;) { - if (orig[i] instanceof type) return true; - } -} - -/**Can we turn { block contents... } into just the block contents ? - * Not if one of these is inside. - **/ -function can_be_evicted_from_block(node) { - return !( - node instanceof AST_DefClass || - node instanceof AST_Defun || - node instanceof AST_Let || - node instanceof AST_Const || - node instanceof AST_Export || - node instanceof AST_Import - ); -} - -function as_statement_array(thing) { - if (thing === null) return []; - if (thing instanceof AST_BlockStatement) return thing.body; - if (thing instanceof AST_EmptyStatement) return []; - if (thing instanceof AST_Statement) return [ thing ]; - throw new Error("Can't convert thing to statement array"); -} - -function is_reachable(scope_node, defs) { - const find_ref = node => { - if (node instanceof AST_SymbolRef && defs.includes(node.definition())) { - return walk_abort; - } - }; - - return walk_parent(scope_node, (node, info) => { - if (node instanceof AST_Scope && node !== scope_node) { - var parent = info.parent(); - - if ( - parent instanceof AST_Call - && parent.expression === node - // Async/Generators aren't guaranteed to sync evaluate all of - // their body steps, so it's possible they close over the variable. - && !(node.async || node.is_generator) - ) { - return; - } - - if (walk(node, find_ref)) return walk_abort; - - return true; - } - }); -} - -/** Check if a ref refers to the name of a function/class it's defined within */ -function is_recursive_ref(compressor, def) { - var node; - for (var i = 0; node = compressor.parent(i); i++) { - if (node instanceof AST_Lambda || node instanceof AST_Class) { - var name = node.name; - if (name && name.definition() === def) { - return true; - } - } - } - return false; -} - -// TODO this only works with AST_Defun, shouldn't it work for other ways of defining functions? -function retain_top_func(fn, compressor) { - return compressor.top_retain - && fn instanceof AST_Defun - && has_flag(fn, TOP) - && fn.name - && compressor.top_retain(fn.name.definition()); -} - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// Lists of native methods, useful for `unsafe` option which assumes they exist. -// Note: Lots of methods and functions are missing here, in case they aren't pure -// or not available in all JS environments. - -function make_nested_lookup(obj) { - const out = new Map(); - for (var key of Object.keys(obj)) { - out.set(key, makePredicate(obj[key])); - } - - const does_have = (global_name, fname) => { - const inner_map = out.get(global_name); - return inner_map != null && inner_map.has(fname); - }; - return does_have; -} - -// Objects which are safe to access without throwing or causing a side effect. -// Usually we'd check the `unsafe` option first but these are way too common for that -const pure_prop_access_globals = new Set([ - "Number", - "String", - "Array", - "Object", - "Function", - "Promise", -]); - -const object_methods = [ - "constructor", - "toString", - "valueOf", -]; - -const is_pure_native_method = make_nested_lookup({ - Array: [ - "at", - "flat", - "includes", - "indexOf", - "join", - "lastIndexOf", - "slice", - ...object_methods, - ], - Boolean: object_methods, - Function: object_methods, - Number: [ - "toExponential", - "toFixed", - "toPrecision", - ...object_methods, - ], - Object: object_methods, - RegExp: [ - "test", - ...object_methods, - ], - String: [ - "at", - "charAt", - "charCodeAt", - "charPointAt", - "concat", - "endsWith", - "fromCharCode", - "fromCodePoint", - "includes", - "indexOf", - "italics", - "lastIndexOf", - "localeCompare", - "match", - "matchAll", - "normalize", - "padStart", - "padEnd", - "repeat", - "replace", - "replaceAll", - "search", - "slice", - "split", - "startsWith", - "substr", - "substring", - "repeat", - "toLocaleLowerCase", - "toLocaleUpperCase", - "toLowerCase", - "toUpperCase", - "trim", - "trimEnd", - "trimStart", - ...object_methods, - ], -}); - -const is_pure_native_fn = make_nested_lookup({ - Array: [ - "isArray", - ], - Math: [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan", - "atan2", - "pow", - "max", - "min", - ], - Number: [ - "isFinite", - "isNaN", - ], - Object: [ - "create", - "getOwnPropertyDescriptor", - "getOwnPropertyNames", - "getPrototypeOf", - "isExtensible", - "isFrozen", - "isSealed", - "hasOwn", - "keys", - ], - String: [ - "fromCharCode", - ], -}); - -// Known numeric values which come with JS environments -const is_pure_native_value = make_nested_lookup({ - Math: [ - "E", - "LN10", - "LN2", - "LOG2E", - "LOG10E", - "PI", - "SQRT1_2", - "SQRT2", - ], - Number: [ - "MAX_VALUE", - "MIN_VALUE", - "NaN", - "NEGATIVE_INFINITY", - "POSITIVE_INFINITY", - ], -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// Functions and methods to infer certain facts about expressions -// It's not always possible to be 100% sure about something just by static analysis, -// so `true` means yes, and `false` means maybe - -const is_undeclared_ref = (node) => - node instanceof AST_SymbolRef && node.definition().undeclared; - -const lazy_op = makePredicate("&& || ??"); -const unary_side_effects = makePredicate("delete ++ --"); - -// methods to determine whether an expression has a boolean result type -(function(def_is_boolean) { - const unary_bool = makePredicate("! delete"); - const binary_bool = makePredicate("in instanceof == != === !== < <= >= >"); - def_is_boolean(AST_Node, return_false); - def_is_boolean(AST_UnaryPrefix, function() { - return unary_bool.has(this.operator); - }); - def_is_boolean(AST_Binary, function() { - return binary_bool.has(this.operator) - || lazy_op.has(this.operator) - && this.left.is_boolean() - && this.right.is_boolean(); - }); - def_is_boolean(AST_Conditional, function() { - return this.consequent.is_boolean() && this.alternative.is_boolean(); - }); - def_is_boolean(AST_Assign, function() { - return this.operator == "=" && this.right.is_boolean(); - }); - def_is_boolean(AST_Sequence, function() { - return this.tail_node().is_boolean(); - }); - def_is_boolean(AST_True, return_true); - def_is_boolean(AST_False, return_true); -})(function(node, func) { - node.DEFMETHOD("is_boolean", func); -}); - -// methods to determine if an expression has a numeric result type -(function(def_is_number) { - def_is_number(AST_Node, return_false); - def_is_number(AST_Number, return_true); - const unary = makePredicate("+ - ~ ++ --"); - def_is_number(AST_Unary, function() { - return unary.has(this.operator) && !(this.expression instanceof AST_BigInt); - }); - const numeric_ops = makePredicate("- * / % & | ^ << >> >>>"); - def_is_number(AST_Binary, function(compressor) { - return numeric_ops.has(this.operator) || this.operator == "+" - && this.left.is_number(compressor) - && this.right.is_number(compressor); - }); - def_is_number(AST_Assign, function(compressor) { - return numeric_ops.has(this.operator.slice(0, -1)) - || this.operator == "=" && this.right.is_number(compressor); - }); - def_is_number(AST_Sequence, function(compressor) { - return this.tail_node().is_number(compressor); - }); - def_is_number(AST_Conditional, function(compressor) { - return this.consequent.is_number(compressor) && this.alternative.is_number(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_number", func); -}); - -// methods to determine if an expression has a string result type -(function(def_is_string) { - def_is_string(AST_Node, return_false); - def_is_string(AST_String, return_true); - def_is_string(AST_TemplateString, return_true); - def_is_string(AST_UnaryPrefix, function() { - return this.operator == "typeof"; - }); - def_is_string(AST_Binary, function(compressor) { - return this.operator == "+" && - (this.left.is_string(compressor) || this.right.is_string(compressor)); - }); - def_is_string(AST_Assign, function(compressor) { - return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); - }); - def_is_string(AST_Sequence, function(compressor) { - return this.tail_node().is_string(compressor); - }); - def_is_string(AST_Conditional, function(compressor) { - return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_string", func); -}); - -function is_undefined(node, compressor) { - return ( - has_flag(node, UNDEFINED) - || node instanceof AST_Undefined - || node instanceof AST_UnaryPrefix - && node.operator == "void" - && !node.expression.has_side_effects(compressor) - ); -} - -// Is the node explicitly null or undefined. -function is_null_or_undefined(node, compressor) { - let fixed; - return ( - node instanceof AST_Null - || is_undefined(node, compressor) - || ( - node instanceof AST_SymbolRef - && (fixed = node.definition().fixed) instanceof AST_Node - && is_nullish(fixed, compressor) - ) - ); -} - -// Find out if this expression is optionally chained from a base-point that we -// can statically analyze as null or undefined. -function is_nullish_shortcircuited(node, compressor) { - if (node instanceof AST_PropAccess || node instanceof AST_Call) { - return ( - (node.optional && is_null_or_undefined(node.expression, compressor)) - || is_nullish_shortcircuited(node.expression, compressor) - ); - } - if (node instanceof AST_Chain) return is_nullish_shortcircuited(node.expression, compressor); - return false; -} - -// Find out if something is == null, or can short circuit into nullish. -// Used to optimize ?. and ?? -function is_nullish(node, compressor) { - if (is_null_or_undefined(node, compressor)) return true; - return is_nullish_shortcircuited(node, compressor); -} - -// Determine if expression might cause side effects -// If there's a possibility that a node may change something when it's executed, this returns true -(function(def_has_side_effects) { - def_has_side_effects(AST_Node, return_true); - - def_has_side_effects(AST_EmptyStatement, return_false); - def_has_side_effects(AST_Constant, return_false); - def_has_side_effects(AST_This, return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].has_side_effects(compressor)) - return true; - return false; - } - - def_has_side_effects(AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def_has_side_effects(AST_Call, function(compressor) { - if ( - !this.is_callee_pure(compressor) - && (!this.expression.is_call_pure(compressor) - || this.expression.has_side_effects(compressor)) - ) { - return true; - } - return any(this.args, compressor); - }); - def_has_side_effects(AST_Switch, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def_has_side_effects(AST_Case, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def_has_side_effects(AST_Try, function(compressor) { - return this.body.has_side_effects(compressor) - || this.bcatch && this.bcatch.has_side_effects(compressor) - || this.bfinally && this.bfinally.has_side_effects(compressor); - }); - def_has_side_effects(AST_If, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.body && this.body.has_side_effects(compressor) - || this.alternative && this.alternative.has_side_effects(compressor); - }); - def_has_side_effects(AST_ImportMeta, return_false); - def_has_side_effects(AST_LabeledStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def_has_side_effects(AST_SimpleStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def_has_side_effects(AST_Lambda, return_false); - def_has_side_effects(AST_Class, function (compressor) { - if (this.extends && this.extends.has_side_effects(compressor)) { - return true; - } - return any(this.properties, compressor); - }); - def_has_side_effects(AST_ClassStaticBlock, function(compressor) { - return any(this.body, compressor); - }); - def_has_side_effects(AST_Binary, function(compressor) { - return this.left.has_side_effects(compressor) - || this.right.has_side_effects(compressor); - }); - def_has_side_effects(AST_Assign, return_true); - def_has_side_effects(AST_Conditional, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.consequent.has_side_effects(compressor) - || this.alternative.has_side_effects(compressor); - }); - def_has_side_effects(AST_Unary, function(compressor) { - return unary_side_effects.has(this.operator) - || this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) && !pure_prop_access_globals.has(this.name); - }); - def_has_side_effects(AST_SymbolClassProperty, return_false); - def_has_side_effects(AST_SymbolDeclaration, return_false); - def_has_side_effects(AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def_has_side_effects(AST_ObjectProperty, function(compressor) { - return ( - this.computed_key() && this.key.has_side_effects(compressor) - || this.value && this.value.has_side_effects(compressor) - ); - }); - def_has_side_effects(AST_ClassProperty, function(compressor) { - return ( - this.computed_key() && this.key.has_side_effects(compressor) - || this.static && this.value && this.value.has_side_effects(compressor) - ); - }); - def_has_side_effects(AST_ConciseMethod, function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(AST_ObjectGetter, function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(AST_ObjectSetter, function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def_has_side_effects(AST_Dot, function(compressor) { - if (is_nullish(this, compressor)) { - return this.expression.has_side_effects(compressor); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return true; - } - - return this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_Sub, function(compressor) { - if (is_nullish(this, compressor)) { - return this.expression.has_side_effects(compressor); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return true; - } - - var property = this.property.has_side_effects(compressor); - if (property && this.optional) return true; // "?." is a condition - - return property || this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_Chain, function (compressor) { - return this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def_has_side_effects(AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def_has_side_effects(AST_VarDef, function() { - return this.value; - }); - def_has_side_effects(AST_TemplateSegment, return_false); - def_has_side_effects(AST_TemplateString, function(compressor) { - return any(this.segments, compressor); - }); -})(function(node, func) { - node.DEFMETHOD("has_side_effects", func); -}); - -// determine if expression may throw -(function(def_may_throw) { - def_may_throw(AST_Node, return_true); - - def_may_throw(AST_Constant, return_false); - def_may_throw(AST_EmptyStatement, return_false); - def_may_throw(AST_Lambda, return_false); - def_may_throw(AST_SymbolDeclaration, return_false); - def_may_throw(AST_This, return_false); - def_may_throw(AST_ImportMeta, return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].may_throw(compressor)) - return true; - return false; - } - - def_may_throw(AST_Class, function(compressor) { - if (this.extends && this.extends.may_throw(compressor)) return true; - return any(this.properties, compressor); - }); - def_may_throw(AST_ClassStaticBlock, function (compressor) { - return any(this.body, compressor); - }); - - def_may_throw(AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def_may_throw(AST_Assign, function(compressor) { - if (this.right.may_throw(compressor)) return true; - if (!compressor.has_directive("use strict") - && this.operator == "=" - && this.left instanceof AST_SymbolRef) { - return false; - } - return this.left.may_throw(compressor); - }); - def_may_throw(AST_Binary, function(compressor) { - return this.left.may_throw(compressor) - || this.right.may_throw(compressor); - }); - def_may_throw(AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def_may_throw(AST_Call, function(compressor) { - if (is_nullish(this, compressor)) return false; - if (any(this.args, compressor)) return true; - if (this.is_callee_pure(compressor)) return false; - if (this.expression.may_throw(compressor)) return true; - return !(this.expression instanceof AST_Lambda) - || any(this.expression.body, compressor); - }); - def_may_throw(AST_Case, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def_may_throw(AST_Conditional, function(compressor) { - return this.condition.may_throw(compressor) - || this.consequent.may_throw(compressor) - || this.alternative.may_throw(compressor); - }); - def_may_throw(AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def_may_throw(AST_If, function(compressor) { - return this.condition.may_throw(compressor) - || this.body && this.body.may_throw(compressor) - || this.alternative && this.alternative.may_throw(compressor); - }); - def_may_throw(AST_LabeledStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def_may_throw(AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def_may_throw(AST_ObjectProperty, function(compressor) { - // TODO key may throw too - return this.value ? this.value.may_throw(compressor) : false; - }); - def_may_throw(AST_ClassProperty, function(compressor) { - return ( - this.computed_key() && this.key.may_throw(compressor) - || this.static && this.value && this.value.may_throw(compressor) - ); - }); - def_may_throw(AST_ConciseMethod, function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw(AST_ObjectGetter, function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw(AST_ObjectSetter, function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw(AST_Return, function(compressor) { - return this.value && this.value.may_throw(compressor); - }); - def_may_throw(AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def_may_throw(AST_SimpleStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def_may_throw(AST_Dot, function(compressor) { - if (is_nullish(this, compressor)) return false; - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor); - }); - def_may_throw(AST_Sub, function(compressor) { - if (is_nullish(this, compressor)) return false; - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor) - || this.property.may_throw(compressor); - }); - def_may_throw(AST_Chain, function(compressor) { - return this.expression.may_throw(compressor); - }); - def_may_throw(AST_Switch, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def_may_throw(AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) && !pure_prop_access_globals.has(this.name); - }); - def_may_throw(AST_SymbolClassProperty, return_false); - def_may_throw(AST_Try, function(compressor) { - return this.bcatch ? this.bcatch.may_throw(compressor) : this.body.may_throw(compressor) - || this.bfinally && this.bfinally.may_throw(compressor); - }); - def_may_throw(AST_Unary, function(compressor) { - if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) - return false; - return this.expression.may_throw(compressor); - }); - def_may_throw(AST_VarDef, function(compressor) { - if (!this.value) return false; - return this.value.may_throw(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("may_throw", func); -}); - -// determine if expression is constant -(function(def_is_constant_expression) { - function all_refs_local(scope) { - let result = true; - walk(this, node => { - if (node instanceof AST_SymbolRef) { - if (has_flag(this, INLINED)) { - result = false; - return walk_abort; - } - var def = node.definition(); - if ( - member(def, this.enclosed) - && !this.variables.has(def.name) - ) { - if (scope) { - var scope_def = scope.find_variable(node); - if (def.undeclared ? !scope_def : scope_def === def) { - result = "f"; - return true; - } - } - result = false; - return walk_abort; - } - return true; - } - if (node instanceof AST_This && this instanceof AST_Arrow) { - result = false; - return walk_abort; - } - }); - return result; - } - - def_is_constant_expression(AST_Node, return_false); - def_is_constant_expression(AST_Constant, return_true); - def_is_constant_expression(AST_Class, function(scope) { - if (this.extends && !this.extends.is_constant_expression(scope)) { - return false; - } - - for (const prop of this.properties) { - if (prop.computed_key() && !prop.key.is_constant_expression(scope)) { - return false; - } - if (prop.static && prop.value && !prop.value.is_constant_expression(scope)) { - return false; - } - if (prop instanceof AST_ClassStaticBlock) { - return false; - } - } - - return all_refs_local.call(this, scope); - }); - def_is_constant_expression(AST_Lambda, all_refs_local); - def_is_constant_expression(AST_Unary, function() { - return this.expression.is_constant_expression(); - }); - def_is_constant_expression(AST_Binary, function() { - return this.left.is_constant_expression() - && this.right.is_constant_expression(); - }); - def_is_constant_expression(AST_Array, function() { - return this.elements.every((l) => l.is_constant_expression()); - }); - def_is_constant_expression(AST_Object, function() { - return this.properties.every((l) => l.is_constant_expression()); - }); - def_is_constant_expression(AST_ObjectProperty, function() { - return !!(!(this.key instanceof AST_Node) && this.value && this.value.is_constant_expression()); - }); -})(function(node, func) { - node.DEFMETHOD("is_constant_expression", func); -}); - - -// may_throw_on_access() -// returns true if this node may be null, undefined or contain `AST_Accessor` -(function(def_may_throw_on_access) { - AST_Node.DEFMETHOD("may_throw_on_access", function(compressor) { - return !compressor.option("pure_getters") - || this._dot_throw(compressor); - }); - - function is_strict(compressor) { - return /strict/.test(compressor.option("pure_getters")); - } - - def_may_throw_on_access(AST_Node, is_strict); - def_may_throw_on_access(AST_Null, return_true); - def_may_throw_on_access(AST_Undefined, return_true); - def_may_throw_on_access(AST_Constant, return_false); - def_may_throw_on_access(AST_Array, return_false); - def_may_throw_on_access(AST_Object, function(compressor) { - if (!is_strict(compressor)) return false; - for (var i = this.properties.length; --i >=0;) - if (this.properties[i]._dot_throw(compressor)) return true; - return false; - }); - // Do not be as strict with classes as we are with objects. - // Hopefully the community is not going to abuse static getters and setters. - // https://github.com/terser/terser/issues/724#issuecomment-643655656 - def_may_throw_on_access(AST_Class, return_false); - def_may_throw_on_access(AST_ObjectProperty, return_false); - def_may_throw_on_access(AST_ObjectGetter, return_true); - def_may_throw_on_access(AST_Expansion, function(compressor) { - return this.expression._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Function, return_false); - def_may_throw_on_access(AST_Arrow, return_false); - def_may_throw_on_access(AST_UnaryPostfix, return_false); - def_may_throw_on_access(AST_UnaryPrefix, function() { - return this.operator == "void"; - }); - def_may_throw_on_access(AST_Binary, function(compressor) { - return (this.operator == "&&" || this.operator == "||" || this.operator == "??") - && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); - }); - def_may_throw_on_access(AST_Assign, function(compressor) { - if (this.logical) return true; - - return this.operator == "=" - && this.right._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Conditional, function(compressor) { - return this.consequent._dot_throw(compressor) - || this.alternative._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Dot, function(compressor) { - if (!is_strict(compressor)) return false; - - if (this.property == "prototype") { - return !( - this.expression instanceof AST_Function - || this.expression instanceof AST_Class - ); - } - return true; - }); - def_may_throw_on_access(AST_Chain, function(compressor) { - return this.expression._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Sequence, function(compressor) { - return this.tail_node()._dot_throw(compressor); - }); - def_may_throw_on_access(AST_SymbolRef, function(compressor) { - if (this.name === "arguments" && this.scope instanceof AST_Lambda) return false; - if (has_flag(this, UNDEFINED)) return true; - if (!is_strict(compressor)) return false; - if (is_undeclared_ref(this) && this.is_declared(compressor)) return false; - if (this.is_immutable()) return false; - var fixed = this.fixed_value(); - return !fixed || fixed._dot_throw(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("_dot_throw", func); -}); - -function is_lhs(node, parent) { - if (parent instanceof AST_Unary && unary_side_effects.has(parent.operator)) return parent.expression; - if (parent instanceof AST_Assign && parent.left === node) return node; - if (parent instanceof AST_ForIn && parent.init === node) return node; -} - -// method to negate an expression -(function(def_negate) { - function basic_negation(exp) { - return make_node(AST_UnaryPrefix, exp, { - operator: "!", - expression: exp - }); - } - function best(orig, alt, first_in_statement) { - var negated = basic_negation(orig); - if (first_in_statement) { - var stat = make_node(AST_SimpleStatement, alt, { - body: alt - }); - return best_of_expression(negated, stat) === stat ? alt : negated; - } - return best_of_expression(negated, alt); - } - def_negate(AST_Node, function() { - return basic_negation(this); - }); - def_negate(AST_Statement, function() { - throw new Error("Cannot negate a statement"); - }); - def_negate(AST_Function, function() { - return basic_negation(this); - }); - def_negate(AST_Class, function() { - return basic_negation(this); - }); - def_negate(AST_Arrow, function() { - return basic_negation(this); - }); - def_negate(AST_UnaryPrefix, function() { - if (this.operator == "!") - return this.expression; - return basic_negation(this); - }); - def_negate(AST_Sequence, function(compressor) { - var expressions = this.expressions.slice(); - expressions.push(expressions.pop().negate(compressor)); - return make_sequence(this, expressions); - }); - def_negate(AST_Conditional, function(compressor, first_in_statement) { - var self = this.clone(); - self.consequent = self.consequent.negate(compressor); - self.alternative = self.alternative.negate(compressor); - return best(this, self, first_in_statement); - }); - def_negate(AST_Binary, function(compressor, first_in_statement) { - var self = this.clone(), op = this.operator; - if (compressor.option("unsafe_comps")) { - switch (op) { - case "<=" : self.operator = ">" ; return self; - case "<" : self.operator = ">=" ; return self; - case ">=" : self.operator = "<" ; return self; - case ">" : self.operator = "<=" ; return self; - } - } - switch (op) { - case "==" : self.operator = "!="; return self; - case "!=" : self.operator = "=="; return self; - case "===": self.operator = "!=="; return self; - case "!==": self.operator = "==="; return self; - case "&&": - self.operator = "||"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - case "||": - self.operator = "&&"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - } - return basic_negation(this); - }); -})(function(node, func) { - node.DEFMETHOD("negate", function(compressor, first_in_statement) { - return func.call(this, compressor, first_in_statement); - }); -}); - -// Is the callee of this function pure? -var global_pure_fns = makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError"); -AST_Call.DEFMETHOD("is_callee_pure", function(compressor) { - if (compressor.option("unsafe")) { - var expr = this.expression; - var first_arg = (this.args && this.args[0] && this.args[0].evaluate(compressor)); - if ( - expr.expression && expr.expression.name === "hasOwnProperty" && - (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) - ) { - return false; - } - if (is_undeclared_ref(expr) && global_pure_fns.has(expr.name)) return true; - if ( - expr instanceof AST_Dot - && is_undeclared_ref(expr.expression) - && is_pure_native_fn(expr.expression.name, expr.property) - ) { - return true; - } - } - if ((this instanceof AST_New) && compressor.option("pure_new")) { - return true; - } - if (compressor.option("side_effects") && has_annotation(this, _PURE)) { - return true; - } - return !compressor.pure_funcs(this); -}); - -// If I call this, is it a pure function? -AST_Node.DEFMETHOD("is_call_pure", return_false); -AST_Dot.DEFMETHOD("is_call_pure", function(compressor) { - if (!compressor.option("unsafe")) return; - const expr = this.expression; - - let native_obj; - if (expr instanceof AST_Array) { - native_obj = "Array"; - } else if (expr.is_boolean()) { - native_obj = "Boolean"; - } else if (expr.is_number(compressor)) { - native_obj = "Number"; - } else if (expr instanceof AST_RegExp) { - native_obj = "RegExp"; - } else if (expr.is_string(compressor)) { - native_obj = "String"; - } else if (!this.may_throw_on_access(compressor)) { - native_obj = "Object"; - } - return native_obj != null && is_pure_native_method(native_obj, this.property); -}); - -// tell me if a statement aborts -const aborts = (thing) => thing && thing.aborts(); - -(function(def_aborts) { - def_aborts(AST_Statement, return_null); - def_aborts(AST_Jump, return_this); - function block_aborts() { - for (var i = 0; i < this.body.length; i++) { - if (aborts(this.body[i])) { - return this.body[i]; - } - } - return null; - } - def_aborts(AST_Import, return_null); - def_aborts(AST_BlockStatement, block_aborts); - def_aborts(AST_SwitchBranch, block_aborts); - def_aborts(AST_DefClass, function () { - for (const prop of this.properties) { - if (prop instanceof AST_ClassStaticBlock) { - if (prop.aborts()) return prop; - } - } - return null; - }); - def_aborts(AST_ClassStaticBlock, block_aborts); - def_aborts(AST_If, function() { - return this.alternative && aborts(this.body) && aborts(this.alternative) && this; - }); -})(function(node, func) { - node.DEFMETHOD("aborts", func); -}); - -AST_Node.DEFMETHOD("contains_this", function() { - return walk(this, node => { - if (node instanceof AST_This) return walk_abort; - if ( - node !== this - && node instanceof AST_Scope - && !(node instanceof AST_Arrow) - ) { - return true; - } - }); -}); - -function is_modified(compressor, tw, node, value, level, immutable) { - var parent = tw.parent(level); - var lhs = is_lhs(node, parent); - if (lhs) return lhs; - if (!immutable - && parent instanceof AST_Call - && parent.expression === node - && !(value instanceof AST_Arrow) - && !(value instanceof AST_Class) - && !parent.is_callee_pure(compressor) - && (!(value instanceof AST_Function) - || !(parent instanceof AST_New) && value.contains_this())) { - return true; - } - if (parent instanceof AST_Array) { - return is_modified(compressor, tw, parent, parent, level + 1); - } - if (parent instanceof AST_ObjectKeyVal && node === parent.value) { - var obj = tw.parent(level + 1); - return is_modified(compressor, tw, obj, obj, level + 2); - } - if (parent instanceof AST_PropAccess && parent.expression === node) { - var prop = read_property(value, parent.property); - return !immutable && is_modified(compressor, tw, parent, prop, level + 1); - } -} - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// methods to evaluate a constant expression - -function def_eval(node, func) { - node.DEFMETHOD("_eval", func); -} - -// Used to propagate a nullish short-circuit signal upwards through the chain. -const nullish = Symbol("This AST_Chain is nullish"); - -// If the node has been successfully reduced to a constant, -// then its value is returned; otherwise the element itself -// is returned. -// They can be distinguished as constant value is never a -// descendant of AST_Node. -AST_Node.DEFMETHOD("evaluate", function (compressor) { - if (!compressor.option("evaluate")) - return this; - var val = this._eval(compressor, 1); - if (!val || val instanceof RegExp) - return val; - if (typeof val == "function" || typeof val == "object" || val == nullish) - return this; - - // Evaluated strings can be larger than the original expression - if (typeof val === "string") { - const unevaluated_size = this.size(compressor); - if (val.length + 2 > unevaluated_size) return this; - } - - return val; -}); - -var unaryPrefix = makePredicate("! ~ - + void"); -AST_Node.DEFMETHOD("is_constant", function () { - // Accomodate when compress option evaluate=false - // as well as the common constant expressions !0 and -1 - if (this instanceof AST_Constant) { - return !(this instanceof AST_RegExp); - } else { - return this instanceof AST_UnaryPrefix - && this.expression instanceof AST_Constant - && unaryPrefix.has(this.operator); - } -}); - -def_eval(AST_Statement, function () { - throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); -}); - -def_eval(AST_Lambda, return_this); -def_eval(AST_Class, return_this); -def_eval(AST_Node, return_this); -def_eval(AST_Constant, function () { - return this.getValue(); -}); - -def_eval(AST_BigInt, return_this); - -def_eval(AST_RegExp, function (compressor) { - let evaluated = compressor.evaluated_regexps.get(this.value); - if (evaluated === undefined && regexp_is_safe(this.value.source)) { - try { - const { source, flags } = this.value; - evaluated = new RegExp(source, flags); - } catch (e) { - evaluated = null; - } - compressor.evaluated_regexps.set(this.value, evaluated); - } - return evaluated || this; -}); - -def_eval(AST_TemplateString, function () { - if (this.segments.length !== 1) return this; - return this.segments[0].value; -}); - -def_eval(AST_Function, function (compressor) { - if (compressor.option("unsafe")) { - var fn = function () { }; - fn.node = this; - fn.toString = () => this.print_to_string(); - return fn; - } - return this; -}); - -def_eval(AST_Array, function (compressor, depth) { - if (compressor.option("unsafe")) { - var elements = []; - for (var i = 0, len = this.elements.length; i < len; i++) { - var element = this.elements[i]; - var value = element._eval(compressor, depth); - if (element === value) - return this; - elements.push(value); - } - return elements; - } - return this; -}); - -def_eval(AST_Object, function (compressor, depth) { - if (compressor.option("unsafe")) { - var val = {}; - for (var i = 0, len = this.properties.length; i < len; i++) { - var prop = this.properties[i]; - if (prop instanceof AST_Expansion) - return this; - var key = prop.key; - if (key instanceof AST_Symbol) { - key = key.name; - } else if (key instanceof AST_Node) { - key = key._eval(compressor, depth); - if (key === prop.key) - return this; - } - if (typeof Object.prototype[key] === "function") { - return this; - } - if (prop.value instanceof AST_Function) - continue; - val[key] = prop.value._eval(compressor, depth); - if (val[key] === prop.value) - return this; - } - return val; - } - return this; -}); - -var non_converting_unary = makePredicate("! typeof void"); -def_eval(AST_UnaryPrefix, function (compressor, depth) { - var e = this.expression; - // Function would be evaluated to an array and so typeof would - // incorrectly return 'object'. Hence making is a special case. - if (compressor.option("typeofs") - && this.operator == "typeof" - && (e instanceof AST_Lambda - || e instanceof AST_SymbolRef - && e.fixed_value() instanceof AST_Lambda)) { - return typeof function () { }; - } - if (!non_converting_unary.has(this.operator)) - depth++; - e = e._eval(compressor, depth); - if (e === this.expression) - return this; - switch (this.operator) { - case "!": return !e; - case "typeof": - // typeof returns "object" or "function" on different platforms - // so cannot evaluate reliably - if (e instanceof RegExp) - return this; - return typeof e; - case "void": return void e; - case "~": return ~e; - case "-": return -e; - case "+": return +e; - } - return this; -}); - -var non_converting_binary = makePredicate("&& || ?? === !=="); -const identity_comparison = makePredicate("== != === !=="); -const has_identity = value => typeof value === "object" - || typeof value === "function" - || typeof value === "symbol"; - -def_eval(AST_Binary, function (compressor, depth) { - if (!non_converting_binary.has(this.operator)) - depth++; - - var left = this.left._eval(compressor, depth); - if (left === this.left) - return this; - var right = this.right._eval(compressor, depth); - if (right === this.right) - return this; - var result; - - if (left != null - && right != null - && identity_comparison.has(this.operator) - && has_identity(left) - && has_identity(right) - && typeof left === typeof right) { - // Do not compare by reference - return this; - } - - switch (this.operator) { - case "&&": result = left && right; break; - case "||": result = left || right; break; - case "??": result = left != null ? left : right; break; - case "|": result = left | right; break; - case "&": result = left & right; break; - case "^": result = left ^ right; break; - case "+": result = left + right; break; - case "*": result = left * right; break; - case "**": result = Math.pow(left, right); break; - case "/": result = left / right; break; - case "%": result = left % right; break; - case "-": result = left - right; break; - case "<<": result = left << right; break; - case ">>": result = left >> right; break; - case ">>>": result = left >>> right; break; - case "==": result = left == right; break; - case "===": result = left === right; break; - case "!=": result = left != right; break; - case "!==": result = left !== right; break; - case "<": result = left < right; break; - case "<=": result = left <= right; break; - case ">": result = left > right; break; - case ">=": result = left >= right; break; - default: - return this; - } - if (isNaN(result) && compressor.find_parent(AST_With)) { - // leave original expression as is - return this; - } - return result; -}); - -def_eval(AST_Conditional, function (compressor, depth) { - var condition = this.condition._eval(compressor, depth); - if (condition === this.condition) - return this; - var node = condition ? this.consequent : this.alternative; - var value = node._eval(compressor, depth); - return value === node ? this : value; -}); - -// Set of AST_SymbolRef which are currently being evaluated. -// Avoids infinite recursion of ._eval() -const reentrant_ref_eval = new Set(); -def_eval(AST_SymbolRef, function (compressor, depth) { - if (reentrant_ref_eval.has(this)) - return this; - - var fixed = this.fixed_value(); - if (!fixed) - return this; - - reentrant_ref_eval.add(this); - const value = fixed._eval(compressor, depth); - reentrant_ref_eval.delete(this); - - if (value === fixed) - return this; - - if (value && typeof value == "object") { - var escaped = this.definition().escaped; - if (escaped && depth > escaped) - return this; - } - return value; -}); - -const global_objs = { Array, Math, Number, Object, String }; - -const regexp_flags = new Set([ - "dotAll", - "global", - "ignoreCase", - "multiline", - "sticky", - "unicode", -]); - -def_eval(AST_PropAccess, function (compressor, depth) { - let obj = this.expression._eval(compressor, depth + 1); - if (obj === nullish || (this.optional && obj == null)) return nullish; - - // `.length` of strings and arrays is always safe - if (this.property === "length") { - if (typeof obj === "string") { - return obj.length; - } - - const is_spreadless_array = - obj instanceof AST_Array - && obj.elements.every(el => !(el instanceof AST_Expansion)); - - if ( - is_spreadless_array - && obj.elements.every(el => !el.has_side_effects(compressor)) - ) { - return obj.elements.length; - } - } - - if (compressor.option("unsafe")) { - var key = this.property; - if (key instanceof AST_Node) { - key = key._eval(compressor, depth); - if (key === this.property) - return this; - } - - var exp = this.expression; - if (is_undeclared_ref(exp)) { - var aa; - var first_arg = exp.name === "hasOwnProperty" - && key === "call" - && (aa = compressor.parent() && compressor.parent().args) - && (aa && aa[0] - && aa[0].evaluate(compressor)); - - first_arg = first_arg instanceof AST_Dot ? first_arg.expression : first_arg; - - if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) { - return this.clone(); - } - if (!is_pure_native_value(exp.name, key)) - return this; - obj = global_objs[exp.name]; - } else { - if (obj instanceof RegExp) { - if (key == "source") { - return regexp_source_fix(obj.source); - } else if (key == "flags" || regexp_flags.has(key)) { - return obj[key]; - } - } - if (!obj || obj === exp || !HOP(obj, key)) - return this; - - if (typeof obj == "function") - switch (key) { - case "name": - return obj.node.name ? obj.node.name.name : ""; - case "length": - return obj.node.length_property(); - default: - return this; - } - } - return obj[key]; - } - return this; -}); - -def_eval(AST_Chain, function (compressor, depth) { - const evaluated = this.expression._eval(compressor, depth); - return evaluated === nullish - ? undefined - : evaluated === this.expression - ? this - : evaluated; -}); - -def_eval(AST_Call, function (compressor, depth) { - var exp = this.expression; - - const callee = exp._eval(compressor, depth); - if (callee === nullish || (this.optional && callee == null)) return nullish; - - if (compressor.option("unsafe") && exp instanceof AST_PropAccess) { - var key = exp.property; - if (key instanceof AST_Node) { - key = key._eval(compressor, depth); - if (key === exp.property) - return this; - } - var val; - var e = exp.expression; - if (is_undeclared_ref(e)) { - var first_arg = e.name === "hasOwnProperty" && - key === "call" && - (this.args[0] && this.args[0].evaluate(compressor)); - - first_arg = first_arg instanceof AST_Dot ? first_arg.expression : first_arg; - - if ((first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)) { - return this.clone(); - } - if (!is_pure_native_fn(e.name, key)) return this; - val = global_objs[e.name]; - } else { - val = e._eval(compressor, depth + 1); - if (val === e || !val) - return this; - if (!is_pure_native_method(val.constructor.name, key)) - return this; - } - var args = []; - for (var i = 0, len = this.args.length; i < len; i++) { - var arg = this.args[i]; - var value = arg._eval(compressor, depth); - if (arg === value) - return this; - if (arg instanceof AST_Lambda) - return this; - args.push(value); - } - try { - return val[key].apply(val, args); - } catch (ex) { - // We don't really care - } - } - return this; -}); - -// Also a subclass of AST_Call -def_eval(AST_New, return_this); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// AST_Node#drop_side_effect_free() gets called when we don't care about the value, -// only about side effects. We'll be defining this method for each node type in this module -// -// Examples: -// foo++ -> foo++ -// 1 + func() -> func() -// 10 -> (nothing) -// knownPureFunc(foo++) -> foo++ - -function def_drop_side_effect_free(node, func) { - node.DEFMETHOD("drop_side_effect_free", func); -} - -// Drop side-effect-free elements from an array of expressions. -// Returns an array of expressions with side-effects or null -// if all elements were dropped. Note: original array may be -// returned if nothing changed. -function trim(nodes, compressor, first_in_statement) { - var len = nodes.length; - if (!len) return null; - - var ret = [], changed = false; - for (var i = 0; i < len; i++) { - var node = nodes[i].drop_side_effect_free(compressor, first_in_statement); - changed |= node !== nodes[i]; - if (node) { - ret.push(node); - first_in_statement = false; - } - } - return changed ? ret.length ? ret : null : nodes; -} - -def_drop_side_effect_free(AST_Node, return_this); -def_drop_side_effect_free(AST_Constant, return_null); -def_drop_side_effect_free(AST_This, return_null); - -def_drop_side_effect_free(AST_Call, function (compressor, first_in_statement) { - if (is_nullish_shortcircuited(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - - if (!this.is_callee_pure(compressor)) { - if (this.expression.is_call_pure(compressor)) { - var exprs = this.args.slice(); - exprs.unshift(this.expression.expression); - exprs = trim(exprs, compressor, first_in_statement); - return exprs && make_sequence(this, exprs); - } - if (is_func_expr(this.expression) - && (!this.expression.name || !this.expression.name.definition().references.length)) { - var node = this.clone(); - node.expression.process_expression(false, compressor); - return node; - } - return this; - } - - var args = trim(this.args, compressor, first_in_statement); - return args && make_sequence(this, args); -}); - -def_drop_side_effect_free(AST_Accessor, return_null); - -def_drop_side_effect_free(AST_Function, return_null); - -def_drop_side_effect_free(AST_Arrow, return_null); - -def_drop_side_effect_free(AST_Class, function (compressor) { - const with_effects = []; - const trimmed_extends = this.extends && this.extends.drop_side_effect_free(compressor); - if (trimmed_extends) - with_effects.push(trimmed_extends); - - for (const prop of this.properties) { - if (prop instanceof AST_ClassStaticBlock) { - if (prop.has_side_effects(compressor)) { - return this; // Be cautious about these - } - } else { - const trimmed_prop = prop.drop_side_effect_free(compressor); - if (trimmed_prop) { - if (trimmed_prop.contains_this()) return this; - - with_effects.push(trimmed_prop); - } - } - } - - if (!with_effects.length) - return null; - - const exprs = make_sequence(this, with_effects); - if (this instanceof AST_DefClass) { - // We want a statement - return make_node(AST_SimpleStatement, this, { body: exprs }); - } else { - return exprs; - } -}); - -def_drop_side_effect_free(AST_ClassProperty, function (compressor) { - const key = this.computed_key() && this.key.drop_side_effect_free(compressor); - - const value = this.static && this.value - && this.value.drop_side_effect_free(compressor); - - if (key && value) - return make_sequence(this, [key, value]); - return key || value || null; -}); - -def_drop_side_effect_free(AST_Binary, function (compressor, first_in_statement) { - var right = this.right.drop_side_effect_free(compressor); - if (!right) - return this.left.drop_side_effect_free(compressor, first_in_statement); - if (lazy_op.has(this.operator)) { - if (right === this.right) - return this; - var node = this.clone(); - node.right = right; - return node; - } else { - var left = this.left.drop_side_effect_free(compressor, first_in_statement); - if (!left) - return this.right.drop_side_effect_free(compressor, first_in_statement); - return make_sequence(this, [left, right]); - } -}); - -def_drop_side_effect_free(AST_Assign, function (compressor) { - if (this.logical) - return this; - - var left = this.left; - if (left.has_side_effects(compressor) - || compressor.has_directive("use strict") - && left instanceof AST_PropAccess - && left.expression.is_constant()) { - return this; - } - set_flag(this, WRITE_ONLY); - while (left instanceof AST_PropAccess) { - left = left.expression; - } - if (left.is_constant_expression(compressor.find_parent(AST_Scope))) { - return this.right.drop_side_effect_free(compressor); - } - return this; -}); - -def_drop_side_effect_free(AST_Conditional, function (compressor) { - var consequent = this.consequent.drop_side_effect_free(compressor); - var alternative = this.alternative.drop_side_effect_free(compressor); - if (consequent === this.consequent && alternative === this.alternative) - return this; - if (!consequent) - return alternative ? make_node(AST_Binary, this, { - operator: "||", - left: this.condition, - right: alternative - }) : this.condition.drop_side_effect_free(compressor); - if (!alternative) - return make_node(AST_Binary, this, { - operator: "&&", - left: this.condition, - right: consequent - }); - var node = this.clone(); - node.consequent = consequent; - node.alternative = alternative; - return node; -}); - -def_drop_side_effect_free(AST_Unary, function (compressor, first_in_statement) { - if (unary_side_effects.has(this.operator)) { - if (!this.expression.has_side_effects(compressor)) { - set_flag(this, WRITE_ONLY); - } else { - clear_flag(this, WRITE_ONLY); - } - return this; - } - if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) - return null; - var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); - if (first_in_statement && expression && is_iife_call(expression)) { - if (expression === this.expression && this.operator == "!") - return this; - return expression.negate(compressor, first_in_statement); - } - return expression; -}); - -def_drop_side_effect_free(AST_SymbolRef, function (compressor) { - const safe_access = this.is_declared(compressor) - || pure_prop_access_globals.has(this.name); - return safe_access ? null : this; -}); - -def_drop_side_effect_free(AST_Object, function (compressor, first_in_statement) { - var values = trim(this.properties, compressor, first_in_statement); - return values && make_sequence(this, values); -}); - -def_drop_side_effect_free(AST_ObjectProperty, function (compressor, first_in_statement) { - const computed_key = this instanceof AST_ObjectKeyVal && this.key instanceof AST_Node; - const key = computed_key && this.key.drop_side_effect_free(compressor, first_in_statement); - const value = this.value && this.value.drop_side_effect_free(compressor, first_in_statement); - if (key && value) { - return make_sequence(this, [key, value]); - } - return key || value; -}); - -def_drop_side_effect_free(AST_ConciseMethod, function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free(AST_ObjectGetter, function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free(AST_ObjectSetter, function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free(AST_Array, function (compressor, first_in_statement) { - var values = trim(this.elements, compressor, first_in_statement); - return values && make_sequence(this, values); -}); - -def_drop_side_effect_free(AST_Dot, function (compressor, first_in_statement) { - if (is_nullish_shortcircuited(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return this; - } - - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(AST_Sub, function (compressor, first_in_statement) { - if (is_nullish_shortcircuited(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return this; - } - - var property = this.property.drop_side_effect_free(compressor); - if (property && this.optional) return this; - - var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); - - if (expression && property) return make_sequence(this, [expression, property]); - return expression || property; -}); - -def_drop_side_effect_free(AST_Chain, function (compressor, first_in_statement) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(AST_Sequence, function (compressor) { - var last = this.tail_node(); - var expr = last.drop_side_effect_free(compressor); - if (expr === last) - return this; - var expressions = this.expressions.slice(0, -1); - if (expr) - expressions.push(expr); - if (!expressions.length) { - return make_node(AST_Number, this, { value: 0 }); - } - return make_sequence(this, expressions); -}); - -def_drop_side_effect_free(AST_Expansion, function (compressor, first_in_statement) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(AST_TemplateSegment, return_null); - -def_drop_side_effect_free(AST_TemplateString, function (compressor) { - var values = trim(this.segments, compressor, first_in_statement); - return values && make_sequence(this, values); -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -const r_keep_assign = /keep_assign/; - -/** Drop unused variables from this scope */ -AST_Scope.DEFMETHOD("drop_unused", function(compressor) { - if (!compressor.option("unused")) return; - if (compressor.has_directive("use asm")) return; - if (!this.variables) return; // not really a scope (eg: AST_Class) - - var self = this; - if (self.pinned()) return; - var drop_funcs = !(self instanceof AST_Toplevel) || compressor.toplevel.funcs; - var drop_vars = !(self instanceof AST_Toplevel) || compressor.toplevel.vars; - const assign_as_unused = r_keep_assign.test(compressor.option("unused")) ? return_false : function(node) { - if (node instanceof AST_Assign - && !node.logical - && (has_flag(node, WRITE_ONLY) || node.operator == "=") - ) { - return node.left; - } - if (node instanceof AST_Unary && has_flag(node, WRITE_ONLY)) { - return node.expression; - } - }; - var in_use_ids = new Map(); - var fixed_ids = new Map(); - if (self instanceof AST_Toplevel && compressor.top_retain) { - self.variables.forEach(function(def) { - if (compressor.top_retain(def)) { - in_use_ids.set(def.id, def); - } - }); - } - var var_defs_by_id = new Map(); - var initializations = new Map(); - // pass 1: find out which symbols are directly used in - // this scope (not in nested scopes). - var scope = this; - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) { - node.argnames.forEach(function(argname) { - if (!(argname instanceof AST_SymbolDeclaration)) return; - var def = argname.definition(); - in_use_ids.set(def.id, def); - }); - } - if (node === self) return; - if (node instanceof AST_Class) { - if (node.has_side_effects(compressor)) { - node.visit_nondeferred_class_parts(tw); - } - } - if (node instanceof AST_Defun || node instanceof AST_DefClass) { - var node_def = node.name.definition(); - const in_export = tw.parent() instanceof AST_Export; - if (in_export || !drop_funcs && scope === self) { - if (node_def.global) { - in_use_ids.set(node_def.id, node_def); - } - } - - map_add(initializations, node_def.id, node); - return true; // don't go in nested scopes - } - // In the root scope, we drop things. In inner scopes, we just check for uses. - const in_root_scope = scope === self; - if (node instanceof AST_SymbolFunarg && in_root_scope) { - map_add(var_defs_by_id, node.definition().id, node); - } - if (node instanceof AST_Definitions && in_root_scope) { - const in_export = tw.parent() instanceof AST_Export; - node.definitions.forEach(function(def) { - if (def.name instanceof AST_SymbolVar) { - map_add(var_defs_by_id, def.name.definition().id, def); - } - if (in_export || !drop_vars) { - walk(def.name, node => { - if (node instanceof AST_SymbolDeclaration) { - const def = node.definition(); - if (def.global) { - in_use_ids.set(def.id, def); - } - } - }); - } - if (def.name instanceof AST_Destructuring) { - def.walk(tw); - } - if (def.name instanceof AST_SymbolDeclaration && def.value) { - var node_def = def.name.definition(); - map_add(initializations, node_def.id, def.value); - if (!node_def.chained && def.name.fixed_value() === def.value) { - fixed_ids.set(node_def.id, def); - } - if (def.value.has_side_effects(compressor)) { - def.value.walk(tw); - } - } - }); - return true; - } - return scan_ref_scoped(node, descend); - }); - self.walk(tw); - // pass 2: for every used symbol we need to walk its - // initialization code to figure out if it uses other - // symbols (that may not be in_use). - tw = new TreeWalker(scan_ref_scoped); - in_use_ids.forEach(function (def) { - var init = initializations.get(def.id); - if (init) init.forEach(function(init) { - init.walk(tw); - }); - }); - // pass 3: we should drop declarations not in_use - var tt = new TreeTransformer( - function before(node, descend, in_list) { - var parent = tt.parent(); - if (drop_vars) { - const sym = assign_as_unused(node); - if (sym instanceof AST_SymbolRef) { - var def = sym.definition(); - var in_use = in_use_ids.has(def.id); - if (node instanceof AST_Assign) { - if (!in_use || fixed_ids.has(def.id) && fixed_ids.get(def.id) !== node) { - return maintain_this_binding(parent, node, node.right.transform(tt)); - } - } else if (!in_use) { - return in_list ? MAP.skip : make_node(AST_Number, node, { value: 0 }); - } - } - } - if (scope !== self) return; - var def; - if (node.name - && (node instanceof AST_ClassExpression - && !keep_name(compressor.option("keep_classnames"), (def = node.name.definition()).name) - || node instanceof AST_Function - && !keep_name(compressor.option("keep_fnames"), (def = node.name.definition()).name))) { - // any declarations with same name will overshadow - // name of this anonymous function and can therefore - // never be used anywhere - if (!in_use_ids.has(def.id) || def.orig.length > 1) node.name = null; - } - if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) { - var trim = !compressor.option("keep_fargs"); - for (var a = node.argnames, i = a.length; --i >= 0;) { - var sym = a[i]; - if (sym instanceof AST_Expansion) { - sym = sym.expression; - } - if (sym instanceof AST_DefaultAssign) { - sym = sym.left; - } - // Do not drop destructuring arguments. - // They constitute a type assertion of sorts - if ( - !(sym instanceof AST_Destructuring) - && !in_use_ids.has(sym.definition().id) - ) { - set_flag(sym, UNUSED); - if (trim) { - a.pop(); - } - } else { - trim = false; - } - } - } - if (node instanceof AST_DefClass && node !== self) { - const def = node.name.definition(); - descend(node, this); - const keep_class = def.global && !drop_funcs || in_use_ids.has(def.id); - if (!keep_class) { - const kept = node.drop_side_effect_free(compressor); - if (kept == null) { - def.eliminated++; - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - } - return kept; - } - return node; - } - if (node instanceof AST_Defun && node !== self) { - const def = node.name.definition(); - const keep = def.global && !drop_funcs || in_use_ids.has(def.id); - if (!keep) { - def.eliminated++; - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - } - } - if (node instanceof AST_Definitions && !(parent instanceof AST_ForIn && parent.init === node)) { - var drop_block = !(parent instanceof AST_Toplevel) && !(node instanceof AST_Var); - // place uninitialized names at the start - var body = [], head = [], tail = []; - // for unused names whose initialization has - // side effects, we can cascade the init. code - // into the next one, or next statement. - var side_effects = []; - node.definitions.forEach(function(def) { - if (def.value) def.value = def.value.transform(tt); - var is_destructure = def.name instanceof AST_Destructuring; - var sym = is_destructure - ? new SymbolDef(null, { name: "" }) /* fake SymbolDef */ - : def.name.definition(); - if (drop_block && sym.global) return tail.push(def); - if (!(drop_vars || drop_block) - || is_destructure - && (def.name.names.length - || def.name.is_array - || compressor.option("pure_getters") != true) - || in_use_ids.has(sym.id) - ) { - if (def.value && fixed_ids.has(sym.id) && fixed_ids.get(sym.id) !== def) { - def.value = def.value.drop_side_effect_free(compressor); - } - if (def.name instanceof AST_SymbolVar) { - var var_defs = var_defs_by_id.get(sym.id); - if (var_defs.length > 1 && (!def.value || sym.orig.indexOf(def.name) > sym.eliminated)) { - if (def.value) { - var ref = make_node(AST_SymbolRef, def.name, def.name); - sym.references.push(ref); - var assign = make_node(AST_Assign, def, { - operator: "=", - logical: false, - left: ref, - right: def.value - }); - if (fixed_ids.get(sym.id) === def) { - fixed_ids.set(sym.id, assign); - } - side_effects.push(assign.transform(tt)); - } - remove(var_defs, def); - sym.eliminated++; - return; - } - } - if (def.value) { - if (side_effects.length > 0) { - if (tail.length > 0) { - side_effects.push(def.value); - def.value = make_sequence(def.value, side_effects); - } else { - body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(node, side_effects) - })); - } - side_effects = []; - } - tail.push(def); - } else { - head.push(def); - } - } else if (sym.orig[0] instanceof AST_SymbolCatch) { - var value = def.value && def.value.drop_side_effect_free(compressor); - if (value) side_effects.push(value); - def.value = null; - head.push(def); - } else { - var value = def.value && def.value.drop_side_effect_free(compressor); - if (value) { - side_effects.push(value); - } - sym.eliminated++; - } - }); - if (head.length > 0 || tail.length > 0) { - node.definitions = head.concat(tail); - body.push(node); - } - if (side_effects.length > 0) { - body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(node, side_effects) - })); - } - switch (body.length) { - case 0: - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - case 1: - return body[0]; - default: - return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, { body }); - } - } - // certain combination of unused name + side effect leads to: - // https://github.com/mishoo/UglifyJS2/issues/44 - // https://github.com/mishoo/UglifyJS2/issues/1830 - // https://github.com/mishoo/UglifyJS2/issues/1838 - // that's an invalid AST. - // We fix it at this stage by moving the `var` outside the `for`. - if (node instanceof AST_For) { - descend(node, this); - var block; - if (node.init instanceof AST_BlockStatement) { - block = node.init; - node.init = block.body.pop(); - block.body.push(node); - } - if (node.init instanceof AST_SimpleStatement) { - node.init = node.init.body; - } else if (is_empty(node.init)) { - node.init = null; - } - return !block ? node : in_list ? MAP.splice(block.body) : block; - } - if (node instanceof AST_LabeledStatement - && node.body instanceof AST_For - ) { - descend(node, this); - if (node.body instanceof AST_BlockStatement) { - var block = node.body; - node.body = block.body.pop(); - block.body.push(node); - return in_list ? MAP.splice(block.body) : block; - } - return node; - } - if (node instanceof AST_BlockStatement) { - descend(node, this); - if (in_list && node.body.every(can_be_evicted_from_block)) { - return MAP.splice(node.body); - } - return node; - } - if (node instanceof AST_Scope && !(node instanceof AST_ClassStaticBlock)) { - const save_scope = scope; - scope = node; - descend(node, this); - scope = save_scope; - return node; - } - } - ); - - self.transform(tt); - - function scan_ref_scoped(node, descend) { - var node_def; - const sym = assign_as_unused(node); - if (sym instanceof AST_SymbolRef - && !is_ref_of(node.left, AST_SymbolBlockDeclaration) - && self.variables.get(sym.name) === (node_def = sym.definition()) - ) { - if (node instanceof AST_Assign) { - node.right.walk(tw); - if (!node_def.chained && node.left.fixed_value() === node.right) { - fixed_ids.set(node_def.id, node); - } - } - return true; - } - if (node instanceof AST_SymbolRef) { - node_def = node.definition(); - if (!in_use_ids.has(node_def.id)) { - in_use_ids.set(node_def.id, node_def); - if (node_def.orig[0] instanceof AST_SymbolCatch) { - const redef = node_def.scope.is_block_scope() - && node_def.scope.get_defun_scope().variables.get(node_def.name); - if (redef) in_use_ids.set(redef.id, redef); - } - } - return true; - } - if (node instanceof AST_Class) { - descend(); - return true; - } - if (node instanceof AST_Scope && !(node instanceof AST_ClassStaticBlock)) { - var save_scope = scope; - scope = node; - descend(); - scope = save_scope; - return true; - } - } -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -/** - * Define the method AST_Node#reduce_vars, which goes through the AST in - * execution order to perform basic flow analysis - */ -function def_reduce_vars(node, func) { - node.DEFMETHOD("reduce_vars", func); -} - -def_reduce_vars(AST_Node, noop); - -/** Clear definition properties */ -function reset_def(compressor, def) { - def.assignments = 0; - def.chained = false; - def.direct_access = false; - def.escaped = 0; - def.recursive_refs = 0; - def.references = []; - def.single_use = undefined; - if ( - def.scope.pinned() - || (def.orig[0] instanceof AST_SymbolFunarg && def.scope.uses_arguments) - ) { - def.fixed = false; - } else if (def.orig[0] instanceof AST_SymbolConst || !compressor.exposed(def)) { - def.fixed = def.init; - } else { - def.fixed = false; - } -} - -function reset_variables(tw, compressor, node) { - node.variables.forEach(function(def) { - reset_def(compressor, def); - if (def.fixed === null) { - tw.defs_to_safe_ids.set(def.id, tw.safe_ids); - mark(tw, def, true); - } else if (def.fixed) { - tw.loop_ids.set(def.id, tw.in_loop); - mark(tw, def, true); - } - }); -} - -function reset_block_variables(compressor, node) { - if (node.block_scope) node.block_scope.variables.forEach((def) => { - reset_def(compressor, def); - }); -} - -function push(tw) { - tw.safe_ids = Object.create(tw.safe_ids); -} - -function pop(tw) { - tw.safe_ids = Object.getPrototypeOf(tw.safe_ids); -} - -function mark(tw, def, safe) { - tw.safe_ids[def.id] = safe; -} - -function safe_to_read(tw, def) { - if (def.single_use == "m") return false; - if (tw.safe_ids[def.id]) { - if (def.fixed == null) { - var orig = def.orig[0]; - if (orig instanceof AST_SymbolFunarg || orig.name == "arguments") return false; - def.fixed = make_node(AST_Undefined, orig); - } - return true; - } - return def.fixed instanceof AST_Defun; -} - -function safe_to_assign(tw, def, scope, value) { - if (def.fixed === undefined) return true; - let def_safe_ids; - if (def.fixed === null - && (def_safe_ids = tw.defs_to_safe_ids.get(def.id)) - ) { - def_safe_ids[def.id] = false; - tw.defs_to_safe_ids.delete(def.id); - return true; - } - if (!HOP(tw.safe_ids, def.id)) return false; - if (!safe_to_read(tw, def)) return false; - if (def.fixed === false) return false; - if (def.fixed != null && (!value || def.references.length > def.assignments)) return false; - if (def.fixed instanceof AST_Defun) { - return value instanceof AST_Node && def.fixed.parent_scope === scope; - } - return def.orig.every((sym) => { - return !(sym instanceof AST_SymbolConst - || sym instanceof AST_SymbolDefun - || sym instanceof AST_SymbolLambda); - }); -} - -function ref_once(tw, compressor, def) { - return compressor.option("unused") - && !def.scope.pinned() - && def.references.length - def.recursive_refs == 1 - && tw.loop_ids.get(def.id) === tw.in_loop; -} - -function is_immutable(value) { - if (!value) return false; - return value.is_constant() - || value instanceof AST_Lambda - || value instanceof AST_This; -} - -// A definition "escapes" when its value can leave the point of use. -// Example: `a = b || c` -// In this example, "b" and "c" are escaping, because they're going into "a" -// -// def.escaped is != 0 when it escapes. -// -// When greater than 1, it means that N chained properties will be read off -// of that def before an escape occurs. This is useful for evaluating -// property accesses, where you need to know when to stop. -function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) { - var parent = tw.parent(level); - if (value) { - if (value.is_constant()) return; - if (value instanceof AST_ClassExpression) return; - } - - if ( - parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right - || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New) - || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope - || parent instanceof AST_VarDef && node === parent.value - || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope - ) { - if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; - if (!d.escaped || d.escaped > depth) d.escaped = depth; - return; - } else if ( - parent instanceof AST_Array - || parent instanceof AST_Await - || parent instanceof AST_Binary && lazy_op.has(parent.operator) - || parent instanceof AST_Conditional && node !== parent.condition - || parent instanceof AST_Expansion - || parent instanceof AST_Sequence && node === parent.tail_node() - ) { - mark_escaped(tw, d, scope, parent, parent, level + 1, depth); - } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) { - var obj = tw.parent(level + 1); - - mark_escaped(tw, d, scope, obj, obj, level + 2, depth); - } else if (parent instanceof AST_PropAccess && node === parent.expression) { - value = read_property(value, parent.property); - - mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); - if (value) return; - } - - if (level > 0) return; - if (parent instanceof AST_Sequence && node !== parent.tail_node()) return; - if (parent instanceof AST_SimpleStatement) return; - - d.direct_access = true; -} - -const suppress = node => walk(node, node => { - if (!(node instanceof AST_Symbol)) return; - var d = node.definition(); - if (!d) return; - if (node instanceof AST_SymbolRef) d.references.push(node); - d.fixed = false; -}); - -def_reduce_vars(AST_Accessor, function(tw, descend, compressor) { - push(tw); - reset_variables(tw, compressor, this); - descend(); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Assign, function(tw, descend, compressor) { - var node = this; - if (node.left instanceof AST_Destructuring) { - suppress(node.left); - return; - } - - const finish_walk = () => { - if (node.logical) { - node.left.walk(tw); - - push(tw); - node.right.walk(tw); - pop(tw); - - return true; - } - }; - - var sym = node.left; - if (!(sym instanceof AST_SymbolRef)) return finish_walk(); - - var def = sym.definition(); - var safe = safe_to_assign(tw, def, sym.scope, node.right); - def.assignments++; - if (!safe) return finish_walk(); - - var fixed = def.fixed; - if (!fixed && node.operator != "=" && !node.logical) return finish_walk(); - - var eq = node.operator == "="; - var value = eq ? node.right : node; - if (is_modified(compressor, tw, node, value, 0)) return finish_walk(); - - def.references.push(sym); - - if (!node.logical) { - if (!eq) def.chained = true; - - def.fixed = eq ? function() { - return node.right; - } : function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: fixed instanceof AST_Node ? fixed : fixed(), - right: node.right - }); - }; - } - - if (node.logical) { - mark(tw, def, false); - push(tw); - node.right.walk(tw); - pop(tw); - return true; - } - - mark(tw, def, false); - node.right.walk(tw); - mark(tw, def, true); - - mark_escaped(tw, def, sym.scope, node, value, 0, 1); - - return true; -}); - -def_reduce_vars(AST_Binary, function(tw) { - if (!lazy_op.has(this.operator)) return; - this.left.walk(tw); - push(tw); - this.right.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Block, function(tw, descend, compressor) { - reset_block_variables(compressor, this); -}); - -def_reduce_vars(AST_Case, function(tw) { - push(tw); - this.expression.walk(tw); - pop(tw); - push(tw); - walk_body(this, tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Class, function(tw, descend) { - clear_flag(this, INLINED); - push(tw); - descend(); - pop(tw); - return true; -}); - -def_reduce_vars(AST_ClassStaticBlock, function(tw, descend, compressor) { - reset_block_variables(compressor, this); -}); - -def_reduce_vars(AST_Conditional, function(tw) { - this.condition.walk(tw); - push(tw); - this.consequent.walk(tw); - pop(tw); - push(tw); - this.alternative.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Chain, function(tw, descend) { - // Chains' conditions apply left-to-right, cumulatively. - // If we walk normally we don't go in that order because we would pop before pushing again - // Solution: AST_PropAccess and AST_Call push when they are optional, and never pop. - // Then we pop everything when they are done being walked. - const safe_ids = tw.safe_ids; - - descend(); - - // Unroll back to start - tw.safe_ids = safe_ids; - return true; -}); - -def_reduce_vars(AST_Call, function (tw) { - this.expression.walk(tw); - - if (this.optional) { - // Never pop -- it's popped at AST_Chain above - push(tw); - } - - for (const arg of this.args) arg.walk(tw); - - return true; -}); - -def_reduce_vars(AST_PropAccess, function (tw) { - if (!this.optional) return; - - this.expression.walk(tw); - - // Never pop -- it's popped at AST_Chain above - push(tw); - - if (this.property instanceof AST_Node) this.property.walk(tw); - - return true; -}); - -def_reduce_vars(AST_Default, function(tw, descend) { - push(tw); - descend(); - pop(tw); - return true; -}); - -function mark_lambda(tw, descend, compressor) { - clear_flag(this, INLINED); - push(tw); - reset_variables(tw, compressor, this); - - var iife; - if (!this.name - && !this.uses_arguments - && !this.pinned() - && (iife = tw.parent()) instanceof AST_Call - && iife.expression === this - && !iife.args.some(arg => arg instanceof AST_Expansion) - && this.argnames.every(arg_name => arg_name instanceof AST_Symbol) - ) { - // Virtually turn IIFE parameters into variable definitions: - // (function(a,b) {...})(c,d) => (function() {var a=c,b=d; ...})() - // So existing transformation rules can work on them. - this.argnames.forEach((arg, i) => { - if (!arg.definition) return; - var d = arg.definition(); - // Avoid setting fixed when there's more than one origin for a variable value - if (d.orig.length > 1) return; - if (d.fixed === undefined && (!this.uses_arguments || tw.has_directive("use strict"))) { - d.fixed = function() { - return iife.args[i] || make_node(AST_Undefined, iife); - }; - tw.loop_ids.set(d.id, tw.in_loop); - mark(tw, d, true); - } else { - d.fixed = false; - } - }); - } - - descend(); - pop(tw); - - handle_defined_after_hoist(this); - - return true; -} - -/** - * It's possible for a hoisted function to use something that's not defined yet. Example: - * - * hoisted(); - * var defined_after = true; - * function hoisted() { - * // use defined_after - * } - * - * This function is called on the parent to handle this issue. - */ -function handle_defined_after_hoist(parent) { - const defuns = []; - walk(parent, node => { - if (node === parent) return; - if (node instanceof AST_Defun) defuns.push(node); - if ( - node instanceof AST_Scope - || node instanceof AST_SimpleStatement - ) return true; - }); - - const symbols_of_interest = new Set(); - const defuns_of_interest = new Set(); - const potential_conflicts = []; - - for (const defun of defuns) { - const fname_def = defun.name.definition(); - const found_self_ref_in_other_defuns = defuns.some( - d => d !== defun && d.enclosed.indexOf(fname_def) !== -1 - ); - - for (const def of defun.enclosed) { - if ( - def.fixed === false - || def === fname_def - || def.scope.get_defun_scope() !== parent - ) { - continue; - } - - // defun is hoisted, so always safe - if ( - def.assignments === 0 - && def.orig.length === 1 - && def.orig[0] instanceof AST_SymbolDefun - ) { - continue; - } - - if (found_self_ref_in_other_defuns) { - def.fixed = false; - continue; - } - - // for the slower checks below this loop - potential_conflicts.push({ defun, def, fname_def }); - symbols_of_interest.add(def.id); - symbols_of_interest.add(fname_def.id); - defuns_of_interest.add(defun); - } - } - - // linearize all symbols, and locate defs that are read after the defun - if (potential_conflicts.length) { - // All "symbols of interest", that is, defuns or defs, that we found. - // These are placed in order so we can check which is after which. - const found_symbols = []; - // Indices of `found_symbols` which are writes - const found_symbol_writes = new Set(); - // Defun ranges are recorded because we don't care if a function uses the def internally - const defun_ranges = new Map(); - - let tw; - parent.walk((tw = new TreeWalker((node, descend) => { - if (node instanceof AST_Defun && defuns_of_interest.has(node)) { - const start = found_symbols.length; - descend(); - const end = found_symbols.length; - - defun_ranges.set(node, { start, end }); - return true; - } - // if we found a defun on the list, mark IN_DEFUN=id and descend - - if (node instanceof AST_Symbol && node.thedef) { - const id = node.definition().id; - if (symbols_of_interest.has(id)) { - if (node instanceof AST_SymbolDeclaration || is_lhs(node, tw)) { - found_symbol_writes.add(found_symbols.length); - } - found_symbols.push(id); - } - } - }))); - - for (const { def, defun, fname_def } of potential_conflicts) { - const defun_range = defun_ranges.get(defun); - - // find the index in `found_symbols`, with some special rules: - const find = (sym_id, starting_at = 0, must_be_write = false) => { - let index = starting_at; - - for (;;) { - index = found_symbols.indexOf(sym_id, index); - - if (index === -1) { - break; - } else if (index >= defun_range.start && index < defun_range.end) { - index = defun_range.end; - continue; - } else if (must_be_write && !found_symbol_writes.has(index)) { - index++; - continue; - } else { - break; - } - } - - return index; - }; - - const read_defun_at = find(fname_def.id); - const wrote_def_at = find(def.id, read_defun_at + 1, true); - - const wrote_def_after_reading_defun = read_defun_at != -1 && wrote_def_at != -1 && wrote_def_at > read_defun_at; - - if (wrote_def_after_reading_defun) { - def.fixed = false; - } - } - } -} - -def_reduce_vars(AST_Lambda, mark_lambda); - -def_reduce_vars(AST_Do, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - if (has_break_or_continue(this)) { - pop(tw); - push(tw); - } - this.condition.walk(tw); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(AST_For, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - if (this.init) this.init.walk(tw); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - if (this.condition) this.condition.walk(tw); - this.body.walk(tw); - if (this.step) { - if (has_break_or_continue(this)) { - pop(tw); - push(tw); - } - this.step.walk(tw); - } - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(AST_ForIn, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - suppress(this.init); - this.object.walk(tw); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(AST_If, function(tw) { - this.condition.walk(tw); - push(tw); - this.body.walk(tw); - pop(tw); - if (this.alternative) { - push(tw); - this.alternative.walk(tw); - pop(tw); - } - return true; -}); - -def_reduce_vars(AST_LabeledStatement, function(tw) { - push(tw); - this.body.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_SymbolCatch, function() { - this.definition().fixed = false; -}); - -def_reduce_vars(AST_SymbolRef, function(tw, descend, compressor) { - var d = this.definition(); - d.references.push(this); - if (d.references.length == 1 - && !d.fixed - && d.orig[0] instanceof AST_SymbolDefun) { - tw.loop_ids.set(d.id, tw.in_loop); - } - var fixed_value; - if (d.fixed === undefined || !safe_to_read(tw, d)) { - d.fixed = false; - } else if (d.fixed) { - fixed_value = this.fixed_value(); - if ( - fixed_value instanceof AST_Lambda - && is_recursive_ref(tw, d) - ) { - d.recursive_refs++; - } else if (fixed_value - && !compressor.exposed(d) - && ref_once(tw, compressor, d) - ) { - d.single_use = - fixed_value instanceof AST_Lambda && !fixed_value.pinned() - || fixed_value instanceof AST_Class - || d.scope === this.scope && fixed_value.is_constant_expression(); - } else { - d.single_use = false; - } - if (is_modified(compressor, tw, this, fixed_value, 0, is_immutable(fixed_value))) { - if (d.single_use) { - d.single_use = "m"; - } else { - d.fixed = false; - } - } - } - mark_escaped(tw, d, this.scope, this, fixed_value, 0, 1); -}); - -def_reduce_vars(AST_Toplevel, function(tw, descend, compressor) { - this.globals.forEach(function(def) { - reset_def(compressor, def); - }); - reset_variables(tw, compressor, this); - descend(); - handle_defined_after_hoist(this); - return true; -}); - -def_reduce_vars(AST_Try, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - push(tw); - this.body.walk(tw); - pop(tw); - if (this.bcatch) { - push(tw); - this.bcatch.walk(tw); - pop(tw); - } - if (this.bfinally) this.bfinally.walk(tw); - return true; -}); - -def_reduce_vars(AST_Unary, function(tw) { - var node = this; - if (node.operator !== "++" && node.operator !== "--") return; - var exp = node.expression; - if (!(exp instanceof AST_SymbolRef)) return; - var def = exp.definition(); - var safe = safe_to_assign(tw, def, exp.scope, true); - def.assignments++; - if (!safe) return; - var fixed = def.fixed; - if (!fixed) return; - def.references.push(exp); - def.chained = true; - def.fixed = function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: make_node(AST_UnaryPrefix, node, { - operator: "+", - expression: fixed instanceof AST_Node ? fixed : fixed() - }), - right: make_node(AST_Number, node, { - value: 1 - }) - }); - }; - mark(tw, def, true); - return true; -}); - -def_reduce_vars(AST_VarDef, function(tw, descend) { - var node = this; - if (node.name instanceof AST_Destructuring) { - suppress(node.name); - return; - } - var d = node.name.definition(); - if (node.value) { - if (safe_to_assign(tw, d, node.name.scope, node.value)) { - d.fixed = function() { - return node.value; - }; - tw.loop_ids.set(d.id, tw.in_loop); - mark(tw, d, false); - descend(); - mark(tw, d, true); - return true; - } else { - d.fixed = false; - } - } -}); - -def_reduce_vars(AST_While, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - descend(); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -function loop_body(x) { - if (x instanceof AST_IterationStatement) { - return x.body instanceof AST_BlockStatement ? x.body : x; - } - return x; -} - -function is_lhs_read_only(lhs) { - if (lhs instanceof AST_This) return true; - if (lhs instanceof AST_SymbolRef) return lhs.definition().orig[0] instanceof AST_SymbolLambda; - if (lhs instanceof AST_PropAccess) { - lhs = lhs.expression; - if (lhs instanceof AST_SymbolRef) { - if (lhs.is_immutable()) return false; - lhs = lhs.fixed_value(); - } - if (!lhs) return true; - if (lhs instanceof AST_RegExp) return false; - if (lhs instanceof AST_Constant) return true; - return is_lhs_read_only(lhs); - } - return false; -} - -/** var a = 1 --> var a*/ -function remove_initializers(var_statement) { - var decls = []; - var_statement.definitions.forEach(function(def) { - if (def.name instanceof AST_SymbolDeclaration) { - def.value = null; - decls.push(def); - } else { - def.declarations_as_names().forEach(name => { - decls.push(make_node(AST_VarDef, def, { - name, - value: null - })); - }); - } - }); - return decls.length ? make_node(AST_Var, var_statement, { definitions: decls }) : null; -} - -/** Called on code which we know is unreachable, to keep elements that affect outside of it. */ -function trim_unreachable_code(compressor, stat, target) { - walk(stat, node => { - if (node instanceof AST_Var) { - const no_initializers = remove_initializers(node); - if (no_initializers) target.push(no_initializers); - return true; - } - if ( - node instanceof AST_Defun - && (node === stat || !compressor.has_directive("use strict")) - ) { - target.push(node === stat ? node : make_node(AST_Var, node, { - definitions: [ - make_node(AST_VarDef, node, { - name: make_node(AST_SymbolVar, node.name, node.name), - value: null - }) - ] - })); - return true; - } - if (node instanceof AST_Export || node instanceof AST_Import) { - target.push(node); - return true; - } - if (node instanceof AST_Scope) { - return true; - } - }); -} - -/** Tighten a bunch of statements together, and perform statement-level optimization. */ -function tighten_body(statements, compressor) { - const nearest_scope = compressor.find_scope(); - const defun_scope = nearest_scope.get_defun_scope(); - const { in_loop, in_try } = find_loop_scope_try(); - - var CHANGED, max_iter = 10; - do { - CHANGED = false; - eliminate_spurious_blocks(statements); - if (compressor.option("dead_code")) { - eliminate_dead_code(statements, compressor); - } - if (compressor.option("if_return")) { - handle_if_return(statements, compressor); - } - if (compressor.sequences_limit > 0) { - sequencesize(statements, compressor); - sequencesize_2(statements, compressor); - } - if (compressor.option("join_vars")) { - join_consecutive_vars(statements); - } - if (compressor.option("collapse_vars")) { - collapse(statements, compressor); - } - } while (CHANGED && max_iter-- > 0); - - function find_loop_scope_try() { - var node = compressor.self(), level = 0, in_loop = false, in_try = false; - do { - if (node instanceof AST_IterationStatement) { - in_loop = true; - } else if (node instanceof AST_Scope) { - break; - } else if (node instanceof AST_TryBlock) { - in_try = true; - } - } while (node = compressor.parent(level++)); - - return { in_loop, in_try }; - } - - // Search from right to left for assignment-like expressions: - // - `var a = x;` - // - `a = x;` - // - `++a` - // For each candidate, scan from left to right for first usage, then try - // to fold assignment into the site for compression. - // Will not attempt to collapse assignments into or past code blocks - // which are not sequentially executed, e.g. loops and conditionals. - function collapse(statements, compressor) { - if (nearest_scope.pinned() || defun_scope.pinned()) - return statements; - var args; - var candidates = []; - var stat_index = statements.length; - var scanner = new TreeTransformer(function (node) { - if (abort) - return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) - return node; - hit_index++; - if (hit_index < hit_stack.length) - return handle_custom_scan_order(node); - hit = true; - stop_after = find_stop(node, 0); - if (stop_after === node) - abort = true; - return node; - } - // Stop immediately if these node types are encountered - var parent = scanner.parent(); - if (node instanceof AST_Assign - && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left)) - || node instanceof AST_Await - || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) - || - (node instanceof AST_Call || node instanceof AST_PropAccess) - && node.optional - || node instanceof AST_Debugger - || node instanceof AST_Destructuring - || node instanceof AST_Expansion - && node.expression instanceof AST_Symbol - && ( - node.expression instanceof AST_This - || node.expression.definition().references.length > 1 - ) - || node instanceof AST_IterationStatement && !(node instanceof AST_For) - || node instanceof AST_LoopControl - || node instanceof AST_Try - || node instanceof AST_With - || node instanceof AST_Yield - || node instanceof AST_Export - || node instanceof AST_Class - || parent instanceof AST_For && node !== parent.init - || !replace_all - && ( - node instanceof AST_SymbolRef - && !node.is_declared(compressor) - && !pure_prop_access_globals.has(node) - ) - || node instanceof AST_SymbolRef - && parent instanceof AST_Call - && has_annotation(parent, _NOINLINE) - ) { - abort = true; - return node; - } - // Stop only if candidate is found within conditional branches - if (!stop_if_hit && (!lhs_local || !replace_all) - && (parent instanceof AST_Binary && lazy_op.has(parent.operator) && parent.left !== node - || parent instanceof AST_Conditional && parent.condition !== node - || parent instanceof AST_If && parent.condition !== node)) { - stop_if_hit = parent; - } - // Replace variable with assignment when found - if ( - can_replace - && !(node instanceof AST_SymbolDeclaration) - && lhs.equivalent_to(node) - && !shadows(scanner.find_scope() || nearest_scope, lvalues) - ) { - if (stop_if_hit) { - abort = true; - return node; - } - if (is_lhs(node, parent)) { - if (value_def) - replaced++; - return node; - } else { - replaced++; - if (value_def && candidate instanceof AST_VarDef) - return node; - } - CHANGED = abort = true; - if (candidate instanceof AST_UnaryPostfix) { - return make_node(AST_UnaryPrefix, candidate, candidate); - } - if (candidate instanceof AST_VarDef) { - var def = candidate.name.definition(); - var value = candidate.value; - if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) { - def.replaced++; - if (funarg && is_identifier_atom(value)) { - return value.transform(compressor); - } else { - return maintain_this_binding(parent, node, value); - } - } - return make_node(AST_Assign, candidate, { - operator: "=", - logical: false, - left: make_node(AST_SymbolRef, candidate.name, candidate.name), - right: value - }); - } - clear_flag(candidate, WRITE_ONLY); - return candidate; - } - // These node types have child nodes that execute sequentially, - // but are otherwise not safe to scan into or beyond them. - var sym; - if (node instanceof AST_Call - || node instanceof AST_Exit - && (side_effects || lhs instanceof AST_PropAccess || may_modify(lhs)) - || node instanceof AST_PropAccess - && (side_effects || node.expression.may_throw_on_access(compressor)) - || node instanceof AST_SymbolRef - && ((lvalues.has(node.name) && lvalues.get(node.name).modified) || side_effects && may_modify(node)) - || node instanceof AST_VarDef && node.value - && (lvalues.has(node.name.name) || side_effects && may_modify(node.name)) - || (sym = is_lhs(node.left, node)) - && (sym instanceof AST_PropAccess || lvalues.has(sym.name)) - || may_throw - && (in_try ? node.has_side_effects(compressor) : side_effects_external(node))) { - stop_after = node; - if (node instanceof AST_Scope) - abort = true; - } - return handle_custom_scan_order(node); - }, function (node) { - if (abort) - return; - if (stop_after === node) - abort = true; - if (stop_if_hit === node) - stop_if_hit = null; - }); - - var multi_replacer = new TreeTransformer(function (node) { - if (abort) - return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) - return node; - hit_index++; - if (hit_index < hit_stack.length) - return; - hit = true; - return node; - } - // Replace variable when found - if (node instanceof AST_SymbolRef - && node.name == def.name) { - if (!--replaced) - abort = true; - if (is_lhs(node, multi_replacer.parent())) - return node; - def.replaced++; - value_def.replaced--; - return candidate.value; - } - // Skip (non-executed) functions and (leading) default case in switch statements - if (node instanceof AST_Default || node instanceof AST_Scope) - return node; - }); - - while (--stat_index >= 0) { - // Treat parameters as collapsible in IIFE, i.e. - // function(a, b){ ... }(x()); - // would be translated into equivalent assignments: - // var a = x(), b = undefined; - if (stat_index == 0 && compressor.option("unused")) - extract_args(); - // Find collapsible assignments - var hit_stack = []; - extract_candidates(statements[stat_index]); - while (candidates.length > 0) { - hit_stack = candidates.pop(); - var hit_index = 0; - var candidate = hit_stack[hit_stack.length - 1]; - var value_def = null; - var stop_after = null; - var stop_if_hit = null; - var lhs = get_lhs(candidate); - if (!lhs || is_lhs_read_only(lhs) || lhs.has_side_effects(compressor)) - continue; - // Locate symbols which may execute code outside of scanning range - var lvalues = get_lvalues(candidate); - var lhs_local = is_lhs_local(lhs); - if (lhs instanceof AST_SymbolRef) { - lvalues.set(lhs.name, { def: lhs.definition(), modified: false }); - } - var side_effects = value_has_side_effects(candidate); - var replace_all = replace_all_symbols(); - var may_throw = candidate.may_throw(compressor); - var funarg = candidate.name instanceof AST_SymbolFunarg; - var hit = funarg; - var abort = false, replaced = 0, can_replace = !args || !hit; - if (!can_replace) { - for ( - let j = compressor.self().argnames.lastIndexOf(candidate.name) + 1; - !abort && j < args.length; - j++ - ) { - args[j].transform(scanner); - } - can_replace = true; - } - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(scanner); - } - if (value_def) { - var def = candidate.name.definition(); - if (abort && def.references.length - def.replaced > replaced) - replaced = false; - else { - abort = false; - hit_index = 0; - hit = funarg; - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(multi_replacer); - } - value_def.single_use = false; - } - } - if (replaced && !remove_candidate(candidate)) - statements.splice(stat_index, 1); - } - } - - function handle_custom_scan_order(node) { - // Skip (non-executed) functions - if (node instanceof AST_Scope) - return node; - - // Scan case expressions first in a switch statement - if (node instanceof AST_Switch) { - node.expression = node.expression.transform(scanner); - for (var i = 0, len = node.body.length; !abort && i < len; i++) { - var branch = node.body[i]; - if (branch instanceof AST_Case) { - if (!hit) { - if (branch !== hit_stack[hit_index]) - continue; - hit_index++; - } - branch.expression = branch.expression.transform(scanner); - if (!replace_all) - break; - } - } - abort = true; - return node; - } - } - - function redefined_within_scope(def, scope) { - if (def.global) - return false; - let cur_scope = def.scope; - while (cur_scope && cur_scope !== scope) { - if (cur_scope.variables.has(def.name)) { - return true; - } - cur_scope = cur_scope.parent_scope; - } - return false; - } - - function has_overlapping_symbol(fn, arg, fn_strict) { - var found = false, scan_this = !(fn instanceof AST_Arrow); - arg.walk(new TreeWalker(function (node, descend) { - if (found) - return true; - if (node instanceof AST_SymbolRef && (fn.variables.has(node.name) || redefined_within_scope(node.definition(), fn))) { - var s = node.definition().scope; - if (s !== defun_scope) - while (s = s.parent_scope) { - if (s === defun_scope) - return true; - } - return found = true; - } - if ((fn_strict || scan_this) && node instanceof AST_This) { - return found = true; - } - if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) { - var prev = scan_this; - scan_this = false; - descend(); - scan_this = prev; - return true; - } - })); - return found; - } - - function extract_args() { - var iife, fn = compressor.self(); - if (is_func_expr(fn) - && !fn.name - && !fn.uses_arguments - && !fn.pinned() - && (iife = compressor.parent()) instanceof AST_Call - && iife.expression === fn - && iife.args.every((arg) => !(arg instanceof AST_Expansion))) { - var fn_strict = compressor.has_directive("use strict"); - if (fn_strict && !member(fn_strict, fn.body)) - fn_strict = false; - var len = fn.argnames.length; - args = iife.args.slice(len); - var names = new Set(); - for (var i = len; --i >= 0;) { - var sym = fn.argnames[i]; - var arg = iife.args[i]; - // The following two line fix is a duplicate of the fix at - // https://github.com/terser/terser/commit/011d3eb08cefe6922c7d1bdfa113fc4aeaca1b75 - // This might mean that these two pieces of code (one here in collapse_vars and another in reduce_vars - // Might be doing the exact same thing. - const def = sym.definition && sym.definition(); - const is_reassigned = def && def.orig.length > 1; - if (is_reassigned) - continue; - args.unshift(make_node(AST_VarDef, sym, { - name: sym, - value: arg - })); - if (names.has(sym.name)) - continue; - names.add(sym.name); - if (sym instanceof AST_Expansion) { - var elements = iife.args.slice(i); - if (elements.every((arg) => !has_overlapping_symbol(fn, arg, fn_strict) - )) { - candidates.unshift([make_node(AST_VarDef, sym, { - name: sym.expression, - value: make_node(AST_Array, iife, { - elements: elements - }) - })]); - } - } else { - if (!arg) { - arg = make_node(AST_Undefined, sym).transform(compressor); - } else if (arg instanceof AST_Lambda && arg.pinned() - || has_overlapping_symbol(fn, arg, fn_strict)) { - arg = null; - } - if (arg) - candidates.unshift([make_node(AST_VarDef, sym, { - name: sym, - value: arg - })]); - } - } - } - } - - function extract_candidates(expr) { - hit_stack.push(expr); - if (expr instanceof AST_Assign) { - if (!expr.left.has_side_effects(compressor) - && !(expr.right instanceof AST_Chain)) { - candidates.push(hit_stack.slice()); - } - extract_candidates(expr.right); - } else if (expr instanceof AST_Binary) { - extract_candidates(expr.left); - extract_candidates(expr.right); - } else if (expr instanceof AST_Call && !has_annotation(expr, _NOINLINE)) { - extract_candidates(expr.expression); - expr.args.forEach(extract_candidates); - } else if (expr instanceof AST_Case) { - extract_candidates(expr.expression); - } else if (expr instanceof AST_Conditional) { - extract_candidates(expr.condition); - extract_candidates(expr.consequent); - extract_candidates(expr.alternative); - } else if (expr instanceof AST_Definitions) { - var len = expr.definitions.length; - // limit number of trailing variable definitions for consideration - var i = len - 200; - if (i < 0) - i = 0; - for (; i < len; i++) { - extract_candidates(expr.definitions[i]); - } - } else if (expr instanceof AST_DWLoop) { - extract_candidates(expr.condition); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_Exit) { - if (expr.value) - extract_candidates(expr.value); - } else if (expr instanceof AST_For) { - if (expr.init) - extract_candidates(expr.init); - if (expr.condition) - extract_candidates(expr.condition); - if (expr.step) - extract_candidates(expr.step); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_ForIn) { - extract_candidates(expr.object); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_If) { - extract_candidates(expr.condition); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - if (expr.alternative && !(expr.alternative instanceof AST_Block)) { - extract_candidates(expr.alternative); - } - } else if (expr instanceof AST_Sequence) { - expr.expressions.forEach(extract_candidates); - } else if (expr instanceof AST_SimpleStatement) { - extract_candidates(expr.body); - } else if (expr instanceof AST_Switch) { - extract_candidates(expr.expression); - expr.body.forEach(extract_candidates); - } else if (expr instanceof AST_Unary) { - if (expr.operator == "++" || expr.operator == "--") { - candidates.push(hit_stack.slice()); - } - } else if (expr instanceof AST_VarDef) { - if (expr.value && !(expr.value instanceof AST_Chain)) { - candidates.push(hit_stack.slice()); - extract_candidates(expr.value); - } - } - hit_stack.pop(); - } - - function find_stop(node, level, write_only) { - var parent = scanner.parent(level); - if (parent instanceof AST_Assign) { - if (write_only - && !parent.logical - && !(parent.left instanceof AST_PropAccess - || lvalues.has(parent.left.name))) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_Binary) { - if (write_only && (!lazy_op.has(parent.operator) || parent.left === node)) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_Call) - return node; - if (parent instanceof AST_Case) - return node; - if (parent instanceof AST_Conditional) { - if (write_only && parent.condition === node) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_Definitions) { - return find_stop(parent, level + 1, true); - } - if (parent instanceof AST_Exit) { - return write_only ? find_stop(parent, level + 1, write_only) : node; - } - if (parent instanceof AST_If) { - if (write_only && parent.condition === node) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_IterationStatement) - return node; - if (parent instanceof AST_Sequence) { - return find_stop(parent, level + 1, parent.tail_node() !== node); - } - if (parent instanceof AST_SimpleStatement) { - return find_stop(parent, level + 1, true); - } - if (parent instanceof AST_Switch) - return node; - if (parent instanceof AST_VarDef) - return node; - return null; - } - - function mangleable_var(var_def) { - var value = var_def.value; - if (!(value instanceof AST_SymbolRef)) - return; - if (value.name == "arguments") - return; - var def = value.definition(); - if (def.undeclared) - return; - return value_def = def; - } - - function get_lhs(expr) { - if (expr instanceof AST_Assign && expr.logical) { - return false; - } else if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { - var def = expr.name.definition(); - if (!member(expr.name, def.orig)) - return; - var referenced = def.references.length - def.replaced; - if (!referenced) - return; - var declared = def.orig.length - def.eliminated; - if (declared > 1 && !(expr.name instanceof AST_SymbolFunarg) - || (referenced > 1 ? mangleable_var(expr) : !compressor.exposed(def))) { - return make_node(AST_SymbolRef, expr.name, expr.name); - } - } else { - const lhs = expr instanceof AST_Assign - ? expr.left - : expr.expression; - return !is_ref_of(lhs, AST_SymbolConst) - && !is_ref_of(lhs, AST_SymbolLet) && lhs; - } - } - - function get_rvalue(expr) { - if (expr instanceof AST_Assign) { - return expr.right; - } else { - return expr.value; - } - } - - function get_lvalues(expr) { - var lvalues = new Map(); - if (expr instanceof AST_Unary) - return lvalues; - var tw = new TreeWalker(function (node) { - var sym = node; - while (sym instanceof AST_PropAccess) - sym = sym.expression; - if (sym instanceof AST_SymbolRef) { - const prev = lvalues.get(sym.name); - if (!prev || !prev.modified) { - lvalues.set(sym.name, { - def: sym.definition(), - modified: is_modified(compressor, tw, node, node, 0) - }); - } - } - }); - get_rvalue(expr).walk(tw); - return lvalues; - } - - function remove_candidate(expr) { - if (expr.name instanceof AST_SymbolFunarg) { - var iife = compressor.parent(), argnames = compressor.self().argnames; - var index = argnames.indexOf(expr.name); - if (index < 0) { - iife.args.length = Math.min(iife.args.length, argnames.length - 1); - } else { - var args = iife.args; - if (args[index]) - args[index] = make_node(AST_Number, args[index], { - value: 0 - }); - } - return true; - } - var found = false; - return statements[stat_index].transform(new TreeTransformer(function (node, descend, in_list) { - if (found) - return node; - if (node === expr || node.body === expr) { - found = true; - if (node instanceof AST_VarDef) { - node.value = node.name instanceof AST_SymbolConst - ? make_node(AST_Undefined, node.value) // `const` always needs value. - : null; - return node; - } - return in_list ? MAP.skip : null; - } - }, function (node) { - if (node instanceof AST_Sequence) - switch (node.expressions.length) { - case 0: return null; - case 1: return node.expressions[0]; - } - })); - } - - function is_lhs_local(lhs) { - while (lhs instanceof AST_PropAccess) - lhs = lhs.expression; - return lhs instanceof AST_SymbolRef - && lhs.definition().scope.get_defun_scope() === defun_scope - && !(in_loop - && (lvalues.has(lhs.name) - || candidate instanceof AST_Unary - || (candidate instanceof AST_Assign - && !candidate.logical - && candidate.operator != "="))); - } - - function value_has_side_effects(expr) { - if (expr instanceof AST_Unary) - return unary_side_effects.has(expr.operator); - return get_rvalue(expr).has_side_effects(compressor); - } - - function replace_all_symbols() { - if (side_effects) - return false; - if (value_def) - return true; - if (lhs instanceof AST_SymbolRef) { - var def = lhs.definition(); - if (def.references.length - def.replaced == (candidate instanceof AST_VarDef ? 1 : 2)) { - return true; - } - } - return false; - } - - function may_modify(sym) { - if (!sym.definition) - return true; // AST_Destructuring - var def = sym.definition(); - if (def.orig.length == 1 && def.orig[0] instanceof AST_SymbolDefun) - return false; - if (def.scope.get_defun_scope() !== defun_scope) - return true; - return def.references.some((ref) => - ref.scope.get_defun_scope() !== defun_scope - ); - } - - function side_effects_external(node, lhs) { - if (node instanceof AST_Assign) - return side_effects_external(node.left, true); - if (node instanceof AST_Unary) - return side_effects_external(node.expression, true); - if (node instanceof AST_VarDef) - return node.value && side_effects_external(node.value); - if (lhs) { - if (node instanceof AST_Dot) - return side_effects_external(node.expression, true); - if (node instanceof AST_Sub) - return side_effects_external(node.expression, true); - if (node instanceof AST_SymbolRef) - return node.definition().scope.get_defun_scope() !== defun_scope; - } - return false; - } - - /** - * Will any of the pulled-in lvalues shadow a variable in newScope or parents? - * similar to scope_encloses_variables_in_this_scope */ - function shadows(my_scope, lvalues) { - for (const { def } of lvalues.values()) { - const looked_up = my_scope.find_variable(def.name); - if (looked_up) { - if (looked_up === def) continue; - return true; - } - } - return false; - } - } - - function eliminate_spurious_blocks(statements) { - var seen_dirs = []; - for (var i = 0; i < statements.length;) { - var stat = statements[i]; - if (stat instanceof AST_BlockStatement && stat.body.every(can_be_evicted_from_block)) { - CHANGED = true; - eliminate_spurious_blocks(stat.body); - statements.splice(i, 1, ...stat.body); - i += stat.body.length; - } else if (stat instanceof AST_EmptyStatement) { - CHANGED = true; - statements.splice(i, 1); - } else if (stat instanceof AST_Directive) { - if (seen_dirs.indexOf(stat.value) < 0) { - i++; - seen_dirs.push(stat.value); - } else { - CHANGED = true; - statements.splice(i, 1); - } - } else - i++; - } - } - - function handle_if_return(statements, compressor) { - var self = compressor.self(); - var multiple_if_returns = has_multiple_if_returns(statements); - var in_lambda = self instanceof AST_Lambda; - // Prevent extremely deep nesting - // https://github.com/terser/terser/issues/1432 - // https://github.com/webpack/webpack/issues/17548 - const iteration_start = Math.min(statements.length, 500); - for (var i = iteration_start; --i >= 0;) { - var stat = statements[i]; - var j = next_index(i); - var next = statements[j]; - - if (in_lambda && !next && stat instanceof AST_Return) { - if (!stat.value) { - CHANGED = true; - statements.splice(i, 1); - continue; - } - if (stat.value instanceof AST_UnaryPrefix && stat.value.operator == "void") { - CHANGED = true; - statements[i] = make_node(AST_SimpleStatement, stat, { - body: stat.value.expression - }); - continue; - } - } - - if (stat instanceof AST_If) { - let ab, new_else; - - ab = aborts(stat.body); - if ( - can_merge_flow(ab) - && (new_else = as_statement_array_with_return(stat.body, ab)) - ) { - if (ab.label) { - remove(ab.label.thedef.references, ab); - } - CHANGED = true; - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = make_node(AST_BlockStatement, stat, { - body: as_statement_array(stat.alternative).concat(extract_functions()) - }); - stat.alternative = make_node(AST_BlockStatement, stat, { - body: new_else - }); - statements[i] = stat.transform(compressor); - continue; - } - - ab = aborts(stat.alternative); - if ( - can_merge_flow(ab) - && (new_else = as_statement_array_with_return(stat.alternative, ab)) - ) { - if (ab.label) { - remove(ab.label.thedef.references, ab); - } - CHANGED = true; - stat = stat.clone(); - stat.body = make_node(AST_BlockStatement, stat.body, { - body: as_statement_array(stat.body).concat(extract_functions()) - }); - stat.alternative = make_node(AST_BlockStatement, stat.alternative, { - body: new_else - }); - statements[i] = stat.transform(compressor); - continue; - } - } - - if (stat instanceof AST_If && stat.body instanceof AST_Return) { - var value = stat.body.value; - //--- - // pretty silly case, but: - // if (foo()) return; return; ==> foo(); return; - if (!value && !stat.alternative - && (in_lambda && !next || next instanceof AST_Return && !next.value)) { - CHANGED = true; - statements[i] = make_node(AST_SimpleStatement, stat.condition, { - body: stat.condition - }); - continue; - } - //--- - // if (foo()) return x; return y; ==> return foo() ? x : y; - if (value && !stat.alternative && next instanceof AST_Return && next.value) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = next; - statements[i] = stat.transform(compressor); - statements.splice(j, 1); - continue; - } - //--- - // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined; - if (value && !stat.alternative - && (!next && in_lambda && multiple_if_returns - || next instanceof AST_Return)) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = next || make_node(AST_Return, stat, { - value: null - }); - statements[i] = stat.transform(compressor); - if (next) - statements.splice(j, 1); - continue; - } - //--- - // if (a) return b; if (c) return d; e; ==> return a ? b : c ? d : void e; - // - // if sequences is not enabled, this can lead to an endless loop (issue #866). - // however, with sequences on this helps producing slightly better output for - // the example code. - var prev = statements[prev_index(i)]; - if (compressor.option("sequences") && in_lambda && !stat.alternative - && prev instanceof AST_If && prev.body instanceof AST_Return - && next_index(j) == statements.length && next instanceof AST_SimpleStatement) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = make_node(AST_BlockStatement, next, { - body: [ - next, - make_node(AST_Return, next, { - value: null - }) - ] - }); - statements[i] = stat.transform(compressor); - statements.splice(j, 1); - continue; - } - } - } - - function has_multiple_if_returns(statements) { - var n = 0; - for (var i = statements.length; --i >= 0;) { - var stat = statements[i]; - if (stat instanceof AST_If && stat.body instanceof AST_Return) { - if (++n > 1) - return true; - } - } - return false; - } - - function is_return_void(value) { - return !value || value instanceof AST_UnaryPrefix && value.operator == "void"; - } - - function can_merge_flow(ab) { - if (!ab) - return false; - for (var j = i + 1, len = statements.length; j < len; j++) { - var stat = statements[j]; - if (stat instanceof AST_Const || stat instanceof AST_Let) - return false; - } - var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null; - return ab instanceof AST_Return && in_lambda && is_return_void(ab.value) - || ab instanceof AST_Continue && self === loop_body(lct) - || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct; - } - - function extract_functions() { - var tail = statements.slice(i + 1); - statements.length = i + 1; - return tail.filter(function (stat) { - if (stat instanceof AST_Defun) { - statements.push(stat); - return false; - } - return true; - }); - } - - function as_statement_array_with_return(node, ab) { - var body = as_statement_array(node); - if (ab !== body[body.length - 1]) { - return undefined; - } - body = body.slice(0, -1); - if (ab.value) { - body.push(make_node(AST_SimpleStatement, ab.value, { - body: ab.value.expression - })); - } - return body; - } - - function next_index(i) { - for (var j = i + 1, len = statements.length; j < len; j++) { - var stat = statements[j]; - if (!(stat instanceof AST_Var && declarations_only(stat))) { - break; - } - } - return j; - } - - function prev_index(i) { - for (var j = i; --j >= 0;) { - var stat = statements[j]; - if (!(stat instanceof AST_Var && declarations_only(stat))) { - break; - } - } - return j; - } - } - - function eliminate_dead_code(statements, compressor) { - var has_quit; - var self = compressor.self(); - for (var i = 0, n = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof AST_LoopControl) { - var lct = compressor.loopcontrol_target(stat); - if (stat instanceof AST_Break - && !(lct instanceof AST_IterationStatement) - && loop_body(lct) === self - || stat instanceof AST_Continue - && loop_body(lct) === self) { - if (stat.label) { - remove(stat.label.thedef.references, stat); - } - } else { - statements[n++] = stat; - } - } else { - statements[n++] = stat; - } - if (aborts(stat)) { - has_quit = statements.slice(i + 1); - break; - } - } - statements.length = n; - CHANGED = n != len; - if (has_quit) - has_quit.forEach(function (stat) { - trim_unreachable_code(compressor, stat, statements); - }); - } - - function declarations_only(node) { - return node.definitions.every((var_def) => !var_def.value); - } - - function sequencesize(statements, compressor) { - if (statements.length < 2) - return; - var seq = [], n = 0; - function push_seq() { - if (!seq.length) - return; - var body = make_sequence(seq[0], seq); - statements[n++] = make_node(AST_SimpleStatement, body, { body: body }); - seq = []; - } - for (var i = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof AST_SimpleStatement) { - if (seq.length >= compressor.sequences_limit) - push_seq(); - var body = stat.body; - if (seq.length > 0) - body = body.drop_side_effect_free(compressor); - if (body) - merge_sequence(seq, body); - } else if (stat instanceof AST_Definitions && declarations_only(stat) - || stat instanceof AST_Defun) { - statements[n++] = stat; - } else { - push_seq(); - statements[n++] = stat; - } - } - push_seq(); - statements.length = n; - if (n != len) - CHANGED = true; - } - - function to_simple_statement(block, decls) { - if (!(block instanceof AST_BlockStatement)) - return block; - var stat = null; - for (var i = 0, len = block.body.length; i < len; i++) { - var line = block.body[i]; - if (line instanceof AST_Var && declarations_only(line)) { - decls.push(line); - } else if (stat || line instanceof AST_Const || line instanceof AST_Let) { - return false; - } else { - stat = line; - } - } - return stat; - } - - function sequencesize_2(statements, compressor) { - function cons_seq(right) { - n--; - CHANGED = true; - var left = prev.body; - return make_sequence(left, [left, right]).transform(compressor); - } - var n = 0, prev; - for (var i = 0; i < statements.length; i++) { - var stat = statements[i]; - if (prev) { - if (stat instanceof AST_Exit) { - stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor)); - } else if (stat instanceof AST_For) { - if (!(stat.init instanceof AST_Definitions)) { - const abort = walk(prev.body, node => { - if (node instanceof AST_Scope) - return true; - if (node instanceof AST_Binary - && node.operator === "in") { - return walk_abort; - } - }); - if (!abort) { - if (stat.init) - stat.init = cons_seq(stat.init); - else { - stat.init = prev.body; - n--; - CHANGED = true; - } - } - } - } else if (stat instanceof AST_ForIn) { - if (!(stat.init instanceof AST_Const) && !(stat.init instanceof AST_Let)) { - stat.object = cons_seq(stat.object); - } - } else if (stat instanceof AST_If) { - stat.condition = cons_seq(stat.condition); - } else if (stat instanceof AST_Switch) { - stat.expression = cons_seq(stat.expression); - } else if (stat instanceof AST_With) { - stat.expression = cons_seq(stat.expression); - } - } - if (compressor.option("conditionals") && stat instanceof AST_If) { - var decls = []; - var body = to_simple_statement(stat.body, decls); - var alt = to_simple_statement(stat.alternative, decls); - if (body !== false && alt !== false && decls.length > 0) { - var len = decls.length; - decls.push(make_node(AST_If, stat, { - condition: stat.condition, - body: body || make_node(AST_EmptyStatement, stat.body), - alternative: alt - })); - decls.unshift(n, 1); - [].splice.apply(statements, decls); - i += len; - n += len + 1; - prev = null; - CHANGED = true; - continue; - } - } - statements[n++] = stat; - prev = stat instanceof AST_SimpleStatement ? stat : null; - } - statements.length = n; - } - - function join_object_assignments(defn, body) { - if (!(defn instanceof AST_Definitions)) - return; - var def = defn.definitions[defn.definitions.length - 1]; - if (!(def.value instanceof AST_Object)) - return; - var exprs; - if (body instanceof AST_Assign && !body.logical) { - exprs = [body]; - } else if (body instanceof AST_Sequence) { - exprs = body.expressions.slice(); - } - if (!exprs) - return; - var trimmed = false; - do { - var node = exprs[0]; - if (!(node instanceof AST_Assign)) - break; - if (node.operator != "=") - break; - if (!(node.left instanceof AST_PropAccess)) - break; - var sym = node.left.expression; - if (!(sym instanceof AST_SymbolRef)) - break; - if (def.name.name != sym.name) - break; - if (!node.right.is_constant_expression(nearest_scope)) - break; - var prop = node.left.property; - if (prop instanceof AST_Node) { - prop = prop.evaluate(compressor); - } - if (prop instanceof AST_Node) - break; - prop = "" + prop; - var diff = compressor.option("ecma") < 2015 - && compressor.has_directive("use strict") ? function (node) { - return node.key != prop && (node.key && node.key.name != prop); - } : function (node) { - return node.key && node.key.name != prop; - }; - if (!def.value.properties.every(diff)) - break; - var p = def.value.properties.filter(function (p) { return p.key === prop; })[0]; - if (!p) { - def.value.properties.push(make_node(AST_ObjectKeyVal, node, { - key: prop, - value: node.right - })); - } else { - p.value = new AST_Sequence({ - start: p.start, - expressions: [p.value.clone(), node.right.clone()], - end: p.end - }); - } - exprs.shift(); - trimmed = true; - } while (exprs.length); - return trimmed && exprs; - } - - function join_consecutive_vars(statements) { - var defs; - for (var i = 0, j = -1, len = statements.length; i < len; i++) { - var stat = statements[i]; - var prev = statements[j]; - if (stat instanceof AST_Definitions) { - if (prev && prev.TYPE == stat.TYPE) { - prev.definitions = prev.definitions.concat(stat.definitions); - CHANGED = true; - } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) { - defs.definitions = defs.definitions.concat(stat.definitions); - CHANGED = true; - } else { - statements[++j] = stat; - defs = stat; - } - } else if (stat instanceof AST_Exit) { - stat.value = extract_object_assignments(stat.value); - } else if (stat instanceof AST_For) { - var exprs = join_object_assignments(prev, stat.init); - if (exprs) { - CHANGED = true; - stat.init = exprs.length ? make_sequence(stat.init, exprs) : null; - statements[++j] = stat; - } else if ( - prev instanceof AST_Var - && (!stat.init || stat.init.TYPE == prev.TYPE) - ) { - if (stat.init) { - prev.definitions = prev.definitions.concat(stat.init.definitions); - } - stat.init = prev; - statements[j] = stat; - CHANGED = true; - } else if ( - defs instanceof AST_Var - && stat.init instanceof AST_Var - && declarations_only(stat.init) - ) { - defs.definitions = defs.definitions.concat(stat.init.definitions); - stat.init = null; - statements[++j] = stat; - CHANGED = true; - } else { - statements[++j] = stat; - } - } else if (stat instanceof AST_ForIn) { - stat.object = extract_object_assignments(stat.object); - } else if (stat instanceof AST_If) { - stat.condition = extract_object_assignments(stat.condition); - } else if (stat instanceof AST_SimpleStatement) { - var exprs = join_object_assignments(prev, stat.body); - if (exprs) { - CHANGED = true; - if (!exprs.length) - continue; - stat.body = make_sequence(stat.body, exprs); - } - statements[++j] = stat; - } else if (stat instanceof AST_Switch) { - stat.expression = extract_object_assignments(stat.expression); - } else if (stat instanceof AST_With) { - stat.expression = extract_object_assignments(stat.expression); - } else { - statements[++j] = stat; - } - } - statements.length = j + 1; - - function extract_object_assignments(value) { - statements[++j] = stat; - var exprs = join_object_assignments(prev, value); - if (exprs) { - CHANGED = true; - if (exprs.length) { - return make_sequence(value, exprs); - } else if (value instanceof AST_Sequence) { - return value.tail_node().left; - } else { - return value.left; - } - } - return value; - } - } -} - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -/** - * Module that contains the inlining logic. - * - * @module - * - * The stars of the show are `inline_into_symbolref` and `inline_into_call`. - */ - -function within_array_or_object_literal(compressor) { - var node, level = 0; - while (node = compressor.parent(level++)) { - if (node instanceof AST_Statement) return false; - if (node instanceof AST_Array - || node instanceof AST_ObjectKeyVal - || node instanceof AST_Object) { - return true; - } - } - return false; -} - -function scope_encloses_variables_in_this_scope(scope, pulled_scope) { - for (const enclosed of pulled_scope.enclosed) { - if (pulled_scope.variables.has(enclosed.name)) { - continue; - } - const looked_up = scope.find_variable(enclosed.name); - if (looked_up) { - if (looked_up === enclosed) continue; - return true; - } - } - return false; -} - -/** - * An extra check function for `top_retain` option, compare the length of const identifier - * and init value length and return true if init value is longer than identifier. for example: - * ``` - * // top_retain: ["example"] - * const example = 100 - * ``` - * it will return false because length of "100" is short than identifier "example". - */ -function is_const_symbol_short_than_init_value(def, fixed_value) { - if (def.orig.length === 1 && fixed_value) { - const init_value_length = fixed_value.size(); - const identifer_length = def.name.length; - return init_value_length > identifer_length; - } - return true; -} - -function inline_into_symbolref(self, compressor) { - const parent = compressor.parent(); - const def = self.definition(); - const nearest_scope = compressor.find_scope(); - let fixed = self.fixed_value(); - if ( - compressor.top_retain && - def.global && - compressor.top_retain(def) && - // when identifier is in top_retain option dose not mean we can always inline it. - // if identifier name is longer then init value, we can replace it. - is_const_symbol_short_than_init_value(def, fixed) - ) { - // keep it - def.fixed = false; - def.single_use = false; - return self; - } - - let single_use = def.single_use - && !(parent instanceof AST_Call - && (parent.is_callee_pure(compressor)) - || has_annotation(parent, _NOINLINE)) - && !(parent instanceof AST_Export - && fixed instanceof AST_Lambda - && fixed.name); - - if (single_use && fixed instanceof AST_Node) { - single_use = - !fixed.has_side_effects(compressor) - && !fixed.may_throw(compressor); - } - - if (fixed instanceof AST_Class && def.scope !== self.scope) { - return self; - } - - if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { - if (retain_top_func(fixed, compressor)) { - single_use = false; - } else if (def.scope !== self.scope - && (def.escaped == 1 - || has_flag(fixed, INLINED) - || within_array_or_object_literal(compressor) - || !compressor.option("reduce_funcs"))) { - single_use = false; - } else if (is_recursive_ref(compressor, def)) { - single_use = false; - } else if (def.scope !== self.scope || def.orig[0] instanceof AST_SymbolFunarg) { - single_use = fixed.is_constant_expression(self.scope); - if (single_use == "f") { - var scope = self.scope; - do { - if (scope instanceof AST_Defun || is_func_expr(scope)) { - set_flag(scope, INLINED); - } - } while (scope = scope.parent_scope); - } - } - } - - if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { - single_use = - def.scope === self.scope - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - || parent instanceof AST_Call - && parent.expression === self - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - && !(fixed.name && fixed.name.definition().recursive_refs > 0); - } - - if (single_use && fixed) { - if (fixed instanceof AST_DefClass) { - set_flag(fixed, SQUEEZED); - fixed = make_node(AST_ClassExpression, fixed, fixed); - } - if (fixed instanceof AST_Defun) { - set_flag(fixed, SQUEEZED); - fixed = make_node(AST_Function, fixed, fixed); - } - if (def.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) { - const defun_def = fixed.name.definition(); - let lambda_def = fixed.variables.get(fixed.name.name); - let name = lambda_def && lambda_def.orig[0]; - if (!(name instanceof AST_SymbolLambda)) { - name = make_node(AST_SymbolLambda, fixed.name, fixed.name); - name.scope = fixed; - fixed.name = name; - lambda_def = fixed.def_function(name); - } - walk(fixed, node => { - if (node instanceof AST_SymbolRef && node.definition() === defun_def) { - node.thedef = lambda_def; - lambda_def.references.push(node); - } - }); - } - if ( - (fixed instanceof AST_Lambda || fixed instanceof AST_Class) - && fixed.parent_scope !== nearest_scope - ) { - fixed = fixed.clone(true, compressor.get_toplevel()); - - nearest_scope.add_child_scope(fixed); - } - return fixed.optimize(compressor); - } - - // multiple uses - if (fixed) { - let replace; - - if (fixed instanceof AST_This) { - if (!(def.orig[0] instanceof AST_SymbolFunarg) - && def.references.every((ref) => - def.scope === ref.scope - )) { - replace = fixed; - } - } else { - var ev = fixed.evaluate(compressor); - if ( - ev !== fixed - && (compressor.option("unsafe_regexp") || !(ev instanceof RegExp)) - ) { - replace = make_node_from_constant(ev, fixed); - } - } - - if (replace) { - const name_length = self.size(compressor); - const replace_size = replace.size(compressor); - - let overhead = 0; - if (compressor.option("unused") && !compressor.exposed(def)) { - overhead = - (name_length + 2 + replace_size) / - (def.references.length - def.assignments); - } - - if (replace_size <= name_length + overhead) { - return replace; - } - } - } - - return self; -} - -function inline_into_call(self, compressor) { - var exp = self.expression; - var fn = exp; - var simple_args = self.args.every((arg) => !(arg instanceof AST_Expansion)); - - if (compressor.option("reduce_vars") - && fn instanceof AST_SymbolRef - && !has_annotation(self, _NOINLINE) - ) { - const fixed = fn.fixed_value(); - - if ( - retain_top_func(fixed, compressor) - || !compressor.toplevel.funcs && exp.definition().global - ) { - return self; - } - - fn = fixed; - } - - var is_func = fn instanceof AST_Lambda; - - var stat = is_func && fn.body[0]; - var is_regular_func = is_func && !fn.is_generator && !fn.async; - var can_inline = is_regular_func && compressor.option("inline") && !self.is_callee_pure(compressor); - if (can_inline && stat instanceof AST_Return) { - let returned = stat.value; - if (!returned || returned.is_constant_expression()) { - if (returned) { - returned = returned.clone(true); - } else { - returned = make_node(AST_Undefined, self); - } - const args = self.args.concat(returned); - return make_sequence(self, args).optimize(compressor); - } - - // optimize identity function - if ( - fn.argnames.length === 1 - && (fn.argnames[0] instanceof AST_SymbolFunarg) - && self.args.length < 2 - && !(self.args[0] instanceof AST_Expansion) - && returned instanceof AST_SymbolRef - && returned.name === fn.argnames[0].name - ) { - const replacement = - (self.args[0] || make_node(AST_Undefined)).optimize(compressor); - - let parent; - if ( - replacement instanceof AST_PropAccess - && (parent = compressor.parent()) instanceof AST_Call - && parent.expression === self - ) { - // identity function was being used to remove `this`, like in - // - // id(bag.no_this)(...) - // - // Replace with a larger but more effish (0, bag.no_this) wrapper. - - return make_sequence(self, [ - make_node(AST_Number, self, { value: 0 }), - replacement - ]); - } - // replace call with first argument or undefined if none passed - return replacement; - } - } - - if (can_inline) { - var scope, in_loop, level = -1; - let def; - let returned_value; - let nearest_scope; - if (simple_args - && !fn.uses_arguments - && !(compressor.parent() instanceof AST_Class) - && !(fn.name && fn instanceof AST_Function) - && (returned_value = can_flatten_body(stat)) - && (exp === fn - || has_annotation(self, _INLINE) - || compressor.option("unused") - && (def = exp.definition()).references.length == 1 - && !is_recursive_ref(compressor, def) - && fn.is_constant_expression(exp.scope)) - && !has_annotation(self, _PURE | _NOINLINE) - && !fn.contains_this() - && can_inject_symbols() - && (nearest_scope = compressor.find_scope()) - && !scope_encloses_variables_in_this_scope(nearest_scope, fn) - && !(function in_default_assign() { - // Due to the fact function parameters have their own scope - // which can't use `var something` in the function body within, - // we simply don't inline into DefaultAssign. - let i = 0; - let p; - while ((p = compressor.parent(i++))) { - if (p instanceof AST_DefaultAssign) return true; - if (p instanceof AST_Block) break; - } - return false; - })() - && !(scope instanceof AST_Class) - ) { - set_flag(fn, SQUEEZED); - nearest_scope.add_child_scope(fn); - return make_sequence(self, flatten_fn(returned_value)).optimize(compressor); - } - } - - if (can_inline && has_annotation(self, _INLINE)) { - set_flag(fn, SQUEEZED); - fn = make_node(fn.CTOR === AST_Defun ? AST_Function : fn.CTOR, fn, fn); - fn = fn.clone(true); - fn.figure_out_scope({}, { - parent_scope: compressor.find_scope(), - toplevel: compressor.get_toplevel() - }); - - return make_node(AST_Call, self, { - expression: fn, - args: self.args, - }).optimize(compressor); - } - - const can_drop_this_call = is_regular_func && compressor.option("side_effects") && fn.body.every(is_empty); - if (can_drop_this_call) { - var args = self.args.concat(make_node(AST_Undefined, self)); - return make_sequence(self, args).optimize(compressor); - } - - if (compressor.option("negate_iife") - && compressor.parent() instanceof AST_SimpleStatement - && is_iife_call(self)) { - return self.negate(compressor, true); - } - - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - - return self; - - function return_value(stat) { - if (!stat) return make_node(AST_Undefined, self); - if (stat instanceof AST_Return) { - if (!stat.value) return make_node(AST_Undefined, self); - return stat.value.clone(true); - } - if (stat instanceof AST_SimpleStatement) { - return make_node(AST_UnaryPrefix, stat, { - operator: "void", - expression: stat.body.clone(true) - }); - } - } - - function can_flatten_body(stat) { - var body = fn.body; - var len = body.length; - if (compressor.option("inline") < 3) { - return len == 1 && return_value(stat); - } - stat = null; - for (var i = 0; i < len; i++) { - var line = body[i]; - if (line instanceof AST_Var) { - if (stat && !line.definitions.every((var_def) => - !var_def.value - )) { - return false; - } - } else if (stat) { - return false; - } else if (!(line instanceof AST_EmptyStatement)) { - stat = line; - } - } - return return_value(stat); - } - - function can_inject_args(block_scoped, safe_to_inject) { - for (var i = 0, len = fn.argnames.length; i < len; i++) { - var arg = fn.argnames[i]; - if (arg instanceof AST_DefaultAssign) { - if (has_flag(arg.left, UNUSED)) continue; - return false; - } - if (arg instanceof AST_Destructuring) return false; - if (arg instanceof AST_Expansion) { - if (has_flag(arg.expression, UNUSED)) continue; - return false; - } - if (has_flag(arg, UNUSED)) continue; - if (!safe_to_inject - || block_scoped.has(arg.name) - || identifier_atom.has(arg.name) - || scope.conflicting_def(arg.name)) { - return false; - } - if (in_loop) in_loop.push(arg.definition()); - } - return true; - } - - function can_inject_vars(block_scoped, safe_to_inject) { - var len = fn.body.length; - for (var i = 0; i < len; i++) { - var stat = fn.body[i]; - if (!(stat instanceof AST_Var)) continue; - if (!safe_to_inject) return false; - for (var j = stat.definitions.length; --j >= 0;) { - var name = stat.definitions[j].name; - if (name instanceof AST_Destructuring - || block_scoped.has(name.name) - || identifier_atom.has(name.name) - || scope.conflicting_def(name.name)) { - return false; - } - if (in_loop) in_loop.push(name.definition()); - } - } - return true; - } - - function can_inject_symbols() { - var block_scoped = new Set(); - do { - scope = compressor.parent(++level); - if (scope.is_block_scope() && scope.block_scope) { - // TODO this is sometimes undefined during compression. - // But it should always have a value! - scope.block_scope.variables.forEach(function (variable) { - block_scoped.add(variable.name); - }); - } - if (scope instanceof AST_Catch) { - // TODO can we delete? AST_Catch is a block scope. - if (scope.argname) { - block_scoped.add(scope.argname.name); - } - } else if (scope instanceof AST_IterationStatement) { - in_loop = []; - } else if (scope instanceof AST_SymbolRef) { - if (scope.fixed_value() instanceof AST_Scope) return false; - } - } while (!(scope instanceof AST_Scope)); - - var safe_to_inject = !(scope instanceof AST_Toplevel) || compressor.toplevel.vars; - var inline = compressor.option("inline"); - if (!can_inject_vars(block_scoped, inline >= 3 && safe_to_inject)) return false; - if (!can_inject_args(block_scoped, inline >= 2 && safe_to_inject)) return false; - return !in_loop || in_loop.length == 0 || !is_reachable(fn, in_loop); - } - - function append_var(decls, expressions, name, value) { - var def = name.definition(); - - // Name already exists, only when a function argument had the same name - const already_appended = scope.variables.has(name.name); - if (!already_appended) { - scope.variables.set(name.name, def); - scope.enclosed.push(def); - decls.push(make_node(AST_VarDef, name, { - name: name, - value: null - })); - } - - var sym = make_node(AST_SymbolRef, name, name); - def.references.push(sym); - if (value) expressions.push(make_node(AST_Assign, self, { - operator: "=", - logical: false, - left: sym, - right: value.clone() - })); - } - - function flatten_args(decls, expressions) { - var len = fn.argnames.length; - for (var i = self.args.length; --i >= len;) { - expressions.push(self.args[i]); - } - for (i = len; --i >= 0;) { - var name = fn.argnames[i]; - var value = self.args[i]; - if (has_flag(name, UNUSED) || !name.name || scope.conflicting_def(name.name)) { - if (value) expressions.push(value); - } else { - var symbol = make_node(AST_SymbolVar, name, name); - name.definition().orig.push(symbol); - if (!value && in_loop) value = make_node(AST_Undefined, self); - append_var(decls, expressions, symbol, value); - } - } - decls.reverse(); - expressions.reverse(); - } - - function flatten_vars(decls, expressions) { - var pos = expressions.length; - for (var i = 0, lines = fn.body.length; i < lines; i++) { - var stat = fn.body[i]; - if (!(stat instanceof AST_Var)) continue; - for (var j = 0, defs = stat.definitions.length; j < defs; j++) { - var var_def = stat.definitions[j]; - var name = var_def.name; - append_var(decls, expressions, name, var_def.value); - if (in_loop && fn.argnames.every((argname) => - argname.name != name.name - )) { - var def = fn.variables.get(name.name); - var sym = make_node(AST_SymbolRef, name, name); - def.references.push(sym); - expressions.splice(pos++, 0, make_node(AST_Assign, var_def, { - operator: "=", - logical: false, - left: sym, - right: make_node(AST_Undefined, name) - })); - } - } - } - } - - function flatten_fn(returned_value) { - var decls = []; - var expressions = []; - flatten_args(decls, expressions); - flatten_vars(decls, expressions); - expressions.push(returned_value); - - if (decls.length) { - const i = scope.body.indexOf(compressor.parent(level - 1)) + 1; - scope.body.splice(i, 0, make_node(AST_Var, fn, { - definitions: decls - })); - } - - return expressions.map(exp => exp.clone(true)); - } -} - -(function(def_find_defs) { - function to_node(value, orig) { - if (value instanceof AST_Node) { - if (!(value instanceof AST_Constant)) { - // Value may be a function, an array including functions and even a complex assign / block expression, - // so it should never be shared in different places. - // Otherwise wrong information may be used in the compression phase - value = value.clone(true); - } - return make_node(value.CTOR, orig, value); - } - if (Array.isArray(value)) return make_node(AST_Array, orig, { - elements: value.map(function(value) { - return to_node(value, orig); - }) - }); - if (value && typeof value == "object") { - var props = []; - for (var key in value) if (HOP(value, key)) { - props.push(make_node(AST_ObjectKeyVal, orig, { - key: key, - value: to_node(value[key], orig) - })); - } - return make_node(AST_Object, orig, { - properties: props - }); - } - return make_node_from_constant(value, orig); - } - - AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) { - if (!compressor.option("global_defs")) return this; - this.figure_out_scope({ ie8: compressor.option("ie8") }); - return this.transform(new TreeTransformer(function(node) { - var def = node._find_defs(compressor, ""); - if (!def) return; - var level = 0, child = node, parent; - while (parent = this.parent(level++)) { - if (!(parent instanceof AST_PropAccess)) break; - if (parent.expression !== child) break; - child = parent; - } - if (is_lhs(child, parent)) { - return; - } - return def; - })); - }); - def_find_defs(AST_Node, noop); - def_find_defs(AST_Chain, function(compressor, suffix) { - return this.expression._find_defs(compressor, suffix); - }); - def_find_defs(AST_Dot, function(compressor, suffix) { - return this.expression._find_defs(compressor, "." + this.property + suffix); - }); - def_find_defs(AST_SymbolDeclaration, function() { - if (!this.global()) return; - }); - def_find_defs(AST_SymbolRef, function(compressor, suffix) { - if (!this.global()) return; - var defines = compressor.option("global_defs"); - var name = this.name + suffix; - if (HOP(defines, name)) return to_node(defines[name], this); - }); - def_find_defs(AST_ImportMeta, function(compressor, suffix) { - var defines = compressor.option("global_defs"); - var name = "import.meta" + suffix; - if (HOP(defines, name)) return to_node(defines[name], this); - }); -})(function(node, func) { - node.DEFMETHOD("_find_defs", func); -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -class Compressor extends TreeWalker { - constructor(options, { false_by_default = false, mangle_options = false }) { - super(); - if (options.defaults !== undefined && !options.defaults) false_by_default = true; - this.options = defaults(options, { - arguments : false, - arrows : !false_by_default, - booleans : !false_by_default, - booleans_as_integers : false, - collapse_vars : !false_by_default, - comparisons : !false_by_default, - computed_props: !false_by_default, - conditionals : !false_by_default, - dead_code : !false_by_default, - defaults : true, - directives : !false_by_default, - drop_console : false, - drop_debugger : !false_by_default, - ecma : 5, - evaluate : !false_by_default, - expression : false, - global_defs : false, - hoist_funs : false, - hoist_props : !false_by_default, - hoist_vars : false, - ie8 : false, - if_return : !false_by_default, - inline : !false_by_default, - join_vars : !false_by_default, - keep_classnames: false, - keep_fargs : true, - keep_fnames : false, - keep_infinity : false, - lhs_constants : !false_by_default, - loops : !false_by_default, - module : false, - negate_iife : !false_by_default, - passes : 1, - properties : !false_by_default, - pure_getters : !false_by_default && "strict", - pure_funcs : null, - pure_new : false, - reduce_funcs : !false_by_default, - reduce_vars : !false_by_default, - sequences : !false_by_default, - side_effects : !false_by_default, - switches : !false_by_default, - top_retain : null, - toplevel : !!(options && options["top_retain"]), - typeofs : !false_by_default, - unsafe : false, - unsafe_arrows : false, - unsafe_comps : false, - unsafe_Function: false, - unsafe_math : false, - unsafe_symbols: false, - unsafe_methods: false, - unsafe_proto : false, - unsafe_regexp : false, - unsafe_undefined: false, - unused : !false_by_default, - warnings : false // legacy - }, true); - var global_defs = this.options["global_defs"]; - if (typeof global_defs == "object") for (var key in global_defs) { - if (key[0] === "@" && HOP(global_defs, key)) { - global_defs[key.slice(1)] = parse(global_defs[key], { - expression: true - }); - } - } - if (this.options["inline"] === true) this.options["inline"] = 3; - var pure_funcs = this.options["pure_funcs"]; - if (typeof pure_funcs == "function") { - this.pure_funcs = pure_funcs; - } else { - this.pure_funcs = pure_funcs ? function(node) { - return !pure_funcs.includes(node.expression.print_to_string()); - } : return_true; - } - var top_retain = this.options["top_retain"]; - if (top_retain instanceof RegExp) { - this.top_retain = function(def) { - return top_retain.test(def.name); - }; - } else if (typeof top_retain == "function") { - this.top_retain = top_retain; - } else if (top_retain) { - if (typeof top_retain == "string") { - top_retain = top_retain.split(/,/); - } - this.top_retain = function(def) { - return top_retain.includes(def.name); - }; - } - if (this.options["module"]) { - this.directives["use strict"] = true; - this.options["toplevel"] = true; - } - var toplevel = this.options["toplevel"]; - this.toplevel = typeof toplevel == "string" ? { - funcs: /funcs/.test(toplevel), - vars: /vars/.test(toplevel) - } : { - funcs: toplevel, - vars: toplevel - }; - var sequences = this.options["sequences"]; - this.sequences_limit = sequences == 1 ? 800 : sequences | 0; - this.evaluated_regexps = new Map(); - this._toplevel = undefined; - this._mangle_options = mangle_options - ? format_mangler_options(mangle_options) - : mangle_options; - } - - mangle_options() { - var nth_identifier = this._mangle_options && this._mangle_options.nth_identifier || base54; - var module = this._mangle_options && this._mangle_options.module || this.option("module"); - return { ie8: this.option("ie8"), nth_identifier, module }; - } - - option(key) { - return this.options[key]; - } - - exposed(def) { - if (def.export) return true; - if (def.global) for (var i = 0, len = def.orig.length; i < len; i++) - if (!this.toplevel[def.orig[i] instanceof AST_SymbolDefun ? "funcs" : "vars"]) - return true; - return false; - } - - in_boolean_context() { - if (!this.option("booleans")) return false; - var self = this.self(); - for (var i = 0, p; p = this.parent(i); i++) { - if (p instanceof AST_SimpleStatement - || p instanceof AST_Conditional && p.condition === self - || p instanceof AST_DWLoop && p.condition === self - || p instanceof AST_For && p.condition === self - || p instanceof AST_If && p.condition === self - || p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self) { - return true; - } - if ( - p instanceof AST_Binary - && ( - p.operator == "&&" - || p.operator == "||" - || p.operator == "??" - ) - || p instanceof AST_Conditional - || p.tail_node() === self - ) { - self = p; - } else { - return false; - } - } - } - - get_toplevel() { - return this._toplevel; - } - - compress(toplevel) { - toplevel = toplevel.resolve_defines(this); - this._toplevel = toplevel; - if (this.option("expression")) { - this._toplevel.process_expression(true); - } - var passes = +this.options.passes || 1; - var min_count = 1 / 0; - var stopping = false; - var mangle = this.mangle_options(); - for (var pass = 0; pass < passes; pass++) { - this._toplevel.figure_out_scope(mangle); - if (pass === 0 && this.option("drop_console")) { - // must be run before reduce_vars and compress pass - this._toplevel = this._toplevel.drop_console(this.option("drop_console")); - } - if (pass > 0 || this.option("reduce_vars")) { - this._toplevel.reset_opt_flags(this); - } - this._toplevel = this._toplevel.transform(this); - if (passes > 1) { - let count = 0; - walk(this._toplevel, () => { count++; }); - if (count < min_count) { - min_count = count; - stopping = false; - } else if (stopping) { - break; - } else { - stopping = true; - } - } - } - if (this.option("expression")) { - this._toplevel.process_expression(false); - } - toplevel = this._toplevel; - this._toplevel = undefined; - return toplevel; - } - - before(node, descend) { - if (has_flag(node, SQUEEZED)) return node; - var was_scope = false; - if (node instanceof AST_Scope) { - node = node.hoist_properties(this); - node = node.hoist_declarations(this); - was_scope = true; - } - // Before https://github.com/mishoo/UglifyJS2/pull/1602 AST_Node.optimize() - // would call AST_Node.transform() if a different instance of AST_Node is - // produced after def_optimize(). - // This corrupts TreeWalker.stack, which cause AST look-ups to malfunction. - // Migrate and defer all children's AST_Node.transform() to below, which - // will now happen after this parent AST_Node has been properly substituted - // thus gives a consistent AST snapshot. - descend(node, this); - // Existing code relies on how AST_Node.optimize() worked, and omitting the - // following replacement call would result in degraded efficiency of both - // output and performance. - descend(node, this); - var opt = node.optimize(this); - if (was_scope && opt instanceof AST_Scope) { - opt.drop_unused(this); - descend(opt, this); - } - if (opt === node) set_flag(opt, SQUEEZED); - return opt; - } - - /** Alternative to plain is_lhs() which doesn't work within .optimize() */ - is_lhs() { - const self = this.stack[this.stack.length - 1]; - const parent = this.stack[this.stack.length - 2]; - return is_lhs(self, parent); - } -} - -function def_optimize(node, optimizer) { - node.DEFMETHOD("optimize", function(compressor) { - var self = this; - if (has_flag(self, OPTIMIZED)) return self; - if (compressor.has_directive("use asm")) return self; - var opt = optimizer(self, compressor); - set_flag(opt, OPTIMIZED); - return opt; - }); -} - -def_optimize(AST_Node, function(self) { - return self; -}); - -AST_Toplevel.DEFMETHOD("drop_console", function(options) { - var isArray = Array.isArray(options); - - return this.transform(new TreeTransformer(function(self) { - if (self.TYPE !== "Call") { - return; - } - - var exp = self.expression; - - if (!(exp instanceof AST_PropAccess)) { - return; - } - - if (isArray && options.indexOf(exp.property) === -1) { - return; - } - - var name = exp.expression; - while (name.expression) { - name = name.expression; - } - if (is_undeclared_ref(name) && name.name == "console") { - return make_node(AST_Undefined, self); - } - })); -}); - -AST_Node.DEFMETHOD("equivalent_to", function(node) { - return equivalent_to(this, node); -}); - -AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { - var self = this; - var tt = new TreeTransformer(function(node) { - if (insert && node instanceof AST_SimpleStatement) { - return make_node(AST_Return, node, { - value: node.body - }); - } - if (!insert && node instanceof AST_Return) { - if (compressor) { - var value = node.value && node.value.drop_side_effect_free(compressor, true); - return value - ? make_node(AST_SimpleStatement, node, { body: value }) - : make_node(AST_EmptyStatement, node); - } - return make_node(AST_SimpleStatement, node, { - body: node.value || make_node(AST_UnaryPrefix, node, { - operator: "void", - expression: make_node(AST_Number, node, { - value: 0 - }) - }) - }); - } - if (node instanceof AST_Class || node instanceof AST_Lambda && node !== self) { - return node; - } - if (node instanceof AST_Block) { - var index = node.body.length - 1; - if (index >= 0) { - node.body[index] = node.body[index].transform(tt); - } - } else if (node instanceof AST_If) { - node.body = node.body.transform(tt); - if (node.alternative) { - node.alternative = node.alternative.transform(tt); - } - } else if (node instanceof AST_With) { - node.body = node.body.transform(tt); - } - return node; - }); - self.transform(tt); -}); - -AST_Toplevel.DEFMETHOD("reset_opt_flags", function(compressor) { - const self = this; - const reduce_vars = compressor.option("reduce_vars"); - - const preparation = new TreeWalker(function(node, descend) { - clear_flag(node, CLEAR_BETWEEN_PASSES); - if (reduce_vars) { - if (compressor.top_retain - && node instanceof AST_Defun // Only functions are retained - && preparation.parent() === self - ) { - set_flag(node, TOP); - } - return node.reduce_vars(preparation, descend, compressor); - } - }); - // Stack of look-up tables to keep track of whether a `SymbolDef` has been - // properly assigned before use: - // - `push()` & `pop()` when visiting conditional branches - preparation.safe_ids = Object.create(null); - preparation.in_loop = null; - preparation.loop_ids = new Map(); - preparation.defs_to_safe_ids = new Map(); - self.walk(preparation); -}); - -AST_Symbol.DEFMETHOD("fixed_value", function() { - var fixed = this.thedef.fixed; - if (!fixed || fixed instanceof AST_Node) return fixed; - return fixed(); -}); - -AST_SymbolRef.DEFMETHOD("is_immutable", function() { - var orig = this.definition().orig; - return orig.length == 1 && orig[0] instanceof AST_SymbolLambda; -}); - -function find_variable(compressor, name) { - var scope, i = 0; - while (scope = compressor.parent(i++)) { - if (scope instanceof AST_Scope) break; - if (scope instanceof AST_Catch && scope.argname) { - scope = scope.argname.definition().scope; - break; - } - } - return scope.find_variable(name); -} - -var global_names = makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError"); -AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { - return !this.definition().undeclared - || compressor.option("unsafe") && global_names.has(this.name); -}); - -/* -----[ optimizers ]----- */ - -var directives = new Set(["use asm", "use strict"]); -def_optimize(AST_Directive, function(self, compressor) { - if (compressor.option("directives") - && (!directives.has(self.value) || compressor.has_directive(self.value) !== self)) { - return make_node(AST_EmptyStatement, self); - } - return self; -}); - -def_optimize(AST_Debugger, function(self, compressor) { - if (compressor.option("drop_debugger")) - return make_node(AST_EmptyStatement, self); - return self; -}); - -def_optimize(AST_LabeledStatement, function(self, compressor) { - if (self.body instanceof AST_Break - && compressor.loopcontrol_target(self.body) === self.body) { - return make_node(AST_EmptyStatement, self); - } - return self.label.references.length == 0 ? self.body : self; -}); - -def_optimize(AST_Block, function(self, compressor) { - tighten_body(self.body, compressor); - return self; -}); - -function can_be_extracted_from_if_block(node) { - return !( - node instanceof AST_Const - || node instanceof AST_Let - || node instanceof AST_Class - ); -} - -def_optimize(AST_BlockStatement, function(self, compressor) { - tighten_body(self.body, compressor); - switch (self.body.length) { - case 1: - if (!compressor.has_directive("use strict") - && compressor.parent() instanceof AST_If - && can_be_extracted_from_if_block(self.body[0]) - || can_be_evicted_from_block(self.body[0])) { - return self.body[0]; - } - break; - case 0: return make_node(AST_EmptyStatement, self); - } - return self; -}); - -function opt_AST_Lambda(self, compressor) { - tighten_body(self.body, compressor); - if (compressor.option("side_effects") - && self.body.length == 1 - && self.body[0] === compressor.has_directive("use strict")) { - self.body.length = 0; - } - return self; -} -def_optimize(AST_Lambda, opt_AST_Lambda); - -AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { - var self = this; - if (compressor.has_directive("use asm")) return self; - - var hoist_funs = compressor.option("hoist_funs"); - var hoist_vars = compressor.option("hoist_vars"); - - if (hoist_funs || hoist_vars) { - var dirs = []; - var hoisted = []; - var vars = new Map(), vars_found = 0, var_decl = 0; - // let's count var_decl first, we seem to waste a lot of - // space if we hoist `var` when there's only one. - walk(self, node => { - if (node instanceof AST_Scope && node !== self) - return true; - if (node instanceof AST_Var) { - ++var_decl; - return true; - } - }); - hoist_vars = hoist_vars && var_decl > 1; - var tt = new TreeTransformer( - function before(node) { - if (node !== self) { - if (node instanceof AST_Directive) { - dirs.push(node); - return make_node(AST_EmptyStatement, node); - } - if (hoist_funs && node instanceof AST_Defun - && !(tt.parent() instanceof AST_Export) - && tt.parent() === self) { - hoisted.push(node); - return make_node(AST_EmptyStatement, node); - } - if ( - hoist_vars - && node instanceof AST_Var - && !node.definitions.some(def => def.name instanceof AST_Destructuring) - ) { - node.definitions.forEach(function(def) { - vars.set(def.name.name, def); - ++vars_found; - }); - var seq = node.to_assignments(compressor); - var p = tt.parent(); - if (p instanceof AST_ForIn && p.init === node) { - if (seq == null) { - var def = node.definitions[0].name; - return make_node(AST_SymbolRef, def, def); - } - return seq; - } - if (p instanceof AST_For && p.init === node) { - return seq; - } - if (!seq) return make_node(AST_EmptyStatement, node); - return make_node(AST_SimpleStatement, node, { - body: seq - }); - } - if (node instanceof AST_Scope) - return node; // to avoid descending in nested scopes - } - } - ); - self = self.transform(tt); - if (vars_found > 0) { - // collect only vars which don't show up in self's arguments list - var defs = []; - const is_lambda = self instanceof AST_Lambda; - const args_as_names = is_lambda ? self.args_as_names() : null; - vars.forEach((def, name) => { - if (is_lambda && args_as_names.some((x) => x.name === def.name.name)) { - vars.delete(name); - } else { - def = def.clone(); - def.value = null; - defs.push(def); - vars.set(name, def); - } - }); - if (defs.length > 0) { - // try to merge in assignments - for (var i = 0; i < self.body.length;) { - if (self.body[i] instanceof AST_SimpleStatement) { - var expr = self.body[i].body, sym, assign; - if (expr instanceof AST_Assign - && expr.operator == "=" - && (sym = expr.left) instanceof AST_Symbol - && vars.has(sym.name) - ) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = expr.right; - remove(defs, def); - defs.push(def); - self.body.splice(i, 1); - continue; - } - if (expr instanceof AST_Sequence - && (assign = expr.expressions[0]) instanceof AST_Assign - && assign.operator == "=" - && (sym = assign.left) instanceof AST_Symbol - && vars.has(sym.name) - ) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = assign.right; - remove(defs, def); - defs.push(def); - self.body[i].body = make_sequence(expr, expr.expressions.slice(1)); - continue; - } - } - if (self.body[i] instanceof AST_EmptyStatement) { - self.body.splice(i, 1); - continue; - } - if (self.body[i] instanceof AST_BlockStatement) { - self.body.splice(i, 1, ...self.body[i].body); - continue; - } - break; - } - defs = make_node(AST_Var, self, { - definitions: defs - }); - hoisted.push(defs); - } - } - self.body = dirs.concat(hoisted, self.body); - } - return self; -}); - -AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { - var self = this; - if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return self; - var top_retain = self instanceof AST_Toplevel && compressor.top_retain || return_false; - var defs_by_id = new Map(); - var hoister = new TreeTransformer(function(node, descend) { - if (node instanceof AST_VarDef) { - const sym = node.name; - let def; - let value; - if (sym.scope === self - && (def = sym.definition()).escaped != 1 - && !def.assignments - && !def.direct_access - && !def.single_use - && !compressor.exposed(def) - && !top_retain(def) - && (value = sym.fixed_value()) === node.value - && value instanceof AST_Object - && !value.properties.some(prop => - prop instanceof AST_Expansion || prop.computed_key() - ) - ) { - descend(node, this); - const defs = new Map(); - const assignments = []; - value.properties.forEach(({ key, value }) => { - const scope = hoister.find_scope(); - const symbol = self.create_symbol(sym.CTOR, { - source: sym, - scope, - conflict_scopes: new Set([ - scope, - ...sym.definition().references.map(ref => ref.scope) - ]), - tentative_name: sym.name + "_" + key - }); - - defs.set(String(key), symbol.definition()); - - assignments.push(make_node(AST_VarDef, node, { - name: symbol, - value - })); - }); - defs_by_id.set(def.id, defs); - return MAP.splice(assignments); - } - } else if (node instanceof AST_PropAccess - && node.expression instanceof AST_SymbolRef - ) { - const defs = defs_by_id.get(node.expression.definition().id); - if (defs) { - const def = defs.get(String(get_simple_key(node.property))); - const sym = make_node(AST_SymbolRef, node, { - name: def.name, - scope: node.expression.scope, - thedef: def - }); - sym.reference({}); - return sym; - } - } - }); - return self.transform(hoister); -}); - -def_optimize(AST_SimpleStatement, function(self, compressor) { - if (compressor.option("side_effects")) { - var body = self.body; - var node = body.drop_side_effect_free(compressor, true); - if (!node) { - return make_node(AST_EmptyStatement, self); - } - if (node !== body) { - return make_node(AST_SimpleStatement, self, { body: node }); - } - } - return self; -}); - -def_optimize(AST_While, function(self, compressor) { - return compressor.option("loops") ? make_node(AST_For, self, self).optimize(compressor) : self; -}); - -def_optimize(AST_Do, function(self, compressor) { - if (!compressor.option("loops")) return self; - var cond = self.condition.tail_node().evaluate(compressor); - if (!(cond instanceof AST_Node)) { - if (cond) return make_node(AST_For, self, { - body: make_node(AST_BlockStatement, self.body, { - body: [ - self.body, - make_node(AST_SimpleStatement, self.condition, { - body: self.condition - }) - ] - }) - }).optimize(compressor); - if (!has_break_or_continue(self, compressor.parent())) { - return make_node(AST_BlockStatement, self.body, { - body: [ - self.body, - make_node(AST_SimpleStatement, self.condition, { - body: self.condition - }) - ] - }).optimize(compressor); - } - } - return self; -}); - -function if_break_in_loop(self, compressor) { - var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body; - if (compressor.option("dead_code") && is_break(first)) { - var body = []; - if (self.init instanceof AST_Statement) { - body.push(self.init); - } else if (self.init) { - body.push(make_node(AST_SimpleStatement, self.init, { - body: self.init - })); - } - if (self.condition) { - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - } - trim_unreachable_code(compressor, self.body, body); - return make_node(AST_BlockStatement, self, { - body: body - }); - } - if (first instanceof AST_If) { - if (is_break(first.body)) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition.negate(compressor), - }); - } else { - self.condition = first.condition.negate(compressor); - } - drop_it(first.alternative); - } else if (is_break(first.alternative)) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition, - }); - } else { - self.condition = first.condition; - } - drop_it(first.body); - } - } - return self; - - function is_break(node) { - return node instanceof AST_Break - && compressor.loopcontrol_target(node) === compressor.self(); - } - - function drop_it(rest) { - rest = as_statement_array(rest); - if (self.body instanceof AST_BlockStatement) { - self.body = self.body.clone(); - self.body.body = rest.concat(self.body.body.slice(1)); - self.body = self.body.transform(compressor); - } else { - self.body = make_node(AST_BlockStatement, self.body, { - body: rest - }).transform(compressor); - } - self = if_break_in_loop(self, compressor); - } -} - -def_optimize(AST_For, function(self, compressor) { - if (!compressor.option("loops")) return self; - if (compressor.option("side_effects") && self.init) { - self.init = self.init.drop_side_effect_free(compressor); - } - if (self.condition) { - var cond = self.condition.evaluate(compressor); - if (!(cond instanceof AST_Node)) { - if (cond) self.condition = null; - else if (!compressor.option("dead_code")) { - var orig = self.condition; - self.condition = make_node_from_constant(cond, self.condition); - self.condition = best_of_expression(self.condition.transform(compressor), orig); - } - } - if (compressor.option("dead_code")) { - if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor); - if (!cond) { - var body = []; - trim_unreachable_code(compressor, self.body, body); - if (self.init instanceof AST_Statement) { - body.push(self.init); - } else if (self.init) { - body.push(make_node(AST_SimpleStatement, self.init, { - body: self.init - })); - } - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - } - return if_break_in_loop(self, compressor); -}); - -def_optimize(AST_If, function(self, compressor) { - if (is_empty(self.alternative)) self.alternative = null; - - if (!compressor.option("conditionals")) return self; - // if condition can be statically determined, drop - // one of the blocks. note, statically determined implies - // “has no side effects”; also it doesn't work for cases like - // `x && true`, though it probably should. - var cond = self.condition.evaluate(compressor); - if (!compressor.option("dead_code") && !(cond instanceof AST_Node)) { - var orig = self.condition; - self.condition = make_node_from_constant(cond, orig); - self.condition = best_of_expression(self.condition.transform(compressor), orig); - } - if (compressor.option("dead_code")) { - if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor); - if (!cond) { - var body = []; - trim_unreachable_code(compressor, self.body, body); - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - if (self.alternative) body.push(self.alternative); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } else if (!(cond instanceof AST_Node)) { - var body = []; - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - body.push(self.body); - if (self.alternative) { - trim_unreachable_code(compressor, self.alternative, body); - } - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - var negated = self.condition.negate(compressor); - var self_condition_length = self.condition.size(); - var negated_length = negated.size(); - var negated_is_best = negated_length < self_condition_length; - if (self.alternative && negated_is_best) { - negated_is_best = false; // because we already do the switch here. - // no need to swap values of self_condition_length and negated_length - // here because they are only used in an equality comparison later on. - self.condition = negated; - var tmp = self.body; - self.body = self.alternative || make_node(AST_EmptyStatement, self); - self.alternative = tmp; - } - if (is_empty(self.body) && is_empty(self.alternative)) { - return make_node(AST_SimpleStatement, self.condition, { - body: self.condition.clone() - }).optimize(compressor); - } - if (self.body instanceof AST_SimpleStatement - && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Conditional, self, { - condition : self.condition, - consequent : self.body.body, - alternative : self.alternative.body - }) - }).optimize(compressor); - } - if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) { - if (self_condition_length === negated_length && !negated_is_best - && self.condition instanceof AST_Binary && self.condition.operator == "||") { - // although the code length of self.condition and negated are the same, - // negated does not require additional surrounding parentheses. - // see https://github.com/mishoo/UglifyJS2/issues/979 - negated_is_best = true; - } - if (negated_is_best) return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "||", - left : negated, - right : self.body.body - }) - }).optimize(compressor); - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "&&", - left : self.condition, - right : self.body.body - }) - }).optimize(compressor); - } - if (self.body instanceof AST_EmptyStatement - && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "||", - left : self.condition, - right : self.alternative.body - }) - }).optimize(compressor); - } - if (self.body instanceof AST_Exit - && self.alternative instanceof AST_Exit - && self.body.TYPE == self.alternative.TYPE) { - return make_node(self.body.CTOR, self, { - value: make_node(AST_Conditional, self, { - condition : self.condition, - consequent : self.body.value || make_node(AST_Undefined, self.body), - alternative : self.alternative.value || make_node(AST_Undefined, self.alternative) - }).transform(compressor) - }).optimize(compressor); - } - if (self.body instanceof AST_If - && !self.body.alternative - && !self.alternative) { - self = make_node(AST_If, self, { - condition: make_node(AST_Binary, self.condition, { - operator: "&&", - left: self.condition, - right: self.body.condition - }), - body: self.body.body, - alternative: null - }); - } - if (aborts(self.body)) { - if (self.alternative) { - var alt = self.alternative; - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, alt ] - }).optimize(compressor); - } - } - if (aborts(self.alternative)) { - var body = self.body; - self.body = self.alternative; - self.condition = negated_is_best ? negated : self.condition.negate(compressor); - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, body ] - }).optimize(compressor); - } - return self; -}); - -def_optimize(AST_Switch, function(self, compressor) { - if (!compressor.option("switches")) return self; - var branch; - var value = self.expression.evaluate(compressor); - if (!(value instanceof AST_Node)) { - var orig = self.expression; - self.expression = make_node_from_constant(value, orig); - self.expression = best_of_expression(self.expression.transform(compressor), orig); - } - if (!compressor.option("dead_code")) return self; - if (value instanceof AST_Node) { - value = self.expression.tail_node().evaluate(compressor); - } - var decl = []; - var body = []; - var default_branch; - var exact_match; - for (var i = 0, len = self.body.length; i < len && !exact_match; i++) { - branch = self.body[i]; - if (branch instanceof AST_Default) { - if (!default_branch) { - default_branch = branch; - } else { - eliminate_branch(branch, body[body.length - 1]); - } - } else if (!(value instanceof AST_Node)) { - var exp = branch.expression.evaluate(compressor); - if (!(exp instanceof AST_Node) && exp !== value) { - eliminate_branch(branch, body[body.length - 1]); - continue; - } - if (exp instanceof AST_Node) exp = branch.expression.tail_node().evaluate(compressor); - if (exp === value) { - exact_match = branch; - if (default_branch) { - var default_index = body.indexOf(default_branch); - body.splice(default_index, 1); - eliminate_branch(default_branch, body[default_index - 1]); - default_branch = null; - } - } - } - body.push(branch); - } - while (i < len) eliminate_branch(self.body[i++], body[body.length - 1]); - self.body = body; - - let default_or_exact = default_branch || exact_match; - default_branch = null; - exact_match = null; - - // group equivalent branches so they will be located next to each other, - // that way the next micro-optimization will merge them. - // ** bail micro-optimization if not a simple switch case with breaks - if (body.every((branch, i) => - (branch === default_or_exact || branch.expression instanceof AST_Constant) - && (branch.body.length === 0 || aborts(branch) || body.length - 1 === i)) - ) { - for (let i = 0; i < body.length; i++) { - const branch = body[i]; - for (let j = i + 1; j < body.length; j++) { - const next = body[j]; - if (next.body.length === 0) continue; - const last_branch = j === (body.length - 1); - const equivalentBranch = branches_equivalent(next, branch, false); - if (equivalentBranch || (last_branch && branches_equivalent(next, branch, true))) { - if (!equivalentBranch && last_branch) { - next.body.push(make_node(AST_Break)); - } - - // let's find previous siblings with inert fallthrough... - let x = j - 1; - let fallthroughDepth = 0; - while (x > i) { - if (is_inert_body(body[x--])) { - fallthroughDepth++; - } else { - break; - } - } - - const plucked = body.splice(j - fallthroughDepth, 1 + fallthroughDepth); - body.splice(i + 1, 0, ...plucked); - i += plucked.length; - } - } - } - } - - // merge equivalent branches in a row - for (let i = 0; i < body.length; i++) { - let branch = body[i]; - if (branch.body.length === 0) continue; - if (!aborts(branch)) continue; - - for (let j = i + 1; j < body.length; i++, j++) { - let next = body[j]; - if (next.body.length === 0) continue; - if ( - branches_equivalent(next, branch, false) - || (j === body.length - 1 && branches_equivalent(next, branch, true)) - ) { - branch.body = []; - branch = next; - continue; - } - break; - } - } - - // Prune any empty branches at the end of the switch statement. - { - let i = body.length - 1; - for (; i >= 0; i--) { - let bbody = body[i].body; - if (is_break(bbody[bbody.length - 1], compressor)) bbody.pop(); - if (!is_inert_body(body[i])) break; - } - // i now points to the index of a branch that contains a body. By incrementing, it's - // pointing to the first branch that's empty. - i++; - if (!default_or_exact || body.indexOf(default_or_exact) >= i) { - // The default behavior is to do nothing. We can take advantage of that to - // remove all case expressions that are side-effect free that also do - // nothing, since they'll default to doing nothing. But we can't remove any - // case expressions before one that would side-effect, since they may cause - // the side-effect to be skipped. - for (let j = body.length - 1; j >= i; j--) { - let branch = body[j]; - if (branch === default_or_exact) { - default_or_exact = null; - body.pop(); - } else if (!branch.expression.has_side_effects(compressor)) { - body.pop(); - } else { - break; - } - } - } - } - - - // Prune side-effect free branches that fall into default. - DEFAULT: if (default_or_exact) { - let default_index = body.indexOf(default_or_exact); - let default_body_index = default_index; - for (; default_body_index < body.length - 1; default_body_index++) { - if (!is_inert_body(body[default_body_index])) break; - } - if (default_body_index < body.length - 1) { - break DEFAULT; - } - - let side_effect_index = body.length - 1; - for (; side_effect_index >= 0; side_effect_index--) { - let branch = body[side_effect_index]; - if (branch === default_or_exact) continue; - if (branch.expression.has_side_effects(compressor)) break; - } - // If the default behavior comes after any side-effect case expressions, - // then we can fold all side-effect free cases into the default branch. - // If the side-effect case is after the default, then any side-effect - // free cases could prevent the side-effect from occurring. - if (default_body_index > side_effect_index) { - let prev_body_index = default_index - 1; - for (; prev_body_index >= 0; prev_body_index--) { - if (!is_inert_body(body[prev_body_index])) break; - } - let before = Math.max(side_effect_index, prev_body_index) + 1; - let after = default_index; - if (side_effect_index > default_index) { - // If the default falls into the same body as a side-effect - // case, then we need preserve that case and only prune the - // cases after it. - after = side_effect_index; - body[side_effect_index].body = body[default_body_index].body; - } else { - // The default will be the last branch. - default_or_exact.body = body[default_body_index].body; - } - - // Prune everything after the default (or last side-effect case) - // until the next case with a body. - body.splice(after + 1, default_body_index - after); - // Prune everything before the default that falls into it. - body.splice(before, default_index - before); - } - } - - // See if we can remove the switch entirely if all cases (the default) fall into the same case body. - DEFAULT: if (default_or_exact) { - let i = body.findIndex(branch => !is_inert_body(branch)); - let caseBody; - // `i` is equal to one of the following: - // - `-1`, there is no body in the switch statement. - // - `body.length - 1`, all cases fall into the same body. - // - anything else, there are multiple bodies in the switch. - if (i === body.length - 1) { - // All cases fall into the case body. - let branch = body[i]; - if (has_nested_break(self)) break DEFAULT; - - // This is the last case body, and we've already pruned any breaks, so it's - // safe to hoist. - caseBody = make_node(AST_BlockStatement, branch, { - body: branch.body - }); - branch.body = []; - } else if (i !== -1) { - // If there are multiple bodies, then we cannot optimize anything. - break DEFAULT; - } - - let sideEffect = body.find(branch => { - return ( - branch !== default_or_exact - && branch.expression.has_side_effects(compressor) - ); - }); - // If no cases cause a side-effect, we can eliminate the switch entirely. - if (!sideEffect) { - return make_node(AST_BlockStatement, self, { - body: decl.concat( - statement(self.expression), - default_or_exact.expression ? statement(default_or_exact.expression) : [], - caseBody || [] - ) - }).optimize(compressor); - } - - // If we're this far, either there was no body or all cases fell into the same body. - // If there was no body, then we don't need a default branch (because the default is - // do nothing). If there was a body, we'll extract it to after the switch, so the - // switch's new default is to do nothing and we can still prune it. - const default_index = body.indexOf(default_or_exact); - body.splice(default_index, 1); - default_or_exact = null; - - if (caseBody) { - // Recurse into switch statement one more time so that we can append the case body - // outside of the switch. This recursion will only happen once since we've pruned - // the default case. - return make_node(AST_BlockStatement, self, { - body: decl.concat(self, caseBody) - }).optimize(compressor); - } - // If we fall here, there is a default branch somewhere, there are no case bodies, - // and there's a side-effect somewhere. Just let the below paths take care of it. - } - - if (body.length > 0) { - body[0].body = decl.concat(body[0].body); - } - - if (body.length == 0) { - return make_node(AST_BlockStatement, self, { - body: decl.concat(statement(self.expression)) - }).optimize(compressor); - } - if (body.length == 1 && !has_nested_break(self)) { - // This is the last case body, and we've already pruned any breaks, so it's - // safe to hoist. - let branch = body[0]; - return make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: "===", - left: self.expression, - right: branch.expression, - }), - body: make_node(AST_BlockStatement, branch, { - body: branch.body - }), - alternative: null - }).optimize(compressor); - } - if (body.length === 2 && default_or_exact && !has_nested_break(self)) { - let branch = body[0] === default_or_exact ? body[1] : body[0]; - let exact_exp = default_or_exact.expression && statement(default_or_exact.expression); - if (aborts(body[0])) { - // Only the first branch body could have a break (at the last statement) - let first = body[0]; - if (is_break(first.body[first.body.length - 1], compressor)) { - first.body.pop(); - } - return make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: "===", - left: self.expression, - right: branch.expression, - }), - body: make_node(AST_BlockStatement, branch, { - body: branch.body - }), - alternative: make_node(AST_BlockStatement, default_or_exact, { - body: [].concat( - exact_exp || [], - default_or_exact.body - ) - }) - }).optimize(compressor); - } - let operator = "==="; - let consequent = make_node(AST_BlockStatement, branch, { - body: branch.body, - }); - let always = make_node(AST_BlockStatement, default_or_exact, { - body: [].concat( - exact_exp || [], - default_or_exact.body - ) - }); - if (body[0] === default_or_exact) { - operator = "!=="; - let tmp = always; - always = consequent; - consequent = tmp; - } - return make_node(AST_BlockStatement, self, { - body: [ - make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: operator, - left: self.expression, - right: branch.expression, - }), - body: consequent, - alternative: null - }) - ].concat(always) - }).optimize(compressor); - } - return self; - - function eliminate_branch(branch, prev) { - if (prev && !aborts(prev)) { - prev.body = prev.body.concat(branch.body); - } else { - trim_unreachable_code(compressor, branch, decl); - } - } - function branches_equivalent(branch, prev, insertBreak) { - let bbody = branch.body; - let pbody = prev.body; - if (insertBreak) { - bbody = bbody.concat(make_node(AST_Break)); - } - if (bbody.length !== pbody.length) return false; - let bblock = make_node(AST_BlockStatement, branch, { body: bbody }); - let pblock = make_node(AST_BlockStatement, prev, { body: pbody }); - return bblock.equivalent_to(pblock); - } - function statement(expression) { - return make_node(AST_SimpleStatement, expression, { - body: expression - }); - } - function has_nested_break(root) { - let has_break = false; - let tw = new TreeWalker(node => { - if (has_break) return true; - if (node instanceof AST_Lambda) return true; - if (node instanceof AST_SimpleStatement) return true; - if (!is_break(node, tw)) return; - let parent = tw.parent(); - if ( - parent instanceof AST_SwitchBranch - && parent.body[parent.body.length - 1] === node - ) { - return; - } - has_break = true; - }); - root.walk(tw); - return has_break; - } - function is_break(node, stack) { - return node instanceof AST_Break - && stack.loopcontrol_target(node) === self; - } - function is_inert_body(branch) { - return !aborts(branch) && !make_node(AST_BlockStatement, branch, { - body: branch.body - }).has_side_effects(compressor); - } -}); - -def_optimize(AST_Try, function(self, compressor) { - if (self.bcatch && self.bfinally && self.bfinally.body.every(is_empty)) self.bfinally = null; - - if (compressor.option("dead_code") && self.body.body.every(is_empty)) { - var body = []; - if (self.bcatch) { - trim_unreachable_code(compressor, self.bcatch, body); - } - if (self.bfinally) body.push(...self.bfinally.body); - return make_node(AST_BlockStatement, self, { - body: body - }).optimize(compressor); - } - return self; -}); - -AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { - var reduce_vars = compressor.option("reduce_vars"); - var assignments = []; - - for (const def of this.definitions) { - if (def.value) { - var name = make_node(AST_SymbolRef, def.name, def.name); - assignments.push(make_node(AST_Assign, def, { - operator : "=", - logical: false, - left : name, - right : def.value - })); - if (reduce_vars) name.definition().fixed = false; - } - const thedef = def.name.definition(); - thedef.eliminated++; - thedef.replaced--; - } - - if (assignments.length == 0) return null; - return make_sequence(this, assignments); -}); - -def_optimize(AST_Definitions, function(self) { - if (self.definitions.length == 0) { - return make_node(AST_EmptyStatement, self); - } - return self; -}); - -def_optimize(AST_VarDef, function(self, compressor) { - if ( - self.name instanceof AST_SymbolLet - && self.value != null - && is_undefined(self.value, compressor) - ) { - self.value = null; - } - return self; -}); - -def_optimize(AST_Import, function(self) { - return self; -}); - -def_optimize(AST_Call, function(self, compressor) { - var exp = self.expression; - var fn = exp; - inline_array_like_spread(self.args); - var simple_args = self.args.every((arg) => !(arg instanceof AST_Expansion)); - - if (compressor.option("reduce_vars") && fn instanceof AST_SymbolRef) { - fn = fn.fixed_value(); - } - - var is_func = fn instanceof AST_Lambda; - - if (is_func && fn.pinned()) return self; - - if (compressor.option("unused") - && simple_args - && is_func - && !fn.uses_arguments) { - var pos = 0, last = 0; - for (var i = 0, len = self.args.length; i < len; i++) { - if (fn.argnames[i] instanceof AST_Expansion) { - if (has_flag(fn.argnames[i].expression, UNUSED)) while (i < len) { - var node = self.args[i++].drop_side_effect_free(compressor); - if (node) { - self.args[pos++] = node; - } - } else while (i < len) { - self.args[pos++] = self.args[i++]; - } - last = pos; - break; - } - var trim = i >= fn.argnames.length; - if (trim || has_flag(fn.argnames[i], UNUSED)) { - var node = self.args[i].drop_side_effect_free(compressor); - if (node) { - self.args[pos++] = node; - } else if (!trim) { - self.args[pos++] = make_node(AST_Number, self.args[i], { - value: 0 - }); - continue; - } - } else { - self.args[pos++] = self.args[i]; - } - last = pos; - } - self.args.length = last; - } - - if (compressor.option("unsafe") && !exp.contains_optional()) { - if (exp instanceof AST_Dot && exp.start.value === "Array" && exp.property === "from" && self.args.length === 1) { - const [argument] = self.args; - if (argument instanceof AST_Array) { - return make_node(AST_Array, argument, { - elements: argument.elements - }).optimize(compressor); - } - } - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - if (self.args.length != 1) { - return make_node(AST_Array, self, { - elements: self.args - }).optimize(compressor); - } else if (self.args[0] instanceof AST_Number && self.args[0].value <= 11) { - const elements = []; - for (let i = 0; i < self.args[0].value; i++) elements.push(new AST_Hole); - return new AST_Array({ elements }); - } - break; - case "Object": - if (self.args.length == 0) { - return make_node(AST_Object, self, { - properties: [] - }); - } - break; - case "String": - if (self.args.length == 0) return make_node(AST_String, self, { - value: "" - }); - if (self.args.length <= 1) return make_node(AST_Binary, self, { - left: self.args[0], - operator: "+", - right: make_node(AST_String, self, { value: "" }) - }).optimize(compressor); - break; - case "Number": - if (self.args.length == 0) return make_node(AST_Number, self, { - value: 0 - }); - if (self.args.length == 1 && compressor.option("unsafe_math")) { - return make_node(AST_UnaryPrefix, self, { - expression: self.args[0], - operator: "+" - }).optimize(compressor); - } - break; - case "Symbol": - if (self.args.length == 1 && self.args[0] instanceof AST_String && compressor.option("unsafe_symbols")) - self.args.length = 0; - break; - case "Boolean": - if (self.args.length == 0) return make_node(AST_False, self); - if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, { - expression: make_node(AST_UnaryPrefix, self, { - expression: self.args[0], - operator: "!" - }), - operator: "!" - }).optimize(compressor); - break; - case "RegExp": - var params = []; - if (self.args.length >= 1 - && self.args.length <= 2 - && self.args.every((arg) => { - var value = arg.evaluate(compressor); - params.push(value); - return arg !== value; - }) - && regexp_is_safe(params[0]) - ) { - let [ source, flags ] = params; - source = regexp_source_fix(new RegExp(source).source); - const rx = make_node(AST_RegExp, self, { - value: { source, flags } - }); - if (rx._eval(compressor) !== rx) { - return rx; - } - } - break; - } else if (exp instanceof AST_Dot) switch(exp.property) { - case "toString": - if (self.args.length == 0 && !exp.expression.may_throw_on_access(compressor)) { - return make_node(AST_Binary, self, { - left: make_node(AST_String, self, { value: "" }), - operator: "+", - right: exp.expression - }).optimize(compressor); - } - break; - case "join": - if (exp.expression instanceof AST_Array) EXIT: { - var separator; - if (self.args.length > 0) { - separator = self.args[0].evaluate(compressor); - if (separator === self.args[0]) break EXIT; // not a constant - } - var elements = []; - var consts = []; - for (var i = 0, len = exp.expression.elements.length; i < len; i++) { - var el = exp.expression.elements[i]; - if (el instanceof AST_Expansion) break EXIT; - var value = el.evaluate(compressor); - if (value !== el) { - consts.push(value); - } else { - if (consts.length > 0) { - elements.push(make_node(AST_String, self, { - value: consts.join(separator) - })); - consts.length = 0; - } - elements.push(el); - } - } - if (consts.length > 0) { - elements.push(make_node(AST_String, self, { - value: consts.join(separator) - })); - } - if (elements.length == 0) return make_node(AST_String, self, { value: "" }); - if (elements.length == 1) { - if (elements[0].is_string(compressor)) { - return elements[0]; - } - return make_node(AST_Binary, elements[0], { - operator : "+", - left : make_node(AST_String, self, { value: "" }), - right : elements[0] - }); - } - if (separator == "") { - var first; - if (elements[0].is_string(compressor) - || elements[1].is_string(compressor)) { - first = elements.shift(); - } else { - first = make_node(AST_String, self, { value: "" }); - } - return elements.reduce(function(prev, el) { - return make_node(AST_Binary, el, { - operator : "+", - left : prev, - right : el - }); - }, first).optimize(compressor); - } - // need this awkward cloning to not affect original element - // best_of will decide which one to get through. - var node = self.clone(); - node.expression = node.expression.clone(); - node.expression.expression = node.expression.expression.clone(); - node.expression.expression.elements = elements; - return best_of(compressor, self, node); - } - break; - case "charAt": - if (exp.expression.is_string(compressor)) { - var arg = self.args[0]; - var index = arg ? arg.evaluate(compressor) : 0; - if (index !== arg) { - return make_node(AST_Sub, exp, { - expression: exp.expression, - property: make_node_from_constant(index | 0, arg || exp) - }).optimize(compressor); - } - } - break; - case "apply": - if (self.args.length == 2 && self.args[1] instanceof AST_Array) { - var args = self.args[1].elements.slice(); - args.unshift(self.args[0]); - return make_node(AST_Call, self, { - expression: make_node(AST_Dot, exp, { - expression: exp.expression, - optional: false, - property: "call" - }), - args: args - }).optimize(compressor); - } - break; - case "call": - var func = exp.expression; - if (func instanceof AST_SymbolRef) { - func = func.fixed_value(); - } - if (func instanceof AST_Lambda && !func.contains_this()) { - return (self.args.length ? make_sequence(this, [ - self.args[0], - make_node(AST_Call, self, { - expression: exp.expression, - args: self.args.slice(1) - }) - ]) : make_node(AST_Call, self, { - expression: exp.expression, - args: [] - })).optimize(compressor); - } - break; - } - } - - if (compressor.option("unsafe_Function") - && is_undeclared_ref(exp) - && exp.name == "Function") { - // new Function() => function(){} - if (self.args.length == 0) return make_node(AST_Function, self, { - argnames: [], - body: [] - }).optimize(compressor); - if (self.args.every((x) => x instanceof AST_String)) { - // quite a corner-case, but we can handle it: - // https://github.com/mishoo/UglifyJS2/issues/203 - // if the code argument is a constant, then we can minify it. - try { - var code = "n(function(" + self.args.slice(0, -1).map(function(arg) { - return arg.value; - }).join(",") + "){" + self.args[self.args.length - 1].value + "})"; - var ast = parse(code); - var mangle = compressor.mangle_options(); - ast.figure_out_scope(mangle); - var comp = new Compressor(compressor.options, { - mangle_options: compressor._mangle_options - }); - ast = ast.transform(comp); - ast.figure_out_scope(mangle); - ast.compute_char_frequency(mangle); - ast.mangle_names(mangle); - var fun; - walk(ast, node => { - if (is_func_expr(node)) { - fun = node; - return walk_abort; - } - }); - var code = OutputStream(); - AST_BlockStatement.prototype._codegen.call(fun, fun, code); - self.args = [ - make_node(AST_String, self, { - value: fun.argnames.map(function(arg) { - return arg.print_to_string(); - }).join(",") - }), - make_node(AST_String, self.args[self.args.length - 1], { - value: code.get().replace(/^{|}$/g, "") - }) - ]; - return self; - } catch (ex) { - if (!(ex instanceof JS_Parse_Error)) { - throw ex; - } - - // Otherwise, it crashes at runtime. Or maybe it's nonstandard syntax. - } - } - } - - return inline_into_call(self, compressor); -}); - -/** Does this node contain optional property access or optional call? */ -AST_Node.DEFMETHOD("contains_optional", function() { - if ( - this instanceof AST_PropAccess - || this instanceof AST_Call - || this instanceof AST_Chain - ) { - if (this.optional) { - return true; - } else { - return this.expression.contains_optional(); - } - } else { - return false; - } -}); - -def_optimize(AST_New, function(self, compressor) { - if ( - compressor.option("unsafe") && - is_undeclared_ref(self.expression) && - ["Object", "RegExp", "Function", "Error", "Array"].includes(self.expression.name) - ) return make_node(AST_Call, self, self).transform(compressor); - return self; -}); - -def_optimize(AST_Sequence, function(self, compressor) { - if (!compressor.option("side_effects")) return self; - var expressions = []; - filter_for_side_effects(); - var end = expressions.length - 1; - trim_right_for_undefined(); - if (end == 0) { - self = maintain_this_binding(compressor.parent(), compressor.self(), expressions[0]); - if (!(self instanceof AST_Sequence)) self = self.optimize(compressor); - return self; - } - self.expressions = expressions; - return self; - - function filter_for_side_effects() { - var first = first_in_statement(compressor); - var last = self.expressions.length - 1; - self.expressions.forEach(function(expr, index) { - if (index < last) expr = expr.drop_side_effect_free(compressor, first); - if (expr) { - merge_sequence(expressions, expr); - first = false; - } - }); - } - - function trim_right_for_undefined() { - while (end > 0 && is_undefined(expressions[end], compressor)) end--; - if (end < expressions.length - 1) { - expressions[end] = make_node(AST_UnaryPrefix, self, { - operator : "void", - expression : expressions[end] - }); - expressions.length = end + 1; - } - } -}); - -AST_Unary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.expression instanceof AST_Sequence) { - var x = this.expression.expressions.slice(); - var e = this.clone(); - e.expression = x.pop(); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } - } - return this; -}); - -def_optimize(AST_UnaryPostfix, function(self, compressor) { - return self.lift_sequences(compressor); -}); - -def_optimize(AST_UnaryPrefix, function(self, compressor) { - var e = self.expression; - if ( - self.operator == "delete" && - !( - e instanceof AST_SymbolRef || - e instanceof AST_PropAccess || - e instanceof AST_Chain || - is_identifier_atom(e) - ) - ) { - return make_sequence(self, [e, make_node(AST_True, self)]).optimize(compressor); - } - var seq = self.lift_sequences(compressor); - if (seq !== self) { - return seq; - } - if (compressor.option("side_effects") && self.operator == "void") { - e = e.drop_side_effect_free(compressor); - if (e) { - self.expression = e; - return self; - } else { - return make_node(AST_Undefined, self).optimize(compressor); - } - } - if (compressor.in_boolean_context()) { - switch (self.operator) { - case "!": - if (e instanceof AST_UnaryPrefix && e.operator == "!") { - // !!foo ==> foo, if we're in boolean context - return e.expression; - } - if (e instanceof AST_Binary) { - self = best_of(compressor, self, e.negate(compressor, first_in_statement(compressor))); - } - break; - case "typeof": - // typeof always returns a non-empty string, thus it's - // always true in booleans - // And we don't need to check if it's undeclared, because in typeof, that's OK - return (e instanceof AST_SymbolRef ? make_node(AST_True, self) : make_sequence(self, [ - e, - make_node(AST_True, self) - ])).optimize(compressor); - } - } - if (self.operator == "-" && e instanceof AST_Infinity) { - e = e.transform(compressor); - } - if (e instanceof AST_Binary - && (self.operator == "+" || self.operator == "-") - && (e.operator == "*" || e.operator == "/" || e.operator == "%")) { - return make_node(AST_Binary, self, { - operator: e.operator, - left: make_node(AST_UnaryPrefix, e.left, { - operator: self.operator, - expression: e.left - }), - right: e.right - }); - } - // avoids infinite recursion of numerals - if (self.operator != "-" - || !(e instanceof AST_Number || e instanceof AST_Infinity || e instanceof AST_BigInt)) { - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - } - return self; -}); - -AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.left instanceof AST_Sequence) { - var x = this.left.expressions.slice(); - var e = this.clone(); - e.left = x.pop(); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } - if (this.right instanceof AST_Sequence && !this.left.has_side_effects(compressor)) { - var assign = this.operator == "=" && this.left instanceof AST_SymbolRef; - var x = this.right.expressions; - var last = x.length - 1; - for (var i = 0; i < last; i++) { - if (!assign && x[i].has_side_effects(compressor)) break; - } - if (i == last) { - x = x.slice(); - var e = this.clone(); - e.right = x.pop(); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } else if (i > 0) { - var e = this.clone(); - e.right = make_sequence(this.right, x.slice(i)); - x = x.slice(0, i); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } - } - } - return this; -}); - -var commutativeOperators = makePredicate("== === != !== * & | ^"); -function is_object(node) { - return node instanceof AST_Array - || node instanceof AST_Lambda - || node instanceof AST_Object - || node instanceof AST_Class; -} - -def_optimize(AST_Binary, function(self, compressor) { - function reversible() { - return self.left.is_constant() - || self.right.is_constant() - || !self.left.has_side_effects(compressor) - && !self.right.has_side_effects(compressor); - } - function reverse(op) { - if (reversible()) { - if (op) self.operator = op; - var tmp = self.left; - self.left = self.right; - self.right = tmp; - } - } - if (compressor.option("lhs_constants") && commutativeOperators.has(self.operator)) { - if (self.right.is_constant() - && !self.left.is_constant()) { - // if right is a constant, whatever side effects the - // left side might have could not influence the - // result. hence, force switch. - - if (!(self.left instanceof AST_Binary - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - reverse(); - } - } - } - self = self.lift_sequences(compressor); - if (compressor.option("comparisons")) switch (self.operator) { - case "===": - case "!==": - var is_strict_comparison = true; - if ((self.left.is_string(compressor) && self.right.is_string(compressor)) || - (self.left.is_number(compressor) && self.right.is_number(compressor)) || - (self.left.is_boolean() && self.right.is_boolean()) || - self.left.equivalent_to(self.right)) { - self.operator = self.operator.substr(0, 2); - } - // XXX: intentionally falling down to the next case - case "==": - case "!=": - // void 0 == x => null == x - if (!is_strict_comparison && is_undefined(self.left, compressor)) { - self.left = make_node(AST_Null, self.left); - // x == void 0 => x == null - } else if (!is_strict_comparison && is_undefined(self.right, compressor)) { - self.right = make_node(AST_Null, self.right); - } else if (compressor.option("typeofs") - // "undefined" == typeof x => undefined === x - && self.left instanceof AST_String - && self.left.value == "undefined" - && self.right instanceof AST_UnaryPrefix - && self.right.operator == "typeof") { - var expr = self.right.expression; - if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { - self.right = expr; - self.left = make_node(AST_Undefined, self.left).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } else if (compressor.option("typeofs") - // typeof x === "undefined" => x === undefined - && self.left instanceof AST_UnaryPrefix - && self.left.operator == "typeof" - && self.right instanceof AST_String - && self.right.value == "undefined") { - var expr = self.left.expression; - if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { - self.left = expr; - self.right = make_node(AST_Undefined, self.right).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } else if (self.left instanceof AST_SymbolRef - // obj !== obj => false - && self.right instanceof AST_SymbolRef - && self.left.definition() === self.right.definition() - && is_object(self.left.fixed_value())) { - return make_node(self.operator[0] == "=" ? AST_True : AST_False, self); - } - break; - case "&&": - case "||": - var lhs = self.left; - if (lhs.operator == self.operator) { - lhs = lhs.right; - } - if (lhs instanceof AST_Binary - && lhs.operator == (self.operator == "&&" ? "!==" : "===") - && self.right instanceof AST_Binary - && lhs.operator == self.right.operator - && (is_undefined(lhs.left, compressor) && self.right.left instanceof AST_Null - || lhs.left instanceof AST_Null && is_undefined(self.right.left, compressor)) - && !lhs.right.has_side_effects(compressor) - && lhs.right.equivalent_to(self.right.right)) { - var combined = make_node(AST_Binary, self, { - operator: lhs.operator.slice(0, -1), - left: make_node(AST_Null, self), - right: lhs.right - }); - if (lhs !== self.left) { - combined = make_node(AST_Binary, self, { - operator: self.operator, - left: self.left.left, - right: combined - }); - } - return combined; - } - break; - } - if (self.operator == "+" && compressor.in_boolean_context()) { - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if (ll && typeof ll == "string") { - return make_sequence(self, [ - self.right, - make_node(AST_True, self) - ]).optimize(compressor); - } - if (rr && typeof rr == "string") { - return make_sequence(self, [ - self.left, - make_node(AST_True, self) - ]).optimize(compressor); - } - } - if (compressor.option("comparisons") && self.is_boolean()) { - if (!(compressor.parent() instanceof AST_Binary) - || compressor.parent() instanceof AST_Assign) { - var negated = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.negate(compressor, first_in_statement(compressor)) - }); - self = best_of(compressor, self, negated); - } - if (compressor.option("unsafe_comps")) { - switch (self.operator) { - case "<": reverse(">"); break; - case "<=": reverse(">="); break; - } - } - } - if (self.operator == "+") { - if (self.right instanceof AST_String - && self.right.getValue() == "" - && self.left.is_string(compressor)) { - return self.left; - } - if (self.left instanceof AST_String - && self.left.getValue() == "" - && self.right.is_string(compressor)) { - return self.right; - } - if (self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.left instanceof AST_String - && self.left.left.getValue() == "" - && self.right.is_string(compressor)) { - self.left = self.left.right; - return self; - } - } - if (compressor.option("evaluate")) { - switch (self.operator) { - case "&&": - var ll = has_flag(self.left, TRUTHY) - ? true - : has_flag(self.left, FALSY) - ? false - : self.left.evaluate(compressor); - if (!ll) { - return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - if (compressor.in_boolean_context()) { - return make_sequence(self, [ - self.left, - make_node(AST_False, self) - ]).optimize(compressor); - } else { - set_flag(self, FALSY); - } - } else if (!(rr instanceof AST_Node)) { - var parent = compressor.parent(); - if (parent.operator == "&&" && parent.left === compressor.self() || compressor.in_boolean_context()) { - return self.left.optimize(compressor); - } - } - // x || false && y ---> x ? y : false - if (self.left.operator == "||") { - var lr = self.left.right.evaluate(compressor); - if (!lr) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.right, - alternative: self.left.right - }).optimize(compressor); - } - break; - case "||": - var ll = has_flag(self.left, TRUTHY) - ? true - : has_flag(self.left, FALSY) - ? false - : self.left.evaluate(compressor); - if (!ll) { - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - var parent = compressor.parent(); - if (parent.operator == "||" && parent.left === compressor.self() || compressor.in_boolean_context()) { - return self.left.optimize(compressor); - } - } else if (!(rr instanceof AST_Node)) { - if (compressor.in_boolean_context()) { - return make_sequence(self, [ - self.left, - make_node(AST_True, self) - ]).optimize(compressor); - } else { - set_flag(self, TRUTHY); - } - } - if (self.left.operator == "&&") { - var lr = self.left.right.evaluate(compressor); - if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.left.right, - alternative: self.right - }).optimize(compressor); - } - break; - case "??": - if (is_nullish(self.left, compressor)) { - return self.right; - } - - var ll = self.left.evaluate(compressor); - if (!(ll instanceof AST_Node)) { - // if we know the value for sure we can simply compute right away. - return ll == null ? self.right : self.left; - } - - if (compressor.in_boolean_context()) { - const rr = self.right.evaluate(compressor); - if (!(rr instanceof AST_Node) && !rr) { - return self.left; - } - } - } - var associative = true; - switch (self.operator) { - case "+": - // (x + "foo") + "bar" => x + "foobar" - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor)) { - var binary = make_node(AST_Binary, self, { - operator: "+", - left: self.left.right, - right: self.right, - }); - var r = binary.optimize(compressor); - if (binary !== r) { - self = make_node(AST_Binary, self, { - operator: "+", - left: self.left.left, - right: r - }); - } - } - // (x + "foo") + ("bar" + y) => (x + "foobar") + y - if (self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor) - && self.right instanceof AST_Binary - && self.right.operator == "+" - && self.right.is_string(compressor)) { - var binary = make_node(AST_Binary, self, { - operator: "+", - left: self.left.right, - right: self.right.left, - }); - var m = binary.optimize(compressor); - if (binary !== m) { - self = make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_Binary, self.left, { - operator: "+", - left: self.left.left, - right: m - }), - right: self.right.right - }); - } - } - // a + -b => a - b - if (self.right instanceof AST_UnaryPrefix - && self.right.operator == "-" - && self.left.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.left, - right: self.right.expression - }); - break; - } - // -a + b => b - a - if (self.left instanceof AST_UnaryPrefix - && self.left.operator == "-" - && reversible() - && self.right.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.right, - right: self.left.expression - }); - break; - } - // `foo${bar}baz` + 1 => `foo${bar}baz1` - if (self.left instanceof AST_TemplateString) { - var l = self.left; - var r = self.right.evaluate(compressor); - if (r != self.right) { - l.segments[l.segments.length - 1].value += String(r); - return l; - } - } - // 1 + `foo${bar}baz` => `1foo${bar}baz` - if (self.right instanceof AST_TemplateString) { - var r = self.right; - var l = self.left.evaluate(compressor); - if (l != self.left) { - r.segments[0].value = String(l) + r.segments[0].value; - return r; - } - } - // `1${bar}2` + `foo${bar}baz` => `1${bar}2foo${bar}baz` - if (self.left instanceof AST_TemplateString - && self.right instanceof AST_TemplateString) { - var l = self.left; - var segments = l.segments; - var r = self.right; - segments[segments.length - 1].value += r.segments[0].value; - for (var i = 1; i < r.segments.length; i++) { - segments.push(r.segments[i]); - } - return l; - } - case "*": - associative = compressor.option("unsafe_math"); - case "&": - case "|": - case "^": - // a + +b => +b + a - if (self.left.is_number(compressor) - && self.right.is_number(compressor) - && reversible() - && !(self.left instanceof AST_Binary - && self.left.operator != self.operator - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - var reversed = make_node(AST_Binary, self, { - operator: self.operator, - left: self.right, - right: self.left - }); - if (self.right instanceof AST_Constant - && !(self.left instanceof AST_Constant)) { - self = best_of(compressor, reversed, self); - } else { - self = best_of(compressor, self, reversed); - } - } - if (associative && self.is_number(compressor)) { - // a + (b + c) => (a + b) + c - if (self.right instanceof AST_Binary - && self.right.operator == self.operator) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left, - right: self.right.left, - start: self.left.start, - end: self.right.left.end - }), - right: self.right.right - }); - } - // (n + 2) + 3 => 5 + n - // (2 * n) * 3 => 6 + n - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == self.operator) { - if (self.left.left instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left.left, - right: self.right, - start: self.left.left.start, - end: self.right.end - }), - right: self.left.right - }); - } else if (self.left.right instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left.right, - right: self.right, - start: self.left.right.start, - end: self.right.end - }), - right: self.left.left - }); - } - } - // (a | 1) | (2 | d) => (3 | a) | b - if (self.left instanceof AST_Binary - && self.left.operator == self.operator - && self.left.right instanceof AST_Constant - && self.right instanceof AST_Binary - && self.right.operator == self.operator - && self.right.left instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: make_node(AST_Binary, self.left.left, { - operator: self.operator, - left: self.left.right, - right: self.right.left, - start: self.left.right.start, - end: self.right.left.end - }), - right: self.left.left - }), - right: self.right.right - }); - } - } - } - } - // x && (y && z) ==> x && y && z - // x || (y || z) ==> x || y || z - // x + ("y" + z) ==> x + "y" + z - // "x" + (y + "z")==> "x" + y + "z" - if (self.right instanceof AST_Binary - && self.right.operator == self.operator - && (lazy_op.has(self.operator) - || (self.operator == "+" - && (self.right.left.is_string(compressor) - || (self.left.is_string(compressor) - && self.right.right.is_string(compressor))))) - ) { - self.left = make_node(AST_Binary, self.left, { - operator : self.operator, - left : self.left.transform(compressor), - right : self.right.left.transform(compressor) - }); - self.right = self.right.right.transform(compressor); - return self.transform(compressor); - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; -}); - -def_optimize(AST_SymbolExport, function(self) { - return self; -}); - -def_optimize(AST_SymbolRef, function(self, compressor) { - if ( - !compressor.option("ie8") - && is_undeclared_ref(self) - && !compressor.find_parent(AST_With) - ) { - switch (self.name) { - case "undefined": - return make_node(AST_Undefined, self).optimize(compressor); - case "NaN": - return make_node(AST_NaN, self).optimize(compressor); - case "Infinity": - return make_node(AST_Infinity, self).optimize(compressor); - } - } - - if (compressor.option("reduce_vars") && !compressor.is_lhs()) { - return inline_into_symbolref(self, compressor); - } else { - return self; - } -}); - -function is_atomic(lhs, self) { - return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE; -} - -def_optimize(AST_Undefined, function(self, compressor) { - if (compressor.option("unsafe_undefined")) { - var undef = find_variable(compressor, "undefined"); - if (undef) { - var ref = make_node(AST_SymbolRef, self, { - name : "undefined", - scope : undef.scope, - thedef : undef - }); - set_flag(ref, UNDEFINED); - return ref; - } - } - var lhs = compressor.is_lhs(); - if (lhs && is_atomic(lhs, self)) return self; - return make_node(AST_UnaryPrefix, self, { - operator: "void", - expression: make_node(AST_Number, self, { - value: 0 - }) - }); -}); - -def_optimize(AST_Infinity, function(self, compressor) { - var lhs = compressor.is_lhs(); - if (lhs && is_atomic(lhs, self)) return self; - if ( - compressor.option("keep_infinity") - && !(lhs && !is_atomic(lhs, self)) - && !find_variable(compressor, "Infinity") - ) { - return self; - } - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { - value: 1 - }), - right: make_node(AST_Number, self, { - value: 0 - }) - }); -}); - -def_optimize(AST_NaN, function(self, compressor) { - var lhs = compressor.is_lhs(); - if (lhs && !is_atomic(lhs, self) - || find_variable(compressor, "NaN")) { - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { - value: 0 - }), - right: make_node(AST_Number, self, { - value: 0 - }) - }); - } - return self; -}); - -const ASSIGN_OPS = makePredicate("+ - / * % >> << >>> | ^ &"); -const ASSIGN_OPS_COMMUTATIVE = makePredicate("* | ^ &"); -def_optimize(AST_Assign, function(self, compressor) { - if (self.logical) { - return self.lift_sequences(compressor); - } - - var def; - // x = x ---> x - if ( - self.operator === "=" - && self.left instanceof AST_SymbolRef - && self.left.name !== "arguments" - && !(def = self.left.definition()).undeclared - && self.right.equivalent_to(self.left) - ) { - return self.right; - } - - if (compressor.option("dead_code") - && self.left instanceof AST_SymbolRef - && (def = self.left.definition()).scope === compressor.find_parent(AST_Lambda)) { - var level = 0, node, parent = self; - do { - node = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_Exit) { - if (in_try(level, parent)) break; - if (is_reachable(def.scope, [ def ])) break; - if (self.operator == "=") return self.right; - def.fixed = false; - return make_node(AST_Binary, self, { - operator: self.operator.slice(0, -1), - left: self.left, - right: self.right - }).optimize(compressor); - } - } while (parent instanceof AST_Binary && parent.right === node - || parent instanceof AST_Sequence && parent.tail_node() === node); - } - self = self.lift_sequences(compressor); - - if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) { - // x = expr1 OP expr2 - if (self.right.left instanceof AST_SymbolRef - && self.right.left.name == self.left.name - && ASSIGN_OPS.has(self.right.operator)) { - // x = x - 2 ---> x -= 2 - self.operator = self.right.operator + "="; - self.right = self.right.right; - } else if (self.right.right instanceof AST_SymbolRef - && self.right.right.name == self.left.name - && ASSIGN_OPS_COMMUTATIVE.has(self.right.operator) - && !self.right.left.has_side_effects(compressor)) { - // x = 2 & x ---> x &= 2 - self.operator = self.right.operator + "="; - self.right = self.right.left; - } - } - return self; - - function in_try(level, node) { - function may_assignment_throw() { - const right = self.right; - self.right = make_node(AST_Null, right); - const may_throw = node.may_throw(compressor); - self.right = right; - - return may_throw; - } - - var stop_at = self.left.definition().scope.get_defun_scope(); - var parent; - while ((parent = compressor.parent(level++)) !== stop_at) { - if (parent instanceof AST_Try) { - if (parent.bfinally) return true; - if (parent.bcatch && may_assignment_throw()) return true; - } - } - } -}); - -def_optimize(AST_DefaultAssign, function(self, compressor) { - if (!compressor.option("evaluate")) { - return self; - } - var evaluateRight = self.right.evaluate(compressor); - - // `[x = undefined] = foo` ---> `[x] = foo` - // `(arg = undefined) => ...` ---> `(arg) => ...` (unless `keep_fargs`) - // `((arg = undefined) => ...)()` ---> `((arg) => ...)()` - let lambda, iife; - if (evaluateRight === undefined) { - if ( - (lambda = compressor.parent()) instanceof AST_Lambda - ? ( - compressor.option("keep_fargs") === false - || (iife = compressor.parent(1)).TYPE === "Call" - && iife.expression === lambda - ) - : true - ) { - self = self.left; - } - } else if (evaluateRight !== self.right) { - evaluateRight = make_node_from_constant(evaluateRight, self.right); - self.right = best_of_expression(evaluateRight, self.right); - } - - return self; -}); - -function is_nullish_check(check, check_subject, compressor) { - if (check_subject.may_throw(compressor)) return false; - - let nullish_side; - - // foo == null - if ( - check instanceof AST_Binary - && check.operator === "==" - // which side is nullish? - && ( - (nullish_side = is_nullish(check.left, compressor) && check.left) - || (nullish_side = is_nullish(check.right, compressor) && check.right) - ) - // is the other side the same as the check_subject - && ( - nullish_side === check.left - ? check.right - : check.left - ).equivalent_to(check_subject) - ) { - return true; - } - - // foo === null || foo === undefined - if (check instanceof AST_Binary && check.operator === "||") { - let null_cmp; - let undefined_cmp; - - const find_comparison = cmp => { - if (!( - cmp instanceof AST_Binary - && (cmp.operator === "===" || cmp.operator === "==") - )) { - return false; - } - - let found = 0; - let defined_side; - - if (cmp.left instanceof AST_Null) { - found++; - null_cmp = cmp; - defined_side = cmp.right; - } - if (cmp.right instanceof AST_Null) { - found++; - null_cmp = cmp; - defined_side = cmp.left; - } - if (is_undefined(cmp.left, compressor)) { - found++; - undefined_cmp = cmp; - defined_side = cmp.right; - } - if (is_undefined(cmp.right, compressor)) { - found++; - undefined_cmp = cmp; - defined_side = cmp.left; - } - - if (found !== 1) { - return false; - } - - if (!defined_side.equivalent_to(check_subject)) { - return false; - } - - return true; - }; - - if (!find_comparison(check.left)) return false; - if (!find_comparison(check.right)) return false; - - if (null_cmp && undefined_cmp && null_cmp !== undefined_cmp) { - return true; - } - } - - return false; -} - -def_optimize(AST_Conditional, function(self, compressor) { - if (!compressor.option("conditionals")) return self; - // This looks like lift_sequences(), should probably be under "sequences" - if (self.condition instanceof AST_Sequence) { - var expressions = self.condition.expressions.slice(); - self.condition = expressions.pop(); - expressions.push(self); - return make_sequence(self, expressions); - } - var cond = self.condition.evaluate(compressor); - if (cond !== self.condition) { - if (cond) { - return maintain_this_binding(compressor.parent(), compressor.self(), self.consequent); - } else { - return maintain_this_binding(compressor.parent(), compressor.self(), self.alternative); - } - } - var negated = cond.negate(compressor, first_in_statement(compressor)); - if (best_of(compressor, cond, negated) === negated) { - self = make_node(AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent - }); - } - var condition = self.condition; - var consequent = self.consequent; - var alternative = self.alternative; - // x?x:y --> x||y - if (condition instanceof AST_SymbolRef - && consequent instanceof AST_SymbolRef - && condition.definition() === consequent.definition()) { - return make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative - }); - } - // if (foo) exp = something; else exp = something_else; - // | - // v - // exp = foo ? something : something_else; - if ( - consequent instanceof AST_Assign - && alternative instanceof AST_Assign - && consequent.operator === alternative.operator - && consequent.logical === alternative.logical - && consequent.left.equivalent_to(alternative.left) - && (!self.condition.has_side_effects(compressor) - || consequent.operator == "=" - && !consequent.left.has_side_effects(compressor)) - ) { - return make_node(AST_Assign, self, { - operator: consequent.operator, - left: consequent.left, - logical: consequent.logical, - right: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.right, - alternative: alternative.right - }) - }); - } - // x ? y(a) : y(b) --> y(x ? a : b) - var arg_index; - if (consequent instanceof AST_Call - && alternative.TYPE === consequent.TYPE - && consequent.args.length > 0 - && consequent.args.length == alternative.args.length - && consequent.expression.equivalent_to(alternative.expression) - && !self.condition.has_side_effects(compressor) - && !consequent.expression.has_side_effects(compressor) - && typeof (arg_index = single_arg_diff()) == "number") { - var node = consequent.clone(); - node.args[arg_index] = make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.args[arg_index], - alternative: alternative.args[arg_index] - }); - return node; - } - // a ? b : c ? b : d --> (a || c) ? b : d - if (alternative instanceof AST_Conditional - && consequent.equivalent_to(alternative.consequent)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative.condition - }), - consequent: consequent, - alternative: alternative.alternative - }).optimize(compressor); - } - - // a == null ? b : a -> a ?? b - if ( - compressor.option("ecma") >= 2020 && - is_nullish_check(condition, alternative, compressor) - ) { - return make_node(AST_Binary, self, { - operator: "??", - left: alternative, - right: consequent - }).optimize(compressor); - } - - // a ? b : (c, b) --> (a || c), b - if (alternative instanceof AST_Sequence - && consequent.equivalent_to(alternative.expressions[alternative.expressions.length - 1])) { - return make_sequence(self, [ - make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: make_sequence(self, alternative.expressions.slice(0, -1)) - }), - consequent - ]).optimize(compressor); - } - // a ? b : (c && b) --> (a || c) && b - if (alternative instanceof AST_Binary - && alternative.operator == "&&" - && consequent.equivalent_to(alternative.right)) { - return make_node(AST_Binary, self, { - operator: "&&", - left: make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative.left - }), - right: consequent - }).optimize(compressor); - } - // x?y?z:a:a --> x&&y?z:a - if (consequent instanceof AST_Conditional - && consequent.alternative.equivalent_to(alternative)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: self.condition, - operator: "&&", - right: consequent.condition - }), - consequent: consequent.consequent, - alternative: alternative - }); - } - // x ? y : y --> x, y - if (consequent.equivalent_to(alternative)) { - return make_sequence(self, [ - self.condition, - consequent - ]).optimize(compressor); - } - // x ? y || z : z --> x && y || z - if (consequent instanceof AST_Binary - && consequent.operator == "||" - && consequent.right.equivalent_to(alternative)) { - return make_node(AST_Binary, self, { - operator: "||", - left: make_node(AST_Binary, self, { - operator: "&&", - left: self.condition, - right: consequent.left - }), - right: alternative - }).optimize(compressor); - } - - const in_bool = compressor.in_boolean_context(); - if (is_true(self.consequent)) { - if (is_false(self.alternative)) { - // c ? true : false ---> !!c - return booleanize(self.condition); - } - // c ? true : x ---> !!c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(self.condition), - right: self.alternative - }); - } - if (is_false(self.consequent)) { - if (is_true(self.alternative)) { - // c ? false : true ---> !c - return booleanize(self.condition.negate(compressor)); - } - // c ? false : x ---> !c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition.negate(compressor)), - right: self.alternative - }); - } - if (is_true(self.alternative)) { - // c ? x : true ---> !c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(self.condition.negate(compressor)), - right: self.consequent - }); - } - if (is_false(self.alternative)) { - // c ? x : false ---> !!c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition), - right: self.consequent - }); - } - - return self; - - function booleanize(node) { - if (node.is_boolean()) return node; - // !!expression - return make_node(AST_UnaryPrefix, node, { - operator: "!", - expression: node.negate(compressor) - }); - } - - // AST_True or !0 - function is_true(node) { - return node instanceof AST_True - || in_bool - && node instanceof AST_Constant - && node.getValue() - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && !node.expression.getValue()); - } - // AST_False or !1 - function is_false(node) { - return node instanceof AST_False - || in_bool - && node instanceof AST_Constant - && !node.getValue() - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && node.expression.getValue()); - } - - function single_arg_diff() { - var a = consequent.args; - var b = alternative.args; - for (var i = 0, len = a.length; i < len; i++) { - if (a[i] instanceof AST_Expansion) return; - if (!a[i].equivalent_to(b[i])) { - if (b[i] instanceof AST_Expansion) return; - for (var j = i + 1; j < len; j++) { - if (a[j] instanceof AST_Expansion) return; - if (!a[j].equivalent_to(b[j])) return; - } - return i; - } - } - } -}); - -def_optimize(AST_Boolean, function(self, compressor) { - if (compressor.in_boolean_context()) return make_node(AST_Number, self, { - value: +self.value - }); - var p = compressor.parent(); - if (compressor.option("booleans_as_integers")) { - if (p instanceof AST_Binary && (p.operator == "===" || p.operator == "!==")) { - p.operator = p.operator.replace(/=$/, ""); - } - return make_node(AST_Number, self, { - value: +self.value - }); - } - if (compressor.option("booleans")) { - if (p instanceof AST_Binary && (p.operator == "==" - || p.operator == "!=")) { - return make_node(AST_Number, self, { - value: +self.value - }); - } - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_Number, self, { - value: 1 - self.value - }) - }); - } - return self; -}); - -function safe_to_flatten(value, compressor) { - if (value instanceof AST_SymbolRef) { - value = value.fixed_value(); - } - if (!value) return false; - if (!(value instanceof AST_Lambda || value instanceof AST_Class)) return true; - if (!(value instanceof AST_Lambda && value.contains_this())) return true; - return compressor.parent() instanceof AST_New; -} - -AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { - if (!compressor.option("properties")) return; - if (key === "__proto__") return; - - var arrows = compressor.option("unsafe_arrows") && compressor.option("ecma") >= 2015; - var expr = this.expression; - if (expr instanceof AST_Object) { - var props = expr.properties; - - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - - if ("" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) { - const all_props_flattenable = props.every((p) => - (p instanceof AST_ObjectKeyVal - || arrows && p instanceof AST_ConciseMethod && !p.is_generator - ) - && !p.computed_key() - ); - - if (!all_props_flattenable) return; - if (!safe_to_flatten(prop.value, compressor)) return; - - return make_node(AST_Sub, this, { - expression: make_node(AST_Array, expr, { - elements: props.map(function(prop) { - var v = prop.value; - if (v instanceof AST_Accessor) { - v = make_node(AST_Function, v, v); - } - - var k = prop.key; - if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) { - return make_sequence(prop, [ k, v ]); - } - - return v; - }) - }), - property: make_node(AST_Number, this, { - value: i - }) - }); - } - } - } -}); - -def_optimize(AST_Sub, function(self, compressor) { - var expr = self.expression; - var prop = self.property; - if (compressor.option("properties")) { - var key = prop.evaluate(compressor); - if (key !== prop) { - if (typeof key == "string") { - if (key == "undefined") { - key = undefined; - } else { - var value = parseFloat(key); - if (value.toString() == key) { - key = value; - } - } - } - prop = self.property = best_of_expression( - prop, - make_node_from_constant(key, prop).transform(compressor) - ); - var property = "" + key; - if (is_basic_identifier_string(property) - && property.length <= prop.size() + 1) { - return make_node(AST_Dot, self, { - expression: expr, - optional: self.optional, - property: property, - quote: prop.quote, - }).optimize(compressor); - } - } - } - var fn; - OPT_ARGUMENTS: if (compressor.option("arguments") - && expr instanceof AST_SymbolRef - && expr.name == "arguments" - && expr.definition().orig.length == 1 - && (fn = expr.scope) instanceof AST_Lambda - && fn.uses_arguments - && !(fn instanceof AST_Arrow) - && prop instanceof AST_Number) { - var index = prop.getValue(); - var params = new Set(); - var argnames = fn.argnames; - for (var n = 0; n < argnames.length; n++) { - if (!(argnames[n] instanceof AST_SymbolFunarg)) { - break OPT_ARGUMENTS; // destructuring parameter - bail - } - var param = argnames[n].name; - if (params.has(param)) { - break OPT_ARGUMENTS; // duplicate parameter - bail - } - params.add(param); - } - var argname = fn.argnames[index]; - if (argname && compressor.has_directive("use strict")) { - var def = argname.definition(); - if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) { - argname = null; - } - } else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) { - while (index >= fn.argnames.length) { - argname = fn.create_symbol(AST_SymbolFunarg, { - source: fn, - scope: fn, - tentative_name: "argument_" + fn.argnames.length, - }); - fn.argnames.push(argname); - } - } - if (argname) { - var sym = make_node(AST_SymbolRef, self, argname); - sym.reference({}); - clear_flag(argname, UNUSED); - return sym; - } - } - if (compressor.is_lhs()) return self; - if (key !== prop) { - var sub = self.flatten_object(property, compressor); - if (sub) { - expr = self.expression = sub.expression; - prop = self.property = sub.property; - } - } - if (compressor.option("properties") && compressor.option("side_effects") - && prop instanceof AST_Number && expr instanceof AST_Array) { - var index = prop.getValue(); - var elements = expr.elements; - var retValue = elements[index]; - FLATTEN: if (safe_to_flatten(retValue, compressor)) { - var flatten = true; - var values = []; - for (var i = elements.length; --i > index;) { - var value = elements[i].drop_side_effect_free(compressor); - if (value) { - values.unshift(value); - if (flatten && value.has_side_effects(compressor)) flatten = false; - } - } - if (retValue instanceof AST_Expansion) break FLATTEN; - retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue; - if (!flatten) values.unshift(retValue); - while (--i >= 0) { - var value = elements[i]; - if (value instanceof AST_Expansion) break FLATTEN; - value = value.drop_side_effect_free(compressor); - if (value) values.unshift(value); - else index--; - } - if (flatten) { - values.push(retValue); - return make_sequence(self, values).optimize(compressor); - } else return make_node(AST_Sub, self, { - expression: make_node(AST_Array, expr, { - elements: values - }), - property: make_node(AST_Number, prop, { - value: index - }) - }); - } - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; -}); - -def_optimize(AST_Chain, function (self, compressor) { - if (is_nullish(self.expression, compressor)) { - let parent = compressor.parent(); - // It's valid to delete a nullish optional chain, but if we optimized - // this to `delete undefined` then it would appear to be a syntax error - // when we try to optimize the delete. Thankfully, `delete 0` is fine. - if (parent instanceof AST_UnaryPrefix && parent.operator === "delete") { - return make_node_from_constant(0, self); - } - return make_node(AST_Undefined, self); - } - return self; -}); - -def_optimize(AST_Dot, function(self, compressor) { - const parent = compressor.parent(); - if (compressor.is_lhs()) return self; - if (compressor.option("unsafe_proto") - && self.expression instanceof AST_Dot - && self.expression.property == "prototype") { - var exp = self.expression.expression; - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - self.expression = make_node(AST_Array, self.expression, { - elements: [] - }); - break; - case "Function": - self.expression = make_node(AST_Function, self.expression, { - argnames: [], - body: [] - }); - break; - case "Number": - self.expression = make_node(AST_Number, self.expression, { - value: 0 - }); - break; - case "Object": - self.expression = make_node(AST_Object, self.expression, { - properties: [] - }); - break; - case "RegExp": - self.expression = make_node(AST_RegExp, self.expression, { - value: { source: "t", flags: "" } - }); - break; - case "String": - self.expression = make_node(AST_String, self.expression, { - value: "" - }); - break; - } - } - if (!(parent instanceof AST_Call) || !has_annotation(parent, _NOINLINE)) { - const sub = self.flatten_object(self.property, compressor); - if (sub) return sub.optimize(compressor); - } - - if (self.expression instanceof AST_PropAccess - && parent instanceof AST_PropAccess) { - return self; - } - - let ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; -}); - -function literals_in_boolean_context(self, compressor) { - if (compressor.in_boolean_context()) { - return best_of(compressor, self, make_sequence(self, [ - self, - make_node(AST_True, self) - ]).optimize(compressor)); - } - return self; -} - -function inline_array_like_spread(elements) { - for (var i = 0; i < elements.length; i++) { - var el = elements[i]; - if (el instanceof AST_Expansion) { - var expr = el.expression; - if ( - expr instanceof AST_Array - && !expr.elements.some(elm => elm instanceof AST_Hole) - ) { - elements.splice(i, 1, ...expr.elements); - // Step back one, as the element at i is now new. - i--; - } - // In array-like spread, spreading a non-iterable value is TypeError. - // We therefore can’t optimize anything else, unlike with object spread. - } - } -} - -def_optimize(AST_Array, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_array_like_spread(self.elements); - return self; -}); - -function inline_object_prop_spread(props, compressor) { - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop instanceof AST_Expansion) { - const expr = prop.expression; - if ( - expr instanceof AST_Object - && expr.properties.every(prop => prop instanceof AST_ObjectKeyVal) - ) { - props.splice(i, 1, ...expr.properties); - // Step back one, as the property at i is now new. - i--; - } else if (expr instanceof AST_Constant - && !(expr instanceof AST_String)) { - // Unlike array-like spread, in object spread, spreading a - // non-iterable value silently does nothing; it is thus safe - // to remove. AST_String is the only iterable AST_Constant. - props.splice(i, 1); - i--; - } else if (is_nullish(expr, compressor)) { - // Likewise, null and undefined can be silently removed. - props.splice(i, 1); - i--; - } - } - } -} - -def_optimize(AST_Object, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_object_prop_spread(self.properties, compressor); - return self; -}); - -def_optimize(AST_RegExp, literals_in_boolean_context); - -def_optimize(AST_Return, function(self, compressor) { - if (self.value && is_undefined(self.value, compressor)) { - self.value = null; - } - return self; -}); - -def_optimize(AST_Arrow, opt_AST_Lambda); - -def_optimize(AST_Function, function(self, compressor) { - self = opt_AST_Lambda(self, compressor); - if (compressor.option("unsafe_arrows") - && compressor.option("ecma") >= 2015 - && !self.name - && !self.is_generator - && !self.uses_arguments - && !self.pinned()) { - const uses_this = walk(self, node => { - if (node instanceof AST_This) return walk_abort; - }); - if (!uses_this) return make_node(AST_Arrow, self, self).optimize(compressor); - } - return self; -}); - -def_optimize(AST_Class, function(self) { - for (let i = 0; i < self.properties.length; i++) { - const prop = self.properties[i]; - if (prop instanceof AST_ClassStaticBlock && prop.body.length == 0) { - self.properties.splice(i, 1); - i--; - } - } - - return self; -}); - -def_optimize(AST_ClassStaticBlock, function(self, compressor) { - tighten_body(self.body, compressor); - return self; -}); - -def_optimize(AST_Yield, function(self, compressor) { - if (self.expression && !self.is_star && is_undefined(self.expression, compressor)) { - self.expression = null; - } - return self; -}); - -def_optimize(AST_TemplateString, function(self, compressor) { - if ( - !compressor.option("evaluate") - || compressor.parent() instanceof AST_PrefixedTemplateString - ) { - return self; - } - - var segments = []; - for (var i = 0; i < self.segments.length; i++) { - var segment = self.segments[i]; - if (segment instanceof AST_Node) { - var result = segment.evaluate(compressor); - // Evaluate to constant value - // Constant value shorter than ${segment} - if (result !== segment && (result + "").length <= segment.size() + "${}".length) { - // There should always be a previous and next segment if segment is a node - segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value; - continue; - } - // `before ${`innerBefore ${any} innerAfter`} after` => `before innerBefore ${any} innerAfter after` - // TODO: - // `before ${'test' + foo} after` => `before innerBefore ${any} innerAfter after` - // `before ${foo + 'test} after` => `before innerBefore ${any} innerAfter after` - if (segment instanceof AST_TemplateString) { - var inners = segment.segments; - segments[segments.length - 1].value += inners[0].value; - for (var j = 1; j < inners.length; j++) { - segment = inners[j]; - segments.push(segment); - } - continue; - } - } - segments.push(segment); - } - self.segments = segments; - - // `foo` => "foo" - if (segments.length == 1) { - return make_node(AST_String, self, segments[0]); - } - - if ( - segments.length === 3 - && segments[1] instanceof AST_Node - && ( - segments[1].is_string(compressor) - || segments[1].is_number(compressor) - || is_nullish(segments[1], compressor) - || compressor.option("unsafe") - ) - ) { - // `foo${bar}` => "foo" + bar - if (segments[2].value === "") { - return make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self, { - value: segments[0].value, - }), - right: segments[1], - }); - } - // `${bar}baz` => bar + "baz" - if (segments[0].value === "") { - return make_node(AST_Binary, self, { - operator: "+", - left: segments[1], - right: make_node(AST_String, self, { - value: segments[2].value, - }), - }); - } - } - return self; -}); - -def_optimize(AST_PrefixedTemplateString, function(self) { - return self; -}); - -// ["p"]:1 ---> p:1 -// [42]:1 ---> 42:1 -function lift_key(self, compressor) { - if (!compressor.option("computed_props")) return self; - // save a comparison in the typical case - if (!(self.key instanceof AST_Constant)) return self; - // allow certain acceptable props as not all AST_Constants are true constants - if (self.key instanceof AST_String || self.key instanceof AST_Number) { - if (self.key.value === "__proto__") return self; - if (self.key.value == "constructor" - && compressor.parent() instanceof AST_Class) return self; - if (self instanceof AST_ObjectKeyVal) { - self.quote = self.key.quote; - self.key = self.key.value; - } else if (self instanceof AST_ClassProperty) { - self.quote = self.key.quote; - self.key = make_node(AST_SymbolClassProperty, self.key, { - name: self.key.value - }); - } else { - self.quote = self.key.quote; - self.key = make_node(AST_SymbolMethod, self.key, { - name: self.key.value - }); - } - } - return self; -} - -def_optimize(AST_ObjectProperty, lift_key); - -def_optimize(AST_ConciseMethod, function(self, compressor) { - lift_key(self, compressor); - // p(){return x;} ---> p:()=>x - if (compressor.option("arrows") - && compressor.parent() instanceof AST_Object - && !self.is_generator - && !self.value.uses_arguments - && !self.value.pinned() - && self.value.body.length == 1 - && self.value.body[0] instanceof AST_Return - && self.value.body[0].value - && !self.value.contains_this()) { - var arrow = make_node(AST_Arrow, self.value, self.value); - arrow.async = self.async; - arrow.is_generator = self.is_generator; - return make_node(AST_ObjectKeyVal, self, { - key: self.key instanceof AST_SymbolMethod ? self.key.name : self.key, - value: arrow, - quote: self.quote, - }); - } - return self; -}); - -def_optimize(AST_ObjectKeyVal, function(self, compressor) { - lift_key(self, compressor); - // p:function(){} ---> p(){} - // p:function*(){} ---> *p(){} - // p:async function(){} ---> async p(){} - // p:()=>{} ---> p(){} - // p:async()=>{} ---> async p(){} - var unsafe_methods = compressor.option("unsafe_methods"); - if (unsafe_methods - && compressor.option("ecma") >= 2015 - && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + ""))) { - var key = self.key; - var value = self.value; - var is_arrow_with_block = value instanceof AST_Arrow - && Array.isArray(value.body) - && !value.contains_this(); - if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) { - return make_node(AST_ConciseMethod, self, { - async: value.async, - is_generator: value.is_generator, - key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self, { - name: key, - }), - value: make_node(AST_Accessor, value, value), - quote: self.quote, - }); - } - } - return self; -}); - -def_optimize(AST_Destructuring, function(self, compressor) { - if (compressor.option("pure_getters") == true - && compressor.option("unused") - && !self.is_array - && Array.isArray(self.names) - && !is_destructuring_export_decl(compressor) - && !(self.names[self.names.length - 1] instanceof AST_Expansion)) { - var keep = []; - for (var i = 0; i < self.names.length; i++) { - var elem = self.names[i]; - if (!(elem instanceof AST_ObjectKeyVal - && typeof elem.key == "string" - && elem.value instanceof AST_SymbolDeclaration - && !should_retain(compressor, elem.value.definition()))) { - keep.push(elem); - } - } - if (keep.length != self.names.length) { - self.names = keep; - } - } - return self; - - function is_destructuring_export_decl(compressor) { - var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/]; - for (var a = 0, p = 0, len = ancestors.length; a < len; p++) { - var parent = compressor.parent(p); - if (!parent) return false; - if (a === 0 && parent.TYPE == "Destructuring") continue; - if (!ancestors[a].test(parent.TYPE)) { - return false; - } - a++; - } - return true; - } - - function should_retain(compressor, def) { - if (def.references.length) return true; - if (!def.global) return false; - if (compressor.toplevel.vars) { - if (compressor.top_retain) { - return compressor.top_retain(def); - } - return false; - } - return true; - } -}); - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// a small wrapper around source-map and @jridgewell/source-map -function* SourceMap(options) { - options = defaults(options, { - file : null, - root : null, - orig : null, - files: {}, - }); - - var orig_map; - var generator = new sourceMap.SourceMapGenerator({ - file : options.file, - sourceRoot : options.root - }); - - let sourcesContent = {__proto__: null}; - let files = options.files; - for (var name in files) if (HOP(files, name)) { - sourcesContent[name] = files[name]; - } - if (options.orig) { - // We support both @jridgewell/source-map (which has a sync - // SourceMapConsumer) and source-map (which has an async - // SourceMapConsumer). - orig_map = yield new sourceMap.SourceMapConsumer(options.orig); - if (orig_map.sourcesContent) { - orig_map.sources.forEach(function(source, i) { - var content = orig_map.sourcesContent[i]; - if (content) { - sourcesContent[source] = content; - } - }); - } - } - - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - let generatedPos = { line: gen_line, column: gen_col }; - - if (orig_map) { - var info = orig_map.originalPositionFor({ - line: orig_line, - column: orig_col - }); - if (info.source === null) { - generator.addMapping({ - generated: generatedPos, - original: null, - source: null, - name: null - }); - return; - } - source = info.source; - orig_line = info.line; - orig_col = info.column; - name = info.name || name; - } - generator.addMapping({ - generated : generatedPos, - original : { line: orig_line, column: orig_col }, - source : source, - name : name - }); - generator.setSourceContent(source, sourcesContent[source]); - } - - function clean(map) { - const allNull = map.sourcesContent && map.sourcesContent.every(c => c == null); - if (allNull) delete map.sourcesContent; - if (map.file === undefined) delete map.file; - if (map.sourceRoot === undefined) delete map.sourceRoot; - return map; - } - - function getDecoded() { - if (!generator.toDecodedMap) return null; - return clean(generator.toDecodedMap()); - } - - function getEncoded() { - return clean(generator.toJSON()); - } - - function destroy() { - // @jridgewell/source-map's SourceMapConsumer does not need to be - // manually freed. - if (orig_map && orig_map.destroy) orig_map.destroy(); - } - - return { - add, - getDecoded, - getEncoded, - destroy, - }; -} - -var domprops = [ - "$&", - "$'", - "$*", - "$+", - "$1", - "$2", - "$3", - "$4", - "$5", - "$6", - "$7", - "$8", - "$9", - "$_", - "$`", - "$input", - "-moz-animation", - "-moz-animation-delay", - "-moz-animation-direction", - "-moz-animation-duration", - "-moz-animation-fill-mode", - "-moz-animation-iteration-count", - "-moz-animation-name", - "-moz-animation-play-state", - "-moz-animation-timing-function", - "-moz-appearance", - "-moz-backface-visibility", - "-moz-border-end", - "-moz-border-end-color", - "-moz-border-end-style", - "-moz-border-end-width", - "-moz-border-image", - "-moz-border-start", - "-moz-border-start-color", - "-moz-border-start-style", - "-moz-border-start-width", - "-moz-box-align", - "-moz-box-direction", - "-moz-box-flex", - "-moz-box-ordinal-group", - "-moz-box-orient", - "-moz-box-pack", - "-moz-box-sizing", - "-moz-float-edge", - "-moz-font-feature-settings", - "-moz-font-language-override", - "-moz-force-broken-image-icon", - "-moz-hyphens", - "-moz-image-region", - "-moz-margin-end", - "-moz-margin-start", - "-moz-orient", - "-moz-osx-font-smoothing", - "-moz-outline-radius", - "-moz-outline-radius-bottomleft", - "-moz-outline-radius-bottomright", - "-moz-outline-radius-topleft", - "-moz-outline-radius-topright", - "-moz-padding-end", - "-moz-padding-start", - "-moz-perspective", - "-moz-perspective-origin", - "-moz-tab-size", - "-moz-text-size-adjust", - "-moz-transform", - "-moz-transform-origin", - "-moz-transform-style", - "-moz-transition", - "-moz-transition-delay", - "-moz-transition-duration", - "-moz-transition-property", - "-moz-transition-timing-function", - "-moz-user-focus", - "-moz-user-input", - "-moz-user-modify", - "-moz-user-select", - "-moz-window-dragging", - "-webkit-align-content", - "-webkit-align-items", - "-webkit-align-self", - "-webkit-animation", - "-webkit-animation-delay", - "-webkit-animation-direction", - "-webkit-animation-duration", - "-webkit-animation-fill-mode", - "-webkit-animation-iteration-count", - "-webkit-animation-name", - "-webkit-animation-play-state", - "-webkit-animation-timing-function", - "-webkit-appearance", - "-webkit-backface-visibility", - "-webkit-background-clip", - "-webkit-background-origin", - "-webkit-background-size", - "-webkit-border-bottom-left-radius", - "-webkit-border-bottom-right-radius", - "-webkit-border-image", - "-webkit-border-radius", - "-webkit-border-top-left-radius", - "-webkit-border-top-right-radius", - "-webkit-box-align", - "-webkit-box-direction", - "-webkit-box-flex", - "-webkit-box-ordinal-group", - "-webkit-box-orient", - "-webkit-box-pack", - "-webkit-box-shadow", - "-webkit-box-sizing", - "-webkit-filter", - "-webkit-flex", - "-webkit-flex-basis", - "-webkit-flex-direction", - "-webkit-flex-flow", - "-webkit-flex-grow", - "-webkit-flex-shrink", - "-webkit-flex-wrap", - "-webkit-justify-content", - "-webkit-line-clamp", - "-webkit-mask", - "-webkit-mask-clip", - "-webkit-mask-composite", - "-webkit-mask-image", - "-webkit-mask-origin", - "-webkit-mask-position", - "-webkit-mask-position-x", - "-webkit-mask-position-y", - "-webkit-mask-repeat", - "-webkit-mask-size", - "-webkit-order", - "-webkit-perspective", - "-webkit-perspective-origin", - "-webkit-text-fill-color", - "-webkit-text-size-adjust", - "-webkit-text-stroke", - "-webkit-text-stroke-color", - "-webkit-text-stroke-width", - "-webkit-transform", - "-webkit-transform-origin", - "-webkit-transform-style", - "-webkit-transition", - "-webkit-transition-delay", - "-webkit-transition-duration", - "-webkit-transition-property", - "-webkit-transition-timing-function", - "-webkit-user-select", - "0", - "1", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "2", - "20", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "@@iterator", - "ABORT_ERR", - "ACTIVE", - "ACTIVE_ATTRIBUTES", - "ACTIVE_TEXTURE", - "ACTIVE_UNIFORMS", - "ACTIVE_UNIFORM_BLOCKS", - "ADDITION", - "ALIASED_LINE_WIDTH_RANGE", - "ALIASED_POINT_SIZE_RANGE", - "ALL", - "ALLOW_KEYBOARD_INPUT", - "ALLPASS", - "ALPHA", - "ALPHA_BITS", - "ALREADY_SIGNALED", - "ALT_MASK", - "ALWAYS", - "ANY_SAMPLES_PASSED", - "ANY_SAMPLES_PASSED_CONSERVATIVE", - "ANY_TYPE", - "ANY_UNORDERED_NODE_TYPE", - "ARRAY_BUFFER", - "ARRAY_BUFFER_BINDING", - "ATTACHED_SHADERS", - "ATTRIBUTE_NODE", - "AT_TARGET", - "AbortController", - "AbortSignal", - "AbsoluteOrientationSensor", - "AbstractRange", - "Accelerometer", - "AddSearchProvider", - "AggregateError", - "AnalyserNode", - "Animation", - "AnimationEffect", - "AnimationEvent", - "AnimationPlaybackEvent", - "AnimationTimeline", - "AnonXMLHttpRequest", - "Any", - "ApplicationCache", - "ApplicationCacheErrorEvent", - "Array", - "ArrayBuffer", - "ArrayType", - "Atomics", - "Attr", - "Audio", - "AudioBuffer", - "AudioBufferSourceNode", - "AudioContext", - "AudioDestinationNode", - "AudioListener", - "AudioNode", - "AudioParam", - "AudioParamMap", - "AudioProcessingEvent", - "AudioScheduledSourceNode", - "AudioStreamTrack", - "AudioWorklet", - "AudioWorkletNode", - "AuthenticatorAssertionResponse", - "AuthenticatorAttestationResponse", - "AuthenticatorResponse", - "AutocompleteErrorEvent", - "BACK", - "BAD_BOUNDARYPOINTS_ERR", - "BAD_REQUEST", - "BANDPASS", - "BLEND", - "BLEND_COLOR", - "BLEND_DST_ALPHA", - "BLEND_DST_RGB", - "BLEND_EQUATION", - "BLEND_EQUATION_ALPHA", - "BLEND_EQUATION_RGB", - "BLEND_SRC_ALPHA", - "BLEND_SRC_RGB", - "BLUE", - "BLUE_BITS", - "BLUR", - "BOOL", - "BOOLEAN_TYPE", - "BOOL_VEC2", - "BOOL_VEC3", - "BOOL_VEC4", - "BOTH", - "BROWSER_DEFAULT_WEBGL", - "BUBBLING_PHASE", - "BUFFER_SIZE", - "BUFFER_USAGE", - "BYTE", - "BYTES_PER_ELEMENT", - "BackgroundFetchManager", - "BackgroundFetchRecord", - "BackgroundFetchRegistration", - "BarProp", - "BarcodeDetector", - "BaseAudioContext", - "BaseHref", - "BatteryManager", - "BeforeInstallPromptEvent", - "BeforeLoadEvent", - "BeforeUnloadEvent", - "BigInt", - "BigInt64Array", - "BigUint64Array", - "BiquadFilterNode", - "Blob", - "BlobEvent", - "Bluetooth", - "BluetoothCharacteristicProperties", - "BluetoothDevice", - "BluetoothRemoteGATTCharacteristic", - "BluetoothRemoteGATTDescriptor", - "BluetoothRemoteGATTServer", - "BluetoothRemoteGATTService", - "BluetoothUUID", - "Boolean", - "BroadcastChannel", - "ByteLengthQueuingStrategy", - "CAPTURING_PHASE", - "CCW", - "CDATASection", - "CDATA_SECTION_NODE", - "CHANGE", - "CHARSET_RULE", - "CHECKING", - "CLAMP_TO_EDGE", - "CLICK", - "CLOSED", - "CLOSING", - "COLOR", - "COLOR_ATTACHMENT0", - "COLOR_ATTACHMENT1", - "COLOR_ATTACHMENT10", - "COLOR_ATTACHMENT11", - "COLOR_ATTACHMENT12", - "COLOR_ATTACHMENT13", - "COLOR_ATTACHMENT14", - "COLOR_ATTACHMENT15", - "COLOR_ATTACHMENT2", - "COLOR_ATTACHMENT3", - "COLOR_ATTACHMENT4", - "COLOR_ATTACHMENT5", - "COLOR_ATTACHMENT6", - "COLOR_ATTACHMENT7", - "COLOR_ATTACHMENT8", - "COLOR_ATTACHMENT9", - "COLOR_BUFFER_BIT", - "COLOR_CLEAR_VALUE", - "COLOR_WRITEMASK", - "COMMENT_NODE", - "COMPARE_REF_TO_TEXTURE", - "COMPILE_STATUS", - "COMPLETION_STATUS_KHR", - "COMPRESSED_RGBA_S3TC_DXT1_EXT", - "COMPRESSED_RGBA_S3TC_DXT3_EXT", - "COMPRESSED_RGBA_S3TC_DXT5_EXT", - "COMPRESSED_RGB_S3TC_DXT1_EXT", - "COMPRESSED_TEXTURE_FORMATS", - "COMPUTE", - "CONDITION_SATISFIED", - "CONFIGURATION_UNSUPPORTED", - "CONNECTING", - "CONSTANT_ALPHA", - "CONSTANT_COLOR", - "CONSTRAINT_ERR", - "CONTEXT_LOST_WEBGL", - "CONTROL_MASK", - "COPY_DST", - "COPY_READ_BUFFER", - "COPY_READ_BUFFER_BINDING", - "COPY_SRC", - "COPY_WRITE_BUFFER", - "COPY_WRITE_BUFFER_BINDING", - "COUNTER_STYLE_RULE", - "CSS", - "CSS2Properties", - "CSSAnimation", - "CSSCharsetRule", - "CSSConditionRule", - "CSSCounterStyleRule", - "CSSFontFaceRule", - "CSSFontFeatureValuesRule", - "CSSGroupingRule", - "CSSImageValue", - "CSSImportRule", - "CSSKeyframeRule", - "CSSKeyframesRule", - "CSSKeywordValue", - "CSSMathInvert", - "CSSMathMax", - "CSSMathMin", - "CSSMathNegate", - "CSSMathProduct", - "CSSMathSum", - "CSSMathValue", - "CSSMatrixComponent", - "CSSMediaRule", - "CSSMozDocumentRule", - "CSSNameSpaceRule", - "CSSNamespaceRule", - "CSSNumericArray", - "CSSNumericValue", - "CSSPageRule", - "CSSPerspective", - "CSSPositionValue", - "CSSPrimitiveValue", - "CSSRotate", - "CSSRule", - "CSSRuleList", - "CSSScale", - "CSSSkew", - "CSSSkewX", - "CSSSkewY", - "CSSStyleDeclaration", - "CSSStyleRule", - "CSSStyleSheet", - "CSSStyleValue", - "CSSSupportsRule", - "CSSTransformComponent", - "CSSTransformValue", - "CSSTransition", - "CSSTranslate", - "CSSUnitValue", - "CSSUnknownRule", - "CSSUnparsedValue", - "CSSValue", - "CSSValueList", - "CSSVariableReferenceValue", - "CSSVariablesDeclaration", - "CSSVariablesRule", - "CSSViewportRule", - "CSS_ATTR", - "CSS_CM", - "CSS_COUNTER", - "CSS_CUSTOM", - "CSS_DEG", - "CSS_DIMENSION", - "CSS_EMS", - "CSS_EXS", - "CSS_FILTER_BLUR", - "CSS_FILTER_BRIGHTNESS", - "CSS_FILTER_CONTRAST", - "CSS_FILTER_CUSTOM", - "CSS_FILTER_DROP_SHADOW", - "CSS_FILTER_GRAYSCALE", - "CSS_FILTER_HUE_ROTATE", - "CSS_FILTER_INVERT", - "CSS_FILTER_OPACITY", - "CSS_FILTER_REFERENCE", - "CSS_FILTER_SATURATE", - "CSS_FILTER_SEPIA", - "CSS_GRAD", - "CSS_HZ", - "CSS_IDENT", - "CSS_IN", - "CSS_INHERIT", - "CSS_KHZ", - "CSS_MATRIX", - "CSS_MATRIX3D", - "CSS_MM", - "CSS_MS", - "CSS_NUMBER", - "CSS_PC", - "CSS_PERCENTAGE", - "CSS_PERSPECTIVE", - "CSS_PRIMITIVE_VALUE", - "CSS_PT", - "CSS_PX", - "CSS_RAD", - "CSS_RECT", - "CSS_RGBCOLOR", - "CSS_ROTATE", - "CSS_ROTATE3D", - "CSS_ROTATEX", - "CSS_ROTATEY", - "CSS_ROTATEZ", - "CSS_S", - "CSS_SCALE", - "CSS_SCALE3D", - "CSS_SCALEX", - "CSS_SCALEY", - "CSS_SCALEZ", - "CSS_SKEW", - "CSS_SKEWX", - "CSS_SKEWY", - "CSS_STRING", - "CSS_TRANSLATE", - "CSS_TRANSLATE3D", - "CSS_TRANSLATEX", - "CSS_TRANSLATEY", - "CSS_TRANSLATEZ", - "CSS_UNKNOWN", - "CSS_URI", - "CSS_VALUE_LIST", - "CSS_VH", - "CSS_VMAX", - "CSS_VMIN", - "CSS_VW", - "CULL_FACE", - "CULL_FACE_MODE", - "CURRENT_PROGRAM", - "CURRENT_QUERY", - "CURRENT_VERTEX_ATTRIB", - "CUSTOM", - "CW", - "Cache", - "CacheStorage", - "CanvasCaptureMediaStream", - "CanvasCaptureMediaStreamTrack", - "CanvasGradient", - "CanvasPattern", - "CanvasRenderingContext2D", - "CaretPosition", - "ChannelMergerNode", - "ChannelSplitterNode", - "CharacterData", - "ClientRect", - "ClientRectList", - "Clipboard", - "ClipboardEvent", - "ClipboardItem", - "CloseEvent", - "Collator", - "CommandEvent", - "Comment", - "CompileError", - "CompositionEvent", - "CompressionStream", - "Console", - "ConstantSourceNode", - "Controllers", - "ConvolverNode", - "CountQueuingStrategy", - "Counter", - "Credential", - "CredentialsContainer", - "Crypto", - "CryptoKey", - "CustomElementRegistry", - "CustomEvent", - "DATABASE_ERR", - "DATA_CLONE_ERR", - "DATA_ERR", - "DBLCLICK", - "DECR", - "DECR_WRAP", - "DELETE_STATUS", - "DEPTH", - "DEPTH24_STENCIL8", - "DEPTH32F_STENCIL8", - "DEPTH_ATTACHMENT", - "DEPTH_BITS", - "DEPTH_BUFFER_BIT", - "DEPTH_CLEAR_VALUE", - "DEPTH_COMPONENT", - "DEPTH_COMPONENT16", - "DEPTH_COMPONENT24", - "DEPTH_COMPONENT32F", - "DEPTH_FUNC", - "DEPTH_RANGE", - "DEPTH_STENCIL", - "DEPTH_STENCIL_ATTACHMENT", - "DEPTH_TEST", - "DEPTH_WRITEMASK", - "DEVICE_INELIGIBLE", - "DIRECTION_DOWN", - "DIRECTION_LEFT", - "DIRECTION_RIGHT", - "DIRECTION_UP", - "DISABLED", - "DISPATCH_REQUEST_ERR", - "DITHER", - "DOCUMENT_FRAGMENT_NODE", - "DOCUMENT_NODE", - "DOCUMENT_POSITION_CONTAINED_BY", - "DOCUMENT_POSITION_CONTAINS", - "DOCUMENT_POSITION_DISCONNECTED", - "DOCUMENT_POSITION_FOLLOWING", - "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", - "DOCUMENT_POSITION_PRECEDING", - "DOCUMENT_TYPE_NODE", - "DOMCursor", - "DOMError", - "DOMException", - "DOMImplementation", - "DOMImplementationLS", - "DOMMatrix", - "DOMMatrixReadOnly", - "DOMParser", - "DOMPoint", - "DOMPointReadOnly", - "DOMQuad", - "DOMRect", - "DOMRectList", - "DOMRectReadOnly", - "DOMRequest", - "DOMSTRING_SIZE_ERR", - "DOMSettableTokenList", - "DOMStringList", - "DOMStringMap", - "DOMTokenList", - "DOMTransactionEvent", - "DOM_DELTA_LINE", - "DOM_DELTA_PAGE", - "DOM_DELTA_PIXEL", - "DOM_INPUT_METHOD_DROP", - "DOM_INPUT_METHOD_HANDWRITING", - "DOM_INPUT_METHOD_IME", - "DOM_INPUT_METHOD_KEYBOARD", - "DOM_INPUT_METHOD_MULTIMODAL", - "DOM_INPUT_METHOD_OPTION", - "DOM_INPUT_METHOD_PASTE", - "DOM_INPUT_METHOD_SCRIPT", - "DOM_INPUT_METHOD_UNKNOWN", - "DOM_INPUT_METHOD_VOICE", - "DOM_KEY_LOCATION_JOYSTICK", - "DOM_KEY_LOCATION_LEFT", - "DOM_KEY_LOCATION_MOBILE", - "DOM_KEY_LOCATION_NUMPAD", - "DOM_KEY_LOCATION_RIGHT", - "DOM_KEY_LOCATION_STANDARD", - "DOM_VK_0", - "DOM_VK_1", - "DOM_VK_2", - "DOM_VK_3", - "DOM_VK_4", - "DOM_VK_5", - "DOM_VK_6", - "DOM_VK_7", - "DOM_VK_8", - "DOM_VK_9", - "DOM_VK_A", - "DOM_VK_ACCEPT", - "DOM_VK_ADD", - "DOM_VK_ALT", - "DOM_VK_ALTGR", - "DOM_VK_AMPERSAND", - "DOM_VK_ASTERISK", - "DOM_VK_AT", - "DOM_VK_ATTN", - "DOM_VK_B", - "DOM_VK_BACKSPACE", - "DOM_VK_BACK_QUOTE", - "DOM_VK_BACK_SLASH", - "DOM_VK_BACK_SPACE", - "DOM_VK_C", - "DOM_VK_CANCEL", - "DOM_VK_CAPS_LOCK", - "DOM_VK_CIRCUMFLEX", - "DOM_VK_CLEAR", - "DOM_VK_CLOSE_BRACKET", - "DOM_VK_CLOSE_CURLY_BRACKET", - "DOM_VK_CLOSE_PAREN", - "DOM_VK_COLON", - "DOM_VK_COMMA", - "DOM_VK_CONTEXT_MENU", - "DOM_VK_CONTROL", - "DOM_VK_CONVERT", - "DOM_VK_CRSEL", - "DOM_VK_CTRL", - "DOM_VK_D", - "DOM_VK_DECIMAL", - "DOM_VK_DELETE", - "DOM_VK_DIVIDE", - "DOM_VK_DOLLAR", - "DOM_VK_DOUBLE_QUOTE", - "DOM_VK_DOWN", - "DOM_VK_E", - "DOM_VK_EISU", - "DOM_VK_END", - "DOM_VK_ENTER", - "DOM_VK_EQUALS", - "DOM_VK_EREOF", - "DOM_VK_ESCAPE", - "DOM_VK_EXCLAMATION", - "DOM_VK_EXECUTE", - "DOM_VK_EXSEL", - "DOM_VK_F", - "DOM_VK_F1", - "DOM_VK_F10", - "DOM_VK_F11", - "DOM_VK_F12", - "DOM_VK_F13", - "DOM_VK_F14", - "DOM_VK_F15", - "DOM_VK_F16", - "DOM_VK_F17", - "DOM_VK_F18", - "DOM_VK_F19", - "DOM_VK_F2", - "DOM_VK_F20", - "DOM_VK_F21", - "DOM_VK_F22", - "DOM_VK_F23", - "DOM_VK_F24", - "DOM_VK_F25", - "DOM_VK_F26", - "DOM_VK_F27", - "DOM_VK_F28", - "DOM_VK_F29", - "DOM_VK_F3", - "DOM_VK_F30", - "DOM_VK_F31", - "DOM_VK_F32", - "DOM_VK_F33", - "DOM_VK_F34", - "DOM_VK_F35", - "DOM_VK_F36", - "DOM_VK_F4", - "DOM_VK_F5", - "DOM_VK_F6", - "DOM_VK_F7", - "DOM_VK_F8", - "DOM_VK_F9", - "DOM_VK_FINAL", - "DOM_VK_FRONT", - "DOM_VK_G", - "DOM_VK_GREATER_THAN", - "DOM_VK_H", - "DOM_VK_HANGUL", - "DOM_VK_HANJA", - "DOM_VK_HASH", - "DOM_VK_HELP", - "DOM_VK_HK_TOGGLE", - "DOM_VK_HOME", - "DOM_VK_HYPHEN_MINUS", - "DOM_VK_I", - "DOM_VK_INSERT", - "DOM_VK_J", - "DOM_VK_JUNJA", - "DOM_VK_K", - "DOM_VK_KANA", - "DOM_VK_KANJI", - "DOM_VK_L", - "DOM_VK_LEFT", - "DOM_VK_LEFT_TAB", - "DOM_VK_LESS_THAN", - "DOM_VK_M", - "DOM_VK_META", - "DOM_VK_MODECHANGE", - "DOM_VK_MULTIPLY", - "DOM_VK_N", - "DOM_VK_NONCONVERT", - "DOM_VK_NUMPAD0", - "DOM_VK_NUMPAD1", - "DOM_VK_NUMPAD2", - "DOM_VK_NUMPAD3", - "DOM_VK_NUMPAD4", - "DOM_VK_NUMPAD5", - "DOM_VK_NUMPAD6", - "DOM_VK_NUMPAD7", - "DOM_VK_NUMPAD8", - "DOM_VK_NUMPAD9", - "DOM_VK_NUM_LOCK", - "DOM_VK_O", - "DOM_VK_OEM_1", - "DOM_VK_OEM_102", - "DOM_VK_OEM_2", - "DOM_VK_OEM_3", - "DOM_VK_OEM_4", - "DOM_VK_OEM_5", - "DOM_VK_OEM_6", - "DOM_VK_OEM_7", - "DOM_VK_OEM_8", - "DOM_VK_OEM_COMMA", - "DOM_VK_OEM_MINUS", - "DOM_VK_OEM_PERIOD", - "DOM_VK_OEM_PLUS", - "DOM_VK_OPEN_BRACKET", - "DOM_VK_OPEN_CURLY_BRACKET", - "DOM_VK_OPEN_PAREN", - "DOM_VK_P", - "DOM_VK_PA1", - "DOM_VK_PAGEDOWN", - "DOM_VK_PAGEUP", - "DOM_VK_PAGE_DOWN", - "DOM_VK_PAGE_UP", - "DOM_VK_PAUSE", - "DOM_VK_PERCENT", - "DOM_VK_PERIOD", - "DOM_VK_PIPE", - "DOM_VK_PLAY", - "DOM_VK_PLUS", - "DOM_VK_PRINT", - "DOM_VK_PRINTSCREEN", - "DOM_VK_PROCESSKEY", - "DOM_VK_PROPERITES", - "DOM_VK_Q", - "DOM_VK_QUESTION_MARK", - "DOM_VK_QUOTE", - "DOM_VK_R", - "DOM_VK_REDO", - "DOM_VK_RETURN", - "DOM_VK_RIGHT", - "DOM_VK_S", - "DOM_VK_SCROLL_LOCK", - "DOM_VK_SELECT", - "DOM_VK_SEMICOLON", - "DOM_VK_SEPARATOR", - "DOM_VK_SHIFT", - "DOM_VK_SLASH", - "DOM_VK_SLEEP", - "DOM_VK_SPACE", - "DOM_VK_SUBTRACT", - "DOM_VK_T", - "DOM_VK_TAB", - "DOM_VK_TILDE", - "DOM_VK_U", - "DOM_VK_UNDERSCORE", - "DOM_VK_UNDO", - "DOM_VK_UNICODE", - "DOM_VK_UP", - "DOM_VK_V", - "DOM_VK_VOLUME_DOWN", - "DOM_VK_VOLUME_MUTE", - "DOM_VK_VOLUME_UP", - "DOM_VK_W", - "DOM_VK_WIN", - "DOM_VK_WINDOW", - "DOM_VK_WIN_ICO_00", - "DOM_VK_WIN_ICO_CLEAR", - "DOM_VK_WIN_ICO_HELP", - "DOM_VK_WIN_OEM_ATTN", - "DOM_VK_WIN_OEM_AUTO", - "DOM_VK_WIN_OEM_BACKTAB", - "DOM_VK_WIN_OEM_CLEAR", - "DOM_VK_WIN_OEM_COPY", - "DOM_VK_WIN_OEM_CUSEL", - "DOM_VK_WIN_OEM_ENLW", - "DOM_VK_WIN_OEM_FINISH", - "DOM_VK_WIN_OEM_FJ_JISHO", - "DOM_VK_WIN_OEM_FJ_LOYA", - "DOM_VK_WIN_OEM_FJ_MASSHOU", - "DOM_VK_WIN_OEM_FJ_ROYA", - "DOM_VK_WIN_OEM_FJ_TOUROKU", - "DOM_VK_WIN_OEM_JUMP", - "DOM_VK_WIN_OEM_PA1", - "DOM_VK_WIN_OEM_PA2", - "DOM_VK_WIN_OEM_PA3", - "DOM_VK_WIN_OEM_RESET", - "DOM_VK_WIN_OEM_WSCTRL", - "DOM_VK_X", - "DOM_VK_XF86XK_ADD_FAVORITE", - "DOM_VK_XF86XK_APPLICATION_LEFT", - "DOM_VK_XF86XK_APPLICATION_RIGHT", - "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", - "DOM_VK_XF86XK_AUDIO_FORWARD", - "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", - "DOM_VK_XF86XK_AUDIO_MEDIA", - "DOM_VK_XF86XK_AUDIO_MUTE", - "DOM_VK_XF86XK_AUDIO_NEXT", - "DOM_VK_XF86XK_AUDIO_PAUSE", - "DOM_VK_XF86XK_AUDIO_PLAY", - "DOM_VK_XF86XK_AUDIO_PREV", - "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", - "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", - "DOM_VK_XF86XK_AUDIO_RECORD", - "DOM_VK_XF86XK_AUDIO_REPEAT", - "DOM_VK_XF86XK_AUDIO_REWIND", - "DOM_VK_XF86XK_AUDIO_STOP", - "DOM_VK_XF86XK_AWAY", - "DOM_VK_XF86XK_BACK", - "DOM_VK_XF86XK_BACK_FORWARD", - "DOM_VK_XF86XK_BATTERY", - "DOM_VK_XF86XK_BLUE", - "DOM_VK_XF86XK_BLUETOOTH", - "DOM_VK_XF86XK_BOOK", - "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", - "DOM_VK_XF86XK_CALCULATOR", - "DOM_VK_XF86XK_CALENDAR", - "DOM_VK_XF86XK_CD", - "DOM_VK_XF86XK_CLOSE", - "DOM_VK_XF86XK_COMMUNITY", - "DOM_VK_XF86XK_CONTRAST_ADJUST", - "DOM_VK_XF86XK_COPY", - "DOM_VK_XF86XK_CUT", - "DOM_VK_XF86XK_CYCLE_ANGLE", - "DOM_VK_XF86XK_DISPLAY", - "DOM_VK_XF86XK_DOCUMENTS", - "DOM_VK_XF86XK_DOS", - "DOM_VK_XF86XK_EJECT", - "DOM_VK_XF86XK_EXCEL", - "DOM_VK_XF86XK_EXPLORER", - "DOM_VK_XF86XK_FAVORITES", - "DOM_VK_XF86XK_FINANCE", - "DOM_VK_XF86XK_FORWARD", - "DOM_VK_XF86XK_FRAME_BACK", - "DOM_VK_XF86XK_FRAME_FORWARD", - "DOM_VK_XF86XK_GAME", - "DOM_VK_XF86XK_GO", - "DOM_VK_XF86XK_GREEN", - "DOM_VK_XF86XK_HIBERNATE", - "DOM_VK_XF86XK_HISTORY", - "DOM_VK_XF86XK_HOME_PAGE", - "DOM_VK_XF86XK_HOT_LINKS", - "DOM_VK_XF86XK_I_TOUCH", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", - "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", - "DOM_VK_XF86XK_LAUNCH0", - "DOM_VK_XF86XK_LAUNCH1", - "DOM_VK_XF86XK_LAUNCH2", - "DOM_VK_XF86XK_LAUNCH3", - "DOM_VK_XF86XK_LAUNCH4", - "DOM_VK_XF86XK_LAUNCH5", - "DOM_VK_XF86XK_LAUNCH6", - "DOM_VK_XF86XK_LAUNCH7", - "DOM_VK_XF86XK_LAUNCH8", - "DOM_VK_XF86XK_LAUNCH9", - "DOM_VK_XF86XK_LAUNCH_A", - "DOM_VK_XF86XK_LAUNCH_B", - "DOM_VK_XF86XK_LAUNCH_C", - "DOM_VK_XF86XK_LAUNCH_D", - "DOM_VK_XF86XK_LAUNCH_E", - "DOM_VK_XF86XK_LAUNCH_F", - "DOM_VK_XF86XK_LIGHT_BULB", - "DOM_VK_XF86XK_LOG_OFF", - "DOM_VK_XF86XK_MAIL", - "DOM_VK_XF86XK_MAIL_FORWARD", - "DOM_VK_XF86XK_MARKET", - "DOM_VK_XF86XK_MEETING", - "DOM_VK_XF86XK_MEMO", - "DOM_VK_XF86XK_MENU_KB", - "DOM_VK_XF86XK_MENU_PB", - "DOM_VK_XF86XK_MESSENGER", - "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", - "DOM_VK_XF86XK_MUSIC", - "DOM_VK_XF86XK_MY_COMPUTER", - "DOM_VK_XF86XK_MY_SITES", - "DOM_VK_XF86XK_NEW", - "DOM_VK_XF86XK_NEWS", - "DOM_VK_XF86XK_OFFICE_HOME", - "DOM_VK_XF86XK_OPEN", - "DOM_VK_XF86XK_OPEN_URL", - "DOM_VK_XF86XK_OPTION", - "DOM_VK_XF86XK_PASTE", - "DOM_VK_XF86XK_PHONE", - "DOM_VK_XF86XK_PICTURES", - "DOM_VK_XF86XK_POWER_DOWN", - "DOM_VK_XF86XK_POWER_OFF", - "DOM_VK_XF86XK_RED", - "DOM_VK_XF86XK_REFRESH", - "DOM_VK_XF86XK_RELOAD", - "DOM_VK_XF86XK_REPLY", - "DOM_VK_XF86XK_ROCKER_DOWN", - "DOM_VK_XF86XK_ROCKER_ENTER", - "DOM_VK_XF86XK_ROCKER_UP", - "DOM_VK_XF86XK_ROTATE_WINDOWS", - "DOM_VK_XF86XK_ROTATION_KB", - "DOM_VK_XF86XK_ROTATION_PB", - "DOM_VK_XF86XK_SAVE", - "DOM_VK_XF86XK_SCREEN_SAVER", - "DOM_VK_XF86XK_SCROLL_CLICK", - "DOM_VK_XF86XK_SCROLL_DOWN", - "DOM_VK_XF86XK_SCROLL_UP", - "DOM_VK_XF86XK_SEARCH", - "DOM_VK_XF86XK_SEND", - "DOM_VK_XF86XK_SHOP", - "DOM_VK_XF86XK_SPELL", - "DOM_VK_XF86XK_SPLIT_SCREEN", - "DOM_VK_XF86XK_STANDBY", - "DOM_VK_XF86XK_START", - "DOM_VK_XF86XK_STOP", - "DOM_VK_XF86XK_SUBTITLE", - "DOM_VK_XF86XK_SUPPORT", - "DOM_VK_XF86XK_SUSPEND", - "DOM_VK_XF86XK_TASK_PANE", - "DOM_VK_XF86XK_TERMINAL", - "DOM_VK_XF86XK_TIME", - "DOM_VK_XF86XK_TOOLS", - "DOM_VK_XF86XK_TOP_MENU", - "DOM_VK_XF86XK_TO_DO_LIST", - "DOM_VK_XF86XK_TRAVEL", - "DOM_VK_XF86XK_USER1KB", - "DOM_VK_XF86XK_USER2KB", - "DOM_VK_XF86XK_USER_PB", - "DOM_VK_XF86XK_UWB", - "DOM_VK_XF86XK_VENDOR_HOME", - "DOM_VK_XF86XK_VIDEO", - "DOM_VK_XF86XK_VIEW", - "DOM_VK_XF86XK_WAKE_UP", - "DOM_VK_XF86XK_WEB_CAM", - "DOM_VK_XF86XK_WHEEL_BUTTON", - "DOM_VK_XF86XK_WLAN", - "DOM_VK_XF86XK_WORD", - "DOM_VK_XF86XK_WWW", - "DOM_VK_XF86XK_XFER", - "DOM_VK_XF86XK_YELLOW", - "DOM_VK_XF86XK_ZOOM_IN", - "DOM_VK_XF86XK_ZOOM_OUT", - "DOM_VK_Y", - "DOM_VK_Z", - "DOM_VK_ZOOM", - "DONE", - "DONT_CARE", - "DOWNLOADING", - "DRAGDROP", - "DRAW_BUFFER0", - "DRAW_BUFFER1", - "DRAW_BUFFER10", - "DRAW_BUFFER11", - "DRAW_BUFFER12", - "DRAW_BUFFER13", - "DRAW_BUFFER14", - "DRAW_BUFFER15", - "DRAW_BUFFER2", - "DRAW_BUFFER3", - "DRAW_BUFFER4", - "DRAW_BUFFER5", - "DRAW_BUFFER6", - "DRAW_BUFFER7", - "DRAW_BUFFER8", - "DRAW_BUFFER9", - "DRAW_FRAMEBUFFER", - "DRAW_FRAMEBUFFER_BINDING", - "DST_ALPHA", - "DST_COLOR", - "DYNAMIC_COPY", - "DYNAMIC_DRAW", - "DYNAMIC_READ", - "DataChannel", - "DataTransfer", - "DataTransferItem", - "DataTransferItemList", - "DataView", - "Date", - "DateTimeFormat", - "DecompressionStream", - "DelayNode", - "DeprecationReportBody", - "DesktopNotification", - "DesktopNotificationCenter", - "DeviceLightEvent", - "DeviceMotionEvent", - "DeviceMotionEventAcceleration", - "DeviceMotionEventRotationRate", - "DeviceOrientationEvent", - "DeviceProximityEvent", - "DeviceStorage", - "DeviceStorageChangeEvent", - "Directory", - "DisplayNames", - "Document", - "DocumentFragment", - "DocumentTimeline", - "DocumentType", - "DragEvent", - "DynamicsCompressorNode", - "E", - "ELEMENT_ARRAY_BUFFER", - "ELEMENT_ARRAY_BUFFER_BINDING", - "ELEMENT_NODE", - "EMPTY", - "ENCODING_ERR", - "ENDED", - "END_TO_END", - "END_TO_START", - "ENTITY_NODE", - "ENTITY_REFERENCE_NODE", - "EPSILON", - "EQUAL", - "EQUALPOWER", - "ERROR", - "EXPONENTIAL_DISTANCE", - "Element", - "ElementInternals", - "ElementQuery", - "EnterPictureInPictureEvent", - "Entity", - "EntityReference", - "Error", - "ErrorEvent", - "EvalError", - "Event", - "EventException", - "EventSource", - "EventTarget", - "External", - "FASTEST", - "FIDOSDK", - "FILTER_ACCEPT", - "FILTER_INTERRUPT", - "FILTER_REJECT", - "FILTER_SKIP", - "FINISHED_STATE", - "FIRST_ORDERED_NODE_TYPE", - "FLOAT", - "FLOAT_32_UNSIGNED_INT_24_8_REV", - "FLOAT_MAT2", - "FLOAT_MAT2x3", - "FLOAT_MAT2x4", - "FLOAT_MAT3", - "FLOAT_MAT3x2", - "FLOAT_MAT3x4", - "FLOAT_MAT4", - "FLOAT_MAT4x2", - "FLOAT_MAT4x3", - "FLOAT_VEC2", - "FLOAT_VEC3", - "FLOAT_VEC4", - "FOCUS", - "FONT_FACE_RULE", - "FONT_FEATURE_VALUES_RULE", - "FRAGMENT", - "FRAGMENT_SHADER", - "FRAGMENT_SHADER_DERIVATIVE_HINT", - "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", - "FRAMEBUFFER", - "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", - "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", - "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", - "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", - "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", - "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", - "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", - "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", - "FRAMEBUFFER_ATTACHMENT_RED_SIZE", - "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", - "FRAMEBUFFER_BINDING", - "FRAMEBUFFER_COMPLETE", - "FRAMEBUFFER_DEFAULT", - "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", - "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", - "FRAMEBUFFER_UNSUPPORTED", - "FRONT", - "FRONT_AND_BACK", - "FRONT_FACE", - "FUNC_ADD", - "FUNC_REVERSE_SUBTRACT", - "FUNC_SUBTRACT", - "FeaturePolicy", - "FeaturePolicyViolationReportBody", - "FederatedCredential", - "Feed", - "FeedEntry", - "File", - "FileError", - "FileList", - "FileReader", - "FileSystem", - "FileSystemDirectoryEntry", - "FileSystemDirectoryReader", - "FileSystemEntry", - "FileSystemFileEntry", - "FinalizationRegistry", - "FindInPage", - "Float32Array", - "Float64Array", - "FocusEvent", - "FontFace", - "FontFaceSet", - "FontFaceSetLoadEvent", - "FormData", - "FormDataEvent", - "FragmentDirective", - "Function", - "GENERATE_MIPMAP_HINT", - "GEQUAL", - "GREATER", - "GREEN", - "GREEN_BITS", - "GainNode", - "Gamepad", - "GamepadAxisMoveEvent", - "GamepadButton", - "GamepadButtonEvent", - "GamepadEvent", - "GamepadHapticActuator", - "GamepadPose", - "Geolocation", - "GeolocationCoordinates", - "GeolocationPosition", - "GeolocationPositionError", - "GestureEvent", - "Global", - "Gyroscope", - "HALF_FLOAT", - "HAVE_CURRENT_DATA", - "HAVE_ENOUGH_DATA", - "HAVE_FUTURE_DATA", - "HAVE_METADATA", - "HAVE_NOTHING", - "HEADERS_RECEIVED", - "HIDDEN", - "HIERARCHY_REQUEST_ERR", - "HIGHPASS", - "HIGHSHELF", - "HIGH_FLOAT", - "HIGH_INT", - "HORIZONTAL", - "HORIZONTAL_AXIS", - "HRTF", - "HTMLAllCollection", - "HTMLAnchorElement", - "HTMLAppletElement", - "HTMLAreaElement", - "HTMLAudioElement", - "HTMLBRElement", - "HTMLBaseElement", - "HTMLBaseFontElement", - "HTMLBlockquoteElement", - "HTMLBodyElement", - "HTMLButtonElement", - "HTMLCanvasElement", - "HTMLCollection", - "HTMLCommandElement", - "HTMLContentElement", - "HTMLDListElement", - "HTMLDataElement", - "HTMLDataListElement", - "HTMLDetailsElement", - "HTMLDialogElement", - "HTMLDirectoryElement", - "HTMLDivElement", - "HTMLDocument", - "HTMLElement", - "HTMLEmbedElement", - "HTMLFieldSetElement", - "HTMLFontElement", - "HTMLFormControlsCollection", - "HTMLFormElement", - "HTMLFrameElement", - "HTMLFrameSetElement", - "HTMLHRElement", - "HTMLHeadElement", - "HTMLHeadingElement", - "HTMLHtmlElement", - "HTMLIFrameElement", - "HTMLImageElement", - "HTMLInputElement", - "HTMLIsIndexElement", - "HTMLKeygenElement", - "HTMLLIElement", - "HTMLLabelElement", - "HTMLLegendElement", - "HTMLLinkElement", - "HTMLMapElement", - "HTMLMarqueeElement", - "HTMLMediaElement", - "HTMLMenuElement", - "HTMLMenuItemElement", - "HTMLMetaElement", - "HTMLMeterElement", - "HTMLModElement", - "HTMLOListElement", - "HTMLObjectElement", - "HTMLOptGroupElement", - "HTMLOptionElement", - "HTMLOptionsCollection", - "HTMLOutputElement", - "HTMLParagraphElement", - "HTMLParamElement", - "HTMLPictureElement", - "HTMLPreElement", - "HTMLProgressElement", - "HTMLPropertiesCollection", - "HTMLQuoteElement", - "HTMLScriptElement", - "HTMLSelectElement", - "HTMLShadowElement", - "HTMLSlotElement", - "HTMLSourceElement", - "HTMLSpanElement", - "HTMLStyleElement", - "HTMLTableCaptionElement", - "HTMLTableCellElement", - "HTMLTableColElement", - "HTMLTableElement", - "HTMLTableRowElement", - "HTMLTableSectionElement", - "HTMLTemplateElement", - "HTMLTextAreaElement", - "HTMLTimeElement", - "HTMLTitleElement", - "HTMLTrackElement", - "HTMLUListElement", - "HTMLUnknownElement", - "HTMLVideoElement", - "HashChangeEvent", - "Headers", - "History", - "Hz", - "ICE_CHECKING", - "ICE_CLOSED", - "ICE_COMPLETED", - "ICE_CONNECTED", - "ICE_FAILED", - "ICE_GATHERING", - "ICE_WAITING", - "IDBCursor", - "IDBCursorWithValue", - "IDBDatabase", - "IDBDatabaseException", - "IDBFactory", - "IDBFileHandle", - "IDBFileRequest", - "IDBIndex", - "IDBKeyRange", - "IDBMutableFile", - "IDBObjectStore", - "IDBOpenDBRequest", - "IDBRequest", - "IDBTransaction", - "IDBVersionChangeEvent", - "IDLE", - "IIRFilterNode", - "IMPLEMENTATION_COLOR_READ_FORMAT", - "IMPLEMENTATION_COLOR_READ_TYPE", - "IMPORT_RULE", - "INCR", - "INCR_WRAP", - "INDEX", - "INDEX_SIZE_ERR", - "INDIRECT", - "INT", - "INTERLEAVED_ATTRIBS", - "INT_2_10_10_10_REV", - "INT_SAMPLER_2D", - "INT_SAMPLER_2D_ARRAY", - "INT_SAMPLER_3D", - "INT_SAMPLER_CUBE", - "INT_VEC2", - "INT_VEC3", - "INT_VEC4", - "INUSE_ATTRIBUTE_ERR", - "INVALID_ACCESS_ERR", - "INVALID_CHARACTER_ERR", - "INVALID_ENUM", - "INVALID_EXPRESSION_ERR", - "INVALID_FRAMEBUFFER_OPERATION", - "INVALID_INDEX", - "INVALID_MODIFICATION_ERR", - "INVALID_NODE_TYPE_ERR", - "INVALID_OPERATION", - "INVALID_STATE_ERR", - "INVALID_VALUE", - "INVERSE_DISTANCE", - "INVERT", - "IceCandidate", - "IdleDeadline", - "Image", - "ImageBitmap", - "ImageBitmapRenderingContext", - "ImageCapture", - "ImageData", - "Infinity", - "InputDeviceCapabilities", - "InputDeviceInfo", - "InputEvent", - "InputMethodContext", - "InstallTrigger", - "InstallTriggerImpl", - "Instance", - "Int16Array", - "Int32Array", - "Int8Array", - "Intent", - "InternalError", - "IntersectionObserver", - "IntersectionObserverEntry", - "Intl", - "IsSearchProviderInstalled", - "Iterator", - "JSON", - "KEEP", - "KEYDOWN", - "KEYFRAMES_RULE", - "KEYFRAME_RULE", - "KEYPRESS", - "KEYUP", - "KeyEvent", - "Keyboard", - "KeyboardEvent", - "KeyboardLayoutMap", - "KeyframeEffect", - "LENGTHADJUST_SPACING", - "LENGTHADJUST_SPACINGANDGLYPHS", - "LENGTHADJUST_UNKNOWN", - "LEQUAL", - "LESS", - "LINEAR", - "LINEAR_DISTANCE", - "LINEAR_MIPMAP_LINEAR", - "LINEAR_MIPMAP_NEAREST", - "LINES", - "LINE_LOOP", - "LINE_STRIP", - "LINE_WIDTH", - "LINK_STATUS", - "LIVE", - "LN10", - "LN2", - "LOADED", - "LOADING", - "LOG10E", - "LOG2E", - "LOWPASS", - "LOWSHELF", - "LOW_FLOAT", - "LOW_INT", - "LSException", - "LSParserFilter", - "LUMINANCE", - "LUMINANCE_ALPHA", - "LargestContentfulPaint", - "LayoutShift", - "LayoutShiftAttribution", - "LinearAccelerationSensor", - "LinkError", - "ListFormat", - "LocalMediaStream", - "Locale", - "Location", - "Lock", - "LockManager", - "MAP_READ", - "MAP_WRITE", - "MAX", - "MAX_3D_TEXTURE_SIZE", - "MAX_ARRAY_TEXTURE_LAYERS", - "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", - "MAX_COLOR_ATTACHMENTS", - "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_COMBINED_TEXTURE_IMAGE_UNITS", - "MAX_COMBINED_UNIFORM_BLOCKS", - "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", - "MAX_CUBE_MAP_TEXTURE_SIZE", - "MAX_DRAW_BUFFERS", - "MAX_ELEMENTS_INDICES", - "MAX_ELEMENTS_VERTICES", - "MAX_ELEMENT_INDEX", - "MAX_FRAGMENT_INPUT_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_BLOCKS", - "MAX_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_VECTORS", - "MAX_PROGRAM_TEXEL_OFFSET", - "MAX_RENDERBUFFER_SIZE", - "MAX_SAFE_INTEGER", - "MAX_SAMPLES", - "MAX_SERVER_WAIT_TIMEOUT", - "MAX_TEXTURE_IMAGE_UNITS", - "MAX_TEXTURE_LOD_BIAS", - "MAX_TEXTURE_MAX_ANISOTROPY_EXT", - "MAX_TEXTURE_SIZE", - "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", - "MAX_UNIFORM_BLOCK_SIZE", - "MAX_UNIFORM_BUFFER_BINDINGS", - "MAX_VALUE", - "MAX_VARYING_COMPONENTS", - "MAX_VARYING_VECTORS", - "MAX_VERTEX_ATTRIBS", - "MAX_VERTEX_OUTPUT_COMPONENTS", - "MAX_VERTEX_TEXTURE_IMAGE_UNITS", - "MAX_VERTEX_UNIFORM_BLOCKS", - "MAX_VERTEX_UNIFORM_COMPONENTS", - "MAX_VERTEX_UNIFORM_VECTORS", - "MAX_VIEWPORT_DIMS", - "MEDIA_ERR_ABORTED", - "MEDIA_ERR_DECODE", - "MEDIA_ERR_ENCRYPTED", - "MEDIA_ERR_NETWORK", - "MEDIA_ERR_SRC_NOT_SUPPORTED", - "MEDIA_KEYERR_CLIENT", - "MEDIA_KEYERR_DOMAIN", - "MEDIA_KEYERR_HARDWARECHANGE", - "MEDIA_KEYERR_OUTPUT", - "MEDIA_KEYERR_SERVICE", - "MEDIA_KEYERR_UNKNOWN", - "MEDIA_RULE", - "MEDIUM_FLOAT", - "MEDIUM_INT", - "META_MASK", - "MIDIAccess", - "MIDIConnectionEvent", - "MIDIInput", - "MIDIInputMap", - "MIDIMessageEvent", - "MIDIOutput", - "MIDIOutputMap", - "MIDIPort", - "MIN", - "MIN_PROGRAM_TEXEL_OFFSET", - "MIN_SAFE_INTEGER", - "MIN_VALUE", - "MIRRORED_REPEAT", - "MODE_ASYNCHRONOUS", - "MODE_SYNCHRONOUS", - "MODIFICATION", - "MOUSEDOWN", - "MOUSEDRAG", - "MOUSEMOVE", - "MOUSEOUT", - "MOUSEOVER", - "MOUSEUP", - "MOZ_KEYFRAMES_RULE", - "MOZ_KEYFRAME_RULE", - "MOZ_SOURCE_CURSOR", - "MOZ_SOURCE_ERASER", - "MOZ_SOURCE_KEYBOARD", - "MOZ_SOURCE_MOUSE", - "MOZ_SOURCE_PEN", - "MOZ_SOURCE_TOUCH", - "MOZ_SOURCE_UNKNOWN", - "MSGESTURE_FLAG_BEGIN", - "MSGESTURE_FLAG_CANCEL", - "MSGESTURE_FLAG_END", - "MSGESTURE_FLAG_INERTIA", - "MSGESTURE_FLAG_NONE", - "MSPOINTER_TYPE_MOUSE", - "MSPOINTER_TYPE_PEN", - "MSPOINTER_TYPE_TOUCH", - "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", - "MS_ASYNC_CALLBACK_STATUS_CANCEL", - "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", - "MS_ASYNC_CALLBACK_STATUS_ERROR", - "MS_ASYNC_CALLBACK_STATUS_JOIN", - "MS_ASYNC_OP_STATUS_CANCELED", - "MS_ASYNC_OP_STATUS_ERROR", - "MS_ASYNC_OP_STATUS_SUCCESS", - "MS_MANIPULATION_STATE_ACTIVE", - "MS_MANIPULATION_STATE_CANCELLED", - "MS_MANIPULATION_STATE_COMMITTED", - "MS_MANIPULATION_STATE_DRAGGING", - "MS_MANIPULATION_STATE_INERTIA", - "MS_MANIPULATION_STATE_PRESELECT", - "MS_MANIPULATION_STATE_SELECTING", - "MS_MANIPULATION_STATE_STOPPED", - "MS_MEDIA_ERR_ENCRYPTED", - "MS_MEDIA_KEYERR_CLIENT", - "MS_MEDIA_KEYERR_DOMAIN", - "MS_MEDIA_KEYERR_HARDWARECHANGE", - "MS_MEDIA_KEYERR_OUTPUT", - "MS_MEDIA_KEYERR_SERVICE", - "MS_MEDIA_KEYERR_UNKNOWN", - "Map", - "Math", - "MathMLElement", - "MediaCapabilities", - "MediaCapabilitiesInfo", - "MediaController", - "MediaDeviceInfo", - "MediaDevices", - "MediaElementAudioSourceNode", - "MediaEncryptedEvent", - "MediaError", - "MediaKeyError", - "MediaKeyEvent", - "MediaKeyMessageEvent", - "MediaKeyNeededEvent", - "MediaKeySession", - "MediaKeyStatusMap", - "MediaKeySystemAccess", - "MediaKeys", - "MediaList", - "MediaMetadata", - "MediaQueryList", - "MediaQueryListEvent", - "MediaRecorder", - "MediaRecorderErrorEvent", - "MediaSession", - "MediaSettingsRange", - "MediaSource", - "MediaStream", - "MediaStreamAudioDestinationNode", - "MediaStreamAudioSourceNode", - "MediaStreamEvent", - "MediaStreamTrack", - "MediaStreamTrackAudioSourceNode", - "MediaStreamTrackEvent", - "Memory", - "MessageChannel", - "MessageEvent", - "MessagePort", - "Methods", - "MimeType", - "MimeTypeArray", - "Module", - "MouseEvent", - "MouseScrollEvent", - "MozAnimation", - "MozAnimationDelay", - "MozAnimationDirection", - "MozAnimationDuration", - "MozAnimationFillMode", - "MozAnimationIterationCount", - "MozAnimationName", - "MozAnimationPlayState", - "MozAnimationTimingFunction", - "MozAppearance", - "MozBackfaceVisibility", - "MozBinding", - "MozBorderBottomColors", - "MozBorderEnd", - "MozBorderEndColor", - "MozBorderEndStyle", - "MozBorderEndWidth", - "MozBorderImage", - "MozBorderLeftColors", - "MozBorderRightColors", - "MozBorderStart", - "MozBorderStartColor", - "MozBorderStartStyle", - "MozBorderStartWidth", - "MozBorderTopColors", - "MozBoxAlign", - "MozBoxDirection", - "MozBoxFlex", - "MozBoxOrdinalGroup", - "MozBoxOrient", - "MozBoxPack", - "MozBoxSizing", - "MozCSSKeyframeRule", - "MozCSSKeyframesRule", - "MozColumnCount", - "MozColumnFill", - "MozColumnGap", - "MozColumnRule", - "MozColumnRuleColor", - "MozColumnRuleStyle", - "MozColumnRuleWidth", - "MozColumnWidth", - "MozColumns", - "MozContactChangeEvent", - "MozFloatEdge", - "MozFontFeatureSettings", - "MozFontLanguageOverride", - "MozForceBrokenImageIcon", - "MozHyphens", - "MozImageRegion", - "MozMarginEnd", - "MozMarginStart", - "MozMmsEvent", - "MozMmsMessage", - "MozMobileMessageThread", - "MozOSXFontSmoothing", - "MozOrient", - "MozOsxFontSmoothing", - "MozOutlineRadius", - "MozOutlineRadiusBottomleft", - "MozOutlineRadiusBottomright", - "MozOutlineRadiusTopleft", - "MozOutlineRadiusTopright", - "MozPaddingEnd", - "MozPaddingStart", - "MozPerspective", - "MozPerspectiveOrigin", - "MozPowerManager", - "MozSettingsEvent", - "MozSmsEvent", - "MozSmsMessage", - "MozStackSizing", - "MozTabSize", - "MozTextAlignLast", - "MozTextDecorationColor", - "MozTextDecorationLine", - "MozTextDecorationStyle", - "MozTextSizeAdjust", - "MozTransform", - "MozTransformOrigin", - "MozTransformStyle", - "MozTransition", - "MozTransitionDelay", - "MozTransitionDuration", - "MozTransitionProperty", - "MozTransitionTimingFunction", - "MozUserFocus", - "MozUserInput", - "MozUserModify", - "MozUserSelect", - "MozWindowDragging", - "MozWindowShadow", - "MutationEvent", - "MutationObserver", - "MutationRecord", - "NAMESPACE_ERR", - "NAMESPACE_RULE", - "NEAREST", - "NEAREST_MIPMAP_LINEAR", - "NEAREST_MIPMAP_NEAREST", - "NEGATIVE_INFINITY", - "NETWORK_EMPTY", - "NETWORK_ERR", - "NETWORK_IDLE", - "NETWORK_LOADED", - "NETWORK_LOADING", - "NETWORK_NO_SOURCE", - "NEVER", - "NEW", - "NEXT", - "NEXT_NO_DUPLICATE", - "NICEST", - "NODE_AFTER", - "NODE_BEFORE", - "NODE_BEFORE_AND_AFTER", - "NODE_INSIDE", - "NONE", - "NON_TRANSIENT_ERR", - "NOTATION_NODE", - "NOTCH", - "NOTEQUAL", - "NOT_ALLOWED_ERR", - "NOT_FOUND_ERR", - "NOT_READABLE_ERR", - "NOT_SUPPORTED_ERR", - "NO_DATA_ALLOWED_ERR", - "NO_ERR", - "NO_ERROR", - "NO_MODIFICATION_ALLOWED_ERR", - "NUMBER_TYPE", - "NUM_COMPRESSED_TEXTURE_FORMATS", - "NaN", - "NamedNodeMap", - "NavigationPreloadManager", - "Navigator", - "NearbyLinks", - "NetworkInformation", - "Node", - "NodeFilter", - "NodeIterator", - "NodeList", - "Notation", - "Notification", - "NotifyPaintEvent", - "Number", - "NumberFormat", - "OBJECT_TYPE", - "OBSOLETE", - "OK", - "ONE", - "ONE_MINUS_CONSTANT_ALPHA", - "ONE_MINUS_CONSTANT_COLOR", - "ONE_MINUS_DST_ALPHA", - "ONE_MINUS_DST_COLOR", - "ONE_MINUS_SRC_ALPHA", - "ONE_MINUS_SRC_COLOR", - "OPEN", - "OPENED", - "OPENING", - "ORDERED_NODE_ITERATOR_TYPE", - "ORDERED_NODE_SNAPSHOT_TYPE", - "OTHER_ERROR", - "OUT_OF_MEMORY", - "Object", - "OfflineAudioCompletionEvent", - "OfflineAudioContext", - "OfflineResourceList", - "OffscreenCanvas", - "OffscreenCanvasRenderingContext2D", - "Option", - "OrientationSensor", - "OscillatorNode", - "OverconstrainedError", - "OverflowEvent", - "PACK_ALIGNMENT", - "PACK_ROW_LENGTH", - "PACK_SKIP_PIXELS", - "PACK_SKIP_ROWS", - "PAGE_RULE", - "PARSE_ERR", - "PATHSEG_ARC_ABS", - "PATHSEG_ARC_REL", - "PATHSEG_CLOSEPATH", - "PATHSEG_CURVETO_CUBIC_ABS", - "PATHSEG_CURVETO_CUBIC_REL", - "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", - "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", - "PATHSEG_CURVETO_QUADRATIC_ABS", - "PATHSEG_CURVETO_QUADRATIC_REL", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", - "PATHSEG_LINETO_ABS", - "PATHSEG_LINETO_HORIZONTAL_ABS", - "PATHSEG_LINETO_HORIZONTAL_REL", - "PATHSEG_LINETO_REL", - "PATHSEG_LINETO_VERTICAL_ABS", - "PATHSEG_LINETO_VERTICAL_REL", - "PATHSEG_MOVETO_ABS", - "PATHSEG_MOVETO_REL", - "PATHSEG_UNKNOWN", - "PATH_EXISTS_ERR", - "PEAKING", - "PERMISSION_DENIED", - "PERSISTENT", - "PI", - "PIXEL_PACK_BUFFER", - "PIXEL_PACK_BUFFER_BINDING", - "PIXEL_UNPACK_BUFFER", - "PIXEL_UNPACK_BUFFER_BINDING", - "PLAYING_STATE", - "POINTS", - "POLYGON_OFFSET_FACTOR", - "POLYGON_OFFSET_FILL", - "POLYGON_OFFSET_UNITS", - "POSITION_UNAVAILABLE", - "POSITIVE_INFINITY", - "PREV", - "PREV_NO_DUPLICATE", - "PROCESSING_INSTRUCTION_NODE", - "PageChangeEvent", - "PageTransitionEvent", - "PaintRequest", - "PaintRequestList", - "PannerNode", - "PasswordCredential", - "Path2D", - "PaymentAddress", - "PaymentInstruments", - "PaymentManager", - "PaymentMethodChangeEvent", - "PaymentRequest", - "PaymentRequestUpdateEvent", - "PaymentResponse", - "Performance", - "PerformanceElementTiming", - "PerformanceEntry", - "PerformanceEventTiming", - "PerformanceLongTaskTiming", - "PerformanceMark", - "PerformanceMeasure", - "PerformanceNavigation", - "PerformanceNavigationTiming", - "PerformanceObserver", - "PerformanceObserverEntryList", - "PerformancePaintTiming", - "PerformanceResourceTiming", - "PerformanceServerTiming", - "PerformanceTiming", - "PeriodicSyncManager", - "PeriodicWave", - "PermissionStatus", - "Permissions", - "PhotoCapabilities", - "PictureInPictureWindow", - "Plugin", - "PluginArray", - "PluralRules", - "PointerEvent", - "PopStateEvent", - "PopupBlockedEvent", - "Presentation", - "PresentationAvailability", - "PresentationConnection", - "PresentationConnectionAvailableEvent", - "PresentationConnectionCloseEvent", - "PresentationConnectionList", - "PresentationReceiver", - "PresentationRequest", - "ProcessingInstruction", - "ProgressEvent", - "Promise", - "PromiseRejectionEvent", - "PropertyNodeList", - "Proxy", - "PublicKeyCredential", - "PushManager", - "PushSubscription", - "PushSubscriptionOptions", - "Q", - "QUERY_RESOLVE", - "QUERY_RESULT", - "QUERY_RESULT_AVAILABLE", - "QUOTA_ERR", - "QUOTA_EXCEEDED_ERR", - "QueryInterface", - "R11F_G11F_B10F", - "R16F", - "R16I", - "R16UI", - "R32F", - "R32I", - "R32UI", - "R8", - "R8I", - "R8UI", - "R8_SNORM", - "RASTERIZER_DISCARD", - "READ", - "READ_BUFFER", - "READ_FRAMEBUFFER", - "READ_FRAMEBUFFER_BINDING", - "READ_ONLY", - "READ_ONLY_ERR", - "READ_WRITE", - "RED", - "RED_BITS", - "RED_INTEGER", - "REMOVAL", - "RENDERBUFFER", - "RENDERBUFFER_ALPHA_SIZE", - "RENDERBUFFER_BINDING", - "RENDERBUFFER_BLUE_SIZE", - "RENDERBUFFER_DEPTH_SIZE", - "RENDERBUFFER_GREEN_SIZE", - "RENDERBUFFER_HEIGHT", - "RENDERBUFFER_INTERNAL_FORMAT", - "RENDERBUFFER_RED_SIZE", - "RENDERBUFFER_SAMPLES", - "RENDERBUFFER_STENCIL_SIZE", - "RENDERBUFFER_WIDTH", - "RENDERER", - "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", - "RENDERING_INTENT_AUTO", - "RENDERING_INTENT_PERCEPTUAL", - "RENDERING_INTENT_RELATIVE_COLORIMETRIC", - "RENDERING_INTENT_SATURATION", - "RENDERING_INTENT_UNKNOWN", - "RENDER_ATTACHMENT", - "REPEAT", - "REPLACE", - "RG", - "RG16F", - "RG16I", - "RG16UI", - "RG32F", - "RG32I", - "RG32UI", - "RG8", - "RG8I", - "RG8UI", - "RG8_SNORM", - "RGB", - "RGB10_A2", - "RGB10_A2UI", - "RGB16F", - "RGB16I", - "RGB16UI", - "RGB32F", - "RGB32I", - "RGB32UI", - "RGB565", - "RGB5_A1", - "RGB8", - "RGB8I", - "RGB8UI", - "RGB8_SNORM", - "RGB9_E5", - "RGBA", - "RGBA16F", - "RGBA16I", - "RGBA16UI", - "RGBA32F", - "RGBA32I", - "RGBA32UI", - "RGBA4", - "RGBA8", - "RGBA8I", - "RGBA8UI", - "RGBA8_SNORM", - "RGBA_INTEGER", - "RGBColor", - "RGB_INTEGER", - "RG_INTEGER", - "ROTATION_CLOCKWISE", - "ROTATION_COUNTERCLOCKWISE", - "RTCCertificate", - "RTCDTMFSender", - "RTCDTMFToneChangeEvent", - "RTCDataChannel", - "RTCDataChannelEvent", - "RTCDtlsTransport", - "RTCError", - "RTCErrorEvent", - "RTCIceCandidate", - "RTCIceTransport", - "RTCPeerConnection", - "RTCPeerConnectionIceErrorEvent", - "RTCPeerConnectionIceEvent", - "RTCRtpReceiver", - "RTCRtpSender", - "RTCRtpTransceiver", - "RTCSctpTransport", - "RTCSessionDescription", - "RTCStatsReport", - "RTCTrackEvent", - "RadioNodeList", - "Range", - "RangeError", - "RangeException", - "ReadableStream", - "ReadableStreamDefaultReader", - "RecordErrorEvent", - "Rect", - "ReferenceError", - "Reflect", - "RegExp", - "RelativeOrientationSensor", - "RelativeTimeFormat", - "RemotePlayback", - "Report", - "ReportBody", - "ReportingObserver", - "Request", - "ResizeObserver", - "ResizeObserverEntry", - "ResizeObserverSize", - "Response", - "RuntimeError", - "SAMPLER_2D", - "SAMPLER_2D_ARRAY", - "SAMPLER_2D_ARRAY_SHADOW", - "SAMPLER_2D_SHADOW", - "SAMPLER_3D", - "SAMPLER_BINDING", - "SAMPLER_CUBE", - "SAMPLER_CUBE_SHADOW", - "SAMPLES", - "SAMPLE_ALPHA_TO_COVERAGE", - "SAMPLE_BUFFERS", - "SAMPLE_COVERAGE", - "SAMPLE_COVERAGE_INVERT", - "SAMPLE_COVERAGE_VALUE", - "SAWTOOTH", - "SCHEDULED_STATE", - "SCISSOR_BOX", - "SCISSOR_TEST", - "SCROLL_PAGE_DOWN", - "SCROLL_PAGE_UP", - "SDP_ANSWER", - "SDP_OFFER", - "SDP_PRANSWER", - "SECURITY_ERR", - "SELECT", - "SEPARATE_ATTRIBS", - "SERIALIZE_ERR", - "SEVERITY_ERROR", - "SEVERITY_FATAL_ERROR", - "SEVERITY_WARNING", - "SHADER_COMPILER", - "SHADER_TYPE", - "SHADING_LANGUAGE_VERSION", - "SHIFT_MASK", - "SHORT", - "SHOWING", - "SHOW_ALL", - "SHOW_ATTRIBUTE", - "SHOW_CDATA_SECTION", - "SHOW_COMMENT", - "SHOW_DOCUMENT", - "SHOW_DOCUMENT_FRAGMENT", - "SHOW_DOCUMENT_TYPE", - "SHOW_ELEMENT", - "SHOW_ENTITY", - "SHOW_ENTITY_REFERENCE", - "SHOW_NOTATION", - "SHOW_PROCESSING_INSTRUCTION", - "SHOW_TEXT", - "SIGNALED", - "SIGNED_NORMALIZED", - "SINE", - "SOUNDFIELD", - "SQLException", - "SQRT1_2", - "SQRT2", - "SQUARE", - "SRC_ALPHA", - "SRC_ALPHA_SATURATE", - "SRC_COLOR", - "SRGB", - "SRGB8", - "SRGB8_ALPHA8", - "START_TO_END", - "START_TO_START", - "STATIC_COPY", - "STATIC_DRAW", - "STATIC_READ", - "STENCIL", - "STENCIL_ATTACHMENT", - "STENCIL_BACK_FAIL", - "STENCIL_BACK_FUNC", - "STENCIL_BACK_PASS_DEPTH_FAIL", - "STENCIL_BACK_PASS_DEPTH_PASS", - "STENCIL_BACK_REF", - "STENCIL_BACK_VALUE_MASK", - "STENCIL_BACK_WRITEMASK", - "STENCIL_BITS", - "STENCIL_BUFFER_BIT", - "STENCIL_CLEAR_VALUE", - "STENCIL_FAIL", - "STENCIL_FUNC", - "STENCIL_INDEX", - "STENCIL_INDEX8", - "STENCIL_PASS_DEPTH_FAIL", - "STENCIL_PASS_DEPTH_PASS", - "STENCIL_REF", - "STENCIL_TEST", - "STENCIL_VALUE_MASK", - "STENCIL_WRITEMASK", - "STORAGE", - "STORAGE_BINDING", - "STREAM_COPY", - "STREAM_DRAW", - "STREAM_READ", - "STRING_TYPE", - "STYLE_RULE", - "SUBPIXEL_BITS", - "SUPPORTS_RULE", - "SVGAElement", - "SVGAltGlyphDefElement", - "SVGAltGlyphElement", - "SVGAltGlyphItemElement", - "SVGAngle", - "SVGAnimateColorElement", - "SVGAnimateElement", - "SVGAnimateMotionElement", - "SVGAnimateTransformElement", - "SVGAnimatedAngle", - "SVGAnimatedBoolean", - "SVGAnimatedEnumeration", - "SVGAnimatedInteger", - "SVGAnimatedLength", - "SVGAnimatedLengthList", - "SVGAnimatedNumber", - "SVGAnimatedNumberList", - "SVGAnimatedPreserveAspectRatio", - "SVGAnimatedRect", - "SVGAnimatedString", - "SVGAnimatedTransformList", - "SVGAnimationElement", - "SVGCircleElement", - "SVGClipPathElement", - "SVGColor", - "SVGComponentTransferFunctionElement", - "SVGCursorElement", - "SVGDefsElement", - "SVGDescElement", - "SVGDiscardElement", - "SVGDocument", - "SVGElement", - "SVGElementInstance", - "SVGElementInstanceList", - "SVGEllipseElement", - "SVGException", - "SVGFEBlendElement", - "SVGFEColorMatrixElement", - "SVGFEComponentTransferElement", - "SVGFECompositeElement", - "SVGFEConvolveMatrixElement", - "SVGFEDiffuseLightingElement", - "SVGFEDisplacementMapElement", - "SVGFEDistantLightElement", - "SVGFEDropShadowElement", - "SVGFEFloodElement", - "SVGFEFuncAElement", - "SVGFEFuncBElement", - "SVGFEFuncGElement", - "SVGFEFuncRElement", - "SVGFEGaussianBlurElement", - "SVGFEImageElement", - "SVGFEMergeElement", - "SVGFEMergeNodeElement", - "SVGFEMorphologyElement", - "SVGFEOffsetElement", - "SVGFEPointLightElement", - "SVGFESpecularLightingElement", - "SVGFESpotLightElement", - "SVGFETileElement", - "SVGFETurbulenceElement", - "SVGFilterElement", - "SVGFontElement", - "SVGFontFaceElement", - "SVGFontFaceFormatElement", - "SVGFontFaceNameElement", - "SVGFontFaceSrcElement", - "SVGFontFaceUriElement", - "SVGForeignObjectElement", - "SVGGElement", - "SVGGeometryElement", - "SVGGlyphElement", - "SVGGlyphRefElement", - "SVGGradientElement", - "SVGGraphicsElement", - "SVGHKernElement", - "SVGImageElement", - "SVGLength", - "SVGLengthList", - "SVGLineElement", - "SVGLinearGradientElement", - "SVGMPathElement", - "SVGMarkerElement", - "SVGMaskElement", - "SVGMatrix", - "SVGMetadataElement", - "SVGMissingGlyphElement", - "SVGNumber", - "SVGNumberList", - "SVGPaint", - "SVGPathElement", - "SVGPathSeg", - "SVGPathSegArcAbs", - "SVGPathSegArcRel", - "SVGPathSegClosePath", - "SVGPathSegCurvetoCubicAbs", - "SVGPathSegCurvetoCubicRel", - "SVGPathSegCurvetoCubicSmoothAbs", - "SVGPathSegCurvetoCubicSmoothRel", - "SVGPathSegCurvetoQuadraticAbs", - "SVGPathSegCurvetoQuadraticRel", - "SVGPathSegCurvetoQuadraticSmoothAbs", - "SVGPathSegCurvetoQuadraticSmoothRel", - "SVGPathSegLinetoAbs", - "SVGPathSegLinetoHorizontalAbs", - "SVGPathSegLinetoHorizontalRel", - "SVGPathSegLinetoRel", - "SVGPathSegLinetoVerticalAbs", - "SVGPathSegLinetoVerticalRel", - "SVGPathSegList", - "SVGPathSegMovetoAbs", - "SVGPathSegMovetoRel", - "SVGPatternElement", - "SVGPoint", - "SVGPointList", - "SVGPolygonElement", - "SVGPolylineElement", - "SVGPreserveAspectRatio", - "SVGRadialGradientElement", - "SVGRect", - "SVGRectElement", - "SVGRenderingIntent", - "SVGSVGElement", - "SVGScriptElement", - "SVGSetElement", - "SVGStopElement", - "SVGStringList", - "SVGStyleElement", - "SVGSwitchElement", - "SVGSymbolElement", - "SVGTRefElement", - "SVGTSpanElement", - "SVGTextContentElement", - "SVGTextElement", - "SVGTextPathElement", - "SVGTextPositioningElement", - "SVGTitleElement", - "SVGTransform", - "SVGTransformList", - "SVGUnitTypes", - "SVGUseElement", - "SVGVKernElement", - "SVGViewElement", - "SVGViewSpec", - "SVGZoomAndPan", - "SVGZoomEvent", - "SVG_ANGLETYPE_DEG", - "SVG_ANGLETYPE_GRAD", - "SVG_ANGLETYPE_RAD", - "SVG_ANGLETYPE_UNKNOWN", - "SVG_ANGLETYPE_UNSPECIFIED", - "SVG_CHANNEL_A", - "SVG_CHANNEL_B", - "SVG_CHANNEL_G", - "SVG_CHANNEL_R", - "SVG_CHANNEL_UNKNOWN", - "SVG_COLORTYPE_CURRENTCOLOR", - "SVG_COLORTYPE_RGBCOLOR", - "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", - "SVG_COLORTYPE_UNKNOWN", - "SVG_EDGEMODE_DUPLICATE", - "SVG_EDGEMODE_NONE", - "SVG_EDGEMODE_UNKNOWN", - "SVG_EDGEMODE_WRAP", - "SVG_FEBLEND_MODE_COLOR", - "SVG_FEBLEND_MODE_COLOR_BURN", - "SVG_FEBLEND_MODE_COLOR_DODGE", - "SVG_FEBLEND_MODE_DARKEN", - "SVG_FEBLEND_MODE_DIFFERENCE", - "SVG_FEBLEND_MODE_EXCLUSION", - "SVG_FEBLEND_MODE_HARD_LIGHT", - "SVG_FEBLEND_MODE_HUE", - "SVG_FEBLEND_MODE_LIGHTEN", - "SVG_FEBLEND_MODE_LUMINOSITY", - "SVG_FEBLEND_MODE_MULTIPLY", - "SVG_FEBLEND_MODE_NORMAL", - "SVG_FEBLEND_MODE_OVERLAY", - "SVG_FEBLEND_MODE_SATURATION", - "SVG_FEBLEND_MODE_SCREEN", - "SVG_FEBLEND_MODE_SOFT_LIGHT", - "SVG_FEBLEND_MODE_UNKNOWN", - "SVG_FECOLORMATRIX_TYPE_HUEROTATE", - "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", - "SVG_FECOLORMATRIX_TYPE_MATRIX", - "SVG_FECOLORMATRIX_TYPE_SATURATE", - "SVG_FECOLORMATRIX_TYPE_UNKNOWN", - "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", - "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", - "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", - "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", - "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", - "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", - "SVG_FECOMPOSITE_OPERATOR_ATOP", - "SVG_FECOMPOSITE_OPERATOR_IN", - "SVG_FECOMPOSITE_OPERATOR_OUT", - "SVG_FECOMPOSITE_OPERATOR_OVER", - "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_XOR", - "SVG_INVALID_VALUE_ERR", - "SVG_LENGTHTYPE_CM", - "SVG_LENGTHTYPE_EMS", - "SVG_LENGTHTYPE_EXS", - "SVG_LENGTHTYPE_IN", - "SVG_LENGTHTYPE_MM", - "SVG_LENGTHTYPE_NUMBER", - "SVG_LENGTHTYPE_PC", - "SVG_LENGTHTYPE_PERCENTAGE", - "SVG_LENGTHTYPE_PT", - "SVG_LENGTHTYPE_PX", - "SVG_LENGTHTYPE_UNKNOWN", - "SVG_MARKERUNITS_STROKEWIDTH", - "SVG_MARKERUNITS_UNKNOWN", - "SVG_MARKERUNITS_USERSPACEONUSE", - "SVG_MARKER_ORIENT_ANGLE", - "SVG_MARKER_ORIENT_AUTO", - "SVG_MARKER_ORIENT_UNKNOWN", - "SVG_MASKTYPE_ALPHA", - "SVG_MASKTYPE_LUMINANCE", - "SVG_MATRIX_NOT_INVERTABLE", - "SVG_MEETORSLICE_MEET", - "SVG_MEETORSLICE_SLICE", - "SVG_MEETORSLICE_UNKNOWN", - "SVG_MORPHOLOGY_OPERATOR_DILATE", - "SVG_MORPHOLOGY_OPERATOR_ERODE", - "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", - "SVG_PAINTTYPE_CURRENTCOLOR", - "SVG_PAINTTYPE_NONE", - "SVG_PAINTTYPE_RGBCOLOR", - "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", - "SVG_PAINTTYPE_UNKNOWN", - "SVG_PAINTTYPE_URI", - "SVG_PAINTTYPE_URI_CURRENTCOLOR", - "SVG_PAINTTYPE_URI_NONE", - "SVG_PAINTTYPE_URI_RGBCOLOR", - "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", - "SVG_PRESERVEASPECTRATIO_NONE", - "SVG_PRESERVEASPECTRATIO_UNKNOWN", - "SVG_PRESERVEASPECTRATIO_XMAXYMAX", - "SVG_PRESERVEASPECTRATIO_XMAXYMID", - "SVG_PRESERVEASPECTRATIO_XMAXYMIN", - "SVG_PRESERVEASPECTRATIO_XMIDYMAX", - "SVG_PRESERVEASPECTRATIO_XMIDYMID", - "SVG_PRESERVEASPECTRATIO_XMIDYMIN", - "SVG_PRESERVEASPECTRATIO_XMINYMAX", - "SVG_PRESERVEASPECTRATIO_XMINYMID", - "SVG_PRESERVEASPECTRATIO_XMINYMIN", - "SVG_SPREADMETHOD_PAD", - "SVG_SPREADMETHOD_REFLECT", - "SVG_SPREADMETHOD_REPEAT", - "SVG_SPREADMETHOD_UNKNOWN", - "SVG_STITCHTYPE_NOSTITCH", - "SVG_STITCHTYPE_STITCH", - "SVG_STITCHTYPE_UNKNOWN", - "SVG_TRANSFORM_MATRIX", - "SVG_TRANSFORM_ROTATE", - "SVG_TRANSFORM_SCALE", - "SVG_TRANSFORM_SKEWX", - "SVG_TRANSFORM_SKEWY", - "SVG_TRANSFORM_TRANSLATE", - "SVG_TRANSFORM_UNKNOWN", - "SVG_TURBULENCE_TYPE_FRACTALNOISE", - "SVG_TURBULENCE_TYPE_TURBULENCE", - "SVG_TURBULENCE_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", - "SVG_UNIT_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_USERSPACEONUSE", - "SVG_WRONG_TYPE_ERR", - "SVG_ZOOMANDPAN_DISABLE", - "SVG_ZOOMANDPAN_MAGNIFY", - "SVG_ZOOMANDPAN_UNKNOWN", - "SYNC_CONDITION", - "SYNC_FENCE", - "SYNC_FLAGS", - "SYNC_FLUSH_COMMANDS_BIT", - "SYNC_GPU_COMMANDS_COMPLETE", - "SYNC_STATUS", - "SYNTAX_ERR", - "SavedPages", - "Screen", - "ScreenOrientation", - "Script", - "ScriptProcessorNode", - "ScrollAreaEvent", - "SecurityPolicyViolationEvent", - "Selection", - "Sensor", - "SensorErrorEvent", - "ServiceWorker", - "ServiceWorkerContainer", - "ServiceWorkerRegistration", - "SessionDescription", - "Set", - "ShadowRoot", - "SharedArrayBuffer", - "SharedWorker", - "SimpleGestureEvent", - "SourceBuffer", - "SourceBufferList", - "SpeechSynthesis", - "SpeechSynthesisErrorEvent", - "SpeechSynthesisEvent", - "SpeechSynthesisUtterance", - "SpeechSynthesisVoice", - "StaticRange", - "StereoPannerNode", - "StopIteration", - "Storage", - "StorageEvent", - "StorageManager", - "String", - "StructType", - "StylePropertyMap", - "StylePropertyMapReadOnly", - "StyleSheet", - "StyleSheetList", - "SubmitEvent", - "SubtleCrypto", - "Symbol", - "SyncManager", - "SyntaxError", - "TEMPORARY", - "TEXTPATH_METHODTYPE_ALIGN", - "TEXTPATH_METHODTYPE_STRETCH", - "TEXTPATH_METHODTYPE_UNKNOWN", - "TEXTPATH_SPACINGTYPE_AUTO", - "TEXTPATH_SPACINGTYPE_EXACT", - "TEXTPATH_SPACINGTYPE_UNKNOWN", - "TEXTURE", - "TEXTURE0", - "TEXTURE1", - "TEXTURE10", - "TEXTURE11", - "TEXTURE12", - "TEXTURE13", - "TEXTURE14", - "TEXTURE15", - "TEXTURE16", - "TEXTURE17", - "TEXTURE18", - "TEXTURE19", - "TEXTURE2", - "TEXTURE20", - "TEXTURE21", - "TEXTURE22", - "TEXTURE23", - "TEXTURE24", - "TEXTURE25", - "TEXTURE26", - "TEXTURE27", - "TEXTURE28", - "TEXTURE29", - "TEXTURE3", - "TEXTURE30", - "TEXTURE31", - "TEXTURE4", - "TEXTURE5", - "TEXTURE6", - "TEXTURE7", - "TEXTURE8", - "TEXTURE9", - "TEXTURE_2D", - "TEXTURE_2D_ARRAY", - "TEXTURE_3D", - "TEXTURE_BASE_LEVEL", - "TEXTURE_BINDING", - "TEXTURE_BINDING_2D", - "TEXTURE_BINDING_2D_ARRAY", - "TEXTURE_BINDING_3D", - "TEXTURE_BINDING_CUBE_MAP", - "TEXTURE_COMPARE_FUNC", - "TEXTURE_COMPARE_MODE", - "TEXTURE_CUBE_MAP", - "TEXTURE_CUBE_MAP_NEGATIVE_X", - "TEXTURE_CUBE_MAP_NEGATIVE_Y", - "TEXTURE_CUBE_MAP_NEGATIVE_Z", - "TEXTURE_CUBE_MAP_POSITIVE_X", - "TEXTURE_CUBE_MAP_POSITIVE_Y", - "TEXTURE_CUBE_MAP_POSITIVE_Z", - "TEXTURE_IMMUTABLE_FORMAT", - "TEXTURE_IMMUTABLE_LEVELS", - "TEXTURE_MAG_FILTER", - "TEXTURE_MAX_ANISOTROPY_EXT", - "TEXTURE_MAX_LEVEL", - "TEXTURE_MAX_LOD", - "TEXTURE_MIN_FILTER", - "TEXTURE_MIN_LOD", - "TEXTURE_WRAP_R", - "TEXTURE_WRAP_S", - "TEXTURE_WRAP_T", - "TEXT_NODE", - "TIMEOUT", - "TIMEOUT_ERR", - "TIMEOUT_EXPIRED", - "TIMEOUT_IGNORED", - "TOO_LARGE_ERR", - "TRANSACTION_INACTIVE_ERR", - "TRANSFORM_FEEDBACK", - "TRANSFORM_FEEDBACK_ACTIVE", - "TRANSFORM_FEEDBACK_BINDING", - "TRANSFORM_FEEDBACK_BUFFER", - "TRANSFORM_FEEDBACK_BUFFER_BINDING", - "TRANSFORM_FEEDBACK_BUFFER_MODE", - "TRANSFORM_FEEDBACK_BUFFER_SIZE", - "TRANSFORM_FEEDBACK_BUFFER_START", - "TRANSFORM_FEEDBACK_PAUSED", - "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", - "TRANSFORM_FEEDBACK_VARYINGS", - "TRIANGLE", - "TRIANGLES", - "TRIANGLE_FAN", - "TRIANGLE_STRIP", - "TYPE_BACK_FORWARD", - "TYPE_ERR", - "TYPE_MISMATCH_ERR", - "TYPE_NAVIGATE", - "TYPE_RELOAD", - "TYPE_RESERVED", - "Table", - "TaskAttributionTiming", - "Text", - "TextDecoder", - "TextDecoderStream", - "TextEncoder", - "TextEncoderStream", - "TextEvent", - "TextMetrics", - "TextTrack", - "TextTrackCue", - "TextTrackCueList", - "TextTrackList", - "TimeEvent", - "TimeRanges", - "Touch", - "TouchEvent", - "TouchList", - "TrackEvent", - "TransformStream", - "TransitionEvent", - "TreeWalker", - "TrustedHTML", - "TrustedScript", - "TrustedScriptURL", - "TrustedTypePolicy", - "TrustedTypePolicyFactory", - "TypeError", - "TypedObject", - "U2F", - "UIEvent", - "UNCACHED", - "UNIFORM", - "UNIFORM_ARRAY_STRIDE", - "UNIFORM_BLOCK_ACTIVE_UNIFORMS", - "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", - "UNIFORM_BLOCK_BINDING", - "UNIFORM_BLOCK_DATA_SIZE", - "UNIFORM_BLOCK_INDEX", - "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", - "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", - "UNIFORM_BUFFER", - "UNIFORM_BUFFER_BINDING", - "UNIFORM_BUFFER_OFFSET_ALIGNMENT", - "UNIFORM_BUFFER_SIZE", - "UNIFORM_BUFFER_START", - "UNIFORM_IS_ROW_MAJOR", - "UNIFORM_MATRIX_STRIDE", - "UNIFORM_OFFSET", - "UNIFORM_SIZE", - "UNIFORM_TYPE", - "UNKNOWN_ERR", - "UNKNOWN_RULE", - "UNMASKED_RENDERER_WEBGL", - "UNMASKED_VENDOR_WEBGL", - "UNORDERED_NODE_ITERATOR_TYPE", - "UNORDERED_NODE_SNAPSHOT_TYPE", - "UNPACK_ALIGNMENT", - "UNPACK_COLORSPACE_CONVERSION_WEBGL", - "UNPACK_FLIP_Y_WEBGL", - "UNPACK_IMAGE_HEIGHT", - "UNPACK_PREMULTIPLY_ALPHA_WEBGL", - "UNPACK_ROW_LENGTH", - "UNPACK_SKIP_IMAGES", - "UNPACK_SKIP_PIXELS", - "UNPACK_SKIP_ROWS", - "UNSCHEDULED_STATE", - "UNSENT", - "UNSIGNALED", - "UNSIGNED_BYTE", - "UNSIGNED_INT", - "UNSIGNED_INT_10F_11F_11F_REV", - "UNSIGNED_INT_24_8", - "UNSIGNED_INT_2_10_10_10_REV", - "UNSIGNED_INT_5_9_9_9_REV", - "UNSIGNED_INT_SAMPLER_2D", - "UNSIGNED_INT_SAMPLER_2D_ARRAY", - "UNSIGNED_INT_SAMPLER_3D", - "UNSIGNED_INT_SAMPLER_CUBE", - "UNSIGNED_INT_VEC2", - "UNSIGNED_INT_VEC3", - "UNSIGNED_INT_VEC4", - "UNSIGNED_NORMALIZED", - "UNSIGNED_SHORT", - "UNSIGNED_SHORT_4_4_4_4", - "UNSIGNED_SHORT_5_5_5_1", - "UNSIGNED_SHORT_5_6_5", - "UNSPECIFIED_EVENT_TYPE_ERR", - "UPDATEREADY", - "URIError", - "URL", - "URLSearchParams", - "URLUnencoded", - "URL_MISMATCH_ERR", - "USB", - "USBAlternateInterface", - "USBConfiguration", - "USBConnectionEvent", - "USBDevice", - "USBEndpoint", - "USBInTransferResult", - "USBInterface", - "USBIsochronousInTransferPacket", - "USBIsochronousInTransferResult", - "USBIsochronousOutTransferPacket", - "USBIsochronousOutTransferResult", - "USBOutTransferResult", - "UTC", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "UserActivation", - "UserMessageHandler", - "UserMessageHandlersNamespace", - "UserProximityEvent", - "VALIDATE_STATUS", - "VALIDATION_ERR", - "VARIABLES_RULE", - "VENDOR", - "VERSION", - "VERSION_CHANGE", - "VERSION_ERR", - "VERTEX", - "VERTEX_ARRAY_BINDING", - "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", - "VERTEX_ATTRIB_ARRAY_DIVISOR", - "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", - "VERTEX_ATTRIB_ARRAY_ENABLED", - "VERTEX_ATTRIB_ARRAY_INTEGER", - "VERTEX_ATTRIB_ARRAY_NORMALIZED", - "VERTEX_ATTRIB_ARRAY_POINTER", - "VERTEX_ATTRIB_ARRAY_SIZE", - "VERTEX_ATTRIB_ARRAY_STRIDE", - "VERTEX_ATTRIB_ARRAY_TYPE", - "VERTEX_SHADER", - "VERTICAL", - "VERTICAL_AXIS", - "VER_ERR", - "VIEWPORT", - "VIEWPORT_RULE", - "VRDisplay", - "VRDisplayCapabilities", - "VRDisplayEvent", - "VREyeParameters", - "VRFieldOfView", - "VRFrameData", - "VRPose", - "VRStageParameters", - "VTTCue", - "VTTRegion", - "ValidityState", - "VideoPlaybackQuality", - "VideoStreamTrack", - "VisualViewport", - "WAIT_FAILED", - "WEBKIT_FILTER_RULE", - "WEBKIT_KEYFRAMES_RULE", - "WEBKIT_KEYFRAME_RULE", - "WEBKIT_REGION_RULE", - "WRITE", - "WRONG_DOCUMENT_ERR", - "WakeLock", - "WakeLockSentinel", - "WasmAnyRef", - "WaveShaperNode", - "WeakMap", - "WeakRef", - "WeakSet", - "WebAssembly", - "WebGL2RenderingContext", - "WebGLActiveInfo", - "WebGLBuffer", - "WebGLContextEvent", - "WebGLFramebuffer", - "WebGLProgram", - "WebGLQuery", - "WebGLRenderbuffer", - "WebGLRenderingContext", - "WebGLSampler", - "WebGLShader", - "WebGLShaderPrecisionFormat", - "WebGLSync", - "WebGLTexture", - "WebGLTransformFeedback", - "WebGLUniformLocation", - "WebGLVertexArray", - "WebGLVertexArrayObject", - "WebKitAnimationEvent", - "WebKitBlobBuilder", - "WebKitCSSFilterRule", - "WebKitCSSFilterValue", - "WebKitCSSKeyframeRule", - "WebKitCSSKeyframesRule", - "WebKitCSSMatrix", - "WebKitCSSRegionRule", - "WebKitCSSTransformValue", - "WebKitDataCue", - "WebKitGamepad", - "WebKitMediaKeyError", - "WebKitMediaKeyMessageEvent", - "WebKitMediaKeySession", - "WebKitMediaKeys", - "WebKitMediaSource", - "WebKitMutationObserver", - "WebKitNamespace", - "WebKitPlaybackTargetAvailabilityEvent", - "WebKitPoint", - "WebKitShadowRoot", - "WebKitSourceBuffer", - "WebKitSourceBufferList", - "WebKitTransitionEvent", - "WebSocket", - "WebkitAlignContent", - "WebkitAlignItems", - "WebkitAlignSelf", - "WebkitAnimation", - "WebkitAnimationDelay", - "WebkitAnimationDirection", - "WebkitAnimationDuration", - "WebkitAnimationFillMode", - "WebkitAnimationIterationCount", - "WebkitAnimationName", - "WebkitAnimationPlayState", - "WebkitAnimationTimingFunction", - "WebkitAppearance", - "WebkitBackfaceVisibility", - "WebkitBackgroundClip", - "WebkitBackgroundOrigin", - "WebkitBackgroundSize", - "WebkitBorderBottomLeftRadius", - "WebkitBorderBottomRightRadius", - "WebkitBorderImage", - "WebkitBorderRadius", - "WebkitBorderTopLeftRadius", - "WebkitBorderTopRightRadius", - "WebkitBoxAlign", - "WebkitBoxDirection", - "WebkitBoxFlex", - "WebkitBoxOrdinalGroup", - "WebkitBoxOrient", - "WebkitBoxPack", - "WebkitBoxShadow", - "WebkitBoxSizing", - "WebkitFilter", - "WebkitFlex", - "WebkitFlexBasis", - "WebkitFlexDirection", - "WebkitFlexFlow", - "WebkitFlexGrow", - "WebkitFlexShrink", - "WebkitFlexWrap", - "WebkitJustifyContent", - "WebkitLineClamp", - "WebkitMask", - "WebkitMaskClip", - "WebkitMaskComposite", - "WebkitMaskImage", - "WebkitMaskOrigin", - "WebkitMaskPosition", - "WebkitMaskPositionX", - "WebkitMaskPositionY", - "WebkitMaskRepeat", - "WebkitMaskSize", - "WebkitOrder", - "WebkitPerspective", - "WebkitPerspectiveOrigin", - "WebkitTextFillColor", - "WebkitTextSizeAdjust", - "WebkitTextStroke", - "WebkitTextStrokeColor", - "WebkitTextStrokeWidth", - "WebkitTransform", - "WebkitTransformOrigin", - "WebkitTransformStyle", - "WebkitTransition", - "WebkitTransitionDelay", - "WebkitTransitionDuration", - "WebkitTransitionProperty", - "WebkitTransitionTimingFunction", - "WebkitUserSelect", - "WheelEvent", - "Window", - "Worker", - "Worklet", - "WritableStream", - "WritableStreamDefaultWriter", - "XMLDocument", - "XMLHttpRequest", - "XMLHttpRequestEventTarget", - "XMLHttpRequestException", - "XMLHttpRequestProgressEvent", - "XMLHttpRequestUpload", - "XMLSerializer", - "XMLStylesheetProcessingInstruction", - "XPathEvaluator", - "XPathException", - "XPathExpression", - "XPathNSResolver", - "XPathResult", - "XRBoundedReferenceSpace", - "XRDOMOverlayState", - "XRFrame", - "XRHitTestResult", - "XRHitTestSource", - "XRInputSource", - "XRInputSourceArray", - "XRInputSourceEvent", - "XRInputSourcesChangeEvent", - "XRLayer", - "XRPose", - "XRRay", - "XRReferenceSpace", - "XRReferenceSpaceEvent", - "XRRenderState", - "XRRigidTransform", - "XRSession", - "XRSessionEvent", - "XRSpace", - "XRSystem", - "XRTransientInputHitTestResult", - "XRTransientInputHitTestSource", - "XRView", - "XRViewerPose", - "XRViewport", - "XRWebGLLayer", - "XSLTProcessor", - "ZERO", - "_XD0M_", - "_YD0M_", - "__brand", - "__defineGetter__", - "__defineSetter__", - "__lookupGetter__", - "__lookupSetter__", - "__opera", - "__proto__", - "_browserjsran", - "a", - "aLink", - "abbr", - "abort", - "aborted", - "abs", - "absolute", - "acceleration", - "accelerationIncludingGravity", - "accelerator", - "accept", - "acceptCharset", - "acceptNode", - "access", - "accessKey", - "accessKeyLabel", - "accuracy", - "acos", - "acosh", - "action", - "actionURL", - "actions", - "activated", - "active", - "activeCues", - "activeElement", - "activeSourceBuffers", - "activeSourceCount", - "activeTexture", - "activeVRDisplays", - "actualBoundingBoxAscent", - "actualBoundingBoxDescent", - "actualBoundingBoxLeft", - "actualBoundingBoxRight", - "add", - "addAll", - "addBehavior", - "addCandidate", - "addColorStop", - "addCue", - "addElement", - "addEventListener", - "addFilter", - "addFromString", - "addFromUri", - "addIceCandidate", - "addImport", - "addListener", - "addModule", - "addNamed", - "addPageRule", - "addPath", - "addPointer", - "addRange", - "addRegion", - "addRule", - "addSearchEngine", - "addSourceBuffer", - "addStream", - "addTextTrack", - "addTrack", - "addTransceiver", - "addWakeLockListener", - "added", - "addedNodes", - "additionalName", - "additiveSymbols", - "addons", - "address", - "addressLine", - "addressModeU", - "addressModeV", - "addressModeW", - "adoptNode", - "adoptedStyleSheets", - "adr", - "advance", - "after", - "album", - "alert", - "algorithm", - "align", - "align-content", - "align-items", - "align-self", - "alignContent", - "alignItems", - "alignSelf", - "alignmentBaseline", - "alinkColor", - "all", - "allSettled", - "allow", - "allowFullscreen", - "allowPaymentRequest", - "allowedDirections", - "allowedFeatures", - "allowedToPlay", - "allowsFeature", - "alpha", - "alphaMode", - "alphaToCoverageEnabled", - "alt", - "altGraphKey", - "altHtml", - "altKey", - "altLeft", - "alternate", - "alternateSetting", - "alternates", - "altitude", - "altitudeAccuracy", - "amplitude", - "ancestorOrigins", - "anchor", - "anchorNode", - "anchorOffset", - "anchors", - "and", - "angle", - "angularAcceleration", - "angularVelocity", - "animVal", - "animate", - "animatedInstanceRoot", - "animatedNormalizedPathSegList", - "animatedPathSegList", - "animatedPoints", - "animation", - "animation-delay", - "animation-direction", - "animation-duration", - "animation-fill-mode", - "animation-iteration-count", - "animation-name", - "animation-play-state", - "animation-timing-function", - "animationDelay", - "animationDirection", - "animationDuration", - "animationFillMode", - "animationIterationCount", - "animationName", - "animationPlayState", - "animationStartTime", - "animationTimingFunction", - "animationsPaused", - "anniversary", - "antialias", - "anticipatedRemoval", - "any", - "app", - "appCodeName", - "appMinorVersion", - "appName", - "appNotifications", - "appVersion", - "appearance", - "append", - "appendBuffer", - "appendChild", - "appendData", - "appendItem", - "appendMedium", - "appendNamed", - "appendRule", - "appendStream", - "appendWindowEnd", - "appendWindowStart", - "applets", - "applicationCache", - "applicationServerKey", - "apply", - "applyConstraints", - "applyElement", - "arc", - "arcTo", - "architecture", - "archive", - "areas", - "arguments", - "ariaAtomic", - "ariaAutoComplete", - "ariaBusy", - "ariaChecked", - "ariaColCount", - "ariaColIndex", - "ariaColSpan", - "ariaCurrent", - "ariaDescription", - "ariaDisabled", - "ariaExpanded", - "ariaHasPopup", - "ariaHidden", - "ariaKeyShortcuts", - "ariaLabel", - "ariaLevel", - "ariaLive", - "ariaModal", - "ariaMultiLine", - "ariaMultiSelectable", - "ariaOrientation", - "ariaPlaceholder", - "ariaPosInSet", - "ariaPressed", - "ariaReadOnly", - "ariaRelevant", - "ariaRequired", - "ariaRoleDescription", - "ariaRowCount", - "ariaRowIndex", - "ariaRowSpan", - "ariaSelected", - "ariaSetSize", - "ariaSort", - "ariaValueMax", - "ariaValueMin", - "ariaValueNow", - "ariaValueText", - "arrayBuffer", - "arrayLayerCount", - "arrayStride", - "artist", - "artwork", - "as", - "asIntN", - "asUintN", - "asin", - "asinh", - "aspect", - "assert", - "assign", - "assignedElements", - "assignedNodes", - "assignedSlot", - "async", - "asyncIterator", - "atEnd", - "atan", - "atan2", - "atanh", - "atob", - "attachEvent", - "attachInternals", - "attachShader", - "attachShadow", - "attachments", - "attack", - "attestationObject", - "attrChange", - "attrName", - "attributeFilter", - "attributeName", - "attributeNamespace", - "attributeOldValue", - "attributeStyleMap", - "attributes", - "attribution", - "audioBitsPerSecond", - "audioTracks", - "audioWorklet", - "authenticatedSignedWrites", - "authenticatorData", - "autoIncrement", - "autobuffer", - "autocapitalize", - "autocomplete", - "autocorrect", - "autofocus", - "automationRate", - "autoplay", - "availHeight", - "availLeft", - "availTop", - "availWidth", - "availability", - "available", - "aversion", - "ax", - "axes", - "axis", - "ay", - "azimuth", - "b", - "back", - "backface-visibility", - "backfaceVisibility", - "background", - "background-attachment", - "background-blend-mode", - "background-clip", - "background-color", - "background-image", - "background-origin", - "background-position", - "background-position-x", - "background-position-y", - "background-repeat", - "background-size", - "backgroundAttachment", - "backgroundBlendMode", - "backgroundClip", - "backgroundColor", - "backgroundFetch", - "backgroundImage", - "backgroundOrigin", - "backgroundPosition", - "backgroundPositionX", - "backgroundPositionY", - "backgroundRepeat", - "backgroundSize", - "badInput", - "badge", - "balance", - "baseArrayLayer", - "baseFrequencyX", - "baseFrequencyY", - "baseLatency", - "baseLayer", - "baseMipLevel", - "baseNode", - "baseOffset", - "baseURI", - "baseVal", - "baselineShift", - "battery", - "bday", - "before", - "beginComputePass", - "beginElement", - "beginElementAt", - "beginOcclusionQuery", - "beginPath", - "beginQuery", - "beginRenderPass", - "beginTransformFeedback", - "beginningOfPassWriteIndex", - "behavior", - "behaviorCookie", - "behaviorPart", - "behaviorUrns", - "beta", - "bezierCurveTo", - "bgColor", - "bgProperties", - "bias", - "big", - "bigint64", - "biguint64", - "binaryType", - "bind", - "bindAttribLocation", - "bindBuffer", - "bindBufferBase", - "bindBufferRange", - "bindFramebuffer", - "bindGroupLayouts", - "bindRenderbuffer", - "bindSampler", - "bindTexture", - "bindTransformFeedback", - "bindVertexArray", - "binding", - "bitness", - "blend", - "blendColor", - "blendEquation", - "blendEquationSeparate", - "blendFunc", - "blendFuncSeparate", - "blink", - "blitFramebuffer", - "blob", - "block-size", - "blockDirection", - "blockSize", - "blockedURI", - "blue", - "bluetooth", - "blur", - "body", - "bodyUsed", - "bold", - "bookmarks", - "booleanValue", - "border", - "border-block", - "border-block-color", - "border-block-end", - "border-block-end-color", - "border-block-end-style", - "border-block-end-width", - "border-block-start", - "border-block-start-color", - "border-block-start-style", - "border-block-start-width", - "border-block-style", - "border-block-width", - "border-bottom", - "border-bottom-color", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-bottom-style", - "border-bottom-width", - "border-collapse", - "border-color", - "border-end-end-radius", - "border-end-start-radius", - "border-image", - "border-image-outset", - "border-image-repeat", - "border-image-slice", - "border-image-source", - "border-image-width", - "border-inline", - "border-inline-color", - "border-inline-end", - "border-inline-end-color", - "border-inline-end-style", - "border-inline-end-width", - "border-inline-start", - "border-inline-start-color", - "border-inline-start-style", - "border-inline-start-width", - "border-inline-style", - "border-inline-width", - "border-left", - "border-left-color", - "border-left-style", - "border-left-width", - "border-radius", - "border-right", - "border-right-color", - "border-right-style", - "border-right-width", - "border-spacing", - "border-start-end-radius", - "border-start-start-radius", - "border-style", - "border-top", - "border-top-color", - "border-top-left-radius", - "border-top-right-radius", - "border-top-style", - "border-top-width", - "border-width", - "borderBlock", - "borderBlockColor", - "borderBlockEnd", - "borderBlockEndColor", - "borderBlockEndStyle", - "borderBlockEndWidth", - "borderBlockStart", - "borderBlockStartColor", - "borderBlockStartStyle", - "borderBlockStartWidth", - "borderBlockStyle", - "borderBlockWidth", - "borderBottom", - "borderBottomColor", - "borderBottomLeftRadius", - "borderBottomRightRadius", - "borderBottomStyle", - "borderBottomWidth", - "borderBoxSize", - "borderCollapse", - "borderColor", - "borderColorDark", - "borderColorLight", - "borderEndEndRadius", - "borderEndStartRadius", - "borderImage", - "borderImageOutset", - "borderImageRepeat", - "borderImageSlice", - "borderImageSource", - "borderImageWidth", - "borderInline", - "borderInlineColor", - "borderInlineEnd", - "borderInlineEndColor", - "borderInlineEndStyle", - "borderInlineEndWidth", - "borderInlineStart", - "borderInlineStartColor", - "borderInlineStartStyle", - "borderInlineStartWidth", - "borderInlineStyle", - "borderInlineWidth", - "borderLeft", - "borderLeftColor", - "borderLeftStyle", - "borderLeftWidth", - "borderRadius", - "borderRight", - "borderRightColor", - "borderRightStyle", - "borderRightWidth", - "borderSpacing", - "borderStartEndRadius", - "borderStartStartRadius", - "borderStyle", - "borderTop", - "borderTopColor", - "borderTopLeftRadius", - "borderTopRightRadius", - "borderTopStyle", - "borderTopWidth", - "borderWidth", - "bottom", - "bottomMargin", - "bound", - "boundElements", - "boundingClientRect", - "boundingHeight", - "boundingLeft", - "boundingTop", - "boundingWidth", - "bounds", - "boundsGeometry", - "box-decoration-break", - "box-shadow", - "box-sizing", - "boxDecorationBreak", - "boxShadow", - "boxSizing", - "brand", - "brands", - "break-after", - "break-before", - "break-inside", - "breakAfter", - "breakBefore", - "breakInside", - "broadcast", - "browserLanguage", - "btoa", - "bubbles", - "buffer", - "bufferData", - "bufferDepth", - "bufferSize", - "bufferSubData", - "buffered", - "bufferedAmount", - "bufferedAmountLowThreshold", - "buffers", - "buildID", - "buildNumber", - "button", - "buttonID", - "buttons", - "byteLength", - "byteOffset", - "bytesPerRow", - "bytesWritten", - "c", - "cache", - "caches", - "call", - "caller", - "canBeFormatted", - "canBeMounted", - "canBeShared", - "canHaveChildren", - "canHaveHTML", - "canInsertDTMF", - "canMakePayment", - "canPlayType", - "canPresent", - "canTrickleIceCandidates", - "cancel", - "cancelAndHoldAtTime", - "cancelAnimationFrame", - "cancelBubble", - "cancelIdleCallback", - "cancelScheduledValues", - "cancelVideoFrameCallback", - "cancelWatchAvailability", - "cancelable", - "candidate", - "canonicalUUID", - "canvas", - "capabilities", - "caption", - "caption-side", - "captionSide", - "capture", - "captureEvents", - "captureStackTrace", - "captureStream", - "caret-color", - "caretBidiLevel", - "caretColor", - "caretPositionFromPoint", - "caretRangeFromPoint", - "cast", - "catch", - "category", - "cbrt", - "cd", - "ceil", - "cellIndex", - "cellPadding", - "cellSpacing", - "cells", - "ch", - "chOff", - "chain", - "challenge", - "changeType", - "changedTouches", - "channel", - "channelCount", - "channelCountMode", - "channelInterpretation", - "char", - "charAt", - "charCode", - "charCodeAt", - "charIndex", - "charLength", - "characterData", - "characterDataOldValue", - "characterSet", - "characteristic", - "charging", - "chargingTime", - "charset", - "check", - "checkEnclosure", - "checkFramebufferStatus", - "checkIntersection", - "checkValidity", - "checked", - "childElementCount", - "childList", - "childNodes", - "children", - "chrome", - "ciphertext", - "cite", - "city", - "claimInterface", - "claimed", - "classList", - "className", - "classid", - "clear", - "clearAppBadge", - "clearAttributes", - "clearBuffer", - "clearBufferfi", - "clearBufferfv", - "clearBufferiv", - "clearBufferuiv", - "clearColor", - "clearData", - "clearDepth", - "clearHalt", - "clearImmediate", - "clearInterval", - "clearLiveSeekableRange", - "clearMarks", - "clearMaxGCPauseAccumulator", - "clearMeasures", - "clearParameters", - "clearRect", - "clearResourceTimings", - "clearShadow", - "clearStencil", - "clearTimeout", - "clearValue", - "clearWatch", - "click", - "clickCount", - "clientDataJSON", - "clientHeight", - "clientInformation", - "clientLeft", - "clientRect", - "clientRects", - "clientTop", - "clientWaitSync", - "clientWidth", - "clientX", - "clientY", - "clip", - "clip-path", - "clip-rule", - "clipBottom", - "clipLeft", - "clipPath", - "clipPathUnits", - "clipRight", - "clipRule", - "clipTop", - "clipboard", - "clipboardData", - "clone", - "cloneContents", - "cloneNode", - "cloneRange", - "close", - "closePath", - "closed", - "closest", - "clz", - "clz32", - "cm", - "cmp", - "code", - "codeBase", - "codePointAt", - "codeType", - "colSpan", - "collapse", - "collapseToEnd", - "collapseToStart", - "collapsed", - "collect", - "colno", - "color", - "color-adjust", - "color-interpolation", - "color-interpolation-filters", - "colorAdjust", - "colorAttachments", - "colorDepth", - "colorFormats", - "colorInterpolation", - "colorInterpolationFilters", - "colorMask", - "colorSpace", - "colorType", - "cols", - "column-count", - "column-fill", - "column-gap", - "column-rule", - "column-rule-color", - "column-rule-style", - "column-rule-width", - "column-span", - "column-width", - "columnCount", - "columnFill", - "columnGap", - "columnNumber", - "columnRule", - "columnRuleColor", - "columnRuleStyle", - "columnRuleWidth", - "columnSpan", - "columnWidth", - "columns", - "command", - "commit", - "commitPreferences", - "commitStyles", - "commonAncestorContainer", - "compact", - "compare", - "compareBoundaryPoints", - "compareDocumentPosition", - "compareEndPoints", - "compareExchange", - "compareNode", - "comparePoint", - "compatMode", - "compatible", - "compile", - "compileShader", - "compileStreaming", - "complete", - "component", - "componentFromPoint", - "composed", - "composedPath", - "composite", - "compositionEndOffset", - "compositionStartOffset", - "compressedTexImage2D", - "compressedTexImage3D", - "compressedTexSubImage2D", - "compressedTexSubImage3D", - "compute", - "computedStyleMap", - "concat", - "conditionText", - "coneInnerAngle", - "coneOuterAngle", - "coneOuterGain", - "configurable", - "configuration", - "configurationName", - "configurationValue", - "configurations", - "configure", - "confirm", - "confirmComposition", - "confirmSiteSpecificTrackingException", - "confirmWebWideTrackingException", - "connect", - "connectEnd", - "connectShark", - "connectStart", - "connected", - "connection", - "connectionList", - "connectionSpeed", - "connectionState", - "connections", - "console", - "consolidate", - "constants", - "constraint", - "constrictionActive", - "construct", - "constructor", - "contactID", - "contain", - "containerId", - "containerName", - "containerSrc", - "containerType", - "contains", - "containsNode", - "content", - "contentBoxSize", - "contentDocument", - "contentEditable", - "contentHint", - "contentOverflow", - "contentRect", - "contentScriptType", - "contentStyleType", - "contentType", - "contentWindow", - "context", - "contextMenu", - "contextmenu", - "continue", - "continuePrimaryKey", - "continuous", - "control", - "controlTransferIn", - "controlTransferOut", - "controller", - "controls", - "controlsList", - "convertPointFromNode", - "convertQuadFromNode", - "convertRectFromNode", - "convertToBlob", - "convertToSpecifiedUnits", - "cookie", - "cookieEnabled", - "coords", - "copyBufferSubData", - "copyBufferToBuffer", - "copyBufferToTexture", - "copyExternalImageToTexture", - "copyFromChannel", - "copyTexImage2D", - "copyTexSubImage2D", - "copyTexSubImage3D", - "copyTextureToBuffer", - "copyTextureToTexture", - "copyToChannel", - "copyWithin", - "correspondingElement", - "correspondingUseElement", - "corruptedVideoFrames", - "cos", - "cosh", - "count", - "countReset", - "counter-increment", - "counter-reset", - "counter-set", - "counterIncrement", - "counterReset", - "counterSet", - "country", - "cpuClass", - "cpuSleepAllowed", - "create", - "createAnalyser", - "createAnswer", - "createAttribute", - "createAttributeNS", - "createBindGroup", - "createBindGroupLayout", - "createBiquadFilter", - "createBuffer", - "createBufferSource", - "createCDATASection", - "createCSSStyleSheet", - "createCaption", - "createChannelMerger", - "createChannelSplitter", - "createCommandEncoder", - "createComment", - "createComputePipeline", - "createComputePipelineAsync", - "createConstantSource", - "createContextualFragment", - "createControlRange", - "createConvolver", - "createDTMFSender", - "createDataChannel", - "createDelay", - "createDelayNode", - "createDocument", - "createDocumentFragment", - "createDocumentType", - "createDynamicsCompressor", - "createElement", - "createElementNS", - "createEntityReference", - "createEvent", - "createEventObject", - "createExpression", - "createFramebuffer", - "createFunction", - "createGain", - "createGainNode", - "createHTML", - "createHTMLDocument", - "createIIRFilter", - "createImageBitmap", - "createImageData", - "createIndex", - "createJavaScriptNode", - "createLinearGradient", - "createMediaElementSource", - "createMediaKeys", - "createMediaStreamDestination", - "createMediaStreamSource", - "createMediaStreamTrackSource", - "createMutableFile", - "createNSResolver", - "createNodeIterator", - "createNotification", - "createObjectStore", - "createObjectURL", - "createOffer", - "createOscillator", - "createPanner", - "createPattern", - "createPeriodicWave", - "createPipelineLayout", - "createPolicy", - "createPopup", - "createProcessingInstruction", - "createProgram", - "createQuery", - "createQuerySet", - "createRadialGradient", - "createRange", - "createRangeCollection", - "createReader", - "createRenderBundleEncoder", - "createRenderPipeline", - "createRenderPipelineAsync", - "createRenderbuffer", - "createSVGAngle", - "createSVGLength", - "createSVGMatrix", - "createSVGNumber", - "createSVGPathSegArcAbs", - "createSVGPathSegArcRel", - "createSVGPathSegClosePath", - "createSVGPathSegCurvetoCubicAbs", - "createSVGPathSegCurvetoCubicRel", - "createSVGPathSegCurvetoCubicSmoothAbs", - "createSVGPathSegCurvetoCubicSmoothRel", - "createSVGPathSegCurvetoQuadraticAbs", - "createSVGPathSegCurvetoQuadraticRel", - "createSVGPathSegCurvetoQuadraticSmoothAbs", - "createSVGPathSegCurvetoQuadraticSmoothRel", - "createSVGPathSegLinetoAbs", - "createSVGPathSegLinetoHorizontalAbs", - "createSVGPathSegLinetoHorizontalRel", - "createSVGPathSegLinetoRel", - "createSVGPathSegLinetoVerticalAbs", - "createSVGPathSegLinetoVerticalRel", - "createSVGPathSegMovetoAbs", - "createSVGPathSegMovetoRel", - "createSVGPoint", - "createSVGRect", - "createSVGTransform", - "createSVGTransformFromMatrix", - "createSampler", - "createScript", - "createScriptProcessor", - "createScriptURL", - "createSession", - "createShader", - "createShaderModule", - "createShadowRoot", - "createStereoPanner", - "createStyleSheet", - "createTBody", - "createTFoot", - "createTHead", - "createTextNode", - "createTextRange", - "createTexture", - "createTouch", - "createTouchList", - "createTransformFeedback", - "createTreeWalker", - "createVertexArray", - "createView", - "createWaveShaper", - "creationTime", - "credentials", - "crossOrigin", - "crossOriginIsolated", - "crypto", - "csi", - "csp", - "cssFloat", - "cssRules", - "cssText", - "cssValueType", - "ctrlKey", - "ctrlLeft", - "cues", - "cullFace", - "cullMode", - "currentDirection", - "currentLocalDescription", - "currentNode", - "currentPage", - "currentRect", - "currentRemoteDescription", - "currentScale", - "currentScript", - "currentSrc", - "currentState", - "currentStyle", - "currentTarget", - "currentTime", - "currentTranslate", - "currentView", - "cursor", - "curve", - "customElements", - "customError", - "cx", - "cy", - "d", - "data", - "dataFld", - "dataFormatAs", - "dataLoss", - "dataLossMessage", - "dataPageSize", - "dataSrc", - "dataTransfer", - "database", - "databases", - "dataset", - "dateTime", - "db", - "debug", - "debuggerEnabled", - "declare", - "decode", - "decodeAudioData", - "decodeURI", - "decodeURIComponent", - "decodedBodySize", - "decoding", - "decodingInfo", - "decrypt", - "default", - "defaultCharset", - "defaultChecked", - "defaultMuted", - "defaultPlaybackRate", - "defaultPolicy", - "defaultPrevented", - "defaultQueue", - "defaultRequest", - "defaultSelected", - "defaultStatus", - "defaultURL", - "defaultValue", - "defaultView", - "defaultstatus", - "defer", - "define", - "defineMagicFunction", - "defineMagicVariable", - "defineProperties", - "defineProperty", - "deg", - "delay", - "delayTime", - "delegatesFocus", - "delete", - "deleteBuffer", - "deleteCaption", - "deleteCell", - "deleteContents", - "deleteData", - "deleteDatabase", - "deleteFramebuffer", - "deleteFromDocument", - "deleteIndex", - "deleteMedium", - "deleteObjectStore", - "deleteProgram", - "deleteProperty", - "deleteQuery", - "deleteRenderbuffer", - "deleteRow", - "deleteRule", - "deleteSampler", - "deleteShader", - "deleteSync", - "deleteTFoot", - "deleteTHead", - "deleteTexture", - "deleteTransformFeedback", - "deleteVertexArray", - "deliverChangeRecords", - "delivery", - "deliveryInfo", - "deliveryStatus", - "deliveryTimestamp", - "delta", - "deltaMode", - "deltaX", - "deltaY", - "deltaZ", - "dependentLocality", - "depthBias", - "depthBiasClamp", - "depthBiasSlopeScale", - "depthClearValue", - "depthCompare", - "depthFailOp", - "depthFar", - "depthFunc", - "depthLoadOp", - "depthMask", - "depthNear", - "depthOrArrayLayers", - "depthRange", - "depthReadOnly", - "depthStencil", - "depthStencilAttachment", - "depthStencilFormat", - "depthStoreOp", - "depthWriteEnabled", - "deref", - "deriveBits", - "deriveKey", - "description", - "deselectAll", - "designMode", - "desiredSize", - "destination", - "destinationURL", - "destroy", - "detach", - "detachEvent", - "detachShader", - "detail", - "details", - "detect", - "detune", - "device", - "deviceClass", - "deviceId", - "deviceMemory", - "devicePixelContentBoxSize", - "devicePixelRatio", - "deviceProtocol", - "deviceSubclass", - "deviceVersionMajor", - "deviceVersionMinor", - "deviceVersionSubminor", - "deviceXDPI", - "deviceYDPI", - "didTimeout", - "diffuseConstant", - "digest", - "dimension", - "dimensions", - "dir", - "dirName", - "direction", - "dirxml", - "disable", - "disablePictureInPicture", - "disableRemotePlayback", - "disableVertexAttribArray", - "disabled", - "dischargingTime", - "disconnect", - "disconnectShark", - "dispatchEvent", - "dispatchWorkgroups", - "dispatchWorkgroupsIndirect", - "display", - "displayId", - "displayName", - "disposition", - "distanceModel", - "div", - "divisor", - "djsapi", - "djsproxy", - "doImport", - "doNotTrack", - "doScroll", - "doctype", - "document", - "documentElement", - "documentMode", - "documentURI", - "dolphin", - "dolphinGameCenter", - "dolphininfo", - "dolphinmeta", - "domComplete", - "domContentLoadedEventEnd", - "domContentLoadedEventStart", - "domInteractive", - "domLoading", - "domOverlayState", - "domain", - "domainLookupEnd", - "domainLookupStart", - "dominant-baseline", - "dominantBaseline", - "done", - "dopplerFactor", - "dotAll", - "downDegrees", - "downlink", - "download", - "downloadTotal", - "downloaded", - "dpcm", - "dpi", - "dppx", - "dragDrop", - "draggable", - "draw", - "drawArrays", - "drawArraysInstanced", - "drawArraysInstancedANGLE", - "drawBuffers", - "drawCustomFocusRing", - "drawElements", - "drawElementsInstanced", - "drawElementsInstancedANGLE", - "drawFocusIfNeeded", - "drawImage", - "drawImageFromRect", - "drawIndexed", - "drawIndexedIndirect", - "drawIndirect", - "drawRangeElements", - "drawSystemFocusRing", - "drawingBufferHeight", - "drawingBufferWidth", - "dropEffect", - "droppedVideoFrames", - "dropzone", - "dstFactor", - "dtmf", - "dump", - "dumpProfile", - "duplicate", - "durability", - "duration", - "dvname", - "dvnum", - "dx", - "dy", - "dynsrc", - "e", - "edgeMode", - "effect", - "effectAllowed", - "effectiveDirective", - "effectiveType", - "elapsedTime", - "element", - "elementFromPoint", - "elementTiming", - "elements", - "elementsFromPoint", - "elevation", - "ellipse", - "em", - "email", - "embeds", - "emma", - "empty", - "empty-cells", - "emptyCells", - "emptyHTML", - "emptyScript", - "emulatedPosition", - "enable", - "enableBackground", - "enableDelegations", - "enableStyleSheetsForSet", - "enableVertexAttribArray", - "enabled", - "enabledPlugin", - "encode", - "encodeInto", - "encodeURI", - "encodeURIComponent", - "encodedBodySize", - "encoding", - "encodingInfo", - "encrypt", - "enctype", - "end", - "endContainer", - "endElement", - "endElementAt", - "endOcclusionQuery", - "endOfPassWriteIndex", - "endOfStream", - "endOffset", - "endQuery", - "endTime", - "endTransformFeedback", - "ended", - "endpoint", - "endpointNumber", - "endpoints", - "endsWith", - "enterKeyHint", - "entities", - "entries", - "entryPoint", - "entryType", - "enumerable", - "enumerate", - "enumerateDevices", - "enumerateEditable", - "environmentBlendMode", - "equals", - "error", - "errorCode", - "errorDetail", - "errorText", - "escape", - "estimate", - "eval", - "evaluate", - "event", - "eventPhase", - "every", - "ex", - "exception", - "exchange", - "exec", - "execCommand", - "execCommandShowHelp", - "execScript", - "executeBundles", - "exitFullscreen", - "exitPictureInPicture", - "exitPointerLock", - "exitPresent", - "exp", - "expand", - "expandEntityReferences", - "expando", - "expansion", - "expiration", - "expirationTime", - "expires", - "expiryDate", - "explicitOriginalTarget", - "expm1", - "exponent", - "exponentialRampToValueAtTime", - "exportKey", - "exports", - "extend", - "extensions", - "extentNode", - "extentOffset", - "external", - "externalResourcesRequired", - "externalTexture", - "extractContents", - "extractable", - "eye", - "f", - "face", - "factoryReset", - "failOp", - "failureReason", - "fallback", - "family", - "familyName", - "farthestViewportElement", - "fastSeek", - "fatal", - "featureId", - "featurePolicy", - "featureSettings", - "features", - "fenceSync", - "fetch", - "fetchStart", - "fftSize", - "fgColor", - "fieldOfView", - "file", - "fileCreatedDate", - "fileHandle", - "fileModifiedDate", - "fileName", - "fileSize", - "fileUpdatedDate", - "filename", - "files", - "filesystem", - "fill", - "fill-opacity", - "fill-rule", - "fillLightMode", - "fillOpacity", - "fillRect", - "fillRule", - "fillStyle", - "fillText", - "filter", - "filterResX", - "filterResY", - "filterUnits", - "filters", - "finally", - "find", - "findIndex", - "findRule", - "findText", - "finish", - "finished", - "fireEvent", - "firesTouchEvents", - "firstChild", - "firstElementChild", - "firstPage", - "fixed", - "flags", - "flat", - "flatMap", - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "flexBasis", - "flexDirection", - "flexFlow", - "flexGrow", - "flexShrink", - "flexWrap", - "flipX", - "flipY", - "float", - "float32", - "float64", - "flood-color", - "flood-opacity", - "floodColor", - "floodOpacity", - "floor", - "flush", - "focus", - "focusNode", - "focusOffset", - "font", - "font-family", - "font-feature-settings", - "font-kerning", - "font-language-override", - "font-optical-sizing", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-synthesis", - "font-variant", - "font-variant-alternates", - "font-variant-caps", - "font-variant-east-asian", - "font-variant-ligatures", - "font-variant-numeric", - "font-variant-position", - "font-variation-settings", - "font-weight", - "fontFamily", - "fontFeatureSettings", - "fontKerning", - "fontLanguageOverride", - "fontOpticalSizing", - "fontSize", - "fontSizeAdjust", - "fontSmoothingEnabled", - "fontStretch", - "fontStyle", - "fontSynthesis", - "fontVariant", - "fontVariantAlternates", - "fontVariantCaps", - "fontVariantEastAsian", - "fontVariantLigatures", - "fontVariantNumeric", - "fontVariantPosition", - "fontVariationSettings", - "fontWeight", - "fontcolor", - "fontfaces", - "fonts", - "fontsize", - "for", - "forEach", - "force", - "forceFallbackAdapter", - "forceRedraw", - "form", - "formAction", - "formData", - "formEnctype", - "formMethod", - "formNoValidate", - "formTarget", - "format", - "formatToParts", - "forms", - "forward", - "forwardX", - "forwardY", - "forwardZ", - "foundation", - "fr", - "fragment", - "fragmentDirective", - "frame", - "frameBorder", - "frameElement", - "frameSpacing", - "framebuffer", - "framebufferHeight", - "framebufferRenderbuffer", - "framebufferTexture2D", - "framebufferTextureLayer", - "framebufferWidth", - "frames", - "freeSpace", - "freeze", - "frequency", - "frequencyBinCount", - "from", - "fromCharCode", - "fromCodePoint", - "fromElement", - "fromEntries", - "fromFloat32Array", - "fromFloat64Array", - "fromMatrix", - "fromPoint", - "fromQuad", - "fromRect", - "frontFace", - "fround", - "fullPath", - "fullScreen", - "fullVersionList", - "fullscreen", - "fullscreenElement", - "fullscreenEnabled", - "fx", - "fy", - "g", - "gain", - "gamepad", - "gamma", - "gap", - "gatheringState", - "gatt", - "genderIdentity", - "generateCertificate", - "generateKey", - "generateMipmap", - "generateRequest", - "geolocation", - "gestureObject", - "get", - "getActiveAttrib", - "getActiveUniform", - "getActiveUniformBlockName", - "getActiveUniformBlockParameter", - "getActiveUniforms", - "getAdjacentText", - "getAll", - "getAllKeys", - "getAllResponseHeaders", - "getAllowlistForFeature", - "getAnimations", - "getAsFile", - "getAsString", - "getAttachedShaders", - "getAttribLocation", - "getAttribute", - "getAttributeNS", - "getAttributeNames", - "getAttributeNode", - "getAttributeNodeNS", - "getAttributeType", - "getAudioTracks", - "getAvailability", - "getBBox", - "getBattery", - "getBigInt64", - "getBigUint64", - "getBindGroupLayout", - "getBlob", - "getBookmark", - "getBoundingClientRect", - "getBounds", - "getBoxQuads", - "getBufferParameter", - "getBufferSubData", - "getByteFrequencyData", - "getByteTimeDomainData", - "getCSSCanvasContext", - "getCTM", - "getCandidateWindowClientRect", - "getCanonicalLocales", - "getCapabilities", - "getChannelData", - "getCharNumAtPosition", - "getCharacteristic", - "getCharacteristics", - "getClientExtensionResults", - "getClientRect", - "getClientRects", - "getCoalescedEvents", - "getCompilationInfo", - "getCompositionAlternatives", - "getComputedStyle", - "getComputedTextLength", - "getComputedTiming", - "getConfiguration", - "getConstraints", - "getContext", - "getContextAttributes", - "getContributingSources", - "getCounterValue", - "getCueAsHTML", - "getCueById", - "getCurrentPosition", - "getCurrentTexture", - "getCurrentTime", - "getData", - "getDatabaseNames", - "getDate", - "getDay", - "getDefaultComputedStyle", - "getDescriptor", - "getDescriptors", - "getDestinationInsertionPoints", - "getDevices", - "getDirectory", - "getDisplayMedia", - "getDistributedNodes", - "getEditable", - "getElementById", - "getElementsByClassName", - "getElementsByName", - "getElementsByTagName", - "getElementsByTagNameNS", - "getEnclosureList", - "getEndPositionOfChar", - "getEntries", - "getEntriesByName", - "getEntriesByType", - "getError", - "getExtension", - "getExtentOfChar", - "getEyeParameters", - "getFeature", - "getFile", - "getFiles", - "getFilesAndDirectories", - "getFingerprints", - "getFloat32", - "getFloat64", - "getFloatFrequencyData", - "getFloatTimeDomainData", - "getFloatValue", - "getFragDataLocation", - "getFrameData", - "getFramebufferAttachmentParameter", - "getFrequencyResponse", - "getFullYear", - "getGamepads", - "getHighEntropyValues", - "getHitTestResults", - "getHitTestResultsForTransientInput", - "getHours", - "getIdentityAssertion", - "getIds", - "getImageData", - "getIndexedParameter", - "getInstalledRelatedApps", - "getInt16", - "getInt32", - "getInt8", - "getInternalformatParameter", - "getIntersectionList", - "getItem", - "getItems", - "getKey", - "getKeyframes", - "getLayers", - "getLayoutMap", - "getLineDash", - "getLocalCandidates", - "getLocalParameters", - "getLocalStreams", - "getMappedRange", - "getMarks", - "getMatchedCSSRules", - "getMaxGCPauseSinceClear", - "getMeasures", - "getMetadata", - "getMilliseconds", - "getMinutes", - "getModifierState", - "getMonth", - "getNamedItem", - "getNamedItemNS", - "getNativeFramebufferScaleFactor", - "getNotifications", - "getNotifier", - "getNumberOfChars", - "getOffsetReferenceSpace", - "getOutputTimestamp", - "getOverrideHistoryNavigationMode", - "getOverrideStyle", - "getOwnPropertyDescriptor", - "getOwnPropertyDescriptors", - "getOwnPropertyNames", - "getOwnPropertySymbols", - "getParameter", - "getParameters", - "getParent", - "getPathSegAtLength", - "getPhotoCapabilities", - "getPhotoSettings", - "getPointAtLength", - "getPose", - "getPredictedEvents", - "getPreference", - "getPreferenceDefault", - "getPreferredCanvasFormat", - "getPresentationAttribute", - "getPreventDefault", - "getPrimaryService", - "getPrimaryServices", - "getProgramInfoLog", - "getProgramParameter", - "getPropertyCSSValue", - "getPropertyPriority", - "getPropertyShorthand", - "getPropertyType", - "getPropertyValue", - "getPrototypeOf", - "getQuery", - "getQueryParameter", - "getRGBColorValue", - "getRandomValues", - "getRangeAt", - "getReader", - "getReceivers", - "getRectValue", - "getRegistration", - "getRegistrations", - "getRemoteCandidates", - "getRemoteCertificates", - "getRemoteParameters", - "getRemoteStreams", - "getRenderbufferParameter", - "getResponseHeader", - "getRoot", - "getRootNode", - "getRotationOfChar", - "getSVGDocument", - "getSamplerParameter", - "getScreenCTM", - "getSeconds", - "getSelectedCandidatePair", - "getSelection", - "getSenders", - "getService", - "getSettings", - "getShaderInfoLog", - "getShaderParameter", - "getShaderPrecisionFormat", - "getShaderSource", - "getSimpleDuration", - "getSiteIcons", - "getSources", - "getSpeculativeParserUrls", - "getStartPositionOfChar", - "getStartTime", - "getState", - "getStats", - "getStatusForPolicy", - "getStorageUpdates", - "getStreamById", - "getStringValue", - "getSubStringLength", - "getSubscription", - "getSupportedConstraints", - "getSupportedExtensions", - "getSupportedFormats", - "getSyncParameter", - "getSynchronizationSources", - "getTags", - "getTargetRanges", - "getTexParameter", - "getTime", - "getTimezoneOffset", - "getTiming", - "getTotalLength", - "getTrackById", - "getTracks", - "getTransceivers", - "getTransform", - "getTransformFeedbackVarying", - "getTransformToElement", - "getTransports", - "getType", - "getTypeMapping", - "getUTCDate", - "getUTCDay", - "getUTCFullYear", - "getUTCHours", - "getUTCMilliseconds", - "getUTCMinutes", - "getUTCMonth", - "getUTCSeconds", - "getUint16", - "getUint32", - "getUint8", - "getUniform", - "getUniformBlockIndex", - "getUniformIndices", - "getUniformLocation", - "getUserMedia", - "getVRDisplays", - "getValues", - "getVarDate", - "getVariableValue", - "getVertexAttrib", - "getVertexAttribOffset", - "getVideoPlaybackQuality", - "getVideoTracks", - "getViewerPose", - "getViewport", - "getVoices", - "getWakeLockState", - "getWriter", - "getYear", - "givenName", - "global", - "globalAlpha", - "globalCompositeOperation", - "globalThis", - "glyphOrientationHorizontal", - "glyphOrientationVertical", - "glyphRef", - "go", - "gpu", - "grabFrame", - "grad", - "gradientTransform", - "gradientUnits", - "grammars", - "green", - "grid", - "grid-area", - "grid-auto-columns", - "grid-auto-flow", - "grid-auto-rows", - "grid-column", - "grid-column-end", - "grid-column-gap", - "grid-column-start", - "grid-gap", - "grid-row", - "grid-row-end", - "grid-row-gap", - "grid-row-start", - "grid-template", - "grid-template-areas", - "grid-template-columns", - "grid-template-rows", - "gridArea", - "gridAutoColumns", - "gridAutoFlow", - "gridAutoRows", - "gridColumn", - "gridColumnEnd", - "gridColumnGap", - "gridColumnStart", - "gridGap", - "gridRow", - "gridRowEnd", - "gridRowGap", - "gridRowStart", - "gridTemplate", - "gridTemplateAreas", - "gridTemplateColumns", - "gridTemplateRows", - "gripSpace", - "group", - "groups", - "groupCollapsed", - "groupEnd", - "groupId", - "hadRecentInput", - "hand", - "handedness", - "hapticActuators", - "hardwareConcurrency", - "has", - "hasAttribute", - "hasAttributeNS", - "hasAttributes", - "hasBeenActive", - "hasChildNodes", - "hasComposition", - "hasDynamicOffset", - "hasEnrolledInstrument", - "hasExtension", - "hasExternalDisplay", - "hasFeature", - "hasFocus", - "hasInstance", - "hasLayout", - "hasOrientation", - "hasOwnProperty", - "hasPointerCapture", - "hasPosition", - "hasReading", - "hasStorageAccess", - "hash", - "head", - "headers", - "heading", - "height", - "hidden", - "hide", - "hideFocus", - "high", - "highWaterMark", - "hint", - "hints", - "history", - "honorificPrefix", - "honorificSuffix", - "horizontalOverflow", - "host", - "hostCandidate", - "hostname", - "href", - "hrefTranslate", - "hreflang", - "hspace", - "html5TagCheckInerface", - "htmlFor", - "htmlText", - "httpEquiv", - "httpRequestStatusCode", - "hwTimestamp", - "hyphens", - "hypot", - "iccId", - "iceConnectionState", - "iceGatheringState", - "iceTransport", - "icon", - "iconURL", - "id", - "identifier", - "identity", - "idpLoginUrl", - "ignoreBOM", - "ignoreCase", - "ignoreDepthValues", - "image-orientation", - "image-rendering", - "imageHeight", - "imageOrientation", - "imageRendering", - "imageSizes", - "imageSmoothingEnabled", - "imageSmoothingQuality", - "imageSrcset", - "imageWidth", - "images", - "ime-mode", - "imeMode", - "implementation", - "importExternalTexture", - "importKey", - "importNode", - "importStylesheet", - "imports", - "impp", - "imul", - "in", - "in1", - "in2", - "inBandMetadataTrackDispatchType", - "inRange", - "includes", - "incremental", - "indeterminate", - "index", - "indexNames", - "indexOf", - "indexedDB", - "indicate", - "indices", - "inert", - "inertiaDestinationX", - "inertiaDestinationY", - "info", - "init", - "initAnimationEvent", - "initBeforeLoadEvent", - "initClipboardEvent", - "initCloseEvent", - "initCommandEvent", - "initCompositionEvent", - "initCustomEvent", - "initData", - "initDataType", - "initDeviceMotionEvent", - "initDeviceOrientationEvent", - "initDragEvent", - "initErrorEvent", - "initEvent", - "initFocusEvent", - "initGestureEvent", - "initHashChangeEvent", - "initKeyEvent", - "initKeyboardEvent", - "initMSManipulationEvent", - "initMessageEvent", - "initMouseEvent", - "initMouseScrollEvent", - "initMouseWheelEvent", - "initMutationEvent", - "initNSMouseEvent", - "initOverflowEvent", - "initPageEvent", - "initPageTransitionEvent", - "initPointerEvent", - "initPopStateEvent", - "initProgressEvent", - "initScrollAreaEvent", - "initSimpleGestureEvent", - "initStorageEvent", - "initTextEvent", - "initTimeEvent", - "initTouchEvent", - "initTransitionEvent", - "initUIEvent", - "initWebKitAnimationEvent", - "initWebKitTransitionEvent", - "initWebKitWheelEvent", - "initWheelEvent", - "initialTime", - "initialize", - "initiatorType", - "inline-size", - "inlineSize", - "inlineVerticalFieldOfView", - "inner", - "innerHTML", - "innerHeight", - "innerText", - "innerWidth", - "input", - "inputBuffer", - "inputEncoding", - "inputMethod", - "inputMode", - "inputSource", - "inputSources", - "inputType", - "inputs", - "insertAdjacentElement", - "insertAdjacentHTML", - "insertAdjacentText", - "insertBefore", - "insertCell", - "insertDTMF", - "insertData", - "insertDebugMarker", - "insertItemBefore", - "insertNode", - "insertRow", - "insertRule", - "inset", - "inset-block", - "inset-block-end", - "inset-block-start", - "inset-inline", - "inset-inline-end", - "inset-inline-start", - "insetBlock", - "insetBlockEnd", - "insetBlockStart", - "insetInline", - "insetInlineEnd", - "insetInlineStart", - "installing", - "instanceRoot", - "instantiate", - "instantiateStreaming", - "instruments", - "int16", - "int32", - "int8", - "integrity", - "interactionMode", - "intercept", - "interfaceClass", - "interfaceName", - "interfaceNumber", - "interfaceProtocol", - "interfaceSubclass", - "interfaces", - "interimResults", - "internalSubset", - "interpretation", - "intersectionRatio", - "intersectionRect", - "intersectsNode", - "interval", - "invalidIteratorState", - "invalidateFramebuffer", - "invalidateSubFramebuffer", - "inverse", - "invertSelf", - "is", - "is2D", - "isActive", - "isAlternate", - "isArray", - "isBingCurrentSearchDefault", - "isBuffer", - "isCandidateWindowVisible", - "isChar", - "isCollapsed", - "isComposing", - "isConcatSpreadable", - "isConnected", - "isContentEditable", - "isContentHandlerRegistered", - "isContextLost", - "isDefaultNamespace", - "isDirectory", - "isDisabled", - "isEnabled", - "isEqual", - "isEqualNode", - "isExtensible", - "isExternalCTAP2SecurityKeySupported", - "isFallbackAdapter", - "isFile", - "isFinite", - "isFramebuffer", - "isFrozen", - "isGenerator", - "isHTML", - "isHistoryNavigation", - "isId", - "isIdentity", - "isInjected", - "isInteger", - "isIntersecting", - "isLockFree", - "isMap", - "isMultiLine", - "isNaN", - "isOpen", - "isPointInFill", - "isPointInPath", - "isPointInRange", - "isPointInStroke", - "isPrefAlternate", - "isPresenting", - "isPrimary", - "isProgram", - "isPropertyImplicit", - "isProtocolHandlerRegistered", - "isPrototypeOf", - "isQuery", - "isRenderbuffer", - "isSafeInteger", - "isSameNode", - "isSampler", - "isScript", - "isScriptURL", - "isSealed", - "isSecureContext", - "isSessionSupported", - "isShader", - "isSupported", - "isSync", - "isTextEdit", - "isTexture", - "isTransformFeedback", - "isTrusted", - "isTypeSupported", - "isUserVerifyingPlatformAuthenticatorAvailable", - "isVertexArray", - "isView", - "isVisible", - "isochronousTransferIn", - "isochronousTransferOut", - "isolation", - "italics", - "item", - "itemId", - "itemProp", - "itemRef", - "itemScope", - "itemType", - "itemValue", - "items", - "iterateNext", - "iterationComposite", - "iterator", - "javaEnabled", - "jobTitle", - "join", - "json", - "justify-content", - "justify-items", - "justify-self", - "justifyContent", - "justifyItems", - "justifySelf", - "k1", - "k2", - "k3", - "k4", - "kHz", - "keepalive", - "kernelMatrix", - "kernelUnitLengthX", - "kernelUnitLengthY", - "kerning", - "key", - "keyCode", - "keyFor", - "keyIdentifier", - "keyLightEnabled", - "keyLocation", - "keyPath", - "keyStatuses", - "keySystem", - "keyText", - "keyUsage", - "keyboard", - "keys", - "keytype", - "kind", - "knee", - "label", - "labels", - "lang", - "language", - "languages", - "largeArcFlag", - "lastChild", - "lastElementChild", - "lastEventId", - "lastIndex", - "lastIndexOf", - "lastInputTime", - "lastMatch", - "lastMessageSubject", - "lastMessageType", - "lastModified", - "lastModifiedDate", - "lastPage", - "lastParen", - "lastState", - "lastStyleSheetSet", - "latitude", - "layerX", - "layerY", - "layout", - "layoutFlow", - "layoutGrid", - "layoutGridChar", - "layoutGridLine", - "layoutGridMode", - "layoutGridType", - "lbound", - "left", - "leftContext", - "leftDegrees", - "leftMargin", - "leftProjectionMatrix", - "leftViewMatrix", - "length", - "lengthAdjust", - "lengthComputable", - "letter-spacing", - "letterSpacing", - "level", - "lighting-color", - "lightingColor", - "limitingConeAngle", - "limits", - "line", - "line-break", - "line-height", - "lineAlign", - "lineBreak", - "lineCap", - "lineDashOffset", - "lineHeight", - "lineJoin", - "lineNum", - "lineNumber", - "linePos", - "lineTo", - "lineWidth", - "linearAcceleration", - "linearRampToValueAtTime", - "linearVelocity", - "lineno", - "lines", - "link", - "linkColor", - "linkProgram", - "links", - "list", - "list-style", - "list-style-image", - "list-style-position", - "list-style-type", - "listStyle", - "listStyleImage", - "listStylePosition", - "listStyleType", - "listener", - "load", - "loadEventEnd", - "loadEventStart", - "loadOp", - "loadTime", - "loadTimes", - "loaded", - "loading", - "localDescription", - "localName", - "localService", - "localStorage", - "locale", - "localeCompare", - "location", - "locationbar", - "lock", - "locked", - "lockedFile", - "locks", - "lodMaxClamp", - "lodMinClamp", - "log", - "log10", - "log1p", - "log2", - "logicalXDPI", - "logicalYDPI", - "longDesc", - "longitude", - "lookupNamespaceURI", - "lookupPrefix", - "loop", - "loopEnd", - "loopStart", - "looping", - "lost", - "low", - "lower", - "lowerBound", - "lowerOpen", - "lowsrc", - "m11", - "m12", - "m13", - "m14", - "m21", - "m22", - "m23", - "m24", - "m31", - "m32", - "m33", - "m34", - "m41", - "m42", - "m43", - "m44", - "magFilter", - "makeXRCompatible", - "manifest", - "manufacturer", - "manufacturerName", - "map", - "mapAsync", - "mapState", - "mappedAtCreation", - "mapping", - "margin", - "margin-block", - "margin-block-end", - "margin-block-start", - "margin-bottom", - "margin-inline", - "margin-inline-end", - "margin-inline-start", - "margin-left", - "margin-right", - "margin-top", - "marginBlock", - "marginBlockEnd", - "marginBlockStart", - "marginBottom", - "marginHeight", - "marginInline", - "marginInlineEnd", - "marginInlineStart", - "marginLeft", - "marginRight", - "marginTop", - "marginWidth", - "mark", - "marker", - "marker-end", - "marker-mid", - "marker-offset", - "marker-start", - "markerEnd", - "markerHeight", - "markerMid", - "markerOffset", - "markerStart", - "markerUnits", - "markerWidth", - "marks", - "mask", - "mask-clip", - "mask-composite", - "mask-image", - "mask-mode", - "mask-origin", - "mask-position", - "mask-position-x", - "mask-position-y", - "mask-repeat", - "mask-size", - "mask-type", - "maskClip", - "maskComposite", - "maskContentUnits", - "maskImage", - "maskMode", - "maskOrigin", - "maskPosition", - "maskPositionX", - "maskPositionY", - "maskRepeat", - "maskSize", - "maskType", - "maskUnits", - "match", - "matchAll", - "matchMedia", - "matchMedium", - "matches", - "matrix", - "matrixTransform", - "max", - "max-block-size", - "max-height", - "max-inline-size", - "max-width", - "maxActions", - "maxAlternatives", - "maxAnisotropy", - "maxBindGroups", - "maxBindGroupsPlusVertexBuffers", - "maxBindingsPerBindGroup", - "maxBlockSize", - "maxBufferSize", - "maxChannelCount", - "maxChannels", - "maxColorAttachmentBytesPerSample", - "maxColorAttachments", - "maxComputeInvocationsPerWorkgroup", - "maxComputeWorkgroupSizeX", - "maxComputeWorkgroupSizeY", - "maxComputeWorkgroupSizeZ", - "maxComputeWorkgroupStorageSize", - "maxComputeWorkgroupsPerDimension", - "maxConnectionsPerServer", - "maxDecibels", - "maxDistance", - "maxDrawCount", - "maxDynamicStorageBuffersPerPipelineLayout", - "maxDynamicUniformBuffersPerPipelineLayout", - "maxHeight", - "maxInlineSize", - "maxInterStageShaderComponents", - "maxInterStageShaderVariables", - "maxLayers", - "maxLength", - "maxMessageSize", - "maxPacketLifeTime", - "maxRetransmits", - "maxSampledTexturesPerShaderStage", - "maxSamplersPerShaderStage", - "maxStorageBufferBindingSize", - "maxStorageBuffersPerShaderStage", - "maxStorageTexturesPerShaderStage", - "maxTextureArrayLayers", - "maxTextureDimension1D", - "maxTextureDimension2D", - "maxTextureDimension3D", - "maxTouchPoints", - "maxUniformBufferBindingSize", - "maxUniformBuffersPerShaderStage", - "maxValue", - "maxVertexAttributes", - "maxVertexBufferArrayStride", - "maxVertexBuffers", - "maxWidth", - "measure", - "measureText", - "media", - "mediaCapabilities", - "mediaDevices", - "mediaElement", - "mediaGroup", - "mediaKeys", - "mediaSession", - "mediaStream", - "mediaText", - "meetOrSlice", - "memory", - "menubar", - "mergeAttributes", - "message", - "messageClass", - "messageHandlers", - "messageType", - "messages", - "metaKey", - "metadata", - "method", - "methodDetails", - "methodName", - "mid", - "mimeType", - "mimeTypes", - "min", - "min-block-size", - "min-height", - "min-inline-size", - "min-width", - "minBindingSize", - "minBlockSize", - "minDecibels", - "minFilter", - "minHeight", - "minInlineSize", - "minLength", - "minStorageBufferOffsetAlignment", - "minUniformBufferOffsetAlignment", - "minValue", - "minWidth", - "mipLevel", - "mipLevelCount", - "mipmapFilter", - "miterLimit", - "mix-blend-mode", - "mixBlendMode", - "mm", - "mobile", - "mode", - "model", - "modify", - "module", - "mount", - "move", - "moveBy", - "moveEnd", - "moveFirst", - "moveFocusDown", - "moveFocusLeft", - "moveFocusRight", - "moveFocusUp", - "moveNext", - "moveRow", - "moveStart", - "moveTo", - "moveToBookmark", - "moveToElementText", - "moveToPoint", - "movementX", - "movementY", - "mozAdd", - "mozAnimationStartTime", - "mozAnon", - "mozApps", - "mozAudioCaptured", - "mozAudioChannelType", - "mozAutoplayEnabled", - "mozCancelAnimationFrame", - "mozCancelFullScreen", - "mozCancelRequestAnimationFrame", - "mozCaptureStream", - "mozCaptureStreamUntilEnded", - "mozClearDataAt", - "mozContact", - "mozContacts", - "mozCreateFileHandle", - "mozCurrentTransform", - "mozCurrentTransformInverse", - "mozCursor", - "mozDash", - "mozDashOffset", - "mozDecodedFrames", - "mozExitPointerLock", - "mozFillRule", - "mozFragmentEnd", - "mozFrameDelay", - "mozFullScreen", - "mozFullScreenElement", - "mozFullScreenEnabled", - "mozGetAll", - "mozGetAllKeys", - "mozGetAsFile", - "mozGetDataAt", - "mozGetMetadata", - "mozGetUserMedia", - "mozHasAudio", - "mozHasItem", - "mozHidden", - "mozImageSmoothingEnabled", - "mozIndexedDB", - "mozInnerScreenX", - "mozInnerScreenY", - "mozInputSource", - "mozIsTextField", - "mozItem", - "mozItemCount", - "mozItems", - "mozLength", - "mozLockOrientation", - "mozMatchesSelector", - "mozMovementX", - "mozMovementY", - "mozOpaque", - "mozOrientation", - "mozPaintCount", - "mozPaintedFrames", - "mozParsedFrames", - "mozPay", - "mozPointerLockElement", - "mozPresentedFrames", - "mozPreservesPitch", - "mozPressure", - "mozPrintCallback", - "mozRTCIceCandidate", - "mozRTCPeerConnection", - "mozRTCSessionDescription", - "mozRemove", - "mozRequestAnimationFrame", - "mozRequestFullScreen", - "mozRequestPointerLock", - "mozSetDataAt", - "mozSetImageElement", - "mozSourceNode", - "mozSrcObject", - "mozSystem", - "mozTCPSocket", - "mozTextStyle", - "mozTypesAt", - "mozUnlockOrientation", - "mozUserCancelled", - "mozVisibilityState", - "ms", - "msAnimation", - "msAnimationDelay", - "msAnimationDirection", - "msAnimationDuration", - "msAnimationFillMode", - "msAnimationIterationCount", - "msAnimationName", - "msAnimationPlayState", - "msAnimationStartTime", - "msAnimationTimingFunction", - "msBackfaceVisibility", - "msBlockProgression", - "msCSSOMElementFloatMetrics", - "msCaching", - "msCachingEnabled", - "msCancelRequestAnimationFrame", - "msCapsLockWarningOff", - "msClearImmediate", - "msClose", - "msContentZoomChaining", - "msContentZoomFactor", - "msContentZoomLimit", - "msContentZoomLimitMax", - "msContentZoomLimitMin", - "msContentZoomSnap", - "msContentZoomSnapPoints", - "msContentZoomSnapType", - "msContentZooming", - "msConvertURL", - "msCrypto", - "msDoNotTrack", - "msElementsFromPoint", - "msElementsFromRect", - "msExitFullscreen", - "msExtendedCode", - "msFillRule", - "msFirstPaint", - "msFlex", - "msFlexAlign", - "msFlexDirection", - "msFlexFlow", - "msFlexItemAlign", - "msFlexLinePack", - "msFlexNegative", - "msFlexOrder", - "msFlexPack", - "msFlexPositive", - "msFlexPreferredSize", - "msFlexWrap", - "msFlowFrom", - "msFlowInto", - "msFontFeatureSettings", - "msFullscreenElement", - "msFullscreenEnabled", - "msGetInputContext", - "msGetRegionContent", - "msGetUntransformedBounds", - "msGraphicsTrustStatus", - "msGridColumn", - "msGridColumnAlign", - "msGridColumnSpan", - "msGridColumns", - "msGridRow", - "msGridRowAlign", - "msGridRowSpan", - "msGridRows", - "msHidden", - "msHighContrastAdjust", - "msHyphenateLimitChars", - "msHyphenateLimitLines", - "msHyphenateLimitZone", - "msHyphens", - "msImageSmoothingEnabled", - "msImeAlign", - "msIndexedDB", - "msInterpolationMode", - "msIsStaticHTML", - "msKeySystem", - "msKeys", - "msLaunchUri", - "msLockOrientation", - "msManipulationViewsEnabled", - "msMatchMedia", - "msMatchesSelector", - "msMaxTouchPoints", - "msOrientation", - "msOverflowStyle", - "msPerspective", - "msPerspectiveOrigin", - "msPlayToDisabled", - "msPlayToPreferredSourceUri", - "msPlayToPrimary", - "msPointerEnabled", - "msRegionOverflow", - "msReleasePointerCapture", - "msRequestAnimationFrame", - "msRequestFullscreen", - "msSaveBlob", - "msSaveOrOpenBlob", - "msScrollChaining", - "msScrollLimit", - "msScrollLimitXMax", - "msScrollLimitXMin", - "msScrollLimitYMax", - "msScrollLimitYMin", - "msScrollRails", - "msScrollSnapPointsX", - "msScrollSnapPointsY", - "msScrollSnapType", - "msScrollSnapX", - "msScrollSnapY", - "msScrollTranslation", - "msSetImmediate", - "msSetMediaKeys", - "msSetPointerCapture", - "msTextCombineHorizontal", - "msTextSizeAdjust", - "msToBlob", - "msTouchAction", - "msTouchSelect", - "msTraceAsyncCallbackCompleted", - "msTraceAsyncCallbackStarting", - "msTraceAsyncOperationCompleted", - "msTraceAsyncOperationStarting", - "msTransform", - "msTransformOrigin", - "msTransformStyle", - "msTransition", - "msTransitionDelay", - "msTransitionDuration", - "msTransitionProperty", - "msTransitionTimingFunction", - "msUnlockOrientation", - "msUpdateAsyncCallbackRelation", - "msUserSelect", - "msVisibilityState", - "msWrapFlow", - "msWrapMargin", - "msWrapThrough", - "msWriteProfilerMark", - "msZoom", - "msZoomTo", - "mt", - "mul", - "multiEntry", - "multiSelectionObj", - "multiline", - "multiple", - "multiply", - "multiplySelf", - "multisample", - "multisampled", - "mutableFile", - "muted", - "n", - "name", - "nameProp", - "namedItem", - "namedRecordset", - "names", - "namespaceURI", - "namespaces", - "naturalHeight", - "naturalWidth", - "navigate", - "navigation", - "navigationMode", - "navigationPreload", - "navigationStart", - "navigator", - "near", - "nearestViewportElement", - "negative", - "negotiated", - "netscape", - "networkState", - "newScale", - "newTranslate", - "newURL", - "newValue", - "newValueSpecifiedUnits", - "newVersion", - "newhome", - "next", - "nextElementSibling", - "nextHopProtocol", - "nextNode", - "nextPage", - "nextSibling", - "nickname", - "noHref", - "noModule", - "noResize", - "noShade", - "noValidate", - "noWrap", - "node", - "nodeName", - "nodeType", - "nodeValue", - "nonce", - "normalize", - "normalizedPathSegList", - "notationName", - "notations", - "note", - "noteGrainOn", - "noteOff", - "noteOn", - "notify", - "now", - "numOctaves", - "number", - "numberOfChannels", - "numberOfInputs", - "numberOfItems", - "numberOfOutputs", - "numberValue", - "oMatchesSelector", - "object", - "object-fit", - "object-position", - "objectFit", - "objectPosition", - "objectStore", - "objectStoreNames", - "objectType", - "observe", - "occlusionQuerySet", - "of", - "offscreenBuffering", - "offset", - "offset-anchor", - "offset-distance", - "offset-path", - "offset-rotate", - "offsetAnchor", - "offsetDistance", - "offsetHeight", - "offsetLeft", - "offsetNode", - "offsetParent", - "offsetPath", - "offsetRotate", - "offsetTop", - "offsetWidth", - "offsetX", - "offsetY", - "ok", - "oldURL", - "oldValue", - "oldVersion", - "olderShadowRoot", - "onLine", - "onSubmittedWorkDone", - "onabort", - "onabsolutedeviceorientation", - "onactivate", - "onactive", - "onaddsourcebuffer", - "onaddstream", - "onaddtrack", - "onafterprint", - "onafterscriptexecute", - "onafterupdate", - "onanimationcancel", - "onanimationend", - "onanimationiteration", - "onanimationstart", - "onappinstalled", - "onaudioend", - "onaudioprocess", - "onaudiostart", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onbeforeactivate", - "onbeforecopy", - "onbeforecut", - "onbeforedeactivate", - "onbeforeeditfocus", - "onbeforeinstallprompt", - "onbeforepaste", - "onbeforeprint", - "onbeforescriptexecute", - "onbeforeunload", - "onbeforeupdate", - "onbeforexrselect", - "onbegin", - "onblocked", - "onblur", - "onbounce", - "onboundary", - "onbufferedamountlow", - "oncached", - "oncancel", - "oncandidatewindowhide", - "oncandidatewindowshow", - "oncandidatewindowupdate", - "oncanplay", - "oncanplaythrough", - "once", - "oncellchange", - "onchange", - "oncharacteristicvaluechanged", - "onchargingchange", - "onchargingtimechange", - "onchecking", - "onclick", - "onclose", - "onclosing", - "oncompassneedscalibration", - "oncomplete", - "onconnect", - "onconnecting", - "onconnectionavailable", - "onconnectionstatechange", - "oncontextmenu", - "oncontrollerchange", - "oncontrolselect", - "oncopy", - "oncuechange", - "oncut", - "ondataavailable", - "ondatachannel", - "ondatasetchanged", - "ondatasetcomplete", - "ondblclick", - "ondeactivate", - "ondevicechange", - "ondevicelight", - "ondevicemotion", - "ondeviceorientation", - "ondeviceorientationabsolute", - "ondeviceproximity", - "ondischargingtimechange", - "ondisconnect", - "ondisplay", - "ondownloading", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onencrypted", - "onend", - "onended", - "onenter", - "onenterpictureinpicture", - "onerror", - "onerrorupdate", - "onexit", - "onfilterchange", - "onfinish", - "onfocus", - "onfocusin", - "onfocusout", - "onformdata", - "onfreeze", - "onfullscreenchange", - "onfullscreenerror", - "ongatheringstatechange", - "ongattserverdisconnected", - "ongesturechange", - "ongestureend", - "ongesturestart", - "ongotpointercapture", - "onhashchange", - "onhelp", - "onicecandidate", - "onicecandidateerror", - "oniceconnectionstatechange", - "onicegatheringstatechange", - "oninactive", - "oninput", - "oninputsourceschange", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeystatuseschange", - "onkeyup", - "onlanguagechange", - "onlayoutcomplete", - "onleavepictureinpicture", - "onlevelchange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloading", - "onloadingdone", - "onloadingerror", - "onloadstart", - "onlosecapture", - "onlostpointercapture", - "only", - "onmark", - "onmessage", - "onmessageerror", - "onmidimessage", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onmove", - "onmoveend", - "onmovestart", - "onmozfullscreenchange", - "onmozfullscreenerror", - "onmozorientationchange", - "onmozpointerlockchange", - "onmozpointerlockerror", - "onmscontentzoom", - "onmsfullscreenchange", - "onmsfullscreenerror", - "onmsgesturechange", - "onmsgesturedoubletap", - "onmsgestureend", - "onmsgesturehold", - "onmsgesturestart", - "onmsgesturetap", - "onmsgotpointercapture", - "onmsinertiastart", - "onmslostpointercapture", - "onmsmanipulationstatechanged", - "onmsneedkey", - "onmsorientationchange", - "onmspointercancel", - "onmspointerdown", - "onmspointerenter", - "onmspointerhover", - "onmspointerleave", - "onmspointermove", - "onmspointerout", - "onmspointerover", - "onmspointerup", - "onmssitemodejumplistitemremoved", - "onmsthumbnailclick", - "onmute", - "onnegotiationneeded", - "onnomatch", - "onnoupdate", - "onobsolete", - "onoffline", - "ononline", - "onopen", - "onorientationchange", - "onpagechange", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onpayerdetailchange", - "onpaymentmethodchange", - "onplay", - "onplaying", - "onpluginstreamstart", - "onpointercancel", - "onpointerdown", - "onpointerenter", - "onpointerleave", - "onpointerlockchange", - "onpointerlockerror", - "onpointermove", - "onpointerout", - "onpointerover", - "onpointerrawupdate", - "onpointerup", - "onpopstate", - "onprocessorerror", - "onprogress", - "onpropertychange", - "onratechange", - "onreading", - "onreadystatechange", - "onrejectionhandled", - "onrelease", - "onremove", - "onremovesourcebuffer", - "onremovestream", - "onremovetrack", - "onrepeat", - "onreset", - "onresize", - "onresizeend", - "onresizestart", - "onresourcetimingbufferfull", - "onresult", - "onresume", - "onrowenter", - "onrowexit", - "onrowsdelete", - "onrowsinserted", - "onscroll", - "onsearch", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onselectedcandidatepairchange", - "onselectend", - "onselectionchange", - "onselectstart", - "onshippingaddresschange", - "onshippingoptionchange", - "onshow", - "onsignalingstatechange", - "onsoundend", - "onsoundstart", - "onsourceclose", - "onsourceclosed", - "onsourceended", - "onsourceopen", - "onspeechend", - "onspeechstart", - "onsqueeze", - "onsqueezeend", - "onsqueezestart", - "onstalled", - "onstart", - "onstatechange", - "onstop", - "onstorage", - "onstoragecommit", - "onsubmit", - "onsuccess", - "onsuspend", - "onterminate", - "ontextinput", - "ontimeout", - "ontimeupdate", - "ontoggle", - "ontonechange", - "ontouchcancel", - "ontouchend", - "ontouchmove", - "ontouchstart", - "ontrack", - "ontransitioncancel", - "ontransitionend", - "ontransitionrun", - "ontransitionstart", - "onuncapturederror", - "onunhandledrejection", - "onunload", - "onunmute", - "onupdate", - "onupdateend", - "onupdatefound", - "onupdateready", - "onupdatestart", - "onupgradeneeded", - "onuserproximity", - "onversionchange", - "onvisibilitychange", - "onvoiceschanged", - "onvolumechange", - "onvrdisplayactivate", - "onvrdisplayconnect", - "onvrdisplaydeactivate", - "onvrdisplaydisconnect", - "onvrdisplaypresentchange", - "onwaiting", - "onwaitingforkey", - "onwarning", - "onwebkitanimationend", - "onwebkitanimationiteration", - "onwebkitanimationstart", - "onwebkitcurrentplaybacktargetiswirelesschanged", - "onwebkitfullscreenchange", - "onwebkitfullscreenerror", - "onwebkitkeyadded", - "onwebkitkeyerror", - "onwebkitkeymessage", - "onwebkitneedkey", - "onwebkitorientationchange", - "onwebkitplaybacktargetavailabilitychanged", - "onwebkitpointerlockchange", - "onwebkitpointerlockerror", - "onwebkitresourcetimingbufferfull", - "onwebkittransitionend", - "onwheel", - "onzoom", - "opacity", - "open", - "openCursor", - "openDatabase", - "openKeyCursor", - "opened", - "opener", - "opera", - "operation", - "operationType", - "operator", - "opr", - "optimum", - "options", - "or", - "order", - "orderX", - "orderY", - "ordered", - "org", - "organization", - "orient", - "orientAngle", - "orientType", - "orientation", - "orientationX", - "orientationY", - "orientationZ", - "origin", - "originalPolicy", - "originalTarget", - "orphans", - "oscpu", - "outerHTML", - "outerHeight", - "outerText", - "outerWidth", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "outlineColor", - "outlineOffset", - "outlineStyle", - "outlineWidth", - "outputBuffer", - "outputChannelCount", - "outputLatency", - "outputs", - "overflow", - "overflow-anchor", - "overflow-block", - "overflow-inline", - "overflow-wrap", - "overflow-x", - "overflow-y", - "overflowAnchor", - "overflowBlock", - "overflowInline", - "overflowWrap", - "overflowX", - "overflowY", - "overrideMimeType", - "oversample", - "overscroll-behavior", - "overscroll-behavior-block", - "overscroll-behavior-inline", - "overscroll-behavior-x", - "overscroll-behavior-y", - "overscrollBehavior", - "overscrollBehaviorBlock", - "overscrollBehaviorInline", - "overscrollBehaviorX", - "overscrollBehaviorY", - "ownKeys", - "ownerDocument", - "ownerElement", - "ownerNode", - "ownerRule", - "ownerSVGElement", - "owningElement", - "p1", - "p2", - "p3", - "p4", - "packetSize", - "packets", - "pad", - "padEnd", - "padStart", - "padding", - "padding-block", - "padding-block-end", - "padding-block-start", - "padding-bottom", - "padding-inline", - "padding-inline-end", - "padding-inline-start", - "padding-left", - "padding-right", - "padding-top", - "paddingBlock", - "paddingBlockEnd", - "paddingBlockStart", - "paddingBottom", - "paddingInline", - "paddingInlineEnd", - "paddingInlineStart", - "paddingLeft", - "paddingRight", - "paddingTop", - "page", - "page-break-after", - "page-break-before", - "page-break-inside", - "pageBreakAfter", - "pageBreakBefore", - "pageBreakInside", - "pageCount", - "pageLeft", - "pageTop", - "pageX", - "pageXOffset", - "pageY", - "pageYOffset", - "pages", - "paint-order", - "paintOrder", - "paintRequests", - "paintType", - "paintWorklet", - "palette", - "pan", - "panningModel", - "parameterData", - "parameters", - "parent", - "parentElement", - "parentNode", - "parentRule", - "parentStyleSheet", - "parentTextEdit", - "parentWindow", - "parse", - "parseAll", - "parseFloat", - "parseFromString", - "parseInt", - "part", - "participants", - "passOp", - "passive", - "password", - "pasteHTML", - "path", - "pathLength", - "pathSegList", - "pathSegType", - "pathSegTypeAsLetter", - "pathname", - "pattern", - "patternContentUnits", - "patternMismatch", - "patternTransform", - "patternUnits", - "pause", - "pauseAnimations", - "pauseOnExit", - "pauseProfilers", - "pauseTransformFeedback", - "paused", - "payerEmail", - "payerName", - "payerPhone", - "paymentManager", - "pc", - "peerIdentity", - "pending", - "pendingLocalDescription", - "pendingRemoteDescription", - "percent", - "performance", - "periodicSync", - "permission", - "permissionState", - "permissions", - "persist", - "persisted", - "personalbar", - "perspective", - "perspective-origin", - "perspectiveOrigin", - "phone", - "phoneticFamilyName", - "phoneticGivenName", - "photo", - "pictureInPictureElement", - "pictureInPictureEnabled", - "pictureInPictureWindow", - "ping", - "pipeThrough", - "pipeTo", - "pitch", - "pixelBottom", - "pixelDepth", - "pixelHeight", - "pixelLeft", - "pixelRight", - "pixelStorei", - "pixelTop", - "pixelUnitToMillimeterX", - "pixelUnitToMillimeterY", - "pixelWidth", - "place-content", - "place-items", - "place-self", - "placeContent", - "placeItems", - "placeSelf", - "placeholder", - "platform", - "platformVersion", - "platforms", - "play", - "playEffect", - "playState", - "playbackRate", - "playbackState", - "playbackTime", - "played", - "playoutDelayHint", - "playsInline", - "plugins", - "pluginspage", - "pname", - "pointer-events", - "pointerBeforeReferenceNode", - "pointerEnabled", - "pointerEvents", - "pointerId", - "pointerLockElement", - "pointerType", - "points", - "pointsAtX", - "pointsAtY", - "pointsAtZ", - "polygonOffset", - "pop", - "popDebugGroup", - "popErrorScope", - "populateMatrix", - "popupWindowFeatures", - "popupWindowName", - "popupWindowURI", - "port", - "port1", - "port2", - "ports", - "posBottom", - "posHeight", - "posLeft", - "posRight", - "posTop", - "posWidth", - "pose", - "position", - "positionAlign", - "positionX", - "positionY", - "positionZ", - "postError", - "postMessage", - "postalCode", - "poster", - "pow", - "powerEfficient", - "powerOff", - "powerPreference", - "preMultiplySelf", - "precision", - "preferredStyleSheetSet", - "preferredStylesheetSet", - "prefix", - "preload", - "premultipliedAlpha", - "prepend", - "presentation", - "preserveAlpha", - "preserveAspectRatio", - "preserveAspectRatioString", - "pressed", - "pressure", - "prevValue", - "preventDefault", - "preventExtensions", - "preventSilentAccess", - "previousElementSibling", - "previousNode", - "previousPage", - "previousRect", - "previousScale", - "previousSibling", - "previousTranslate", - "primaryKey", - "primitive", - "primitiveType", - "primitiveUnits", - "principals", - "print", - "priority", - "privateKey", - "probablySupportsContext", - "process", - "processIceMessage", - "processingEnd", - "processingStart", - "processorOptions", - "product", - "productId", - "productName", - "productSub", - "profile", - "profileEnd", - "profiles", - "projectionMatrix", - "promise", - "prompt", - "properties", - "propertyIsEnumerable", - "propertyName", - "protocol", - "protocolLong", - "prototype", - "provider", - "pseudoClass", - "pseudoElement", - "pt", - "publicId", - "publicKey", - "published", - "pulse", - "push", - "pushDebugGroup", - "pushErrorScope", - "pushManager", - "pushNotification", - "pushState", - "put", - "putImageData", - "px", - "quadraticCurveTo", - "qualifier", - "quaternion", - "query", - "queryCommandEnabled", - "queryCommandIndeterm", - "queryCommandState", - "queryCommandSupported", - "queryCommandText", - "queryCommandValue", - "querySelector", - "querySelectorAll", - "querySet", - "queue", - "queueMicrotask", - "quote", - "quotes", - "r", - "r1", - "r2", - "race", - "rad", - "radiogroup", - "radiusX", - "radiusY", - "random", - "range", - "rangeCount", - "rangeMax", - "rangeMin", - "rangeOffset", - "rangeOverflow", - "rangeParent", - "rangeUnderflow", - "rate", - "ratio", - "raw", - "rawId", - "read", - "readAsArrayBuffer", - "readAsBinaryString", - "readAsBlob", - "readAsDataURL", - "readAsText", - "readBuffer", - "readEntries", - "readOnly", - "readPixels", - "readReportRequested", - "readText", - "readValue", - "readable", - "ready", - "readyState", - "reason", - "reboot", - "receivedAlert", - "receiver", - "receivers", - "recipient", - "reconnect", - "recordNumber", - "recordsAvailable", - "recordset", - "rect", - "red", - "redEyeReduction", - "redirect", - "redirectCount", - "redirectEnd", - "redirectStart", - "redirected", - "reduce", - "reduceRight", - "reduction", - "refDistance", - "refX", - "refY", - "referenceNode", - "referenceSpace", - "referrer", - "referrerPolicy", - "refresh", - "region", - "regionAnchorX", - "regionAnchorY", - "regionId", - "regions", - "register", - "registerContentHandler", - "registerElement", - "registerProperty", - "registerProtocolHandler", - "reject", - "rel", - "relList", - "relatedAddress", - "relatedNode", - "relatedPort", - "relatedTarget", - "release", - "releaseCapture", - "releaseEvents", - "releaseInterface", - "releaseLock", - "releasePointerCapture", - "releaseShaderCompiler", - "reliable", - "reliableWrite", - "reload", - "rem", - "remainingSpace", - "remote", - "remoteDescription", - "remove", - "removeAllRanges", - "removeAttribute", - "removeAttributeNS", - "removeAttributeNode", - "removeBehavior", - "removeChild", - "removeCue", - "removeEventListener", - "removeFilter", - "removeImport", - "removeItem", - "removeListener", - "removeNamedItem", - "removeNamedItemNS", - "removeNode", - "removeParameter", - "removeProperty", - "removeRange", - "removeRegion", - "removeRule", - "removeSiteSpecificTrackingException", - "removeSourceBuffer", - "removeStream", - "removeTrack", - "removeVariable", - "removeWakeLockListener", - "removeWebWideTrackingException", - "removed", - "removedNodes", - "renderHeight", - "renderState", - "renderTime", - "renderWidth", - "renderbufferStorage", - "renderbufferStorageMultisample", - "renderedBuffer", - "renderingMode", - "renotify", - "repeat", - "replace", - "replaceAdjacentText", - "replaceAll", - "replaceChild", - "replaceChildren", - "replaceData", - "replaceId", - "replaceItem", - "replaceNode", - "replaceState", - "replaceSync", - "replaceTrack", - "replaceWholeText", - "replaceWith", - "reportValidity", - "request", - "requestAdapter", - "requestAdapterInfo", - "requestAnimationFrame", - "requestAutocomplete", - "requestData", - "requestDevice", - "requestFrame", - "requestFullscreen", - "requestHitTestSource", - "requestHitTestSourceForTransientInput", - "requestId", - "requestIdleCallback", - "requestMIDIAccess", - "requestMediaKeySystemAccess", - "requestPermission", - "requestPictureInPicture", - "requestPointerLock", - "requestPresent", - "requestReferenceSpace", - "requestSession", - "requestStart", - "requestStorageAccess", - "requestSubmit", - "requestVideoFrameCallback", - "requestingWindow", - "requireInteraction", - "required", - "requiredExtensions", - "requiredFeatures", - "requiredLimits", - "reset", - "resetPose", - "resetTransform", - "resize", - "resizeBy", - "resizeTo", - "resolve", - "resolveQuerySet", - "resolveTarget", - "resource", - "response", - "responseBody", - "responseEnd", - "responseReady", - "responseStart", - "responseText", - "responseType", - "responseURL", - "responseXML", - "restartIce", - "restore", - "result", - "resultIndex", - "resultType", - "results", - "resume", - "resumeProfilers", - "resumeTransformFeedback", - "retry", - "returnValue", - "rev", - "reverse", - "reversed", - "revocable", - "revokeObjectURL", - "rgbColor", - "right", - "rightContext", - "rightDegrees", - "rightMargin", - "rightProjectionMatrix", - "rightViewMatrix", - "role", - "rolloffFactor", - "root", - "rootBounds", - "rootElement", - "rootMargin", - "rotate", - "rotateAxisAngle", - "rotateAxisAngleSelf", - "rotateFromVector", - "rotateFromVectorSelf", - "rotateSelf", - "rotation", - "rotationAngle", - "rotationRate", - "round", - "roundRect", - "row-gap", - "rowGap", - "rowIndex", - "rowSpan", - "rows", - "rowsPerImage", - "rtcpTransport", - "rtt", - "ruby-align", - "ruby-position", - "rubyAlign", - "rubyOverhang", - "rubyPosition", - "rules", - "runtime", - "runtimeStyle", - "rx", - "ry", - "s", - "safari", - "sample", - "sampleCount", - "sampleCoverage", - "sampleRate", - "sampleType", - "sampler", - "samplerParameterf", - "samplerParameteri", - "sandbox", - "save", - "saveData", - "scale", - "scale3d", - "scale3dSelf", - "scaleNonUniform", - "scaleNonUniformSelf", - "scaleSelf", - "scheme", - "scissor", - "scope", - "scopeName", - "scoped", - "screen", - "screenBrightness", - "screenEnabled", - "screenLeft", - "screenPixelToMillimeterX", - "screenPixelToMillimeterY", - "screenTop", - "screenX", - "screenY", - "scriptURL", - "scripts", - "scroll", - "scroll-behavior", - "scroll-margin", - "scroll-margin-block", - "scroll-margin-block-end", - "scroll-margin-block-start", - "scroll-margin-bottom", - "scroll-margin-inline", - "scroll-margin-inline-end", - "scroll-margin-inline-start", - "scroll-margin-left", - "scroll-margin-right", - "scroll-margin-top", - "scroll-padding", - "scroll-padding-block", - "scroll-padding-block-end", - "scroll-padding-block-start", - "scroll-padding-bottom", - "scroll-padding-inline", - "scroll-padding-inline-end", - "scroll-padding-inline-start", - "scroll-padding-left", - "scroll-padding-right", - "scroll-padding-top", - "scroll-snap-align", - "scroll-snap-type", - "scrollAmount", - "scrollBehavior", - "scrollBy", - "scrollByLines", - "scrollByPages", - "scrollDelay", - "scrollHeight", - "scrollIntoView", - "scrollIntoViewIfNeeded", - "scrollLeft", - "scrollLeftMax", - "scrollMargin", - "scrollMarginBlock", - "scrollMarginBlockEnd", - "scrollMarginBlockStart", - "scrollMarginBottom", - "scrollMarginInline", - "scrollMarginInlineEnd", - "scrollMarginInlineStart", - "scrollMarginLeft", - "scrollMarginRight", - "scrollMarginTop", - "scrollMaxX", - "scrollMaxY", - "scrollPadding", - "scrollPaddingBlock", - "scrollPaddingBlockEnd", - "scrollPaddingBlockStart", - "scrollPaddingBottom", - "scrollPaddingInline", - "scrollPaddingInlineEnd", - "scrollPaddingInlineStart", - "scrollPaddingLeft", - "scrollPaddingRight", - "scrollPaddingTop", - "scrollRestoration", - "scrollSnapAlign", - "scrollSnapType", - "scrollTo", - "scrollTop", - "scrollTopMax", - "scrollWidth", - "scrollX", - "scrollY", - "scrollbar-color", - "scrollbar-width", - "scrollbar3dLightColor", - "scrollbarArrowColor", - "scrollbarBaseColor", - "scrollbarColor", - "scrollbarDarkShadowColor", - "scrollbarFaceColor", - "scrollbarHighlightColor", - "scrollbarShadowColor", - "scrollbarTrackColor", - "scrollbarWidth", - "scrollbars", - "scrolling", - "scrollingElement", - "sctp", - "sctpCauseCode", - "sdp", - "sdpLineNumber", - "sdpMLineIndex", - "sdpMid", - "seal", - "search", - "searchBox", - "searchBoxJavaBridge_", - "searchParams", - "sectionRowIndex", - "secureConnectionStart", - "security", - "seed", - "seekToNextFrame", - "seekable", - "seeking", - "select", - "selectAllChildren", - "selectAlternateInterface", - "selectConfiguration", - "selectNode", - "selectNodeContents", - "selectNodes", - "selectSingleNode", - "selectSubString", - "selected", - "selectedIndex", - "selectedOptions", - "selectedStyleSheetSet", - "selectedStylesheetSet", - "selection", - "selectionDirection", - "selectionEnd", - "selectionStart", - "selector", - "selectorText", - "self", - "send", - "sendAsBinary", - "sendBeacon", - "sender", - "sentAlert", - "sentTimestamp", - "separator", - "serialNumber", - "serializeToString", - "serverTiming", - "service", - "serviceWorker", - "session", - "sessionId", - "sessionStorage", - "set", - "setActionHandler", - "setActive", - "setAlpha", - "setAppBadge", - "setAttribute", - "setAttributeNS", - "setAttributeNode", - "setAttributeNodeNS", - "setBaseAndExtent", - "setBigInt64", - "setBigUint64", - "setBindGroup", - "setBingCurrentSearchDefault", - "setBlendConstant", - "setCapture", - "setCodecPreferences", - "setColor", - "setCompositeOperation", - "setConfiguration", - "setCurrentTime", - "setCustomValidity", - "setData", - "setDate", - "setDragImage", - "setEnd", - "setEndAfter", - "setEndBefore", - "setEndPoint", - "setFillColor", - "setFilterRes", - "setFloat32", - "setFloat64", - "setFloatValue", - "setFormValue", - "setFullYear", - "setHeaderValue", - "setHours", - "setIdentityProvider", - "setImmediate", - "setIndexBuffer", - "setInt16", - "setInt32", - "setInt8", - "setInterval", - "setItem", - "setKeyframes", - "setLineCap", - "setLineDash", - "setLineJoin", - "setLineWidth", - "setLiveSeekableRange", - "setLocalDescription", - "setMatrix", - "setMatrixValue", - "setMediaKeys", - "setMilliseconds", - "setMinutes", - "setMiterLimit", - "setMonth", - "setNamedItem", - "setNamedItemNS", - "setNonUserCodeExceptions", - "setOrientToAngle", - "setOrientToAuto", - "setOrientation", - "setOverrideHistoryNavigationMode", - "setPaint", - "setParameter", - "setParameters", - "setPeriodicWave", - "setPipeline", - "setPointerCapture", - "setPosition", - "setPositionState", - "setPreference", - "setProperty", - "setPrototypeOf", - "setRGBColor", - "setRGBColorICCColor", - "setRadius", - "setRangeText", - "setRemoteDescription", - "setRequestHeader", - "setResizable", - "setResourceTimingBufferSize", - "setRotate", - "setScale", - "setScissorRect", - "setSeconds", - "setSelectionRange", - "setServerCertificate", - "setShadow", - "setSinkId", - "setSkewX", - "setSkewY", - "setStart", - "setStartAfter", - "setStartBefore", - "setStdDeviation", - "setStencilReference", - "setStreams", - "setStringValue", - "setStrokeColor", - "setSuggestResult", - "setTargetAtTime", - "setTargetValueAtTime", - "setTime", - "setTimeout", - "setTransform", - "setTranslate", - "setUTCDate", - "setUTCFullYear", - "setUTCHours", - "setUTCMilliseconds", - "setUTCMinutes", - "setUTCMonth", - "setUTCSeconds", - "setUint16", - "setUint32", - "setUint8", - "setUri", - "setValidity", - "setValueAtTime", - "setValueCurveAtTime", - "setVariable", - "setVelocity", - "setVersion", - "setVertexBuffer", - "setViewport", - "setYear", - "settingName", - "settingValue", - "sex", - "shaderLocation", - "shaderSource", - "shadowBlur", - "shadowColor", - "shadowOffsetX", - "shadowOffsetY", - "shadowRoot", - "shape", - "shape-image-threshold", - "shape-margin", - "shape-outside", - "shape-rendering", - "shapeImageThreshold", - "shapeMargin", - "shapeOutside", - "shapeRendering", - "sheet", - "shift", - "shiftKey", - "shiftLeft", - "shippingAddress", - "shippingOption", - "shippingType", - "show", - "showHelp", - "showModal", - "showModalDialog", - "showModelessDialog", - "showNotification", - "sidebar", - "sign", - "signal", - "signalingState", - "signature", - "silent", - "sin", - "singleNodeValue", - "sinh", - "sinkId", - "sittingToStandingTransform", - "size", - "sizeToContent", - "sizeX", - "sizeZ", - "sizes", - "skewX", - "skewXSelf", - "skewY", - "skewYSelf", - "slice", - "slope", - "slot", - "small", - "smil", - "smooth", - "smoothingTimeConstant", - "snapToLines", - "snapshotItem", - "snapshotLength", - "some", - "sort", - "sortingCode", - "source", - "sourceBuffer", - "sourceBuffers", - "sourceCapabilities", - "sourceFile", - "sourceIndex", - "sourceMap", - "sources", - "spacing", - "span", - "speak", - "speakAs", - "speaking", - "species", - "specified", - "specularConstant", - "specularExponent", - "speechSynthesis", - "speed", - "speedOfSound", - "spellcheck", - "splice", - "split", - "splitText", - "spreadMethod", - "sqrt", - "src", - "srcElement", - "srcFactor", - "srcFilter", - "srcObject", - "srcUrn", - "srcdoc", - "srclang", - "srcset", - "stack", - "stackTraceLimit", - "stacktrace", - "stageParameters", - "standalone", - "standby", - "start", - "startContainer", - "startIce", - "startMessages", - "startNotifications", - "startOffset", - "startProfiling", - "startRendering", - "startShark", - "startTime", - "startsWith", - "state", - "status", - "statusCode", - "statusMessage", - "statusText", - "statusbar", - "stdDeviationX", - "stdDeviationY", - "stencilBack", - "stencilClearValue", - "stencilFront", - "stencilFunc", - "stencilFuncSeparate", - "stencilLoadOp", - "stencilMask", - "stencilMaskSeparate", - "stencilOp", - "stencilOpSeparate", - "stencilReadMask", - "stencilReadOnly", - "stencilStoreOp", - "stencilWriteMask", - "step", - "stepDown", - "stepMismatch", - "stepMode", - "stepUp", - "sticky", - "stitchTiles", - "stop", - "stop-color", - "stop-opacity", - "stopColor", - "stopImmediatePropagation", - "stopNotifications", - "stopOpacity", - "stopProfiling", - "stopPropagation", - "stopShark", - "stopped", - "storage", - "storageArea", - "storageName", - "storageStatus", - "storageTexture", - "store", - "storeOp", - "storeSiteSpecificTrackingException", - "storeWebWideTrackingException", - "stpVersion", - "stream", - "streams", - "stretch", - "strike", - "string", - "stringValue", - "stringify", - "stripIndexFormat", - "stroke", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "strokeDasharray", - "strokeDashoffset", - "strokeLinecap", - "strokeLinejoin", - "strokeMiterlimit", - "strokeOpacity", - "strokeRect", - "strokeStyle", - "strokeText", - "strokeWidth", - "style", - "styleFloat", - "styleMap", - "styleMedia", - "styleSheet", - "styleSheetSets", - "styleSheets", - "sub", - "subarray", - "subject", - "submit", - "submitFrame", - "submitter", - "subscribe", - "substr", - "substring", - "substringData", - "subtle", - "subtree", - "suffix", - "suffixes", - "summary", - "sup", - "supported", - "supportedContentEncodings", - "supportedEntryTypes", - "supports", - "supportsSession", - "surfaceScale", - "surroundContents", - "suspend", - "suspendRedraw", - "swapCache", - "swapNode", - "sweepFlag", - "symbols", - "sync", - "sysexEnabled", - "system", - "systemCode", - "systemId", - "systemLanguage", - "systemXDPI", - "systemYDPI", - "tBodies", - "tFoot", - "tHead", - "tabIndex", - "table", - "table-layout", - "tableLayout", - "tableValues", - "tag", - "tagName", - "tagUrn", - "tags", - "taintEnabled", - "takePhoto", - "takeRecords", - "tan", - "tangentialPressure", - "tanh", - "target", - "targetElement", - "targetRayMode", - "targetRaySpace", - "targetTouches", - "targetX", - "targetY", - "targets", - "tcpType", - "tee", - "tel", - "terminate", - "test", - "texImage2D", - "texImage3D", - "texParameterf", - "texParameteri", - "texStorage2D", - "texStorage3D", - "texSubImage2D", - "texSubImage3D", - "text", - "text-align", - "text-align-last", - "text-anchor", - "text-combine-upright", - "text-decoration", - "text-decoration-color", - "text-decoration-line", - "text-decoration-skip-ink", - "text-decoration-style", - "text-decoration-thickness", - "text-emphasis", - "text-emphasis-color", - "text-emphasis-position", - "text-emphasis-style", - "text-indent", - "text-justify", - "text-orientation", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "text-underline-offset", - "text-underline-position", - "textAlign", - "textAlignLast", - "textAnchor", - "textAutospace", - "textBaseline", - "textCombineUpright", - "textContent", - "textDecoration", - "textDecorationBlink", - "textDecorationColor", - "textDecorationLine", - "textDecorationLineThrough", - "textDecorationNone", - "textDecorationOverline", - "textDecorationSkipInk", - "textDecorationStyle", - "textDecorationThickness", - "textDecorationUnderline", - "textEmphasis", - "textEmphasisColor", - "textEmphasisPosition", - "textEmphasisStyle", - "textIndent", - "textJustify", - "textJustifyTrim", - "textKashida", - "textKashidaSpace", - "textLength", - "textOrientation", - "textOverflow", - "textRendering", - "textShadow", - "textTracks", - "textTransform", - "textUnderlineOffset", - "textUnderlinePosition", - "texture", - "then", - "threadId", - "threshold", - "thresholds", - "tiltX", - "tiltY", - "time", - "timeEnd", - "timeLog", - "timeOrigin", - "timeRemaining", - "timeStamp", - "timecode", - "timeline", - "timelineTime", - "timeout", - "timestamp", - "timestampOffset", - "timestampWrites", - "timing", - "title", - "to", - "toArray", - "toBlob", - "toDataURL", - "toDateString", - "toElement", - "toExponential", - "toFixed", - "toFloat32Array", - "toFloat64Array", - "toGMTString", - "toISOString", - "toJSON", - "toLocaleDateString", - "toLocaleFormat", - "toLocaleLowerCase", - "toLocaleString", - "toLocaleTimeString", - "toLocaleUpperCase", - "toLowerCase", - "toMatrix", - "toMethod", - "toPrecision", - "toPrimitive", - "toSdp", - "toSource", - "toStaticHTML", - "toString", - "toStringTag", - "toSum", - "toTimeString", - "toUTCString", - "toUpperCase", - "toggle", - "toggleAttribute", - "toggleLongPressEnabled", - "tone", - "toneBuffer", - "tooLong", - "tooShort", - "toolbar", - "top", - "topMargin", - "topology", - "total", - "totalFrameDelay", - "totalVideoFrames", - "touch-action", - "touchAction", - "touched", - "touches", - "trace", - "track", - "trackVisibility", - "transaction", - "transactions", - "transceiver", - "transferControlToOffscreen", - "transferFromImageBitmap", - "transferImageBitmap", - "transferIn", - "transferOut", - "transferSize", - "transferToImageBitmap", - "transform", - "transform-box", - "transform-origin", - "transform-style", - "transformBox", - "transformFeedbackVaryings", - "transformOrigin", - "transformPoint", - "transformString", - "transformStyle", - "transformToDocument", - "transformToFragment", - "transition", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "transitionDelay", - "transitionDuration", - "transitionProperty", - "transitionTimingFunction", - "translate", - "translateSelf", - "translationX", - "translationY", - "transport", - "trim", - "trimEnd", - "trimLeft", - "trimRight", - "trimStart", - "trueSpeed", - "trunc", - "truncate", - "trustedTypes", - "turn", - "twist", - "type", - "typeDetail", - "typeMismatch", - "typeMustMatch", - "types", - "u2f", - "ubound", - "uint16", - "uint32", - "uint8", - "uint8Clamped", - "unclippedDepth", - "unconfigure", - "undefined", - "unescape", - "uneval", - "unicode", - "unicode-bidi", - "unicodeBidi", - "unicodeRange", - "uniform1f", - "uniform1fv", - "uniform1i", - "uniform1iv", - "uniform1ui", - "uniform1uiv", - "uniform2f", - "uniform2fv", - "uniform2i", - "uniform2iv", - "uniform2ui", - "uniform2uiv", - "uniform3f", - "uniform3fv", - "uniform3i", - "uniform3iv", - "uniform3ui", - "uniform3uiv", - "uniform4f", - "uniform4fv", - "uniform4i", - "uniform4iv", - "uniform4ui", - "uniform4uiv", - "uniformBlockBinding", - "uniformMatrix2fv", - "uniformMatrix2x3fv", - "uniformMatrix2x4fv", - "uniformMatrix3fv", - "uniformMatrix3x2fv", - "uniformMatrix3x4fv", - "uniformMatrix4fv", - "uniformMatrix4x2fv", - "uniformMatrix4x3fv", - "unique", - "uniqueID", - "uniqueNumber", - "unit", - "unitType", - "units", - "unloadEventEnd", - "unloadEventStart", - "unlock", - "unmap", - "unmount", - "unobserve", - "unpause", - "unpauseAnimations", - "unreadCount", - "unregister", - "unregisterContentHandler", - "unregisterProtocolHandler", - "unscopables", - "unselectable", - "unshift", - "unsubscribe", - "unsuspendRedraw", - "unsuspendRedrawAll", - "unwatch", - "unwrapKey", - "upDegrees", - "upX", - "upY", - "upZ", - "update", - "updateCommands", - "updateIce", - "updateInterval", - "updatePlaybackRate", - "updateRenderState", - "updateSettings", - "updateTiming", - "updateViaCache", - "updateWith", - "updated", - "updating", - "upgrade", - "upload", - "uploadTotal", - "uploaded", - "upper", - "upperBound", - "upperOpen", - "uri", - "url", - "urn", - "urns", - "usage", - "usages", - "usb", - "usbVersionMajor", - "usbVersionMinor", - "usbVersionSubminor", - "useCurrentView", - "useMap", - "useProgram", - "usedSpace", - "user-select", - "userActivation", - "userAgent", - "userAgentData", - "userChoice", - "userHandle", - "userHint", - "userLanguage", - "userSelect", - "userVisibleOnly", - "username", - "usernameFragment", - "utterance", - "uuid", - "v8BreakIterator", - "vAlign", - "vLink", - "valid", - "validate", - "validateProgram", - "validationMessage", - "validity", - "value", - "valueAsDate", - "valueAsNumber", - "valueAsString", - "valueInSpecifiedUnits", - "valueMissing", - "valueOf", - "valueText", - "valueType", - "values", - "variable", - "variant", - "variationSettings", - "vector-effect", - "vectorEffect", - "velocityAngular", - "velocityExpansion", - "velocityX", - "velocityY", - "vendor", - "vendorId", - "vendorSub", - "verify", - "version", - "vertex", - "vertexAttrib1f", - "vertexAttrib1fv", - "vertexAttrib2f", - "vertexAttrib2fv", - "vertexAttrib3f", - "vertexAttrib3fv", - "vertexAttrib4f", - "vertexAttrib4fv", - "vertexAttribDivisor", - "vertexAttribDivisorANGLE", - "vertexAttribI4i", - "vertexAttribI4iv", - "vertexAttribI4ui", - "vertexAttribI4uiv", - "vertexAttribIPointer", - "vertexAttribPointer", - "vertical", - "vertical-align", - "verticalAlign", - "verticalOverflow", - "vh", - "vibrate", - "vibrationActuator", - "videoBitsPerSecond", - "videoHeight", - "videoTracks", - "videoWidth", - "view", - "viewBox", - "viewBoxString", - "viewDimension", - "viewFormats", - "viewTarget", - "viewTargetString", - "viewport", - "viewportAnchorX", - "viewportAnchorY", - "viewportElement", - "views", - "violatedDirective", - "visibility", - "visibilityState", - "visible", - "visualViewport", - "vlinkColor", - "vmax", - "vmin", - "voice", - "voiceURI", - "volume", - "vrml", - "vspace", - "vw", - "w", - "wait", - "waitSync", - "waiting", - "wake", - "wakeLock", - "wand", - "warn", - "wasClean", - "wasDiscarded", - "watch", - "watchAvailability", - "watchPosition", - "webdriver", - "webkitAddKey", - "webkitAlignContent", - "webkitAlignItems", - "webkitAlignSelf", - "webkitAnimation", - "webkitAnimationDelay", - "webkitAnimationDirection", - "webkitAnimationDuration", - "webkitAnimationFillMode", - "webkitAnimationIterationCount", - "webkitAnimationName", - "webkitAnimationPlayState", - "webkitAnimationTimingFunction", - "webkitAppearance", - "webkitAudioContext", - "webkitAudioDecodedByteCount", - "webkitAudioPannerNode", - "webkitBackfaceVisibility", - "webkitBackground", - "webkitBackgroundAttachment", - "webkitBackgroundClip", - "webkitBackgroundColor", - "webkitBackgroundImage", - "webkitBackgroundOrigin", - "webkitBackgroundPosition", - "webkitBackgroundPositionX", - "webkitBackgroundPositionY", - "webkitBackgroundRepeat", - "webkitBackgroundSize", - "webkitBackingStorePixelRatio", - "webkitBorderBottomLeftRadius", - "webkitBorderBottomRightRadius", - "webkitBorderImage", - "webkitBorderImageOutset", - "webkitBorderImageRepeat", - "webkitBorderImageSlice", - "webkitBorderImageSource", - "webkitBorderImageWidth", - "webkitBorderRadius", - "webkitBorderTopLeftRadius", - "webkitBorderTopRightRadius", - "webkitBoxAlign", - "webkitBoxDirection", - "webkitBoxFlex", - "webkitBoxOrdinalGroup", - "webkitBoxOrient", - "webkitBoxPack", - "webkitBoxShadow", - "webkitBoxSizing", - "webkitCancelAnimationFrame", - "webkitCancelFullScreen", - "webkitCancelKeyRequest", - "webkitCancelRequestAnimationFrame", - "webkitClearResourceTimings", - "webkitClosedCaptionsVisible", - "webkitConvertPointFromNodeToPage", - "webkitConvertPointFromPageToNode", - "webkitCreateShadowRoot", - "webkitCurrentFullScreenElement", - "webkitCurrentPlaybackTargetIsWireless", - "webkitDecodedFrameCount", - "webkitDirectionInvertedFromDevice", - "webkitDisplayingFullscreen", - "webkitDroppedFrameCount", - "webkitEnterFullScreen", - "webkitEnterFullscreen", - "webkitEntries", - "webkitExitFullScreen", - "webkitExitFullscreen", - "webkitExitPointerLock", - "webkitFilter", - "webkitFlex", - "webkitFlexBasis", - "webkitFlexDirection", - "webkitFlexFlow", - "webkitFlexGrow", - "webkitFlexShrink", - "webkitFlexWrap", - "webkitFullScreenKeyboardInputAllowed", - "webkitFullscreenElement", - "webkitFullscreenEnabled", - "webkitGenerateKeyRequest", - "webkitGetAsEntry", - "webkitGetDatabaseNames", - "webkitGetEntries", - "webkitGetEntriesByName", - "webkitGetEntriesByType", - "webkitGetFlowByName", - "webkitGetGamepads", - "webkitGetImageDataHD", - "webkitGetNamedFlows", - "webkitGetRegionFlowRanges", - "webkitGetUserMedia", - "webkitHasClosedCaptions", - "webkitHidden", - "webkitIDBCursor", - "webkitIDBDatabase", - "webkitIDBDatabaseError", - "webkitIDBDatabaseException", - "webkitIDBFactory", - "webkitIDBIndex", - "webkitIDBKeyRange", - "webkitIDBObjectStore", - "webkitIDBRequest", - "webkitIDBTransaction", - "webkitImageSmoothingEnabled", - "webkitIndexedDB", - "webkitInitMessageEvent", - "webkitIsFullScreen", - "webkitJustifyContent", - "webkitKeys", - "webkitLineClamp", - "webkitLineDashOffset", - "webkitLockOrientation", - "webkitMask", - "webkitMaskClip", - "webkitMaskComposite", - "webkitMaskImage", - "webkitMaskOrigin", - "webkitMaskPosition", - "webkitMaskPositionX", - "webkitMaskPositionY", - "webkitMaskRepeat", - "webkitMaskSize", - "webkitMatchesSelector", - "webkitMediaStream", - "webkitNotifications", - "webkitOfflineAudioContext", - "webkitOrder", - "webkitOrientation", - "webkitPeerConnection00", - "webkitPersistentStorage", - "webkitPerspective", - "webkitPerspectiveOrigin", - "webkitPointerLockElement", - "webkitPostMessage", - "webkitPreservesPitch", - "webkitPutImageDataHD", - "webkitRTCPeerConnection", - "webkitRegionOverset", - "webkitRelativePath", - "webkitRequestAnimationFrame", - "webkitRequestFileSystem", - "webkitRequestFullScreen", - "webkitRequestFullscreen", - "webkitRequestPointerLock", - "webkitResolveLocalFileSystemURL", - "webkitSetMediaKeys", - "webkitSetResourceTimingBufferSize", - "webkitShadowRoot", - "webkitShowPlaybackTargetPicker", - "webkitSlice", - "webkitSpeechGrammar", - "webkitSpeechGrammarList", - "webkitSpeechRecognition", - "webkitSpeechRecognitionError", - "webkitSpeechRecognitionEvent", - "webkitStorageInfo", - "webkitSupportsFullscreen", - "webkitTemporaryStorage", - "webkitTextFillColor", - "webkitTextSizeAdjust", - "webkitTextStroke", - "webkitTextStrokeColor", - "webkitTextStrokeWidth", - "webkitTransform", - "webkitTransformOrigin", - "webkitTransformStyle", - "webkitTransition", - "webkitTransitionDelay", - "webkitTransitionDuration", - "webkitTransitionProperty", - "webkitTransitionTimingFunction", - "webkitURL", - "webkitUnlockOrientation", - "webkitUserSelect", - "webkitVideoDecodedByteCount", - "webkitVisibilityState", - "webkitWirelessVideoPlaybackDisabled", - "webkitdirectory", - "webkitdropzone", - "webstore", - "weight", - "wgslLanguageFeatures", - "whatToShow", - "wheelDelta", - "wheelDeltaX", - "wheelDeltaY", - "whenDefined", - "which", - "white-space", - "whiteSpace", - "wholeText", - "widows", - "width", - "will-change", - "willChange", - "willValidate", - "window", - "withCredentials", - "word-break", - "word-spacing", - "word-wrap", - "wordBreak", - "wordSpacing", - "wordWrap", - "workerStart", - "wow64", - "wrap", - "wrapKey", - "writable", - "writableAuxiliaries", - "write", - "writeBuffer", - "writeMask", - "writeText", - "writeTexture", - "writeTimestamp", - "writeValue", - "writeWithoutResponse", - "writeln", - "writing-mode", - "writingMode", - "x", - "x1", - "x2", - "xChannelSelector", - "xmlEncoding", - "xmlStandalone", - "xmlVersion", - "xmlbase", - "xmllang", - "xmlspace", - "xor", - "xr", - "y", - "y1", - "y2", - "yChannelSelector", - "yandex", - "z", - "z-index", - "zIndex", - "zoom", - "zoomAndPan", - "zoomRectScreen", -]; - -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -function find_builtins(reserved) { - domprops.forEach(add); - - // Compatibility fix for some standard defined globals not defined on every js environment - var new_globals = ["Symbol", "Map", "Promise", "Proxy", "Reflect", "Set", "WeakMap", "WeakSet"]; - var objects = {}; - var global_ref = typeof global === "object" ? global : self; - - new_globals.forEach(function (new_global) { - objects[new_global] = global_ref[new_global] || function() {}; - }); - - [ - "null", - "true", - "false", - "NaN", - "Infinity", - "-Infinity", - "undefined", - ].forEach(add); - [ Object, Array, Function, Number, - String, Boolean, Error, Math, - Date, RegExp, objects.Symbol, ArrayBuffer, - DataView, decodeURI, decodeURIComponent, - encodeURI, encodeURIComponent, eval, EvalError, - Float32Array, Float64Array, Int8Array, Int16Array, - Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat, - parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError, - objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array, - Uint8ClampedArray, Uint16Array, Uint32Array, URIError, - objects.WeakMap, objects.WeakSet - ].forEach(function(ctor) { - Object.getOwnPropertyNames(ctor).map(add); - if (ctor.prototype) { - Object.getOwnPropertyNames(ctor.prototype).map(add); - } - }); - function add(name) { - reserved.add(name); - } -} - -function reserve_quoted_keys(ast, reserved) { - function add(name) { - push_uniq(reserved, name); - } - - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_ObjectKeyVal && node.quote) { - add(node.key); - } else if (node instanceof AST_ObjectProperty && node.quote) { - add(node.key.name); - } else if (node instanceof AST_Sub) { - addStrings(node.property, add); - } - })); -} - -function addStrings(node, add) { - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_Sequence) { - addStrings(node.tail_node(), add); - } else if (node instanceof AST_String) { - add(node.value); - } else if (node instanceof AST_Conditional) { - addStrings(node.consequent, add); - addStrings(node.alternative, add); - } - return true; - })); -} - -function mangle_private_properties(ast, options) { - var cprivate = -1; - var private_cache = new Map(); - var nth_identifier = options.nth_identifier || base54; - - ast = ast.transform(new TreeTransformer(function(node) { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_PrivateIn - ) { - node.key.name = mangle_private(node.key.name); - } else if (node instanceof AST_DotHash) { - node.property = mangle_private(node.property); - } - })); - return ast; - - function mangle_private(name) { - let mangled = private_cache.get(name); - if (!mangled) { - mangled = nth_identifier.get(++cprivate); - private_cache.set(name, mangled); - } - - return mangled; - } -} - -function find_annotated_props(ast) { - var annotated_props = new Set(); - walk(ast, node => { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_DotHash - ) ; else if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string" && has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - if (has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.key.name); - } - } else if (node instanceof AST_Dot) { - if (has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.property); - } - } else if (node instanceof AST_Sub) { - if (node.property instanceof AST_String && has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.property.value); - } - } - }); - return annotated_props; -} - -function mangle_properties(ast, options, annotated_props = find_annotated_props(ast)) { - options = defaults(options, { - builtins: false, - cache: null, - debug: false, - keep_quoted: false, - nth_identifier: base54, - only_cache: false, - regex: null, - reserved: null, - undeclared: false, - only_annotated: false, - }, true); - - var nth_identifier = options.nth_identifier; - - var reserved_option = options.reserved; - if (!Array.isArray(reserved_option)) reserved_option = [reserved_option]; - var reserved = new Set(reserved_option); - if (!options.builtins) find_builtins(reserved); - - var cname = -1; - - var cache; - if (options.cache) { - cache = options.cache.props; - } else { - cache = new Map(); - } - - var only_annotated = options.only_annotated; - var regex = options.regex && new RegExp(options.regex); - - // note debug is either false (disabled), or a string of the debug suffix to use (enabled). - // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true' - // the same as passing an empty string. - var debug = options.debug !== false; - var debug_name_suffix; - if (debug) { - debug_name_suffix = (options.debug === true ? "" : options.debug); - } - - var names_to_mangle = new Set(); - var unmangleable = new Set(); - // Track each already-mangled name to prevent nth_identifier from generating - // the same name. - cache.forEach((mangled_name) => unmangleable.add(mangled_name)); - - var keep_quoted = !!options.keep_quoted; - - // step 1: find candidates to mangle - ast.walk(new TreeWalker(function(node) { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_DotHash - ) ; else if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { - add(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - if (!keep_quoted || !node.quote) { - add(node.key.name); - } - } else if (node instanceof AST_Dot) { - var declared = !!options.undeclared; - if (!declared) { - var root = node; - while (root.expression) { - root = root.expression; - } - declared = !(root.thedef && root.thedef.undeclared); - } - if (declared && - (!keep_quoted || !node.quote)) { - add(node.property); - } - } else if (node instanceof AST_Sub) { - if (!keep_quoted) { - addStrings(node.property, add); - } - } else if (node instanceof AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - addStrings(node.args[1], add); - } else if (node instanceof AST_Binary && node.operator === "in") { - addStrings(node.left, add); - } else if (node instanceof AST_String && has_annotation(node, _KEY)) { - add(node.value); - } - })); - - // step 2: transform the tree, renaming properties - return ast.transform(new TreeTransformer(function(node) { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_DotHash - ) ; else if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { - node.key = mangle(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter, getter, method or class field - if (!keep_quoted || !node.quote) { - node.key.name = mangle(node.key.name); - } - } else if (node instanceof AST_Dot) { - if (!keep_quoted || !node.quote) { - node.property = mangle(node.property); - } - } else if (!keep_quoted && node instanceof AST_Sub) { - node.property = mangleStrings(node.property); - } else if (node instanceof AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - node.args[1] = mangleStrings(node.args[1]); - } else if (node instanceof AST_Binary && node.operator === "in") { - node.left = mangleStrings(node.left); - } else if (node instanceof AST_String && has_annotation(node, _KEY)) { - // Clear _KEY annotation to prevent double mangling - clear_annotation(node, _KEY); - node.value = mangle(node.value); - } - })); - - // only function declarations after this line - - function can_mangle(name) { - if (unmangleable.has(name)) return false; - if (reserved.has(name)) return false; - if (options.only_cache) { - return cache.has(name); - } - if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; - return true; - } - - function should_mangle(name) { - if (only_annotated && !annotated_props.has(name)) return false; - if (regex && !regex.test(name)) { - return annotated_props.has(name); - } - if (reserved.has(name)) return false; - return cache.has(name) - || names_to_mangle.has(name); - } - - function add(name) { - if (can_mangle(name)) { - names_to_mangle.add(name); - } - - if (!should_mangle(name)) { - unmangleable.add(name); - } - } - - function mangle(name) { - if (!should_mangle(name)) { - return name; - } - - var mangled = cache.get(name); - if (!mangled) { - if (debug) { - // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_. - var debug_mangled = "_$" + name + "$" + debug_name_suffix + "_"; - - if (can_mangle(debug_mangled)) { - mangled = debug_mangled; - } - } - - // either debug mode is off, or it is on and we could not use the mangled name - if (!mangled) { - do { - mangled = nth_identifier.get(++cname); - } while (!can_mangle(mangled)); - } - - cache.set(name, mangled); - } - return mangled; - } - - function mangleStrings(node) { - return node.transform(new TreeTransformer(function(node) { - if (node instanceof AST_Sequence) { - var last = node.expressions.length - 1; - node.expressions[last] = mangleStrings(node.expressions[last]); - } else if (node instanceof AST_String) { - // Clear _KEY annotation to prevent double mangling - clear_annotation(node, _KEY); - node.value = mangle(node.value); - } else if (node instanceof AST_Conditional) { - node.consequent = mangleStrings(node.consequent); - node.alternative = mangleStrings(node.alternative); - } - return node; - })); - } -} - -// to/from base64 functions -// Prefer built-in Buffer, if available, then use hack -// https://developer.mozilla.org/en-US/docs/Glossary/Base64#The_Unicode_Problem -var to_ascii = typeof Buffer !== "undefined" - ? (b64) => Buffer.from(b64, "base64").toString() - : (b64) => decodeURIComponent(escape(atob(b64))); -var to_base64 = typeof Buffer !== "undefined" - ? (str) => Buffer.from(str).toString("base64") - : (str) => btoa(unescape(encodeURIComponent(str))); - -function read_source_map(code) { - var match = /(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(code); - if (!match) { - console.warn("inline source map not found"); - return null; - } - return to_ascii(match[2]); -} - -function set_shorthand(name, options, keys) { - if (options[name]) { - keys.forEach(function(key) { - if (options[key]) { - if (typeof options[key] != "object") options[key] = {}; - if (!(name in options[key])) options[key][name] = options[name]; - } - }); - } -} - -function init_cache(cache) { - if (!cache) return; - if (!("props" in cache)) { - cache.props = new Map(); - } else if (!(cache.props instanceof Map)) { - cache.props = map_from_object(cache.props); - } -} - -function cache_to_json(cache) { - return { - props: map_to_object(cache.props) - }; -} - -function log_input(files, options, fs, debug_folder) { - if (!(fs && fs.writeFileSync && fs.mkdirSync)) { - return; - } - - try { - fs.mkdirSync(debug_folder); - } catch (e) { - if (e.code !== "EEXIST") throw e; - } - - const log_path = `${debug_folder}/terser-debug-${(Math.random() * 9999999) | 0}.log`; - - options = options || {}; - - const options_str = JSON.stringify(options, (_key, thing) => { - if (typeof thing === "function") return "[Function " + thing.toString() + "]"; - if (thing instanceof RegExp) return "[RegExp " + thing.toString() + "]"; - return thing; - }, 4); - - const files_str = (file) => { - if (typeof file === "object" && options.parse && options.parse.spidermonkey) { - return JSON.stringify(file, null, 2); - } else if (typeof file === "object") { - return Object.keys(file) - .map((key) => key + ": " + files_str(file[key])) - .join("\n\n"); - } else if (typeof file === "string") { - return "```\n" + file + "\n```"; - } else { - return file; // What do? - } - }; - - fs.writeFileSync(log_path, "Options: \n" + options_str + "\n\nInput files:\n\n" + files_str(files) + "\n"); -} - -function* minify_sync_or_async(files, options, _fs_module) { - if ( - _fs_module - && typeof process === "object" - && process.env - && typeof process.env.TERSER_DEBUG_DIR === "string" - ) { - log_input(files, options, _fs_module, process.env.TERSER_DEBUG_DIR); - } - - options = defaults(options, { - compress: {}, - ecma: undefined, - enclose: false, - ie8: false, - keep_classnames: undefined, - keep_fnames: false, - mangle: {}, - module: false, - nameCache: null, - output: null, - format: null, - parse: {}, - rename: undefined, - safari10: false, - sourceMap: false, - spidermonkey: false, - timings: false, - toplevel: false, - warnings: false, - wrap: false, - }, true); - - var timings = options.timings && { - start: Date.now() - }; - if (options.keep_classnames === undefined) { - options.keep_classnames = options.keep_fnames; - } - if (options.rename === undefined) { - options.rename = options.compress && options.mangle; - } - if (options.output && options.format) { - throw new Error("Please only specify either output or format option, preferrably format."); - } - options.format = options.format || options.output || {}; - set_shorthand("ecma", options, [ "parse", "compress", "format" ]); - set_shorthand("ie8", options, [ "compress", "mangle", "format" ]); - set_shorthand("keep_classnames", options, [ "compress", "mangle" ]); - set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); - set_shorthand("module", options, [ "parse", "compress", "mangle" ]); - set_shorthand("safari10", options, [ "mangle", "format" ]); - set_shorthand("toplevel", options, [ "compress", "mangle" ]); - set_shorthand("warnings", options, [ "compress" ]); // legacy - var quoted_props; - if (options.mangle) { - options.mangle = defaults(options.mangle, { - cache: options.nameCache && (options.nameCache.vars || {}), - eval: false, - ie8: false, - keep_classnames: false, - keep_fnames: false, - module: false, - nth_identifier: base54, - properties: false, - reserved: [], - safari10: false, - toplevel: false, - }, true); - if (options.mangle.properties) { - if (typeof options.mangle.properties != "object") { - options.mangle.properties = {}; - } - if (options.mangle.properties.keep_quoted) { - quoted_props = options.mangle.properties.reserved; - if (!Array.isArray(quoted_props)) quoted_props = []; - options.mangle.properties.reserved = quoted_props; - } - if (options.nameCache && !("cache" in options.mangle.properties)) { - options.mangle.properties.cache = options.nameCache.props || {}; - } - } - init_cache(options.mangle.cache); - init_cache(options.mangle.properties.cache); - } - if (options.sourceMap) { - options.sourceMap = defaults(options.sourceMap, { - asObject: false, - content: null, - filename: null, - includeSources: false, - root: null, - url: null, - }, true); - } - - // -- Parse phase -- - if (timings) timings.parse = Date.now(); - var toplevel; - if (files instanceof AST_Toplevel) { - toplevel = files; - } else { - if (typeof files == "string" || (options.parse.spidermonkey && !Array.isArray(files))) { - files = [ files ]; - } - options.parse = options.parse || {}; - options.parse.toplevel = null; - - if (options.parse.spidermonkey) { - options.parse.toplevel = AST_Node.from_mozilla_ast(Object.keys(files).reduce(function(toplevel, name) { - if (!toplevel) return files[name]; - toplevel.body = toplevel.body.concat(files[name].body); - return toplevel; - }, null)); - } else { - delete options.parse.spidermonkey; - - for (var name in files) if (HOP(files, name)) { - options.parse.filename = name; - options.parse.toplevel = parse(files[name], options.parse); - if (options.sourceMap && options.sourceMap.content == "inline") { - if (Object.keys(files).length > 1) - throw new Error("inline source map only works with singular input"); - options.sourceMap.content = read_source_map(files[name]); - } - } - } - if (options.parse.toplevel === null) { - throw new Error("no source file given"); - } - - toplevel = options.parse.toplevel; - } - if (quoted_props && options.mangle.properties.keep_quoted !== "strict") { - reserve_quoted_keys(toplevel, quoted_props); - } - var annotated_props; - if (options.mangle && options.mangle.properties) { - annotated_props = find_annotated_props(toplevel); - } - if (options.wrap) { - toplevel = toplevel.wrap_commonjs(options.wrap); - } - if (options.enclose) { - toplevel = toplevel.wrap_enclose(options.enclose); - } - if (timings) timings.rename = Date.now(); - - // -- Compress phase -- - if (timings) timings.compress = Date.now(); - if (options.compress) { - toplevel = new Compressor(options.compress, { - mangle_options: options.mangle - }).compress(toplevel); - } - - // -- Mangle phase -- - if (timings) timings.scope = Date.now(); - if (options.mangle) toplevel.figure_out_scope(options.mangle); - if (timings) timings.mangle = Date.now(); - if (options.mangle) { - toplevel.compute_char_frequency(options.mangle); - toplevel.mangle_names(options.mangle); - toplevel = mangle_private_properties(toplevel, options.mangle); - } - if (timings) timings.properties = Date.now(); - if (options.mangle && options.mangle.properties) { - toplevel = mangle_properties(toplevel, options.mangle.properties, annotated_props); - } - - // Format phase - if (timings) timings.format = Date.now(); - var result = {}; - if (options.format.ast) { - result.ast = toplevel; - } - if (options.format.spidermonkey) { - result.ast = toplevel.to_mozilla_ast(); - } - let format_options; - if (!HOP(options.format, "code") || options.format.code) { - // Make a shallow copy so that we can modify without mutating the user's input. - format_options = {...options.format}; - if (!format_options.ast) { - // Destroy stuff to save RAM. (unless the deprecated `ast` option is on) - format_options._destroy_ast = true; - - walk(toplevel, node => { - if (node instanceof AST_Scope) { - node.variables = undefined; - node.enclosed = undefined; - node.parent_scope = undefined; - } - if (node.block_scope) { - node.block_scope.variables = undefined; - node.block_scope.enclosed = undefined; - node.parent_scope = undefined; - } - }); - } - - if (options.sourceMap) { - if (options.sourceMap.includeSources && files instanceof AST_Toplevel) { - throw new Error("original source content unavailable"); - } - format_options.source_map = yield* SourceMap({ - file: options.sourceMap.filename, - orig: options.sourceMap.content, - root: options.sourceMap.root, - files: options.sourceMap.includeSources ? files : null, - }); - } - delete format_options.ast; - delete format_options.code; - delete format_options.spidermonkey; - var stream = OutputStream(format_options); - toplevel.print(stream); - result.code = stream.get(); - if (options.sourceMap) { - Object.defineProperty(result, "map", { - configurable: true, - enumerable: true, - get() { - const map = format_options.source_map.getEncoded(); - return (result.map = options.sourceMap.asObject ? map : JSON.stringify(map)); - }, - set(value) { - Object.defineProperty(result, "map", { - value, - writable: true, - }); - } - }); - result.decoded_map = format_options.source_map.getDecoded(); - if (options.sourceMap.url == "inline") { - var sourceMap = typeof result.map === "object" ? JSON.stringify(result.map) : result.map; - result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(sourceMap); - } else if (options.sourceMap.url) { - result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; - } - } - } - if (options.nameCache && options.mangle) { - if (options.mangle.cache) options.nameCache.vars = cache_to_json(options.mangle.cache); - if (options.mangle.properties && options.mangle.properties.cache) { - options.nameCache.props = cache_to_json(options.mangle.properties.cache); - } - } - if (format_options && format_options.source_map) { - format_options.source_map.destroy(); - } - if (timings) { - timings.end = Date.now(); - result.timings = { - parse: 1e-3 * (timings.rename - timings.parse), - rename: 1e-3 * (timings.compress - timings.rename), - compress: 1e-3 * (timings.scope - timings.compress), - scope: 1e-3 * (timings.mangle - timings.scope), - mangle: 1e-3 * (timings.properties - timings.mangle), - properties: 1e-3 * (timings.format - timings.properties), - format: 1e-3 * (timings.end - timings.format), - total: 1e-3 * (timings.end - timings.start) - }; - } - return result; -} - -async function minify(files, options, _fs_module) { - const gen = minify_sync_or_async(files, options, _fs_module); - - let yielded; - let val; - do { - val = gen.next(await yielded); - yielded = val.value; - } while (!val.done); - - return val.value; -} - -function minify_sync(files, options, _fs_module) { - const gen = minify_sync_or_async(files, options, _fs_module); - - let yielded; - let val; - do { - if (yielded && typeof yielded.then === "function") { - throw new Error("minify_sync cannot be used with the legacy source-map module"); - } - val = gen.next(yielded); - yielded = val.value; - } while (!val.done); - - return val.value; -} - -async function run_cli({ program, packageJson, fs, path }) { - const skip_keys = new Set([ "cname", "parent_scope", "scope", "uses_eval", "uses_with" ]); - var files = {}; - var options = { - compress: false, - mangle: false - }; - const default_options = await _default_options(); - program.version(packageJson.name + " " + packageJson.version); - program.parseArgv = program.parse; - program.parse = undefined; - - if (process.argv.includes("ast")) program.helpInformation = describe_ast; - else if (process.argv.includes("options")) program.helpInformation = function() { - var text = []; - for (var option in default_options) { - text.push("--" + (option === "sourceMap" ? "source-map" : option) + " options:"); - text.push(format_object(default_options[option])); - text.push(""); - } - return text.join("\n"); - }; - - program.option("-p, --parse ", "Specify parser options.", parse_js()); - program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js()); - program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js()); - program.option("--mangle-props [options]", "Mangle properties/specify mangler options.", parse_js()); - program.option("-f, --format [options]", "Format options.", parse_js()); - program.option("-b, --beautify [options]", "Alias for --format.", parse_js()); - program.option("-o, --output ", "Output file (default STDOUT)."); - program.option("--comments [filter]", "Preserve copyright comments in the output."); - program.option("--config-file ", "Read minify() options from JSON file."); - program.option("-d, --define [=value]", "Global definitions.", parse_js("define")); - program.option("--ecma ", "Specify ECMAScript release: 5, 2015, 2016 or 2017..."); - program.option("-e, --enclose [arg[,...][:value[,...]]]", "Embed output in a big function with configurable arguments and values."); - program.option("--ie8", "Support non-standard Internet Explorer 8."); - program.option("--keep-classnames", "Do not mangle/drop class names."); - program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); - program.option("--module", "Input is an ES6 module"); - program.option("--name-cache ", "File to hold mangled name mappings."); - program.option("--rename", "Force symbol expansion."); - program.option("--no-rename", "Disable symbol expansion."); - program.option("--safari10", "Support non-standard Safari 10."); - program.option("--source-map [options]", "Enable source map/specify source map options.", parse_js()); - program.option("--timings", "Display operations run time on STDERR."); - program.option("--toplevel", "Compress and/or mangle variables in toplevel scope."); - program.option("--wrap ", "Embed everything as a function with “exports” corresponding to “name” globally."); - program.arguments("[files...]").parseArgv(process.argv); - if (program.configFile) { - options = JSON.parse(read_file(program.configFile)); - } - if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { - fatal("ERROR: cannot write source map to STDOUT"); - } - - [ - "compress", - "enclose", - "ie8", - "mangle", - "module", - "safari10", - "sourceMap", - "toplevel", - "wrap" - ].forEach(function(name) { - if (name in program) { - options[name] = program[name]; - } - }); - - if ("ecma" in program) { - if (program.ecma != (program.ecma | 0)) fatal("ERROR: ecma must be an integer"); - const ecma = program.ecma | 0; - if (ecma > 5 && ecma < 2015) - options.ecma = ecma + 2009; - else - options.ecma = ecma; - } - if (program.format || program.beautify) { - const chosenOption = program.format || program.beautify; - options.format = typeof chosenOption === "object" ? chosenOption : {}; - } - if (program.comments) { - if (typeof options.format != "object") options.format = {}; - options.format.comments = typeof program.comments == "string" ? (program.comments == "false" ? false : program.comments) : "some"; - } - if (program.define) { - if (typeof options.compress != "object") options.compress = {}; - if (typeof options.compress.global_defs != "object") options.compress.global_defs = {}; - for (var expr in program.define) { - options.compress.global_defs[expr] = program.define[expr]; - } - } - if (program.keepClassnames) { - options.keep_classnames = true; - } - if (program.keepFnames) { - options.keep_fnames = true; - } - if (program.mangleProps) { - if (program.mangleProps.domprops) { - delete program.mangleProps.domprops; - } else { - if (typeof program.mangleProps != "object") program.mangleProps = {}; - if (!Array.isArray(program.mangleProps.reserved)) program.mangleProps.reserved = []; - } - if (typeof options.mangle != "object") options.mangle = {}; - options.mangle.properties = program.mangleProps; - } - if (program.nameCache) { - options.nameCache = JSON.parse(read_file(program.nameCache, "{}")); - } - if (program.output == "ast") { - options.format = { - ast: true, - code: false - }; - } - if (program.parse) { - if (!program.parse.acorn && !program.parse.spidermonkey) { - options.parse = program.parse; - } else if (program.sourceMap && program.sourceMap.content == "inline") { - fatal("ERROR: inline source map only works with built-in parser"); - } - } - if (~program.rawArgs.indexOf("--rename")) { - options.rename = true; - } else if (!program.rename) { - options.rename = false; - } - - let convert_path = name => name; - if (typeof program.sourceMap == "object" && "base" in program.sourceMap) { - convert_path = function() { - var base = program.sourceMap.base; - delete options.sourceMap.base; - return function(name) { - return path.relative(base, name); - }; - }(); - } - - let filesList; - if (options.files && options.files.length) { - filesList = options.files; - - delete options.files; - } else if (program.args.length) { - filesList = program.args; - } - - if (filesList) { - simple_glob(filesList).forEach(function(name) { - files[convert_path(name)] = read_file(name); - }); - } else { - await new Promise((resolve) => { - var chunks = []; - process.stdin.setEncoding("utf8"); - process.stdin.on("data", function(chunk) { - chunks.push(chunk); - }).on("end", function() { - files = [ chunks.join("") ]; - resolve(); - }); - process.stdin.resume(); - }); - } - - await run_cli(); - - function convert_ast(fn) { - return AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null)); - } - - async function run_cli() { - var content = program.sourceMap && program.sourceMap.content; - if (content && content !== "inline") { - options.sourceMap.content = read_file(content, content); - } - if (program.timings) options.timings = true; - - try { - if (program.parse) { - if (program.parse.acorn) { - files = convert_ast(function(toplevel, name) { - return require("acorn").parse(files[name], { - ecmaVersion: 2018, - locations: true, - program: toplevel, - sourceFile: name, - sourceType: options.module || program.parse.module ? "module" : "script" - }); - }); - } else if (program.parse.spidermonkey) { - files = convert_ast(function(toplevel, name) { - var obj = JSON.parse(files[name]); - if (!toplevel) return obj; - toplevel.body = toplevel.body.concat(obj.body); - return toplevel; - }); - } - } - } catch (ex) { - fatal(ex); - } - - let result; - try { - result = await minify(files, options, fs); - } catch (ex) { - if (ex.name == "SyntaxError") { - print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); - var col = ex.col; - var lines = files[ex.filename].split(/\r?\n/); - var line = lines[ex.line - 1]; - if (!line && !col) { - line = lines[ex.line - 2]; - col = line.length; - } - if (line) { - var limit = 70; - if (col > limit) { - line = line.slice(col - limit); - col = limit; - } - print_error(line.slice(0, 80)); - print_error(line.slice(0, col).replace(/\S/g, " ") + "^"); - } - } - if (ex.defs) { - print_error("Supported options:"); - print_error(format_object(ex.defs)); - } - fatal(ex); - return; - } - - if (program.output == "ast") { - if (!options.compress && !options.mangle) { - result.ast.figure_out_scope({}); - } - console.log(JSON.stringify(result.ast, function(key, value) { - if (value) switch (key) { - case "thedef": - return symdef(value); - case "enclosed": - return value.length ? value.map(symdef) : undefined; - case "variables": - case "globals": - return value.size ? collect_from_map(value, symdef) : undefined; - } - if (skip_keys.has(key)) return; - if (value instanceof AST_Token) return; - if (value instanceof Map) return; - if (value instanceof AST_Node) { - var result = { - _class: "AST_" + value.TYPE - }; - if (value.block_scope) { - result.variables = value.block_scope.variables; - result.enclosed = value.block_scope.enclosed; - } - value.CTOR.PROPS.forEach(function(prop) { - if (prop !== "block_scope") { - result[prop] = value[prop]; - } - }); - return result; - } - return value; - }, 2)); - } else if (program.output == "spidermonkey") { - try { - const minified = await minify( - result.code, - { - compress: false, - mangle: false, - format: { - ast: true, - code: false - } - }, - fs - ); - console.log(JSON.stringify(minified.ast.to_mozilla_ast(), null, 2)); - } catch (ex) { - fatal(ex); - return; - } - } else if (program.output) { - fs.writeFileSync(program.output, result.code); - if (options.sourceMap && options.sourceMap.url !== "inline" && result.map) { - fs.writeFileSync(program.output + ".map", result.map); - } - } else { - console.log(result.code); - } - if (program.nameCache) { - fs.writeFileSync(program.nameCache, JSON.stringify(options.nameCache)); - } - if (result.timings) for (var phase in result.timings) { - print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s"); - } - } - - function fatal(message) { - if (message instanceof Error) message = message.stack.replace(/^\S*?Error:/, "ERROR:"); - print_error(message); - process.exit(1); - } - - // A file glob function that only supports "*" and "?" wildcards in the basename. - // Example: "foo/bar/*baz??.*.js" - // Argument `glob` may be a string or an array of strings. - // Returns an array of strings. Garbage in, garbage out. - function simple_glob(glob) { - if (Array.isArray(glob)) { - return [].concat.apply([], glob.map(simple_glob)); - } - if (glob && glob.match(/[*?]/)) { - var dir = path.dirname(glob); - try { - var entries = fs.readdirSync(dir); - } catch (ex) {} - if (entries) { - var pattern = "^" + path.basename(glob) - .replace(/[.+^$[\]\\(){}]/g, "\\$&") - .replace(/\*/g, "[^/\\\\]*") - .replace(/\?/g, "[^/\\\\]") + "$"; - var mod = process.platform === "win32" ? "i" : ""; - var rx = new RegExp(pattern, mod); - var results = entries.filter(function(name) { - return rx.test(name); - }).map(function(name) { - return path.join(dir, name); - }); - if (results.length) return results; - } - } - return [ glob ]; - } - - function read_file(path, default_value) { - try { - return fs.readFileSync(path, "utf8"); - } catch (ex) { - if ((ex.code == "ENOENT" || ex.code == "ENAMETOOLONG") && default_value != null) return default_value; - fatal(ex); - } - } - - function parse_js(flag) { - return function(value, options) { - options = options || {}; - try { - walk(parse(value, { expression: true }), node => { - if (node instanceof AST_Assign) { - var name = node.left.print_to_string(); - var value = node.right; - if (flag) { - options[name] = value; - } else if (value instanceof AST_Array) { - options[name] = value.elements.map(to_string); - } else if (value instanceof AST_RegExp) { - value = value.value; - options[name] = new RegExp(value.source, value.flags); - } else { - options[name] = to_string(value); - } - return true; - } - if (node instanceof AST_Symbol || node instanceof AST_PropAccess) { - var name = node.print_to_string(); - options[name] = true; - return true; - } - if (!(node instanceof AST_Sequence)) throw node; - - function to_string(value) { - return value instanceof AST_Constant ? value.getValue() : value.print_to_string({ - quote_keys: true - }); - } - }); - } catch(ex) { - if (flag) { - fatal("Error parsing arguments for '" + flag + "': " + value); - } else { - options[value] = null; - } - } - return options; - }; - } - - function symdef(def) { - var ret = (1e6 + def.id) + " " + def.name; - if (def.mangled_name) ret += " " + def.mangled_name; - return ret; - } - - function collect_from_map(map, callback) { - var result = []; - map.forEach(function (def) { - result.push(callback(def)); - }); - return result; - } - - function format_object(obj) { - var lines = []; - var padding = ""; - Object.keys(obj).map(function(name) { - if (padding.length < name.length) padding = Array(name.length + 1).join(" "); - return [ name, JSON.stringify(obj[name]) ]; - }).forEach(function(tokens) { - lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); - }); - return lines.join("\n"); - } - - function print_error(msg) { - process.stderr.write(msg); - process.stderr.write("\n"); - } - - function describe_ast() { - var out = OutputStream({ beautify: true }); - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - const props = ctor.SELF_PROPS.filter(prop => !/^\$/.test(prop)); - - if (props.length > 0) { - out.space(); - out.with_parens(function() { - props.forEach(function(prop, i) { - if (i) out.space(); - out.print(prop); - }); - }); - } - - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function() { - ctor.SUBCLASSES.forEach(function(ctor) { - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - } - doitem(AST_Node); - return out + "\n"; - } -} - -async function _default_options() { - const defs = {}; - - Object.keys(infer_options({ 0: 0 })).forEach((component) => { - const options = infer_options({ - [component]: {0: 0} - }); - - if (options) defs[component] = options; - }); - return defs; -} - -async function infer_options(options) { - try { - await minify("", options); - } catch (error) { - return error.defs; - } -} - -exports._default_options = _default_options; -exports._run_cli = run_cli; -exports.minify = minify; -exports.minify_sync = minify_sync; - -})); diff --git a/node_modules/terser/dist/package.json b/node_modules/terser/dist/package.json deleted file mode 100644 index a4cb7d1..0000000 --- a/node_modules/terser/dist/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "dist", - "private": true, - "version": "1.0.0", - "main": "bundle.min.js", - "type": "commonjs", - "author": "", - "license": "BSD-2-Clause", - "description": "A package to hold the Terser dist bundle as commonjs while keeping the rest of it ESM. Nothing to see here." -} diff --git a/node_modules/terser/lib/ast.js b/node_modules/terser/lib/ast.js deleted file mode 100644 index 1ae990d..0000000 --- a/node_modules/terser/lib/ast.js +++ /dev/null @@ -1,3339 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - HOP, - MAP, - noop -} from "./utils/index.js"; -import { parse } from "./parse.js"; - -function DEFNODE(type, props, ctor, methods, base = AST_Node) { - if (!props) props = []; - else props = props.split(/\s+/); - var self_props = props; - if (base && base.PROPS) - props = props.concat(base.PROPS); - const proto = base && Object.create(base.prototype); - if (proto) { - ctor.prototype = proto; - ctor.BASE = base; - } - if (base) base.SUBCLASSES.push(ctor); - ctor.prototype.CTOR = ctor; - ctor.prototype.constructor = ctor; - ctor.PROPS = props || null; - ctor.SELF_PROPS = self_props; - ctor.SUBCLASSES = []; - if (type) { - ctor.prototype.TYPE = ctor.TYPE = type; - } - if (methods) for (let i in methods) if (HOP(methods, i)) { - if (i[0] === "$") { - ctor[i.substr(1)] = methods[i]; - } else { - ctor.prototype[i] = methods[i]; - } - } - ctor.DEFMETHOD = function(name, method) { - this.prototype[name] = method; - }; - return ctor; -} - -const has_tok_flag = (tok, flag) => Boolean(tok.flags & flag); -const set_tok_flag = (tok, flag, truth) => { - if (truth) { - tok.flags |= flag; - } else { - tok.flags &= ~flag; - } -}; - -const TOK_FLAG_NLB = 0b0001; -const TOK_FLAG_QUOTE_SINGLE = 0b0010; -const TOK_FLAG_QUOTE_EXISTS = 0b0100; -const TOK_FLAG_TEMPLATE_END = 0b1000; - -class AST_Token { - constructor(type, value, line, col, pos, nlb, comments_before, comments_after, file) { - this.flags = (nlb ? 1 : 0); - - this.type = type; - this.value = value; - this.line = line; - this.col = col; - this.pos = pos; - this.comments_before = comments_before; - this.comments_after = comments_after; - this.file = file; - - Object.seal(this); - } - - // Return a string summary of the token for node.js console.log - [Symbol.for("nodejs.util.inspect.custom")](_depth, options) { - const special = str => options.stylize(str, "special"); - const quote = typeof this.value === "string" && this.value.includes("`") ? "'" : "`"; - const value = `${quote}${this.value}${quote}`; - return `${special("[AST_Token")} ${value} at ${this.line}:${this.col}${special("]")}`; - } - - get nlb() { - return has_tok_flag(this, TOK_FLAG_NLB); - } - - set nlb(new_nlb) { - set_tok_flag(this, TOK_FLAG_NLB, new_nlb); - } - - get quote() { - return !has_tok_flag(this, TOK_FLAG_QUOTE_EXISTS) - ? "" - : (has_tok_flag(this, TOK_FLAG_QUOTE_SINGLE) ? "'" : '"'); - } - - set quote(quote_type) { - set_tok_flag(this, TOK_FLAG_QUOTE_SINGLE, quote_type === "'"); - set_tok_flag(this, TOK_FLAG_QUOTE_EXISTS, !!quote_type); - } - - get template_end() { - return has_tok_flag(this, TOK_FLAG_TEMPLATE_END); - } - - set template_end(new_template_end) { - set_tok_flag(this, TOK_FLAG_TEMPLATE_END, new_template_end); - } -} - -var AST_Node = DEFNODE("Node", "start end", function AST_Node(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - _clone: function(deep) { - if (deep) { - var self = this.clone(); - return self.transform(new TreeTransformer(function(node) { - if (node !== self) { - return node.clone(true); - } - })); - } - return new this.CTOR(this); - }, - clone: function(deep) { - return this._clone(deep); - }, - $documentation: "Base class of all AST nodes", - $propdoc: { - start: "[AST_Token] The first token of this node", - end: "[AST_Token] The last token of this node" - }, - _walk: function(visitor) { - return visitor._visit(this); - }, - walk: function(visitor) { - return this._walk(visitor); // not sure the indirection will be any help - }, - _children_backwards: () => {} -}, null); - -/* -----[ statements ]----- */ - -var AST_Statement = DEFNODE("Statement", null, function AST_Statement(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class of all statements", -}); - -var AST_Debugger = DEFNODE("Debugger", null, function AST_Debugger(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Represents a debugger statement", -}, AST_Statement); - -var AST_Directive = DEFNODE("Directive", "value quote", function AST_Directive(props) { - if (props) { - this.value = props.value; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Represents a directive, like \"use strict\";", - $propdoc: { - value: "[string] The value of this directive as a plain string (it's not an AST_String!)", - quote: "[string] the original quote character" - }, -}, AST_Statement); - -var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", function AST_SimpleStatement(props) { - if (props) { - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", - $propdoc: { - body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - } -}, AST_Statement); - -function walk_body(node, visitor) { - const body = node.body; - for (var i = 0, len = body.length; i < len; i++) { - body[i]._walk(visitor); - } -} - -function clone_block_scope(deep) { - var clone = this._clone(deep); - if (this.block_scope) { - clone.block_scope = this.block_scope.clone(); - } - return clone; -} - -var AST_Block = DEFNODE("Block", "body block_scope", function AST_Block(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A body of statements (usually braced)", - $propdoc: { - body: "[AST_Statement*] an array of statements", - block_scope: "[AST_Scope] the block scope" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - }, - clone: clone_block_scope -}, AST_Statement); - -var AST_BlockStatement = DEFNODE("BlockStatement", null, function AST_BlockStatement(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A block statement", -}, AST_Block); - -var AST_EmptyStatement = DEFNODE("EmptyStatement", null, function AST_EmptyStatement(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The empty statement (empty block or simply a semicolon)" -}, AST_Statement); - -var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", function AST_StatementWithBody(props) { - if (props) { - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", - $propdoc: { - body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" - } -}, AST_Statement); - -var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", function AST_LabeledStatement(props) { - if (props) { - this.label = props.label; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Statement with a label", - $propdoc: { - label: "[AST_Label] a label definition" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.label._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.label); - }, - clone: function(deep) { - var node = this._clone(deep); - if (deep) { - var label = node.label; - var def = this.label; - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_LoopControl - && node.label && node.label.thedef === def) { - node.label.thedef = label; - label.references.push(node); - } - })); - } - return node; - } -}, AST_StatementWithBody); - -var AST_IterationStatement = DEFNODE( - "IterationStatement", - "block_scope", - function AST_IterationStatement(props) { - if (props) { - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Internal class. All loops inherit from it.", - $propdoc: { - block_scope: "[AST_Scope] the block scope for this iteration statement." - }, - clone: clone_block_scope - }, - AST_StatementWithBody -); - -var AST_DWLoop = DEFNODE("DWLoop", "condition", function AST_DWLoop(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for do/while statements", - $propdoc: { - condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - } -}, AST_IterationStatement); - -var AST_Do = DEFNODE("Do", null, function AST_Do(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `do` statement", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - this.condition._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.condition); - push(this.body); - } -}, AST_DWLoop); - -var AST_While = DEFNODE("While", null, function AST_While(props) { - if (props) { - this.condition = props.condition; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `while` statement", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.condition); - }, -}, AST_DWLoop); - -var AST_For = DEFNODE("For", "init condition step", function AST_For(props) { - if (props) { - this.init = props.init; - this.condition = props.condition; - this.step = props.step; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for` statement", - $propdoc: { - init: "[AST_Node?] the `for` initialization code, or null if empty", - condition: "[AST_Node?] the `for` termination clause, or null if empty", - step: "[AST_Node?] the `for` update clause, or null if empty" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.init) this.init._walk(visitor); - if (this.condition) this.condition._walk(visitor); - if (this.step) this.step._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - if (this.step) push(this.step); - if (this.condition) push(this.condition); - if (this.init) push(this.init); - }, -}, AST_IterationStatement); - -var AST_ForIn = DEFNODE("ForIn", "init object", function AST_ForIn(props) { - if (props) { - this.init = props.init; - this.object = props.object; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for ... in` statement", - $propdoc: { - init: "[AST_Node] the `for/in` initialization code", - object: "[AST_Node] the object that we're looping through" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.init._walk(visitor); - this.object._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - if (this.object) push(this.object); - if (this.init) push(this.init); - }, -}, AST_IterationStatement); - -var AST_ForOf = DEFNODE("ForOf", "await", function AST_ForOf(props) { - if (props) { - this.await = props.await; - this.init = props.init; - this.object = props.object; - this.block_scope = props.block_scope; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `for ... of` statement", -}, AST_ForIn); - -var AST_With = DEFNODE("With", "expression", function AST_With(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `with` statement", - $propdoc: { - expression: "[AST_Node] the `with` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.body._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.body); - push(this.expression); - }, -}, AST_StatementWithBody); - -/* -----[ scope and functions ]----- */ - -var AST_Scope = DEFNODE( - "Scope", - "variables uses_with uses_eval parent_scope enclosed cname", - function AST_Scope(props) { - if (props) { - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for all statements introducing a lexical scope", - $propdoc: { - variables: "[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope", - uses_with: "[boolean/S] tells whether this scope uses the `with` statement", - uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", - parent_scope: "[AST_Scope?/S] link to the parent scope", - enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", - cname: "[integer/S] current index for mangling variables (used internally by the mangler)", - }, - get_defun_scope: function() { - var self = this; - while (self.is_block_scope()) { - self = self.parent_scope; - } - return self; - }, - clone: function(deep, toplevel) { - var node = this._clone(deep); - if (deep && this.variables && toplevel && !this._block_scope) { - node.figure_out_scope({}, { - toplevel: toplevel, - parent_scope: this.parent_scope - }); - } else { - if (this.variables) node.variables = new Map(this.variables); - if (this.enclosed) node.enclosed = this.enclosed.slice(); - if (this._block_scope) node._block_scope = this._block_scope; - } - return node; - }, - pinned: function() { - return this.uses_eval || this.uses_with; - } - }, - AST_Block -); - -var AST_Toplevel = DEFNODE("Toplevel", "globals", function AST_Toplevel(props) { - if (props) { - this.globals = props.globals; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The toplevel scope", - $propdoc: { - globals: "[Map/S] a map of name -> SymbolDef for all undeclared names", - }, - wrap_commonjs: function(name) { - var body = this.body; - var wrapped_tl = "(function(exports){'$ORIG';})(typeof " + name + "=='undefined'?(" + name + "={}):" + name + ");"; - wrapped_tl = parse(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return MAP.splice(body); - } - })); - return wrapped_tl; - }, - wrap_enclose: function(args_values) { - if (typeof args_values != "string") args_values = ""; - var index = args_values.indexOf(":"); - if (index < 0) index = args_values.length; - var body = this.body; - return parse([ - "(function(", - args_values.slice(0, index), - '){"$ORIG"})(', - args_values.slice(index + 1), - ")" - ].join("")).transform(new TreeTransformer(function(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return MAP.splice(body); - } - })); - } -}, AST_Scope); - -var AST_Expansion = DEFNODE("Expansion", "expression", function AST_Expansion(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list", - $propdoc: { - expression: "[AST_Node] the thing to be expanded" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression.walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Lambda = DEFNODE( - "Lambda", - "name argnames uses_arguments is_generator async", - function AST_Lambda(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for functions", - $propdoc: { - name: "[AST_SymbolDeclaration?] the name of this function", - argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments", - uses_arguments: "[boolean/S] tells whether this function accesses the arguments array", - is_generator: "[boolean] is this a generator method", - async: "[boolean] is this method async", - }, - args_as_names: function () { - var out = []; - for (var i = 0; i < this.argnames.length; i++) { - if (this.argnames[i] instanceof AST_Destructuring) { - out.push(...this.argnames[i].all_symbols()); - } else { - out.push(this.argnames[i]); - } - } - return out; - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) this.name._walk(visitor); - var argnames = this.argnames; - for (var i = 0, len = argnames.length; i < len; i++) { - argnames[i]._walk(visitor); - } - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - - i = this.argnames.length; - while (i--) push(this.argnames[i]); - - if (this.name) push(this.name); - }, - is_braceless() { - return this.body[0] instanceof AST_Return && this.body[0].value; - }, - // Default args and expansion don't count, so .argnames.length doesn't cut it - length_property() { - let length = 0; - - for (const arg of this.argnames) { - if (arg instanceof AST_SymbolFunarg || arg instanceof AST_Destructuring) { - length++; - } - } - - return length; - } - }, - AST_Scope -); - -var AST_Accessor = DEFNODE("Accessor", null, function AST_Accessor(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A setter/getter function. The `name` property is always null." -}, AST_Lambda); - -var AST_Function = DEFNODE("Function", null, function AST_Function(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A function expression" -}, AST_Lambda); - -var AST_Arrow = DEFNODE("Arrow", null, function AST_Arrow(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An ES6 Arrow function ((a) => b)" -}, AST_Lambda); - -var AST_Defun = DEFNODE("Defun", null, function AST_Defun(props) { - if (props) { - this.name = props.name; - this.argnames = props.argnames; - this.uses_arguments = props.uses_arguments; - this.is_generator = props.is_generator; - this.async = props.async; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A function definition" -}, AST_Lambda); - -/* -----[ DESTRUCTURING ]----- */ -var AST_Destructuring = DEFNODE("Destructuring", "names is_array", function AST_Destructuring(props) { - if (props) { - this.names = props.names; - this.is_array = props.is_array; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A destructuring of several names. Used in destructuring assignment and with destructuring function argument names", - $propdoc: { - "names": "[AST_Node*] Array of properties or elements", - "is_array": "[Boolean] Whether the destructuring represents an object or array" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.names.forEach(function(name) { - name._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.names.length; - while (i--) push(this.names[i]); - }, - all_symbols: function() { - var out = []; - walk(this, node => { - if (node instanceof AST_SymbolDeclaration) { - out.push(node); - } - if (node instanceof AST_Lambda) { - return true; - } - }); - return out; - } -}); - -var AST_PrefixedTemplateString = DEFNODE( - "PrefixedTemplateString", - "template_string prefix", - function AST_PrefixedTemplateString(props) { - if (props) { - this.template_string = props.template_string; - this.prefix = props.prefix; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "A templatestring with a prefix, such as String.raw`foobarbaz`", - $propdoc: { - template_string: "[AST_TemplateString] The template string", - prefix: "[AST_Node] The prefix, which will get called." - }, - _walk: function(visitor) { - return visitor._visit(this, function () { - this.prefix._walk(visitor); - this.template_string._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.template_string); - push(this.prefix); - }, - } -); - -var AST_TemplateString = DEFNODE("TemplateString", "segments", function AST_TemplateString(props) { - if (props) { - this.segments = props.segments; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A template string literal", - $propdoc: { - segments: "[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.segments.forEach(function(seg) { - seg._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.segments.length; - while (i--) push(this.segments[i]); - } -}); - -var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", function AST_TemplateSegment(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A segment of a template string literal", - $propdoc: { - value: "Content of the segment", - raw: "Raw source of the segment", - } -}); - -/* -----[ JUMPS ]----- */ - -var AST_Jump = DEFNODE("Jump", null, function AST_Jump(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" -}, AST_Statement); - -/** Base class for “exits” (`return` and `throw`) */ -var AST_Exit = DEFNODE("Exit", "value", function AST_Exit(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for “exits” (`return` and `throw`)", - $propdoc: { - value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" - }, - _walk: function(visitor) { - return visitor._visit(this, this.value && function() { - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value) push(this.value); - }, -}, AST_Jump); - -var AST_Return = DEFNODE("Return", null, function AST_Return(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `return` statement" -}, AST_Exit); - -var AST_Throw = DEFNODE("Throw", null, function AST_Throw(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `throw` statement" -}, AST_Exit); - -var AST_LoopControl = DEFNODE("LoopControl", "label", function AST_LoopControl(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for loop control statements (`break` and `continue`)", - $propdoc: { - label: "[AST_LabelRef?] the label, or null if none", - }, - _walk: function(visitor) { - return visitor._visit(this, this.label && function() { - this.label._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.label) push(this.label); - }, -}, AST_Jump); - -var AST_Break = DEFNODE("Break", null, function AST_Break(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `break` statement" -}, AST_LoopControl); - -var AST_Continue = DEFNODE("Continue", null, function AST_Continue(props) { - if (props) { - this.label = props.label; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `continue` statement" -}, AST_LoopControl); - -var AST_Await = DEFNODE("Await", "expression", function AST_Await(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An `await` statement", - $propdoc: { - expression: "[AST_Node] the mandatory expression being awaited", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Yield = DEFNODE("Yield", "expression is_star", function AST_Yield(props) { - if (props) { - this.expression = props.expression; - this.is_star = props.is_star; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `yield` statement", - $propdoc: { - expression: "[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false", - is_star: "[Boolean] Whether this is a yield or yield* statement" - }, - _walk: function(visitor) { - return visitor._visit(this, this.expression && function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.expression) push(this.expression); - } -}); - -/* -----[ IF ]----- */ - -var AST_If = DEFNODE("If", "condition alternative", function AST_If(props) { - if (props) { - this.condition = props.condition; - this.alternative = props.alternative; - this.body = props.body; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `if` statement", - $propdoc: { - condition: "[AST_Node] the `if` condition", - alternative: "[AST_Statement?] the `else` part, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - if (this.alternative) this.alternative._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.alternative) { - push(this.alternative); - } - push(this.body); - push(this.condition); - } -}, AST_StatementWithBody); - -/* -----[ SWITCH ]----- */ - -var AST_Switch = DEFNODE("Switch", "expression", function AST_Switch(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `switch` statement", - $propdoc: { - expression: "[AST_Node] the `switch` “discriminant”" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - push(this.expression); - } -}, AST_Block); - -var AST_SwitchBranch = DEFNODE("SwitchBranch", null, function AST_SwitchBranch(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for `switch` branches", -}, AST_Block); - -var AST_Default = DEFNODE("Default", null, function AST_Default(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `default` switch branch", -}, AST_SwitchBranch); - -var AST_Case = DEFNODE("Case", "expression", function AST_Case(props) { - if (props) { - this.expression = props.expression; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `case` switch branch", - $propdoc: { - expression: "[AST_Node] the `case` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - push(this.expression); - }, -}, AST_SwitchBranch); - -/* -----[ EXCEPTIONS ]----- */ - -var AST_Try = DEFNODE("Try", "body bcatch bfinally", function AST_Try(props) { - if (props) { - this.body = props.body; - this.bcatch = props.bcatch; - this.bfinally = props.bfinally; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `try` statement", - $propdoc: { - body: "[AST_TryBlock] the try block", - bcatch: "[AST_Catch?] the catch block, or null if not present", - bfinally: "[AST_Finally?] the finally block, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - if (this.bcatch) this.bcatch._walk(visitor); - if (this.bfinally) this.bfinally._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.bfinally) push(this.bfinally); - if (this.bcatch) push(this.bcatch); - push(this.body); - }, -}, AST_Statement); - -var AST_TryBlock = DEFNODE("TryBlock", null, function AST_TryBlock(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `try` block of a try statement" -}, AST_Block); - -var AST_Catch = DEFNODE("Catch", "argname", function AST_Catch(props) { - if (props) { - this.argname = props.argname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `catch` node; only makes sense as part of a `try` statement", - $propdoc: { - argname: "[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.argname) this.argname._walk(visitor); - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - if (this.argname) push(this.argname); - }, -}, AST_Block); - -var AST_Finally = DEFNODE("Finally", null, function AST_Finally(props) { - if (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `finally` node; only makes sense as part of a `try` statement" -}, AST_Block); - -/* -----[ VAR/CONST ]----- */ - -var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definitions(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", - $propdoc: { - definitions: "[AST_VarDef*] array of variable definitions" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var definitions = this.definitions; - for (var i = 0, len = definitions.length; i < len; i++) { - definitions[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.definitions.length; - while (i--) push(this.definitions[i]); - }, -}, AST_Statement); - -var AST_Var = DEFNODE("Var", null, function AST_Var(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `var` statement" -}, AST_Definitions); - -var AST_Let = DEFNODE("Let", null, function AST_Let(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `let` statement" -}, AST_Definitions); - -var AST_Const = DEFNODE("Const", null, function AST_Const(props) { - if (props) { - this.definitions = props.definitions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A `const` statement" -}, AST_Definitions); - -var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef(props) { - if (props) { - this.name = props.name; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A variable declaration; only appears in a AST_Definitions node", - $propdoc: { - name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable", - value: "[AST_Node?] initializer, or null of there's no initializer" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.name._walk(visitor); - if (this.value) this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value) push(this.value); - push(this.name); - }, - declarations_as_names() { - if (this.name instanceof AST_SymbolDeclaration) { - return [this]; - } else { - return this.name.all_symbols(); - } - } -}); - -var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", function AST_NameMapping(props) { - if (props) { - this.foreign_name = props.foreign_name; - this.name = props.name; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The part of the export/import statement that declare names from a module.", - $propdoc: { - foreign_name: "[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)", - name: "[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module." - }, - _walk: function (visitor) { - return visitor._visit(this, function() { - this.foreign_name._walk(visitor); - this.name._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.name); - push(this.foreign_name); - }, -}); - -var AST_Import = DEFNODE( - "Import", - "imported_name imported_names module_name assert_clause", - function AST_Import(props) { - if (props) { - this.imported_name = props.imported_name; - this.imported_names = props.imported_names; - this.module_name = props.module_name; - this.assert_clause = props.assert_clause; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "An `import` statement", - $propdoc: { - imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.", - imported_names: "[AST_NameMapping*] The names of non-default imported variables", - module_name: "[AST_String] String literal describing where this module came from", - assert_clause: "[AST_Object?] The import assertion" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.imported_name) { - this.imported_name._walk(visitor); - } - if (this.imported_names) { - this.imported_names.forEach(function(name_import) { - name_import._walk(visitor); - }); - } - this.module_name._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.module_name); - if (this.imported_names) { - let i = this.imported_names.length; - while (i--) push(this.imported_names[i]); - } - if (this.imported_name) push(this.imported_name); - }, - } -); - -var AST_ImportMeta = DEFNODE("ImportMeta", null, function AST_ImportMeta(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A reference to import.meta", -}); - -var AST_Export = DEFNODE( - "Export", - "exported_definition exported_value is_default exported_names module_name assert_clause", - function AST_Export(props) { - if (props) { - this.exported_definition = props.exported_definition; - this.exported_value = props.exported_value; - this.is_default = props.is_default; - this.exported_names = props.exported_names; - this.module_name = props.module_name; - this.assert_clause = props.assert_clause; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "An `export` statement", - $propdoc: { - exported_definition: "[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition", - exported_value: "[AST_Node?] An exported value", - exported_names: "[AST_NameMapping*?] List of exported names", - module_name: "[AST_String?] Name of the file to load exports from", - is_default: "[Boolean] Whether this is the default exported value of this module", - assert_clause: "[AST_Object?] The import assertion" - }, - _walk: function (visitor) { - return visitor._visit(this, function () { - if (this.exported_definition) { - this.exported_definition._walk(visitor); - } - if (this.exported_value) { - this.exported_value._walk(visitor); - } - if (this.exported_names) { - this.exported_names.forEach(function(name_export) { - name_export._walk(visitor); - }); - } - if (this.module_name) { - this.module_name._walk(visitor); - } - }); - }, - _children_backwards(push) { - if (this.module_name) push(this.module_name); - if (this.exported_names) { - let i = this.exported_names.length; - while (i--) push(this.exported_names[i]); - } - if (this.exported_value) push(this.exported_value); - if (this.exported_definition) push(this.exported_definition); - } - }, - AST_Statement -); - -/* -----[ OTHER ]----- */ - -var AST_Call = DEFNODE( - "Call", - "expression args optional _annotations", - function AST_Call(props) { - if (props) { - this.expression = props.expression; - this.args = props.args; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; - }, - { - $documentation: "A function call expression", - $propdoc: { - expression: "[AST_Node] expression to invoke as function", - args: "[AST_Node*] array of arguments", - optional: "[boolean] whether this is an optional call (IE ?.() )", - _annotations: "[number] bitfield containing information about the call" - }, - initialize() { - if (this._annotations == null) this._annotations = 0; - }, - _walk(visitor) { - return visitor._visit(this, function() { - var args = this.args; - for (var i = 0, len = args.length; i < len; i++) { - args[i]._walk(visitor); - } - this.expression._walk(visitor); // TODO why do we need to crawl this last? - }); - }, - _children_backwards(push) { - let i = this.args.length; - while (i--) push(this.args[i]); - push(this.expression); - }, - } -); - -var AST_New = DEFNODE("New", null, function AST_New(props) { - if (props) { - this.expression = props.expression; - this.args = props.args; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; -}, { - $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" -}, AST_Call); - -var AST_Sequence = DEFNODE("Sequence", "expressions", function AST_Sequence(props) { - if (props) { - this.expressions = props.expressions; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A sequence expression (comma-separated expressions)", - $propdoc: { - expressions: "[AST_Node*] array of expressions (at least two)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expressions.forEach(function(node) { - node._walk(visitor); - }); - }); - }, - _children_backwards(push) { - let i = this.expressions.length; - while (i--) push(this.expressions[i]); - }, -}); - -var AST_PropAccess = DEFNODE( - "PropAccess", - "expression property optional", - function AST_PropAccess(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", - $propdoc: { - expression: "[AST_Node] the “container” expression", - property: "[AST_Node|string] the property to access. For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node", - - optional: "[boolean] whether this is an optional property access (IE ?.)" - } - } -); - -var AST_Dot = DEFNODE("Dot", "quote", function AST_Dot(props) { - if (props) { - this.quote = props.quote; - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A dotted property access expression", - $propdoc: { - quote: "[string] the original quote character when transformed from AST_Sub", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}, AST_PropAccess); - -var AST_DotHash = DEFNODE("DotHash", "", function AST_DotHash(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A dotted property access to a private property", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}, AST_PropAccess); - -var AST_Sub = DEFNODE("Sub", null, function AST_Sub(props) { - if (props) { - this.expression = props.expression; - this.property = props.property; - this.optional = props.optional; - this._annotations = props._annotations; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Index-style property access, i.e. `a[\"foo\"]`", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.property._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.property); - push(this.expression); - }, -}, AST_PropAccess); - -var AST_Chain = DEFNODE("Chain", "expression", function AST_Chain(props) { - if (props) { - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A chain expression like a?.b?.(c)?.[d]", - $propdoc: { - expression: "[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element." - }, - _walk: function (visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_Unary = DEFNODE("Unary", "operator expression", function AST_Unary(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for unary expressions", - $propdoc: { - operator: "[string] the operator", - expression: "[AST_Node] expression that this unary operator applies to" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.expression); - }, -}); - -var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, function AST_UnaryPrefix(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" -}, AST_Unary); - -var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, function AST_UnaryPostfix(props) { - if (props) { - this.operator = props.operator; - this.expression = props.expression; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Unary postfix expression, i.e. `i++`" -}, AST_Unary); - -var AST_Binary = DEFNODE("Binary", "operator left right", function AST_Binary(props) { - if (props) { - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Binary expression, i.e. `a + b`", - $propdoc: { - left: "[AST_Node] left-hand side expression", - operator: "[string] the operator", - right: "[AST_Node] right-hand side expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.left._walk(visitor); - this.right._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.right); - push(this.left); - }, -}); - -var AST_Conditional = DEFNODE( - "Conditional", - "condition consequent alternative", - function AST_Conditional(props) { - if (props) { - this.condition = props.condition; - this.consequent = props.consequent; - this.alternative = props.alternative; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", - $propdoc: { - condition: "[AST_Node]", - consequent: "[AST_Node]", - alternative: "[AST_Node]" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.consequent._walk(visitor); - this.alternative._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.alternative); - push(this.consequent); - push(this.condition); - }, - } -); - -var AST_Assign = DEFNODE("Assign", "logical", function AST_Assign(props) { - if (props) { - this.logical = props.logical; - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An assignment expression — `a = b + 5`", - $propdoc: { - logical: "Whether it's a logical assignment" - } -}, AST_Binary); - -var AST_DefaultAssign = DEFNODE("DefaultAssign", null, function AST_DefaultAssign(props) { - if (props) { - this.operator = props.operator; - this.left = props.left; - this.right = props.right; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A default assignment expression like in `(a = 3) => a`" -}, AST_Binary); - -/* -----[ LITERALS ]----- */ - -var AST_Array = DEFNODE("Array", "elements", function AST_Array(props) { - if (props) { - this.elements = props.elements; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An array literal", - $propdoc: { - elements: "[AST_Node*] array of elements" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var elements = this.elements; - for (var i = 0, len = elements.length; i < len; i++) { - elements[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.elements.length; - while (i--) push(this.elements[i]); - }, -}); - -var AST_Object = DEFNODE("Object", "properties", function AST_Object(props) { - if (props) { - this.properties = props.properties; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An object literal", - $propdoc: { - properties: "[AST_ObjectProperty*] array of properties" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - var properties = this.properties; - for (var i = 0, len = properties.length; i < len; i++) { - properties[i]._walk(visitor); - } - }); - }, - _children_backwards(push) { - let i = this.properties.length; - while (i--) push(this.properties[i]); - }, -}); - -var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", function AST_ObjectProperty(props) { - if (props) { - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "Base class for literal object properties", - $propdoc: { - key: "[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.", - value: "[AST_Node] property value. For getters and setters this is an AST_Accessor." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.key instanceof AST_Node) - this.key._walk(visitor); - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.value); - if (this.key instanceof AST_Node) push(this.key); - } -}); - -var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", "quote", function AST_ObjectKeyVal(props) { - if (props) { - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A key: value object property", - $propdoc: { - quote: "[string] the original quote character" - }, - computed_key() { - return this.key instanceof AST_Node; - } -}, AST_ObjectProperty); - -var AST_PrivateSetter = DEFNODE("PrivateSetter", "static", function AST_PrivateSetter(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - static: "[boolean] whether this is a static private setter" - }, - $documentation: "A private setter property", - computed_key() { - return false; - } -}, AST_ObjectProperty); - -var AST_PrivateGetter = DEFNODE("PrivateGetter", "static", function AST_PrivateGetter(props) { - if (props) { - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - static: "[boolean] whether this is a static private getter" - }, - $documentation: "A private getter property", - computed_key() { - return false; - } -}, AST_ObjectProperty); - -var AST_ObjectSetter = DEFNODE("ObjectSetter", "quote static", function AST_ObjectSetter(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] whether this is a static setter (classes only)" - }, - $documentation: "An object setter property", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_ObjectGetter = DEFNODE("ObjectGetter", "quote static", function AST_ObjectGetter(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] whether this is a static getter (classes only)" - }, - $documentation: "An object getter property", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } -}, AST_ObjectProperty); - -var AST_ConciseMethod = DEFNODE( - "ConciseMethod", - "quote static is_generator async", - function AST_ConciseMethod(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.is_generator = props.is_generator; - this.async = props.async; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; - }, - { - $propdoc: { - quote: "[string|undefined] the original quote character, if any", - static: "[boolean] is this method static (classes only)", - is_generator: "[boolean] is this a generator method", - async: "[boolean] is this method async", - }, - $documentation: "An ES6 concise method inside an object or class", - computed_key() { - return !(this.key instanceof AST_SymbolMethod); - } - }, - AST_ObjectProperty -); - -var AST_PrivateMethod = DEFNODE("PrivateMethod", "", function AST_PrivateMethod(props) { - if (props) { - this.quote = props.quote; - this.static = props.static; - this.is_generator = props.is_generator; - this.async = props.async; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A private class method inside a class", -}, AST_ConciseMethod); - -var AST_Class = DEFNODE("Class", "name extends properties", function AST_Class(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - name: "[AST_SymbolClass|AST_SymbolDefClass?] optional class name.", - extends: "[AST_Node]? optional parent class", - properties: "[AST_ObjectProperty*] array of properties" - }, - $documentation: "An ES6 class", - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) { - this.name._walk(visitor); - } - if (this.extends) { - this.extends._walk(visitor); - } - this.properties.forEach((prop) => prop._walk(visitor)); - }); - }, - _children_backwards(push) { - let i = this.properties.length; - while (i--) push(this.properties[i]); - if (this.extends) push(this.extends); - if (this.name) push(this.name); - }, - /** go through the bits that are executed instantly, not when the class is `new`'d. Doesn't walk the name. */ - visit_nondeferred_class_parts(visitor) { - if (this.extends) { - this.extends._walk(visitor); - } - this.properties.forEach((prop) => { - if (prop instanceof AST_ClassStaticBlock) { - prop._walk(visitor); - return; - } - if (prop.computed_key()) { - visitor.push(prop); - prop.key._walk(visitor); - visitor.pop(); - } - if ((prop instanceof AST_ClassPrivateProperty || prop instanceof AST_ClassProperty) && prop.static && prop.value) { - visitor.push(prop); - prop.value._walk(visitor); - visitor.pop(); - } - }); - }, - /** go through the bits that are executed later, when the class is `new`'d or a static method is called */ - visit_deferred_class_parts(visitor) { - this.properties.forEach((prop) => { - if (prop instanceof AST_ConciseMethod) { - prop.walk(visitor); - } else if (prop instanceof AST_ClassProperty && !prop.static && prop.value) { - visitor.push(prop); - prop.value._walk(visitor); - visitor.pop(); - } - }); - }, -}, AST_Scope /* TODO a class might have a scope but it's not a scope */); - -var AST_ClassProperty = DEFNODE("ClassProperty", "static quote", function AST_ClassProperty(props) { - if (props) { - this.static = props.static; - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A class property", - $propdoc: { - static: "[boolean] whether this is a static key", - quote: "[string] which quote is being used" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.key instanceof AST_Node) - this.key._walk(visitor); - if (this.value instanceof AST_Node) - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - if (this.value instanceof AST_Node) push(this.value); - if (this.key instanceof AST_Node) push(this.key); - }, - computed_key() { - return !(this.key instanceof AST_SymbolClassProperty); - } -}, AST_ObjectProperty); - -var AST_ClassPrivateProperty = DEFNODE("ClassPrivateProperty", "", function AST_ClassPrivateProperty(props) { - if (props) { - this.static = props.static; - this.quote = props.quote; - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class property for a private property", -}, AST_ClassProperty); - -var AST_PrivateIn = DEFNODE("PrivateIn", "key value", function AST_PrivateIn(props) { - if (props) { - this.key = props.key; - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "An `in` binop when the key is private, eg #x in this", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.key._walk(visitor); - this.value._walk(visitor); - }); - }, - _children_backwards(push) { - push(this.value); - push(this.key); - }, -}); - -var AST_DefClass = DEFNODE("DefClass", null, function AST_DefClass(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class definition", -}, AST_Class); - -var AST_ClassStaticBlock = DEFNODE("ClassStaticBlock", "body block_scope", function AST_ClassStaticBlock (props) { - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; -}, { - $documentation: "A block containing statements to be executed in the context of the class", - $propdoc: { - body: "[AST_Statement*] an array of statements", - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - }, - _children_backwards(push) { - let i = this.body.length; - while (i--) push(this.body[i]); - }, - clone: clone_block_scope, - computed_key: () => false -}, AST_Scope); - -var AST_ClassExpression = DEFNODE("ClassExpression", null, function AST_ClassExpression(props) { - if (props) { - this.name = props.name; - this.extends = props.extends; - this.properties = props.properties; - this.variables = props.variables; - this.uses_with = props.uses_with; - this.uses_eval = props.uses_eval; - this.parent_scope = props.parent_scope; - this.enclosed = props.enclosed; - this.cname = props.cname; - this.body = props.body; - this.block_scope = props.block_scope; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A class expression." -}, AST_Class); - -var AST_Symbol = DEFNODE("Symbol", "scope name thedef", function AST_Symbol(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $propdoc: { - name: "[string] name of this symbol", - scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", - thedef: "[SymbolDef/S] the definition of this symbol" - }, - $documentation: "Base class for all symbols" -}); - -var AST_NewTarget = DEFNODE("NewTarget", null, function AST_NewTarget(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A reference to new.target" -}); - -var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", function AST_SymbolDeclaration(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", -}, AST_Symbol); - -var AST_SymbolVar = DEFNODE("SymbolVar", null, function AST_SymbolVar(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol defining a variable", -}, AST_SymbolDeclaration); - -var AST_SymbolBlockDeclaration = DEFNODE( - "SymbolBlockDeclaration", - null, - function AST_SymbolBlockDeclaration(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; - }, - { - $documentation: "Base class for block-scoped declaration symbols" - }, - AST_SymbolDeclaration -); - -var AST_SymbolConst = DEFNODE("SymbolConst", null, function AST_SymbolConst(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A constant declaration" -}, AST_SymbolBlockDeclaration); - -var AST_SymbolLet = DEFNODE("SymbolLet", null, function AST_SymbolLet(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A block-scoped `let` declaration" -}, AST_SymbolBlockDeclaration); - -var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, function AST_SymbolFunarg(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a function argument", -}, AST_SymbolVar); - -var AST_SymbolDefun = DEFNODE("SymbolDefun", null, function AST_SymbolDefun(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol defining a function", -}, AST_SymbolDeclaration); - -var AST_SymbolMethod = DEFNODE("SymbolMethod", null, function AST_SymbolMethod(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol in an object defining a method", -}, AST_Symbol); - -var AST_SymbolClassProperty = DEFNODE("SymbolClassProperty", null, function AST_SymbolClassProperty(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol for a class property", -}, AST_Symbol); - -var AST_SymbolLambda = DEFNODE("SymbolLambda", null, function AST_SymbolLambda(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a function expression", -}, AST_SymbolDeclaration); - -var AST_SymbolDefClass = DEFNODE("SymbolDefClass", null, function AST_SymbolDefClass(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class." -}, AST_SymbolBlockDeclaration); - -var AST_SymbolClass = DEFNODE("SymbolClass", null, function AST_SymbolClass(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a class's name. Lexically scoped to the class." -}, AST_SymbolDeclaration); - -var AST_SymbolCatch = DEFNODE("SymbolCatch", null, function AST_SymbolCatch(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol naming the exception in catch", -}, AST_SymbolBlockDeclaration); - -var AST_SymbolImport = DEFNODE("SymbolImport", null, function AST_SymbolImport(props) { - if (props) { - this.init = props.init; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol referring to an imported name", -}, AST_SymbolBlockDeclaration); - -var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", null, function AST_SymbolImportForeign(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes", -}, AST_Symbol); - -var AST_Label = DEFNODE("Label", "references", function AST_Label(props) { - if (props) { - this.references = props.references; - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - this.initialize(); - } - - this.flags = 0; -}, { - $documentation: "Symbol naming a label (declaration)", - $propdoc: { - references: "[AST_LoopControl*] a list of nodes referring to this label" - }, - initialize: function() { - this.references = []; - this.thedef = this; - } -}, AST_Symbol); - -var AST_SymbolRef = DEFNODE("SymbolRef", null, function AST_SymbolRef(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Reference to some symbol (not definition/declaration)", -}, AST_Symbol); - -var AST_SymbolExport = DEFNODE("SymbolExport", null, function AST_SymbolExport(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Symbol referring to a name to export", -}, AST_SymbolRef); - -var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", null, function AST_SymbolExportForeign(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes", -}, AST_Symbol); - -var AST_LabelRef = DEFNODE("LabelRef", null, function AST_LabelRef(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Reference to a label symbol", -}, AST_Symbol); - -var AST_SymbolPrivateProperty = DEFNODE("SymbolPrivateProperty", null, function AST_SymbolPrivateProperty(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A symbol that refers to a private property", -}, AST_Symbol); - -var AST_This = DEFNODE("This", null, function AST_This(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `this` symbol", -}, AST_Symbol); - -var AST_Super = DEFNODE("Super", null, function AST_Super(props) { - if (props) { - this.scope = props.scope; - this.name = props.name; - this.thedef = props.thedef; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `super` symbol", -}, AST_This); - -var AST_Constant = DEFNODE("Constant", null, function AST_Constant(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for all constants", - getValue: function() { - return this.value; - } -}); - -var AST_String = DEFNODE("String", "value quote", function AST_String(props) { - if (props) { - this.value = props.value; - this.quote = props.quote; - this.start = props.start; - this.end = props.end; - this._annotations = props._annotations; - } - - this.flags = 0; -}, { - $documentation: "A string literal", - $propdoc: { - value: "[string] the contents of this string", - quote: "[string] the original quote character" - } -}, AST_Constant); - -var AST_Number = DEFNODE("Number", "value raw", function AST_Number(props) { - if (props) { - this.value = props.value; - this.raw = props.raw; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A number literal", - $propdoc: { - value: "[number] the numeric value", - raw: "[string] numeric value as string" - } -}, AST_Constant); - -var AST_BigInt = DEFNODE("BigInt", "value", function AST_BigInt(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A big int literal", - $propdoc: { - value: "[string] big int value" - } -}, AST_Constant); - -var AST_RegExp = DEFNODE("RegExp", "value", function AST_RegExp(props) { - if (props) { - this.value = props.value; - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A regexp literal", - $propdoc: { - value: "[RegExp] the actual regexp", - } -}, AST_Constant); - -var AST_Atom = DEFNODE("Atom", null, function AST_Atom(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for atoms", -}, AST_Constant); - -var AST_Null = DEFNODE("Null", null, function AST_Null(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `null` atom", - value: null -}, AST_Atom); - -var AST_NaN = DEFNODE("NaN", null, function AST_NaN(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The impossible value", - value: 0/0 -}, AST_Atom); - -var AST_Undefined = DEFNODE("Undefined", null, function AST_Undefined(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `undefined` value", - value: (function() {}()) -}, AST_Atom); - -var AST_Hole = DEFNODE("Hole", null, function AST_Hole(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "A hole in an array", - value: (function() {}()) -}, AST_Atom); - -var AST_Infinity = DEFNODE("Infinity", null, function AST_Infinity(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `Infinity` value", - value: 1/0 -}, AST_Atom); - -var AST_Boolean = DEFNODE("Boolean", null, function AST_Boolean(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "Base class for booleans", -}, AST_Atom); - -var AST_False = DEFNODE("False", null, function AST_False(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `false` atom", - value: false -}, AST_Boolean); - -var AST_True = DEFNODE("True", null, function AST_True(props) { - if (props) { - this.start = props.start; - this.end = props.end; - } - - this.flags = 0; -}, { - $documentation: "The `true` atom", - value: true -}, AST_Boolean); - -/* -----[ Walk function ]---- */ - -/** - * Walk nodes in depth-first search fashion. - * Callback can return `walk_abort` symbol to stop iteration. - * It can also return `true` to stop iteration just for child nodes. - * Iteration can be stopped and continued by passing the `to_visit` argument, - * which is given to the callback in the second argument. - **/ -function walk(node, cb, to_visit = [node]) { - const push = to_visit.push.bind(to_visit); - while (to_visit.length) { - const node = to_visit.pop(); - const ret = cb(node, to_visit); - - if (ret) { - if (ret === walk_abort) return true; - continue; - } - - node._children_backwards(push); - } - return false; -} - -/** - * Walks an AST node and its children. - * - * {cb} can return `walk_abort` to interrupt the walk. - * - * @param node - * @param cb {(node, info: { parent: (nth) => any }) => (boolean | undefined)} - * - * @returns {boolean} whether the walk was aborted - * - * @example - * const found_some_cond = walk_parent(my_ast_node, (node, { parent }) => { - * if (some_cond(node, parent())) return walk_abort - * }); - */ -function walk_parent(node, cb, initial_stack) { - const to_visit = [node]; - const push = to_visit.push.bind(to_visit); - const stack = initial_stack ? initial_stack.slice() : []; - const parent_pop_indices = []; - - let current; - - const info = { - parent: (n = 0) => { - if (n === -1) { - return current; - } - - // [ p1 p0 ] [ 1 0 ] - if (initial_stack && n >= stack.length) { - n -= stack.length; - return initial_stack[ - initial_stack.length - (n + 1) - ]; - } - - return stack[stack.length - (1 + n)]; - }, - }; - - while (to_visit.length) { - current = to_visit.pop(); - - while ( - parent_pop_indices.length && - to_visit.length == parent_pop_indices[parent_pop_indices.length - 1] - ) { - stack.pop(); - parent_pop_indices.pop(); - } - - const ret = cb(current, info); - - if (ret) { - if (ret === walk_abort) return true; - continue; - } - - const visit_length = to_visit.length; - - current._children_backwards(push); - - // Push only if we're going to traverse the children - if (to_visit.length > visit_length) { - stack.push(current); - parent_pop_indices.push(visit_length - 1); - } - } - - return false; -} - -const walk_abort = Symbol("abort walk"); - -/* -----[ TreeWalker ]----- */ - -class TreeWalker { - constructor(callback) { - this.visit = callback; - this.stack = []; - this.directives = Object.create(null); - } - - _visit(node, descend) { - this.push(node); - var ret = this.visit(node, descend ? function() { - descend.call(node); - } : noop); - if (!ret && descend) { - descend.call(node); - } - this.pop(); - return ret; - } - - parent(n) { - return this.stack[this.stack.length - 2 - (n || 0)]; - } - - push(node) { - if (node instanceof AST_Lambda) { - this.directives = Object.create(this.directives); - } else if (node instanceof AST_Directive && !this.directives[node.value]) { - this.directives[node.value] = node; - } else if (node instanceof AST_Class) { - this.directives = Object.create(this.directives); - if (!this.directives["use strict"]) { - this.directives["use strict"] = node; - } - } - this.stack.push(node); - } - - pop() { - var node = this.stack.pop(); - if (node instanceof AST_Lambda || node instanceof AST_Class) { - this.directives = Object.getPrototypeOf(this.directives); - } - } - - self() { - return this.stack[this.stack.length - 1]; - } - - find_parent(type) { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof type) return x; - } - } - - find_scope() { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - const p = stack[i]; - if (p instanceof AST_Toplevel) return p; - if (p instanceof AST_Lambda) return p; - if (p.block_scope) return p.block_scope; - } - } - - has_directive(type) { - var dir = this.directives[type]; - if (dir) return dir; - var node = this.stack[this.stack.length - 1]; - if (node instanceof AST_Scope && node.body) { - for (var i = 0; i < node.body.length; ++i) { - var st = node.body[i]; - if (!(st instanceof AST_Directive)) break; - if (st.value == type) return st; - } - } - } - - loopcontrol_target(node) { - var stack = this.stack; - if (node.label) for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_LabeledStatement && x.label.name == node.label.name) - return x.body; - } else for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_IterationStatement - || node instanceof AST_Break && x instanceof AST_Switch) - return x; - } - } -} - -// Tree transformer helpers. -class TreeTransformer extends TreeWalker { - constructor(before, after) { - super(); - this.before = before; - this.after = after; - } -} - -const _PURE = 0b00000001; -const _INLINE = 0b00000010; -const _NOINLINE = 0b00000100; -const _KEY = 0b00001000; -const _MANGLEPROP = 0b00010000; - -export { - AST_Accessor, - AST_Array, - AST_Arrow, - AST_Assign, - AST_Atom, - AST_Await, - AST_BigInt, - AST_Binary, - AST_Block, - AST_BlockStatement, - AST_Boolean, - AST_Break, - AST_Call, - AST_Case, - AST_Catch, - AST_Chain, - AST_Class, - AST_ClassExpression, - AST_ClassPrivateProperty, - AST_PrivateIn, - AST_ClassProperty, - AST_ClassStaticBlock, - AST_ConciseMethod, - AST_Conditional, - AST_Const, - AST_Constant, - AST_Continue, - AST_Debugger, - AST_Default, - AST_DefaultAssign, - AST_DefClass, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DotHash, - AST_DWLoop, - AST_EmptyStatement, - AST_Exit, - AST_Expansion, - AST_Export, - AST_False, - AST_Finally, - AST_For, - AST_ForIn, - AST_ForOf, - AST_Function, - AST_Hole, - AST_If, - AST_Import, - AST_ImportMeta, - AST_Infinity, - AST_IterationStatement, - AST_Jump, - AST_Label, - AST_LabeledStatement, - AST_LabelRef, - AST_Lambda, - AST_Let, - AST_LoopControl, - AST_NameMapping, - AST_NaN, - AST_New, - AST_NewTarget, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PrefixedTemplateString, - AST_PrivateGetter, - AST_PrivateMethod, - AST_PrivateSetter, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Statement, - AST_StatementWithBody, - AST_String, - AST_Sub, - AST_Super, - AST_Switch, - AST_SwitchBranch, - AST_Symbol, - AST_SymbolBlockDeclaration, - AST_SymbolCatch, - AST_SymbolClass, - AST_SymbolClassProperty, - AST_SymbolConst, - AST_SymbolDeclaration, - AST_SymbolDefClass, - AST_SymbolDefun, - AST_SymbolExport, - AST_SymbolExportForeign, - AST_SymbolFunarg, - AST_SymbolImport, - AST_SymbolImportForeign, - AST_SymbolLambda, - AST_SymbolLet, - AST_SymbolMethod, - AST_SymbolRef, - AST_SymbolVar, - AST_TemplateSegment, - AST_TemplateString, - AST_SymbolPrivateProperty, - AST_This, - AST_Throw, - AST_Token, - AST_Toplevel, - AST_True, - AST_Try, - AST_TryBlock, - AST_Unary, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Undefined, - AST_Var, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, - - // Walkers - TreeTransformer, - TreeWalker, - walk, - walk_abort, - walk_body, - walk_parent, - - // annotations - _INLINE, - _NOINLINE, - _PURE, - _KEY, - _MANGLEPROP, -}; diff --git a/node_modules/terser/lib/cli.js b/node_modules/terser/lib/cli.js deleted file mode 100644 index 1ec2cc4..0000000 --- a/node_modules/terser/lib/cli.js +++ /dev/null @@ -1,481 +0,0 @@ -import { minify, _default_options } from "../main.js"; -import { parse } from "./parse.js"; -import { - AST_Assign, - AST_Array, - AST_Constant, - AST_Node, - AST_PropAccess, - AST_RegExp, - AST_Sequence, - AST_Symbol, - AST_Token, - walk -} from "./ast.js"; -import { OutputStream } from "./output.js"; - -export async function run_cli({ program, packageJson, fs, path }) { - const skip_keys = new Set([ "cname", "parent_scope", "scope", "uses_eval", "uses_with" ]); - var files = {}; - var options = { - compress: false, - mangle: false - }; - const default_options = await _default_options(); - program.version(packageJson.name + " " + packageJson.version); - program.parseArgv = program.parse; - program.parse = undefined; - - if (process.argv.includes("ast")) program.helpInformation = describe_ast; - else if (process.argv.includes("options")) program.helpInformation = function() { - var text = []; - for (var option in default_options) { - text.push("--" + (option === "sourceMap" ? "source-map" : option) + " options:"); - text.push(format_object(default_options[option])); - text.push(""); - } - return text.join("\n"); - }; - - program.option("-p, --parse ", "Specify parser options.", parse_js()); - program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js()); - program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js()); - program.option("--mangle-props [options]", "Mangle properties/specify mangler options.", parse_js()); - program.option("-f, --format [options]", "Format options.", parse_js()); - program.option("-b, --beautify [options]", "Alias for --format.", parse_js()); - program.option("-o, --output ", "Output file (default STDOUT)."); - program.option("--comments [filter]", "Preserve copyright comments in the output."); - program.option("--config-file ", "Read minify() options from JSON file."); - program.option("-d, --define [=value]", "Global definitions.", parse_js("define")); - program.option("--ecma ", "Specify ECMAScript release: 5, 2015, 2016 or 2017..."); - program.option("-e, --enclose [arg[,...][:value[,...]]]", "Embed output in a big function with configurable arguments and values."); - program.option("--ie8", "Support non-standard Internet Explorer 8."); - program.option("--keep-classnames", "Do not mangle/drop class names."); - program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); - program.option("--module", "Input is an ES6 module"); - program.option("--name-cache ", "File to hold mangled name mappings."); - program.option("--rename", "Force symbol expansion."); - program.option("--no-rename", "Disable symbol expansion."); - program.option("--safari10", "Support non-standard Safari 10."); - program.option("--source-map [options]", "Enable source map/specify source map options.", parse_js()); - program.option("--timings", "Display operations run time on STDERR."); - program.option("--toplevel", "Compress and/or mangle variables in toplevel scope."); - program.option("--wrap ", "Embed everything as a function with “exports” corresponding to “name” globally."); - program.arguments("[files...]").parseArgv(process.argv); - if (program.configFile) { - options = JSON.parse(read_file(program.configFile)); - } - if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { - fatal("ERROR: cannot write source map to STDOUT"); - } - - [ - "compress", - "enclose", - "ie8", - "mangle", - "module", - "safari10", - "sourceMap", - "toplevel", - "wrap" - ].forEach(function(name) { - if (name in program) { - options[name] = program[name]; - } - }); - - if ("ecma" in program) { - if (program.ecma != (program.ecma | 0)) fatal("ERROR: ecma must be an integer"); - const ecma = program.ecma | 0; - if (ecma > 5 && ecma < 2015) - options.ecma = ecma + 2009; - else - options.ecma = ecma; - } - if (program.format || program.beautify) { - const chosenOption = program.format || program.beautify; - options.format = typeof chosenOption === "object" ? chosenOption : {}; - } - if (program.comments) { - if (typeof options.format != "object") options.format = {}; - options.format.comments = typeof program.comments == "string" ? (program.comments == "false" ? false : program.comments) : "some"; - } - if (program.define) { - if (typeof options.compress != "object") options.compress = {}; - if (typeof options.compress.global_defs != "object") options.compress.global_defs = {}; - for (var expr in program.define) { - options.compress.global_defs[expr] = program.define[expr]; - } - } - if (program.keepClassnames) { - options.keep_classnames = true; - } - if (program.keepFnames) { - options.keep_fnames = true; - } - if (program.mangleProps) { - if (program.mangleProps.domprops) { - delete program.mangleProps.domprops; - } else { - if (typeof program.mangleProps != "object") program.mangleProps = {}; - if (!Array.isArray(program.mangleProps.reserved)) program.mangleProps.reserved = []; - } - if (typeof options.mangle != "object") options.mangle = {}; - options.mangle.properties = program.mangleProps; - } - if (program.nameCache) { - options.nameCache = JSON.parse(read_file(program.nameCache, "{}")); - } - if (program.output == "ast") { - options.format = { - ast: true, - code: false - }; - } - if (program.parse) { - if (!program.parse.acorn && !program.parse.spidermonkey) { - options.parse = program.parse; - } else if (program.sourceMap && program.sourceMap.content == "inline") { - fatal("ERROR: inline source map only works with built-in parser"); - } - } - if (~program.rawArgs.indexOf("--rename")) { - options.rename = true; - } else if (!program.rename) { - options.rename = false; - } - - let convert_path = name => name; - if (typeof program.sourceMap == "object" && "base" in program.sourceMap) { - convert_path = function() { - var base = program.sourceMap.base; - delete options.sourceMap.base; - return function(name) { - return path.relative(base, name); - }; - }(); - } - - let filesList; - if (options.files && options.files.length) { - filesList = options.files; - - delete options.files; - } else if (program.args.length) { - filesList = program.args; - } - - if (filesList) { - simple_glob(filesList).forEach(function(name) { - files[convert_path(name)] = read_file(name); - }); - } else { - await new Promise((resolve) => { - var chunks = []; - process.stdin.setEncoding("utf8"); - process.stdin.on("data", function(chunk) { - chunks.push(chunk); - }).on("end", function() { - files = [ chunks.join("") ]; - resolve(); - }); - process.stdin.resume(); - }); - } - - await run_cli(); - - function convert_ast(fn) { - return AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null)); - } - - async function run_cli() { - var content = program.sourceMap && program.sourceMap.content; - if (content && content !== "inline") { - options.sourceMap.content = read_file(content, content); - } - if (program.timings) options.timings = true; - - try { - if (program.parse) { - if (program.parse.acorn) { - files = convert_ast(function(toplevel, name) { - return require("acorn").parse(files[name], { - ecmaVersion: 2018, - locations: true, - program: toplevel, - sourceFile: name, - sourceType: options.module || program.parse.module ? "module" : "script" - }); - }); - } else if (program.parse.spidermonkey) { - files = convert_ast(function(toplevel, name) { - var obj = JSON.parse(files[name]); - if (!toplevel) return obj; - toplevel.body = toplevel.body.concat(obj.body); - return toplevel; - }); - } - } - } catch (ex) { - fatal(ex); - } - - let result; - try { - result = await minify(files, options, fs); - } catch (ex) { - if (ex.name == "SyntaxError") { - print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); - var col = ex.col; - var lines = files[ex.filename].split(/\r?\n/); - var line = lines[ex.line - 1]; - if (!line && !col) { - line = lines[ex.line - 2]; - col = line.length; - } - if (line) { - var limit = 70; - if (col > limit) { - line = line.slice(col - limit); - col = limit; - } - print_error(line.slice(0, 80)); - print_error(line.slice(0, col).replace(/\S/g, " ") + "^"); - } - } - if (ex.defs) { - print_error("Supported options:"); - print_error(format_object(ex.defs)); - } - fatal(ex); - return; - } - - if (program.output == "ast") { - if (!options.compress && !options.mangle) { - result.ast.figure_out_scope({}); - } - console.log(JSON.stringify(result.ast, function(key, value) { - if (value) switch (key) { - case "thedef": - return symdef(value); - case "enclosed": - return value.length ? value.map(symdef) : undefined; - case "variables": - case "globals": - return value.size ? collect_from_map(value, symdef) : undefined; - } - if (skip_keys.has(key)) return; - if (value instanceof AST_Token) return; - if (value instanceof Map) return; - if (value instanceof AST_Node) { - var result = { - _class: "AST_" + value.TYPE - }; - if (value.block_scope) { - result.variables = value.block_scope.variables; - result.enclosed = value.block_scope.enclosed; - } - value.CTOR.PROPS.forEach(function(prop) { - if (prop !== "block_scope") { - result[prop] = value[prop]; - } - }); - return result; - } - return value; - }, 2)); - } else if (program.output == "spidermonkey") { - try { - const minified = await minify( - result.code, - { - compress: false, - mangle: false, - format: { - ast: true, - code: false - } - }, - fs - ); - console.log(JSON.stringify(minified.ast.to_mozilla_ast(), null, 2)); - } catch (ex) { - fatal(ex); - return; - } - } else if (program.output) { - fs.writeFileSync(program.output, result.code); - if (options.sourceMap && options.sourceMap.url !== "inline" && result.map) { - fs.writeFileSync(program.output + ".map", result.map); - } - } else { - console.log(result.code); - } - if (program.nameCache) { - fs.writeFileSync(program.nameCache, JSON.stringify(options.nameCache)); - } - if (result.timings) for (var phase in result.timings) { - print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s"); - } - } - - function fatal(message) { - if (message instanceof Error) message = message.stack.replace(/^\S*?Error:/, "ERROR:"); - print_error(message); - process.exit(1); - } - - // A file glob function that only supports "*" and "?" wildcards in the basename. - // Example: "foo/bar/*baz??.*.js" - // Argument `glob` may be a string or an array of strings. - // Returns an array of strings. Garbage in, garbage out. - function simple_glob(glob) { - if (Array.isArray(glob)) { - return [].concat.apply([], glob.map(simple_glob)); - } - if (glob && glob.match(/[*?]/)) { - var dir = path.dirname(glob); - try { - var entries = fs.readdirSync(dir); - } catch (ex) {} - if (entries) { - var pattern = "^" + path.basename(glob) - .replace(/[.+^$[\]\\(){}]/g, "\\$&") - .replace(/\*/g, "[^/\\\\]*") - .replace(/\?/g, "[^/\\\\]") + "$"; - var mod = process.platform === "win32" ? "i" : ""; - var rx = new RegExp(pattern, mod); - var results = entries.filter(function(name) { - return rx.test(name); - }).map(function(name) { - return path.join(dir, name); - }); - if (results.length) return results; - } - } - return [ glob ]; - } - - function read_file(path, default_value) { - try { - return fs.readFileSync(path, "utf8"); - } catch (ex) { - if ((ex.code == "ENOENT" || ex.code == "ENAMETOOLONG") && default_value != null) return default_value; - fatal(ex); - } - } - - function parse_js(flag) { - return function(value, options) { - options = options || {}; - try { - walk(parse(value, { expression: true }), node => { - if (node instanceof AST_Assign) { - var name = node.left.print_to_string(); - var value = node.right; - if (flag) { - options[name] = value; - } else if (value instanceof AST_Array) { - options[name] = value.elements.map(to_string); - } else if (value instanceof AST_RegExp) { - value = value.value; - options[name] = new RegExp(value.source, value.flags); - } else { - options[name] = to_string(value); - } - return true; - } - if (node instanceof AST_Symbol || node instanceof AST_PropAccess) { - var name = node.print_to_string(); - options[name] = true; - return true; - } - if (!(node instanceof AST_Sequence)) throw node; - - function to_string(value) { - return value instanceof AST_Constant ? value.getValue() : value.print_to_string({ - quote_keys: true - }); - } - }); - } catch(ex) { - if (flag) { - fatal("Error parsing arguments for '" + flag + "': " + value); - } else { - options[value] = null; - } - } - return options; - }; - } - - function symdef(def) { - var ret = (1e6 + def.id) + " " + def.name; - if (def.mangled_name) ret += " " + def.mangled_name; - return ret; - } - - function collect_from_map(map, callback) { - var result = []; - map.forEach(function (def) { - result.push(callback(def)); - }); - return result; - } - - function format_object(obj) { - var lines = []; - var padding = ""; - Object.keys(obj).map(function(name) { - if (padding.length < name.length) padding = Array(name.length + 1).join(" "); - return [ name, JSON.stringify(obj[name]) ]; - }).forEach(function(tokens) { - lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]); - }); - return lines.join("\n"); - } - - function print_error(msg) { - process.stderr.write(msg); - process.stderr.write("\n"); - } - - function describe_ast() { - var out = OutputStream({ beautify: true }); - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - const props = ctor.SELF_PROPS.filter(prop => !/^\$/.test(prop)); - - if (props.length > 0) { - out.space(); - out.with_parens(function() { - props.forEach(function(prop, i) { - if (i) out.space(); - out.print(prop); - }); - }); - } - - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function() { - ctor.SUBCLASSES.forEach(function(ctor) { - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - } - doitem(AST_Node); - return out + "\n"; - } -} diff --git a/node_modules/terser/lib/compress/common.js b/node_modules/terser/lib/compress/common.js deleted file mode 100644 index 0b6cac5..0000000 --- a/node_modules/terser/lib/compress/common.js +++ /dev/null @@ -1,348 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Array, - AST_Arrow, - AST_BlockStatement, - AST_Call, - AST_Chain, - AST_Class, - AST_Const, - AST_Constant, - AST_DefClass, - AST_Defun, - AST_EmptyStatement, - AST_Export, - AST_False, - AST_Function, - AST_Import, - AST_Infinity, - AST_LabeledStatement, - AST_Lambda, - AST_Let, - AST_LoopControl, - AST_NaN, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectKeyVal, - AST_PropAccess, - AST_RegExp, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Statement, - AST_String, - AST_SymbolRef, - AST_True, - AST_UnaryPrefix, - AST_Undefined, - - TreeWalker, - walk, - walk_abort, - walk_parent, -} from "../ast.js"; -import { make_node, regexp_source_fix, string_template, makePredicate } from "../utils/index.js"; -import { first_in_statement } from "../utils/first_in_statement.js"; -import { has_flag, TOP } from "./compressor-flags.js"; - -export function merge_sequence(array, node) { - if (node instanceof AST_Sequence) { - array.push(...node.expressions); - } else { - array.push(node); - } - return array; -} - -export function make_sequence(orig, expressions) { - if (expressions.length == 1) return expressions[0]; - if (expressions.length == 0) throw new Error("trying to create a sequence with length zero!"); - return make_node(AST_Sequence, orig, { - expressions: expressions.reduce(merge_sequence, []) - }); -} - -export function make_node_from_constant(val, orig) { - switch (typeof val) { - case "string": - return make_node(AST_String, orig, { - value: val - }); - case "number": - if (isNaN(val)) return make_node(AST_NaN, orig); - if (isFinite(val)) { - return 1 / val < 0 ? make_node(AST_UnaryPrefix, orig, { - operator: "-", - expression: make_node(AST_Number, orig, { value: -val }) - }) : make_node(AST_Number, orig, { value: val }); - } - return val < 0 ? make_node(AST_UnaryPrefix, orig, { - operator: "-", - expression: make_node(AST_Infinity, orig) - }) : make_node(AST_Infinity, orig); - case "boolean": - return make_node(val ? AST_True : AST_False, orig); - case "undefined": - return make_node(AST_Undefined, orig); - default: - if (val === null) { - return make_node(AST_Null, orig, { value: null }); - } - if (val instanceof RegExp) { - return make_node(AST_RegExp, orig, { - value: { - source: regexp_source_fix(val.source), - flags: val.flags - } - }); - } - throw new Error(string_template("Can't handle constant of type: {type}", { - type: typeof val - })); - } -} - -export function best_of_expression(ast1, ast2) { - return ast1.size() > ast2.size() ? ast2 : ast1; -} - -export function best_of_statement(ast1, ast2) { - return best_of_expression( - make_node(AST_SimpleStatement, ast1, { - body: ast1 - }), - make_node(AST_SimpleStatement, ast2, { - body: ast2 - }) - ).body; -} - -/** Find which node is smaller, and return that */ -export function best_of(compressor, ast1, ast2) { - if (first_in_statement(compressor)) { - return best_of_statement(ast1, ast2); - } else { - return best_of_expression(ast1, ast2); - } -} - -/** Simplify an object property's key, if possible */ -export function get_simple_key(key) { - if (key instanceof AST_Constant) { - return key.getValue(); - } - if (key instanceof AST_UnaryPrefix - && key.operator == "void" - && key.expression instanceof AST_Constant) { - return; - } - return key; -} - -export function read_property(obj, key) { - key = get_simple_key(key); - if (key instanceof AST_Node) return; - - var value; - if (obj instanceof AST_Array) { - var elements = obj.elements; - if (key == "length") return make_node_from_constant(elements.length, obj); - if (typeof key == "number" && key in elements) value = elements[key]; - } else if (obj instanceof AST_Object) { - key = "" + key; - var props = obj.properties; - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - if (!(prop instanceof AST_ObjectKeyVal)) return; - if (!value && props[i].key === key) value = props[i].value; - } - } - - return value instanceof AST_SymbolRef && value.fixed_value() || value; -} - -export function has_break_or_continue(loop, parent) { - var found = false; - var tw = new TreeWalker(function(node) { - if (found || node instanceof AST_Scope) return true; - if (node instanceof AST_LoopControl && tw.loopcontrol_target(node) === loop) { - return found = true; - } - }); - if (parent instanceof AST_LabeledStatement) tw.push(parent); - tw.push(loop); - loop.body.walk(tw); - return found; -} - -// we shouldn't compress (1,func)(something) to -// func(something) because that changes the meaning of -// the func (becomes lexical instead of global). -export function maintain_this_binding(parent, orig, val) { - if ( - parent instanceof AST_UnaryPrefix && parent.operator == "delete" - || parent instanceof AST_Call && parent.expression === orig - && ( - val instanceof AST_Chain - || val instanceof AST_PropAccess - || val instanceof AST_SymbolRef && val.name == "eval" - ) - ) { - const zero = make_node(AST_Number, orig, { value: 0 }); - return make_sequence(orig, [ zero, val ]); - } else { - return val; - } -} - -export function is_func_expr(node) { - return node instanceof AST_Arrow || node instanceof AST_Function; -} - -/** - * Used to determine whether the node can benefit from negation. - * Not the case with arrow functions (you need an extra set of parens). */ -export function is_iife_call(node) { - if (node.TYPE != "Call") return false; - return node.expression instanceof AST_Function || is_iife_call(node.expression); -} - -export function is_empty(thing) { - if (thing === null) return true; - if (thing instanceof AST_EmptyStatement) return true; - if (thing instanceof AST_BlockStatement) return thing.body.length == 0; - return false; -} - -export const identifier_atom = makePredicate("Infinity NaN undefined"); -export function is_identifier_atom(node) { - return node instanceof AST_Infinity - || node instanceof AST_NaN - || node instanceof AST_Undefined; -} - -/** Check if this is a SymbolRef node which has one def of a certain AST type */ -export function is_ref_of(ref, type) { - if (!(ref instanceof AST_SymbolRef)) return false; - var orig = ref.definition().orig; - for (var i = orig.length; --i >= 0;) { - if (orig[i] instanceof type) return true; - } -} - -/**Can we turn { block contents... } into just the block contents ? - * Not if one of these is inside. - **/ -export function can_be_evicted_from_block(node) { - return !( - node instanceof AST_DefClass || - node instanceof AST_Defun || - node instanceof AST_Let || - node instanceof AST_Const || - node instanceof AST_Export || - node instanceof AST_Import - ); -} - -export function as_statement_array(thing) { - if (thing === null) return []; - if (thing instanceof AST_BlockStatement) return thing.body; - if (thing instanceof AST_EmptyStatement) return []; - if (thing instanceof AST_Statement) return [ thing ]; - throw new Error("Can't convert thing to statement array"); -} - -export function is_reachable(scope_node, defs) { - const find_ref = node => { - if (node instanceof AST_SymbolRef && defs.includes(node.definition())) { - return walk_abort; - } - }; - - return walk_parent(scope_node, (node, info) => { - if (node instanceof AST_Scope && node !== scope_node) { - var parent = info.parent(); - - if ( - parent instanceof AST_Call - && parent.expression === node - // Async/Generators aren't guaranteed to sync evaluate all of - // their body steps, so it's possible they close over the variable. - && !(node.async || node.is_generator) - ) { - return; - } - - if (walk(node, find_ref)) return walk_abort; - - return true; - } - }); -} - -/** Check if a ref refers to the name of a function/class it's defined within */ -export function is_recursive_ref(compressor, def) { - var node; - for (var i = 0; node = compressor.parent(i); i++) { - if (node instanceof AST_Lambda || node instanceof AST_Class) { - var name = node.name; - if (name && name.definition() === def) { - return true; - } - } - } - return false; -} - -// TODO this only works with AST_Defun, shouldn't it work for other ways of defining functions? -export function retain_top_func(fn, compressor) { - return compressor.top_retain - && fn instanceof AST_Defun - && has_flag(fn, TOP) - && fn.name - && compressor.top_retain(fn.name.definition()); -} diff --git a/node_modules/terser/lib/compress/compressor-flags.js b/node_modules/terser/lib/compress/compressor-flags.js deleted file mode 100644 index 1341658..0000000 --- a/node_modules/terser/lib/compress/compressor-flags.js +++ /dev/null @@ -1,63 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -// bitfield flags to be stored in node.flags. -// These are set and unset during compression, and store information in the node without requiring multiple fields. -export const UNUSED = 0b00000001; -export const TRUTHY = 0b00000010; -export const FALSY = 0b00000100; -export const UNDEFINED = 0b00001000; -export const INLINED = 0b00010000; - -// Nodes to which values are ever written. Used when keep_assign is part of the unused option string. -export const WRITE_ONLY = 0b00100000; - -// information specific to a single compression pass -export const SQUEEZED = 0b0000000100000000; -export const OPTIMIZED = 0b0000001000000000; -export const TOP = 0b0000010000000000; -export const CLEAR_BETWEEN_PASSES = SQUEEZED | OPTIMIZED | TOP; - -export const has_flag = (node, flag) => node.flags & flag; -export const set_flag = (node, flag) => { node.flags |= flag; }; -export const clear_flag = (node, flag) => { node.flags &= ~flag; }; diff --git a/node_modules/terser/lib/compress/drop-side-effect-free.js b/node_modules/terser/lib/compress/drop-side-effect-free.js deleted file mode 100644 index 8f31df7..0000000 --- a/node_modules/terser/lib/compress/drop-side-effect-free.js +++ /dev/null @@ -1,375 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Accessor, - AST_Array, - AST_Arrow, - AST_Assign, - AST_Binary, - AST_Call, - AST_Chain, - AST_Class, - AST_ClassStaticBlock, - AST_ClassProperty, - AST_ConciseMethod, - AST_Conditional, - AST_Constant, - AST_DefClass, - AST_Dot, - AST_Expansion, - AST_Function, - AST_Node, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PropAccess, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Sub, - AST_SymbolRef, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_Unary, -} from "../ast.js"; -import { make_node, return_null, return_this } from "../utils/index.js"; -import { first_in_statement } from "../utils/first_in_statement.js"; - -import { pure_prop_access_globals } from "./native-objects.js"; -import { lazy_op, unary_side_effects, is_nullish_shortcircuited } from "./inference.js"; -import { WRITE_ONLY, set_flag, clear_flag } from "./compressor-flags.js"; -import { make_sequence, is_func_expr, is_iife_call } from "./common.js"; - -// AST_Node#drop_side_effect_free() gets called when we don't care about the value, -// only about side effects. We'll be defining this method for each node type in this module -// -// Examples: -// foo++ -> foo++ -// 1 + func() -> func() -// 10 -> (nothing) -// knownPureFunc(foo++) -> foo++ - -function def_drop_side_effect_free(node, func) { - node.DEFMETHOD("drop_side_effect_free", func); -} - -// Drop side-effect-free elements from an array of expressions. -// Returns an array of expressions with side-effects or null -// if all elements were dropped. Note: original array may be -// returned if nothing changed. -function trim(nodes, compressor, first_in_statement) { - var len = nodes.length; - if (!len) return null; - - var ret = [], changed = false; - for (var i = 0; i < len; i++) { - var node = nodes[i].drop_side_effect_free(compressor, first_in_statement); - changed |= node !== nodes[i]; - if (node) { - ret.push(node); - first_in_statement = false; - } - } - return changed ? ret.length ? ret : null : nodes; -} - -def_drop_side_effect_free(AST_Node, return_this); -def_drop_side_effect_free(AST_Constant, return_null); -def_drop_side_effect_free(AST_This, return_null); - -def_drop_side_effect_free(AST_Call, function (compressor, first_in_statement) { - if (is_nullish_shortcircuited(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - - if (!this.is_callee_pure(compressor)) { - if (this.expression.is_call_pure(compressor)) { - var exprs = this.args.slice(); - exprs.unshift(this.expression.expression); - exprs = trim(exprs, compressor, first_in_statement); - return exprs && make_sequence(this, exprs); - } - if (is_func_expr(this.expression) - && (!this.expression.name || !this.expression.name.definition().references.length)) { - var node = this.clone(); - node.expression.process_expression(false, compressor); - return node; - } - return this; - } - - var args = trim(this.args, compressor, first_in_statement); - return args && make_sequence(this, args); -}); - -def_drop_side_effect_free(AST_Accessor, return_null); - -def_drop_side_effect_free(AST_Function, return_null); - -def_drop_side_effect_free(AST_Arrow, return_null); - -def_drop_side_effect_free(AST_Class, function (compressor) { - const with_effects = []; - const trimmed_extends = this.extends && this.extends.drop_side_effect_free(compressor); - if (trimmed_extends) - with_effects.push(trimmed_extends); - - for (const prop of this.properties) { - if (prop instanceof AST_ClassStaticBlock) { - if (prop.has_side_effects(compressor)) { - return this; // Be cautious about these - } - } else { - const trimmed_prop = prop.drop_side_effect_free(compressor); - if (trimmed_prop) { - if (trimmed_prop.contains_this()) return this; - - with_effects.push(trimmed_prop); - } - } - } - - if (!with_effects.length) - return null; - - const exprs = make_sequence(this, with_effects); - if (this instanceof AST_DefClass) { - // We want a statement - return make_node(AST_SimpleStatement, this, { body: exprs }); - } else { - return exprs; - } -}); - -def_drop_side_effect_free(AST_ClassProperty, function (compressor) { - const key = this.computed_key() && this.key.drop_side_effect_free(compressor); - - const value = this.static && this.value - && this.value.drop_side_effect_free(compressor); - - if (key && value) - return make_sequence(this, [key, value]); - return key || value || null; -}); - -def_drop_side_effect_free(AST_Binary, function (compressor, first_in_statement) { - var right = this.right.drop_side_effect_free(compressor); - if (!right) - return this.left.drop_side_effect_free(compressor, first_in_statement); - if (lazy_op.has(this.operator)) { - if (right === this.right) - return this; - var node = this.clone(); - node.right = right; - return node; - } else { - var left = this.left.drop_side_effect_free(compressor, first_in_statement); - if (!left) - return this.right.drop_side_effect_free(compressor, first_in_statement); - return make_sequence(this, [left, right]); - } -}); - -def_drop_side_effect_free(AST_Assign, function (compressor) { - if (this.logical) - return this; - - var left = this.left; - if (left.has_side_effects(compressor) - || compressor.has_directive("use strict") - && left instanceof AST_PropAccess - && left.expression.is_constant()) { - return this; - } - set_flag(this, WRITE_ONLY); - while (left instanceof AST_PropAccess) { - left = left.expression; - } - if (left.is_constant_expression(compressor.find_parent(AST_Scope))) { - return this.right.drop_side_effect_free(compressor); - } - return this; -}); - -def_drop_side_effect_free(AST_Conditional, function (compressor) { - var consequent = this.consequent.drop_side_effect_free(compressor); - var alternative = this.alternative.drop_side_effect_free(compressor); - if (consequent === this.consequent && alternative === this.alternative) - return this; - if (!consequent) - return alternative ? make_node(AST_Binary, this, { - operator: "||", - left: this.condition, - right: alternative - }) : this.condition.drop_side_effect_free(compressor); - if (!alternative) - return make_node(AST_Binary, this, { - operator: "&&", - left: this.condition, - right: consequent - }); - var node = this.clone(); - node.consequent = consequent; - node.alternative = alternative; - return node; -}); - -def_drop_side_effect_free(AST_Unary, function (compressor, first_in_statement) { - if (unary_side_effects.has(this.operator)) { - if (!this.expression.has_side_effects(compressor)) { - set_flag(this, WRITE_ONLY); - } else { - clear_flag(this, WRITE_ONLY); - } - return this; - } - if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) - return null; - var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); - if (first_in_statement && expression && is_iife_call(expression)) { - if (expression === this.expression && this.operator == "!") - return this; - return expression.negate(compressor, first_in_statement); - } - return expression; -}); - -def_drop_side_effect_free(AST_SymbolRef, function (compressor) { - const safe_access = this.is_declared(compressor) - || pure_prop_access_globals.has(this.name); - return safe_access ? null : this; -}); - -def_drop_side_effect_free(AST_Object, function (compressor, first_in_statement) { - var values = trim(this.properties, compressor, first_in_statement); - return values && make_sequence(this, values); -}); - -def_drop_side_effect_free(AST_ObjectProperty, function (compressor, first_in_statement) { - const computed_key = this instanceof AST_ObjectKeyVal && this.key instanceof AST_Node; - const key = computed_key && this.key.drop_side_effect_free(compressor, first_in_statement); - const value = this.value && this.value.drop_side_effect_free(compressor, first_in_statement); - if (key && value) { - return make_sequence(this, [key, value]); - } - return key || value; -}); - -def_drop_side_effect_free(AST_ConciseMethod, function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free(AST_ObjectGetter, function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free(AST_ObjectSetter, function () { - return this.computed_key() ? this.key : null; -}); - -def_drop_side_effect_free(AST_Array, function (compressor, first_in_statement) { - var values = trim(this.elements, compressor, first_in_statement); - return values && make_sequence(this, values); -}); - -def_drop_side_effect_free(AST_Dot, function (compressor, first_in_statement) { - if (is_nullish_shortcircuited(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return this; - } - - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(AST_Sub, function (compressor, first_in_statement) { - if (is_nullish_shortcircuited(this, compressor)) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return this; - } - - var property = this.property.drop_side_effect_free(compressor); - if (property && this.optional) return this; - - var expression = this.expression.drop_side_effect_free(compressor, first_in_statement); - - if (expression && property) return make_sequence(this, [expression, property]); - return expression || property; -}); - -def_drop_side_effect_free(AST_Chain, function (compressor, first_in_statement) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(AST_Sequence, function (compressor) { - var last = this.tail_node(); - var expr = last.drop_side_effect_free(compressor); - if (expr === last) - return this; - var expressions = this.expressions.slice(0, -1); - if (expr) - expressions.push(expr); - if (!expressions.length) { - return make_node(AST_Number, this, { value: 0 }); - } - return make_sequence(this, expressions); -}); - -def_drop_side_effect_free(AST_Expansion, function (compressor, first_in_statement) { - return this.expression.drop_side_effect_free(compressor, first_in_statement); -}); - -def_drop_side_effect_free(AST_TemplateSegment, return_null); - -def_drop_side_effect_free(AST_TemplateString, function (compressor) { - var values = trim(this.segments, compressor, first_in_statement); - return values && make_sequence(this, values); -}); diff --git a/node_modules/terser/lib/compress/drop-unused.js b/node_modules/terser/lib/compress/drop-unused.js deleted file mode 100644 index b743f1d..0000000 --- a/node_modules/terser/lib/compress/drop-unused.js +++ /dev/null @@ -1,482 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Accessor, - AST_Assign, - AST_BlockStatement, - AST_Class, - AST_ClassExpression, - AST_ClassStaticBlock, - AST_DefaultAssign, - AST_DefClass, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_EmptyStatement, - AST_Expansion, - AST_Export, - AST_For, - AST_ForIn, - AST_Function, - AST_LabeledStatement, - AST_Lambda, - AST_Number, - AST_Scope, - AST_SimpleStatement, - AST_SymbolBlockDeclaration, - AST_SymbolCatch, - AST_SymbolDeclaration, - AST_SymbolFunarg, - AST_SymbolRef, - AST_SymbolVar, - AST_Toplevel, - AST_Unary, - AST_Var, - - TreeTransformer, - TreeWalker, - walk, -} from "../ast.js"; -import { - keep_name, - make_node, - map_add, - MAP, - remove, - return_false, -} from "../utils/index.js"; -import { SymbolDef } from "../scope.js"; - -import { - WRITE_ONLY, - UNUSED, - - has_flag, - set_flag, -} from "./compressor-flags.js"; -import { - make_sequence, - maintain_this_binding, - is_empty, - is_ref_of, - can_be_evicted_from_block, -} from "./common.js"; - -const r_keep_assign = /keep_assign/; - -/** Drop unused variables from this scope */ -AST_Scope.DEFMETHOD("drop_unused", function(compressor) { - if (!compressor.option("unused")) return; - if (compressor.has_directive("use asm")) return; - if (!this.variables) return; // not really a scope (eg: AST_Class) - - var self = this; - if (self.pinned()) return; - var drop_funcs = !(self instanceof AST_Toplevel) || compressor.toplevel.funcs; - var drop_vars = !(self instanceof AST_Toplevel) || compressor.toplevel.vars; - const assign_as_unused = r_keep_assign.test(compressor.option("unused")) ? return_false : function(node) { - if (node instanceof AST_Assign - && !node.logical - && (has_flag(node, WRITE_ONLY) || node.operator == "=") - ) { - return node.left; - } - if (node instanceof AST_Unary && has_flag(node, WRITE_ONLY)) { - return node.expression; - } - }; - var in_use_ids = new Map(); - var fixed_ids = new Map(); - if (self instanceof AST_Toplevel && compressor.top_retain) { - self.variables.forEach(function(def) { - if (compressor.top_retain(def)) { - in_use_ids.set(def.id, def); - } - }); - } - var var_defs_by_id = new Map(); - var initializations = new Map(); - // pass 1: find out which symbols are directly used in - // this scope (not in nested scopes). - var scope = this; - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) { - node.argnames.forEach(function(argname) { - if (!(argname instanceof AST_SymbolDeclaration)) return; - var def = argname.definition(); - in_use_ids.set(def.id, def); - }); - } - if (node === self) return; - if (node instanceof AST_Class) { - if (node.has_side_effects(compressor)) { - node.visit_nondeferred_class_parts(tw); - } - } - if (node instanceof AST_Defun || node instanceof AST_DefClass) { - var node_def = node.name.definition(); - const in_export = tw.parent() instanceof AST_Export; - if (in_export || !drop_funcs && scope === self) { - if (node_def.global) { - in_use_ids.set(node_def.id, node_def); - } - } - - map_add(initializations, node_def.id, node); - return true; // don't go in nested scopes - } - // In the root scope, we drop things. In inner scopes, we just check for uses. - const in_root_scope = scope === self; - if (node instanceof AST_SymbolFunarg && in_root_scope) { - map_add(var_defs_by_id, node.definition().id, node); - } - if (node instanceof AST_Definitions && in_root_scope) { - const in_export = tw.parent() instanceof AST_Export; - node.definitions.forEach(function(def) { - if (def.name instanceof AST_SymbolVar) { - map_add(var_defs_by_id, def.name.definition().id, def); - } - if (in_export || !drop_vars) { - walk(def.name, node => { - if (node instanceof AST_SymbolDeclaration) { - const def = node.definition(); - if (def.global) { - in_use_ids.set(def.id, def); - } - } - }); - } - if (def.name instanceof AST_Destructuring) { - def.walk(tw); - } - if (def.name instanceof AST_SymbolDeclaration && def.value) { - var node_def = def.name.definition(); - map_add(initializations, node_def.id, def.value); - if (!node_def.chained && def.name.fixed_value() === def.value) { - fixed_ids.set(node_def.id, def); - } - if (def.value.has_side_effects(compressor)) { - def.value.walk(tw); - } - } - }); - return true; - } - return scan_ref_scoped(node, descend); - }); - self.walk(tw); - // pass 2: for every used symbol we need to walk its - // initialization code to figure out if it uses other - // symbols (that may not be in_use). - tw = new TreeWalker(scan_ref_scoped); - in_use_ids.forEach(function (def) { - var init = initializations.get(def.id); - if (init) init.forEach(function(init) { - init.walk(tw); - }); - }); - // pass 3: we should drop declarations not in_use - var tt = new TreeTransformer( - function before(node, descend, in_list) { - var parent = tt.parent(); - if (drop_vars) { - const sym = assign_as_unused(node); - if (sym instanceof AST_SymbolRef) { - var def = sym.definition(); - var in_use = in_use_ids.has(def.id); - if (node instanceof AST_Assign) { - if (!in_use || fixed_ids.has(def.id) && fixed_ids.get(def.id) !== node) { - return maintain_this_binding(parent, node, node.right.transform(tt)); - } - } else if (!in_use) { - return in_list ? MAP.skip : make_node(AST_Number, node, { value: 0 }); - } - } - } - if (scope !== self) return; - var def; - if (node.name - && (node instanceof AST_ClassExpression - && !keep_name(compressor.option("keep_classnames"), (def = node.name.definition()).name) - || node instanceof AST_Function - && !keep_name(compressor.option("keep_fnames"), (def = node.name.definition()).name))) { - // any declarations with same name will overshadow - // name of this anonymous function and can therefore - // never be used anywhere - if (!in_use_ids.has(def.id) || def.orig.length > 1) node.name = null; - } - if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) { - var trim = !compressor.option("keep_fargs"); - for (var a = node.argnames, i = a.length; --i >= 0;) { - var sym = a[i]; - if (sym instanceof AST_Expansion) { - sym = sym.expression; - } - if (sym instanceof AST_DefaultAssign) { - sym = sym.left; - } - // Do not drop destructuring arguments. - // They constitute a type assertion of sorts - if ( - !(sym instanceof AST_Destructuring) - && !in_use_ids.has(sym.definition().id) - ) { - set_flag(sym, UNUSED); - if (trim) { - a.pop(); - } - } else { - trim = false; - } - } - } - if (node instanceof AST_DefClass && node !== self) { - const def = node.name.definition(); - descend(node, this); - const keep_class = def.global && !drop_funcs || in_use_ids.has(def.id); - if (!keep_class) { - const kept = node.drop_side_effect_free(compressor); - if (kept == null) { - def.eliminated++; - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - } - return kept; - } - return node; - } - if (node instanceof AST_Defun && node !== self) { - const def = node.name.definition(); - const keep = def.global && !drop_funcs || in_use_ids.has(def.id); - if (!keep) { - def.eliminated++; - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - } - } - if (node instanceof AST_Definitions && !(parent instanceof AST_ForIn && parent.init === node)) { - var drop_block = !(parent instanceof AST_Toplevel) && !(node instanceof AST_Var); - // place uninitialized names at the start - var body = [], head = [], tail = []; - // for unused names whose initialization has - // side effects, we can cascade the init. code - // into the next one, or next statement. - var side_effects = []; - node.definitions.forEach(function(def) { - if (def.value) def.value = def.value.transform(tt); - var is_destructure = def.name instanceof AST_Destructuring; - var sym = is_destructure - ? new SymbolDef(null, { name: "" }) /* fake SymbolDef */ - : def.name.definition(); - if (drop_block && sym.global) return tail.push(def); - if (!(drop_vars || drop_block) - || is_destructure - && (def.name.names.length - || def.name.is_array - || compressor.option("pure_getters") != true) - || in_use_ids.has(sym.id) - ) { - if (def.value && fixed_ids.has(sym.id) && fixed_ids.get(sym.id) !== def) { - def.value = def.value.drop_side_effect_free(compressor); - } - if (def.name instanceof AST_SymbolVar) { - var var_defs = var_defs_by_id.get(sym.id); - if (var_defs.length > 1 && (!def.value || sym.orig.indexOf(def.name) > sym.eliminated)) { - if (def.value) { - var ref = make_node(AST_SymbolRef, def.name, def.name); - sym.references.push(ref); - var assign = make_node(AST_Assign, def, { - operator: "=", - logical: false, - left: ref, - right: def.value - }); - if (fixed_ids.get(sym.id) === def) { - fixed_ids.set(sym.id, assign); - } - side_effects.push(assign.transform(tt)); - } - remove(var_defs, def); - sym.eliminated++; - return; - } - } - if (def.value) { - if (side_effects.length > 0) { - if (tail.length > 0) { - side_effects.push(def.value); - def.value = make_sequence(def.value, side_effects); - } else { - body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(node, side_effects) - })); - } - side_effects = []; - } - tail.push(def); - } else { - head.push(def); - } - } else if (sym.orig[0] instanceof AST_SymbolCatch) { - var value = def.value && def.value.drop_side_effect_free(compressor); - if (value) side_effects.push(value); - def.value = null; - head.push(def); - } else { - var value = def.value && def.value.drop_side_effect_free(compressor); - if (value) { - side_effects.push(value); - } - sym.eliminated++; - } - }); - if (head.length > 0 || tail.length > 0) { - node.definitions = head.concat(tail); - body.push(node); - } - if (side_effects.length > 0) { - body.push(make_node(AST_SimpleStatement, node, { - body: make_sequence(node, side_effects) - })); - } - switch (body.length) { - case 0: - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - case 1: - return body[0]; - default: - return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, { body }); - } - } - // certain combination of unused name + side effect leads to: - // https://github.com/mishoo/UglifyJS2/issues/44 - // https://github.com/mishoo/UglifyJS2/issues/1830 - // https://github.com/mishoo/UglifyJS2/issues/1838 - // that's an invalid AST. - // We fix it at this stage by moving the `var` outside the `for`. - if (node instanceof AST_For) { - descend(node, this); - var block; - if (node.init instanceof AST_BlockStatement) { - block = node.init; - node.init = block.body.pop(); - block.body.push(node); - } - if (node.init instanceof AST_SimpleStatement) { - node.init = node.init.body; - } else if (is_empty(node.init)) { - node.init = null; - } - return !block ? node : in_list ? MAP.splice(block.body) : block; - } - if (node instanceof AST_LabeledStatement - && node.body instanceof AST_For - ) { - descend(node, this); - if (node.body instanceof AST_BlockStatement) { - var block = node.body; - node.body = block.body.pop(); - block.body.push(node); - return in_list ? MAP.splice(block.body) : block; - } - return node; - } - if (node instanceof AST_BlockStatement) { - descend(node, this); - if (in_list && node.body.every(can_be_evicted_from_block)) { - return MAP.splice(node.body); - } - return node; - } - if (node instanceof AST_Scope && !(node instanceof AST_ClassStaticBlock)) { - const save_scope = scope; - scope = node; - descend(node, this); - scope = save_scope; - return node; - } - } - ); - - self.transform(tt); - - function scan_ref_scoped(node, descend) { - var node_def; - const sym = assign_as_unused(node); - if (sym instanceof AST_SymbolRef - && !is_ref_of(node.left, AST_SymbolBlockDeclaration) - && self.variables.get(sym.name) === (node_def = sym.definition()) - ) { - if (node instanceof AST_Assign) { - node.right.walk(tw); - if (!node_def.chained && node.left.fixed_value() === node.right) { - fixed_ids.set(node_def.id, node); - } - } - return true; - } - if (node instanceof AST_SymbolRef) { - node_def = node.definition(); - if (!in_use_ids.has(node_def.id)) { - in_use_ids.set(node_def.id, node_def); - if (node_def.orig[0] instanceof AST_SymbolCatch) { - const redef = node_def.scope.is_block_scope() - && node_def.scope.get_defun_scope().variables.get(node_def.name); - if (redef) in_use_ids.set(redef.id, redef); - } - } - return true; - } - if (node instanceof AST_Class) { - descend(); - return true; - } - if (node instanceof AST_Scope && !(node instanceof AST_ClassStaticBlock)) { - var save_scope = scope; - scope = node; - descend(); - scope = save_scope; - return true; - } - } -}); - diff --git a/node_modules/terser/lib/compress/evaluate.js b/node_modules/terser/lib/compress/evaluate.js deleted file mode 100644 index d249ee3..0000000 --- a/node_modules/terser/lib/compress/evaluate.js +++ /dev/null @@ -1,488 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - HOP, - makePredicate, - return_this, - string_template, - regexp_source_fix, - regexp_is_safe, -} from "../utils/index.js"; -import { - AST_Array, - AST_BigInt, - AST_Binary, - AST_Call, - AST_Chain, - AST_Class, - AST_Conditional, - AST_Constant, - AST_Dot, - AST_Expansion, - AST_Function, - AST_Lambda, - AST_New, - AST_Node, - AST_Object, - AST_PropAccess, - AST_RegExp, - AST_Statement, - AST_Symbol, - AST_SymbolRef, - AST_TemplateString, - AST_UnaryPrefix, - AST_With, -} from "../ast.js"; -import { is_undeclared_ref} from "./inference.js"; -import { is_pure_native_value, is_pure_native_fn, is_pure_native_method } from "./native-objects.js"; - -// methods to evaluate a constant expression - -function def_eval(node, func) { - node.DEFMETHOD("_eval", func); -} - -// Used to propagate a nullish short-circuit signal upwards through the chain. -export const nullish = Symbol("This AST_Chain is nullish"); - -// If the node has been successfully reduced to a constant, -// then its value is returned; otherwise the element itself -// is returned. -// They can be distinguished as constant value is never a -// descendant of AST_Node. -AST_Node.DEFMETHOD("evaluate", function (compressor) { - if (!compressor.option("evaluate")) - return this; - var val = this._eval(compressor, 1); - if (!val || val instanceof RegExp) - return val; - if (typeof val == "function" || typeof val == "object" || val == nullish) - return this; - - // Evaluated strings can be larger than the original expression - if (typeof val === "string") { - const unevaluated_size = this.size(compressor); - if (val.length + 2 > unevaluated_size) return this; - } - - return val; -}); - -var unaryPrefix = makePredicate("! ~ - + void"); -AST_Node.DEFMETHOD("is_constant", function () { - // Accomodate when compress option evaluate=false - // as well as the common constant expressions !0 and -1 - if (this instanceof AST_Constant) { - return !(this instanceof AST_RegExp); - } else { - return this instanceof AST_UnaryPrefix - && this.expression instanceof AST_Constant - && unaryPrefix.has(this.operator); - } -}); - -def_eval(AST_Statement, function () { - throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); -}); - -def_eval(AST_Lambda, return_this); -def_eval(AST_Class, return_this); -def_eval(AST_Node, return_this); -def_eval(AST_Constant, function () { - return this.getValue(); -}); - -def_eval(AST_BigInt, return_this); - -def_eval(AST_RegExp, function (compressor) { - let evaluated = compressor.evaluated_regexps.get(this.value); - if (evaluated === undefined && regexp_is_safe(this.value.source)) { - try { - const { source, flags } = this.value; - evaluated = new RegExp(source, flags); - } catch (e) { - evaluated = null; - } - compressor.evaluated_regexps.set(this.value, evaluated); - } - return evaluated || this; -}); - -def_eval(AST_TemplateString, function () { - if (this.segments.length !== 1) return this; - return this.segments[0].value; -}); - -def_eval(AST_Function, function (compressor) { - if (compressor.option("unsafe")) { - var fn = function () { }; - fn.node = this; - fn.toString = () => this.print_to_string(); - return fn; - } - return this; -}); - -def_eval(AST_Array, function (compressor, depth) { - if (compressor.option("unsafe")) { - var elements = []; - for (var i = 0, len = this.elements.length; i < len; i++) { - var element = this.elements[i]; - var value = element._eval(compressor, depth); - if (element === value) - return this; - elements.push(value); - } - return elements; - } - return this; -}); - -def_eval(AST_Object, function (compressor, depth) { - if (compressor.option("unsafe")) { - var val = {}; - for (var i = 0, len = this.properties.length; i < len; i++) { - var prop = this.properties[i]; - if (prop instanceof AST_Expansion) - return this; - var key = prop.key; - if (key instanceof AST_Symbol) { - key = key.name; - } else if (key instanceof AST_Node) { - key = key._eval(compressor, depth); - if (key === prop.key) - return this; - } - if (typeof Object.prototype[key] === "function") { - return this; - } - if (prop.value instanceof AST_Function) - continue; - val[key] = prop.value._eval(compressor, depth); - if (val[key] === prop.value) - return this; - } - return val; - } - return this; -}); - -var non_converting_unary = makePredicate("! typeof void"); -def_eval(AST_UnaryPrefix, function (compressor, depth) { - var e = this.expression; - // Function would be evaluated to an array and so typeof would - // incorrectly return 'object'. Hence making is a special case. - if (compressor.option("typeofs") - && this.operator == "typeof" - && (e instanceof AST_Lambda - || e instanceof AST_SymbolRef - && e.fixed_value() instanceof AST_Lambda)) { - return typeof function () { }; - } - if (!non_converting_unary.has(this.operator)) - depth++; - e = e._eval(compressor, depth); - if (e === this.expression) - return this; - switch (this.operator) { - case "!": return !e; - case "typeof": - // typeof returns "object" or "function" on different platforms - // so cannot evaluate reliably - if (e instanceof RegExp) - return this; - return typeof e; - case "void": return void e; - case "~": return ~e; - case "-": return -e; - case "+": return +e; - } - return this; -}); - -var non_converting_binary = makePredicate("&& || ?? === !=="); -const identity_comparison = makePredicate("== != === !=="); -const has_identity = value => typeof value === "object" - || typeof value === "function" - || typeof value === "symbol"; - -def_eval(AST_Binary, function (compressor, depth) { - if (!non_converting_binary.has(this.operator)) - depth++; - - var left = this.left._eval(compressor, depth); - if (left === this.left) - return this; - var right = this.right._eval(compressor, depth); - if (right === this.right) - return this; - var result; - - if (left != null - && right != null - && identity_comparison.has(this.operator) - && has_identity(left) - && has_identity(right) - && typeof left === typeof right) { - // Do not compare by reference - return this; - } - - switch (this.operator) { - case "&&": result = left && right; break; - case "||": result = left || right; break; - case "??": result = left != null ? left : right; break; - case "|": result = left | right; break; - case "&": result = left & right; break; - case "^": result = left ^ right; break; - case "+": result = left + right; break; - case "*": result = left * right; break; - case "**": result = Math.pow(left, right); break; - case "/": result = left / right; break; - case "%": result = left % right; break; - case "-": result = left - right; break; - case "<<": result = left << right; break; - case ">>": result = left >> right; break; - case ">>>": result = left >>> right; break; - case "==": result = left == right; break; - case "===": result = left === right; break; - case "!=": result = left != right; break; - case "!==": result = left !== right; break; - case "<": result = left < right; break; - case "<=": result = left <= right; break; - case ">": result = left > right; break; - case ">=": result = left >= right; break; - default: - return this; - } - if (isNaN(result) && compressor.find_parent(AST_With)) { - // leave original expression as is - return this; - } - return result; -}); - -def_eval(AST_Conditional, function (compressor, depth) { - var condition = this.condition._eval(compressor, depth); - if (condition === this.condition) - return this; - var node = condition ? this.consequent : this.alternative; - var value = node._eval(compressor, depth); - return value === node ? this : value; -}); - -// Set of AST_SymbolRef which are currently being evaluated. -// Avoids infinite recursion of ._eval() -const reentrant_ref_eval = new Set(); -def_eval(AST_SymbolRef, function (compressor, depth) { - if (reentrant_ref_eval.has(this)) - return this; - - var fixed = this.fixed_value(); - if (!fixed) - return this; - - reentrant_ref_eval.add(this); - const value = fixed._eval(compressor, depth); - reentrant_ref_eval.delete(this); - - if (value === fixed) - return this; - - if (value && typeof value == "object") { - var escaped = this.definition().escaped; - if (escaped && depth > escaped) - return this; - } - return value; -}); - -const global_objs = { Array, Math, Number, Object, String }; - -const regexp_flags = new Set([ - "dotAll", - "global", - "ignoreCase", - "multiline", - "sticky", - "unicode", -]); - -def_eval(AST_PropAccess, function (compressor, depth) { - let obj = this.expression._eval(compressor, depth + 1); - if (obj === nullish || (this.optional && obj == null)) return nullish; - - // `.length` of strings and arrays is always safe - if (this.property === "length") { - if (typeof obj === "string") { - return obj.length; - } - - const is_spreadless_array = - obj instanceof AST_Array - && obj.elements.every(el => !(el instanceof AST_Expansion)); - - if ( - is_spreadless_array - && obj.elements.every(el => !el.has_side_effects(compressor)) - ) { - return obj.elements.length; - } - } - - if (compressor.option("unsafe")) { - var key = this.property; - if (key instanceof AST_Node) { - key = key._eval(compressor, depth); - if (key === this.property) - return this; - } - - var exp = this.expression; - if (is_undeclared_ref(exp)) { - var aa; - var first_arg = exp.name === "hasOwnProperty" - && key === "call" - && (aa = compressor.parent() && compressor.parent().args) - && (aa && aa[0] - && aa[0].evaluate(compressor)); - - first_arg = first_arg instanceof AST_Dot ? first_arg.expression : first_arg; - - if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) { - return this.clone(); - } - if (!is_pure_native_value(exp.name, key)) - return this; - obj = global_objs[exp.name]; - } else { - if (obj instanceof RegExp) { - if (key == "source") { - return regexp_source_fix(obj.source); - } else if (key == "flags" || regexp_flags.has(key)) { - return obj[key]; - } - } - if (!obj || obj === exp || !HOP(obj, key)) - return this; - - if (typeof obj == "function") - switch (key) { - case "name": - return obj.node.name ? obj.node.name.name : ""; - case "length": - return obj.node.length_property(); - default: - return this; - } - } - return obj[key]; - } - return this; -}); - -def_eval(AST_Chain, function (compressor, depth) { - const evaluated = this.expression._eval(compressor, depth); - return evaluated === nullish - ? undefined - : evaluated === this.expression - ? this - : evaluated; -}); - -def_eval(AST_Call, function (compressor, depth) { - var exp = this.expression; - - const callee = exp._eval(compressor, depth); - if (callee === nullish || (this.optional && callee == null)) return nullish; - - if (compressor.option("unsafe") && exp instanceof AST_PropAccess) { - var key = exp.property; - if (key instanceof AST_Node) { - key = key._eval(compressor, depth); - if (key === exp.property) - return this; - } - var val; - var e = exp.expression; - if (is_undeclared_ref(e)) { - var first_arg = e.name === "hasOwnProperty" && - key === "call" && - (this.args[0] && this.args[0].evaluate(compressor)); - - first_arg = first_arg instanceof AST_Dot ? first_arg.expression : first_arg; - - if ((first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)) { - return this.clone(); - } - if (!is_pure_native_fn(e.name, key)) return this; - val = global_objs[e.name]; - } else { - val = e._eval(compressor, depth + 1); - if (val === e || !val) - return this; - if (!is_pure_native_method(val.constructor.name, key)) - return this; - } - var args = []; - for (var i = 0, len = this.args.length; i < len; i++) { - var arg = this.args[i]; - var value = arg._eval(compressor, depth); - if (arg === value) - return this; - if (arg instanceof AST_Lambda) - return this; - args.push(value); - } - try { - return val[key].apply(val, args); - } catch (ex) { - // We don't really care - } - } - return this; -}); - -// Also a subclass of AST_Call -def_eval(AST_New, return_this); diff --git a/node_modules/terser/lib/compress/global-defs.js b/node_modules/terser/lib/compress/global-defs.js deleted file mode 100644 index e9eb7f5..0000000 --- a/node_modules/terser/lib/compress/global-defs.js +++ /dev/null @@ -1,92 +0,0 @@ -import { - AST_Array, - AST_Chain, - AST_Constant, - AST_Dot, - AST_ImportMeta, - AST_Node, - AST_Object, - AST_ObjectKeyVal, - AST_PropAccess, - AST_SymbolDeclaration, - AST_SymbolRef, - AST_Toplevel, - TreeTransformer, -} from "../ast.js"; -import { make_node, noop, HOP } from "../utils/index.js"; -import { make_node_from_constant } from "./common.js"; -import { is_lhs } from "./inference.js"; - -(function(def_find_defs) { - function to_node(value, orig) { - if (value instanceof AST_Node) { - if (!(value instanceof AST_Constant)) { - // Value may be a function, an array including functions and even a complex assign / block expression, - // so it should never be shared in different places. - // Otherwise wrong information may be used in the compression phase - value = value.clone(true); - } - return make_node(value.CTOR, orig, value); - } - if (Array.isArray(value)) return make_node(AST_Array, orig, { - elements: value.map(function(value) { - return to_node(value, orig); - }) - }); - if (value && typeof value == "object") { - var props = []; - for (var key in value) if (HOP(value, key)) { - props.push(make_node(AST_ObjectKeyVal, orig, { - key: key, - value: to_node(value[key], orig) - })); - } - return make_node(AST_Object, orig, { - properties: props - }); - } - return make_node_from_constant(value, orig); - } - - AST_Toplevel.DEFMETHOD("resolve_defines", function(compressor) { - if (!compressor.option("global_defs")) return this; - this.figure_out_scope({ ie8: compressor.option("ie8") }); - return this.transform(new TreeTransformer(function(node) { - var def = node._find_defs(compressor, ""); - if (!def) return; - var level = 0, child = node, parent; - while (parent = this.parent(level++)) { - if (!(parent instanceof AST_PropAccess)) break; - if (parent.expression !== child) break; - child = parent; - } - if (is_lhs(child, parent)) { - return; - } - return def; - })); - }); - def_find_defs(AST_Node, noop); - def_find_defs(AST_Chain, function(compressor, suffix) { - return this.expression._find_defs(compressor, suffix); - }); - def_find_defs(AST_Dot, function(compressor, suffix) { - return this.expression._find_defs(compressor, "." + this.property + suffix); - }); - def_find_defs(AST_SymbolDeclaration, function() { - if (!this.global()) return; - }); - def_find_defs(AST_SymbolRef, function(compressor, suffix) { - if (!this.global()) return; - var defines = compressor.option("global_defs"); - var name = this.name + suffix; - if (HOP(defines, name)) return to_node(defines[name], this); - }); - def_find_defs(AST_ImportMeta, function(compressor, suffix) { - var defines = compressor.option("global_defs"); - var name = "import.meta" + suffix; - if (HOP(defines, name)) return to_node(defines[name], this); - }); -})(function(node, func) { - node.DEFMETHOD("_find_defs", func); -}); diff --git a/node_modules/terser/lib/compress/index.js b/node_modules/terser/lib/compress/index.js deleted file mode 100644 index 879d55b..0000000 --- a/node_modules/terser/lib/compress/index.js +++ /dev/null @@ -1,3795 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Accessor, - AST_Array, - AST_Arrow, - AST_Assign, - AST_BigInt, - AST_Binary, - AST_Block, - AST_BlockStatement, - AST_Boolean, - AST_Break, - AST_Call, - AST_Catch, - AST_Chain, - AST_Class, - AST_ClassProperty, - AST_ClassStaticBlock, - AST_ConciseMethod, - AST_Conditional, - AST_Const, - AST_Constant, - AST_Debugger, - AST_Default, - AST_DefaultAssign, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DWLoop, - AST_EmptyStatement, - AST_Exit, - AST_Expansion, - AST_Export, - AST_False, - AST_For, - AST_ForIn, - AST_Function, - AST_Hole, - AST_If, - AST_Import, - AST_Infinity, - AST_LabeledStatement, - AST_Lambda, - AST_Let, - AST_NaN, - AST_New, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_PrefixedTemplateString, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Statement, - AST_String, - AST_Sub, - AST_Switch, - AST_SwitchBranch, - AST_Symbol, - AST_SymbolClassProperty, - AST_SymbolDeclaration, - AST_SymbolDefun, - AST_SymbolExport, - AST_SymbolFunarg, - AST_SymbolLambda, - AST_SymbolLet, - AST_SymbolMethod, - AST_SymbolRef, - AST_TemplateString, - AST_This, - AST_Toplevel, - AST_True, - AST_Try, - AST_Unary, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Undefined, - AST_Var, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, - - TreeTransformer, - TreeWalker, - walk, - walk_abort, - - _NOINLINE, -} from "../ast.js"; -import { - defaults, - HOP, - make_node, - makePredicate, - MAP, - remove, - return_false, - return_true, - regexp_source_fix, - has_annotation, - regexp_is_safe, -} from "../utils/index.js"; -import { first_in_statement } from "../utils/first_in_statement.js"; -import { equivalent_to } from "../equivalent-to.js"; -import { - is_basic_identifier_string, - JS_Parse_Error, - parse, - PRECEDENCE, -} from "../parse.js"; -import { OutputStream } from "../output.js"; -import { base54, format_mangler_options } from "../scope.js"; -import "../size.js"; - -import "./evaluate.js"; -import "./drop-side-effect-free.js"; -import "./drop-unused.js"; -import "./reduce-vars.js"; -import { - is_undeclared_ref, - lazy_op, - is_nullish, - is_undefined, - is_lhs, - aborts, -} from "./inference.js"; -import { - SQUEEZED, - OPTIMIZED, - CLEAR_BETWEEN_PASSES, - TOP, - UNDEFINED, - UNUSED, - TRUTHY, - FALSY, - - has_flag, - set_flag, - clear_flag, -} from "./compressor-flags.js"; -import { - make_sequence, - best_of, - best_of_expression, - make_node_from_constant, - merge_sequence, - get_simple_key, - has_break_or_continue, - maintain_this_binding, - is_empty, - is_identifier_atom, - is_reachable, - can_be_evicted_from_block, - as_statement_array, - is_func_expr, -} from "./common.js"; -import { tighten_body, trim_unreachable_code } from "./tighten-body.js"; -import { inline_into_symbolref, inline_into_call } from "./inline.js"; -import "./global-defs.js"; - -class Compressor extends TreeWalker { - constructor(options, { false_by_default = false, mangle_options = false }) { - super(); - if (options.defaults !== undefined && !options.defaults) false_by_default = true; - this.options = defaults(options, { - arguments : false, - arrows : !false_by_default, - booleans : !false_by_default, - booleans_as_integers : false, - collapse_vars : !false_by_default, - comparisons : !false_by_default, - computed_props: !false_by_default, - conditionals : !false_by_default, - dead_code : !false_by_default, - defaults : true, - directives : !false_by_default, - drop_console : false, - drop_debugger : !false_by_default, - ecma : 5, - evaluate : !false_by_default, - expression : false, - global_defs : false, - hoist_funs : false, - hoist_props : !false_by_default, - hoist_vars : false, - ie8 : false, - if_return : !false_by_default, - inline : !false_by_default, - join_vars : !false_by_default, - keep_classnames: false, - keep_fargs : true, - keep_fnames : false, - keep_infinity : false, - lhs_constants : !false_by_default, - loops : !false_by_default, - module : false, - negate_iife : !false_by_default, - passes : 1, - properties : !false_by_default, - pure_getters : !false_by_default && "strict", - pure_funcs : null, - pure_new : false, - reduce_funcs : !false_by_default, - reduce_vars : !false_by_default, - sequences : !false_by_default, - side_effects : !false_by_default, - switches : !false_by_default, - top_retain : null, - toplevel : !!(options && options["top_retain"]), - typeofs : !false_by_default, - unsafe : false, - unsafe_arrows : false, - unsafe_comps : false, - unsafe_Function: false, - unsafe_math : false, - unsafe_symbols: false, - unsafe_methods: false, - unsafe_proto : false, - unsafe_regexp : false, - unsafe_undefined: false, - unused : !false_by_default, - warnings : false // legacy - }, true); - var global_defs = this.options["global_defs"]; - if (typeof global_defs == "object") for (var key in global_defs) { - if (key[0] === "@" && HOP(global_defs, key)) { - global_defs[key.slice(1)] = parse(global_defs[key], { - expression: true - }); - } - } - if (this.options["inline"] === true) this.options["inline"] = 3; - var pure_funcs = this.options["pure_funcs"]; - if (typeof pure_funcs == "function") { - this.pure_funcs = pure_funcs; - } else { - this.pure_funcs = pure_funcs ? function(node) { - return !pure_funcs.includes(node.expression.print_to_string()); - } : return_true; - } - var top_retain = this.options["top_retain"]; - if (top_retain instanceof RegExp) { - this.top_retain = function(def) { - return top_retain.test(def.name); - }; - } else if (typeof top_retain == "function") { - this.top_retain = top_retain; - } else if (top_retain) { - if (typeof top_retain == "string") { - top_retain = top_retain.split(/,/); - } - this.top_retain = function(def) { - return top_retain.includes(def.name); - }; - } - if (this.options["module"]) { - this.directives["use strict"] = true; - this.options["toplevel"] = true; - } - var toplevel = this.options["toplevel"]; - this.toplevel = typeof toplevel == "string" ? { - funcs: /funcs/.test(toplevel), - vars: /vars/.test(toplevel) - } : { - funcs: toplevel, - vars: toplevel - }; - var sequences = this.options["sequences"]; - this.sequences_limit = sequences == 1 ? 800 : sequences | 0; - this.evaluated_regexps = new Map(); - this._toplevel = undefined; - this._mangle_options = mangle_options - ? format_mangler_options(mangle_options) - : mangle_options; - } - - mangle_options() { - var nth_identifier = this._mangle_options && this._mangle_options.nth_identifier || base54; - var module = this._mangle_options && this._mangle_options.module || this.option("module"); - return { ie8: this.option("ie8"), nth_identifier, module }; - } - - option(key) { - return this.options[key]; - } - - exposed(def) { - if (def.export) return true; - if (def.global) for (var i = 0, len = def.orig.length; i < len; i++) - if (!this.toplevel[def.orig[i] instanceof AST_SymbolDefun ? "funcs" : "vars"]) - return true; - return false; - } - - in_boolean_context() { - if (!this.option("booleans")) return false; - var self = this.self(); - for (var i = 0, p; p = this.parent(i); i++) { - if (p instanceof AST_SimpleStatement - || p instanceof AST_Conditional && p.condition === self - || p instanceof AST_DWLoop && p.condition === self - || p instanceof AST_For && p.condition === self - || p instanceof AST_If && p.condition === self - || p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self) { - return true; - } - if ( - p instanceof AST_Binary - && ( - p.operator == "&&" - || p.operator == "||" - || p.operator == "??" - ) - || p instanceof AST_Conditional - || p.tail_node() === self - ) { - self = p; - } else { - return false; - } - } - } - - get_toplevel() { - return this._toplevel; - } - - compress(toplevel) { - toplevel = toplevel.resolve_defines(this); - this._toplevel = toplevel; - if (this.option("expression")) { - this._toplevel.process_expression(true); - } - var passes = +this.options.passes || 1; - var min_count = 1 / 0; - var stopping = false; - var mangle = this.mangle_options(); - for (var pass = 0; pass < passes; pass++) { - this._toplevel.figure_out_scope(mangle); - if (pass === 0 && this.option("drop_console")) { - // must be run before reduce_vars and compress pass - this._toplevel = this._toplevel.drop_console(this.option("drop_console")); - } - if (pass > 0 || this.option("reduce_vars")) { - this._toplevel.reset_opt_flags(this); - } - this._toplevel = this._toplevel.transform(this); - if (passes > 1) { - let count = 0; - walk(this._toplevel, () => { count++; }); - if (count < min_count) { - min_count = count; - stopping = false; - } else if (stopping) { - break; - } else { - stopping = true; - } - } - } - if (this.option("expression")) { - this._toplevel.process_expression(false); - } - toplevel = this._toplevel; - this._toplevel = undefined; - return toplevel; - } - - before(node, descend) { - if (has_flag(node, SQUEEZED)) return node; - var was_scope = false; - if (node instanceof AST_Scope) { - node = node.hoist_properties(this); - node = node.hoist_declarations(this); - was_scope = true; - } - // Before https://github.com/mishoo/UglifyJS2/pull/1602 AST_Node.optimize() - // would call AST_Node.transform() if a different instance of AST_Node is - // produced after def_optimize(). - // This corrupts TreeWalker.stack, which cause AST look-ups to malfunction. - // Migrate and defer all children's AST_Node.transform() to below, which - // will now happen after this parent AST_Node has been properly substituted - // thus gives a consistent AST snapshot. - descend(node, this); - // Existing code relies on how AST_Node.optimize() worked, and omitting the - // following replacement call would result in degraded efficiency of both - // output and performance. - descend(node, this); - var opt = node.optimize(this); - if (was_scope && opt instanceof AST_Scope) { - opt.drop_unused(this); - descend(opt, this); - } - if (opt === node) set_flag(opt, SQUEEZED); - return opt; - } - - /** Alternative to plain is_lhs() which doesn't work within .optimize() */ - is_lhs() { - const self = this.stack[this.stack.length - 1]; - const parent = this.stack[this.stack.length - 2]; - return is_lhs(self, parent); - } -} - -function def_optimize(node, optimizer) { - node.DEFMETHOD("optimize", function(compressor) { - var self = this; - if (has_flag(self, OPTIMIZED)) return self; - if (compressor.has_directive("use asm")) return self; - var opt = optimizer(self, compressor); - set_flag(opt, OPTIMIZED); - return opt; - }); -} - -def_optimize(AST_Node, function(self) { - return self; -}); - -AST_Toplevel.DEFMETHOD("drop_console", function(options) { - var isArray = Array.isArray(options); - - return this.transform(new TreeTransformer(function(self) { - if (self.TYPE !== "Call") { - return; - } - - var exp = self.expression; - - if (!(exp instanceof AST_PropAccess)) { - return; - } - - if (isArray && options.indexOf(exp.property) === -1) { - return; - } - - var name = exp.expression; - while (name.expression) { - name = name.expression; - } - if (is_undeclared_ref(name) && name.name == "console") { - return make_node(AST_Undefined, self); - } - })); -}); - -AST_Node.DEFMETHOD("equivalent_to", function(node) { - return equivalent_to(this, node); -}); - -AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { - var self = this; - var tt = new TreeTransformer(function(node) { - if (insert && node instanceof AST_SimpleStatement) { - return make_node(AST_Return, node, { - value: node.body - }); - } - if (!insert && node instanceof AST_Return) { - if (compressor) { - var value = node.value && node.value.drop_side_effect_free(compressor, true); - return value - ? make_node(AST_SimpleStatement, node, { body: value }) - : make_node(AST_EmptyStatement, node); - } - return make_node(AST_SimpleStatement, node, { - body: node.value || make_node(AST_UnaryPrefix, node, { - operator: "void", - expression: make_node(AST_Number, node, { - value: 0 - }) - }) - }); - } - if (node instanceof AST_Class || node instanceof AST_Lambda && node !== self) { - return node; - } - if (node instanceof AST_Block) { - var index = node.body.length - 1; - if (index >= 0) { - node.body[index] = node.body[index].transform(tt); - } - } else if (node instanceof AST_If) { - node.body = node.body.transform(tt); - if (node.alternative) { - node.alternative = node.alternative.transform(tt); - } - } else if (node instanceof AST_With) { - node.body = node.body.transform(tt); - } - return node; - }); - self.transform(tt); -}); - -AST_Toplevel.DEFMETHOD("reset_opt_flags", function(compressor) { - const self = this; - const reduce_vars = compressor.option("reduce_vars"); - - const preparation = new TreeWalker(function(node, descend) { - clear_flag(node, CLEAR_BETWEEN_PASSES); - if (reduce_vars) { - if (compressor.top_retain - && node instanceof AST_Defun // Only functions are retained - && preparation.parent() === self - ) { - set_flag(node, TOP); - } - return node.reduce_vars(preparation, descend, compressor); - } - }); - // Stack of look-up tables to keep track of whether a `SymbolDef` has been - // properly assigned before use: - // - `push()` & `pop()` when visiting conditional branches - preparation.safe_ids = Object.create(null); - preparation.in_loop = null; - preparation.loop_ids = new Map(); - preparation.defs_to_safe_ids = new Map(); - self.walk(preparation); -}); - -AST_Symbol.DEFMETHOD("fixed_value", function() { - var fixed = this.thedef.fixed; - if (!fixed || fixed instanceof AST_Node) return fixed; - return fixed(); -}); - -AST_SymbolRef.DEFMETHOD("is_immutable", function() { - var orig = this.definition().orig; - return orig.length == 1 && orig[0] instanceof AST_SymbolLambda; -}); - -function find_variable(compressor, name) { - var scope, i = 0; - while (scope = compressor.parent(i++)) { - if (scope instanceof AST_Scope) break; - if (scope instanceof AST_Catch && scope.argname) { - scope = scope.argname.definition().scope; - break; - } - } - return scope.find_variable(name); -} - -var global_names = makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError"); -AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { - return !this.definition().undeclared - || compressor.option("unsafe") && global_names.has(this.name); -}); - -/* -----[ optimizers ]----- */ - -var directives = new Set(["use asm", "use strict"]); -def_optimize(AST_Directive, function(self, compressor) { - if (compressor.option("directives") - && (!directives.has(self.value) || compressor.has_directive(self.value) !== self)) { - return make_node(AST_EmptyStatement, self); - } - return self; -}); - -def_optimize(AST_Debugger, function(self, compressor) { - if (compressor.option("drop_debugger")) - return make_node(AST_EmptyStatement, self); - return self; -}); - -def_optimize(AST_LabeledStatement, function(self, compressor) { - if (self.body instanceof AST_Break - && compressor.loopcontrol_target(self.body) === self.body) { - return make_node(AST_EmptyStatement, self); - } - return self.label.references.length == 0 ? self.body : self; -}); - -def_optimize(AST_Block, function(self, compressor) { - tighten_body(self.body, compressor); - return self; -}); - -function can_be_extracted_from_if_block(node) { - return !( - node instanceof AST_Const - || node instanceof AST_Let - || node instanceof AST_Class - ); -} - -def_optimize(AST_BlockStatement, function(self, compressor) { - tighten_body(self.body, compressor); - switch (self.body.length) { - case 1: - if (!compressor.has_directive("use strict") - && compressor.parent() instanceof AST_If - && can_be_extracted_from_if_block(self.body[0]) - || can_be_evicted_from_block(self.body[0])) { - return self.body[0]; - } - break; - case 0: return make_node(AST_EmptyStatement, self); - } - return self; -}); - -function opt_AST_Lambda(self, compressor) { - tighten_body(self.body, compressor); - if (compressor.option("side_effects") - && self.body.length == 1 - && self.body[0] === compressor.has_directive("use strict")) { - self.body.length = 0; - } - return self; -} -def_optimize(AST_Lambda, opt_AST_Lambda); - -AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { - var self = this; - if (compressor.has_directive("use asm")) return self; - - var hoist_funs = compressor.option("hoist_funs"); - var hoist_vars = compressor.option("hoist_vars"); - - if (hoist_funs || hoist_vars) { - var dirs = []; - var hoisted = []; - var vars = new Map(), vars_found = 0, var_decl = 0; - // let's count var_decl first, we seem to waste a lot of - // space if we hoist `var` when there's only one. - walk(self, node => { - if (node instanceof AST_Scope && node !== self) - return true; - if (node instanceof AST_Var) { - ++var_decl; - return true; - } - }); - hoist_vars = hoist_vars && var_decl > 1; - var tt = new TreeTransformer( - function before(node) { - if (node !== self) { - if (node instanceof AST_Directive) { - dirs.push(node); - return make_node(AST_EmptyStatement, node); - } - if (hoist_funs && node instanceof AST_Defun - && !(tt.parent() instanceof AST_Export) - && tt.parent() === self) { - hoisted.push(node); - return make_node(AST_EmptyStatement, node); - } - if ( - hoist_vars - && node instanceof AST_Var - && !node.definitions.some(def => def.name instanceof AST_Destructuring) - ) { - node.definitions.forEach(function(def) { - vars.set(def.name.name, def); - ++vars_found; - }); - var seq = node.to_assignments(compressor); - var p = tt.parent(); - if (p instanceof AST_ForIn && p.init === node) { - if (seq == null) { - var def = node.definitions[0].name; - return make_node(AST_SymbolRef, def, def); - } - return seq; - } - if (p instanceof AST_For && p.init === node) { - return seq; - } - if (!seq) return make_node(AST_EmptyStatement, node); - return make_node(AST_SimpleStatement, node, { - body: seq - }); - } - if (node instanceof AST_Scope) - return node; // to avoid descending in nested scopes - } - } - ); - self = self.transform(tt); - if (vars_found > 0) { - // collect only vars which don't show up in self's arguments list - var defs = []; - const is_lambda = self instanceof AST_Lambda; - const args_as_names = is_lambda ? self.args_as_names() : null; - vars.forEach((def, name) => { - if (is_lambda && args_as_names.some((x) => x.name === def.name.name)) { - vars.delete(name); - } else { - def = def.clone(); - def.value = null; - defs.push(def); - vars.set(name, def); - } - }); - if (defs.length > 0) { - // try to merge in assignments - for (var i = 0; i < self.body.length;) { - if (self.body[i] instanceof AST_SimpleStatement) { - var expr = self.body[i].body, sym, assign; - if (expr instanceof AST_Assign - && expr.operator == "=" - && (sym = expr.left) instanceof AST_Symbol - && vars.has(sym.name) - ) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = expr.right; - remove(defs, def); - defs.push(def); - self.body.splice(i, 1); - continue; - } - if (expr instanceof AST_Sequence - && (assign = expr.expressions[0]) instanceof AST_Assign - && assign.operator == "=" - && (sym = assign.left) instanceof AST_Symbol - && vars.has(sym.name) - ) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = assign.right; - remove(defs, def); - defs.push(def); - self.body[i].body = make_sequence(expr, expr.expressions.slice(1)); - continue; - } - } - if (self.body[i] instanceof AST_EmptyStatement) { - self.body.splice(i, 1); - continue; - } - if (self.body[i] instanceof AST_BlockStatement) { - self.body.splice(i, 1, ...self.body[i].body); - continue; - } - break; - } - defs = make_node(AST_Var, self, { - definitions: defs - }); - hoisted.push(defs); - } - } - self.body = dirs.concat(hoisted, self.body); - } - return self; -}); - -AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { - var self = this; - if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return self; - var top_retain = self instanceof AST_Toplevel && compressor.top_retain || return_false; - var defs_by_id = new Map(); - var hoister = new TreeTransformer(function(node, descend) { - if (node instanceof AST_VarDef) { - const sym = node.name; - let def; - let value; - if (sym.scope === self - && (def = sym.definition()).escaped != 1 - && !def.assignments - && !def.direct_access - && !def.single_use - && !compressor.exposed(def) - && !top_retain(def) - && (value = sym.fixed_value()) === node.value - && value instanceof AST_Object - && !value.properties.some(prop => - prop instanceof AST_Expansion || prop.computed_key() - ) - ) { - descend(node, this); - const defs = new Map(); - const assignments = []; - value.properties.forEach(({ key, value }) => { - const scope = hoister.find_scope(); - const symbol = self.create_symbol(sym.CTOR, { - source: sym, - scope, - conflict_scopes: new Set([ - scope, - ...sym.definition().references.map(ref => ref.scope) - ]), - tentative_name: sym.name + "_" + key - }); - - defs.set(String(key), symbol.definition()); - - assignments.push(make_node(AST_VarDef, node, { - name: symbol, - value - })); - }); - defs_by_id.set(def.id, defs); - return MAP.splice(assignments); - } - } else if (node instanceof AST_PropAccess - && node.expression instanceof AST_SymbolRef - ) { - const defs = defs_by_id.get(node.expression.definition().id); - if (defs) { - const def = defs.get(String(get_simple_key(node.property))); - const sym = make_node(AST_SymbolRef, node, { - name: def.name, - scope: node.expression.scope, - thedef: def - }); - sym.reference({}); - return sym; - } - } - }); - return self.transform(hoister); -}); - -def_optimize(AST_SimpleStatement, function(self, compressor) { - if (compressor.option("side_effects")) { - var body = self.body; - var node = body.drop_side_effect_free(compressor, true); - if (!node) { - return make_node(AST_EmptyStatement, self); - } - if (node !== body) { - return make_node(AST_SimpleStatement, self, { body: node }); - } - } - return self; -}); - -def_optimize(AST_While, function(self, compressor) { - return compressor.option("loops") ? make_node(AST_For, self, self).optimize(compressor) : self; -}); - -def_optimize(AST_Do, function(self, compressor) { - if (!compressor.option("loops")) return self; - var cond = self.condition.tail_node().evaluate(compressor); - if (!(cond instanceof AST_Node)) { - if (cond) return make_node(AST_For, self, { - body: make_node(AST_BlockStatement, self.body, { - body: [ - self.body, - make_node(AST_SimpleStatement, self.condition, { - body: self.condition - }) - ] - }) - }).optimize(compressor); - if (!has_break_or_continue(self, compressor.parent())) { - return make_node(AST_BlockStatement, self.body, { - body: [ - self.body, - make_node(AST_SimpleStatement, self.condition, { - body: self.condition - }) - ] - }).optimize(compressor); - } - } - return self; -}); - -function if_break_in_loop(self, compressor) { - var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body; - if (compressor.option("dead_code") && is_break(first)) { - var body = []; - if (self.init instanceof AST_Statement) { - body.push(self.init); - } else if (self.init) { - body.push(make_node(AST_SimpleStatement, self.init, { - body: self.init - })); - } - if (self.condition) { - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - } - trim_unreachable_code(compressor, self.body, body); - return make_node(AST_BlockStatement, self, { - body: body - }); - } - if (first instanceof AST_If) { - if (is_break(first.body)) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition.negate(compressor), - }); - } else { - self.condition = first.condition.negate(compressor); - } - drop_it(first.alternative); - } else if (is_break(first.alternative)) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition, - }); - } else { - self.condition = first.condition; - } - drop_it(first.body); - } - } - return self; - - function is_break(node) { - return node instanceof AST_Break - && compressor.loopcontrol_target(node) === compressor.self(); - } - - function drop_it(rest) { - rest = as_statement_array(rest); - if (self.body instanceof AST_BlockStatement) { - self.body = self.body.clone(); - self.body.body = rest.concat(self.body.body.slice(1)); - self.body = self.body.transform(compressor); - } else { - self.body = make_node(AST_BlockStatement, self.body, { - body: rest - }).transform(compressor); - } - self = if_break_in_loop(self, compressor); - } -} - -def_optimize(AST_For, function(self, compressor) { - if (!compressor.option("loops")) return self; - if (compressor.option("side_effects") && self.init) { - self.init = self.init.drop_side_effect_free(compressor); - } - if (self.condition) { - var cond = self.condition.evaluate(compressor); - if (!(cond instanceof AST_Node)) { - if (cond) self.condition = null; - else if (!compressor.option("dead_code")) { - var orig = self.condition; - self.condition = make_node_from_constant(cond, self.condition); - self.condition = best_of_expression(self.condition.transform(compressor), orig); - } - } - if (compressor.option("dead_code")) { - if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor); - if (!cond) { - var body = []; - trim_unreachable_code(compressor, self.body, body); - if (self.init instanceof AST_Statement) { - body.push(self.init); - } else if (self.init) { - body.push(make_node(AST_SimpleStatement, self.init, { - body: self.init - })); - } - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - } - return if_break_in_loop(self, compressor); -}); - -def_optimize(AST_If, function(self, compressor) { - if (is_empty(self.alternative)) self.alternative = null; - - if (!compressor.option("conditionals")) return self; - // if condition can be statically determined, drop - // one of the blocks. note, statically determined implies - // “has no side effects”; also it doesn't work for cases like - // `x && true`, though it probably should. - var cond = self.condition.evaluate(compressor); - if (!compressor.option("dead_code") && !(cond instanceof AST_Node)) { - var orig = self.condition; - self.condition = make_node_from_constant(cond, orig); - self.condition = best_of_expression(self.condition.transform(compressor), orig); - } - if (compressor.option("dead_code")) { - if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor); - if (!cond) { - var body = []; - trim_unreachable_code(compressor, self.body, body); - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - if (self.alternative) body.push(self.alternative); - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } else if (!(cond instanceof AST_Node)) { - var body = []; - body.push(make_node(AST_SimpleStatement, self.condition, { - body: self.condition - })); - body.push(self.body); - if (self.alternative) { - trim_unreachable_code(compressor, self.alternative, body); - } - return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor); - } - } - var negated = self.condition.negate(compressor); - var self_condition_length = self.condition.size(); - var negated_length = negated.size(); - var negated_is_best = negated_length < self_condition_length; - if (self.alternative && negated_is_best) { - negated_is_best = false; // because we already do the switch here. - // no need to swap values of self_condition_length and negated_length - // here because they are only used in an equality comparison later on. - self.condition = negated; - var tmp = self.body; - self.body = self.alternative || make_node(AST_EmptyStatement, self); - self.alternative = tmp; - } - if (is_empty(self.body) && is_empty(self.alternative)) { - return make_node(AST_SimpleStatement, self.condition, { - body: self.condition.clone() - }).optimize(compressor); - } - if (self.body instanceof AST_SimpleStatement - && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Conditional, self, { - condition : self.condition, - consequent : self.body.body, - alternative : self.alternative.body - }) - }).optimize(compressor); - } - if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) { - if (self_condition_length === negated_length && !negated_is_best - && self.condition instanceof AST_Binary && self.condition.operator == "||") { - // although the code length of self.condition and negated are the same, - // negated does not require additional surrounding parentheses. - // see https://github.com/mishoo/UglifyJS2/issues/979 - negated_is_best = true; - } - if (negated_is_best) return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "||", - left : negated, - right : self.body.body - }) - }).optimize(compressor); - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "&&", - left : self.condition, - right : self.body.body - }) - }).optimize(compressor); - } - if (self.body instanceof AST_EmptyStatement - && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "||", - left : self.condition, - right : self.alternative.body - }) - }).optimize(compressor); - } - if (self.body instanceof AST_Exit - && self.alternative instanceof AST_Exit - && self.body.TYPE == self.alternative.TYPE) { - return make_node(self.body.CTOR, self, { - value: make_node(AST_Conditional, self, { - condition : self.condition, - consequent : self.body.value || make_node(AST_Undefined, self.body), - alternative : self.alternative.value || make_node(AST_Undefined, self.alternative) - }).transform(compressor) - }).optimize(compressor); - } - if (self.body instanceof AST_If - && !self.body.alternative - && !self.alternative) { - self = make_node(AST_If, self, { - condition: make_node(AST_Binary, self.condition, { - operator: "&&", - left: self.condition, - right: self.body.condition - }), - body: self.body.body, - alternative: null - }); - } - if (aborts(self.body)) { - if (self.alternative) { - var alt = self.alternative; - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, alt ] - }).optimize(compressor); - } - } - if (aborts(self.alternative)) { - var body = self.body; - self.body = self.alternative; - self.condition = negated_is_best ? negated : self.condition.negate(compressor); - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, body ] - }).optimize(compressor); - } - return self; -}); - -def_optimize(AST_Switch, function(self, compressor) { - if (!compressor.option("switches")) return self; - var branch; - var value = self.expression.evaluate(compressor); - if (!(value instanceof AST_Node)) { - var orig = self.expression; - self.expression = make_node_from_constant(value, orig); - self.expression = best_of_expression(self.expression.transform(compressor), orig); - } - if (!compressor.option("dead_code")) return self; - if (value instanceof AST_Node) { - value = self.expression.tail_node().evaluate(compressor); - } - var decl = []; - var body = []; - var default_branch; - var exact_match; - for (var i = 0, len = self.body.length; i < len && !exact_match; i++) { - branch = self.body[i]; - if (branch instanceof AST_Default) { - if (!default_branch) { - default_branch = branch; - } else { - eliminate_branch(branch, body[body.length - 1]); - } - } else if (!(value instanceof AST_Node)) { - var exp = branch.expression.evaluate(compressor); - if (!(exp instanceof AST_Node) && exp !== value) { - eliminate_branch(branch, body[body.length - 1]); - continue; - } - if (exp instanceof AST_Node) exp = branch.expression.tail_node().evaluate(compressor); - if (exp === value) { - exact_match = branch; - if (default_branch) { - var default_index = body.indexOf(default_branch); - body.splice(default_index, 1); - eliminate_branch(default_branch, body[default_index - 1]); - default_branch = null; - } - } - } - body.push(branch); - } - while (i < len) eliminate_branch(self.body[i++], body[body.length - 1]); - self.body = body; - - let default_or_exact = default_branch || exact_match; - default_branch = null; - exact_match = null; - - // group equivalent branches so they will be located next to each other, - // that way the next micro-optimization will merge them. - // ** bail micro-optimization if not a simple switch case with breaks - if (body.every((branch, i) => - (branch === default_or_exact || branch.expression instanceof AST_Constant) - && (branch.body.length === 0 || aborts(branch) || body.length - 1 === i)) - ) { - for (let i = 0; i < body.length; i++) { - const branch = body[i]; - for (let j = i + 1; j < body.length; j++) { - const next = body[j]; - if (next.body.length === 0) continue; - const last_branch = j === (body.length - 1); - const equivalentBranch = branches_equivalent(next, branch, false); - if (equivalentBranch || (last_branch && branches_equivalent(next, branch, true))) { - if (!equivalentBranch && last_branch) { - next.body.push(make_node(AST_Break)); - } - - // let's find previous siblings with inert fallthrough... - let x = j - 1; - let fallthroughDepth = 0; - while (x > i) { - if (is_inert_body(body[x--])) { - fallthroughDepth++; - } else { - break; - } - } - - const plucked = body.splice(j - fallthroughDepth, 1 + fallthroughDepth); - body.splice(i + 1, 0, ...plucked); - i += plucked.length; - } - } - } - } - - // merge equivalent branches in a row - for (let i = 0; i < body.length; i++) { - let branch = body[i]; - if (branch.body.length === 0) continue; - if (!aborts(branch)) continue; - - for (let j = i + 1; j < body.length; i++, j++) { - let next = body[j]; - if (next.body.length === 0) continue; - if ( - branches_equivalent(next, branch, false) - || (j === body.length - 1 && branches_equivalent(next, branch, true)) - ) { - branch.body = []; - branch = next; - continue; - } - break; - } - } - - // Prune any empty branches at the end of the switch statement. - { - let i = body.length - 1; - for (; i >= 0; i--) { - let bbody = body[i].body; - if (is_break(bbody[bbody.length - 1], compressor)) bbody.pop(); - if (!is_inert_body(body[i])) break; - } - // i now points to the index of a branch that contains a body. By incrementing, it's - // pointing to the first branch that's empty. - i++; - if (!default_or_exact || body.indexOf(default_or_exact) >= i) { - // The default behavior is to do nothing. We can take advantage of that to - // remove all case expressions that are side-effect free that also do - // nothing, since they'll default to doing nothing. But we can't remove any - // case expressions before one that would side-effect, since they may cause - // the side-effect to be skipped. - for (let j = body.length - 1; j >= i; j--) { - let branch = body[j]; - if (branch === default_or_exact) { - default_or_exact = null; - body.pop(); - } else if (!branch.expression.has_side_effects(compressor)) { - body.pop(); - } else { - break; - } - } - } - } - - - // Prune side-effect free branches that fall into default. - DEFAULT: if (default_or_exact) { - let default_index = body.indexOf(default_or_exact); - let default_body_index = default_index; - for (; default_body_index < body.length - 1; default_body_index++) { - if (!is_inert_body(body[default_body_index])) break; - } - if (default_body_index < body.length - 1) { - break DEFAULT; - } - - let side_effect_index = body.length - 1; - for (; side_effect_index >= 0; side_effect_index--) { - let branch = body[side_effect_index]; - if (branch === default_or_exact) continue; - if (branch.expression.has_side_effects(compressor)) break; - } - // If the default behavior comes after any side-effect case expressions, - // then we can fold all side-effect free cases into the default branch. - // If the side-effect case is after the default, then any side-effect - // free cases could prevent the side-effect from occurring. - if (default_body_index > side_effect_index) { - let prev_body_index = default_index - 1; - for (; prev_body_index >= 0; prev_body_index--) { - if (!is_inert_body(body[prev_body_index])) break; - } - let before = Math.max(side_effect_index, prev_body_index) + 1; - let after = default_index; - if (side_effect_index > default_index) { - // If the default falls into the same body as a side-effect - // case, then we need preserve that case and only prune the - // cases after it. - after = side_effect_index; - body[side_effect_index].body = body[default_body_index].body; - } else { - // The default will be the last branch. - default_or_exact.body = body[default_body_index].body; - } - - // Prune everything after the default (or last side-effect case) - // until the next case with a body. - body.splice(after + 1, default_body_index - after); - // Prune everything before the default that falls into it. - body.splice(before, default_index - before); - } - } - - // See if we can remove the switch entirely if all cases (the default) fall into the same case body. - DEFAULT: if (default_or_exact) { - let i = body.findIndex(branch => !is_inert_body(branch)); - let caseBody; - // `i` is equal to one of the following: - // - `-1`, there is no body in the switch statement. - // - `body.length - 1`, all cases fall into the same body. - // - anything else, there are multiple bodies in the switch. - if (i === body.length - 1) { - // All cases fall into the case body. - let branch = body[i]; - if (has_nested_break(self)) break DEFAULT; - - // This is the last case body, and we've already pruned any breaks, so it's - // safe to hoist. - caseBody = make_node(AST_BlockStatement, branch, { - body: branch.body - }); - branch.body = []; - } else if (i !== -1) { - // If there are multiple bodies, then we cannot optimize anything. - break DEFAULT; - } - - let sideEffect = body.find(branch => { - return ( - branch !== default_or_exact - && branch.expression.has_side_effects(compressor) - ); - }); - // If no cases cause a side-effect, we can eliminate the switch entirely. - if (!sideEffect) { - return make_node(AST_BlockStatement, self, { - body: decl.concat( - statement(self.expression), - default_or_exact.expression ? statement(default_or_exact.expression) : [], - caseBody || [] - ) - }).optimize(compressor); - } - - // If we're this far, either there was no body or all cases fell into the same body. - // If there was no body, then we don't need a default branch (because the default is - // do nothing). If there was a body, we'll extract it to after the switch, so the - // switch's new default is to do nothing and we can still prune it. - const default_index = body.indexOf(default_or_exact); - body.splice(default_index, 1); - default_or_exact = null; - - if (caseBody) { - // Recurse into switch statement one more time so that we can append the case body - // outside of the switch. This recursion will only happen once since we've pruned - // the default case. - return make_node(AST_BlockStatement, self, { - body: decl.concat(self, caseBody) - }).optimize(compressor); - } - // If we fall here, there is a default branch somewhere, there are no case bodies, - // and there's a side-effect somewhere. Just let the below paths take care of it. - } - - if (body.length > 0) { - body[0].body = decl.concat(body[0].body); - } - - if (body.length == 0) { - return make_node(AST_BlockStatement, self, { - body: decl.concat(statement(self.expression)) - }).optimize(compressor); - } - if (body.length == 1 && !has_nested_break(self)) { - // This is the last case body, and we've already pruned any breaks, so it's - // safe to hoist. - let branch = body[0]; - return make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: "===", - left: self.expression, - right: branch.expression, - }), - body: make_node(AST_BlockStatement, branch, { - body: branch.body - }), - alternative: null - }).optimize(compressor); - } - if (body.length === 2 && default_or_exact && !has_nested_break(self)) { - let branch = body[0] === default_or_exact ? body[1] : body[0]; - let exact_exp = default_or_exact.expression && statement(default_or_exact.expression); - if (aborts(body[0])) { - // Only the first branch body could have a break (at the last statement) - let first = body[0]; - if (is_break(first.body[first.body.length - 1], compressor)) { - first.body.pop(); - } - return make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: "===", - left: self.expression, - right: branch.expression, - }), - body: make_node(AST_BlockStatement, branch, { - body: branch.body - }), - alternative: make_node(AST_BlockStatement, default_or_exact, { - body: [].concat( - exact_exp || [], - default_or_exact.body - ) - }) - }).optimize(compressor); - } - let operator = "==="; - let consequent = make_node(AST_BlockStatement, branch, { - body: branch.body, - }); - let always = make_node(AST_BlockStatement, default_or_exact, { - body: [].concat( - exact_exp || [], - default_or_exact.body - ) - }); - if (body[0] === default_or_exact) { - operator = "!=="; - let tmp = always; - always = consequent; - consequent = tmp; - } - return make_node(AST_BlockStatement, self, { - body: [ - make_node(AST_If, self, { - condition: make_node(AST_Binary, self, { - operator: operator, - left: self.expression, - right: branch.expression, - }), - body: consequent, - alternative: null - }) - ].concat(always) - }).optimize(compressor); - } - return self; - - function eliminate_branch(branch, prev) { - if (prev && !aborts(prev)) { - prev.body = prev.body.concat(branch.body); - } else { - trim_unreachable_code(compressor, branch, decl); - } - } - function branches_equivalent(branch, prev, insertBreak) { - let bbody = branch.body; - let pbody = prev.body; - if (insertBreak) { - bbody = bbody.concat(make_node(AST_Break)); - } - if (bbody.length !== pbody.length) return false; - let bblock = make_node(AST_BlockStatement, branch, { body: bbody }); - let pblock = make_node(AST_BlockStatement, prev, { body: pbody }); - return bblock.equivalent_to(pblock); - } - function statement(expression) { - return make_node(AST_SimpleStatement, expression, { - body: expression - }); - } - function has_nested_break(root) { - let has_break = false; - let tw = new TreeWalker(node => { - if (has_break) return true; - if (node instanceof AST_Lambda) return true; - if (node instanceof AST_SimpleStatement) return true; - if (!is_break(node, tw)) return; - let parent = tw.parent(); - if ( - parent instanceof AST_SwitchBranch - && parent.body[parent.body.length - 1] === node - ) { - return; - } - has_break = true; - }); - root.walk(tw); - return has_break; - } - function is_break(node, stack) { - return node instanceof AST_Break - && stack.loopcontrol_target(node) === self; - } - function is_inert_body(branch) { - return !aborts(branch) && !make_node(AST_BlockStatement, branch, { - body: branch.body - }).has_side_effects(compressor); - } -}); - -def_optimize(AST_Try, function(self, compressor) { - if (self.bcatch && self.bfinally && self.bfinally.body.every(is_empty)) self.bfinally = null; - - if (compressor.option("dead_code") && self.body.body.every(is_empty)) { - var body = []; - if (self.bcatch) { - trim_unreachable_code(compressor, self.bcatch, body); - } - if (self.bfinally) body.push(...self.bfinally.body); - return make_node(AST_BlockStatement, self, { - body: body - }).optimize(compressor); - } - return self; -}); - -AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { - var reduce_vars = compressor.option("reduce_vars"); - var assignments = []; - - for (const def of this.definitions) { - if (def.value) { - var name = make_node(AST_SymbolRef, def.name, def.name); - assignments.push(make_node(AST_Assign, def, { - operator : "=", - logical: false, - left : name, - right : def.value - })); - if (reduce_vars) name.definition().fixed = false; - } - const thedef = def.name.definition(); - thedef.eliminated++; - thedef.replaced--; - } - - if (assignments.length == 0) return null; - return make_sequence(this, assignments); -}); - -def_optimize(AST_Definitions, function(self) { - if (self.definitions.length == 0) { - return make_node(AST_EmptyStatement, self); - } - return self; -}); - -def_optimize(AST_VarDef, function(self, compressor) { - if ( - self.name instanceof AST_SymbolLet - && self.value != null - && is_undefined(self.value, compressor) - ) { - self.value = null; - } - return self; -}); - -def_optimize(AST_Import, function(self) { - return self; -}); - -def_optimize(AST_Call, function(self, compressor) { - var exp = self.expression; - var fn = exp; - inline_array_like_spread(self.args); - var simple_args = self.args.every((arg) => !(arg instanceof AST_Expansion)); - - if (compressor.option("reduce_vars") && fn instanceof AST_SymbolRef) { - fn = fn.fixed_value(); - } - - var is_func = fn instanceof AST_Lambda; - - if (is_func && fn.pinned()) return self; - - if (compressor.option("unused") - && simple_args - && is_func - && !fn.uses_arguments) { - var pos = 0, last = 0; - for (var i = 0, len = self.args.length; i < len; i++) { - if (fn.argnames[i] instanceof AST_Expansion) { - if (has_flag(fn.argnames[i].expression, UNUSED)) while (i < len) { - var node = self.args[i++].drop_side_effect_free(compressor); - if (node) { - self.args[pos++] = node; - } - } else while (i < len) { - self.args[pos++] = self.args[i++]; - } - last = pos; - break; - } - var trim = i >= fn.argnames.length; - if (trim || has_flag(fn.argnames[i], UNUSED)) { - var node = self.args[i].drop_side_effect_free(compressor); - if (node) { - self.args[pos++] = node; - } else if (!trim) { - self.args[pos++] = make_node(AST_Number, self.args[i], { - value: 0 - }); - continue; - } - } else { - self.args[pos++] = self.args[i]; - } - last = pos; - } - self.args.length = last; - } - - if (compressor.option("unsafe") && !exp.contains_optional()) { - if (exp instanceof AST_Dot && exp.start.value === "Array" && exp.property === "from" && self.args.length === 1) { - const [argument] = self.args; - if (argument instanceof AST_Array) { - return make_node(AST_Array, argument, { - elements: argument.elements - }).optimize(compressor); - } - } - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - if (self.args.length != 1) { - return make_node(AST_Array, self, { - elements: self.args - }).optimize(compressor); - } else if (self.args[0] instanceof AST_Number && self.args[0].value <= 11) { - const elements = []; - for (let i = 0; i < self.args[0].value; i++) elements.push(new AST_Hole); - return new AST_Array({ elements }); - } - break; - case "Object": - if (self.args.length == 0) { - return make_node(AST_Object, self, { - properties: [] - }); - } - break; - case "String": - if (self.args.length == 0) return make_node(AST_String, self, { - value: "" - }); - if (self.args.length <= 1) return make_node(AST_Binary, self, { - left: self.args[0], - operator: "+", - right: make_node(AST_String, self, { value: "" }) - }).optimize(compressor); - break; - case "Number": - if (self.args.length == 0) return make_node(AST_Number, self, { - value: 0 - }); - if (self.args.length == 1 && compressor.option("unsafe_math")) { - return make_node(AST_UnaryPrefix, self, { - expression: self.args[0], - operator: "+" - }).optimize(compressor); - } - break; - case "Symbol": - if (self.args.length == 1 && self.args[0] instanceof AST_String && compressor.option("unsafe_symbols")) - self.args.length = 0; - break; - case "Boolean": - if (self.args.length == 0) return make_node(AST_False, self); - if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, { - expression: make_node(AST_UnaryPrefix, self, { - expression: self.args[0], - operator: "!" - }), - operator: "!" - }).optimize(compressor); - break; - case "RegExp": - var params = []; - if (self.args.length >= 1 - && self.args.length <= 2 - && self.args.every((arg) => { - var value = arg.evaluate(compressor); - params.push(value); - return arg !== value; - }) - && regexp_is_safe(params[0]) - ) { - let [ source, flags ] = params; - source = regexp_source_fix(new RegExp(source).source); - const rx = make_node(AST_RegExp, self, { - value: { source, flags } - }); - if (rx._eval(compressor) !== rx) { - return rx; - } - } - break; - } else if (exp instanceof AST_Dot) switch(exp.property) { - case "toString": - if (self.args.length == 0 && !exp.expression.may_throw_on_access(compressor)) { - return make_node(AST_Binary, self, { - left: make_node(AST_String, self, { value: "" }), - operator: "+", - right: exp.expression - }).optimize(compressor); - } - break; - case "join": - if (exp.expression instanceof AST_Array) EXIT: { - var separator; - if (self.args.length > 0) { - separator = self.args[0].evaluate(compressor); - if (separator === self.args[0]) break EXIT; // not a constant - } - var elements = []; - var consts = []; - for (var i = 0, len = exp.expression.elements.length; i < len; i++) { - var el = exp.expression.elements[i]; - if (el instanceof AST_Expansion) break EXIT; - var value = el.evaluate(compressor); - if (value !== el) { - consts.push(value); - } else { - if (consts.length > 0) { - elements.push(make_node(AST_String, self, { - value: consts.join(separator) - })); - consts.length = 0; - } - elements.push(el); - } - } - if (consts.length > 0) { - elements.push(make_node(AST_String, self, { - value: consts.join(separator) - })); - } - if (elements.length == 0) return make_node(AST_String, self, { value: "" }); - if (elements.length == 1) { - if (elements[0].is_string(compressor)) { - return elements[0]; - } - return make_node(AST_Binary, elements[0], { - operator : "+", - left : make_node(AST_String, self, { value: "" }), - right : elements[0] - }); - } - if (separator == "") { - var first; - if (elements[0].is_string(compressor) - || elements[1].is_string(compressor)) { - first = elements.shift(); - } else { - first = make_node(AST_String, self, { value: "" }); - } - return elements.reduce(function(prev, el) { - return make_node(AST_Binary, el, { - operator : "+", - left : prev, - right : el - }); - }, first).optimize(compressor); - } - // need this awkward cloning to not affect original element - // best_of will decide which one to get through. - var node = self.clone(); - node.expression = node.expression.clone(); - node.expression.expression = node.expression.expression.clone(); - node.expression.expression.elements = elements; - return best_of(compressor, self, node); - } - break; - case "charAt": - if (exp.expression.is_string(compressor)) { - var arg = self.args[0]; - var index = arg ? arg.evaluate(compressor) : 0; - if (index !== arg) { - return make_node(AST_Sub, exp, { - expression: exp.expression, - property: make_node_from_constant(index | 0, arg || exp) - }).optimize(compressor); - } - } - break; - case "apply": - if (self.args.length == 2 && self.args[1] instanceof AST_Array) { - var args = self.args[1].elements.slice(); - args.unshift(self.args[0]); - return make_node(AST_Call, self, { - expression: make_node(AST_Dot, exp, { - expression: exp.expression, - optional: false, - property: "call" - }), - args: args - }).optimize(compressor); - } - break; - case "call": - var func = exp.expression; - if (func instanceof AST_SymbolRef) { - func = func.fixed_value(); - } - if (func instanceof AST_Lambda && !func.contains_this()) { - return (self.args.length ? make_sequence(this, [ - self.args[0], - make_node(AST_Call, self, { - expression: exp.expression, - args: self.args.slice(1) - }) - ]) : make_node(AST_Call, self, { - expression: exp.expression, - args: [] - })).optimize(compressor); - } - break; - } - } - - if (compressor.option("unsafe_Function") - && is_undeclared_ref(exp) - && exp.name == "Function") { - // new Function() => function(){} - if (self.args.length == 0) return make_node(AST_Function, self, { - argnames: [], - body: [] - }).optimize(compressor); - if (self.args.every((x) => x instanceof AST_String)) { - // quite a corner-case, but we can handle it: - // https://github.com/mishoo/UglifyJS2/issues/203 - // if the code argument is a constant, then we can minify it. - try { - var code = "n(function(" + self.args.slice(0, -1).map(function(arg) { - return arg.value; - }).join(",") + "){" + self.args[self.args.length - 1].value + "})"; - var ast = parse(code); - var mangle = compressor.mangle_options(); - ast.figure_out_scope(mangle); - var comp = new Compressor(compressor.options, { - mangle_options: compressor._mangle_options - }); - ast = ast.transform(comp); - ast.figure_out_scope(mangle); - ast.compute_char_frequency(mangle); - ast.mangle_names(mangle); - var fun; - walk(ast, node => { - if (is_func_expr(node)) { - fun = node; - return walk_abort; - } - }); - var code = OutputStream(); - AST_BlockStatement.prototype._codegen.call(fun, fun, code); - self.args = [ - make_node(AST_String, self, { - value: fun.argnames.map(function(arg) { - return arg.print_to_string(); - }).join(",") - }), - make_node(AST_String, self.args[self.args.length - 1], { - value: code.get().replace(/^{|}$/g, "") - }) - ]; - return self; - } catch (ex) { - if (!(ex instanceof JS_Parse_Error)) { - throw ex; - } - - // Otherwise, it crashes at runtime. Or maybe it's nonstandard syntax. - } - } - } - - return inline_into_call(self, compressor); -}); - -/** Does this node contain optional property access or optional call? */ -AST_Node.DEFMETHOD("contains_optional", function() { - if ( - this instanceof AST_PropAccess - || this instanceof AST_Call - || this instanceof AST_Chain - ) { - if (this.optional) { - return true; - } else { - return this.expression.contains_optional(); - } - } else { - return false; - } -}); - -def_optimize(AST_New, function(self, compressor) { - if ( - compressor.option("unsafe") && - is_undeclared_ref(self.expression) && - ["Object", "RegExp", "Function", "Error", "Array"].includes(self.expression.name) - ) return make_node(AST_Call, self, self).transform(compressor); - return self; -}); - -def_optimize(AST_Sequence, function(self, compressor) { - if (!compressor.option("side_effects")) return self; - var expressions = []; - filter_for_side_effects(); - var end = expressions.length - 1; - trim_right_for_undefined(); - if (end == 0) { - self = maintain_this_binding(compressor.parent(), compressor.self(), expressions[0]); - if (!(self instanceof AST_Sequence)) self = self.optimize(compressor); - return self; - } - self.expressions = expressions; - return self; - - function filter_for_side_effects() { - var first = first_in_statement(compressor); - var last = self.expressions.length - 1; - self.expressions.forEach(function(expr, index) { - if (index < last) expr = expr.drop_side_effect_free(compressor, first); - if (expr) { - merge_sequence(expressions, expr); - first = false; - } - }); - } - - function trim_right_for_undefined() { - while (end > 0 && is_undefined(expressions[end], compressor)) end--; - if (end < expressions.length - 1) { - expressions[end] = make_node(AST_UnaryPrefix, self, { - operator : "void", - expression : expressions[end] - }); - expressions.length = end + 1; - } - } -}); - -AST_Unary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.expression instanceof AST_Sequence) { - var x = this.expression.expressions.slice(); - var e = this.clone(); - e.expression = x.pop(); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } - } - return this; -}); - -def_optimize(AST_UnaryPostfix, function(self, compressor) { - return self.lift_sequences(compressor); -}); - -def_optimize(AST_UnaryPrefix, function(self, compressor) { - var e = self.expression; - if ( - self.operator == "delete" && - !( - e instanceof AST_SymbolRef || - e instanceof AST_PropAccess || - e instanceof AST_Chain || - is_identifier_atom(e) - ) - ) { - return make_sequence(self, [e, make_node(AST_True, self)]).optimize(compressor); - } - var seq = self.lift_sequences(compressor); - if (seq !== self) { - return seq; - } - if (compressor.option("side_effects") && self.operator == "void") { - e = e.drop_side_effect_free(compressor); - if (e) { - self.expression = e; - return self; - } else { - return make_node(AST_Undefined, self).optimize(compressor); - } - } - if (compressor.in_boolean_context()) { - switch (self.operator) { - case "!": - if (e instanceof AST_UnaryPrefix && e.operator == "!") { - // !!foo ==> foo, if we're in boolean context - return e.expression; - } - if (e instanceof AST_Binary) { - self = best_of(compressor, self, e.negate(compressor, first_in_statement(compressor))); - } - break; - case "typeof": - // typeof always returns a non-empty string, thus it's - // always true in booleans - // And we don't need to check if it's undeclared, because in typeof, that's OK - return (e instanceof AST_SymbolRef ? make_node(AST_True, self) : make_sequence(self, [ - e, - make_node(AST_True, self) - ])).optimize(compressor); - } - } - if (self.operator == "-" && e instanceof AST_Infinity) { - e = e.transform(compressor); - } - if (e instanceof AST_Binary - && (self.operator == "+" || self.operator == "-") - && (e.operator == "*" || e.operator == "/" || e.operator == "%")) { - return make_node(AST_Binary, self, { - operator: e.operator, - left: make_node(AST_UnaryPrefix, e.left, { - operator: self.operator, - expression: e.left - }), - right: e.right - }); - } - // avoids infinite recursion of numerals - if (self.operator != "-" - || !(e instanceof AST_Number || e instanceof AST_Infinity || e instanceof AST_BigInt)) { - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - } - return self; -}); - -AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.left instanceof AST_Sequence) { - var x = this.left.expressions.slice(); - var e = this.clone(); - e.left = x.pop(); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } - if (this.right instanceof AST_Sequence && !this.left.has_side_effects(compressor)) { - var assign = this.operator == "=" && this.left instanceof AST_SymbolRef; - var x = this.right.expressions; - var last = x.length - 1; - for (var i = 0; i < last; i++) { - if (!assign && x[i].has_side_effects(compressor)) break; - } - if (i == last) { - x = x.slice(); - var e = this.clone(); - e.right = x.pop(); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } else if (i > 0) { - var e = this.clone(); - e.right = make_sequence(this.right, x.slice(i)); - x = x.slice(0, i); - x.push(e); - return make_sequence(this, x).optimize(compressor); - } - } - } - return this; -}); - -var commutativeOperators = makePredicate("== === != !== * & | ^"); -function is_object(node) { - return node instanceof AST_Array - || node instanceof AST_Lambda - || node instanceof AST_Object - || node instanceof AST_Class; -} - -def_optimize(AST_Binary, function(self, compressor) { - function reversible() { - return self.left.is_constant() - || self.right.is_constant() - || !self.left.has_side_effects(compressor) - && !self.right.has_side_effects(compressor); - } - function reverse(op) { - if (reversible()) { - if (op) self.operator = op; - var tmp = self.left; - self.left = self.right; - self.right = tmp; - } - } - if (compressor.option("lhs_constants") && commutativeOperators.has(self.operator)) { - if (self.right.is_constant() - && !self.left.is_constant()) { - // if right is a constant, whatever side effects the - // left side might have could not influence the - // result. hence, force switch. - - if (!(self.left instanceof AST_Binary - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - reverse(); - } - } - } - self = self.lift_sequences(compressor); - if (compressor.option("comparisons")) switch (self.operator) { - case "===": - case "!==": - var is_strict_comparison = true; - if ((self.left.is_string(compressor) && self.right.is_string(compressor)) || - (self.left.is_number(compressor) && self.right.is_number(compressor)) || - (self.left.is_boolean() && self.right.is_boolean()) || - self.left.equivalent_to(self.right)) { - self.operator = self.operator.substr(0, 2); - } - // XXX: intentionally falling down to the next case - case "==": - case "!=": - // void 0 == x => null == x - if (!is_strict_comparison && is_undefined(self.left, compressor)) { - self.left = make_node(AST_Null, self.left); - // x == void 0 => x == null - } else if (!is_strict_comparison && is_undefined(self.right, compressor)) { - self.right = make_node(AST_Null, self.right); - } else if (compressor.option("typeofs") - // "undefined" == typeof x => undefined === x - && self.left instanceof AST_String - && self.left.value == "undefined" - && self.right instanceof AST_UnaryPrefix - && self.right.operator == "typeof") { - var expr = self.right.expression; - if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { - self.right = expr; - self.left = make_node(AST_Undefined, self.left).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } else if (compressor.option("typeofs") - // typeof x === "undefined" => x === undefined - && self.left instanceof AST_UnaryPrefix - && self.left.operator == "typeof" - && self.right instanceof AST_String - && self.right.value == "undefined") { - var expr = self.left.expression; - if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor) - : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) { - self.left = expr; - self.right = make_node(AST_Undefined, self.right).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } else if (self.left instanceof AST_SymbolRef - // obj !== obj => false - && self.right instanceof AST_SymbolRef - && self.left.definition() === self.right.definition() - && is_object(self.left.fixed_value())) { - return make_node(self.operator[0] == "=" ? AST_True : AST_False, self); - } - break; - case "&&": - case "||": - var lhs = self.left; - if (lhs.operator == self.operator) { - lhs = lhs.right; - } - if (lhs instanceof AST_Binary - && lhs.operator == (self.operator == "&&" ? "!==" : "===") - && self.right instanceof AST_Binary - && lhs.operator == self.right.operator - && (is_undefined(lhs.left, compressor) && self.right.left instanceof AST_Null - || lhs.left instanceof AST_Null && is_undefined(self.right.left, compressor)) - && !lhs.right.has_side_effects(compressor) - && lhs.right.equivalent_to(self.right.right)) { - var combined = make_node(AST_Binary, self, { - operator: lhs.operator.slice(0, -1), - left: make_node(AST_Null, self), - right: lhs.right - }); - if (lhs !== self.left) { - combined = make_node(AST_Binary, self, { - operator: self.operator, - left: self.left.left, - right: combined - }); - } - return combined; - } - break; - } - if (self.operator == "+" && compressor.in_boolean_context()) { - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if (ll && typeof ll == "string") { - return make_sequence(self, [ - self.right, - make_node(AST_True, self) - ]).optimize(compressor); - } - if (rr && typeof rr == "string") { - return make_sequence(self, [ - self.left, - make_node(AST_True, self) - ]).optimize(compressor); - } - } - if (compressor.option("comparisons") && self.is_boolean()) { - if (!(compressor.parent() instanceof AST_Binary) - || compressor.parent() instanceof AST_Assign) { - var negated = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.negate(compressor, first_in_statement(compressor)) - }); - self = best_of(compressor, self, negated); - } - if (compressor.option("unsafe_comps")) { - switch (self.operator) { - case "<": reverse(">"); break; - case "<=": reverse(">="); break; - } - } - } - if (self.operator == "+") { - if (self.right instanceof AST_String - && self.right.getValue() == "" - && self.left.is_string(compressor)) { - return self.left; - } - if (self.left instanceof AST_String - && self.left.getValue() == "" - && self.right.is_string(compressor)) { - return self.right; - } - if (self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.left instanceof AST_String - && self.left.left.getValue() == "" - && self.right.is_string(compressor)) { - self.left = self.left.right; - return self; - } - } - if (compressor.option("evaluate")) { - switch (self.operator) { - case "&&": - var ll = has_flag(self.left, TRUTHY) - ? true - : has_flag(self.left, FALSY) - ? false - : self.left.evaluate(compressor); - if (!ll) { - return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - if (compressor.in_boolean_context()) { - return make_sequence(self, [ - self.left, - make_node(AST_False, self) - ]).optimize(compressor); - } else { - set_flag(self, FALSY); - } - } else if (!(rr instanceof AST_Node)) { - var parent = compressor.parent(); - if (parent.operator == "&&" && parent.left === compressor.self() || compressor.in_boolean_context()) { - return self.left.optimize(compressor); - } - } - // x || false && y ---> x ? y : false - if (self.left.operator == "||") { - var lr = self.left.right.evaluate(compressor); - if (!lr) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.right, - alternative: self.left.right - }).optimize(compressor); - } - break; - case "||": - var ll = has_flag(self.left, TRUTHY) - ? true - : has_flag(self.left, FALSY) - ? false - : self.left.evaluate(compressor); - if (!ll) { - return make_sequence(self, [ self.left, self.right ]).optimize(compressor); - } else if (!(ll instanceof AST_Node)) { - return maintain_this_binding(compressor.parent(), compressor.self(), self.left).optimize(compressor); - } - var rr = self.right.evaluate(compressor); - if (!rr) { - var parent = compressor.parent(); - if (parent.operator == "||" && parent.left === compressor.self() || compressor.in_boolean_context()) { - return self.left.optimize(compressor); - } - } else if (!(rr instanceof AST_Node)) { - if (compressor.in_boolean_context()) { - return make_sequence(self, [ - self.left, - make_node(AST_True, self) - ]).optimize(compressor); - } else { - set_flag(self, TRUTHY); - } - } - if (self.left.operator == "&&") { - var lr = self.left.right.evaluate(compressor); - if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, { - condition: self.left.left, - consequent: self.left.right, - alternative: self.right - }).optimize(compressor); - } - break; - case "??": - if (is_nullish(self.left, compressor)) { - return self.right; - } - - var ll = self.left.evaluate(compressor); - if (!(ll instanceof AST_Node)) { - // if we know the value for sure we can simply compute right away. - return ll == null ? self.right : self.left; - } - - if (compressor.in_boolean_context()) { - const rr = self.right.evaluate(compressor); - if (!(rr instanceof AST_Node) && !rr) { - return self.left; - } - } - } - var associative = true; - switch (self.operator) { - case "+": - // (x + "foo") + "bar" => x + "foobar" - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor)) { - var binary = make_node(AST_Binary, self, { - operator: "+", - left: self.left.right, - right: self.right, - }); - var r = binary.optimize(compressor); - if (binary !== r) { - self = make_node(AST_Binary, self, { - operator: "+", - left: self.left.left, - right: r - }); - } - } - // (x + "foo") + ("bar" + y) => (x + "foobar") + y - if (self.left instanceof AST_Binary - && self.left.operator == "+" - && self.left.is_string(compressor) - && self.right instanceof AST_Binary - && self.right.operator == "+" - && self.right.is_string(compressor)) { - var binary = make_node(AST_Binary, self, { - operator: "+", - left: self.left.right, - right: self.right.left, - }); - var m = binary.optimize(compressor); - if (binary !== m) { - self = make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_Binary, self.left, { - operator: "+", - left: self.left.left, - right: m - }), - right: self.right.right - }); - } - } - // a + -b => a - b - if (self.right instanceof AST_UnaryPrefix - && self.right.operator == "-" - && self.left.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.left, - right: self.right.expression - }); - break; - } - // -a + b => b - a - if (self.left instanceof AST_UnaryPrefix - && self.left.operator == "-" - && reversible() - && self.right.is_number(compressor)) { - self = make_node(AST_Binary, self, { - operator: "-", - left: self.right, - right: self.left.expression - }); - break; - } - // `foo${bar}baz` + 1 => `foo${bar}baz1` - if (self.left instanceof AST_TemplateString) { - var l = self.left; - var r = self.right.evaluate(compressor); - if (r != self.right) { - l.segments[l.segments.length - 1].value += String(r); - return l; - } - } - // 1 + `foo${bar}baz` => `1foo${bar}baz` - if (self.right instanceof AST_TemplateString) { - var r = self.right; - var l = self.left.evaluate(compressor); - if (l != self.left) { - r.segments[0].value = String(l) + r.segments[0].value; - return r; - } - } - // `1${bar}2` + `foo${bar}baz` => `1${bar}2foo${bar}baz` - if (self.left instanceof AST_TemplateString - && self.right instanceof AST_TemplateString) { - var l = self.left; - var segments = l.segments; - var r = self.right; - segments[segments.length - 1].value += r.segments[0].value; - for (var i = 1; i < r.segments.length; i++) { - segments.push(r.segments[i]); - } - return l; - } - case "*": - associative = compressor.option("unsafe_math"); - case "&": - case "|": - case "^": - // a + +b => +b + a - if (self.left.is_number(compressor) - && self.right.is_number(compressor) - && reversible() - && !(self.left instanceof AST_Binary - && self.left.operator != self.operator - && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) { - var reversed = make_node(AST_Binary, self, { - operator: self.operator, - left: self.right, - right: self.left - }); - if (self.right instanceof AST_Constant - && !(self.left instanceof AST_Constant)) { - self = best_of(compressor, reversed, self); - } else { - self = best_of(compressor, self, reversed); - } - } - if (associative && self.is_number(compressor)) { - // a + (b + c) => (a + b) + c - if (self.right instanceof AST_Binary - && self.right.operator == self.operator) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left, - right: self.right.left, - start: self.left.start, - end: self.right.left.end - }), - right: self.right.right - }); - } - // (n + 2) + 3 => 5 + n - // (2 * n) * 3 => 6 + n - if (self.right instanceof AST_Constant - && self.left instanceof AST_Binary - && self.left.operator == self.operator) { - if (self.left.left instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left.left, - right: self.right, - start: self.left.left.start, - end: self.right.end - }), - right: self.left.right - }); - } else if (self.left.right instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: self.left.right, - right: self.right, - start: self.left.right.start, - end: self.right.end - }), - right: self.left.left - }); - } - } - // (a | 1) | (2 | d) => (3 | a) | b - if (self.left instanceof AST_Binary - && self.left.operator == self.operator - && self.left.right instanceof AST_Constant - && self.right instanceof AST_Binary - && self.right.operator == self.operator - && self.right.left instanceof AST_Constant) { - self = make_node(AST_Binary, self, { - operator: self.operator, - left: make_node(AST_Binary, self.left, { - operator: self.operator, - left: make_node(AST_Binary, self.left.left, { - operator: self.operator, - left: self.left.right, - right: self.right.left, - start: self.left.right.start, - end: self.right.left.end - }), - right: self.left.left - }), - right: self.right.right - }); - } - } - } - } - // x && (y && z) ==> x && y && z - // x || (y || z) ==> x || y || z - // x + ("y" + z) ==> x + "y" + z - // "x" + (y + "z")==> "x" + y + "z" - if (self.right instanceof AST_Binary - && self.right.operator == self.operator - && (lazy_op.has(self.operator) - || (self.operator == "+" - && (self.right.left.is_string(compressor) - || (self.left.is_string(compressor) - && self.right.right.is_string(compressor))))) - ) { - self.left = make_node(AST_Binary, self.left, { - operator : self.operator, - left : self.left.transform(compressor), - right : self.right.left.transform(compressor) - }); - self.right = self.right.right.transform(compressor); - return self.transform(compressor); - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; -}); - -def_optimize(AST_SymbolExport, function(self) { - return self; -}); - -def_optimize(AST_SymbolRef, function(self, compressor) { - if ( - !compressor.option("ie8") - && is_undeclared_ref(self) - && !compressor.find_parent(AST_With) - ) { - switch (self.name) { - case "undefined": - return make_node(AST_Undefined, self).optimize(compressor); - case "NaN": - return make_node(AST_NaN, self).optimize(compressor); - case "Infinity": - return make_node(AST_Infinity, self).optimize(compressor); - } - } - - if (compressor.option("reduce_vars") && !compressor.is_lhs()) { - return inline_into_symbolref(self, compressor); - } else { - return self; - } -}); - -function is_atomic(lhs, self) { - return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE; -} - -def_optimize(AST_Undefined, function(self, compressor) { - if (compressor.option("unsafe_undefined")) { - var undef = find_variable(compressor, "undefined"); - if (undef) { - var ref = make_node(AST_SymbolRef, self, { - name : "undefined", - scope : undef.scope, - thedef : undef - }); - set_flag(ref, UNDEFINED); - return ref; - } - } - var lhs = compressor.is_lhs(); - if (lhs && is_atomic(lhs, self)) return self; - return make_node(AST_UnaryPrefix, self, { - operator: "void", - expression: make_node(AST_Number, self, { - value: 0 - }) - }); -}); - -def_optimize(AST_Infinity, function(self, compressor) { - var lhs = compressor.is_lhs(); - if (lhs && is_atomic(lhs, self)) return self; - if ( - compressor.option("keep_infinity") - && !(lhs && !is_atomic(lhs, self)) - && !find_variable(compressor, "Infinity") - ) { - return self; - } - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { - value: 1 - }), - right: make_node(AST_Number, self, { - value: 0 - }) - }); -}); - -def_optimize(AST_NaN, function(self, compressor) { - var lhs = compressor.is_lhs(); - if (lhs && !is_atomic(lhs, self) - || find_variable(compressor, "NaN")) { - return make_node(AST_Binary, self, { - operator: "/", - left: make_node(AST_Number, self, { - value: 0 - }), - right: make_node(AST_Number, self, { - value: 0 - }) - }); - } - return self; -}); - -const ASSIGN_OPS = makePredicate("+ - / * % >> << >>> | ^ &"); -const ASSIGN_OPS_COMMUTATIVE = makePredicate("* | ^ &"); -def_optimize(AST_Assign, function(self, compressor) { - if (self.logical) { - return self.lift_sequences(compressor); - } - - var def; - // x = x ---> x - if ( - self.operator === "=" - && self.left instanceof AST_SymbolRef - && self.left.name !== "arguments" - && !(def = self.left.definition()).undeclared - && self.right.equivalent_to(self.left) - ) { - return self.right; - } - - if (compressor.option("dead_code") - && self.left instanceof AST_SymbolRef - && (def = self.left.definition()).scope === compressor.find_parent(AST_Lambda)) { - var level = 0, node, parent = self; - do { - node = parent; - parent = compressor.parent(level++); - if (parent instanceof AST_Exit) { - if (in_try(level, parent)) break; - if (is_reachable(def.scope, [ def ])) break; - if (self.operator == "=") return self.right; - def.fixed = false; - return make_node(AST_Binary, self, { - operator: self.operator.slice(0, -1), - left: self.left, - right: self.right - }).optimize(compressor); - } - } while (parent instanceof AST_Binary && parent.right === node - || parent instanceof AST_Sequence && parent.tail_node() === node); - } - self = self.lift_sequences(compressor); - - if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary) { - // x = expr1 OP expr2 - if (self.right.left instanceof AST_SymbolRef - && self.right.left.name == self.left.name - && ASSIGN_OPS.has(self.right.operator)) { - // x = x - 2 ---> x -= 2 - self.operator = self.right.operator + "="; - self.right = self.right.right; - } else if (self.right.right instanceof AST_SymbolRef - && self.right.right.name == self.left.name - && ASSIGN_OPS_COMMUTATIVE.has(self.right.operator) - && !self.right.left.has_side_effects(compressor)) { - // x = 2 & x ---> x &= 2 - self.operator = self.right.operator + "="; - self.right = self.right.left; - } - } - return self; - - function in_try(level, node) { - function may_assignment_throw() { - const right = self.right; - self.right = make_node(AST_Null, right); - const may_throw = node.may_throw(compressor); - self.right = right; - - return may_throw; - } - - var stop_at = self.left.definition().scope.get_defun_scope(); - var parent; - while ((parent = compressor.parent(level++)) !== stop_at) { - if (parent instanceof AST_Try) { - if (parent.bfinally) return true; - if (parent.bcatch && may_assignment_throw()) return true; - } - } - } -}); - -def_optimize(AST_DefaultAssign, function(self, compressor) { - if (!compressor.option("evaluate")) { - return self; - } - var evaluateRight = self.right.evaluate(compressor); - - // `[x = undefined] = foo` ---> `[x] = foo` - // `(arg = undefined) => ...` ---> `(arg) => ...` (unless `keep_fargs`) - // `((arg = undefined) => ...)()` ---> `((arg) => ...)()` - let lambda, iife; - if (evaluateRight === undefined) { - if ( - (lambda = compressor.parent()) instanceof AST_Lambda - ? ( - compressor.option("keep_fargs") === false - || (iife = compressor.parent(1)).TYPE === "Call" - && iife.expression === lambda - ) - : true - ) { - self = self.left; - } - } else if (evaluateRight !== self.right) { - evaluateRight = make_node_from_constant(evaluateRight, self.right); - self.right = best_of_expression(evaluateRight, self.right); - } - - return self; -}); - -function is_nullish_check(check, check_subject, compressor) { - if (check_subject.may_throw(compressor)) return false; - - let nullish_side; - - // foo == null - if ( - check instanceof AST_Binary - && check.operator === "==" - // which side is nullish? - && ( - (nullish_side = is_nullish(check.left, compressor) && check.left) - || (nullish_side = is_nullish(check.right, compressor) && check.right) - ) - // is the other side the same as the check_subject - && ( - nullish_side === check.left - ? check.right - : check.left - ).equivalent_to(check_subject) - ) { - return true; - } - - // foo === null || foo === undefined - if (check instanceof AST_Binary && check.operator === "||") { - let null_cmp; - let undefined_cmp; - - const find_comparison = cmp => { - if (!( - cmp instanceof AST_Binary - && (cmp.operator === "===" || cmp.operator === "==") - )) { - return false; - } - - let found = 0; - let defined_side; - - if (cmp.left instanceof AST_Null) { - found++; - null_cmp = cmp; - defined_side = cmp.right; - } - if (cmp.right instanceof AST_Null) { - found++; - null_cmp = cmp; - defined_side = cmp.left; - } - if (is_undefined(cmp.left, compressor)) { - found++; - undefined_cmp = cmp; - defined_side = cmp.right; - } - if (is_undefined(cmp.right, compressor)) { - found++; - undefined_cmp = cmp; - defined_side = cmp.left; - } - - if (found !== 1) { - return false; - } - - if (!defined_side.equivalent_to(check_subject)) { - return false; - } - - return true; - }; - - if (!find_comparison(check.left)) return false; - if (!find_comparison(check.right)) return false; - - if (null_cmp && undefined_cmp && null_cmp !== undefined_cmp) { - return true; - } - } - - return false; -} - -def_optimize(AST_Conditional, function(self, compressor) { - if (!compressor.option("conditionals")) return self; - // This looks like lift_sequences(), should probably be under "sequences" - if (self.condition instanceof AST_Sequence) { - var expressions = self.condition.expressions.slice(); - self.condition = expressions.pop(); - expressions.push(self); - return make_sequence(self, expressions); - } - var cond = self.condition.evaluate(compressor); - if (cond !== self.condition) { - if (cond) { - return maintain_this_binding(compressor.parent(), compressor.self(), self.consequent); - } else { - return maintain_this_binding(compressor.parent(), compressor.self(), self.alternative); - } - } - var negated = cond.negate(compressor, first_in_statement(compressor)); - if (best_of(compressor, cond, negated) === negated) { - self = make_node(AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent - }); - } - var condition = self.condition; - var consequent = self.consequent; - var alternative = self.alternative; - // x?x:y --> x||y - if (condition instanceof AST_SymbolRef - && consequent instanceof AST_SymbolRef - && condition.definition() === consequent.definition()) { - return make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative - }); - } - // if (foo) exp = something; else exp = something_else; - // | - // v - // exp = foo ? something : something_else; - if ( - consequent instanceof AST_Assign - && alternative instanceof AST_Assign - && consequent.operator === alternative.operator - && consequent.logical === alternative.logical - && consequent.left.equivalent_to(alternative.left) - && (!self.condition.has_side_effects(compressor) - || consequent.operator == "=" - && !consequent.left.has_side_effects(compressor)) - ) { - return make_node(AST_Assign, self, { - operator: consequent.operator, - left: consequent.left, - logical: consequent.logical, - right: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.right, - alternative: alternative.right - }) - }); - } - // x ? y(a) : y(b) --> y(x ? a : b) - var arg_index; - if (consequent instanceof AST_Call - && alternative.TYPE === consequent.TYPE - && consequent.args.length > 0 - && consequent.args.length == alternative.args.length - && consequent.expression.equivalent_to(alternative.expression) - && !self.condition.has_side_effects(compressor) - && !consequent.expression.has_side_effects(compressor) - && typeof (arg_index = single_arg_diff()) == "number") { - var node = consequent.clone(); - node.args[arg_index] = make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.args[arg_index], - alternative: alternative.args[arg_index] - }); - return node; - } - // a ? b : c ? b : d --> (a || c) ? b : d - if (alternative instanceof AST_Conditional - && consequent.equivalent_to(alternative.consequent)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative.condition - }), - consequent: consequent, - alternative: alternative.alternative - }).optimize(compressor); - } - - // a == null ? b : a -> a ?? b - if ( - compressor.option("ecma") >= 2020 && - is_nullish_check(condition, alternative, compressor) - ) { - return make_node(AST_Binary, self, { - operator: "??", - left: alternative, - right: consequent - }).optimize(compressor); - } - - // a ? b : (c, b) --> (a || c), b - if (alternative instanceof AST_Sequence - && consequent.equivalent_to(alternative.expressions[alternative.expressions.length - 1])) { - return make_sequence(self, [ - make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: make_sequence(self, alternative.expressions.slice(0, -1)) - }), - consequent - ]).optimize(compressor); - } - // a ? b : (c && b) --> (a || c) && b - if (alternative instanceof AST_Binary - && alternative.operator == "&&" - && consequent.equivalent_to(alternative.right)) { - return make_node(AST_Binary, self, { - operator: "&&", - left: make_node(AST_Binary, self, { - operator: "||", - left: condition, - right: alternative.left - }), - right: consequent - }).optimize(compressor); - } - // x?y?z:a:a --> x&&y?z:a - if (consequent instanceof AST_Conditional - && consequent.alternative.equivalent_to(alternative)) { - return make_node(AST_Conditional, self, { - condition: make_node(AST_Binary, self, { - left: self.condition, - operator: "&&", - right: consequent.condition - }), - consequent: consequent.consequent, - alternative: alternative - }); - } - // x ? y : y --> x, y - if (consequent.equivalent_to(alternative)) { - return make_sequence(self, [ - self.condition, - consequent - ]).optimize(compressor); - } - // x ? y || z : z --> x && y || z - if (consequent instanceof AST_Binary - && consequent.operator == "||" - && consequent.right.equivalent_to(alternative)) { - return make_node(AST_Binary, self, { - operator: "||", - left: make_node(AST_Binary, self, { - operator: "&&", - left: self.condition, - right: consequent.left - }), - right: alternative - }).optimize(compressor); - } - - const in_bool = compressor.in_boolean_context(); - if (is_true(self.consequent)) { - if (is_false(self.alternative)) { - // c ? true : false ---> !!c - return booleanize(self.condition); - } - // c ? true : x ---> !!c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(self.condition), - right: self.alternative - }); - } - if (is_false(self.consequent)) { - if (is_true(self.alternative)) { - // c ? false : true ---> !c - return booleanize(self.condition.negate(compressor)); - } - // c ? false : x ---> !c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition.negate(compressor)), - right: self.alternative - }); - } - if (is_true(self.alternative)) { - // c ? x : true ---> !c || x - return make_node(AST_Binary, self, { - operator: "||", - left: booleanize(self.condition.negate(compressor)), - right: self.consequent - }); - } - if (is_false(self.alternative)) { - // c ? x : false ---> !!c && x - return make_node(AST_Binary, self, { - operator: "&&", - left: booleanize(self.condition), - right: self.consequent - }); - } - - return self; - - function booleanize(node) { - if (node.is_boolean()) return node; - // !!expression - return make_node(AST_UnaryPrefix, node, { - operator: "!", - expression: node.negate(compressor) - }); - } - - // AST_True or !0 - function is_true(node) { - return node instanceof AST_True - || in_bool - && node instanceof AST_Constant - && node.getValue() - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && !node.expression.getValue()); - } - // AST_False or !1 - function is_false(node) { - return node instanceof AST_False - || in_bool - && node instanceof AST_Constant - && !node.getValue() - || (node instanceof AST_UnaryPrefix - && node.operator == "!" - && node.expression instanceof AST_Constant - && node.expression.getValue()); - } - - function single_arg_diff() { - var a = consequent.args; - var b = alternative.args; - for (var i = 0, len = a.length; i < len; i++) { - if (a[i] instanceof AST_Expansion) return; - if (!a[i].equivalent_to(b[i])) { - if (b[i] instanceof AST_Expansion) return; - for (var j = i + 1; j < len; j++) { - if (a[j] instanceof AST_Expansion) return; - if (!a[j].equivalent_to(b[j])) return; - } - return i; - } - } - } -}); - -def_optimize(AST_Boolean, function(self, compressor) { - if (compressor.in_boolean_context()) return make_node(AST_Number, self, { - value: +self.value - }); - var p = compressor.parent(); - if (compressor.option("booleans_as_integers")) { - if (p instanceof AST_Binary && (p.operator == "===" || p.operator == "!==")) { - p.operator = p.operator.replace(/=$/, ""); - } - return make_node(AST_Number, self, { - value: +self.value - }); - } - if (compressor.option("booleans")) { - if (p instanceof AST_Binary && (p.operator == "==" - || p.operator == "!=")) { - return make_node(AST_Number, self, { - value: +self.value - }); - } - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_Number, self, { - value: 1 - self.value - }) - }); - } - return self; -}); - -function safe_to_flatten(value, compressor) { - if (value instanceof AST_SymbolRef) { - value = value.fixed_value(); - } - if (!value) return false; - if (!(value instanceof AST_Lambda || value instanceof AST_Class)) return true; - if (!(value instanceof AST_Lambda && value.contains_this())) return true; - return compressor.parent() instanceof AST_New; -} - -AST_PropAccess.DEFMETHOD("flatten_object", function(key, compressor) { - if (!compressor.option("properties")) return; - if (key === "__proto__") return; - - var arrows = compressor.option("unsafe_arrows") && compressor.option("ecma") >= 2015; - var expr = this.expression; - if (expr instanceof AST_Object) { - var props = expr.properties; - - for (var i = props.length; --i >= 0;) { - var prop = props[i]; - - if ("" + (prop instanceof AST_ConciseMethod ? prop.key.name : prop.key) == key) { - const all_props_flattenable = props.every((p) => - (p instanceof AST_ObjectKeyVal - || arrows && p instanceof AST_ConciseMethod && !p.is_generator - ) - && !p.computed_key() - ); - - if (!all_props_flattenable) return; - if (!safe_to_flatten(prop.value, compressor)) return; - - return make_node(AST_Sub, this, { - expression: make_node(AST_Array, expr, { - elements: props.map(function(prop) { - var v = prop.value; - if (v instanceof AST_Accessor) { - v = make_node(AST_Function, v, v); - } - - var k = prop.key; - if (k instanceof AST_Node && !(k instanceof AST_SymbolMethod)) { - return make_sequence(prop, [ k, v ]); - } - - return v; - }) - }), - property: make_node(AST_Number, this, { - value: i - }) - }); - } - } - } -}); - -def_optimize(AST_Sub, function(self, compressor) { - var expr = self.expression; - var prop = self.property; - if (compressor.option("properties")) { - var key = prop.evaluate(compressor); - if (key !== prop) { - if (typeof key == "string") { - if (key == "undefined") { - key = undefined; - } else { - var value = parseFloat(key); - if (value.toString() == key) { - key = value; - } - } - } - prop = self.property = best_of_expression( - prop, - make_node_from_constant(key, prop).transform(compressor) - ); - var property = "" + key; - if (is_basic_identifier_string(property) - && property.length <= prop.size() + 1) { - return make_node(AST_Dot, self, { - expression: expr, - optional: self.optional, - property: property, - quote: prop.quote, - }).optimize(compressor); - } - } - } - var fn; - OPT_ARGUMENTS: if (compressor.option("arguments") - && expr instanceof AST_SymbolRef - && expr.name == "arguments" - && expr.definition().orig.length == 1 - && (fn = expr.scope) instanceof AST_Lambda - && fn.uses_arguments - && !(fn instanceof AST_Arrow) - && prop instanceof AST_Number) { - var index = prop.getValue(); - var params = new Set(); - var argnames = fn.argnames; - for (var n = 0; n < argnames.length; n++) { - if (!(argnames[n] instanceof AST_SymbolFunarg)) { - break OPT_ARGUMENTS; // destructuring parameter - bail - } - var param = argnames[n].name; - if (params.has(param)) { - break OPT_ARGUMENTS; // duplicate parameter - bail - } - params.add(param); - } - var argname = fn.argnames[index]; - if (argname && compressor.has_directive("use strict")) { - var def = argname.definition(); - if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) { - argname = null; - } - } else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) { - while (index >= fn.argnames.length) { - argname = fn.create_symbol(AST_SymbolFunarg, { - source: fn, - scope: fn, - tentative_name: "argument_" + fn.argnames.length, - }); - fn.argnames.push(argname); - } - } - if (argname) { - var sym = make_node(AST_SymbolRef, self, argname); - sym.reference({}); - clear_flag(argname, UNUSED); - return sym; - } - } - if (compressor.is_lhs()) return self; - if (key !== prop) { - var sub = self.flatten_object(property, compressor); - if (sub) { - expr = self.expression = sub.expression; - prop = self.property = sub.property; - } - } - if (compressor.option("properties") && compressor.option("side_effects") - && prop instanceof AST_Number && expr instanceof AST_Array) { - var index = prop.getValue(); - var elements = expr.elements; - var retValue = elements[index]; - FLATTEN: if (safe_to_flatten(retValue, compressor)) { - var flatten = true; - var values = []; - for (var i = elements.length; --i > index;) { - var value = elements[i].drop_side_effect_free(compressor); - if (value) { - values.unshift(value); - if (flatten && value.has_side_effects(compressor)) flatten = false; - } - } - if (retValue instanceof AST_Expansion) break FLATTEN; - retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue; - if (!flatten) values.unshift(retValue); - while (--i >= 0) { - var value = elements[i]; - if (value instanceof AST_Expansion) break FLATTEN; - value = value.drop_side_effect_free(compressor); - if (value) values.unshift(value); - else index--; - } - if (flatten) { - values.push(retValue); - return make_sequence(self, values).optimize(compressor); - } else return make_node(AST_Sub, self, { - expression: make_node(AST_Array, expr, { - elements: values - }), - property: make_node(AST_Number, prop, { - value: index - }) - }); - } - } - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; -}); - -def_optimize(AST_Chain, function (self, compressor) { - if (is_nullish(self.expression, compressor)) { - let parent = compressor.parent(); - // It's valid to delete a nullish optional chain, but if we optimized - // this to `delete undefined` then it would appear to be a syntax error - // when we try to optimize the delete. Thankfully, `delete 0` is fine. - if (parent instanceof AST_UnaryPrefix && parent.operator === "delete") { - return make_node_from_constant(0, self); - } - return make_node(AST_Undefined, self); - } - return self; -}); - -def_optimize(AST_Dot, function(self, compressor) { - const parent = compressor.parent(); - if (compressor.is_lhs()) return self; - if (compressor.option("unsafe_proto") - && self.expression instanceof AST_Dot - && self.expression.property == "prototype") { - var exp = self.expression.expression; - if (is_undeclared_ref(exp)) switch (exp.name) { - case "Array": - self.expression = make_node(AST_Array, self.expression, { - elements: [] - }); - break; - case "Function": - self.expression = make_node(AST_Function, self.expression, { - argnames: [], - body: [] - }); - break; - case "Number": - self.expression = make_node(AST_Number, self.expression, { - value: 0 - }); - break; - case "Object": - self.expression = make_node(AST_Object, self.expression, { - properties: [] - }); - break; - case "RegExp": - self.expression = make_node(AST_RegExp, self.expression, { - value: { source: "t", flags: "" } - }); - break; - case "String": - self.expression = make_node(AST_String, self.expression, { - value: "" - }); - break; - } - } - if (!(parent instanceof AST_Call) || !has_annotation(parent, _NOINLINE)) { - const sub = self.flatten_object(self.property, compressor); - if (sub) return sub.optimize(compressor); - } - - if (self.expression instanceof AST_PropAccess - && parent instanceof AST_PropAccess) { - return self; - } - - let ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - return self; -}); - -function literals_in_boolean_context(self, compressor) { - if (compressor.in_boolean_context()) { - return best_of(compressor, self, make_sequence(self, [ - self, - make_node(AST_True, self) - ]).optimize(compressor)); - } - return self; -} - -function inline_array_like_spread(elements) { - for (var i = 0; i < elements.length; i++) { - var el = elements[i]; - if (el instanceof AST_Expansion) { - var expr = el.expression; - if ( - expr instanceof AST_Array - && !expr.elements.some(elm => elm instanceof AST_Hole) - ) { - elements.splice(i, 1, ...expr.elements); - // Step back one, as the element at i is now new. - i--; - } - // In array-like spread, spreading a non-iterable value is TypeError. - // We therefore can’t optimize anything else, unlike with object spread. - } - } -} - -def_optimize(AST_Array, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_array_like_spread(self.elements); - return self; -}); - -function inline_object_prop_spread(props, compressor) { - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop instanceof AST_Expansion) { - const expr = prop.expression; - if ( - expr instanceof AST_Object - && expr.properties.every(prop => prop instanceof AST_ObjectKeyVal) - ) { - props.splice(i, 1, ...expr.properties); - // Step back one, as the property at i is now new. - i--; - } else if (expr instanceof AST_Constant - && !(expr instanceof AST_String)) { - // Unlike array-like spread, in object spread, spreading a - // non-iterable value silently does nothing; it is thus safe - // to remove. AST_String is the only iterable AST_Constant. - props.splice(i, 1); - i--; - } else if (is_nullish(expr, compressor)) { - // Likewise, null and undefined can be silently removed. - props.splice(i, 1); - i--; - } - } - } -} - -def_optimize(AST_Object, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_object_prop_spread(self.properties, compressor); - return self; -}); - -def_optimize(AST_RegExp, literals_in_boolean_context); - -def_optimize(AST_Return, function(self, compressor) { - if (self.value && is_undefined(self.value, compressor)) { - self.value = null; - } - return self; -}); - -def_optimize(AST_Arrow, opt_AST_Lambda); - -def_optimize(AST_Function, function(self, compressor) { - self = opt_AST_Lambda(self, compressor); - if (compressor.option("unsafe_arrows") - && compressor.option("ecma") >= 2015 - && !self.name - && !self.is_generator - && !self.uses_arguments - && !self.pinned()) { - const uses_this = walk(self, node => { - if (node instanceof AST_This) return walk_abort; - }); - if (!uses_this) return make_node(AST_Arrow, self, self).optimize(compressor); - } - return self; -}); - -def_optimize(AST_Class, function(self) { - for (let i = 0; i < self.properties.length; i++) { - const prop = self.properties[i]; - if (prop instanceof AST_ClassStaticBlock && prop.body.length == 0) { - self.properties.splice(i, 1); - i--; - } - } - - return self; -}); - -def_optimize(AST_ClassStaticBlock, function(self, compressor) { - tighten_body(self.body, compressor); - return self; -}); - -def_optimize(AST_Yield, function(self, compressor) { - if (self.expression && !self.is_star && is_undefined(self.expression, compressor)) { - self.expression = null; - } - return self; -}); - -def_optimize(AST_TemplateString, function(self, compressor) { - if ( - !compressor.option("evaluate") - || compressor.parent() instanceof AST_PrefixedTemplateString - ) { - return self; - } - - var segments = []; - for (var i = 0; i < self.segments.length; i++) { - var segment = self.segments[i]; - if (segment instanceof AST_Node) { - var result = segment.evaluate(compressor); - // Evaluate to constant value - // Constant value shorter than ${segment} - if (result !== segment && (result + "").length <= segment.size() + "${}".length) { - // There should always be a previous and next segment if segment is a node - segments[segments.length - 1].value = segments[segments.length - 1].value + result + self.segments[++i].value; - continue; - } - // `before ${`innerBefore ${any} innerAfter`} after` => `before innerBefore ${any} innerAfter after` - // TODO: - // `before ${'test' + foo} after` => `before innerBefore ${any} innerAfter after` - // `before ${foo + 'test} after` => `before innerBefore ${any} innerAfter after` - if (segment instanceof AST_TemplateString) { - var inners = segment.segments; - segments[segments.length - 1].value += inners[0].value; - for (var j = 1; j < inners.length; j++) { - segment = inners[j]; - segments.push(segment); - } - continue; - } - } - segments.push(segment); - } - self.segments = segments; - - // `foo` => "foo" - if (segments.length == 1) { - return make_node(AST_String, self, segments[0]); - } - - if ( - segments.length === 3 - && segments[1] instanceof AST_Node - && ( - segments[1].is_string(compressor) - || segments[1].is_number(compressor) - || is_nullish(segments[1], compressor) - || compressor.option("unsafe") - ) - ) { - // `foo${bar}` => "foo" + bar - if (segments[2].value === "") { - return make_node(AST_Binary, self, { - operator: "+", - left: make_node(AST_String, self, { - value: segments[0].value, - }), - right: segments[1], - }); - } - // `${bar}baz` => bar + "baz" - if (segments[0].value === "") { - return make_node(AST_Binary, self, { - operator: "+", - left: segments[1], - right: make_node(AST_String, self, { - value: segments[2].value, - }), - }); - } - } - return self; -}); - -def_optimize(AST_PrefixedTemplateString, function(self) { - return self; -}); - -// ["p"]:1 ---> p:1 -// [42]:1 ---> 42:1 -function lift_key(self, compressor) { - if (!compressor.option("computed_props")) return self; - // save a comparison in the typical case - if (!(self.key instanceof AST_Constant)) return self; - // allow certain acceptable props as not all AST_Constants are true constants - if (self.key instanceof AST_String || self.key instanceof AST_Number) { - if (self.key.value === "__proto__") return self; - if (self.key.value == "constructor" - && compressor.parent() instanceof AST_Class) return self; - if (self instanceof AST_ObjectKeyVal) { - self.quote = self.key.quote; - self.key = self.key.value; - } else if (self instanceof AST_ClassProperty) { - self.quote = self.key.quote; - self.key = make_node(AST_SymbolClassProperty, self.key, { - name: self.key.value - }); - } else { - self.quote = self.key.quote; - self.key = make_node(AST_SymbolMethod, self.key, { - name: self.key.value - }); - } - } - return self; -} - -def_optimize(AST_ObjectProperty, lift_key); - -def_optimize(AST_ConciseMethod, function(self, compressor) { - lift_key(self, compressor); - // p(){return x;} ---> p:()=>x - if (compressor.option("arrows") - && compressor.parent() instanceof AST_Object - && !self.is_generator - && !self.value.uses_arguments - && !self.value.pinned() - && self.value.body.length == 1 - && self.value.body[0] instanceof AST_Return - && self.value.body[0].value - && !self.value.contains_this()) { - var arrow = make_node(AST_Arrow, self.value, self.value); - arrow.async = self.async; - arrow.is_generator = self.is_generator; - return make_node(AST_ObjectKeyVal, self, { - key: self.key instanceof AST_SymbolMethod ? self.key.name : self.key, - value: arrow, - quote: self.quote, - }); - } - return self; -}); - -def_optimize(AST_ObjectKeyVal, function(self, compressor) { - lift_key(self, compressor); - // p:function(){} ---> p(){} - // p:function*(){} ---> *p(){} - // p:async function(){} ---> async p(){} - // p:()=>{} ---> p(){} - // p:async()=>{} ---> async p(){} - var unsafe_methods = compressor.option("unsafe_methods"); - if (unsafe_methods - && compressor.option("ecma") >= 2015 - && (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + ""))) { - var key = self.key; - var value = self.value; - var is_arrow_with_block = value instanceof AST_Arrow - && Array.isArray(value.body) - && !value.contains_this(); - if ((is_arrow_with_block || value instanceof AST_Function) && !value.name) { - return make_node(AST_ConciseMethod, self, { - async: value.async, - is_generator: value.is_generator, - key: key instanceof AST_Node ? key : make_node(AST_SymbolMethod, self, { - name: key, - }), - value: make_node(AST_Accessor, value, value), - quote: self.quote, - }); - } - } - return self; -}); - -def_optimize(AST_Destructuring, function(self, compressor) { - if (compressor.option("pure_getters") == true - && compressor.option("unused") - && !self.is_array - && Array.isArray(self.names) - && !is_destructuring_export_decl(compressor) - && !(self.names[self.names.length - 1] instanceof AST_Expansion)) { - var keep = []; - for (var i = 0; i < self.names.length; i++) { - var elem = self.names[i]; - if (!(elem instanceof AST_ObjectKeyVal - && typeof elem.key == "string" - && elem.value instanceof AST_SymbolDeclaration - && !should_retain(compressor, elem.value.definition()))) { - keep.push(elem); - } - } - if (keep.length != self.names.length) { - self.names = keep; - } - } - return self; - - function is_destructuring_export_decl(compressor) { - var ancestors = [/^VarDef$/, /^(Const|Let|Var)$/, /^Export$/]; - for (var a = 0, p = 0, len = ancestors.length; a < len; p++) { - var parent = compressor.parent(p); - if (!parent) return false; - if (a === 0 && parent.TYPE == "Destructuring") continue; - if (!ancestors[a].test(parent.TYPE)) { - return false; - } - a++; - } - return true; - } - - function should_retain(compressor, def) { - if (def.references.length) return true; - if (!def.global) return false; - if (compressor.toplevel.vars) { - if (compressor.top_retain) { - return compressor.top_retain(def); - } - return false; - } - return true; - } -}); - -export { - Compressor, -}; diff --git a/node_modules/terser/lib/compress/inference.js b/node_modules/terser/lib/compress/inference.js deleted file mode 100644 index 88547ce..0000000 --- a/node_modules/terser/lib/compress/inference.js +++ /dev/null @@ -1,934 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Array, - AST_Arrow, - AST_Assign, - AST_BigInt, - AST_Binary, - AST_Block, - AST_BlockStatement, - AST_Call, - AST_Case, - AST_Chain, - AST_Class, - AST_DefClass, - AST_ClassStaticBlock, - AST_ClassProperty, - AST_ConciseMethod, - AST_Conditional, - AST_Constant, - AST_Definitions, - AST_Dot, - AST_EmptyStatement, - AST_Expansion, - AST_False, - AST_ForIn, - AST_Function, - AST_If, - AST_Import, - AST_ImportMeta, - AST_Jump, - AST_LabeledStatement, - AST_Lambda, - AST_New, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Statement, - AST_String, - AST_Sub, - AST_Switch, - AST_SwitchBranch, - AST_SymbolClassProperty, - AST_SymbolDeclaration, - AST_SymbolRef, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_True, - AST_Try, - AST_Unary, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Undefined, - AST_VarDef, - - walk, - walk_abort, - - _PURE -} from "../ast.js"; -import { - makePredicate, - return_true, - return_false, - return_null, - return_this, - make_node, - member, - has_annotation, -} from "../utils/index.js"; -import { make_sequence, best_of_expression, read_property } from "./common.js"; - -import { INLINED, UNDEFINED, has_flag } from "./compressor-flags.js"; -import { pure_prop_access_globals, is_pure_native_fn, is_pure_native_method } from "./native-objects.js"; - -// Functions and methods to infer certain facts about expressions -// It's not always possible to be 100% sure about something just by static analysis, -// so `true` means yes, and `false` means maybe - -export const is_undeclared_ref = (node) => - node instanceof AST_SymbolRef && node.definition().undeclared; - -export const lazy_op = makePredicate("&& || ??"); -export const unary_side_effects = makePredicate("delete ++ --"); - -// methods to determine whether an expression has a boolean result type -(function(def_is_boolean) { - const unary_bool = makePredicate("! delete"); - const binary_bool = makePredicate("in instanceof == != === !== < <= >= >"); - def_is_boolean(AST_Node, return_false); - def_is_boolean(AST_UnaryPrefix, function() { - return unary_bool.has(this.operator); - }); - def_is_boolean(AST_Binary, function() { - return binary_bool.has(this.operator) - || lazy_op.has(this.operator) - && this.left.is_boolean() - && this.right.is_boolean(); - }); - def_is_boolean(AST_Conditional, function() { - return this.consequent.is_boolean() && this.alternative.is_boolean(); - }); - def_is_boolean(AST_Assign, function() { - return this.operator == "=" && this.right.is_boolean(); - }); - def_is_boolean(AST_Sequence, function() { - return this.tail_node().is_boolean(); - }); - def_is_boolean(AST_True, return_true); - def_is_boolean(AST_False, return_true); -})(function(node, func) { - node.DEFMETHOD("is_boolean", func); -}); - -// methods to determine if an expression has a numeric result type -(function(def_is_number) { - def_is_number(AST_Node, return_false); - def_is_number(AST_Number, return_true); - const unary = makePredicate("+ - ~ ++ --"); - def_is_number(AST_Unary, function() { - return unary.has(this.operator) && !(this.expression instanceof AST_BigInt); - }); - const numeric_ops = makePredicate("- * / % & | ^ << >> >>>"); - def_is_number(AST_Binary, function(compressor) { - return numeric_ops.has(this.operator) || this.operator == "+" - && this.left.is_number(compressor) - && this.right.is_number(compressor); - }); - def_is_number(AST_Assign, function(compressor) { - return numeric_ops.has(this.operator.slice(0, -1)) - || this.operator == "=" && this.right.is_number(compressor); - }); - def_is_number(AST_Sequence, function(compressor) { - return this.tail_node().is_number(compressor); - }); - def_is_number(AST_Conditional, function(compressor) { - return this.consequent.is_number(compressor) && this.alternative.is_number(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_number", func); -}); - -// methods to determine if an expression has a string result type -(function(def_is_string) { - def_is_string(AST_Node, return_false); - def_is_string(AST_String, return_true); - def_is_string(AST_TemplateString, return_true); - def_is_string(AST_UnaryPrefix, function() { - return this.operator == "typeof"; - }); - def_is_string(AST_Binary, function(compressor) { - return this.operator == "+" && - (this.left.is_string(compressor) || this.right.is_string(compressor)); - }); - def_is_string(AST_Assign, function(compressor) { - return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); - }); - def_is_string(AST_Sequence, function(compressor) { - return this.tail_node().is_string(compressor); - }); - def_is_string(AST_Conditional, function(compressor) { - return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("is_string", func); -}); - -export function is_undefined(node, compressor) { - return ( - has_flag(node, UNDEFINED) - || node instanceof AST_Undefined - || node instanceof AST_UnaryPrefix - && node.operator == "void" - && !node.expression.has_side_effects(compressor) - ); -} - -// Is the node explicitly null or undefined. -function is_null_or_undefined(node, compressor) { - let fixed; - return ( - node instanceof AST_Null - || is_undefined(node, compressor) - || ( - node instanceof AST_SymbolRef - && (fixed = node.definition().fixed) instanceof AST_Node - && is_nullish(fixed, compressor) - ) - ); -} - -// Find out if this expression is optionally chained from a base-point that we -// can statically analyze as null or undefined. -export function is_nullish_shortcircuited(node, compressor) { - if (node instanceof AST_PropAccess || node instanceof AST_Call) { - return ( - (node.optional && is_null_or_undefined(node.expression, compressor)) - || is_nullish_shortcircuited(node.expression, compressor) - ); - } - if (node instanceof AST_Chain) return is_nullish_shortcircuited(node.expression, compressor); - return false; -} - -// Find out if something is == null, or can short circuit into nullish. -// Used to optimize ?. and ?? -export function is_nullish(node, compressor) { - if (is_null_or_undefined(node, compressor)) return true; - return is_nullish_shortcircuited(node, compressor); -} - -// Determine if expression might cause side effects -// If there's a possibility that a node may change something when it's executed, this returns true -(function(def_has_side_effects) { - def_has_side_effects(AST_Node, return_true); - - def_has_side_effects(AST_EmptyStatement, return_false); - def_has_side_effects(AST_Constant, return_false); - def_has_side_effects(AST_This, return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].has_side_effects(compressor)) - return true; - return false; - } - - def_has_side_effects(AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def_has_side_effects(AST_Call, function(compressor) { - if ( - !this.is_callee_pure(compressor) - && (!this.expression.is_call_pure(compressor) - || this.expression.has_side_effects(compressor)) - ) { - return true; - } - return any(this.args, compressor); - }); - def_has_side_effects(AST_Switch, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def_has_side_effects(AST_Case, function(compressor) { - return this.expression.has_side_effects(compressor) - || any(this.body, compressor); - }); - def_has_side_effects(AST_Try, function(compressor) { - return this.body.has_side_effects(compressor) - || this.bcatch && this.bcatch.has_side_effects(compressor) - || this.bfinally && this.bfinally.has_side_effects(compressor); - }); - def_has_side_effects(AST_If, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.body && this.body.has_side_effects(compressor) - || this.alternative && this.alternative.has_side_effects(compressor); - }); - def_has_side_effects(AST_ImportMeta, return_false); - def_has_side_effects(AST_LabeledStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def_has_side_effects(AST_SimpleStatement, function(compressor) { - return this.body.has_side_effects(compressor); - }); - def_has_side_effects(AST_Lambda, return_false); - def_has_side_effects(AST_Class, function (compressor) { - if (this.extends && this.extends.has_side_effects(compressor)) { - return true; - } - return any(this.properties, compressor); - }); - def_has_side_effects(AST_ClassStaticBlock, function(compressor) { - return any(this.body, compressor); - }); - def_has_side_effects(AST_Binary, function(compressor) { - return this.left.has_side_effects(compressor) - || this.right.has_side_effects(compressor); - }); - def_has_side_effects(AST_Assign, return_true); - def_has_side_effects(AST_Conditional, function(compressor) { - return this.condition.has_side_effects(compressor) - || this.consequent.has_side_effects(compressor) - || this.alternative.has_side_effects(compressor); - }); - def_has_side_effects(AST_Unary, function(compressor) { - return unary_side_effects.has(this.operator) - || this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) && !pure_prop_access_globals.has(this.name); - }); - def_has_side_effects(AST_SymbolClassProperty, return_false); - def_has_side_effects(AST_SymbolDeclaration, return_false); - def_has_side_effects(AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def_has_side_effects(AST_ObjectProperty, function(compressor) { - return ( - this.computed_key() && this.key.has_side_effects(compressor) - || this.value && this.value.has_side_effects(compressor) - ); - }); - def_has_side_effects(AST_ClassProperty, function(compressor) { - return ( - this.computed_key() && this.key.has_side_effects(compressor) - || this.static && this.value && this.value.has_side_effects(compressor) - ); - }); - def_has_side_effects(AST_ConciseMethod, function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(AST_ObjectGetter, function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(AST_ObjectSetter, function(compressor) { - return this.computed_key() && this.key.has_side_effects(compressor); - }); - def_has_side_effects(AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def_has_side_effects(AST_Dot, function(compressor) { - if (is_nullish(this, compressor)) { - return this.expression.has_side_effects(compressor); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return true; - } - - return this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_Sub, function(compressor) { - if (is_nullish(this, compressor)) { - return this.expression.has_side_effects(compressor); - } - if (!this.optional && this.expression.may_throw_on_access(compressor)) { - return true; - } - - var property = this.property.has_side_effects(compressor); - if (property && this.optional) return true; // "?." is a condition - - return property || this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_Chain, function (compressor) { - return this.expression.has_side_effects(compressor); - }); - def_has_side_effects(AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def_has_side_effects(AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def_has_side_effects(AST_VarDef, function() { - return this.value; - }); - def_has_side_effects(AST_TemplateSegment, return_false); - def_has_side_effects(AST_TemplateString, function(compressor) { - return any(this.segments, compressor); - }); -})(function(node, func) { - node.DEFMETHOD("has_side_effects", func); -}); - -// determine if expression may throw -(function(def_may_throw) { - def_may_throw(AST_Node, return_true); - - def_may_throw(AST_Constant, return_false); - def_may_throw(AST_EmptyStatement, return_false); - def_may_throw(AST_Lambda, return_false); - def_may_throw(AST_SymbolDeclaration, return_false); - def_may_throw(AST_This, return_false); - def_may_throw(AST_ImportMeta, return_false); - - function any(list, compressor) { - for (var i = list.length; --i >= 0;) - if (list[i].may_throw(compressor)) - return true; - return false; - } - - def_may_throw(AST_Class, function(compressor) { - if (this.extends && this.extends.may_throw(compressor)) return true; - return any(this.properties, compressor); - }); - def_may_throw(AST_ClassStaticBlock, function (compressor) { - return any(this.body, compressor); - }); - - def_may_throw(AST_Array, function(compressor) { - return any(this.elements, compressor); - }); - def_may_throw(AST_Assign, function(compressor) { - if (this.right.may_throw(compressor)) return true; - if (!compressor.has_directive("use strict") - && this.operator == "=" - && this.left instanceof AST_SymbolRef) { - return false; - } - return this.left.may_throw(compressor); - }); - def_may_throw(AST_Binary, function(compressor) { - return this.left.may_throw(compressor) - || this.right.may_throw(compressor); - }); - def_may_throw(AST_Block, function(compressor) { - return any(this.body, compressor); - }); - def_may_throw(AST_Call, function(compressor) { - if (is_nullish(this, compressor)) return false; - if (any(this.args, compressor)) return true; - if (this.is_callee_pure(compressor)) return false; - if (this.expression.may_throw(compressor)) return true; - return !(this.expression instanceof AST_Lambda) - || any(this.expression.body, compressor); - }); - def_may_throw(AST_Case, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def_may_throw(AST_Conditional, function(compressor) { - return this.condition.may_throw(compressor) - || this.consequent.may_throw(compressor) - || this.alternative.may_throw(compressor); - }); - def_may_throw(AST_Definitions, function(compressor) { - return any(this.definitions, compressor); - }); - def_may_throw(AST_If, function(compressor) { - return this.condition.may_throw(compressor) - || this.body && this.body.may_throw(compressor) - || this.alternative && this.alternative.may_throw(compressor); - }); - def_may_throw(AST_LabeledStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def_may_throw(AST_Object, function(compressor) { - return any(this.properties, compressor); - }); - def_may_throw(AST_ObjectProperty, function(compressor) { - // TODO key may throw too - return this.value ? this.value.may_throw(compressor) : false; - }); - def_may_throw(AST_ClassProperty, function(compressor) { - return ( - this.computed_key() && this.key.may_throw(compressor) - || this.static && this.value && this.value.may_throw(compressor) - ); - }); - def_may_throw(AST_ConciseMethod, function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw(AST_ObjectGetter, function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw(AST_ObjectSetter, function(compressor) { - return this.computed_key() && this.key.may_throw(compressor); - }); - def_may_throw(AST_Return, function(compressor) { - return this.value && this.value.may_throw(compressor); - }); - def_may_throw(AST_Sequence, function(compressor) { - return any(this.expressions, compressor); - }); - def_may_throw(AST_SimpleStatement, function(compressor) { - return this.body.may_throw(compressor); - }); - def_may_throw(AST_Dot, function(compressor) { - if (is_nullish(this, compressor)) return false; - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor); - }); - def_may_throw(AST_Sub, function(compressor) { - if (is_nullish(this, compressor)) return false; - return !this.optional && this.expression.may_throw_on_access(compressor) - || this.expression.may_throw(compressor) - || this.property.may_throw(compressor); - }); - def_may_throw(AST_Chain, function(compressor) { - return this.expression.may_throw(compressor); - }); - def_may_throw(AST_Switch, function(compressor) { - return this.expression.may_throw(compressor) - || any(this.body, compressor); - }); - def_may_throw(AST_SymbolRef, function(compressor) { - return !this.is_declared(compressor) && !pure_prop_access_globals.has(this.name); - }); - def_may_throw(AST_SymbolClassProperty, return_false); - def_may_throw(AST_Try, function(compressor) { - return this.bcatch ? this.bcatch.may_throw(compressor) : this.body.may_throw(compressor) - || this.bfinally && this.bfinally.may_throw(compressor); - }); - def_may_throw(AST_Unary, function(compressor) { - if (this.operator == "typeof" && this.expression instanceof AST_SymbolRef) - return false; - return this.expression.may_throw(compressor); - }); - def_may_throw(AST_VarDef, function(compressor) { - if (!this.value) return false; - return this.value.may_throw(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("may_throw", func); -}); - -// determine if expression is constant -(function(def_is_constant_expression) { - function all_refs_local(scope) { - let result = true; - walk(this, node => { - if (node instanceof AST_SymbolRef) { - if (has_flag(this, INLINED)) { - result = false; - return walk_abort; - } - var def = node.definition(); - if ( - member(def, this.enclosed) - && !this.variables.has(def.name) - ) { - if (scope) { - var scope_def = scope.find_variable(node); - if (def.undeclared ? !scope_def : scope_def === def) { - result = "f"; - return true; - } - } - result = false; - return walk_abort; - } - return true; - } - if (node instanceof AST_This && this instanceof AST_Arrow) { - result = false; - return walk_abort; - } - }); - return result; - } - - def_is_constant_expression(AST_Node, return_false); - def_is_constant_expression(AST_Constant, return_true); - def_is_constant_expression(AST_Class, function(scope) { - if (this.extends && !this.extends.is_constant_expression(scope)) { - return false; - } - - for (const prop of this.properties) { - if (prop.computed_key() && !prop.key.is_constant_expression(scope)) { - return false; - } - if (prop.static && prop.value && !prop.value.is_constant_expression(scope)) { - return false; - } - if (prop instanceof AST_ClassStaticBlock) { - return false; - } - } - - return all_refs_local.call(this, scope); - }); - def_is_constant_expression(AST_Lambda, all_refs_local); - def_is_constant_expression(AST_Unary, function() { - return this.expression.is_constant_expression(); - }); - def_is_constant_expression(AST_Binary, function() { - return this.left.is_constant_expression() - && this.right.is_constant_expression(); - }); - def_is_constant_expression(AST_Array, function() { - return this.elements.every((l) => l.is_constant_expression()); - }); - def_is_constant_expression(AST_Object, function() { - return this.properties.every((l) => l.is_constant_expression()); - }); - def_is_constant_expression(AST_ObjectProperty, function() { - return !!(!(this.key instanceof AST_Node) && this.value && this.value.is_constant_expression()); - }); -})(function(node, func) { - node.DEFMETHOD("is_constant_expression", func); -}); - - -// may_throw_on_access() -// returns true if this node may be null, undefined or contain `AST_Accessor` -(function(def_may_throw_on_access) { - AST_Node.DEFMETHOD("may_throw_on_access", function(compressor) { - return !compressor.option("pure_getters") - || this._dot_throw(compressor); - }); - - function is_strict(compressor) { - return /strict/.test(compressor.option("pure_getters")); - } - - def_may_throw_on_access(AST_Node, is_strict); - def_may_throw_on_access(AST_Null, return_true); - def_may_throw_on_access(AST_Undefined, return_true); - def_may_throw_on_access(AST_Constant, return_false); - def_may_throw_on_access(AST_Array, return_false); - def_may_throw_on_access(AST_Object, function(compressor) { - if (!is_strict(compressor)) return false; - for (var i = this.properties.length; --i >=0;) - if (this.properties[i]._dot_throw(compressor)) return true; - return false; - }); - // Do not be as strict with classes as we are with objects. - // Hopefully the community is not going to abuse static getters and setters. - // https://github.com/terser/terser/issues/724#issuecomment-643655656 - def_may_throw_on_access(AST_Class, return_false); - def_may_throw_on_access(AST_ObjectProperty, return_false); - def_may_throw_on_access(AST_ObjectGetter, return_true); - def_may_throw_on_access(AST_Expansion, function(compressor) { - return this.expression._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Function, return_false); - def_may_throw_on_access(AST_Arrow, return_false); - def_may_throw_on_access(AST_UnaryPostfix, return_false); - def_may_throw_on_access(AST_UnaryPrefix, function() { - return this.operator == "void"; - }); - def_may_throw_on_access(AST_Binary, function(compressor) { - return (this.operator == "&&" || this.operator == "||" || this.operator == "??") - && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); - }); - def_may_throw_on_access(AST_Assign, function(compressor) { - if (this.logical) return true; - - return this.operator == "=" - && this.right._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Conditional, function(compressor) { - return this.consequent._dot_throw(compressor) - || this.alternative._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Dot, function(compressor) { - if (!is_strict(compressor)) return false; - - if (this.property == "prototype") { - return !( - this.expression instanceof AST_Function - || this.expression instanceof AST_Class - ); - } - return true; - }); - def_may_throw_on_access(AST_Chain, function(compressor) { - return this.expression._dot_throw(compressor); - }); - def_may_throw_on_access(AST_Sequence, function(compressor) { - return this.tail_node()._dot_throw(compressor); - }); - def_may_throw_on_access(AST_SymbolRef, function(compressor) { - if (this.name === "arguments" && this.scope instanceof AST_Lambda) return false; - if (has_flag(this, UNDEFINED)) return true; - if (!is_strict(compressor)) return false; - if (is_undeclared_ref(this) && this.is_declared(compressor)) return false; - if (this.is_immutable()) return false; - var fixed = this.fixed_value(); - return !fixed || fixed._dot_throw(compressor); - }); -})(function(node, func) { - node.DEFMETHOD("_dot_throw", func); -}); - -export function is_lhs(node, parent) { - if (parent instanceof AST_Unary && unary_side_effects.has(parent.operator)) return parent.expression; - if (parent instanceof AST_Assign && parent.left === node) return node; - if (parent instanceof AST_ForIn && parent.init === node) return node; -} - -// method to negate an expression -(function(def_negate) { - function basic_negation(exp) { - return make_node(AST_UnaryPrefix, exp, { - operator: "!", - expression: exp - }); - } - function best(orig, alt, first_in_statement) { - var negated = basic_negation(orig); - if (first_in_statement) { - var stat = make_node(AST_SimpleStatement, alt, { - body: alt - }); - return best_of_expression(negated, stat) === stat ? alt : negated; - } - return best_of_expression(negated, alt); - } - def_negate(AST_Node, function() { - return basic_negation(this); - }); - def_negate(AST_Statement, function() { - throw new Error("Cannot negate a statement"); - }); - def_negate(AST_Function, function() { - return basic_negation(this); - }); - def_negate(AST_Class, function() { - return basic_negation(this); - }); - def_negate(AST_Arrow, function() { - return basic_negation(this); - }); - def_negate(AST_UnaryPrefix, function() { - if (this.operator == "!") - return this.expression; - return basic_negation(this); - }); - def_negate(AST_Sequence, function(compressor) { - var expressions = this.expressions.slice(); - expressions.push(expressions.pop().negate(compressor)); - return make_sequence(this, expressions); - }); - def_negate(AST_Conditional, function(compressor, first_in_statement) { - var self = this.clone(); - self.consequent = self.consequent.negate(compressor); - self.alternative = self.alternative.negate(compressor); - return best(this, self, first_in_statement); - }); - def_negate(AST_Binary, function(compressor, first_in_statement) { - var self = this.clone(), op = this.operator; - if (compressor.option("unsafe_comps")) { - switch (op) { - case "<=" : self.operator = ">" ; return self; - case "<" : self.operator = ">=" ; return self; - case ">=" : self.operator = "<" ; return self; - case ">" : self.operator = "<=" ; return self; - } - } - switch (op) { - case "==" : self.operator = "!="; return self; - case "!=" : self.operator = "=="; return self; - case "===": self.operator = "!=="; return self; - case "!==": self.operator = "==="; return self; - case "&&": - self.operator = "||"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - case "||": - self.operator = "&&"; - self.left = self.left.negate(compressor, first_in_statement); - self.right = self.right.negate(compressor); - return best(this, self, first_in_statement); - } - return basic_negation(this); - }); -})(function(node, func) { - node.DEFMETHOD("negate", function(compressor, first_in_statement) { - return func.call(this, compressor, first_in_statement); - }); -}); - -// Is the callee of this function pure? -var global_pure_fns = makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError"); -AST_Call.DEFMETHOD("is_callee_pure", function(compressor) { - if (compressor.option("unsafe")) { - var expr = this.expression; - var first_arg = (this.args && this.args[0] && this.args[0].evaluate(compressor)); - if ( - expr.expression && expr.expression.name === "hasOwnProperty" && - (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) - ) { - return false; - } - if (is_undeclared_ref(expr) && global_pure_fns.has(expr.name)) return true; - if ( - expr instanceof AST_Dot - && is_undeclared_ref(expr.expression) - && is_pure_native_fn(expr.expression.name, expr.property) - ) { - return true; - } - } - if ((this instanceof AST_New) && compressor.option("pure_new")) { - return true; - } - if (compressor.option("side_effects") && has_annotation(this, _PURE)) { - return true; - } - return !compressor.pure_funcs(this); -}); - -// If I call this, is it a pure function? -AST_Node.DEFMETHOD("is_call_pure", return_false); -AST_Dot.DEFMETHOD("is_call_pure", function(compressor) { - if (!compressor.option("unsafe")) return; - const expr = this.expression; - - let native_obj; - if (expr instanceof AST_Array) { - native_obj = "Array"; - } else if (expr.is_boolean()) { - native_obj = "Boolean"; - } else if (expr.is_number(compressor)) { - native_obj = "Number"; - } else if (expr instanceof AST_RegExp) { - native_obj = "RegExp"; - } else if (expr.is_string(compressor)) { - native_obj = "String"; - } else if (!this.may_throw_on_access(compressor)) { - native_obj = "Object"; - } - return native_obj != null && is_pure_native_method(native_obj, this.property); -}); - -// tell me if a statement aborts -export const aborts = (thing) => thing && thing.aborts(); - -(function(def_aborts) { - def_aborts(AST_Statement, return_null); - def_aborts(AST_Jump, return_this); - function block_aborts() { - for (var i = 0; i < this.body.length; i++) { - if (aborts(this.body[i])) { - return this.body[i]; - } - } - return null; - } - def_aborts(AST_Import, return_null); - def_aborts(AST_BlockStatement, block_aborts); - def_aborts(AST_SwitchBranch, block_aborts); - def_aborts(AST_DefClass, function () { - for (const prop of this.properties) { - if (prop instanceof AST_ClassStaticBlock) { - if (prop.aborts()) return prop; - } - } - return null; - }); - def_aborts(AST_ClassStaticBlock, block_aborts); - def_aborts(AST_If, function() { - return this.alternative && aborts(this.body) && aborts(this.alternative) && this; - }); -})(function(node, func) { - node.DEFMETHOD("aborts", func); -}); - -AST_Node.DEFMETHOD("contains_this", function() { - return walk(this, node => { - if (node instanceof AST_This) return walk_abort; - if ( - node !== this - && node instanceof AST_Scope - && !(node instanceof AST_Arrow) - ) { - return true; - } - }); -}); - -export function is_modified(compressor, tw, node, value, level, immutable) { - var parent = tw.parent(level); - var lhs = is_lhs(node, parent); - if (lhs) return lhs; - if (!immutable - && parent instanceof AST_Call - && parent.expression === node - && !(value instanceof AST_Arrow) - && !(value instanceof AST_Class) - && !parent.is_callee_pure(compressor) - && (!(value instanceof AST_Function) - || !(parent instanceof AST_New) && value.contains_this())) { - return true; - } - if (parent instanceof AST_Array) { - return is_modified(compressor, tw, parent, parent, level + 1); - } - if (parent instanceof AST_ObjectKeyVal && node === parent.value) { - var obj = tw.parent(level + 1); - return is_modified(compressor, tw, obj, obj, level + 2); - } - if (parent instanceof AST_PropAccess && parent.expression === node) { - var prop = read_property(value, parent.property); - return !immutable && is_modified(compressor, tw, parent, prop, level + 1); - } -} diff --git a/node_modules/terser/lib/compress/inline.js b/node_modules/terser/lib/compress/inline.js deleted file mode 100644 index c0924da..0000000 --- a/node_modules/terser/lib/compress/inline.js +++ /dev/null @@ -1,665 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Array, - AST_Assign, - AST_Block, - AST_Call, - AST_Catch, - AST_Class, - AST_ClassExpression, - AST_DefaultAssign, - AST_DefClass, - AST_Defun, - AST_Destructuring, - AST_EmptyStatement, - AST_Expansion, - AST_Export, - AST_Function, - AST_IterationStatement, - AST_Lambda, - AST_Node, - AST_Number, - AST_Object, - AST_ObjectKeyVal, - AST_PropAccess, - AST_Return, - AST_Scope, - AST_SimpleStatement, - AST_Statement, - AST_SymbolDefun, - AST_SymbolFunarg, - AST_SymbolLambda, - AST_SymbolRef, - AST_SymbolVar, - AST_This, - AST_Toplevel, - AST_UnaryPrefix, - AST_Undefined, - AST_Var, - AST_VarDef, - - walk, - - _INLINE, - _NOINLINE, - _PURE, -} from "../ast.js"; -import { make_node, has_annotation } from "../utils/index.js"; -import "../size.js"; - -import "./evaluate.js"; -import "./drop-side-effect-free.js"; -import "./reduce-vars.js"; -import { - SQUEEZED, - INLINED, - UNUSED, - - has_flag, - set_flag, -} from "./compressor-flags.js"; -import { - make_sequence, - best_of, - make_node_from_constant, - identifier_atom, - is_empty, - is_func_expr, - is_iife_call, - is_reachable, - is_recursive_ref, - retain_top_func, -} from "./common.js"; - -/** - * Module that contains the inlining logic. - * - * @module - * - * The stars of the show are `inline_into_symbolref` and `inline_into_call`. - */ - -function within_array_or_object_literal(compressor) { - var node, level = 0; - while (node = compressor.parent(level++)) { - if (node instanceof AST_Statement) return false; - if (node instanceof AST_Array - || node instanceof AST_ObjectKeyVal - || node instanceof AST_Object) { - return true; - } - } - return false; -} - -function scope_encloses_variables_in_this_scope(scope, pulled_scope) { - for (const enclosed of pulled_scope.enclosed) { - if (pulled_scope.variables.has(enclosed.name)) { - continue; - } - const looked_up = scope.find_variable(enclosed.name); - if (looked_up) { - if (looked_up === enclosed) continue; - return true; - } - } - return false; -} - -/** - * An extra check function for `top_retain` option, compare the length of const identifier - * and init value length and return true if init value is longer than identifier. for example: - * ``` - * // top_retain: ["example"] - * const example = 100 - * ``` - * it will return false because length of "100" is short than identifier "example". - */ -function is_const_symbol_short_than_init_value(def, fixed_value) { - if (def.orig.length === 1 && fixed_value) { - const init_value_length = fixed_value.size(); - const identifer_length = def.name.length; - return init_value_length > identifer_length; - } - return true; -} - -export function inline_into_symbolref(self, compressor) { - const parent = compressor.parent(); - const def = self.definition(); - const nearest_scope = compressor.find_scope(); - let fixed = self.fixed_value(); - if ( - compressor.top_retain && - def.global && - compressor.top_retain(def) && - // when identifier is in top_retain option dose not mean we can always inline it. - // if identifier name is longer then init value, we can replace it. - is_const_symbol_short_than_init_value(def, fixed) - ) { - // keep it - def.fixed = false; - def.single_use = false; - return self; - } - - let single_use = def.single_use - && !(parent instanceof AST_Call - && (parent.is_callee_pure(compressor)) - || has_annotation(parent, _NOINLINE)) - && !(parent instanceof AST_Export - && fixed instanceof AST_Lambda - && fixed.name); - - if (single_use && fixed instanceof AST_Node) { - single_use = - !fixed.has_side_effects(compressor) - && !fixed.may_throw(compressor); - } - - if (fixed instanceof AST_Class && def.scope !== self.scope) { - return self; - } - - if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { - if (retain_top_func(fixed, compressor)) { - single_use = false; - } else if (def.scope !== self.scope - && (def.escaped == 1 - || has_flag(fixed, INLINED) - || within_array_or_object_literal(compressor) - || !compressor.option("reduce_funcs"))) { - single_use = false; - } else if (is_recursive_ref(compressor, def)) { - single_use = false; - } else if (def.scope !== self.scope || def.orig[0] instanceof AST_SymbolFunarg) { - single_use = fixed.is_constant_expression(self.scope); - if (single_use == "f") { - var scope = self.scope; - do { - if (scope instanceof AST_Defun || is_func_expr(scope)) { - set_flag(scope, INLINED); - } - } while (scope = scope.parent_scope); - } - } - } - - if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { - single_use = - def.scope === self.scope - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - || parent instanceof AST_Call - && parent.expression === self - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - && !(fixed.name && fixed.name.definition().recursive_refs > 0); - } - - if (single_use && fixed) { - if (fixed instanceof AST_DefClass) { - set_flag(fixed, SQUEEZED); - fixed = make_node(AST_ClassExpression, fixed, fixed); - } - if (fixed instanceof AST_Defun) { - set_flag(fixed, SQUEEZED); - fixed = make_node(AST_Function, fixed, fixed); - } - if (def.recursive_refs > 0 && fixed.name instanceof AST_SymbolDefun) { - const defun_def = fixed.name.definition(); - let lambda_def = fixed.variables.get(fixed.name.name); - let name = lambda_def && lambda_def.orig[0]; - if (!(name instanceof AST_SymbolLambda)) { - name = make_node(AST_SymbolLambda, fixed.name, fixed.name); - name.scope = fixed; - fixed.name = name; - lambda_def = fixed.def_function(name); - } - walk(fixed, node => { - if (node instanceof AST_SymbolRef && node.definition() === defun_def) { - node.thedef = lambda_def; - lambda_def.references.push(node); - } - }); - } - if ( - (fixed instanceof AST_Lambda || fixed instanceof AST_Class) - && fixed.parent_scope !== nearest_scope - ) { - fixed = fixed.clone(true, compressor.get_toplevel()); - - nearest_scope.add_child_scope(fixed); - } - return fixed.optimize(compressor); - } - - // multiple uses - if (fixed) { - let replace; - - if (fixed instanceof AST_This) { - if (!(def.orig[0] instanceof AST_SymbolFunarg) - && def.references.every((ref) => - def.scope === ref.scope - )) { - replace = fixed; - } - } else { - var ev = fixed.evaluate(compressor); - if ( - ev !== fixed - && (compressor.option("unsafe_regexp") || !(ev instanceof RegExp)) - ) { - replace = make_node_from_constant(ev, fixed); - } - } - - if (replace) { - const name_length = self.size(compressor); - const replace_size = replace.size(compressor); - - let overhead = 0; - if (compressor.option("unused") && !compressor.exposed(def)) { - overhead = - (name_length + 2 + replace_size) / - (def.references.length - def.assignments); - } - - if (replace_size <= name_length + overhead) { - return replace; - } - } - } - - return self; -} - -export function inline_into_call(self, compressor) { - var exp = self.expression; - var fn = exp; - var simple_args = self.args.every((arg) => !(arg instanceof AST_Expansion)); - - if (compressor.option("reduce_vars") - && fn instanceof AST_SymbolRef - && !has_annotation(self, _NOINLINE) - ) { - const fixed = fn.fixed_value(); - - if ( - retain_top_func(fixed, compressor) - || !compressor.toplevel.funcs && exp.definition().global - ) { - return self; - } - - fn = fixed; - } - - var is_func = fn instanceof AST_Lambda; - - var stat = is_func && fn.body[0]; - var is_regular_func = is_func && !fn.is_generator && !fn.async; - var can_inline = is_regular_func && compressor.option("inline") && !self.is_callee_pure(compressor); - if (can_inline && stat instanceof AST_Return) { - let returned = stat.value; - if (!returned || returned.is_constant_expression()) { - if (returned) { - returned = returned.clone(true); - } else { - returned = make_node(AST_Undefined, self); - } - const args = self.args.concat(returned); - return make_sequence(self, args).optimize(compressor); - } - - // optimize identity function - if ( - fn.argnames.length === 1 - && (fn.argnames[0] instanceof AST_SymbolFunarg) - && self.args.length < 2 - && !(self.args[0] instanceof AST_Expansion) - && returned instanceof AST_SymbolRef - && returned.name === fn.argnames[0].name - ) { - const replacement = - (self.args[0] || make_node(AST_Undefined)).optimize(compressor); - - let parent; - if ( - replacement instanceof AST_PropAccess - && (parent = compressor.parent()) instanceof AST_Call - && parent.expression === self - ) { - // identity function was being used to remove `this`, like in - // - // id(bag.no_this)(...) - // - // Replace with a larger but more effish (0, bag.no_this) wrapper. - - return make_sequence(self, [ - make_node(AST_Number, self, { value: 0 }), - replacement - ]); - } - // replace call with first argument or undefined if none passed - return replacement; - } - } - - if (can_inline) { - var scope, in_loop, level = -1; - let def; - let returned_value; - let nearest_scope; - if (simple_args - && !fn.uses_arguments - && !(compressor.parent() instanceof AST_Class) - && !(fn.name && fn instanceof AST_Function) - && (returned_value = can_flatten_body(stat)) - && (exp === fn - || has_annotation(self, _INLINE) - || compressor.option("unused") - && (def = exp.definition()).references.length == 1 - && !is_recursive_ref(compressor, def) - && fn.is_constant_expression(exp.scope)) - && !has_annotation(self, _PURE | _NOINLINE) - && !fn.contains_this() - && can_inject_symbols() - && (nearest_scope = compressor.find_scope()) - && !scope_encloses_variables_in_this_scope(nearest_scope, fn) - && !(function in_default_assign() { - // Due to the fact function parameters have their own scope - // which can't use `var something` in the function body within, - // we simply don't inline into DefaultAssign. - let i = 0; - let p; - while ((p = compressor.parent(i++))) { - if (p instanceof AST_DefaultAssign) return true; - if (p instanceof AST_Block) break; - } - return false; - })() - && !(scope instanceof AST_Class) - ) { - set_flag(fn, SQUEEZED); - nearest_scope.add_child_scope(fn); - return make_sequence(self, flatten_fn(returned_value)).optimize(compressor); - } - } - - if (can_inline && has_annotation(self, _INLINE)) { - set_flag(fn, SQUEEZED); - fn = make_node(fn.CTOR === AST_Defun ? AST_Function : fn.CTOR, fn, fn); - fn = fn.clone(true); - fn.figure_out_scope({}, { - parent_scope: compressor.find_scope(), - toplevel: compressor.get_toplevel() - }); - - return make_node(AST_Call, self, { - expression: fn, - args: self.args, - }).optimize(compressor); - } - - const can_drop_this_call = is_regular_func && compressor.option("side_effects") && fn.body.every(is_empty); - if (can_drop_this_call) { - var args = self.args.concat(make_node(AST_Undefined, self)); - return make_sequence(self, args).optimize(compressor); - } - - if (compressor.option("negate_iife") - && compressor.parent() instanceof AST_SimpleStatement - && is_iife_call(self)) { - return self.negate(compressor, true); - } - - var ev = self.evaluate(compressor); - if (ev !== self) { - ev = make_node_from_constant(ev, self).optimize(compressor); - return best_of(compressor, ev, self); - } - - return self; - - function return_value(stat) { - if (!stat) return make_node(AST_Undefined, self); - if (stat instanceof AST_Return) { - if (!stat.value) return make_node(AST_Undefined, self); - return stat.value.clone(true); - } - if (stat instanceof AST_SimpleStatement) { - return make_node(AST_UnaryPrefix, stat, { - operator: "void", - expression: stat.body.clone(true) - }); - } - } - - function can_flatten_body(stat) { - var body = fn.body; - var len = body.length; - if (compressor.option("inline") < 3) { - return len == 1 && return_value(stat); - } - stat = null; - for (var i = 0; i < len; i++) { - var line = body[i]; - if (line instanceof AST_Var) { - if (stat && !line.definitions.every((var_def) => - !var_def.value - )) { - return false; - } - } else if (stat) { - return false; - } else if (!(line instanceof AST_EmptyStatement)) { - stat = line; - } - } - return return_value(stat); - } - - function can_inject_args(block_scoped, safe_to_inject) { - for (var i = 0, len = fn.argnames.length; i < len; i++) { - var arg = fn.argnames[i]; - if (arg instanceof AST_DefaultAssign) { - if (has_flag(arg.left, UNUSED)) continue; - return false; - } - if (arg instanceof AST_Destructuring) return false; - if (arg instanceof AST_Expansion) { - if (has_flag(arg.expression, UNUSED)) continue; - return false; - } - if (has_flag(arg, UNUSED)) continue; - if (!safe_to_inject - || block_scoped.has(arg.name) - || identifier_atom.has(arg.name) - || scope.conflicting_def(arg.name)) { - return false; - } - if (in_loop) in_loop.push(arg.definition()); - } - return true; - } - - function can_inject_vars(block_scoped, safe_to_inject) { - var len = fn.body.length; - for (var i = 0; i < len; i++) { - var stat = fn.body[i]; - if (!(stat instanceof AST_Var)) continue; - if (!safe_to_inject) return false; - for (var j = stat.definitions.length; --j >= 0;) { - var name = stat.definitions[j].name; - if (name instanceof AST_Destructuring - || block_scoped.has(name.name) - || identifier_atom.has(name.name) - || scope.conflicting_def(name.name)) { - return false; - } - if (in_loop) in_loop.push(name.definition()); - } - } - return true; - } - - function can_inject_symbols() { - var block_scoped = new Set(); - do { - scope = compressor.parent(++level); - if (scope.is_block_scope() && scope.block_scope) { - // TODO this is sometimes undefined during compression. - // But it should always have a value! - scope.block_scope.variables.forEach(function (variable) { - block_scoped.add(variable.name); - }); - } - if (scope instanceof AST_Catch) { - // TODO can we delete? AST_Catch is a block scope. - if (scope.argname) { - block_scoped.add(scope.argname.name); - } - } else if (scope instanceof AST_IterationStatement) { - in_loop = []; - } else if (scope instanceof AST_SymbolRef) { - if (scope.fixed_value() instanceof AST_Scope) return false; - } - } while (!(scope instanceof AST_Scope)); - - var safe_to_inject = !(scope instanceof AST_Toplevel) || compressor.toplevel.vars; - var inline = compressor.option("inline"); - if (!can_inject_vars(block_scoped, inline >= 3 && safe_to_inject)) return false; - if (!can_inject_args(block_scoped, inline >= 2 && safe_to_inject)) return false; - return !in_loop || in_loop.length == 0 || !is_reachable(fn, in_loop); - } - - function append_var(decls, expressions, name, value) { - var def = name.definition(); - - // Name already exists, only when a function argument had the same name - const already_appended = scope.variables.has(name.name); - if (!already_appended) { - scope.variables.set(name.name, def); - scope.enclosed.push(def); - decls.push(make_node(AST_VarDef, name, { - name: name, - value: null - })); - } - - var sym = make_node(AST_SymbolRef, name, name); - def.references.push(sym); - if (value) expressions.push(make_node(AST_Assign, self, { - operator: "=", - logical: false, - left: sym, - right: value.clone() - })); - } - - function flatten_args(decls, expressions) { - var len = fn.argnames.length; - for (var i = self.args.length; --i >= len;) { - expressions.push(self.args[i]); - } - for (i = len; --i >= 0;) { - var name = fn.argnames[i]; - var value = self.args[i]; - if (has_flag(name, UNUSED) || !name.name || scope.conflicting_def(name.name)) { - if (value) expressions.push(value); - } else { - var symbol = make_node(AST_SymbolVar, name, name); - name.definition().orig.push(symbol); - if (!value && in_loop) value = make_node(AST_Undefined, self); - append_var(decls, expressions, symbol, value); - } - } - decls.reverse(); - expressions.reverse(); - } - - function flatten_vars(decls, expressions) { - var pos = expressions.length; - for (var i = 0, lines = fn.body.length; i < lines; i++) { - var stat = fn.body[i]; - if (!(stat instanceof AST_Var)) continue; - for (var j = 0, defs = stat.definitions.length; j < defs; j++) { - var var_def = stat.definitions[j]; - var name = var_def.name; - append_var(decls, expressions, name, var_def.value); - if (in_loop && fn.argnames.every((argname) => - argname.name != name.name - )) { - var def = fn.variables.get(name.name); - var sym = make_node(AST_SymbolRef, name, name); - def.references.push(sym); - expressions.splice(pos++, 0, make_node(AST_Assign, var_def, { - operator: "=", - logical: false, - left: sym, - right: make_node(AST_Undefined, name) - })); - } - } - } - } - - function flatten_fn(returned_value) { - var decls = []; - var expressions = []; - flatten_args(decls, expressions); - flatten_vars(decls, expressions); - expressions.push(returned_value); - - if (decls.length) { - const i = scope.body.indexOf(compressor.parent(level - 1)) + 1; - scope.body.splice(i, 0, make_node(AST_Var, fn, { - definitions: decls - })); - } - - return expressions.map(exp => exp.clone(true)); - } -} diff --git a/node_modules/terser/lib/compress/native-objects.js b/node_modules/terser/lib/compress/native-objects.js deleted file mode 100644 index d7cb704..0000000 --- a/node_modules/terser/lib/compress/native-objects.js +++ /dev/null @@ -1,206 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { makePredicate } from "../utils/index.js"; - -// Lists of native methods, useful for `unsafe` option which assumes they exist. -// Note: Lots of methods and functions are missing here, in case they aren't pure -// or not available in all JS environments. - -function make_nested_lookup(obj) { - const out = new Map(); - for (var key of Object.keys(obj)) { - out.set(key, makePredicate(obj[key])); - } - - const does_have = (global_name, fname) => { - const inner_map = out.get(global_name); - return inner_map != null && inner_map.has(fname); - }; - return does_have; -} - -// Objects which are safe to access without throwing or causing a side effect. -// Usually we'd check the `unsafe` option first but these are way too common for that -export const pure_prop_access_globals = new Set([ - "Number", - "String", - "Array", - "Object", - "Function", - "Promise", -]); - -const object_methods = [ - "constructor", - "toString", - "valueOf", -]; - -export const is_pure_native_method = make_nested_lookup({ - Array: [ - "at", - "flat", - "includes", - "indexOf", - "join", - "lastIndexOf", - "slice", - ...object_methods, - ], - Boolean: object_methods, - Function: object_methods, - Number: [ - "toExponential", - "toFixed", - "toPrecision", - ...object_methods, - ], - Object: object_methods, - RegExp: [ - "test", - ...object_methods, - ], - String: [ - "at", - "charAt", - "charCodeAt", - "charPointAt", - "concat", - "endsWith", - "fromCharCode", - "fromCodePoint", - "includes", - "indexOf", - "italics", - "lastIndexOf", - "localeCompare", - "match", - "matchAll", - "normalize", - "padStart", - "padEnd", - "repeat", - "replace", - "replaceAll", - "search", - "slice", - "split", - "startsWith", - "substr", - "substring", - "repeat", - "toLocaleLowerCase", - "toLocaleUpperCase", - "toLowerCase", - "toUpperCase", - "trim", - "trimEnd", - "trimStart", - ...object_methods, - ], -}); - -export const is_pure_native_fn = make_nested_lookup({ - Array: [ - "isArray", - ], - Math: [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan", - "atan2", - "pow", - "max", - "min", - ], - Number: [ - "isFinite", - "isNaN", - ], - Object: [ - "create", - "getOwnPropertyDescriptor", - "getOwnPropertyNames", - "getPrototypeOf", - "isExtensible", - "isFrozen", - "isSealed", - "hasOwn", - "keys", - ], - String: [ - "fromCharCode", - ], -}); - -// Known numeric values which come with JS environments -export const is_pure_native_value = make_nested_lookup({ - Math: [ - "E", - "LN10", - "LN2", - "LOG2E", - "LOG10E", - "PI", - "SQRT1_2", - "SQRT2", - ], - Number: [ - "MAX_VALUE", - "MIN_VALUE", - "NaN", - "NEGATIVE_INFINITY", - "POSITIVE_INFINITY", - ], -}); diff --git a/node_modules/terser/lib/compress/reduce-vars.js b/node_modules/terser/lib/compress/reduce-vars.js deleted file mode 100644 index 262df88..0000000 --- a/node_modules/terser/lib/compress/reduce-vars.js +++ /dev/null @@ -1,824 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Accessor, - AST_Array, - AST_Assign, - AST_Await, - AST_Binary, - AST_Block, - AST_Call, - AST_Case, - AST_Chain, - AST_Class, - AST_ClassStaticBlock, - AST_ClassExpression, - AST_Conditional, - AST_Default, - AST_Defun, - AST_Destructuring, - AST_Do, - AST_Exit, - AST_Expansion, - AST_For, - AST_ForIn, - AST_If, - AST_LabeledStatement, - AST_Lambda, - AST_New, - AST_Node, - AST_Number, - AST_ObjectKeyVal, - AST_PropAccess, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Symbol, - AST_SymbolCatch, - AST_SymbolConst, - AST_SymbolDeclaration, - AST_SymbolDefun, - AST_SymbolFunarg, - AST_SymbolLambda, - AST_SymbolRef, - AST_This, - AST_Toplevel, - AST_Try, - AST_Unary, - AST_UnaryPrefix, - AST_Undefined, - AST_VarDef, - AST_While, - AST_Yield, - - walk, - walk_body, - - TreeWalker, -} from "../ast.js"; -import { HOP, make_node, noop } from "../utils/index.js"; - -import { lazy_op, is_modified, is_lhs } from "./inference.js"; -import { INLINED, clear_flag } from "./compressor-flags.js"; -import { read_property, has_break_or_continue, is_recursive_ref } from "./common.js"; - -/** - * Define the method AST_Node#reduce_vars, which goes through the AST in - * execution order to perform basic flow analysis - */ -function def_reduce_vars(node, func) { - node.DEFMETHOD("reduce_vars", func); -} - -def_reduce_vars(AST_Node, noop); - -/** Clear definition properties */ -function reset_def(compressor, def) { - def.assignments = 0; - def.chained = false; - def.direct_access = false; - def.escaped = 0; - def.recursive_refs = 0; - def.references = []; - def.single_use = undefined; - if ( - def.scope.pinned() - || (def.orig[0] instanceof AST_SymbolFunarg && def.scope.uses_arguments) - ) { - def.fixed = false; - } else if (def.orig[0] instanceof AST_SymbolConst || !compressor.exposed(def)) { - def.fixed = def.init; - } else { - def.fixed = false; - } -} - -function reset_variables(tw, compressor, node) { - node.variables.forEach(function(def) { - reset_def(compressor, def); - if (def.fixed === null) { - tw.defs_to_safe_ids.set(def.id, tw.safe_ids); - mark(tw, def, true); - } else if (def.fixed) { - tw.loop_ids.set(def.id, tw.in_loop); - mark(tw, def, true); - } - }); -} - -function reset_block_variables(compressor, node) { - if (node.block_scope) node.block_scope.variables.forEach((def) => { - reset_def(compressor, def); - }); -} - -function push(tw) { - tw.safe_ids = Object.create(tw.safe_ids); -} - -function pop(tw) { - tw.safe_ids = Object.getPrototypeOf(tw.safe_ids); -} - -function mark(tw, def, safe) { - tw.safe_ids[def.id] = safe; -} - -function safe_to_read(tw, def) { - if (def.single_use == "m") return false; - if (tw.safe_ids[def.id]) { - if (def.fixed == null) { - var orig = def.orig[0]; - if (orig instanceof AST_SymbolFunarg || orig.name == "arguments") return false; - def.fixed = make_node(AST_Undefined, orig); - } - return true; - } - return def.fixed instanceof AST_Defun; -} - -function safe_to_assign(tw, def, scope, value) { - if (def.fixed === undefined) return true; - let def_safe_ids; - if (def.fixed === null - && (def_safe_ids = tw.defs_to_safe_ids.get(def.id)) - ) { - def_safe_ids[def.id] = false; - tw.defs_to_safe_ids.delete(def.id); - return true; - } - if (!HOP(tw.safe_ids, def.id)) return false; - if (!safe_to_read(tw, def)) return false; - if (def.fixed === false) return false; - if (def.fixed != null && (!value || def.references.length > def.assignments)) return false; - if (def.fixed instanceof AST_Defun) { - return value instanceof AST_Node && def.fixed.parent_scope === scope; - } - return def.orig.every((sym) => { - return !(sym instanceof AST_SymbolConst - || sym instanceof AST_SymbolDefun - || sym instanceof AST_SymbolLambda); - }); -} - -function ref_once(tw, compressor, def) { - return compressor.option("unused") - && !def.scope.pinned() - && def.references.length - def.recursive_refs == 1 - && tw.loop_ids.get(def.id) === tw.in_loop; -} - -function is_immutable(value) { - if (!value) return false; - return value.is_constant() - || value instanceof AST_Lambda - || value instanceof AST_This; -} - -// A definition "escapes" when its value can leave the point of use. -// Example: `a = b || c` -// In this example, "b" and "c" are escaping, because they're going into "a" -// -// def.escaped is != 0 when it escapes. -// -// When greater than 1, it means that N chained properties will be read off -// of that def before an escape occurs. This is useful for evaluating -// property accesses, where you need to know when to stop. -function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) { - var parent = tw.parent(level); - if (value) { - if (value.is_constant()) return; - if (value instanceof AST_ClassExpression) return; - } - - if ( - parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right - || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New) - || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope - || parent instanceof AST_VarDef && node === parent.value - || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope - ) { - if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; - if (!d.escaped || d.escaped > depth) d.escaped = depth; - return; - } else if ( - parent instanceof AST_Array - || parent instanceof AST_Await - || parent instanceof AST_Binary && lazy_op.has(parent.operator) - || parent instanceof AST_Conditional && node !== parent.condition - || parent instanceof AST_Expansion - || parent instanceof AST_Sequence && node === parent.tail_node() - ) { - mark_escaped(tw, d, scope, parent, parent, level + 1, depth); - } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) { - var obj = tw.parent(level + 1); - - mark_escaped(tw, d, scope, obj, obj, level + 2, depth); - } else if (parent instanceof AST_PropAccess && node === parent.expression) { - value = read_property(value, parent.property); - - mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); - if (value) return; - } - - if (level > 0) return; - if (parent instanceof AST_Sequence && node !== parent.tail_node()) return; - if (parent instanceof AST_SimpleStatement) return; - - d.direct_access = true; -} - -const suppress = node => walk(node, node => { - if (!(node instanceof AST_Symbol)) return; - var d = node.definition(); - if (!d) return; - if (node instanceof AST_SymbolRef) d.references.push(node); - d.fixed = false; -}); - -def_reduce_vars(AST_Accessor, function(tw, descend, compressor) { - push(tw); - reset_variables(tw, compressor, this); - descend(); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Assign, function(tw, descend, compressor) { - var node = this; - if (node.left instanceof AST_Destructuring) { - suppress(node.left); - return; - } - - const finish_walk = () => { - if (node.logical) { - node.left.walk(tw); - - push(tw); - node.right.walk(tw); - pop(tw); - - return true; - } - }; - - var sym = node.left; - if (!(sym instanceof AST_SymbolRef)) return finish_walk(); - - var def = sym.definition(); - var safe = safe_to_assign(tw, def, sym.scope, node.right); - def.assignments++; - if (!safe) return finish_walk(); - - var fixed = def.fixed; - if (!fixed && node.operator != "=" && !node.logical) return finish_walk(); - - var eq = node.operator == "="; - var value = eq ? node.right : node; - if (is_modified(compressor, tw, node, value, 0)) return finish_walk(); - - def.references.push(sym); - - if (!node.logical) { - if (!eq) def.chained = true; - - def.fixed = eq ? function() { - return node.right; - } : function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: fixed instanceof AST_Node ? fixed : fixed(), - right: node.right - }); - }; - } - - if (node.logical) { - mark(tw, def, false); - push(tw); - node.right.walk(tw); - pop(tw); - return true; - } - - mark(tw, def, false); - node.right.walk(tw); - mark(tw, def, true); - - mark_escaped(tw, def, sym.scope, node, value, 0, 1); - - return true; -}); - -def_reduce_vars(AST_Binary, function(tw) { - if (!lazy_op.has(this.operator)) return; - this.left.walk(tw); - push(tw); - this.right.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Block, function(tw, descend, compressor) { - reset_block_variables(compressor, this); -}); - -def_reduce_vars(AST_Case, function(tw) { - push(tw); - this.expression.walk(tw); - pop(tw); - push(tw); - walk_body(this, tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Class, function(tw, descend) { - clear_flag(this, INLINED); - push(tw); - descend(); - pop(tw); - return true; -}); - -def_reduce_vars(AST_ClassStaticBlock, function(tw, descend, compressor) { - reset_block_variables(compressor, this); -}); - -def_reduce_vars(AST_Conditional, function(tw) { - this.condition.walk(tw); - push(tw); - this.consequent.walk(tw); - pop(tw); - push(tw); - this.alternative.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_Chain, function(tw, descend) { - // Chains' conditions apply left-to-right, cumulatively. - // If we walk normally we don't go in that order because we would pop before pushing again - // Solution: AST_PropAccess and AST_Call push when they are optional, and never pop. - // Then we pop everything when they are done being walked. - const safe_ids = tw.safe_ids; - - descend(); - - // Unroll back to start - tw.safe_ids = safe_ids; - return true; -}); - -def_reduce_vars(AST_Call, function (tw) { - this.expression.walk(tw); - - if (this.optional) { - // Never pop -- it's popped at AST_Chain above - push(tw); - } - - for (const arg of this.args) arg.walk(tw); - - return true; -}); - -def_reduce_vars(AST_PropAccess, function (tw) { - if (!this.optional) return; - - this.expression.walk(tw); - - // Never pop -- it's popped at AST_Chain above - push(tw); - - if (this.property instanceof AST_Node) this.property.walk(tw); - - return true; -}); - -def_reduce_vars(AST_Default, function(tw, descend) { - push(tw); - descend(); - pop(tw); - return true; -}); - -function mark_lambda(tw, descend, compressor) { - clear_flag(this, INLINED); - push(tw); - reset_variables(tw, compressor, this); - - var iife; - if (!this.name - && !this.uses_arguments - && !this.pinned() - && (iife = tw.parent()) instanceof AST_Call - && iife.expression === this - && !iife.args.some(arg => arg instanceof AST_Expansion) - && this.argnames.every(arg_name => arg_name instanceof AST_Symbol) - ) { - // Virtually turn IIFE parameters into variable definitions: - // (function(a,b) {...})(c,d) => (function() {var a=c,b=d; ...})() - // So existing transformation rules can work on them. - this.argnames.forEach((arg, i) => { - if (!arg.definition) return; - var d = arg.definition(); - // Avoid setting fixed when there's more than one origin for a variable value - if (d.orig.length > 1) return; - if (d.fixed === undefined && (!this.uses_arguments || tw.has_directive("use strict"))) { - d.fixed = function() { - return iife.args[i] || make_node(AST_Undefined, iife); - }; - tw.loop_ids.set(d.id, tw.in_loop); - mark(tw, d, true); - } else { - d.fixed = false; - } - }); - } - - descend(); - pop(tw); - - handle_defined_after_hoist(this); - - return true; -} - -/** - * It's possible for a hoisted function to use something that's not defined yet. Example: - * - * hoisted(); - * var defined_after = true; - * function hoisted() { - * // use defined_after - * } - * - * This function is called on the parent to handle this issue. - */ -function handle_defined_after_hoist(parent) { - const defuns = []; - walk(parent, node => { - if (node === parent) return; - if (node instanceof AST_Defun) defuns.push(node); - if ( - node instanceof AST_Scope - || node instanceof AST_SimpleStatement - ) return true; - }); - - const symbols_of_interest = new Set(); - const defuns_of_interest = new Set(); - const potential_conflicts = []; - - for (const defun of defuns) { - const fname_def = defun.name.definition(); - const found_self_ref_in_other_defuns = defuns.some( - d => d !== defun && d.enclosed.indexOf(fname_def) !== -1 - ); - - for (const def of defun.enclosed) { - if ( - def.fixed === false - || def === fname_def - || def.scope.get_defun_scope() !== parent - ) { - continue; - } - - // defun is hoisted, so always safe - if ( - def.assignments === 0 - && def.orig.length === 1 - && def.orig[0] instanceof AST_SymbolDefun - ) { - continue; - } - - if (found_self_ref_in_other_defuns) { - def.fixed = false; - continue; - } - - // for the slower checks below this loop - potential_conflicts.push({ defun, def, fname_def }); - symbols_of_interest.add(def.id); - symbols_of_interest.add(fname_def.id); - defuns_of_interest.add(defun); - } - } - - // linearize all symbols, and locate defs that are read after the defun - if (potential_conflicts.length) { - // All "symbols of interest", that is, defuns or defs, that we found. - // These are placed in order so we can check which is after which. - const found_symbols = []; - // Indices of `found_symbols` which are writes - const found_symbol_writes = new Set(); - // Defun ranges are recorded because we don't care if a function uses the def internally - const defun_ranges = new Map(); - - let tw; - parent.walk((tw = new TreeWalker((node, descend) => { - if (node instanceof AST_Defun && defuns_of_interest.has(node)) { - const start = found_symbols.length; - descend(); - const end = found_symbols.length; - - defun_ranges.set(node, { start, end }); - return true; - } - // if we found a defun on the list, mark IN_DEFUN=id and descend - - if (node instanceof AST_Symbol && node.thedef) { - const id = node.definition().id; - if (symbols_of_interest.has(id)) { - if (node instanceof AST_SymbolDeclaration || is_lhs(node, tw)) { - found_symbol_writes.add(found_symbols.length); - } - found_symbols.push(id); - } - } - }))); - - for (const { def, defun, fname_def } of potential_conflicts) { - const defun_range = defun_ranges.get(defun); - - // find the index in `found_symbols`, with some special rules: - const find = (sym_id, starting_at = 0, must_be_write = false) => { - let index = starting_at; - - for (;;) { - index = found_symbols.indexOf(sym_id, index); - - if (index === -1) { - break; - } else if (index >= defun_range.start && index < defun_range.end) { - index = defun_range.end; - continue; - } else if (must_be_write && !found_symbol_writes.has(index)) { - index++; - continue; - } else { - break; - } - } - - return index; - }; - - const read_defun_at = find(fname_def.id); - const wrote_def_at = find(def.id, read_defun_at + 1, true); - - const wrote_def_after_reading_defun = read_defun_at != -1 && wrote_def_at != -1 && wrote_def_at > read_defun_at; - - if (wrote_def_after_reading_defun) { - def.fixed = false; - } - } - } -} - -def_reduce_vars(AST_Lambda, mark_lambda); - -def_reduce_vars(AST_Do, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - if (has_break_or_continue(this)) { - pop(tw); - push(tw); - } - this.condition.walk(tw); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(AST_For, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - if (this.init) this.init.walk(tw); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - if (this.condition) this.condition.walk(tw); - this.body.walk(tw); - if (this.step) { - if (has_break_or_continue(this)) { - pop(tw); - push(tw); - } - this.step.walk(tw); - } - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(AST_ForIn, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - suppress(this.init); - this.object.walk(tw); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - this.body.walk(tw); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); - -def_reduce_vars(AST_If, function(tw) { - this.condition.walk(tw); - push(tw); - this.body.walk(tw); - pop(tw); - if (this.alternative) { - push(tw); - this.alternative.walk(tw); - pop(tw); - } - return true; -}); - -def_reduce_vars(AST_LabeledStatement, function(tw) { - push(tw); - this.body.walk(tw); - pop(tw); - return true; -}); - -def_reduce_vars(AST_SymbolCatch, function() { - this.definition().fixed = false; -}); - -def_reduce_vars(AST_SymbolRef, function(tw, descend, compressor) { - var d = this.definition(); - d.references.push(this); - if (d.references.length == 1 - && !d.fixed - && d.orig[0] instanceof AST_SymbolDefun) { - tw.loop_ids.set(d.id, tw.in_loop); - } - var fixed_value; - if (d.fixed === undefined || !safe_to_read(tw, d)) { - d.fixed = false; - } else if (d.fixed) { - fixed_value = this.fixed_value(); - if ( - fixed_value instanceof AST_Lambda - && is_recursive_ref(tw, d) - ) { - d.recursive_refs++; - } else if (fixed_value - && !compressor.exposed(d) - && ref_once(tw, compressor, d) - ) { - d.single_use = - fixed_value instanceof AST_Lambda && !fixed_value.pinned() - || fixed_value instanceof AST_Class - || d.scope === this.scope && fixed_value.is_constant_expression(); - } else { - d.single_use = false; - } - if (is_modified(compressor, tw, this, fixed_value, 0, is_immutable(fixed_value))) { - if (d.single_use) { - d.single_use = "m"; - } else { - d.fixed = false; - } - } - } - mark_escaped(tw, d, this.scope, this, fixed_value, 0, 1); -}); - -def_reduce_vars(AST_Toplevel, function(tw, descend, compressor) { - this.globals.forEach(function(def) { - reset_def(compressor, def); - }); - reset_variables(tw, compressor, this); - descend(); - handle_defined_after_hoist(this); - return true; -}); - -def_reduce_vars(AST_Try, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - push(tw); - this.body.walk(tw); - pop(tw); - if (this.bcatch) { - push(tw); - this.bcatch.walk(tw); - pop(tw); - } - if (this.bfinally) this.bfinally.walk(tw); - return true; -}); - -def_reduce_vars(AST_Unary, function(tw) { - var node = this; - if (node.operator !== "++" && node.operator !== "--") return; - var exp = node.expression; - if (!(exp instanceof AST_SymbolRef)) return; - var def = exp.definition(); - var safe = safe_to_assign(tw, def, exp.scope, true); - def.assignments++; - if (!safe) return; - var fixed = def.fixed; - if (!fixed) return; - def.references.push(exp); - def.chained = true; - def.fixed = function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: make_node(AST_UnaryPrefix, node, { - operator: "+", - expression: fixed instanceof AST_Node ? fixed : fixed() - }), - right: make_node(AST_Number, node, { - value: 1 - }) - }); - }; - mark(tw, def, true); - return true; -}); - -def_reduce_vars(AST_VarDef, function(tw, descend) { - var node = this; - if (node.name instanceof AST_Destructuring) { - suppress(node.name); - return; - } - var d = node.name.definition(); - if (node.value) { - if (safe_to_assign(tw, d, node.name.scope, node.value)) { - d.fixed = function() { - return node.value; - }; - tw.loop_ids.set(d.id, tw.in_loop); - mark(tw, d, false); - descend(); - mark(tw, d, true); - return true; - } else { - d.fixed = false; - } - } -}); - -def_reduce_vars(AST_While, function(tw, descend, compressor) { - reset_block_variables(compressor, this); - const saved_loop = tw.in_loop; - tw.in_loop = this; - push(tw); - descend(); - pop(tw); - tw.in_loop = saved_loop; - return true; -}); diff --git a/node_modules/terser/lib/compress/tighten-body.js b/node_modules/terser/lib/compress/tighten-body.js deleted file mode 100644 index a74f8e5..0000000 --- a/node_modules/terser/lib/compress/tighten-body.js +++ /dev/null @@ -1,1505 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { - AST_Array, - AST_Arrow, - AST_Assign, - AST_Await, - AST_Binary, - AST_Block, - AST_BlockStatement, - AST_Break, - AST_Call, - AST_Case, - AST_Chain, - AST_Class, - AST_Conditional, - AST_Const, - AST_Constant, - AST_Continue, - AST_Debugger, - AST_Default, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Dot, - AST_DWLoop, - AST_EmptyStatement, - AST_Exit, - AST_Expansion, - AST_Export, - AST_For, - AST_ForIn, - AST_If, - AST_Import, - AST_IterationStatement, - AST_Lambda, - AST_Let, - AST_LoopControl, - AST_Node, - AST_Number, - AST_Object, - AST_ObjectKeyVal, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Sub, - AST_Switch, - AST_Symbol, - AST_SymbolConst, - AST_SymbolDeclaration, - AST_SymbolDefun, - AST_SymbolFunarg, - AST_SymbolLambda, - AST_SymbolLet, - AST_SymbolRef, - AST_SymbolVar, - AST_This, - AST_Try, - AST_TryBlock, - AST_Unary, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Undefined, - AST_Var, - AST_VarDef, - AST_With, - AST_Yield, - - TreeTransformer, - TreeWalker, - walk, - walk_abort, - - _NOINLINE -} from "../ast.js"; -import { - make_node, - MAP, - member, - remove, - has_annotation -} from "../utils/index.js"; - -import { pure_prop_access_globals } from "./native-objects.js"; -import { - lazy_op, - unary_side_effects, - is_modified, - is_lhs, - aborts -} from "./inference.js"; -import { WRITE_ONLY, clear_flag } from "./compressor-flags.js"; -import { - make_sequence, - merge_sequence, - maintain_this_binding, - is_func_expr, - is_identifier_atom, - is_ref_of, - can_be_evicted_from_block, - as_statement_array, -} from "./common.js"; - -function loop_body(x) { - if (x instanceof AST_IterationStatement) { - return x.body instanceof AST_BlockStatement ? x.body : x; - } - return x; -} - -function is_lhs_read_only(lhs) { - if (lhs instanceof AST_This) return true; - if (lhs instanceof AST_SymbolRef) return lhs.definition().orig[0] instanceof AST_SymbolLambda; - if (lhs instanceof AST_PropAccess) { - lhs = lhs.expression; - if (lhs instanceof AST_SymbolRef) { - if (lhs.is_immutable()) return false; - lhs = lhs.fixed_value(); - } - if (!lhs) return true; - if (lhs instanceof AST_RegExp) return false; - if (lhs instanceof AST_Constant) return true; - return is_lhs_read_only(lhs); - } - return false; -} - -/** var a = 1 --> var a*/ -function remove_initializers(var_statement) { - var decls = []; - var_statement.definitions.forEach(function(def) { - if (def.name instanceof AST_SymbolDeclaration) { - def.value = null; - decls.push(def); - } else { - def.declarations_as_names().forEach(name => { - decls.push(make_node(AST_VarDef, def, { - name, - value: null - })); - }); - } - }); - return decls.length ? make_node(AST_Var, var_statement, { definitions: decls }) : null; -} - -/** Called on code which we know is unreachable, to keep elements that affect outside of it. */ -export function trim_unreachable_code(compressor, stat, target) { - walk(stat, node => { - if (node instanceof AST_Var) { - const no_initializers = remove_initializers(node); - if (no_initializers) target.push(no_initializers); - return true; - } - if ( - node instanceof AST_Defun - && (node === stat || !compressor.has_directive("use strict")) - ) { - target.push(node === stat ? node : make_node(AST_Var, node, { - definitions: [ - make_node(AST_VarDef, node, { - name: make_node(AST_SymbolVar, node.name, node.name), - value: null - }) - ] - })); - return true; - } - if (node instanceof AST_Export || node instanceof AST_Import) { - target.push(node); - return true; - } - if (node instanceof AST_Scope) { - return true; - } - }); -} - -/** Tighten a bunch of statements together, and perform statement-level optimization. */ -export function tighten_body(statements, compressor) { - const nearest_scope = compressor.find_scope(); - const defun_scope = nearest_scope.get_defun_scope(); - const { in_loop, in_try } = find_loop_scope_try(); - - var CHANGED, max_iter = 10; - do { - CHANGED = false; - eliminate_spurious_blocks(statements); - if (compressor.option("dead_code")) { - eliminate_dead_code(statements, compressor); - } - if (compressor.option("if_return")) { - handle_if_return(statements, compressor); - } - if (compressor.sequences_limit > 0) { - sequencesize(statements, compressor); - sequencesize_2(statements, compressor); - } - if (compressor.option("join_vars")) { - join_consecutive_vars(statements); - } - if (compressor.option("collapse_vars")) { - collapse(statements, compressor); - } - } while (CHANGED && max_iter-- > 0); - - function find_loop_scope_try() { - var node = compressor.self(), level = 0, in_loop = false, in_try = false; - do { - if (node instanceof AST_IterationStatement) { - in_loop = true; - } else if (node instanceof AST_Scope) { - break; - } else if (node instanceof AST_TryBlock) { - in_try = true; - } - } while (node = compressor.parent(level++)); - - return { in_loop, in_try }; - } - - // Search from right to left for assignment-like expressions: - // - `var a = x;` - // - `a = x;` - // - `++a` - // For each candidate, scan from left to right for first usage, then try - // to fold assignment into the site for compression. - // Will not attempt to collapse assignments into or past code blocks - // which are not sequentially executed, e.g. loops and conditionals. - function collapse(statements, compressor) { - if (nearest_scope.pinned() || defun_scope.pinned()) - return statements; - var args; - var candidates = []; - var stat_index = statements.length; - var scanner = new TreeTransformer(function (node) { - if (abort) - return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) - return node; - hit_index++; - if (hit_index < hit_stack.length) - return handle_custom_scan_order(node); - hit = true; - stop_after = find_stop(node, 0); - if (stop_after === node) - abort = true; - return node; - } - // Stop immediately if these node types are encountered - var parent = scanner.parent(); - if (node instanceof AST_Assign - && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left)) - || node instanceof AST_Await - || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) - || - (node instanceof AST_Call || node instanceof AST_PropAccess) - && node.optional - || node instanceof AST_Debugger - || node instanceof AST_Destructuring - || node instanceof AST_Expansion - && node.expression instanceof AST_Symbol - && ( - node.expression instanceof AST_This - || node.expression.definition().references.length > 1 - ) - || node instanceof AST_IterationStatement && !(node instanceof AST_For) - || node instanceof AST_LoopControl - || node instanceof AST_Try - || node instanceof AST_With - || node instanceof AST_Yield - || node instanceof AST_Export - || node instanceof AST_Class - || parent instanceof AST_For && node !== parent.init - || !replace_all - && ( - node instanceof AST_SymbolRef - && !node.is_declared(compressor) - && !pure_prop_access_globals.has(node) - ) - || node instanceof AST_SymbolRef - && parent instanceof AST_Call - && has_annotation(parent, _NOINLINE) - ) { - abort = true; - return node; - } - // Stop only if candidate is found within conditional branches - if (!stop_if_hit && (!lhs_local || !replace_all) - && (parent instanceof AST_Binary && lazy_op.has(parent.operator) && parent.left !== node - || parent instanceof AST_Conditional && parent.condition !== node - || parent instanceof AST_If && parent.condition !== node)) { - stop_if_hit = parent; - } - // Replace variable with assignment when found - if ( - can_replace - && !(node instanceof AST_SymbolDeclaration) - && lhs.equivalent_to(node) - && !shadows(scanner.find_scope() || nearest_scope, lvalues) - ) { - if (stop_if_hit) { - abort = true; - return node; - } - if (is_lhs(node, parent)) { - if (value_def) - replaced++; - return node; - } else { - replaced++; - if (value_def && candidate instanceof AST_VarDef) - return node; - } - CHANGED = abort = true; - if (candidate instanceof AST_UnaryPostfix) { - return make_node(AST_UnaryPrefix, candidate, candidate); - } - if (candidate instanceof AST_VarDef) { - var def = candidate.name.definition(); - var value = candidate.value; - if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) { - def.replaced++; - if (funarg && is_identifier_atom(value)) { - return value.transform(compressor); - } else { - return maintain_this_binding(parent, node, value); - } - } - return make_node(AST_Assign, candidate, { - operator: "=", - logical: false, - left: make_node(AST_SymbolRef, candidate.name, candidate.name), - right: value - }); - } - clear_flag(candidate, WRITE_ONLY); - return candidate; - } - // These node types have child nodes that execute sequentially, - // but are otherwise not safe to scan into or beyond them. - var sym; - if (node instanceof AST_Call - || node instanceof AST_Exit - && (side_effects || lhs instanceof AST_PropAccess || may_modify(lhs)) - || node instanceof AST_PropAccess - && (side_effects || node.expression.may_throw_on_access(compressor)) - || node instanceof AST_SymbolRef - && ((lvalues.has(node.name) && lvalues.get(node.name).modified) || side_effects && may_modify(node)) - || node instanceof AST_VarDef && node.value - && (lvalues.has(node.name.name) || side_effects && may_modify(node.name)) - || (sym = is_lhs(node.left, node)) - && (sym instanceof AST_PropAccess || lvalues.has(sym.name)) - || may_throw - && (in_try ? node.has_side_effects(compressor) : side_effects_external(node))) { - stop_after = node; - if (node instanceof AST_Scope) - abort = true; - } - return handle_custom_scan_order(node); - }, function (node) { - if (abort) - return; - if (stop_after === node) - abort = true; - if (stop_if_hit === node) - stop_if_hit = null; - }); - - var multi_replacer = new TreeTransformer(function (node) { - if (abort) - return node; - // Skip nodes before `candidate` as quickly as possible - if (!hit) { - if (node !== hit_stack[hit_index]) - return node; - hit_index++; - if (hit_index < hit_stack.length) - return; - hit = true; - return node; - } - // Replace variable when found - if (node instanceof AST_SymbolRef - && node.name == def.name) { - if (!--replaced) - abort = true; - if (is_lhs(node, multi_replacer.parent())) - return node; - def.replaced++; - value_def.replaced--; - return candidate.value; - } - // Skip (non-executed) functions and (leading) default case in switch statements - if (node instanceof AST_Default || node instanceof AST_Scope) - return node; - }); - - while (--stat_index >= 0) { - // Treat parameters as collapsible in IIFE, i.e. - // function(a, b){ ... }(x()); - // would be translated into equivalent assignments: - // var a = x(), b = undefined; - if (stat_index == 0 && compressor.option("unused")) - extract_args(); - // Find collapsible assignments - var hit_stack = []; - extract_candidates(statements[stat_index]); - while (candidates.length > 0) { - hit_stack = candidates.pop(); - var hit_index = 0; - var candidate = hit_stack[hit_stack.length - 1]; - var value_def = null; - var stop_after = null; - var stop_if_hit = null; - var lhs = get_lhs(candidate); - if (!lhs || is_lhs_read_only(lhs) || lhs.has_side_effects(compressor)) - continue; - // Locate symbols which may execute code outside of scanning range - var lvalues = get_lvalues(candidate); - var lhs_local = is_lhs_local(lhs); - if (lhs instanceof AST_SymbolRef) { - lvalues.set(lhs.name, { def: lhs.definition(), modified: false }); - } - var side_effects = value_has_side_effects(candidate); - var replace_all = replace_all_symbols(); - var may_throw = candidate.may_throw(compressor); - var funarg = candidate.name instanceof AST_SymbolFunarg; - var hit = funarg; - var abort = false, replaced = 0, can_replace = !args || !hit; - if (!can_replace) { - for ( - let j = compressor.self().argnames.lastIndexOf(candidate.name) + 1; - !abort && j < args.length; - j++ - ) { - args[j].transform(scanner); - } - can_replace = true; - } - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(scanner); - } - if (value_def) { - var def = candidate.name.definition(); - if (abort && def.references.length - def.replaced > replaced) - replaced = false; - else { - abort = false; - hit_index = 0; - hit = funarg; - for (var i = stat_index; !abort && i < statements.length; i++) { - statements[i].transform(multi_replacer); - } - value_def.single_use = false; - } - } - if (replaced && !remove_candidate(candidate)) - statements.splice(stat_index, 1); - } - } - - function handle_custom_scan_order(node) { - // Skip (non-executed) functions - if (node instanceof AST_Scope) - return node; - - // Scan case expressions first in a switch statement - if (node instanceof AST_Switch) { - node.expression = node.expression.transform(scanner); - for (var i = 0, len = node.body.length; !abort && i < len; i++) { - var branch = node.body[i]; - if (branch instanceof AST_Case) { - if (!hit) { - if (branch !== hit_stack[hit_index]) - continue; - hit_index++; - } - branch.expression = branch.expression.transform(scanner); - if (!replace_all) - break; - } - } - abort = true; - return node; - } - } - - function redefined_within_scope(def, scope) { - if (def.global) - return false; - let cur_scope = def.scope; - while (cur_scope && cur_scope !== scope) { - if (cur_scope.variables.has(def.name)) { - return true; - } - cur_scope = cur_scope.parent_scope; - } - return false; - } - - function has_overlapping_symbol(fn, arg, fn_strict) { - var found = false, scan_this = !(fn instanceof AST_Arrow); - arg.walk(new TreeWalker(function (node, descend) { - if (found) - return true; - if (node instanceof AST_SymbolRef && (fn.variables.has(node.name) || redefined_within_scope(node.definition(), fn))) { - var s = node.definition().scope; - if (s !== defun_scope) - while (s = s.parent_scope) { - if (s === defun_scope) - return true; - } - return found = true; - } - if ((fn_strict || scan_this) && node instanceof AST_This) { - return found = true; - } - if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) { - var prev = scan_this; - scan_this = false; - descend(); - scan_this = prev; - return true; - } - })); - return found; - } - - function extract_args() { - var iife, fn = compressor.self(); - if (is_func_expr(fn) - && !fn.name - && !fn.uses_arguments - && !fn.pinned() - && (iife = compressor.parent()) instanceof AST_Call - && iife.expression === fn - && iife.args.every((arg) => !(arg instanceof AST_Expansion))) { - var fn_strict = compressor.has_directive("use strict"); - if (fn_strict && !member(fn_strict, fn.body)) - fn_strict = false; - var len = fn.argnames.length; - args = iife.args.slice(len); - var names = new Set(); - for (var i = len; --i >= 0;) { - var sym = fn.argnames[i]; - var arg = iife.args[i]; - // The following two line fix is a duplicate of the fix at - // https://github.com/terser/terser/commit/011d3eb08cefe6922c7d1bdfa113fc4aeaca1b75 - // This might mean that these two pieces of code (one here in collapse_vars and another in reduce_vars - // Might be doing the exact same thing. - const def = sym.definition && sym.definition(); - const is_reassigned = def && def.orig.length > 1; - if (is_reassigned) - continue; - args.unshift(make_node(AST_VarDef, sym, { - name: sym, - value: arg - })); - if (names.has(sym.name)) - continue; - names.add(sym.name); - if (sym instanceof AST_Expansion) { - var elements = iife.args.slice(i); - if (elements.every((arg) => !has_overlapping_symbol(fn, arg, fn_strict) - )) { - candidates.unshift([make_node(AST_VarDef, sym, { - name: sym.expression, - value: make_node(AST_Array, iife, { - elements: elements - }) - })]); - } - } else { - if (!arg) { - arg = make_node(AST_Undefined, sym).transform(compressor); - } else if (arg instanceof AST_Lambda && arg.pinned() - || has_overlapping_symbol(fn, arg, fn_strict)) { - arg = null; - } - if (arg) - candidates.unshift([make_node(AST_VarDef, sym, { - name: sym, - value: arg - })]); - } - } - } - } - - function extract_candidates(expr) { - hit_stack.push(expr); - if (expr instanceof AST_Assign) { - if (!expr.left.has_side_effects(compressor) - && !(expr.right instanceof AST_Chain)) { - candidates.push(hit_stack.slice()); - } - extract_candidates(expr.right); - } else if (expr instanceof AST_Binary) { - extract_candidates(expr.left); - extract_candidates(expr.right); - } else if (expr instanceof AST_Call && !has_annotation(expr, _NOINLINE)) { - extract_candidates(expr.expression); - expr.args.forEach(extract_candidates); - } else if (expr instanceof AST_Case) { - extract_candidates(expr.expression); - } else if (expr instanceof AST_Conditional) { - extract_candidates(expr.condition); - extract_candidates(expr.consequent); - extract_candidates(expr.alternative); - } else if (expr instanceof AST_Definitions) { - var len = expr.definitions.length; - // limit number of trailing variable definitions for consideration - var i = len - 200; - if (i < 0) - i = 0; - for (; i < len; i++) { - extract_candidates(expr.definitions[i]); - } - } else if (expr instanceof AST_DWLoop) { - extract_candidates(expr.condition); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_Exit) { - if (expr.value) - extract_candidates(expr.value); - } else if (expr instanceof AST_For) { - if (expr.init) - extract_candidates(expr.init); - if (expr.condition) - extract_candidates(expr.condition); - if (expr.step) - extract_candidates(expr.step); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_ForIn) { - extract_candidates(expr.object); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - } else if (expr instanceof AST_If) { - extract_candidates(expr.condition); - if (!(expr.body instanceof AST_Block)) { - extract_candidates(expr.body); - } - if (expr.alternative && !(expr.alternative instanceof AST_Block)) { - extract_candidates(expr.alternative); - } - } else if (expr instanceof AST_Sequence) { - expr.expressions.forEach(extract_candidates); - } else if (expr instanceof AST_SimpleStatement) { - extract_candidates(expr.body); - } else if (expr instanceof AST_Switch) { - extract_candidates(expr.expression); - expr.body.forEach(extract_candidates); - } else if (expr instanceof AST_Unary) { - if (expr.operator == "++" || expr.operator == "--") { - candidates.push(hit_stack.slice()); - } - } else if (expr instanceof AST_VarDef) { - if (expr.value && !(expr.value instanceof AST_Chain)) { - candidates.push(hit_stack.slice()); - extract_candidates(expr.value); - } - } - hit_stack.pop(); - } - - function find_stop(node, level, write_only) { - var parent = scanner.parent(level); - if (parent instanceof AST_Assign) { - if (write_only - && !parent.logical - && !(parent.left instanceof AST_PropAccess - || lvalues.has(parent.left.name))) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_Binary) { - if (write_only && (!lazy_op.has(parent.operator) || parent.left === node)) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_Call) - return node; - if (parent instanceof AST_Case) - return node; - if (parent instanceof AST_Conditional) { - if (write_only && parent.condition === node) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_Definitions) { - return find_stop(parent, level + 1, true); - } - if (parent instanceof AST_Exit) { - return write_only ? find_stop(parent, level + 1, write_only) : node; - } - if (parent instanceof AST_If) { - if (write_only && parent.condition === node) { - return find_stop(parent, level + 1, write_only); - } - return node; - } - if (parent instanceof AST_IterationStatement) - return node; - if (parent instanceof AST_Sequence) { - return find_stop(parent, level + 1, parent.tail_node() !== node); - } - if (parent instanceof AST_SimpleStatement) { - return find_stop(parent, level + 1, true); - } - if (parent instanceof AST_Switch) - return node; - if (parent instanceof AST_VarDef) - return node; - return null; - } - - function mangleable_var(var_def) { - var value = var_def.value; - if (!(value instanceof AST_SymbolRef)) - return; - if (value.name == "arguments") - return; - var def = value.definition(); - if (def.undeclared) - return; - return value_def = def; - } - - function get_lhs(expr) { - if (expr instanceof AST_Assign && expr.logical) { - return false; - } else if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { - var def = expr.name.definition(); - if (!member(expr.name, def.orig)) - return; - var referenced = def.references.length - def.replaced; - if (!referenced) - return; - var declared = def.orig.length - def.eliminated; - if (declared > 1 && !(expr.name instanceof AST_SymbolFunarg) - || (referenced > 1 ? mangleable_var(expr) : !compressor.exposed(def))) { - return make_node(AST_SymbolRef, expr.name, expr.name); - } - } else { - const lhs = expr instanceof AST_Assign - ? expr.left - : expr.expression; - return !is_ref_of(lhs, AST_SymbolConst) - && !is_ref_of(lhs, AST_SymbolLet) && lhs; - } - } - - function get_rvalue(expr) { - if (expr instanceof AST_Assign) { - return expr.right; - } else { - return expr.value; - } - } - - function get_lvalues(expr) { - var lvalues = new Map(); - if (expr instanceof AST_Unary) - return lvalues; - var tw = new TreeWalker(function (node) { - var sym = node; - while (sym instanceof AST_PropAccess) - sym = sym.expression; - if (sym instanceof AST_SymbolRef) { - const prev = lvalues.get(sym.name); - if (!prev || !prev.modified) { - lvalues.set(sym.name, { - def: sym.definition(), - modified: is_modified(compressor, tw, node, node, 0) - }); - } - } - }); - get_rvalue(expr).walk(tw); - return lvalues; - } - - function remove_candidate(expr) { - if (expr.name instanceof AST_SymbolFunarg) { - var iife = compressor.parent(), argnames = compressor.self().argnames; - var index = argnames.indexOf(expr.name); - if (index < 0) { - iife.args.length = Math.min(iife.args.length, argnames.length - 1); - } else { - var args = iife.args; - if (args[index]) - args[index] = make_node(AST_Number, args[index], { - value: 0 - }); - } - return true; - } - var found = false; - return statements[stat_index].transform(new TreeTransformer(function (node, descend, in_list) { - if (found) - return node; - if (node === expr || node.body === expr) { - found = true; - if (node instanceof AST_VarDef) { - node.value = node.name instanceof AST_SymbolConst - ? make_node(AST_Undefined, node.value) // `const` always needs value. - : null; - return node; - } - return in_list ? MAP.skip : null; - } - }, function (node) { - if (node instanceof AST_Sequence) - switch (node.expressions.length) { - case 0: return null; - case 1: return node.expressions[0]; - } - })); - } - - function is_lhs_local(lhs) { - while (lhs instanceof AST_PropAccess) - lhs = lhs.expression; - return lhs instanceof AST_SymbolRef - && lhs.definition().scope.get_defun_scope() === defun_scope - && !(in_loop - && (lvalues.has(lhs.name) - || candidate instanceof AST_Unary - || (candidate instanceof AST_Assign - && !candidate.logical - && candidate.operator != "="))); - } - - function value_has_side_effects(expr) { - if (expr instanceof AST_Unary) - return unary_side_effects.has(expr.operator); - return get_rvalue(expr).has_side_effects(compressor); - } - - function replace_all_symbols() { - if (side_effects) - return false; - if (value_def) - return true; - if (lhs instanceof AST_SymbolRef) { - var def = lhs.definition(); - if (def.references.length - def.replaced == (candidate instanceof AST_VarDef ? 1 : 2)) { - return true; - } - } - return false; - } - - function may_modify(sym) { - if (!sym.definition) - return true; // AST_Destructuring - var def = sym.definition(); - if (def.orig.length == 1 && def.orig[0] instanceof AST_SymbolDefun) - return false; - if (def.scope.get_defun_scope() !== defun_scope) - return true; - return def.references.some((ref) => - ref.scope.get_defun_scope() !== defun_scope - ); - } - - function side_effects_external(node, lhs) { - if (node instanceof AST_Assign) - return side_effects_external(node.left, true); - if (node instanceof AST_Unary) - return side_effects_external(node.expression, true); - if (node instanceof AST_VarDef) - return node.value && side_effects_external(node.value); - if (lhs) { - if (node instanceof AST_Dot) - return side_effects_external(node.expression, true); - if (node instanceof AST_Sub) - return side_effects_external(node.expression, true); - if (node instanceof AST_SymbolRef) - return node.definition().scope.get_defun_scope() !== defun_scope; - } - return false; - } - - /** - * Will any of the pulled-in lvalues shadow a variable in newScope or parents? - * similar to scope_encloses_variables_in_this_scope */ - function shadows(my_scope, lvalues) { - for (const { def } of lvalues.values()) { - const looked_up = my_scope.find_variable(def.name); - if (looked_up) { - if (looked_up === def) continue; - return true; - } - } - return false; - } - } - - function eliminate_spurious_blocks(statements) { - var seen_dirs = []; - for (var i = 0; i < statements.length;) { - var stat = statements[i]; - if (stat instanceof AST_BlockStatement && stat.body.every(can_be_evicted_from_block)) { - CHANGED = true; - eliminate_spurious_blocks(stat.body); - statements.splice(i, 1, ...stat.body); - i += stat.body.length; - } else if (stat instanceof AST_EmptyStatement) { - CHANGED = true; - statements.splice(i, 1); - } else if (stat instanceof AST_Directive) { - if (seen_dirs.indexOf(stat.value) < 0) { - i++; - seen_dirs.push(stat.value); - } else { - CHANGED = true; - statements.splice(i, 1); - } - } else - i++; - } - } - - function handle_if_return(statements, compressor) { - var self = compressor.self(); - var multiple_if_returns = has_multiple_if_returns(statements); - var in_lambda = self instanceof AST_Lambda; - // Prevent extremely deep nesting - // https://github.com/terser/terser/issues/1432 - // https://github.com/webpack/webpack/issues/17548 - const iteration_start = Math.min(statements.length, 500); - for (var i = iteration_start; --i >= 0;) { - var stat = statements[i]; - var j = next_index(i); - var next = statements[j]; - - if (in_lambda && !next && stat instanceof AST_Return) { - if (!stat.value) { - CHANGED = true; - statements.splice(i, 1); - continue; - } - if (stat.value instanceof AST_UnaryPrefix && stat.value.operator == "void") { - CHANGED = true; - statements[i] = make_node(AST_SimpleStatement, stat, { - body: stat.value.expression - }); - continue; - } - } - - if (stat instanceof AST_If) { - let ab, new_else; - - ab = aborts(stat.body); - if ( - can_merge_flow(ab) - && (new_else = as_statement_array_with_return(stat.body, ab)) - ) { - if (ab.label) { - remove(ab.label.thedef.references, ab); - } - CHANGED = true; - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = make_node(AST_BlockStatement, stat, { - body: as_statement_array(stat.alternative).concat(extract_functions()) - }); - stat.alternative = make_node(AST_BlockStatement, stat, { - body: new_else - }); - statements[i] = stat.transform(compressor); - continue; - } - - ab = aborts(stat.alternative); - if ( - can_merge_flow(ab) - && (new_else = as_statement_array_with_return(stat.alternative, ab)) - ) { - if (ab.label) { - remove(ab.label.thedef.references, ab); - } - CHANGED = true; - stat = stat.clone(); - stat.body = make_node(AST_BlockStatement, stat.body, { - body: as_statement_array(stat.body).concat(extract_functions()) - }); - stat.alternative = make_node(AST_BlockStatement, stat.alternative, { - body: new_else - }); - statements[i] = stat.transform(compressor); - continue; - } - } - - if (stat instanceof AST_If && stat.body instanceof AST_Return) { - var value = stat.body.value; - //--- - // pretty silly case, but: - // if (foo()) return; return; ==> foo(); return; - if (!value && !stat.alternative - && (in_lambda && !next || next instanceof AST_Return && !next.value)) { - CHANGED = true; - statements[i] = make_node(AST_SimpleStatement, stat.condition, { - body: stat.condition - }); - continue; - } - //--- - // if (foo()) return x; return y; ==> return foo() ? x : y; - if (value && !stat.alternative && next instanceof AST_Return && next.value) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = next; - statements[i] = stat.transform(compressor); - statements.splice(j, 1); - continue; - } - //--- - // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined; - if (value && !stat.alternative - && (!next && in_lambda && multiple_if_returns - || next instanceof AST_Return)) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = next || make_node(AST_Return, stat, { - value: null - }); - statements[i] = stat.transform(compressor); - if (next) - statements.splice(j, 1); - continue; - } - //--- - // if (a) return b; if (c) return d; e; ==> return a ? b : c ? d : void e; - // - // if sequences is not enabled, this can lead to an endless loop (issue #866). - // however, with sequences on this helps producing slightly better output for - // the example code. - var prev = statements[prev_index(i)]; - if (compressor.option("sequences") && in_lambda && !stat.alternative - && prev instanceof AST_If && prev.body instanceof AST_Return - && next_index(j) == statements.length && next instanceof AST_SimpleStatement) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = make_node(AST_BlockStatement, next, { - body: [ - next, - make_node(AST_Return, next, { - value: null - }) - ] - }); - statements[i] = stat.transform(compressor); - statements.splice(j, 1); - continue; - } - } - } - - function has_multiple_if_returns(statements) { - var n = 0; - for (var i = statements.length; --i >= 0;) { - var stat = statements[i]; - if (stat instanceof AST_If && stat.body instanceof AST_Return) { - if (++n > 1) - return true; - } - } - return false; - } - - function is_return_void(value) { - return !value || value instanceof AST_UnaryPrefix && value.operator == "void"; - } - - function can_merge_flow(ab) { - if (!ab) - return false; - for (var j = i + 1, len = statements.length; j < len; j++) { - var stat = statements[j]; - if (stat instanceof AST_Const || stat instanceof AST_Let) - return false; - } - var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null; - return ab instanceof AST_Return && in_lambda && is_return_void(ab.value) - || ab instanceof AST_Continue && self === loop_body(lct) - || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct; - } - - function extract_functions() { - var tail = statements.slice(i + 1); - statements.length = i + 1; - return tail.filter(function (stat) { - if (stat instanceof AST_Defun) { - statements.push(stat); - return false; - } - return true; - }); - } - - function as_statement_array_with_return(node, ab) { - var body = as_statement_array(node); - if (ab !== body[body.length - 1]) { - return undefined; - } - body = body.slice(0, -1); - if (ab.value) { - body.push(make_node(AST_SimpleStatement, ab.value, { - body: ab.value.expression - })); - } - return body; - } - - function next_index(i) { - for (var j = i + 1, len = statements.length; j < len; j++) { - var stat = statements[j]; - if (!(stat instanceof AST_Var && declarations_only(stat))) { - break; - } - } - return j; - } - - function prev_index(i) { - for (var j = i; --j >= 0;) { - var stat = statements[j]; - if (!(stat instanceof AST_Var && declarations_only(stat))) { - break; - } - } - return j; - } - } - - function eliminate_dead_code(statements, compressor) { - var has_quit; - var self = compressor.self(); - for (var i = 0, n = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof AST_LoopControl) { - var lct = compressor.loopcontrol_target(stat); - if (stat instanceof AST_Break - && !(lct instanceof AST_IterationStatement) - && loop_body(lct) === self - || stat instanceof AST_Continue - && loop_body(lct) === self) { - if (stat.label) { - remove(stat.label.thedef.references, stat); - } - } else { - statements[n++] = stat; - } - } else { - statements[n++] = stat; - } - if (aborts(stat)) { - has_quit = statements.slice(i + 1); - break; - } - } - statements.length = n; - CHANGED = n != len; - if (has_quit) - has_quit.forEach(function (stat) { - trim_unreachable_code(compressor, stat, statements); - }); - } - - function declarations_only(node) { - return node.definitions.every((var_def) => !var_def.value); - } - - function sequencesize(statements, compressor) { - if (statements.length < 2) - return; - var seq = [], n = 0; - function push_seq() { - if (!seq.length) - return; - var body = make_sequence(seq[0], seq); - statements[n++] = make_node(AST_SimpleStatement, body, { body: body }); - seq = []; - } - for (var i = 0, len = statements.length; i < len; i++) { - var stat = statements[i]; - if (stat instanceof AST_SimpleStatement) { - if (seq.length >= compressor.sequences_limit) - push_seq(); - var body = stat.body; - if (seq.length > 0) - body = body.drop_side_effect_free(compressor); - if (body) - merge_sequence(seq, body); - } else if (stat instanceof AST_Definitions && declarations_only(stat) - || stat instanceof AST_Defun) { - statements[n++] = stat; - } else { - push_seq(); - statements[n++] = stat; - } - } - push_seq(); - statements.length = n; - if (n != len) - CHANGED = true; - } - - function to_simple_statement(block, decls) { - if (!(block instanceof AST_BlockStatement)) - return block; - var stat = null; - for (var i = 0, len = block.body.length; i < len; i++) { - var line = block.body[i]; - if (line instanceof AST_Var && declarations_only(line)) { - decls.push(line); - } else if (stat || line instanceof AST_Const || line instanceof AST_Let) { - return false; - } else { - stat = line; - } - } - return stat; - } - - function sequencesize_2(statements, compressor) { - function cons_seq(right) { - n--; - CHANGED = true; - var left = prev.body; - return make_sequence(left, [left, right]).transform(compressor); - } - var n = 0, prev; - for (var i = 0; i < statements.length; i++) { - var stat = statements[i]; - if (prev) { - if (stat instanceof AST_Exit) { - stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor)); - } else if (stat instanceof AST_For) { - if (!(stat.init instanceof AST_Definitions)) { - const abort = walk(prev.body, node => { - if (node instanceof AST_Scope) - return true; - if (node instanceof AST_Binary - && node.operator === "in") { - return walk_abort; - } - }); - if (!abort) { - if (stat.init) - stat.init = cons_seq(stat.init); - else { - stat.init = prev.body; - n--; - CHANGED = true; - } - } - } - } else if (stat instanceof AST_ForIn) { - if (!(stat.init instanceof AST_Const) && !(stat.init instanceof AST_Let)) { - stat.object = cons_seq(stat.object); - } - } else if (stat instanceof AST_If) { - stat.condition = cons_seq(stat.condition); - } else if (stat instanceof AST_Switch) { - stat.expression = cons_seq(stat.expression); - } else if (stat instanceof AST_With) { - stat.expression = cons_seq(stat.expression); - } - } - if (compressor.option("conditionals") && stat instanceof AST_If) { - var decls = []; - var body = to_simple_statement(stat.body, decls); - var alt = to_simple_statement(stat.alternative, decls); - if (body !== false && alt !== false && decls.length > 0) { - var len = decls.length; - decls.push(make_node(AST_If, stat, { - condition: stat.condition, - body: body || make_node(AST_EmptyStatement, stat.body), - alternative: alt - })); - decls.unshift(n, 1); - [].splice.apply(statements, decls); - i += len; - n += len + 1; - prev = null; - CHANGED = true; - continue; - } - } - statements[n++] = stat; - prev = stat instanceof AST_SimpleStatement ? stat : null; - } - statements.length = n; - } - - function join_object_assignments(defn, body) { - if (!(defn instanceof AST_Definitions)) - return; - var def = defn.definitions[defn.definitions.length - 1]; - if (!(def.value instanceof AST_Object)) - return; - var exprs; - if (body instanceof AST_Assign && !body.logical) { - exprs = [body]; - } else if (body instanceof AST_Sequence) { - exprs = body.expressions.slice(); - } - if (!exprs) - return; - var trimmed = false; - do { - var node = exprs[0]; - if (!(node instanceof AST_Assign)) - break; - if (node.operator != "=") - break; - if (!(node.left instanceof AST_PropAccess)) - break; - var sym = node.left.expression; - if (!(sym instanceof AST_SymbolRef)) - break; - if (def.name.name != sym.name) - break; - if (!node.right.is_constant_expression(nearest_scope)) - break; - var prop = node.left.property; - if (prop instanceof AST_Node) { - prop = prop.evaluate(compressor); - } - if (prop instanceof AST_Node) - break; - prop = "" + prop; - var diff = compressor.option("ecma") < 2015 - && compressor.has_directive("use strict") ? function (node) { - return node.key != prop && (node.key && node.key.name != prop); - } : function (node) { - return node.key && node.key.name != prop; - }; - if (!def.value.properties.every(diff)) - break; - var p = def.value.properties.filter(function (p) { return p.key === prop; })[0]; - if (!p) { - def.value.properties.push(make_node(AST_ObjectKeyVal, node, { - key: prop, - value: node.right - })); - } else { - p.value = new AST_Sequence({ - start: p.start, - expressions: [p.value.clone(), node.right.clone()], - end: p.end - }); - } - exprs.shift(); - trimmed = true; - } while (exprs.length); - return trimmed && exprs; - } - - function join_consecutive_vars(statements) { - var defs; - for (var i = 0, j = -1, len = statements.length; i < len; i++) { - var stat = statements[i]; - var prev = statements[j]; - if (stat instanceof AST_Definitions) { - if (prev && prev.TYPE == stat.TYPE) { - prev.definitions = prev.definitions.concat(stat.definitions); - CHANGED = true; - } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) { - defs.definitions = defs.definitions.concat(stat.definitions); - CHANGED = true; - } else { - statements[++j] = stat; - defs = stat; - } - } else if (stat instanceof AST_Exit) { - stat.value = extract_object_assignments(stat.value); - } else if (stat instanceof AST_For) { - var exprs = join_object_assignments(prev, stat.init); - if (exprs) { - CHANGED = true; - stat.init = exprs.length ? make_sequence(stat.init, exprs) : null; - statements[++j] = stat; - } else if ( - prev instanceof AST_Var - && (!stat.init || stat.init.TYPE == prev.TYPE) - ) { - if (stat.init) { - prev.definitions = prev.definitions.concat(stat.init.definitions); - } - stat.init = prev; - statements[j] = stat; - CHANGED = true; - } else if ( - defs instanceof AST_Var - && stat.init instanceof AST_Var - && declarations_only(stat.init) - ) { - defs.definitions = defs.definitions.concat(stat.init.definitions); - stat.init = null; - statements[++j] = stat; - CHANGED = true; - } else { - statements[++j] = stat; - } - } else if (stat instanceof AST_ForIn) { - stat.object = extract_object_assignments(stat.object); - } else if (stat instanceof AST_If) { - stat.condition = extract_object_assignments(stat.condition); - } else if (stat instanceof AST_SimpleStatement) { - var exprs = join_object_assignments(prev, stat.body); - if (exprs) { - CHANGED = true; - if (!exprs.length) - continue; - stat.body = make_sequence(stat.body, exprs); - } - statements[++j] = stat; - } else if (stat instanceof AST_Switch) { - stat.expression = extract_object_assignments(stat.expression); - } else if (stat instanceof AST_With) { - stat.expression = extract_object_assignments(stat.expression); - } else { - statements[++j] = stat; - } - } - statements.length = j + 1; - - function extract_object_assignments(value) { - statements[++j] = stat; - var exprs = join_object_assignments(prev, value); - if (exprs) { - CHANGED = true; - if (exprs.length) { - return make_sequence(value, exprs); - } else if (value instanceof AST_Sequence) { - return value.tail_node().left; - } else { - return value.left; - } - } - return value; - } - } -} diff --git a/node_modules/terser/lib/equivalent-to.js b/node_modules/terser/lib/equivalent-to.js deleted file mode 100644 index 3359615..0000000 --- a/node_modules/terser/lib/equivalent-to.js +++ /dev/null @@ -1,287 +0,0 @@ -import { - AST_Array, - AST_Atom, - AST_Await, - AST_BigInt, - AST_Binary, - AST_Block, - AST_Call, - AST_Catch, - AST_Chain, - AST_Class, - AST_ClassProperty, - AST_ConciseMethod, - AST_Conditional, - AST_Debugger, - AST_Definitions, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DotHash, - AST_EmptyStatement, - AST_Expansion, - AST_Export, - AST_Finally, - AST_For, - AST_ForIn, - AST_ForOf, - AST_If, - AST_Import, - AST_ImportMeta, - AST_Jump, - AST_LabeledStatement, - AST_Lambda, - AST_LoopControl, - AST_NameMapping, - AST_NewTarget, - AST_Node, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PrefixedTemplateString, - AST_PropAccess, - AST_RegExp, - AST_Sequence, - AST_SimpleStatement, - AST_String, - AST_Super, - AST_Switch, - AST_SwitchBranch, - AST_Symbol, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_Toplevel, - AST_Try, - AST_Unary, - AST_VarDef, - AST_While, - AST_With, - AST_Yield -} from "./ast.js"; - -const shallow_cmp = (node1, node2) => { - return ( - node1 === null && node2 === null - || node1.TYPE === node2.TYPE && node1.shallow_cmp(node2) - ); -}; - -export const equivalent_to = (tree1, tree2) => { - if (!shallow_cmp(tree1, tree2)) return false; - const walk_1_state = [tree1]; - const walk_2_state = [tree2]; - - const walk_1_push = walk_1_state.push.bind(walk_1_state); - const walk_2_push = walk_2_state.push.bind(walk_2_state); - - while (walk_1_state.length && walk_2_state.length) { - const node_1 = walk_1_state.pop(); - const node_2 = walk_2_state.pop(); - - if (!shallow_cmp(node_1, node_2)) return false; - - node_1._children_backwards(walk_1_push); - node_2._children_backwards(walk_2_push); - - if (walk_1_state.length !== walk_2_state.length) { - // Different number of children - return false; - } - } - - return walk_1_state.length == 0 && walk_2_state.length == 0; -}; - -const pass_through = () => true; - -AST_Node.prototype.shallow_cmp = function () { - throw new Error("did not find a shallow_cmp function for " + this.constructor.name); -}; - -AST_Debugger.prototype.shallow_cmp = pass_through; - -AST_Directive.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_SimpleStatement.prototype.shallow_cmp = pass_through; - -AST_Block.prototype.shallow_cmp = pass_through; - -AST_EmptyStatement.prototype.shallow_cmp = pass_through; - -AST_LabeledStatement.prototype.shallow_cmp = function(other) { - return this.label.name === other.label.name; -}; - -AST_Do.prototype.shallow_cmp = pass_through; - -AST_While.prototype.shallow_cmp = pass_through; - -AST_For.prototype.shallow_cmp = function(other) { - return (this.init == null ? other.init == null : this.init === other.init) && (this.condition == null ? other.condition == null : this.condition === other.condition) && (this.step == null ? other.step == null : this.step === other.step); -}; - -AST_ForIn.prototype.shallow_cmp = pass_through; - -AST_ForOf.prototype.shallow_cmp = pass_through; - -AST_With.prototype.shallow_cmp = pass_through; - -AST_Toplevel.prototype.shallow_cmp = pass_through; - -AST_Expansion.prototype.shallow_cmp = pass_through; - -AST_Lambda.prototype.shallow_cmp = function(other) { - return this.is_generator === other.is_generator && this.async === other.async; -}; - -AST_Destructuring.prototype.shallow_cmp = function(other) { - return this.is_array === other.is_array; -}; - -AST_PrefixedTemplateString.prototype.shallow_cmp = pass_through; - -AST_TemplateString.prototype.shallow_cmp = pass_through; - -AST_TemplateSegment.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_Jump.prototype.shallow_cmp = pass_through; - -AST_LoopControl.prototype.shallow_cmp = pass_through; - -AST_Await.prototype.shallow_cmp = pass_through; - -AST_Yield.prototype.shallow_cmp = function(other) { - return this.is_star === other.is_star; -}; - -AST_If.prototype.shallow_cmp = function(other) { - return this.alternative == null ? other.alternative == null : this.alternative === other.alternative; -}; - -AST_Switch.prototype.shallow_cmp = pass_through; - -AST_SwitchBranch.prototype.shallow_cmp = pass_through; - -AST_Try.prototype.shallow_cmp = function(other) { - return (this.body === other.body) && (this.bcatch == null ? other.bcatch == null : this.bcatch === other.bcatch) && (this.bfinally == null ? other.bfinally == null : this.bfinally === other.bfinally); -}; - -AST_Catch.prototype.shallow_cmp = function(other) { - return this.argname == null ? other.argname == null : this.argname === other.argname; -}; - -AST_Finally.prototype.shallow_cmp = pass_through; - -AST_Definitions.prototype.shallow_cmp = pass_through; - -AST_VarDef.prototype.shallow_cmp = function(other) { - return this.value == null ? other.value == null : this.value === other.value; -}; - -AST_NameMapping.prototype.shallow_cmp = pass_through; - -AST_Import.prototype.shallow_cmp = function(other) { - return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names); -}; - -AST_ImportMeta.prototype.shallow_cmp = pass_through; - -AST_Export.prototype.shallow_cmp = function(other) { - return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && this.module_name === other.module_name && this.is_default === other.is_default; -}; - -AST_Call.prototype.shallow_cmp = pass_through; - -AST_Sequence.prototype.shallow_cmp = pass_through; - -AST_PropAccess.prototype.shallow_cmp = pass_through; - -AST_Chain.prototype.shallow_cmp = pass_through; - -AST_Dot.prototype.shallow_cmp = function(other) { - return this.property === other.property; -}; - -AST_DotHash.prototype.shallow_cmp = function(other) { - return this.property === other.property; -}; - -AST_Unary.prototype.shallow_cmp = function(other) { - return this.operator === other.operator; -}; - -AST_Binary.prototype.shallow_cmp = function(other) { - return this.operator === other.operator; -}; - -AST_Conditional.prototype.shallow_cmp = pass_through; - -AST_Array.prototype.shallow_cmp = pass_through; - -AST_Object.prototype.shallow_cmp = pass_through; - -AST_ObjectProperty.prototype.shallow_cmp = pass_through; - -AST_ObjectKeyVal.prototype.shallow_cmp = function(other) { - return this.key === other.key; -}; - -AST_ObjectSetter.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -AST_ObjectGetter.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -AST_ConciseMethod.prototype.shallow_cmp = function(other) { - return this.static === other.static && this.is_generator === other.is_generator && this.async === other.async; -}; - -AST_Class.prototype.shallow_cmp = function(other) { - return (this.name == null ? other.name == null : this.name === other.name) && (this.extends == null ? other.extends == null : this.extends === other.extends); -}; - -AST_ClassProperty.prototype.shallow_cmp = function(other) { - return this.static === other.static; -}; - -AST_Symbol.prototype.shallow_cmp = function(other) { - return this.name === other.name; -}; - -AST_NewTarget.prototype.shallow_cmp = pass_through; - -AST_This.prototype.shallow_cmp = pass_through; - -AST_Super.prototype.shallow_cmp = pass_through; - -AST_String.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_Number.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_BigInt.prototype.shallow_cmp = function(other) { - return this.value === other.value; -}; - -AST_RegExp.prototype.shallow_cmp = function (other) { - return ( - this.value.flags === other.value.flags - && this.value.source === other.value.source - ); -}; - -AST_Atom.prototype.shallow_cmp = pass_through; diff --git a/node_modules/terser/lib/minify.js b/node_modules/terser/lib/minify.js deleted file mode 100644 index 68af570..0000000 --- a/node_modules/terser/lib/minify.js +++ /dev/null @@ -1,412 +0,0 @@ -"use strict"; -/* eslint-env browser, es6, node */ - -import { - defaults, - map_from_object, - map_to_object, - HOP, -} from "./utils/index.js"; -import { AST_Toplevel, AST_Node, walk, AST_Scope } from "./ast.js"; -import { parse } from "./parse.js"; -import { OutputStream } from "./output.js"; -import { Compressor } from "./compress/index.js"; -import { base54 } from "./scope.js"; -import { SourceMap } from "./sourcemap.js"; -import { - mangle_properties, - mangle_private_properties, - reserve_quoted_keys, - find_annotated_props, -} from "./propmangle.js"; - -// to/from base64 functions -// Prefer built-in Buffer, if available, then use hack -// https://developer.mozilla.org/en-US/docs/Glossary/Base64#The_Unicode_Problem -var to_ascii = typeof Buffer !== "undefined" - ? (b64) => Buffer.from(b64, "base64").toString() - : (b64) => decodeURIComponent(escape(atob(b64))); -var to_base64 = typeof Buffer !== "undefined" - ? (str) => Buffer.from(str).toString("base64") - : (str) => btoa(unescape(encodeURIComponent(str))); - -function read_source_map(code) { - var match = /(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(code); - if (!match) { - console.warn("inline source map not found"); - return null; - } - return to_ascii(match[2]); -} - -function set_shorthand(name, options, keys) { - if (options[name]) { - keys.forEach(function(key) { - if (options[key]) { - if (typeof options[key] != "object") options[key] = {}; - if (!(name in options[key])) options[key][name] = options[name]; - } - }); - } -} - -function init_cache(cache) { - if (!cache) return; - if (!("props" in cache)) { - cache.props = new Map(); - } else if (!(cache.props instanceof Map)) { - cache.props = map_from_object(cache.props); - } -} - -function cache_to_json(cache) { - return { - props: map_to_object(cache.props) - }; -} - -function log_input(files, options, fs, debug_folder) { - if (!(fs && fs.writeFileSync && fs.mkdirSync)) { - return; - } - - try { - fs.mkdirSync(debug_folder); - } catch (e) { - if (e.code !== "EEXIST") throw e; - } - - const log_path = `${debug_folder}/terser-debug-${(Math.random() * 9999999) | 0}.log`; - - options = options || {}; - - const options_str = JSON.stringify(options, (_key, thing) => { - if (typeof thing === "function") return "[Function " + thing.toString() + "]"; - if (thing instanceof RegExp) return "[RegExp " + thing.toString() + "]"; - return thing; - }, 4); - - const files_str = (file) => { - if (typeof file === "object" && options.parse && options.parse.spidermonkey) { - return JSON.stringify(file, null, 2); - } else if (typeof file === "object") { - return Object.keys(file) - .map((key) => key + ": " + files_str(file[key])) - .join("\n\n"); - } else if (typeof file === "string") { - return "```\n" + file + "\n```"; - } else { - return file; // What do? - } - }; - - fs.writeFileSync(log_path, "Options: \n" + options_str + "\n\nInput files:\n\n" + files_str(files) + "\n"); -} - -function* minify_sync_or_async(files, options, _fs_module) { - if ( - _fs_module - && typeof process === "object" - && process.env - && typeof process.env.TERSER_DEBUG_DIR === "string" - ) { - log_input(files, options, _fs_module, process.env.TERSER_DEBUG_DIR); - } - - options = defaults(options, { - compress: {}, - ecma: undefined, - enclose: false, - ie8: false, - keep_classnames: undefined, - keep_fnames: false, - mangle: {}, - module: false, - nameCache: null, - output: null, - format: null, - parse: {}, - rename: undefined, - safari10: false, - sourceMap: false, - spidermonkey: false, - timings: false, - toplevel: false, - warnings: false, - wrap: false, - }, true); - - var timings = options.timings && { - start: Date.now() - }; - if (options.keep_classnames === undefined) { - options.keep_classnames = options.keep_fnames; - } - if (options.rename === undefined) { - options.rename = options.compress && options.mangle; - } - if (options.output && options.format) { - throw new Error("Please only specify either output or format option, preferrably format."); - } - options.format = options.format || options.output || {}; - set_shorthand("ecma", options, [ "parse", "compress", "format" ]); - set_shorthand("ie8", options, [ "compress", "mangle", "format" ]); - set_shorthand("keep_classnames", options, [ "compress", "mangle" ]); - set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); - set_shorthand("module", options, [ "parse", "compress", "mangle" ]); - set_shorthand("safari10", options, [ "mangle", "format" ]); - set_shorthand("toplevel", options, [ "compress", "mangle" ]); - set_shorthand("warnings", options, [ "compress" ]); // legacy - var quoted_props; - if (options.mangle) { - options.mangle = defaults(options.mangle, { - cache: options.nameCache && (options.nameCache.vars || {}), - eval: false, - ie8: false, - keep_classnames: false, - keep_fnames: false, - module: false, - nth_identifier: base54, - properties: false, - reserved: [], - safari10: false, - toplevel: false, - }, true); - if (options.mangle.properties) { - if (typeof options.mangle.properties != "object") { - options.mangle.properties = {}; - } - if (options.mangle.properties.keep_quoted) { - quoted_props = options.mangle.properties.reserved; - if (!Array.isArray(quoted_props)) quoted_props = []; - options.mangle.properties.reserved = quoted_props; - } - if (options.nameCache && !("cache" in options.mangle.properties)) { - options.mangle.properties.cache = options.nameCache.props || {}; - } - } - init_cache(options.mangle.cache); - init_cache(options.mangle.properties.cache); - } - if (options.sourceMap) { - options.sourceMap = defaults(options.sourceMap, { - asObject: false, - content: null, - filename: null, - includeSources: false, - root: null, - url: null, - }, true); - } - - // -- Parse phase -- - if (timings) timings.parse = Date.now(); - var toplevel; - if (files instanceof AST_Toplevel) { - toplevel = files; - } else { - if (typeof files == "string" || (options.parse.spidermonkey && !Array.isArray(files))) { - files = [ files ]; - } - options.parse = options.parse || {}; - options.parse.toplevel = null; - - if (options.parse.spidermonkey) { - options.parse.toplevel = AST_Node.from_mozilla_ast(Object.keys(files).reduce(function(toplevel, name) { - if (!toplevel) return files[name]; - toplevel.body = toplevel.body.concat(files[name].body); - return toplevel; - }, null)); - } else { - delete options.parse.spidermonkey; - - for (var name in files) if (HOP(files, name)) { - options.parse.filename = name; - options.parse.toplevel = parse(files[name], options.parse); - if (options.sourceMap && options.sourceMap.content == "inline") { - if (Object.keys(files).length > 1) - throw new Error("inline source map only works with singular input"); - options.sourceMap.content = read_source_map(files[name]); - } - } - } - if (options.parse.toplevel === null) { - throw new Error("no source file given"); - } - - toplevel = options.parse.toplevel; - } - if (quoted_props && options.mangle.properties.keep_quoted !== "strict") { - reserve_quoted_keys(toplevel, quoted_props); - } - var annotated_props; - if (options.mangle && options.mangle.properties) { - annotated_props = find_annotated_props(toplevel); - } - if (options.wrap) { - toplevel = toplevel.wrap_commonjs(options.wrap); - } - if (options.enclose) { - toplevel = toplevel.wrap_enclose(options.enclose); - } - if (timings) timings.rename = Date.now(); - // disable rename on harmony due to expand_names bug in for-of loops - // https://github.com/mishoo/UglifyJS2/issues/2794 - if (0 && options.rename) { - toplevel.figure_out_scope(options.mangle); - toplevel.expand_names(options.mangle); - } - - // -- Compress phase -- - if (timings) timings.compress = Date.now(); - if (options.compress) { - toplevel = new Compressor(options.compress, { - mangle_options: options.mangle - }).compress(toplevel); - } - - // -- Mangle phase -- - if (timings) timings.scope = Date.now(); - if (options.mangle) toplevel.figure_out_scope(options.mangle); - if (timings) timings.mangle = Date.now(); - if (options.mangle) { - toplevel.compute_char_frequency(options.mangle); - toplevel.mangle_names(options.mangle); - toplevel = mangle_private_properties(toplevel, options.mangle); - } - if (timings) timings.properties = Date.now(); - if (options.mangle && options.mangle.properties) { - toplevel = mangle_properties(toplevel, options.mangle.properties, annotated_props); - } - - // Format phase - if (timings) timings.format = Date.now(); - var result = {}; - if (options.format.ast) { - result.ast = toplevel; - } - if (options.format.spidermonkey) { - result.ast = toplevel.to_mozilla_ast(); - } - let format_options; - if (!HOP(options.format, "code") || options.format.code) { - // Make a shallow copy so that we can modify without mutating the user's input. - format_options = {...options.format}; - if (!format_options.ast) { - // Destroy stuff to save RAM. (unless the deprecated `ast` option is on) - format_options._destroy_ast = true; - - walk(toplevel, node => { - if (node instanceof AST_Scope) { - node.variables = undefined; - node.enclosed = undefined; - node.parent_scope = undefined; - } - if (node.block_scope) { - node.block_scope.variables = undefined; - node.block_scope.enclosed = undefined; - node.parent_scope = undefined; - } - }); - } - - if (options.sourceMap) { - if (options.sourceMap.includeSources && files instanceof AST_Toplevel) { - throw new Error("original source content unavailable"); - } - format_options.source_map = yield* SourceMap({ - file: options.sourceMap.filename, - orig: options.sourceMap.content, - root: options.sourceMap.root, - files: options.sourceMap.includeSources ? files : null, - }); - } - delete format_options.ast; - delete format_options.code; - delete format_options.spidermonkey; - var stream = OutputStream(format_options); - toplevel.print(stream); - result.code = stream.get(); - if (options.sourceMap) { - Object.defineProperty(result, "map", { - configurable: true, - enumerable: true, - get() { - const map = format_options.source_map.getEncoded(); - return (result.map = options.sourceMap.asObject ? map : JSON.stringify(map)); - }, - set(value) { - Object.defineProperty(result, "map", { - value, - writable: true, - }); - } - }); - result.decoded_map = format_options.source_map.getDecoded(); - if (options.sourceMap.url == "inline") { - var sourceMap = typeof result.map === "object" ? JSON.stringify(result.map) : result.map; - result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(sourceMap); - } else if (options.sourceMap.url) { - result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; - } - } - } - if (options.nameCache && options.mangle) { - if (options.mangle.cache) options.nameCache.vars = cache_to_json(options.mangle.cache); - if (options.mangle.properties && options.mangle.properties.cache) { - options.nameCache.props = cache_to_json(options.mangle.properties.cache); - } - } - if (format_options && format_options.source_map) { - format_options.source_map.destroy(); - } - if (timings) { - timings.end = Date.now(); - result.timings = { - parse: 1e-3 * (timings.rename - timings.parse), - rename: 1e-3 * (timings.compress - timings.rename), - compress: 1e-3 * (timings.scope - timings.compress), - scope: 1e-3 * (timings.mangle - timings.scope), - mangle: 1e-3 * (timings.properties - timings.mangle), - properties: 1e-3 * (timings.format - timings.properties), - format: 1e-3 * (timings.end - timings.format), - total: 1e-3 * (timings.end - timings.start) - }; - } - return result; -} - -async function minify(files, options, _fs_module) { - const gen = minify_sync_or_async(files, options, _fs_module); - - let yielded; - let val; - do { - val = gen.next(await yielded); - yielded = val.value; - } while (!val.done); - - return val.value; -} - -function minify_sync(files, options, _fs_module) { - const gen = minify_sync_or_async(files, options, _fs_module); - - let yielded; - let val; - do { - if (yielded && typeof yielded.then === "function") { - throw new Error("minify_sync cannot be used with the legacy source-map module"); - } - val = gen.next(yielded); - yielded = val.value; - } while (!val.done); - - return val.value; -} - -export { - minify, - minify_sync, - to_ascii, -}; diff --git a/node_modules/terser/lib/mozilla-ast.js b/node_modules/terser/lib/mozilla-ast.js deleted file mode 100644 index 5e3c720..0000000 --- a/node_modules/terser/lib/mozilla-ast.js +++ /dev/null @@ -1,1886 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -import { make_node } from "./utils/index.js"; -import { - AST_Accessor, - AST_Array, - AST_Arrow, - AST_Assign, - AST_Atom, - AST_Await, - AST_BigInt, - AST_Binary, - AST_Block, - AST_BlockStatement, - AST_Boolean, - AST_Break, - AST_Call, - AST_Case, - AST_Catch, - AST_Chain, - AST_Class, - AST_ClassStaticBlock, - AST_ClassExpression, - AST_ClassProperty, - AST_ClassPrivateProperty, - AST_ConciseMethod, - AST_Conditional, - AST_Const, - AST_Constant, - AST_Continue, - AST_Debugger, - AST_Default, - AST_DefaultAssign, - AST_DefClass, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DotHash, - AST_EmptyStatement, - AST_Expansion, - AST_Export, - AST_False, - AST_Finally, - AST_For, - AST_ForIn, - AST_ForOf, - AST_Function, - AST_Hole, - AST_If, - AST_Import, - AST_ImportMeta, - AST_Label, - AST_LabeledStatement, - AST_LabelRef, - AST_Lambda, - AST_Let, - AST_NameMapping, - AST_New, - AST_NewTarget, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PrefixedTemplateString, - AST_PrivateGetter, - AST_PrivateMethod, - AST_PrivateSetter, - AST_PrivateIn, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Sequence, - AST_SimpleStatement, - AST_Statement, - AST_String, - AST_Sub, - AST_Super, - AST_Switch, - AST_SwitchBranch, - AST_Symbol, - AST_SymbolCatch, - AST_SymbolClass, - AST_SymbolClassProperty, - AST_SymbolPrivateProperty, - AST_SymbolConst, - AST_SymbolDefClass, - AST_SymbolDefun, - AST_SymbolExport, - AST_SymbolExportForeign, - AST_SymbolFunarg, - AST_SymbolImport, - AST_SymbolImportForeign, - AST_SymbolLambda, - AST_SymbolLet, - AST_SymbolMethod, - AST_SymbolRef, - AST_SymbolVar, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_Throw, - AST_Token, - AST_Toplevel, - AST_True, - AST_Try, - AST_TryBlock, - AST_Unary, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Var, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, -} from "./ast.js"; -import { is_basic_identifier_string } from "./parse.js"; - -(function() { - - var normalize_directives = function(body) { - for (var i = 0; i < body.length; i++) { - if (body[i] instanceof AST_Statement && body[i].body instanceof AST_String) { - body[i] = new AST_Directive({ - start: body[i].start, - end: body[i].end, - value: body[i].body.value - }); - } else { - return body; - } - } - - return body; - }; - - const assert_clause_from_moz = (assertions) => { - if (assertions && assertions.length > 0) { - return new AST_Object({ - start: my_start_token(assertions), - end: my_end_token(assertions), - properties: assertions.map((assertion_kv) => - new AST_ObjectKeyVal({ - start: my_start_token(assertion_kv), - end: my_end_token(assertion_kv), - key: assertion_kv.key.name || assertion_kv.key.value, - value: from_moz(assertion_kv.value) - }) - ) - }); - } - return null; - }; - - var MOZ_TO_ME = { - Program: function(M) { - return new AST_Toplevel({ - start: my_start_token(M), - end: my_end_token(M), - body: normalize_directives(M.body.map(from_moz)) - }); - }, - - ArrayPattern: function(M) { - return new AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.elements.map(function(elm) { - if (elm === null) { - return new AST_Hole(); - } - return from_moz(elm); - }), - is_array: true - }); - }, - - ObjectPattern: function(M) { - return new AST_Destructuring({ - start: my_start_token(M), - end: my_end_token(M), - names: M.properties.map(from_moz), - is_array: false - }); - }, - - AssignmentPattern: function(M) { - return new AST_DefaultAssign({ - start: my_start_token(M), - end: my_end_token(M), - left: from_moz(M.left), - operator: "=", - right: from_moz(M.right) - }); - }, - - SpreadElement: function(M) { - return new AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - RestElement: function(M) { - return new AST_Expansion({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - TemplateElement: function(M) { - return new AST_TemplateSegment({ - start: my_start_token(M), - end: my_end_token(M), - value: M.value.cooked, - raw: M.value.raw - }); - }, - - TemplateLiteral: function(M) { - var segments = []; - for (var i = 0; i < M.quasis.length; i++) { - segments.push(from_moz(M.quasis[i])); - if (M.expressions[i]) { - segments.push(from_moz(M.expressions[i])); - } - } - return new AST_TemplateString({ - start: my_start_token(M), - end: my_end_token(M), - segments: segments - }); - }, - - TaggedTemplateExpression: function(M) { - return new AST_PrefixedTemplateString({ - start: my_start_token(M), - end: my_end_token(M), - template_string: from_moz(M.quasi), - prefix: from_moz(M.tag) - }); - }, - - FunctionDeclaration: function(M) { - return new AST_Defun({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: M.params.map(from_moz), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - - FunctionExpression: function(M) { - return new AST_Function({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - argnames: M.params.map(from_moz), - is_generator: M.generator, - async: M.async, - body: normalize_directives(from_moz(M.body).body) - }); - }, - - ArrowFunctionExpression: function(M) { - const body = M.body.type === "BlockStatement" - ? from_moz(M.body).body - : [make_node(AST_Return, {}, { value: from_moz(M.body) })]; - return new AST_Arrow({ - start: my_start_token(M), - end: my_end_token(M), - argnames: M.params.map(from_moz), - body, - async: M.async, - }); - }, - - ExpressionStatement: function(M) { - return new AST_SimpleStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: from_moz(M.expression) - }); - }, - - TryStatement: function(M) { - var handlers = M.handlers || [M.handler]; - if (handlers.length > 1 || M.guardedHandlers && M.guardedHandlers.length) { - throw new Error("Multiple catch clauses are not supported."); - } - return new AST_Try({ - start : my_start_token(M), - end : my_end_token(M), - body : new AST_TryBlock(from_moz(M.block)), - bcatch : from_moz(handlers[0]), - bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null - }); - }, - - Property: function(M) { - var key = M.key; - var args = { - start : my_start_token(key || M.value), - end : my_end_token(M.value), - key : key.type == "Identifier" ? key.name : key.value, - value : from_moz(M.value) - }; - if (M.computed) { - args.key = from_moz(M.key); - } - if (M.method) { - args.is_generator = M.value.generator; - args.async = M.value.async; - if (!M.computed) { - args.key = new AST_SymbolMethod({ name: args.key }); - } else { - args.key = from_moz(M.key); - } - return new AST_ConciseMethod(args); - } - if (M.kind == "init") { - if (key.type != "Identifier" && key.type != "Literal") { - args.key = from_moz(key); - } - return new AST_ObjectKeyVal(args); - } - if (typeof args.key === "string" || typeof args.key === "number") { - args.key = new AST_SymbolMethod({ - name: args.key - }); - } - args.value = new AST_Accessor(args.value); - if (M.kind == "get") return new AST_ObjectGetter(args); - if (M.kind == "set") return new AST_ObjectSetter(args); - if (M.kind == "method") { - args.async = M.value.async; - args.is_generator = M.value.generator; - args.quote = M.computed ? "\"" : null; - return new AST_ConciseMethod(args); - } - }, - - MethodDefinition: function(M) { - const is_private = M.key.type === "PrivateIdentifier"; - const key = M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }); - - var args = { - start : my_start_token(M), - end : my_end_token(M), - key, - value : from_moz(M.value), - static : M.static, - }; - if (M.kind == "get") { - return new (is_private ? AST_PrivateGetter : AST_ObjectGetter)(args); - } - if (M.kind == "set") { - return new (is_private ? AST_PrivateSetter : AST_ObjectSetter)(args); - } - args.is_generator = M.value.generator; - args.async = M.value.async; - return new (is_private ? AST_PrivateMethod : AST_ConciseMethod)(args); - }, - - FieldDefinition: function(M) { - let key; - if (M.computed) { - key = from_moz(M.key); - } else { - if (M.key.type !== "Identifier") throw new Error("Non-Identifier key in FieldDefinition"); - key = from_moz(M.key); - } - return new AST_ClassProperty({ - start : my_start_token(M), - end : my_end_token(M), - key, - value : from_moz(M.value), - static : M.static, - }); - }, - - PropertyDefinition: function(M) { - let key; - if (M.computed) { - key = from_moz(M.key); - } else if (M.key.type === "PrivateIdentifier") { - return new AST_ClassPrivateProperty({ - start : my_start_token(M), - end : my_end_token(M), - key : from_moz(M.key), - value : from_moz(M.value), - static : M.static, - }); - } else { - if (M.key.type !== "Identifier") { - throw new Error("Non-Identifier key in PropertyDefinition"); - } - key = from_moz(M.key); - } - - return new AST_ClassProperty({ - start : my_start_token(M), - end : my_end_token(M), - key, - value : from_moz(M.value), - static : M.static, - }); - }, - - PrivateIdentifier: function (M) { - return new AST_SymbolPrivateProperty({ - start: my_start_token(M), - end: my_end_token(M), - name: M.name - }); - }, - - StaticBlock: function(M) { - return new AST_ClassStaticBlock({ - start : my_start_token(M), - end : my_end_token(M), - body : M.body.map(from_moz), - }); - }, - - ArrayExpression: function(M) { - return new AST_Array({ - start : my_start_token(M), - end : my_end_token(M), - elements : M.elements.map(function(elem) { - return elem === null ? new AST_Hole() : from_moz(elem); - }) - }); - }, - - ObjectExpression: function(M) { - return new AST_Object({ - start : my_start_token(M), - end : my_end_token(M), - properties : M.properties.map(function(prop) { - if (prop.type === "SpreadElement") { - return from_moz(prop); - } - prop.type = "Property"; - return from_moz(prop); - }) - }); - }, - - SequenceExpression: function(M) { - return new AST_Sequence({ - start : my_start_token(M), - end : my_end_token(M), - expressions: M.expressions.map(from_moz) - }); - }, - - MemberExpression: function(M) { - if (M.property.type === "PrivateIdentifier") { - return new AST_DotHash({ - start : my_start_token(M), - end : my_end_token(M), - property : M.property.name, - expression : from_moz(M.object), - optional : M.optional || false - }); - } - return new (M.computed ? AST_Sub : AST_Dot)({ - start : my_start_token(M), - end : my_end_token(M), - property : M.computed ? from_moz(M.property) : M.property.name, - expression : from_moz(M.object), - optional : M.optional || false - }); - }, - - ChainExpression: function(M) { - return new AST_Chain({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.expression) - }); - }, - - SwitchCase: function(M) { - return new (M.test ? AST_Case : AST_Default)({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.test), - body : M.consequent.map(from_moz) - }); - }, - - VariableDeclaration: function(M) { - return new (M.kind === "const" ? AST_Const : - M.kind === "let" ? AST_Let : AST_Var)({ - start : my_start_token(M), - end : my_end_token(M), - definitions : M.declarations.map(from_moz) - }); - }, - - ImportDeclaration: function(M) { - var imported_name = null; - var imported_names = null; - M.specifiers.forEach(function (specifier) { - if (specifier.type === "ImportSpecifier" || specifier.type === "ImportNamespaceSpecifier") { - if (!imported_names) { imported_names = []; } - imported_names.push(from_moz(specifier)); - } else if (specifier.type === "ImportDefaultSpecifier") { - imported_name = from_moz(specifier); - } - }); - return new AST_Import({ - start : my_start_token(M), - end : my_end_token(M), - imported_name: imported_name, - imported_names : imported_names, - module_name : from_moz(M.source), - assert_clause: assert_clause_from_moz(M.assertions) - }); - }, - - ImportSpecifier: function(M) { - return new AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: from_moz(M.imported), - name: from_moz(M.local) - }); - }, - - ImportDefaultSpecifier: function(M) { - return from_moz(M.local); - }, - - ImportNamespaceSpecifier: function(M) { - return new AST_NameMapping({ - start: my_start_token(M), - end: my_end_token(M), - foreign_name: new AST_SymbolImportForeign({ name: "*" }), - name: from_moz(M.local) - }); - }, - - ExportAllDeclaration: function(M) { - var foreign_name = M.exported == null ? - new AST_SymbolExportForeign({ name: "*" }) : - from_moz(M.exported); - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_names: [ - new AST_NameMapping({ - name: new AST_SymbolExportForeign({ name: "*" }), - foreign_name: foreign_name - }) - ], - module_name: from_moz(M.source), - assert_clause: assert_clause_from_moz(M.assertions) - }); - }, - - ExportNamedDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_definition: from_moz(M.declaration), - exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(function (specifier) { - return from_moz(specifier); - }) : null, - module_name: from_moz(M.source), - assert_clause: assert_clause_from_moz(M.assertions) - }); - }, - - ExportDefaultDeclaration: function(M) { - return new AST_Export({ - start: my_start_token(M), - end: my_end_token(M), - exported_value: from_moz(M.declaration), - is_default: true - }); - }, - - ExportSpecifier: function(M) { - return new AST_NameMapping({ - foreign_name: from_moz(M.exported), - name: from_moz(M.local) - }); - }, - - Literal: function(M) { - var val = M.value, args = { - start : my_start_token(M), - end : my_end_token(M) - }; - var rx = M.regex; - if (rx && rx.pattern) { - // RegExpLiteral as per ESTree AST spec - args.value = { - source: rx.pattern, - flags: rx.flags - }; - return new AST_RegExp(args); - } else if (rx) { - // support legacy RegExp - const rx_source = M.raw || val; - const match = rx_source.match(/^\/(.*)\/(\w*)$/); - if (!match) throw new Error("Invalid regex source " + rx_source); - const [_, source, flags] = match; - args.value = { source, flags }; - return new AST_RegExp(args); - } - if (val === null) return new AST_Null(args); - switch (typeof val) { - case "string": - args.quote = "\""; - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - if (p.type == "ImportSpecifier") { - args.name = val; - return new AST_SymbolImportForeign(args); - } else if (p.type == "ExportSpecifier") { - args.name = val; - if (M == p.exported) { - return new AST_SymbolExportForeign(args); - } else { - return new AST_SymbolExport(args); - } - } else if (p.type == "ExportAllDeclaration" && M == p.exported) { - args.name = val; - return new AST_SymbolExportForeign(args); - } - args.value = val; - return new AST_String(args); - case "number": - args.value = val; - args.raw = M.raw || val.toString(); - return new AST_Number(args); - case "boolean": - return new (val ? AST_True : AST_False)(args); - } - }, - - MetaProperty: function(M) { - if (M.meta.name === "new" && M.property.name === "target") { - return new AST_NewTarget({ - start: my_start_token(M), - end: my_end_token(M) - }); - } else if (M.meta.name === "import" && M.property.name === "meta") { - return new AST_ImportMeta({ - start: my_start_token(M), - end: my_end_token(M) - }); - } - }, - - Identifier: function(M) { - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - return new ( p.type == "LabeledStatement" ? AST_Label - : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : p.kind == "let" ? AST_SymbolLet : AST_SymbolVar) - : /Import.*Specifier/.test(p.type) ? (p.local === M ? AST_SymbolImport : AST_SymbolImportForeign) - : p.type == "ExportSpecifier" ? (p.local === M ? AST_SymbolExport : AST_SymbolExportForeign) - : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg) - : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg) - : p.type == "ArrowFunctionExpression" ? (p.params.includes(M)) ? AST_SymbolFunarg : AST_SymbolRef - : p.type == "ClassExpression" ? (p.id === M ? AST_SymbolClass : AST_SymbolRef) - : p.type == "Property" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolMethod) - : p.type == "PropertyDefinition" || p.type === "FieldDefinition" ? (p.key === M && p.computed || p.value === M ? AST_SymbolRef : AST_SymbolClassProperty) - : p.type == "ClassDeclaration" ? (p.id === M ? AST_SymbolDefClass : AST_SymbolRef) - : p.type == "MethodDefinition" ? (p.computed ? AST_SymbolRef : AST_SymbolMethod) - : p.type == "CatchClause" ? AST_SymbolCatch - : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef - : AST_SymbolRef)({ - start : my_start_token(M), - end : my_end_token(M), - name : M.name - }); - }, - - BigIntLiteral(M) { - return new AST_BigInt({ - start : my_start_token(M), - end : my_end_token(M), - value : M.value - }); - }, - - EmptyStatement: function(M) { - return new AST_EmptyStatement({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - BlockStatement: function(M) { - return new AST_BlockStatement({ - start: my_start_token(M), - end: my_end_token(M), - body: M.body.map(from_moz) - }); - }, - - IfStatement: function(M) { - return new AST_If({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.consequent), - alternative: from_moz(M.alternate) - }); - }, - - LabeledStatement: function(M) { - return new AST_LabeledStatement({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz(M.label), - body: from_moz(M.body) - }); - }, - - BreakStatement: function(M) { - return new AST_Break({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz(M.label) - }); - }, - - ContinueStatement: function(M) { - return new AST_Continue({ - start: my_start_token(M), - end: my_end_token(M), - label: from_moz(M.label) - }); - }, - - WithStatement: function(M) { - return new AST_With({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.object), - body: from_moz(M.body) - }); - }, - - SwitchStatement: function(M) { - return new AST_Switch({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.discriminant), - body: M.cases.map(from_moz) - }); - }, - - ReturnStatement: function(M) { - return new AST_Return({ - start: my_start_token(M), - end: my_end_token(M), - value: from_moz(M.argument) - }); - }, - - ThrowStatement: function(M) { - return new AST_Throw({ - start: my_start_token(M), - end: my_end_token(M), - value: from_moz(M.argument) - }); - }, - - WhileStatement: function(M) { - return new AST_While({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.body) - }); - }, - - DoWhileStatement: function(M) { - return new AST_Do({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - body: from_moz(M.body) - }); - }, - - ForStatement: function(M) { - return new AST_For({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.init), - condition: from_moz(M.test), - step: from_moz(M.update), - body: from_moz(M.body) - }); - }, - - ForInStatement: function(M) { - return new AST_ForIn({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body) - }); - }, - - ForOfStatement: function(M) { - return new AST_ForOf({ - start: my_start_token(M), - end: my_end_token(M), - init: from_moz(M.left), - object: from_moz(M.right), - body: from_moz(M.body), - await: M.await - }); - }, - - AwaitExpression: function(M) { - return new AST_Await({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument) - }); - }, - - YieldExpression: function(M) { - return new AST_Yield({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.argument), - is_star: M.delegate - }); - }, - - DebuggerStatement: function(M) { - return new AST_Debugger({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - VariableDeclarator: function(M) { - return new AST_VarDef({ - start: my_start_token(M), - end: my_end_token(M), - name: from_moz(M.id), - value: from_moz(M.init) - }); - }, - - CatchClause: function(M) { - return new AST_Catch({ - start: my_start_token(M), - end: my_end_token(M), - argname: from_moz(M.param), - body: from_moz(M.body).body - }); - }, - - ThisExpression: function(M) { - return new AST_This({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - Super: function(M) { - return new AST_Super({ - start: my_start_token(M), - end: my_end_token(M) - }); - }, - - BinaryExpression: function(M) { - if (M.left.type === "PrivateIdentifier") { - return new AST_PrivateIn({ - start: my_start_token(M), - end: my_end_token(M), - key: new AST_SymbolPrivateProperty({ - start: my_start_token(M.left), - end: my_end_token(M.left), - name: M.left.name - }), - value: from_moz(M.right), - }); - } - return new AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - LogicalExpression: function(M) { - return new AST_Binary({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - AssignmentExpression: function(M) { - return new AST_Assign({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - left: from_moz(M.left), - right: from_moz(M.right) - }); - }, - - ConditionalExpression: function(M) { - return new AST_Conditional({ - start: my_start_token(M), - end: my_end_token(M), - condition: from_moz(M.test), - consequent: from_moz(M.consequent), - alternative: from_moz(M.alternate) - }); - }, - - NewExpression: function(M) { - return new AST_New({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.callee), - args: M.arguments.map(from_moz) - }); - }, - - CallExpression: function(M) { - return new AST_Call({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.callee), - optional: M.optional, - args: M.arguments.map(from_moz) - }); - } - }; - - MOZ_TO_ME.UpdateExpression = - MOZ_TO_ME.UnaryExpression = function To_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix - : M.type == "UnaryExpression" ? true : false; - return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ - start : my_start_token(M), - end : my_end_token(M), - operator : M.operator, - expression : from_moz(M.argument) - }); - }; - - MOZ_TO_ME.ClassDeclaration = - MOZ_TO_ME.ClassExpression = function From_Moz_Class(M) { - return new (M.type === "ClassDeclaration" ? AST_DefClass : AST_ClassExpression)({ - start : my_start_token(M), - end : my_end_token(M), - name : from_moz(M.id), - extends : from_moz(M.superClass), - properties: M.body.body.map(from_moz) - }); - }; - - def_to_moz(AST_EmptyStatement, function To_Moz_EmptyStatement() { - return { - type: "EmptyStatement" - }; - }); - def_to_moz(AST_BlockStatement, function To_Moz_BlockStatement(M) { - return { - type: "BlockStatement", - body: M.body.map(to_moz) - }; - }); - def_to_moz(AST_If, function To_Moz_IfStatement(M) { - return { - type: "IfStatement", - test: to_moz(M.condition), - consequent: to_moz(M.body), - alternate: to_moz(M.alternative) - }; - }); - def_to_moz(AST_LabeledStatement, function To_Moz_LabeledStatement(M) { - return { - type: "LabeledStatement", - label: to_moz(M.label), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_Break, function To_Moz_BreakStatement(M) { - return { - type: "BreakStatement", - label: to_moz(M.label) - }; - }); - def_to_moz(AST_Continue, function To_Moz_ContinueStatement(M) { - return { - type: "ContinueStatement", - label: to_moz(M.label) - }; - }); - def_to_moz(AST_With, function To_Moz_WithStatement(M) { - return { - type: "WithStatement", - object: to_moz(M.expression), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_Switch, function To_Moz_SwitchStatement(M) { - return { - type: "SwitchStatement", - discriminant: to_moz(M.expression), - cases: M.body.map(to_moz) - }; - }); - def_to_moz(AST_Return, function To_Moz_ReturnStatement(M) { - return { - type: "ReturnStatement", - argument: to_moz(M.value) - }; - }); - def_to_moz(AST_Throw, function To_Moz_ThrowStatement(M) { - return { - type: "ThrowStatement", - argument: to_moz(M.value) - }; - }); - def_to_moz(AST_While, function To_Moz_WhileStatement(M) { - return { - type: "WhileStatement", - test: to_moz(M.condition), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_Do, function To_Moz_DoWhileStatement(M) { - return { - type: "DoWhileStatement", - test: to_moz(M.condition), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_For, function To_Moz_ForStatement(M) { - return { - type: "ForStatement", - init: to_moz(M.init), - test: to_moz(M.condition), - update: to_moz(M.step), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_ForIn, function To_Moz_ForInStatement(M) { - return { - type: "ForInStatement", - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body) - }; - }); - def_to_moz(AST_ForOf, function To_Moz_ForOfStatement(M) { - return { - type: "ForOfStatement", - left: to_moz(M.init), - right: to_moz(M.object), - body: to_moz(M.body), - await: M.await - }; - }); - def_to_moz(AST_Await, function To_Moz_AwaitExpression(M) { - return { - type: "AwaitExpression", - argument: to_moz(M.expression) - }; - }); - def_to_moz(AST_Yield, function To_Moz_YieldExpression(M) { - return { - type: "YieldExpression", - argument: to_moz(M.expression), - delegate: M.is_star - }; - }); - def_to_moz(AST_Debugger, function To_Moz_DebuggerStatement() { - return { - type: "DebuggerStatement" - }; - }); - def_to_moz(AST_VarDef, function To_Moz_VariableDeclarator(M) { - return { - type: "VariableDeclarator", - id: to_moz(M.name), - init: to_moz(M.value) - }; - }); - def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: to_moz(M.argname), - body: to_moz_block(M) - }; - }); - - def_to_moz(AST_This, function To_Moz_ThisExpression() { - return { - type: "ThisExpression" - }; - }); - def_to_moz(AST_Super, function To_Moz_Super() { - return { - type: "Super" - }; - }); - def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { - return { - type: "BinaryExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - def_to_moz(AST_Binary, function To_Moz_LogicalExpression(M) { - return { - type: "LogicalExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - def_to_moz(AST_Assign, function To_Moz_AssignmentExpression(M) { - return { - type: "AssignmentExpression", - operator: M.operator, - left: to_moz(M.left), - right: to_moz(M.right) - }; - }); - def_to_moz(AST_Conditional, function To_Moz_ConditionalExpression(M) { - return { - type: "ConditionalExpression", - test: to_moz(M.condition), - consequent: to_moz(M.consequent), - alternate: to_moz(M.alternative) - }; - }); - def_to_moz(AST_New, function To_Moz_NewExpression(M) { - return { - type: "NewExpression", - callee: to_moz(M.expression), - arguments: M.args.map(to_moz) - }; - }); - def_to_moz(AST_Call, function To_Moz_CallExpression(M) { - return { - type: "CallExpression", - callee: to_moz(M.expression), - optional: M.optional, - arguments: M.args.map(to_moz) - }; - }); - - def_to_moz(AST_Toplevel, function To_Moz_Program(M) { - return to_moz_scope("Program", M); - }); - - def_to_moz(AST_Expansion, function To_Moz_Spread(M) { - return { - type: to_moz_in_destructuring() ? "RestElement" : "SpreadElement", - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_PrefixedTemplateString, function To_Moz_TaggedTemplateExpression(M) { - return { - type: "TaggedTemplateExpression", - tag: to_moz(M.prefix), - quasi: to_moz(M.template_string) - }; - }); - - def_to_moz(AST_TemplateString, function To_Moz_TemplateLiteral(M) { - var quasis = []; - var expressions = []; - for (var i = 0; i < M.segments.length; i++) { - if (i % 2 !== 0) { - expressions.push(to_moz(M.segments[i])); - } else { - quasis.push({ - type: "TemplateElement", - value: { - raw: M.segments[i].raw, - cooked: M.segments[i].value - }, - tail: i === M.segments.length - 1 - }); - } - } - return { - type: "TemplateLiteral", - quasis: quasis, - expressions: expressions - }; - }); - - def_to_moz(AST_Defun, function To_Moz_FunctionDeclaration(M) { - return { - type: "FunctionDeclaration", - id: to_moz(M.name), - params: M.argnames.map(to_moz), - generator: M.is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(AST_Function, function To_Moz_FunctionExpression(M, parent) { - var is_generator = parent.is_generator !== undefined ? - parent.is_generator : M.is_generator; - return { - type: "FunctionExpression", - id: to_moz(M.name), - params: M.argnames.map(to_moz), - generator: is_generator, - async: M.async, - body: to_moz_scope("BlockStatement", M) - }; - }); - - def_to_moz(AST_Arrow, function To_Moz_ArrowFunctionExpression(M) { - var body = { - type: "BlockStatement", - body: M.body.map(to_moz) - }; - return { - type: "ArrowFunctionExpression", - params: M.argnames.map(to_moz), - async: M.async, - body: body - }; - }); - - def_to_moz(AST_Destructuring, function To_Moz_ObjectPattern(M) { - if (M.is_array) { - return { - type: "ArrayPattern", - elements: M.names.map(to_moz) - }; - } - return { - type: "ObjectPattern", - properties: M.names.map(to_moz) - }; - }); - - def_to_moz(AST_Directive, function To_Moz_Directive(M) { - return { - type: "ExpressionStatement", - expression: { - type: "Literal", - value: M.value, - raw: M.print_to_string() - }, - directive: M.value - }; - }); - - def_to_moz(AST_SimpleStatement, function To_Moz_ExpressionStatement(M) { - return { - type: "ExpressionStatement", - expression: to_moz(M.body) - }; - }); - - def_to_moz(AST_SwitchBranch, function To_Moz_SwitchCase(M) { - return { - type: "SwitchCase", - test: to_moz(M.expression), - consequent: M.body.map(to_moz) - }; - }); - - def_to_moz(AST_Try, function To_Moz_TryStatement(M) { - return { - type: "TryStatement", - block: to_moz_block(M.body), - handler: to_moz(M.bcatch), - guardedHandlers: [], - finalizer: to_moz(M.bfinally) - }; - }); - - def_to_moz(AST_Catch, function To_Moz_CatchClause(M) { - return { - type: "CatchClause", - param: to_moz(M.argname), - guard: null, - body: to_moz_block(M) - }; - }); - - def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) { - return { - type: "VariableDeclaration", - kind: - M instanceof AST_Const ? "const" : - M instanceof AST_Let ? "let" : "var", - declarations: M.definitions.map(to_moz) - }; - }); - - const assert_clause_to_moz = assert_clause => { - const assertions = []; - if (assert_clause) { - for (const { key, value } of assert_clause.properties) { - const key_moz = is_basic_identifier_string(key) - ? { type: "Identifier", name: key } - : { type: "Literal", value: key, raw: JSON.stringify(key) }; - assertions.push({ - type: "ImportAttribute", - key: key_moz, - value: to_moz(value) - }); - } - } - return assertions; - }; - - def_to_moz(AST_Export, function To_Moz_ExportDeclaration(M) { - if (M.exported_names) { - var first_exported = M.exported_names[0]; - var first_exported_name = first_exported.name; - if (first_exported_name.name === "*" && !first_exported_name.quote) { - var foreign_name = first_exported.foreign_name; - var exported = foreign_name.name === "*" && !foreign_name.quote - ? null - : to_moz(foreign_name); - return { - type: "ExportAllDeclaration", - source: to_moz(M.module_name), - exported: exported, - assertions: assert_clause_to_moz(M.assert_clause) - }; - } - return { - type: "ExportNamedDeclaration", - specifiers: M.exported_names.map(function (name_mapping) { - return { - type: "ExportSpecifier", - exported: to_moz(name_mapping.foreign_name), - local: to_moz(name_mapping.name) - }; - }), - declaration: to_moz(M.exported_definition), - source: to_moz(M.module_name), - assertions: assert_clause_to_moz(M.assert_clause) - }; - } - return { - type: M.is_default ? "ExportDefaultDeclaration" : "ExportNamedDeclaration", - declaration: to_moz(M.exported_value || M.exported_definition) - }; - }); - - def_to_moz(AST_Import, function To_Moz_ImportDeclaration(M) { - var specifiers = []; - if (M.imported_name) { - specifiers.push({ - type: "ImportDefaultSpecifier", - local: to_moz(M.imported_name) - }); - } - if (M.imported_names) { - var first_imported_foreign_name = M.imported_names[0].foreign_name; - if (first_imported_foreign_name.name === "*" && !first_imported_foreign_name.quote) { - specifiers.push({ - type: "ImportNamespaceSpecifier", - local: to_moz(M.imported_names[0].name) - }); - } else { - M.imported_names.forEach(function(name_mapping) { - specifiers.push({ - type: "ImportSpecifier", - local: to_moz(name_mapping.name), - imported: to_moz(name_mapping.foreign_name) - }); - }); - } - } - return { - type: "ImportDeclaration", - specifiers: specifiers, - source: to_moz(M.module_name), - assertions: assert_clause_to_moz(M.assert_clause) - }; - }); - - def_to_moz(AST_ImportMeta, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "import" - }, - property: { - type: "Identifier", - name: "meta" - } - }; - }); - - def_to_moz(AST_Sequence, function To_Moz_SequenceExpression(M) { - return { - type: "SequenceExpression", - expressions: M.expressions.map(to_moz) - }; - }); - - def_to_moz(AST_DotHash, function To_Moz_PrivateMemberExpression(M) { - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: false, - property: { - type: "PrivateIdentifier", - name: M.property - }, - optional: M.optional - }; - }); - - def_to_moz(AST_PropAccess, function To_Moz_MemberExpression(M) { - var isComputed = M instanceof AST_Sub; - return { - type: "MemberExpression", - object: to_moz(M.expression), - computed: isComputed, - property: isComputed ? to_moz(M.property) : {type: "Identifier", name: M.property}, - optional: M.optional - }; - }); - - def_to_moz(AST_Chain, function To_Moz_ChainExpression(M) { - return { - type: "ChainExpression", - expression: to_moz(M.expression) - }; - }); - - def_to_moz(AST_Unary, function To_Moz_Unary(M) { - return { - type: M.operator == "++" || M.operator == "--" ? "UpdateExpression" : "UnaryExpression", - operator: M.operator, - prefix: M instanceof AST_UnaryPrefix, - argument: to_moz(M.expression) - }; - }); - - def_to_moz(AST_Binary, function To_Moz_BinaryExpression(M) { - if (M.operator == "=" && to_moz_in_destructuring()) { - return { - type: "AssignmentPattern", - left: to_moz(M.left), - right: to_moz(M.right) - }; - } - - const type = M.operator == "&&" || M.operator == "||" || M.operator === "??" - ? "LogicalExpression" - : "BinaryExpression"; - - return { - type, - left: to_moz(M.left), - operator: M.operator, - right: to_moz(M.right) - }; - }); - - def_to_moz(AST_PrivateIn, function To_Moz_BinaryExpression_PrivateIn(M) { - return { - type: "BinaryExpression", - left: { type: "PrivateIdentifier", name: M.key.name }, - operator: "in", - right: to_moz(M.value), - }; - }); - - def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { - return { - type: "ArrayExpression", - elements: M.elements.map(to_moz) - }; - }); - - def_to_moz(AST_Object, function To_Moz_ObjectExpression(M) { - return { - type: "ObjectExpression", - properties: M.properties.map(to_moz) - }; - }); - - def_to_moz(AST_ObjectProperty, function To_Moz_Property(M, parent) { - var key = M.key instanceof AST_Node ? to_moz(M.key) : { - type: "Identifier", - value: M.key - }; - if (typeof M.key === "number") { - key = { - type: "Literal", - value: Number(M.key) - }; - } - if (typeof M.key === "string") { - key = { - type: "Identifier", - name: M.key - }; - } - var kind; - var string_or_num = typeof M.key === "string" || typeof M.key === "number"; - var computed = string_or_num ? false : !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef; - if (M instanceof AST_ObjectKeyVal) { - kind = "init"; - computed = !string_or_num; - } else - if (M instanceof AST_ObjectGetter) { - kind = "get"; - } else - if (M instanceof AST_ObjectSetter) { - kind = "set"; - } - if (M instanceof AST_PrivateGetter || M instanceof AST_PrivateSetter) { - const kind = M instanceof AST_PrivateGetter ? "get" : "set"; - return { - type: "MethodDefinition", - computed: false, - kind: kind, - static: M.static, - key: { - type: "PrivateIdentifier", - name: M.key.name - }, - value: to_moz(M.value) - }; - } - if (M instanceof AST_ClassPrivateProperty) { - return { - type: "PropertyDefinition", - key: { - type: "PrivateIdentifier", - name: M.key.name - }, - value: to_moz(M.value), - computed: false, - static: M.static - }; - } - if (M instanceof AST_ClassProperty) { - return { - type: "PropertyDefinition", - key, - value: to_moz(M.value), - computed, - static: M.static - }; - } - if (parent instanceof AST_Class) { - return { - type: "MethodDefinition", - computed: computed, - kind: kind, - static: M.static, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - return { - type: "Property", - computed: computed, - kind: kind, - key: key, - value: to_moz(M.value) - }; - }); - - def_to_moz(AST_ConciseMethod, function To_Moz_MethodDefinition(M, parent) { - if (parent instanceof AST_Object) { - return { - type: "Property", - computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, - kind: "init", - method: true, - shorthand: false, - key: to_moz(M.key), - value: to_moz(M.value) - }; - } - - const key = M instanceof AST_PrivateMethod - ? { - type: "PrivateIdentifier", - name: M.key.name - } - : to_moz(M.key); - - return { - type: "MethodDefinition", - kind: M.key === "constructor" ? "constructor" : "method", - key, - value: to_moz(M.value), - computed: !(M.key instanceof AST_Symbol) || M.key instanceof AST_SymbolRef, - static: M.static, - }; - }); - - def_to_moz(AST_Class, function To_Moz_Class(M) { - var type = M instanceof AST_ClassExpression ? "ClassExpression" : "ClassDeclaration"; - return { - type: type, - superClass: to_moz(M.extends), - id: M.name ? to_moz(M.name) : null, - body: { - type: "ClassBody", - body: M.properties.map(to_moz) - } - }; - }); - - def_to_moz(AST_ClassStaticBlock, function To_Moz_StaticBlock(M) { - return { - type: "StaticBlock", - body: M.body.map(to_moz), - }; - }); - - def_to_moz(AST_NewTarget, function To_Moz_MetaProperty() { - return { - type: "MetaProperty", - meta: { - type: "Identifier", - name: "new" - }, - property: { - type: "Identifier", - name: "target" - } - }; - }); - - def_to_moz(AST_Symbol, function To_Moz_Identifier(M, parent) { - if ( - (M instanceof AST_SymbolMethod && parent.quote) || - (( - M instanceof AST_SymbolImportForeign || - M instanceof AST_SymbolExportForeign || - M instanceof AST_SymbolExport - ) && M.quote) - ) { - return { - type: "Literal", - value: M.name - }; - } - var def = M.definition(); - return { - type: "Identifier", - name: def ? def.mangled_name || def.name : M.name - }; - }); - - def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) { - const pattern = M.value.source; - const flags = M.value.flags; - return { - type: "Literal", - value: null, - raw: M.print_to_string(), - regex: { pattern, flags } - }; - }); - - def_to_moz(AST_Constant, function To_Moz_Literal(M) { - var value = M.value; - return { - type: "Literal", - value: value, - raw: M.raw || M.print_to_string() - }; - }); - - def_to_moz(AST_Atom, function To_Moz_Atom(M) { - return { - type: "Identifier", - name: String(M.value) - }; - }); - - def_to_moz(AST_BigInt, M => ({ - type: "BigIntLiteral", - value: M.value - })); - - AST_Boolean.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); - AST_Null.DEFMETHOD("to_mozilla_ast", AST_Constant.prototype.to_mozilla_ast); - AST_Hole.DEFMETHOD("to_mozilla_ast", function To_Moz_ArrayHole() { return null; }); - - AST_Block.DEFMETHOD("to_mozilla_ast", AST_BlockStatement.prototype.to_mozilla_ast); - AST_Lambda.DEFMETHOD("to_mozilla_ast", AST_Function.prototype.to_mozilla_ast); - - /* -----[ tools ]----- */ - - function my_start_token(moznode) { - var loc = moznode.loc, start = loc && loc.start; - var range = moznode.range; - return new AST_Token( - "", - "", - start && start.line || 0, - start && start.column || 0, - range ? range [0] : moznode.start, - false, - [], - [], - loc && loc.source, - ); - } - - function my_end_token(moznode) { - var loc = moznode.loc, end = loc && loc.end; - var range = moznode.range; - return new AST_Token( - "", - "", - end && end.line || 0, - end && end.column || 0, - range ? range [0] : moznode.end, - false, - [], - [], - loc && loc.source, - ); - } - - var FROM_MOZ_STACK = null; - - function from_moz(node) { - FROM_MOZ_STACK.push(node); - var ret = node != null ? MOZ_TO_ME[node.type](node) : null; - FROM_MOZ_STACK.pop(); - return ret; - } - - AST_Node.from_mozilla_ast = function(node) { - var save_stack = FROM_MOZ_STACK; - FROM_MOZ_STACK = []; - var ast = from_moz(node); - FROM_MOZ_STACK = save_stack; - return ast; - }; - - function set_moz_loc(mynode, moznode) { - var start = mynode.start; - var end = mynode.end; - if (!(start && end)) { - return moznode; - } - if (start.pos != null && end.endpos != null) { - moznode.range = [start.pos, end.endpos]; - } - if (start.line) { - moznode.loc = { - start: {line: start.line, column: start.col}, - end: end.endline ? {line: end.endline, column: end.endcol} : null - }; - if (start.file) { - moznode.loc.source = start.file; - } - } - return moznode; - } - - function def_to_moz(mytype, handler) { - mytype.DEFMETHOD("to_mozilla_ast", function(parent) { - return set_moz_loc(this, handler(this, parent)); - }); - } - - var TO_MOZ_STACK = null; - - function to_moz(node) { - if (TO_MOZ_STACK === null) { TO_MOZ_STACK = []; } - TO_MOZ_STACK.push(node); - var ast = node != null ? node.to_mozilla_ast(TO_MOZ_STACK[TO_MOZ_STACK.length - 2]) : null; - TO_MOZ_STACK.pop(); - if (TO_MOZ_STACK.length === 0) { TO_MOZ_STACK = null; } - return ast; - } - - function to_moz_in_destructuring() { - var i = TO_MOZ_STACK.length; - while (i--) { - if (TO_MOZ_STACK[i] instanceof AST_Destructuring) { - return true; - } - } - return false; - } - - function to_moz_block(node) { - return { - type: "BlockStatement", - body: node.body.map(to_moz) - }; - } - - function to_moz_scope(type, node) { - var body = node.body.map(to_moz); - if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) { - body.unshift(to_moz(new AST_EmptyStatement(node.body[0]))); - } - return { - type: type, - body: body - }; - } -})(); diff --git a/node_modules/terser/lib/output.js b/node_modules/terser/lib/output.js deleted file mode 100644 index 545f97f..0000000 --- a/node_modules/terser/lib/output.js +++ /dev/null @@ -1,2485 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -import { - defaults, - makePredicate, - noop, - regexp_source_fix, - sort_regexp_flags, - return_false, - return_true, -} from "./utils/index.js"; -import { first_in_statement, left_is_object } from "./utils/first_in_statement.js"; -import { - AST_Array, - AST_Arrow, - AST_Assign, - AST_Await, - AST_BigInt, - AST_Binary, - AST_BlockStatement, - AST_Break, - AST_Call, - AST_Case, - AST_Catch, - AST_Chain, - AST_Class, - AST_ClassExpression, - AST_ClassPrivateProperty, - AST_ClassProperty, - AST_ClassStaticBlock, - AST_ConciseMethod, - AST_PrivateGetter, - AST_PrivateMethod, - AST_SymbolPrivateProperty, - AST_PrivateSetter, - AST_PrivateIn, - AST_Conditional, - AST_Const, - AST_Constant, - AST_Continue, - AST_Debugger, - AST_Default, - AST_DefaultAssign, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DotHash, - AST_EmptyStatement, - AST_Exit, - AST_Expansion, - AST_Export, - AST_Finally, - AST_For, - AST_ForIn, - AST_ForOf, - AST_Function, - AST_Hole, - AST_If, - AST_Import, - AST_ImportMeta, - AST_Jump, - AST_LabeledStatement, - AST_Lambda, - AST_Let, - AST_LoopControl, - AST_NameMapping, - AST_New, - AST_NewTarget, - AST_Node, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PrefixedTemplateString, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Scope, - AST_Sequence, - AST_SimpleStatement, - AST_Statement, - AST_StatementWithBody, - AST_String, - AST_Sub, - AST_Super, - AST_Switch, - AST_SwitchBranch, - AST_Symbol, - AST_SymbolClassProperty, - AST_SymbolMethod, - AST_SymbolRef, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_Throw, - AST_Toplevel, - AST_Try, - AST_TryBlock, - AST_Unary, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Var, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, - TreeWalker, - walk, - walk_abort -} from "./ast.js"; -import { - get_full_char_code, - get_full_char, - is_identifier_char, - is_basic_identifier_string, - is_identifier_string, - PRECEDENCE, - ALL_RESERVED_WORDS, -} from "./parse.js"; - -const CODE_LINE_BREAK = 10; -const CODE_SPACE = 32; - -const r_annotation = /[@#]__(PURE|INLINE|NOINLINE)__/; - -function is_some_comments(comment) { - // multiline comment - return ( - (comment.type === "comment2" || comment.type === "comment1") - && /@preserve|@copyright|@lic|@cc_on|^\**!/i.test(comment.value) - ); -} - -const ROPE_COMMIT_WHEN = 8 * 1000; -class Rope { - constructor() { - this.committed = ""; - this.current = ""; - } - - append(str) { - /** When `this.current` is too long, commit it. */ - if (this.current.length > ROPE_COMMIT_WHEN) { - this.committed += this.current + str; - this.current = ""; - } else { - this.current += str; - } - } - - insertAt(char, index) { - const { committed, current } = this; - if (index < committed.length) { - this.committed = committed.slice(0, index) + char + committed.slice(index); - } else if (index === committed.length) { - this.committed += char; - } else { - index -= committed.length; - this.committed += current.slice(0, index) + char; - this.current = current.slice(index); - } - } - - charAt(index) { - const { committed } = this; - if (index < committed.length) return committed[index]; - return this.current[index - committed.length]; - } - - charCodeAt(index) { - const { committed } = this; - if (index < committed.length) return committed.charCodeAt(index); - return this.current.charCodeAt(index - committed.length); - } - - length() { - return this.committed.length + this.current.length; - } - - expectDirective() { - // /^$|[;{][\s\n]*$/ - - let ch, n = this.length(); - - if (n <= 0) return true; - - // Skip N whitespace from the end - while ( - (ch = this.charCodeAt(--n)) - && (ch == CODE_SPACE || ch == CODE_LINE_BREAK) - ); - - // either ";", or "{", or the string ended - return !ch || ch === 59 || ch === 123; - } - - hasNLB() { - let n = this.length() - 1; - while (n >= 0) { - const code = this.charCodeAt(n--); - - if (code === CODE_LINE_BREAK) return true; - if (code !== CODE_SPACE) return false; - } - return true; - } - - - toString() { - return this.committed + this.current; - } -} - -function OutputStream(options) { - - var readonly = !options; - options = defaults(options, { - ascii_only : false, - beautify : false, - braces : false, - comments : "some", - ecma : 5, - ie8 : false, - indent_level : 4, - indent_start : 0, - inline_script : true, - keep_numbers : false, - keep_quoted_props : false, - max_line_len : false, - preamble : null, - preserve_annotations : false, - quote_keys : false, - quote_style : 0, - safari10 : false, - semicolons : true, - shebang : true, - shorthand : undefined, - source_map : null, - webkit : false, - width : 80, - wrap_iife : false, - wrap_func_args : true, - - _destroy_ast : false - }, true); - - if (options.shorthand === undefined) - options.shorthand = options.ecma > 5; - - // Convert comment option to RegExp if necessary and set up comments filter - var comment_filter = return_false; // Default case, throw all comments away - if (options.comments) { - let comments = options.comments; - if (typeof options.comments === "string" && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { - var regex_pos = options.comments.lastIndexOf("/"); - comments = new RegExp( - options.comments.substr(1, regex_pos - 1), - options.comments.substr(regex_pos + 1) - ); - } - if (comments instanceof RegExp) { - comment_filter = function(comment) { - return comment.type != "comment5" && comments.test(comment.value); - }; - } else if (typeof comments === "function") { - comment_filter = function(comment) { - return comment.type != "comment5" && comments(this, comment); - }; - } else if (comments === "some") { - comment_filter = is_some_comments; - } else { // NOTE includes "all" option - comment_filter = return_true; - } - } - - if (options.preserve_annotations) { - let prev_comment_filter = comment_filter; - comment_filter = function (comment) { - return r_annotation.test(comment.value) || prev_comment_filter.apply(this, arguments); - }; - } - - var indentation = 0; - var current_col = 0; - var current_line = 1; - var current_pos = 0; - var OUTPUT = new Rope(); - let printed_comments = new Set(); - - var to_utf8 = options.ascii_only ? function(str, identifier = false, regexp = false) { - if (options.ecma >= 2015 && !options.safari10 && !regexp) { - str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { - var code = get_full_char_code(ch, 0).toString(16); - return "\\u{" + code + "}"; - }); - } - return str.replace(/[\u0000-\u001f\u007f-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - } : function(str) { - return str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) { - if (lone) { - return "\\u" + lone.charCodeAt(0).toString(16); - } - return match; - }); - }; - - function make_string(str, quote) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g, - function(s, i) { - switch (s) { - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\\": return "\\\\"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\x0B": return options.ie8 ? "\\x0B" : "\\v"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case "\ufeff": return "\\ufeff"; - case "\0": - return /[0-9]/.test(get_full_char(str, i+1)) ? "\\x00" : "\\0"; - } - return s; - }); - function quote_single() { - return "'" + str.replace(/\x27/g, "\\'") + "'"; - } - function quote_double() { - return '"' + str.replace(/\x22/g, '\\"') + '"'; - } - function quote_template() { - return "`" + str.replace(/`/g, "\\`") + "`"; - } - str = to_utf8(str); - if (quote === "`") return quote_template(); - switch (options.quote_style) { - case 1: - return quote_single(); - case 2: - return quote_double(); - case 3: - return quote == "'" ? quote_single() : quote_double(); - default: - return dq > sq ? quote_single() : quote_double(); - } - } - - function encode_string(str, quote) { - var ret = make_string(str, quote); - if (options.inline_script) { - ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2"); - ret = ret.replace(/\x3c!--/g, "\\x3c!--"); - ret = ret.replace(/--\x3e/g, "--\\x3e"); - } - return ret; - } - - function make_name(name) { - name = name.toString(); - name = to_utf8(name, true); - return name; - } - - function make_indent(back) { - return " ".repeat(options.indent_start + indentation - back * options.indent_level); - } - - /* -----[ beautification/minification ]----- */ - - var has_parens = false; - var might_need_space = false; - var might_need_semicolon = false; - var might_add_newline = 0; - var need_newline_indented = false; - var need_space = false; - var newline_insert = -1; - var last = ""; - var mapping_token, mapping_name, mappings = options.source_map && []; - - var do_add_mapping = mappings ? function() { - mappings.forEach(function(mapping) { - try { - let { name, token } = mapping; - if (name !== false) { - if (token.type == "name" || token.type === "privatename") { - name = token.value; - } else if (name instanceof AST_Symbol) { - name = token.type === "string" ? token.value : name.name; - } - } - options.source_map.add( - mapping.token.file, - mapping.line, mapping.col, - mapping.token.line, mapping.token.col, - is_basic_identifier_string(name) ? name : undefined - ); - } catch(ex) { - // Ignore bad mapping - } - }); - mappings = []; - } : noop; - - var ensure_line_len = options.max_line_len ? function() { - if (current_col > options.max_line_len) { - if (might_add_newline) { - OUTPUT.insertAt("\n", might_add_newline); - const len_after_newline = OUTPUT.length() - might_add_newline - 1; - if (mappings) { - var delta = len_after_newline - current_col; - mappings.forEach(function(mapping) { - mapping.line++; - mapping.col += delta; - }); - } - current_line++; - current_pos++; - current_col = len_after_newline; - } - } - if (might_add_newline) { - might_add_newline = 0; - do_add_mapping(); - } - } : noop; - - var requireSemicolonChars = makePredicate("( [ + * / - , . `"); - - function print(str) { - str = String(str); - var ch = get_full_char(str, 0); - if (need_newline_indented && ch) { - need_newline_indented = false; - if (ch !== "\n") { - print("\n"); - indent(); - } - } - if (need_space && ch) { - need_space = false; - if (!/[\s;})]/.test(ch)) { - space(); - } - } - newline_insert = -1; - var prev = last.charAt(last.length - 1); - if (might_need_semicolon) { - might_need_semicolon = false; - - if (prev === ":" && ch === "}" || (!ch || !";}".includes(ch)) && prev !== ";") { - if (options.semicolons || requireSemicolonChars.has(ch)) { - OUTPUT.append(";"); - current_col++; - current_pos++; - } else { - ensure_line_len(); - if (current_col > 0) { - OUTPUT.append("\n"); - current_pos++; - current_line++; - current_col = 0; - } - - if (/^\s+$/.test(str)) { - // reset the semicolon flag, since we didn't print one - // now and might still have to later - might_need_semicolon = true; - } - } - - if (!options.beautify) - might_need_space = false; - } - } - - if (might_need_space) { - if ((is_identifier_char(prev) - && (is_identifier_char(ch) || ch == "\\")) - || (ch == "/" && ch == prev) - || ((ch == "+" || ch == "-") && ch == last) - ) { - OUTPUT.append(" "); - current_col++; - current_pos++; - } - might_need_space = false; - } - - if (mapping_token) { - mappings.push({ - token: mapping_token, - name: mapping_name, - line: current_line, - col: current_col - }); - mapping_token = false; - if (!might_add_newline) do_add_mapping(); - } - - OUTPUT.append(str); - has_parens = str[str.length - 1] == "("; - current_pos += str.length; - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - current_col += a[0].length; - if (n > 0) { - ensure_line_len(); - current_col = a[n].length; - } - last = str; - } - - var star = function() { - print("*"); - }; - - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - - var indent = options.beautify ? function(half) { - if (options.beautify) { - print(make_indent(half ? 0.5 : 0)); - } - } : noop; - - var with_indent = options.beautify ? function(col, cont) { - if (col === true) col = next_indent(); - var save_indentation = indentation; - indentation = col; - var ret = cont(); - indentation = save_indentation; - return ret; - } : function(col, cont) { return cont(); }; - - var newline = options.beautify ? function() { - if (newline_insert < 0) return print("\n"); - if (OUTPUT.charAt(newline_insert) != "\n") { - OUTPUT.insertAt("\n", newline_insert); - current_pos++; - current_line++; - } - newline_insert++; - } : options.max_line_len ? function() { - ensure_line_len(); - might_add_newline = OUTPUT.length(); - } : noop; - - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - - function force_semicolon() { - might_need_semicolon = false; - print(";"); - } - - function next_indent() { - return indentation + options.indent_level; - } - - function with_block(cont) { - var ret; - print("{"); - newline(); - with_indent(next_indent(), function() { - ret = cont(); - }); - indent(); - print("}"); - return ret; - } - - function with_parens(cont) { - print("("); - //XXX: still nice to have that for argument lists - //var ret = with_indent(current_col, cont); - var ret = cont(); - print(")"); - return ret; - } - - function with_square(cont) { - print("["); - //var ret = with_indent(current_col, cont); - var ret = cont(); - print("]"); - return ret; - } - - function comma() { - print(","); - space(); - } - - function colon() { - print(":"); - space(); - } - - var add_mapping = mappings ? function(token, name) { - mapping_token = token; - mapping_name = name; - } : noop; - - function get() { - if (might_add_newline) { - ensure_line_len(); - } - return OUTPUT.toString(); - } - - function filter_comment(comment) { - if (!options.preserve_annotations) { - comment = comment.replace(r_annotation, " "); - } - if (/^\s*$/.test(comment)) { - return ""; - } - return comment.replace(/(<\s*\/\s*)(script)/i, "<\\/$2"); - } - - function prepend_comments(node) { - var self = this; - var start = node.start; - if (!start) return; - var printed_comments = self.printed_comments; - - // There cannot be a newline between return/yield and its value. - const keyword_with_value = - node instanceof AST_Exit && node.value - || (node instanceof AST_Await || node instanceof AST_Yield) - && node.expression; - - if ( - start.comments_before - && printed_comments.has(start.comments_before) - ) { - if (keyword_with_value) { - start.comments_before = []; - } else { - return; - } - } - - var comments = start.comments_before; - if (!comments) { - comments = start.comments_before = []; - } - printed_comments.add(comments); - - if (keyword_with_value) { - var tw = new TreeWalker(function(node) { - var parent = tw.parent(); - if (parent instanceof AST_Exit - || parent instanceof AST_Await - || parent instanceof AST_Yield - || parent instanceof AST_Binary && parent.left === node - || parent.TYPE == "Call" && parent.expression === node - || parent instanceof AST_Conditional && parent.condition === node - || parent instanceof AST_Dot && parent.expression === node - || parent instanceof AST_Sequence && parent.expressions[0] === node - || parent instanceof AST_Sub && parent.expression === node - || parent instanceof AST_UnaryPostfix) { - if (!node.start) return; - var text = node.start.comments_before; - if (text && !printed_comments.has(text)) { - printed_comments.add(text); - comments = comments.concat(text); - } - } else { - return true; - } - }); - tw.push(node); - keyword_with_value.walk(tw); - } - - if (current_pos == 0) { - if (comments.length > 0 && options.shebang && comments[0].type === "comment5" - && !printed_comments.has(comments[0])) { - print("#!" + comments.shift().value + "\n"); - indent(); - } - var preamble = options.preamble; - if (preamble) { - print(preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n")); - } - } - - comments = comments.filter(comment_filter, node).filter(c => !printed_comments.has(c)); - if (comments.length == 0) return; - var last_nlb = OUTPUT.hasNLB(); - comments.forEach(function(c, i) { - printed_comments.add(c); - if (!last_nlb) { - if (c.nlb) { - print("\n"); - indent(); - last_nlb = true; - } else if (i > 0) { - space(); - } - } - - if (/comment[134]/.test(c.type)) { - var value = filter_comment(c.value); - if (value) { - print("//" + value + "\n"); - indent(); - } - last_nlb = true; - } else if (c.type == "comment2") { - var value = filter_comment(c.value); - if (value) { - print("/*" + value + "*/"); - } - last_nlb = false; - } - }); - if (!last_nlb) { - if (start.nlb) { - print("\n"); - indent(); - } else { - space(); - } - } - } - - function append_comments(node, tail) { - var self = this; - var token = node.end; - if (!token) return; - var printed_comments = self.printed_comments; - var comments = token[tail ? "comments_before" : "comments_after"]; - if (!comments || printed_comments.has(comments)) return; - if (!(node instanceof AST_Statement || comments.every((c) => - !/comment[134]/.test(c.type) - ))) return; - printed_comments.add(comments); - var insert = OUTPUT.length(); - comments.filter(comment_filter, node).forEach(function(c, i) { - if (printed_comments.has(c)) return; - printed_comments.add(c); - need_space = false; - if (need_newline_indented) { - print("\n"); - indent(); - need_newline_indented = false; - } else if (c.nlb && (i > 0 || !OUTPUT.hasNLB())) { - print("\n"); - indent(); - } else if (i > 0 || !tail) { - space(); - } - if (/comment[134]/.test(c.type)) { - const value = filter_comment(c.value); - if (value) { - print("//" + value); - } - need_newline_indented = true; - } else if (c.type == "comment2") { - const value = filter_comment(c.value); - if (value) { - print("/*" + value + "*/"); - } - need_space = true; - } - }); - if (OUTPUT.length() > insert) newline_insert = insert; - } - - /** - * When output.option("_destroy_ast") is enabled, destroy the function. - * Call this after printing it. - */ - const gc_scope = - options["_destroy_ast"] - ? function gc_scope(scope) { - scope.body.length = 0; - scope.argnames.length = 0; - } - : noop; - - var stack = []; - return { - get : get, - toString : get, - indent : indent, - in_directive : false, - use_asm : null, - active_scope : null, - indentation : function() { return indentation; }, - current_width : function() { return current_col - indentation; }, - should_break : function() { return options.width && this.current_width() >= options.width; }, - has_parens : function() { return has_parens; }, - newline : newline, - print : print, - star : star, - space : space, - comma : comma, - colon : colon, - last : function() { return last; }, - semicolon : semicolon, - force_semicolon : force_semicolon, - to_utf8 : to_utf8, - print_name : function(name) { print(make_name(name)); }, - print_string : function(str, quote, escape_directive) { - var encoded = encode_string(str, quote); - if (escape_directive === true && !encoded.includes("\\")) { - // Insert semicolons to break directive prologue - if (!OUTPUT.expectDirective()) { - force_semicolon(); - } - force_semicolon(); - } - print(encoded); - }, - print_template_string_chars: function(str) { - var encoded = encode_string(str, "`").replace(/\${/g, "\\${"); - return print(encoded.substr(1, encoded.length - 2)); - }, - encode_string : encode_string, - next_indent : next_indent, - with_indent : with_indent, - with_block : with_block, - with_parens : with_parens, - with_square : with_square, - add_mapping : add_mapping, - option : function(opt) { return options[opt]; }, - gc_scope, - printed_comments: printed_comments, - prepend_comments: readonly ? noop : prepend_comments, - append_comments : readonly || comment_filter === return_false ? noop : append_comments, - line : function() { return current_line; }, - col : function() { return current_col; }, - pos : function() { return current_pos; }, - push_node : function(node) { stack.push(node); }, - pop_node : function() { return stack.pop(); }, - parent : function(n) { - return stack[stack.length - 2 - (n || 0)]; - } - }; - -} - -/* -----[ code generators ]----- */ - -(function() { - - /* -----[ utils ]----- */ - - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - } - - AST_Node.DEFMETHOD("print", function(output, force_parens) { - var self = this, generator = self._codegen; - if (self instanceof AST_Scope) { - output.active_scope = self; - } else if (!output.use_asm && self instanceof AST_Directive && self.value == "use asm") { - output.use_asm = output.active_scope; - } - function doit() { - output.prepend_comments(self); - self.add_source_map(output); - generator(self, output); - output.append_comments(self); - } - output.push_node(self); - if (force_parens || self.needs_parens(output)) { - output.with_parens(doit); - } else { - doit(); - } - output.pop_node(); - if (self === output.use_asm) { - output.use_asm = null; - } - }); - AST_Node.DEFMETHOD("_print", AST_Node.prototype.print); - - AST_Node.DEFMETHOD("print_to_string", function(options) { - var output = OutputStream(options); - this.print(output); - return output.get(); - }); - - /* -----[ PARENTHESES ]----- */ - - function PARENS(nodetype, func) { - if (Array.isArray(nodetype)) { - nodetype.forEach(function(nodetype) { - PARENS(nodetype, func); - }); - } else { - nodetype.DEFMETHOD("needs_parens", func); - } - } - - PARENS(AST_Node, return_false); - - // a function expression needs parens around it when it's provably - // the first token to appear in a statement. - PARENS(AST_Function, function(output) { - if (!output.has_parens() && first_in_statement(output)) { - return true; - } - - if (output.option("webkit")) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - return true; - } - } - - if (output.option("wrap_iife")) { - var p = output.parent(); - if (p instanceof AST_Call && p.expression === this) { - return true; - } - } - - if (output.option("wrap_func_args")) { - var p = output.parent(); - if (p instanceof AST_Call && p.args.includes(this)) { - return true; - } - } - - return false; - }); - - PARENS(AST_Arrow, function(output) { - var p = output.parent(); - - if ( - output.option("wrap_func_args") - && p instanceof AST_Call - && p.args.includes(this) - ) { - return true; - } - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Conditional && p.condition === this; - }); - - // same goes for an object literal (as in AST_Function), because - // otherwise {...} would be interpreted as a block of code. - PARENS(AST_Object, function(output) { - return !output.has_parens() && first_in_statement(output); - }); - - PARENS(AST_ClassExpression, first_in_statement); - - PARENS(AST_Unary, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Call && p.expression === this - || p instanceof AST_Binary - && p.operator === "**" - && this instanceof AST_UnaryPrefix - && p.left === this - && this.operator !== "++" - && this.operator !== "--"; - }); - - PARENS(AST_Await, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this - || p instanceof AST_Call && p.expression === this - || p instanceof AST_Binary && p.operator === "**" && p.left === this - || output.option("safari10") && p instanceof AST_UnaryPrefix; - }); - - PARENS(AST_Sequence, function(output) { - var p = output.parent(); - return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) - || p instanceof AST_Unary // !(foo, bar, baz) - || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8 - || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 - || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2 - || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] - || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 - || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) - * ==> 20 (side effect, set a := 10 and b := 20) */ - || p instanceof AST_Arrow // x => (x, x) - || p instanceof AST_DefaultAssign // x => (x = (0, function(){})) - || p instanceof AST_Expansion // [...(a, b)] - || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {} - || p instanceof AST_Yield // yield (foo, bar) - || p instanceof AST_Export // export default (foo, bar) - ; - }); - - PARENS(AST_Binary, function(output) { - var p = output.parent(); - // (foo && bar)() - if (p instanceof AST_Call && p.expression === this) - return true; - // typeof (foo && bar) - if (p instanceof AST_Unary) - return true; - // (foo && bar)["prop"], (foo && bar).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // this deals with precedence: 3 * (2 + 1) - if (p instanceof AST_Binary) { - const po = p.operator; - const so = this.operator; - - if (so === "??" && (po === "||" || po === "&&")) { - return true; - } - - if (po === "??" && (so === "||" || so === "&&")) { - return true; - } - - const pp = PRECEDENCE[po]; - const sp = PRECEDENCE[so]; - if (pp > sp - || (pp == sp - && (this === p.right || po == "**"))) { - return true; - } - } - }); - - PARENS(AST_Yield, function(output) { - var p = output.parent(); - // (yield 1) + (yield 2) - // a = yield 3 - if (p instanceof AST_Binary && p.operator !== "=") - return true; - // (yield 1)() - // new (yield 1)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (yield 1) ? yield 2 : yield 3 - if (p instanceof AST_Conditional && p.condition === this) - return true; - // -(yield 4) - if (p instanceof AST_Unary) - return true; - // (yield x).foo - // (yield x)['foo'] - if (p instanceof AST_PropAccess && p.expression === this) - return true; - }); - - PARENS(AST_Chain, function(output) { - var p = output.parent(); - if (!(p instanceof AST_Call || p instanceof AST_PropAccess)) return false; - return p.expression === this; - }); - - PARENS(AST_PropAccess, function(output) { - var p = output.parent(); - if (p instanceof AST_New && p.expression === this) { - // i.e. new (foo.bar().baz) - // - // if there's one call into this subtree, then we need - // parens around it too, otherwise the call will be - // interpreted as passing the arguments to the upper New - // expression. - return walk(this, node => { - if (node instanceof AST_Scope) return true; - if (node instanceof AST_Call) { - return walk_abort; // makes walk() return true. - } - }); - } - }); - - PARENS(AST_Call, function(output) { - var p = output.parent(), p1; - if (p instanceof AST_New && p.expression === this - || p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function) - return true; - - // workaround for Safari bug. - // https://bugs.webkit.org/show_bug.cgi?id=123506 - return this.expression instanceof AST_Function - && p instanceof AST_PropAccess - && p.expression === this - && (p1 = output.parent(1)) instanceof AST_Assign - && p1.left === p; - }); - - PARENS(AST_New, function(output) { - var p = output.parent(); - if (this.args.length === 0 - && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() - || p instanceof AST_Call && p.expression === this - || p instanceof AST_PrefixedTemplateString && p.prefix === this)) // (new foo)(bar) - return true; - }); - - PARENS(AST_Number, function(output) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value < 0 || /^0/.test(make_num(value))) { - return true; - } - } - }); - - PARENS(AST_BigInt, function(output) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) { - var value = this.getValue(); - if (value.startsWith("-")) { - return true; - } - } - }); - - PARENS([ AST_Assign, AST_Conditional ], function(output) { - var p = output.parent(); - // !(a = false) → true - if (p instanceof AST_Unary) - return true; - // 1 + (a = 2) + 3 → 6, side effect setting a = 2 - if (p instanceof AST_Binary && !(p instanceof AST_Assign)) - return true; - // (a = func)() —or— new (a = Object)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (a = foo) ? bar : baz - if (p instanceof AST_Conditional && p.condition === this) - return true; - // (a = foo)["prop"] —or— (a = foo).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // ({a, b} = {a: 1, b: 2}), a destructuring assignment - if (this instanceof AST_Assign && this.left instanceof AST_Destructuring && this.left.is_array === false) - return true; - }); - - /* -----[ PRINTERS ]----- */ - - DEFPRINT(AST_Directive, function(self, output) { - output.print_string(self.value, self.quote); - output.semicolon(); - }); - - DEFPRINT(AST_Expansion, function (self, output) { - output.print("..."); - self.expression.print(output); - }); - - DEFPRINT(AST_Destructuring, function (self, output) { - output.print(self.is_array ? "[" : "{"); - var len = self.names.length; - self.names.forEach(function (name, i) { - if (i > 0) output.comma(); - name.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i == len - 1 && name instanceof AST_Hole) output.comma(); - }); - output.print(self.is_array ? "]" : "}"); - }); - - DEFPRINT(AST_Debugger, function(self, output) { - output.print("debugger"); - output.semicolon(); - }); - - /* -----[ statements ]----- */ - - function display_body(body, is_toplevel, output, allow_directives) { - var last = body.length - 1; - output.in_directive = allow_directives; - body.forEach(function(stmt, i) { - if (output.in_directive === true && !(stmt instanceof AST_Directive || - stmt instanceof AST_EmptyStatement || - (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String) - )) { - output.in_directive = false; - } - if (!(stmt instanceof AST_EmptyStatement)) { - output.indent(); - stmt.print(output); - if (!(i == last && is_toplevel)) { - output.newline(); - if (is_toplevel) output.newline(); - } - } - if (output.in_directive === true && - stmt instanceof AST_SimpleStatement && - stmt.body instanceof AST_String - ) { - output.in_directive = false; - } - }); - output.in_directive = false; - } - - AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { - print_maybe_braced_body(this.body, output); - }); - - DEFPRINT(AST_Statement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - DEFPRINT(AST_Toplevel, function(self, output) { - display_body(self.body, true, output, true); - output.print(""); - }); - DEFPRINT(AST_LabeledStatement, function(self, output) { - self.label.print(output); - output.colon(); - self.body.print(output); - }); - DEFPRINT(AST_SimpleStatement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - function print_braced_empty(self, output) { - output.print("{"); - output.with_indent(output.next_indent(), function() { - output.append_comments(self, true); - }); - output.add_mapping(self.end); - output.print("}"); - } - function print_braced(self, output, allow_directives) { - if (self.body.length > 0) { - output.with_block(function() { - display_body(self.body, false, output, allow_directives); - output.add_mapping(self.end); - }); - } else print_braced_empty(self, output); - } - DEFPRINT(AST_BlockStatement, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(AST_EmptyStatement, function(self, output) { - output.semicolon(); - }); - DEFPRINT(AST_Do, function(self, output) { - output.print("do"); - output.space(); - make_block(self.body, output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(AST_While, function(self, output) { - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_For, function(self, output) { - output.print("for"); - output.space(); - output.with_parens(function() { - if (self.init) { - if (self.init instanceof AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_noin(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_ForIn, function(self, output) { - output.print("for"); - if (self.await) { - output.space(); - output.print("await"); - } - output.space(); - output.with_parens(function() { - self.init.print(output); - output.space(); - output.print(self instanceof AST_ForOf ? "of" : "in"); - output.space(); - self.object.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_With, function(self, output) { - output.print("with"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - self._do_print_body(output); - }); - - /* -----[ functions ]----- */ - AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { - var self = this; - if (!nokeyword) { - if (self.async) { - output.print("async"); - output.space(); - } - output.print("function"); - if (self.is_generator) { - output.star(); - } - if (self.name) { - output.space(); - } - } - if (self.name instanceof AST_Symbol) { - self.name.print(output); - } else if (nokeyword && self.name instanceof AST_Node) { - output.with_square(function() { - self.name.print(output); // Computed method name - }); - } - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - output.space(); - print_braced(self, output, true); - }); - DEFPRINT(AST_Lambda, function(self, output) { - self._do_print(output); - output.gc_scope(self); - }); - - DEFPRINT(AST_PrefixedTemplateString, function(self, output) { - var tag = self.prefix; - var parenthesize_tag = tag instanceof AST_Lambda - || tag instanceof AST_Binary - || tag instanceof AST_Conditional - || tag instanceof AST_Sequence - || tag instanceof AST_Unary - || tag instanceof AST_Dot && tag.expression instanceof AST_Object; - if (parenthesize_tag) output.print("("); - self.prefix.print(output); - if (parenthesize_tag) output.print(")"); - self.template_string.print(output); - }); - DEFPRINT(AST_TemplateString, function(self, output) { - var is_tagged = output.parent() instanceof AST_PrefixedTemplateString; - - output.print("`"); - for (var i = 0; i < self.segments.length; i++) { - if (!(self.segments[i] instanceof AST_TemplateSegment)) { - output.print("${"); - self.segments[i].print(output); - output.print("}"); - } else if (is_tagged) { - output.print(self.segments[i].raw); - } else { - output.print_template_string_chars(self.segments[i].value); - } - } - output.print("`"); - }); - DEFPRINT(AST_TemplateSegment, function(self, output) { - output.print_template_string_chars(self.value); - }); - - AST_Arrow.DEFMETHOD("_do_print", function(output) { - var self = this; - var parent = output.parent(); - var needs_parens = (parent instanceof AST_Binary && !(parent instanceof AST_Assign)) || - parent instanceof AST_Unary || - (parent instanceof AST_Call && self === parent.expression); - if (needs_parens) { output.print("("); } - if (self.async) { - output.print("async"); - output.space(); - } - if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) { - self.argnames[0].print(output); - } else { - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - } - output.space(); - output.print("=>"); - output.space(); - const first_statement = self.body[0]; - if ( - self.body.length === 1 - && first_statement instanceof AST_Return - ) { - const returned = first_statement.value; - if (!returned) { - output.print("{}"); - } else if (left_is_object(returned)) { - output.print("("); - returned.print(output); - output.print(")"); - } else { - returned.print(output); - } - } else { - print_braced(self, output); - } - if (needs_parens) { output.print(")"); } - output.gc_scope(self); - }); - - /* -----[ exits ]----- */ - AST_Exit.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.value) { - output.space(); - const comments = this.value.start.comments_before; - if (comments && comments.length && !output.printed_comments.has(comments)) { - output.print("("); - this.value.print(output); - output.print(")"); - } else { - this.value.print(output); - } - } - output.semicolon(); - }); - DEFPRINT(AST_Return, function(self, output) { - self._do_print(output, "return"); - }); - DEFPRINT(AST_Throw, function(self, output) { - self._do_print(output, "throw"); - }); - - /* -----[ yield ]----- */ - - DEFPRINT(AST_Yield, function(self, output) { - var star = self.is_star ? "*" : ""; - output.print("yield" + star); - if (self.expression) { - output.space(); - self.expression.print(output); - } - }); - - DEFPRINT(AST_Await, function(self, output) { - output.print("await"); - output.space(); - var e = self.expression; - var parens = !( - e instanceof AST_Call - || e instanceof AST_SymbolRef - || e instanceof AST_PropAccess - || e instanceof AST_Unary - || e instanceof AST_Constant - || e instanceof AST_Await - || e instanceof AST_Object - ); - if (parens) output.print("("); - self.expression.print(output); - if (parens) output.print(")"); - }); - - /* -----[ loop control ]----- */ - AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.label) { - output.space(); - this.label.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Break, function(self, output) { - self._do_print(output, "break"); - }); - DEFPRINT(AST_Continue, function(self, output) { - self._do_print(output, "continue"); - }); - - /* -----[ if ]----- */ - function make_then(self, output) { - var b = self.body; - if (output.option("braces") - || output.option("ie8") && b instanceof AST_Do) - return make_block(b, output); - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block braces if needed. - if (!b) return output.force_semicolon(); - while (true) { - if (b instanceof AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } else if (b instanceof AST_StatementWithBody) { - b = b.body; - } else break; - } - print_maybe_braced_body(self.body, output); - } - DEFPRINT(AST_If, function(self, output) { - output.print("if"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - output.space(); - if (self.alternative instanceof AST_If) - self.alternative.print(output); - else - print_maybe_braced_body(self.alternative, output); - } else { - self._do_print_body(output); - } - }); - - /* -----[ switch ]----- */ - DEFPRINT(AST_Switch, function(self, output) { - output.print("switch"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - var last = self.body.length - 1; - if (last < 0) print_braced_empty(self, output); - else output.with_block(function() { - self.body.forEach(function(branch, i) { - output.indent(true); - branch.print(output); - if (i < last && branch.body.length > 0) - output.newline(); - }); - }); - }); - AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { - output.newline(); - this.body.forEach(function(stmt) { - output.indent(); - stmt.print(output); - output.newline(); - }); - }); - DEFPRINT(AST_Default, function(self, output) { - output.print("default:"); - self._do_print_body(output); - }); - DEFPRINT(AST_Case, function(self, output) { - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - self._do_print_body(output); - }); - - /* -----[ exceptions ]----- */ - DEFPRINT(AST_Try, function(self, output) { - output.print("try"); - output.space(); - self.body.print(output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(AST_TryBlock, function(self, output) { - print_braced(self, output); - }); - DEFPRINT(AST_Catch, function(self, output) { - output.print("catch"); - if (self.argname) { - output.space(); - output.with_parens(function() { - self.argname.print(output); - }); - } - output.space(); - print_braced(self, output); - }); - DEFPRINT(AST_Finally, function(self, output) { - output.print("finally"); - output.space(); - print_braced(self, output); - }); - - /* -----[ var/const ]----- */ - AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - output.space(); - this.definitions.forEach(function(def, i) { - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - var in_for = p instanceof AST_For || p instanceof AST_ForIn; - var output_semicolon = !in_for || p && p.init !== this; - if (output_semicolon) - output.semicolon(); - }); - DEFPRINT(AST_Let, function(self, output) { - self._do_print(output, "let"); - }); - DEFPRINT(AST_Var, function(self, output) { - self._do_print(output, "var"); - }); - DEFPRINT(AST_Const, function(self, output) { - self._do_print(output, "const"); - }); - DEFPRINT(AST_Import, function(self, output) { - output.print("import"); - output.space(); - if (self.imported_name) { - self.imported_name.print(output); - } - if (self.imported_name && self.imported_names) { - output.print(","); - output.space(); - } - if (self.imported_names) { - if (self.imported_names.length === 1 && - self.imported_names[0].foreign_name.name === "*" && - !self.imported_names[0].foreign_name.quote) { - self.imported_names[0].print(output); - } else { - output.print("{"); - self.imported_names.forEach(function (name_import, i) { - output.space(); - name_import.print(output); - if (i < self.imported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } - if (self.imported_name || self.imported_names) { - output.space(); - output.print("from"); - output.space(); - } - self.module_name.print(output); - if (self.assert_clause) { - output.print("assert"); - self.assert_clause.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_ImportMeta, function(self, output) { - output.print("import.meta"); - }); - - DEFPRINT(AST_NameMapping, function(self, output) { - var is_import = output.parent() instanceof AST_Import; - var definition = self.name.definition(); - var foreign_name = self.foreign_name; - var names_are_different = - (definition && definition.mangled_name || self.name.name) !== - foreign_name.name; - if (!names_are_different && - foreign_name.name === "*" && - foreign_name.quote != self.name.quote) { - // export * as "*" - names_are_different = true; - } - var foreign_name_is_name = foreign_name.quote == null; - if (names_are_different) { - if (is_import) { - if (foreign_name_is_name) { - output.print(foreign_name.name); - } else { - output.print_string(foreign_name.name, foreign_name.quote); - } - } else { - if (self.name.quote == null) { - self.name.print(output); - } else { - output.print_string(self.name.name, self.name.quote); - } - - } - output.space(); - output.print("as"); - output.space(); - if (is_import) { - self.name.print(output); - } else { - if (foreign_name_is_name) { - output.print(foreign_name.name); - } else { - output.print_string(foreign_name.name, foreign_name.quote); - } - } - } else { - if (self.name.quote == null) { - self.name.print(output); - } else { - output.print_string(self.name.name, self.name.quote); - } - } - }); - - DEFPRINT(AST_Export, function(self, output) { - output.print("export"); - output.space(); - if (self.is_default) { - output.print("default"); - output.space(); - } - if (self.exported_names) { - if (self.exported_names.length === 1 && - self.exported_names[0].name.name === "*" && - !self.exported_names[0].name.quote) { - self.exported_names[0].print(output); - } else { - output.print("{"); - self.exported_names.forEach(function(name_export, i) { - output.space(); - name_export.print(output); - if (i < self.exported_names.length - 1) { - output.print(","); - } - }); - output.space(); - output.print("}"); - } - } else if (self.exported_value) { - self.exported_value.print(output); - } else if (self.exported_definition) { - self.exported_definition.print(output); - if (self.exported_definition instanceof AST_Definitions) return; - } - if (self.module_name) { - output.space(); - output.print("from"); - output.space(); - self.module_name.print(output); - } - if (self.assert_clause) { - output.print("assert"); - self.assert_clause.print(output); - } - if (self.exported_value - && !(self.exported_value instanceof AST_Defun || - self.exported_value instanceof AST_Function || - self.exported_value instanceof AST_Class) - || self.module_name - || self.exported_names - ) { - output.semicolon(); - } - }); - - function parenthesize_for_noin(node, output, noin) { - var parens = false; - // need to take some precautions here: - // https://github.com/mishoo/UglifyJS2/issues/60 - if (noin) { - parens = walk(node, node => { - // Don't go into scopes -- except arrow functions: - // https://github.com/terser/terser/issues/1019#issuecomment-877642607 - if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) { - return true; - } - if ( - node instanceof AST_Binary && node.operator == "in" - || node instanceof AST_PrivateIn - ) { - return walk_abort; // makes walk() return true - } - }); - } - node.print(output, parens); - } - - DEFPRINT(AST_VarDef, function(self, output) { - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var noin = p instanceof AST_For || p instanceof AST_ForIn; - parenthesize_for_noin(self.value, output, noin); - } - }); - - /* -----[ other expressions ]----- */ - DEFPRINT(AST_Call, function(self, output) { - self.expression.print(output); - if (self instanceof AST_New && self.args.length === 0) - return; - if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) { - output.add_mapping(self.start); - } - if (self.optional) output.print("?."); - output.with_parens(function() { - self.args.forEach(function(expr, i) { - if (i) output.comma(); - expr.print(output); - }); - }); - }); - DEFPRINT(AST_New, function(self, output) { - output.print("new"); - output.space(); - AST_Call.prototype._codegen(self, output); - }); - - AST_Sequence.DEFMETHOD("_do_print", function(output) { - this.expressions.forEach(function(node, index) { - if (index > 0) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - } - node.print(output); - }); - }); - DEFPRINT(AST_Sequence, function(self, output) { - self._do_print(output); - // var p = output.parent(); - // if (p instanceof AST_Statement) { - // output.with_indent(output.next_indent(), function(){ - // self._do_print(output); - // }); - // } else { - // self._do_print(output); - // } - }); - DEFPRINT(AST_Dot, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - var print_computed = ALL_RESERVED_WORDS.has(prop) - ? output.option("ie8") - : !is_identifier_string( - prop, - output.option("ecma") >= 2015 && !output.option("safari10") - ); - - if (self.optional) output.print("?."); - - if (print_computed) { - output.print("["); - output.add_mapping(self.end); - output.print_string(prop); - output.print("]"); - } else { - if (expr instanceof AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.)]/i.test(output.last())) { - output.print("."); - } - } - if (!self.optional) output.print("."); - // the name after dot would be mapped about here. - output.add_mapping(self.end); - output.print_name(prop); - } - }); - DEFPRINT(AST_DotHash, function(self, output) { - var expr = self.expression; - expr.print(output); - var prop = self.property; - - if (self.optional) output.print("?"); - output.print(".#"); - output.add_mapping(self.end); - output.print_name(prop); - }); - DEFPRINT(AST_Sub, function(self, output) { - self.expression.print(output); - if (self.optional) output.print("?."); - output.print("["); - self.property.print(output); - output.print("]"); - }); - DEFPRINT(AST_Chain, function(self, output) { - self.expression.print(output); - }); - DEFPRINT(AST_UnaryPrefix, function(self, output) { - var op = self.operator; - if (op === "--" && output.last().endsWith("!")) { - // avoid printing " - output.print(" "); - } else { - // the space is optional depending on "beautify" - output.space(); - } - output.print(op); - output.space(); - self.right.print(output); - }); - DEFPRINT(AST_Conditional, function(self, output) { - self.condition.print(output); - output.space(); - output.print("?"); - output.space(); - self.consequent.print(output); - output.space(); - output.colon(); - self.alternative.print(output); - }); - - /* -----[ literals ]----- */ - DEFPRINT(AST_Array, function(self, output) { - output.with_square(function() { - var a = self.elements, len = a.length; - if (len > 0) output.space(); - a.forEach(function(exp, i) { - if (i) output.comma(); - exp.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i === len - 1 && exp instanceof AST_Hole) - output.comma(); - }); - if (len > 0) output.space(); - }); - }); - DEFPRINT(AST_Object, function(self, output) { - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else print_braced_empty(self, output); - }); - DEFPRINT(AST_Class, function(self, output) { - output.print("class"); - output.space(); - if (self.name) { - self.name.print(output); - output.space(); - } - if (self.extends) { - var parens = ( - !(self.extends instanceof AST_SymbolRef) - && !(self.extends instanceof AST_PropAccess) - && !(self.extends instanceof AST_ClassExpression) - && !(self.extends instanceof AST_Function) - ); - output.print("extends"); - if (parens) { - output.print("("); - } else { - output.space(); - } - self.extends.print(output); - if (parens) { - output.print(")"); - } else { - output.space(); - } - } - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else output.print("{}"); - }); - DEFPRINT(AST_NewTarget, function(self, output) { - output.print("new.target"); - }); - - /** Prints a prop name. Returns whether it can be used as a shorthand. */ - function print_property_name(key, quote, output) { - if (output.option("quote_keys")) { - output.print_string(key); - return false; - } - if ("" + +key == key && key >= 0) { - if (output.option("keep_numbers")) { - output.print(key); - return false; - } - output.print(make_num(key)); - return false; - } - var print_string = ALL_RESERVED_WORDS.has(key) - ? output.option("ie8") - : ( - output.option("ecma") < 2015 || output.option("safari10") - ? !is_basic_identifier_string(key) - : !is_identifier_string(key, true) - ); - if (print_string || (quote && output.option("keep_quoted_props"))) { - output.print_string(key, quote); - return false; - } - output.print_name(key); - return true; - } - - DEFPRINT(AST_ObjectKeyVal, function(self, output) { - function get_name(self) { - var def = self.definition(); - return def ? def.mangled_name || def.name : self.name; - } - - const try_shorthand = output.option("shorthand") && !(self.key instanceof AST_Node); - if ( - try_shorthand - && self.value instanceof AST_Symbol - && get_name(self.value) === self.key - && !ALL_RESERVED_WORDS.has(self.key) - ) { - const was_shorthand = print_property_name(self.key, self.quote, output); - if (!was_shorthand) { - output.colon(); - self.value.print(output); - } - } else if ( - try_shorthand - && self.value instanceof AST_DefaultAssign - && self.value.left instanceof AST_Symbol - && get_name(self.value.left) === self.key - ) { - const was_shorthand = print_property_name(self.key, self.quote, output); - if (!was_shorthand) { - output.colon(); - self.value.left.print(output); - } - output.space(); - output.print("="); - output.space(); - self.value.right.print(output); - } else { - if (!(self.key instanceof AST_Node)) { - print_property_name(self.key, self.quote, output); - } else { - output.with_square(function() { - self.key.print(output); - }); - } - output.colon(); - self.value.print(output); - } - }); - DEFPRINT(AST_ClassPrivateProperty, (self, output) => { - if (self.static) { - output.print("static"); - output.space(); - } - - output.print("#"); - - print_property_name(self.key.name, self.quote, output); - - if (self.value) { - output.print("="); - self.value.print(output); - } - - output.semicolon(); - }); - DEFPRINT(AST_ClassProperty, (self, output) => { - if (self.static) { - output.print("static"); - output.space(); - } - - if (self.key instanceof AST_SymbolClassProperty) { - print_property_name(self.key.name, self.quote, output); - } else { - output.print("["); - self.key.print(output); - output.print("]"); - } - - if (self.value) { - output.print("="); - self.value.print(output); - } - - output.semicolon(); - }); - AST_ObjectProperty.DEFMETHOD("_print_getter_setter", function(type, is_private, output) { - var self = this; - if (self.static) { - output.print("static"); - output.space(); - } - if (type) { - output.print(type); - output.space(); - } - if (self.key instanceof AST_SymbolMethod) { - if (is_private) output.print("#"); - print_property_name(self.key.name, self.quote, output); - self.key.add_source_map(output); - } else { - output.with_square(function() { - self.key.print(output); - }); - } - self.value._do_print(output, true); - }); - DEFPRINT(AST_ObjectSetter, function(self, output) { - self._print_getter_setter("set", false, output); - }); - DEFPRINT(AST_ObjectGetter, function(self, output) { - self._print_getter_setter("get", false, output); - }); - DEFPRINT(AST_PrivateSetter, function(self, output) { - self._print_getter_setter("set", true, output); - }); - DEFPRINT(AST_PrivateGetter, function(self, output) { - self._print_getter_setter("get", true, output); - }); - DEFPRINT(AST_PrivateMethod, function(self, output) { - var type; - if (self.is_generator && self.async) { - type = "async*"; - } else if (self.is_generator) { - type = "*"; - } else if (self.async) { - type = "async"; - } - self._print_getter_setter(type, true, output); - }); - DEFPRINT(AST_PrivateIn, function(self, output) { - self.key.print(output); - output.space(); - output.print("in"); - output.space(); - self.value.print(output); - }); - DEFPRINT(AST_SymbolPrivateProperty, function(self, output) { - output.print("#" + self.name); - }); - DEFPRINT(AST_ConciseMethod, function(self, output) { - var type; - if (self.is_generator && self.async) { - type = "async*"; - } else if (self.is_generator) { - type = "*"; - } else if (self.async) { - type = "async"; - } - self._print_getter_setter(type, false, output); - }); - DEFPRINT(AST_ClassStaticBlock, function (self, output) { - output.print("static"); - output.space(); - print_braced(self, output); - }); - AST_Symbol.DEFMETHOD("_do_print", function(output) { - var def = this.definition(); - output.print_name(def ? def.mangled_name || def.name : this.name); - }); - DEFPRINT(AST_Symbol, function (self, output) { - self._do_print(output); - }); - DEFPRINT(AST_Hole, noop); - DEFPRINT(AST_This, function(self, output) { - output.print("this"); - }); - DEFPRINT(AST_Super, function(self, output) { - output.print("super"); - }); - DEFPRINT(AST_Constant, function(self, output) { - output.print(self.getValue()); - }); - DEFPRINT(AST_String, function(self, output) { - output.print_string(self.getValue(), self.quote, output.in_directive); - }); - DEFPRINT(AST_Number, function(self, output) { - if ((output.option("keep_numbers") || output.use_asm) && self.raw) { - output.print(self.raw); - } else { - output.print(make_num(self.getValue())); - } - }); - DEFPRINT(AST_BigInt, function(self, output) { - output.print(self.getValue() + "n"); - }); - - const r_slash_script = /(<\s*\/\s*script)/i; - const r_starts_with_script = /^\s*script/i; - const slash_script_replace = (_, $1) => $1.replace("/", "\\/"); - DEFPRINT(AST_RegExp, function(self, output) { - let { source, flags } = self.getValue(); - source = regexp_source_fix(source); - flags = flags ? sort_regexp_flags(flags) : ""; - - // Avoid outputting end of script tag - source = source.replace(r_slash_script, slash_script_replace); - if (r_starts_with_script.test(source) && output.last().endsWith("<")) { - output.print(" "); - } - - output.print(output.to_utf8(`/${source}/${flags}`, false, true)); - - const parent = output.parent(); - if ( - parent instanceof AST_Binary - && /^\w/.test(parent.operator) - && parent.left === self - ) { - output.print(" "); - } - }); - - /** if, for, while, may or may not have braces surrounding its body */ - function print_maybe_braced_body(stat, output) { - if (output.option("braces")) { - make_block(stat, output); - } else { - if (!stat || stat instanceof AST_EmptyStatement) - output.force_semicolon(); - else if (stat instanceof AST_Let || stat instanceof AST_Const || stat instanceof AST_Class) - make_block(stat, output); - else - stat.print(output); - } - } - - function best_of(a) { - var best = a[0], len = best.length; - for (var i = 1; i < a.length; ++i) { - if (a[i].length < len) { - best = a[i]; - len = best.length; - } - } - return best; - } - - function make_num(num) { - var str = num.toString(10).replace(/^0\./, ".").replace("e+", "e"); - var candidates = [ str ]; - if (Math.floor(num) === num) { - if (num < 0) { - candidates.push("-0x" + (-num).toString(16).toLowerCase()); - } else { - candidates.push("0x" + num.toString(16).toLowerCase()); - } - } - var match, len, digits; - if (match = /^\.0+/.exec(str)) { - len = match[0].length; - digits = str.slice(len); - candidates.push(digits + "e-" + (digits.length + len - 1)); - } else if (match = /0+$/.exec(str)) { - len = match[0].length; - candidates.push(str.slice(0, -len) + "e" + len); - } else if (match = /^(\d)\.(\d+)e(-?\d+)$/.exec(str)) { - candidates.push(match[1] + match[2] + "e" + (match[3] - match[2].length)); - } - return best_of(candidates); - } - - function make_block(stmt, output) { - if (!stmt || stmt instanceof AST_EmptyStatement) - output.print("{}"); - else if (stmt instanceof AST_BlockStatement) - stmt.print(output); - else output.with_block(function() { - output.indent(); - stmt.print(output); - output.newline(); - }); - } - - /* -----[ source map generators ]----- */ - - function DEFMAP(nodetype, generator) { - nodetype.forEach(function(nodetype) { - nodetype.DEFMETHOD("add_source_map", generator); - }); - } - - DEFMAP([ - // We could easily add info for ALL nodes, but it seems to me that - // would be quite wasteful, hence this noop in the base class. - AST_Node, - // since the label symbol will mark it - AST_LabeledStatement, - AST_Toplevel, - ], noop); - - // XXX: I'm not exactly sure if we need it for all of these nodes, - // or if we should add even more. - DEFMAP([ - AST_Array, - AST_BlockStatement, - AST_Catch, - AST_Class, - AST_Constant, - AST_Debugger, - AST_Definitions, - AST_Directive, - AST_Finally, - AST_Jump, - AST_Lambda, - AST_New, - AST_Object, - AST_StatementWithBody, - AST_Symbol, - AST_Switch, - AST_SwitchBranch, - AST_TemplateString, - AST_TemplateSegment, - AST_Try, - ], function(output) { - output.add_mapping(this.start); - }); - - DEFMAP([ - AST_ObjectGetter, - AST_ObjectSetter, - AST_PrivateGetter, - AST_PrivateSetter, - AST_ConciseMethod, - AST_PrivateMethod, - ], function(output) { - output.add_mapping(this.start, false /*name handled below*/); - }); - - DEFMAP([ - AST_SymbolMethod, - AST_SymbolPrivateProperty - ], function(output) { - const tok_type = this.end && this.end.type; - if (tok_type === "name" || tok_type === "privatename") { - output.add_mapping(this.end, this.name); - } else { - output.add_mapping(this.end); - } - }); - - DEFMAP([ AST_ObjectProperty ], function(output) { - output.add_mapping(this.start, this.key); - }); -})(); - -export { - OutputStream, -}; diff --git a/node_modules/terser/lib/parse.js b/node_modules/terser/lib/parse.js deleted file mode 100644 index 0c0e622..0000000 --- a/node_modules/terser/lib/parse.js +++ /dev/null @@ -1,3500 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -import { - characters, - defaults, - makePredicate, - set_annotation, -} from "./utils/index.js"; -import { - AST_Accessor, - AST_Array, - AST_Arrow, - AST_Assign, - AST_Await, - AST_BigInt, - AST_Binary, - AST_BlockStatement, - AST_Break, - AST_Call, - AST_Case, - AST_Catch, - AST_Chain, - AST_ClassExpression, - AST_ClassPrivateProperty, - AST_ClassProperty, - AST_ClassStaticBlock, - AST_ConciseMethod, - AST_PrivateIn, - AST_PrivateGetter, - AST_PrivateMethod, - AST_PrivateSetter, - AST_Conditional, - AST_Const, - AST_Continue, - AST_Debugger, - AST_Default, - AST_DefaultAssign, - AST_DefClass, - AST_Definitions, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DotHash, - AST_EmptyStatement, - AST_Expansion, - AST_Export, - AST_False, - AST_Finally, - AST_For, - AST_ForIn, - AST_ForOf, - AST_Function, - AST_Hole, - AST_If, - AST_Import, - AST_ImportMeta, - AST_IterationStatement, - AST_Label, - AST_LabeledStatement, - AST_LabelRef, - AST_Let, - AST_NameMapping, - AST_New, - AST_NewTarget, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectGetter, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_ObjectSetter, - AST_PrefixedTemplateString, - AST_PropAccess, - AST_RegExp, - AST_Return, - AST_Sequence, - AST_SimpleStatement, - AST_String, - AST_Sub, - AST_Super, - AST_Switch, - AST_SymbolCatch, - AST_SymbolClass, - AST_SymbolClassProperty, - AST_SymbolConst, - AST_SymbolDeclaration, - AST_SymbolDefClass, - AST_SymbolDefun, - AST_SymbolExport, - AST_SymbolExportForeign, - AST_SymbolFunarg, - AST_SymbolImport, - AST_SymbolImportForeign, - AST_SymbolLambda, - AST_SymbolLet, - AST_SymbolMethod, - AST_SymbolRef, - AST_SymbolVar, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_SymbolPrivateProperty, - AST_Throw, - AST_Token, - AST_Toplevel, - AST_True, - AST_Try, - AST_TryBlock, - AST_UnaryPostfix, - AST_UnaryPrefix, - AST_Var, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, - _INLINE, - _NOINLINE, - _PURE, - _KEY, - _MANGLEPROP, -} from "./ast.js"; - -var LATEST_RAW = ""; // Only used for numbers and template strings -var TEMPLATE_RAWS = new Map(); // Raw template strings - -var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; -var KEYWORDS_ATOM = "false null true"; -var RESERVED_WORDS = "enum import super this " + KEYWORDS_ATOM + " " + KEYWORDS; -var ALL_RESERVED_WORDS = "implements interface package private protected public static " + RESERVED_WORDS; -var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case yield await"; - -KEYWORDS = makePredicate(KEYWORDS); -RESERVED_WORDS = makePredicate(RESERVED_WORDS); -KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); -KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); -ALL_RESERVED_WORDS = makePredicate(ALL_RESERVED_WORDS); - -var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^")); - -var RE_NUM_LITERAL = /[0-9a-f]/i; -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_ES6_OCT_NUMBER = /^0o[0-7]+$/i; -var RE_BIN_NUMBER = /^0b[01]+$/i; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; -var RE_BIG_INT = /^(0[xob])?[0-9a-f]+n$/i; - -var OPERATORS = makePredicate([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "**", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "||=", - "&&=", - "??=", - "/=", - "*=", - "**=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "??", - "||", -]); - -var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\uFEFF")); - -var NEWLINE_CHARS = makePredicate(characters("\n\r\u2028\u2029")); - -var PUNC_AFTER_EXPRESSION = makePredicate(characters(";]),:")); - -var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,;:")); - -var PUNC_CHARS = makePredicate(characters("[]{}(),;:")); - -/* -----[ Tokenizer ]----- */ - -// surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property -var UNICODE = { - ID_Start: /[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-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DF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\u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DF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - ID_Continue: /(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0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DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0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00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\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uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/, -}; - -try { - UNICODE = { - // https://262.ecma-international.org/13.0/#prod-IdentifierStartChar - // $, _, ID_Start - ID_Start: new RegExp("[_$\\p{ID_Start}]", "u"), - // https://262.ecma-international.org/13.0/#prod-IdentifierPartChar - // $, zero-width-joiner, zero-width-non-joiner, ID_Continue - ID_Continue: new RegExp("[$\\u200C\\u200D\\p{ID_Continue}]+", "u"), - }; -} catch(e) { - // Could not use modern JS \p{...}. UNICODE is already defined above so let's continue -} - -function get_full_char(str, pos) { - if (is_surrogate_pair_head(str.charCodeAt(pos))) { - if (is_surrogate_pair_tail(str.charCodeAt(pos + 1))) { - return str.charAt(pos) + str.charAt(pos + 1); - } - } else if (is_surrogate_pair_tail(str.charCodeAt(pos))) { - if (is_surrogate_pair_head(str.charCodeAt(pos - 1))) { - return str.charAt(pos - 1) + str.charAt(pos); - } - } - return str.charAt(pos); -} - -function get_full_char_code(str, pos) { - // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates - if (is_surrogate_pair_head(str.charCodeAt(pos))) { - return 0x10000 + (str.charCodeAt(pos) - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00; - } - return str.charCodeAt(pos); -} - -function get_full_char_length(str) { - var surrogates = 0; - - for (var i = 0; i < str.length; i++) { - if (is_surrogate_pair_head(str.charCodeAt(i)) && is_surrogate_pair_tail(str.charCodeAt(i + 1))) { - surrogates++; - i++; - } - } - - return str.length - surrogates; -} - -function from_char_code(code) { - // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js - if (code > 0xFFFF) { - code -= 0x10000; - return (String.fromCharCode((code >> 10) + 0xD800) + - String.fromCharCode((code % 0x400) + 0xDC00)); - } - return String.fromCharCode(code); -} - -function is_surrogate_pair_head(code) { - return code >= 0xd800 && code <= 0xdbff; -} - -function is_surrogate_pair_tail(code) { - return code >= 0xdc00 && code <= 0xdfff; -} - -function is_digit(code) { - return code >= 48 && code <= 57; -} - -function is_identifier_start(ch) { - return UNICODE.ID_Start.test(ch); -} - -function is_identifier_char(ch) { - return UNICODE.ID_Continue.test(ch); -} - -const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i; - -function is_basic_identifier_string(str) { - return BASIC_IDENT.test(str); -} - -function is_identifier_string(str, allow_surrogates) { - if (BASIC_IDENT.test(str)) { - return true; - } - if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) { - return false; - } - var match = UNICODE.ID_Start.exec(str); - if (!match || match.index !== 0) { - return false; - } - - str = str.slice(match[0].length); - if (!str) { - return true; - } - - match = UNICODE.ID_Continue.exec(str); - return !!match && match[0].length === str.length; -} - -function parse_js_number(num, allow_e = true) { - if (!allow_e && num.includes("e")) { - return NaN; - } - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_ES6_OCT_NUMBER.test(num)) { - return parseInt(num.substr(2), 8); - } else if (RE_BIN_NUMBER.test(num)) { - return parseInt(num.substr(2), 2); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } else { - var val = parseFloat(num); - if (val == num) return val; - } -} - -class JS_Parse_Error extends Error { - constructor(message, filename, line, col, pos) { - super(); - - this.name = "SyntaxError"; - this.message = message; - this.filename = filename; - this.line = line; - this.col = col; - this.pos = pos; - } -} - -function js_error(message, filename, line, col, pos) { - throw new JS_Parse_Error(message, filename, line, col, pos); -} - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -} - -var EX_EOF = {}; - -function tokenizer($TEXT, filename, html5_comments, shebang) { - var S = { - text : $TEXT, - filename : filename, - pos : 0, - tokpos : 0, - line : 1, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - brace_counter : 0, - template_braces : [], - comments_before : [], - directives : {}, - directive_stack : [] - }; - - function peek() { return get_full_char(S.text, S.pos); } - - // Used because parsing ?. involves a lookahead for a digit - function is_option_chain_op() { - const must_be_dot = S.text.charCodeAt(S.pos + 1) === 46; - if (!must_be_dot) return false; - - const cannot_be_digit = S.text.charCodeAt(S.pos + 2); - return cannot_be_digit < 48 || cannot_be_digit > 57; - } - - function next(signal_eof, in_string) { - var ch = get_full_char(S.text, S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (NEWLINE_CHARS.has(ch)) { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - if (ch == "\r" && peek() == "\n") { - // treat a \r\n sequence as a single \n - ++S.pos; - ch = "\n"; - } - } else { - if (ch.length > 1) { - ++S.pos; - ++S.col; - } - ++S.col; - } - return ch; - } - - function forward(i) { - while (i--) next(); - } - - function looking_at(str) { - return S.text.substr(S.pos, str.length) == str; - } - - function find_eol() { - var text = S.text; - for (var i = S.pos, n = S.text.length; i < n; ++i) { - var ch = text[i]; - if (NEWLINE_CHARS.has(ch)) - return i; - } - return -1; - } - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - } - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - } - - var prev_was_dot = false; - var previous_token = null; - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX.has(value)) || - (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION.has(value)) || - (type == "punc" && PUNC_BEFORE_EXPRESSION.has(value))) || - (type == "arrow"); - if (type == "punc" && (value == "." || value == "?.")) { - prev_was_dot = true; - } else if (!is_comment) { - prev_was_dot = false; - } - const line = S.tokline; - const col = S.tokcol; - const pos = S.tokpos; - const nlb = S.newline_before; - const file = filename; - let comments_before = []; - let comments_after = []; - - if (!is_comment) { - comments_before = S.comments_before; - comments_after = S.comments_before = []; - } - S.newline_before = false; - const tok = new AST_Token(type, value, line, col, pos, nlb, comments_before, comments_after, file); - - if (!is_comment) previous_token = tok; - return tok; - } - - function skip_whitespace() { - while (WHITESPACE_CHARS.has(peek())) - next(); - } - - function read_while(pred) { - var ret = "", ch, i = 0; - while ((ch = peek()) && pred(ch, i++)) - ret += next(); - return ret; - } - - function parse_error(err) { - js_error(err, filename, S.tokline, S.tokcol, S.tokpos); - } - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".", is_big_int = false, numeric_separator = false; - var num = read_while(function(ch, i) { - if (is_big_int) return false; - - var code = ch.charCodeAt(0); - switch (code) { - case 95: // _ - return (numeric_separator = true); - case 98: case 66: // bB - return (has_x = true); // Can occur in hex sequence, don't return false yet - case 111: case 79: // oO - case 120: case 88: // xX - return has_x ? false : (has_x = true); - case 101: case 69: // eE - return has_x ? true : has_e ? false : (has_e = after_e = true); - case 45: // - - return after_e || (i == 0 && !prefix); - case 43: // + - return after_e; - case (after_e = false, 46): // . - return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false; - } - - if (ch === "n") { - is_big_int = true; - - return true; - } - - return RE_NUM_LITERAL.test(ch); - }); - if (prefix) num = prefix + num; - - LATEST_RAW = num; - - if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { - parse_error("Legacy octal literals are not allowed in strict mode"); - } - if (numeric_separator) { - if (num.endsWith("_")) { - parse_error("Numeric separators are not allowed at the end of numeric literals"); - } else if (num.includes("__")) { - parse_error("Only one underscore is allowed as numeric separator"); - } - num = num.replace(/_/g, ""); - } - if (num.endsWith("n")) { - const without_n = num.slice(0, -1); - const allow_e = RE_HEX_NUMBER.test(without_n); - const valid = parse_js_number(without_n, allow_e); - if (!has_dot && RE_BIG_INT.test(num) && !isNaN(valid)) - return token("big_int", without_n); - parse_error("Invalid or unexpected token"); - } - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - } - - function is_octal(ch) { - return ch >= "0" && ch <= "7"; - } - - function read_escaped_char(in_string, strict_hex, template_string) { - var ch = next(true, in_string); - switch (ch.charCodeAt(0)) { - case 110 : return "\n"; - case 114 : return "\r"; - case 116 : return "\t"; - case 98 : return "\b"; - case 118 : return "\u000b"; // \v - case 102 : return "\f"; - case 120 : return String.fromCharCode(hex_bytes(2, strict_hex)); // \x - case 117 : // \u - if (peek() == "{") { - next(true); - if (peek() === "}") - parse_error("Expecting hex-character between {}"); - while (peek() == "0") next(true); // No significance - var result, length = find("}", true) - S.pos; - // Avoid 32 bit integer overflow (1 << 32 === 1) - // We know first character isn't 0 and thus out of range anyway - if (length > 6 || (result = hex_bytes(length, strict_hex)) > 0x10FFFF) { - parse_error("Unicode reference out of bounds"); - } - next(true); - return from_char_code(result); - } - return String.fromCharCode(hex_bytes(4, strict_hex)); - case 10 : return ""; // newline - case 13 : // \r - if (peek() == "\n") { // DOS newline - next(true, in_string); - return ""; - } - } - if (is_octal(ch)) { - if (template_string && strict_hex) { - const represents_null_character = ch === "0" && !is_octal(peek()); - if (!represents_null_character) { - parse_error("Octal escape sequences are not allowed in template strings"); - } - } - return read_octal_escape_sequence(ch, strict_hex); - } - return ch; - } - - function read_octal_escape_sequence(ch, strict_octal) { - // Read - var p = peek(); - if (p >= "0" && p <= "7") { - ch += next(true); - if (ch[0] <= "3" && (p = peek()) >= "0" && p <= "7") - ch += next(true); - } - - // Parse - if (ch === "0") return "\0"; - if (ch.length > 0 && next_token.has_directive("use strict") && strict_octal) - parse_error("Legacy octal escape sequences are not allowed in strict mode"); - return String.fromCharCode(parseInt(ch, 8)); - } - - function hex_bytes(n, strict_hex) { - var num = 0; - for (; n > 0; --n) { - if (!strict_hex && isNaN(parseInt(peek(), 16))) { - return parseInt(num, 16) || ""; - } - var digit = next(true); - if (isNaN(parseInt(digit, 16))) - parse_error("Invalid hex-character pattern in string"); - num += digit; - } - return parseInt(num, 16); - } - - var read_string = with_eof_error("Unterminated string constant", function() { - const start_pos = S.pos; - var quote = next(), ret = []; - for (;;) { - var ch = next(true, true); - if (ch == "\\") ch = read_escaped_char(true, true); - else if (ch == "\r" || ch == "\n") parse_error("Unterminated string constant"); - else if (ch == quote) break; - ret.push(ch); - } - var tok = token("string", ret.join("")); - LATEST_RAW = S.text.slice(start_pos, S.pos); - tok.quote = quote; - return tok; - }); - - var read_template_characters = with_eof_error("Unterminated template", function(begin) { - if (begin) { - S.template_braces.push(S.brace_counter); - } - var content = "", raw = "", ch, tok; - next(true, true); - while ((ch = next(true, true)) != "`") { - if (ch == "\r") { - if (peek() == "\n") ++S.pos; - ch = "\n"; - } else if (ch == "$" && peek() == "{") { - next(true, true); - S.brace_counter++; - tok = token(begin ? "template_head" : "template_substitution", content); - TEMPLATE_RAWS.set(tok, raw); - tok.template_end = false; - return tok; - } - - raw += ch; - if (ch == "\\") { - var tmp = S.pos; - var prev_is_tag = previous_token && (previous_token.type === "name" || previous_token.type === "punc" && (previous_token.value === ")" || previous_token.value === "]")); - ch = read_escaped_char(true, !prev_is_tag, true); - raw += S.text.substr(tmp, S.pos - tmp); - } - - content += ch; - } - S.template_braces.pop(); - tok = token(begin ? "template_head" : "template_substitution", content); - TEMPLATE_RAWS.set(tok, raw); - tok.template_end = true; - return tok; - }); - - function skip_line_comment(type) { - var regex_allowed = S.regex_allowed; - var i = find_eol(), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - S.col = S.tokcol + (S.pos - S.tokpos); - S.comments_before.push(token(type, ret, true)); - S.regex_allowed = regex_allowed; - return next_token; - } - - var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function() { - var regex_allowed = S.regex_allowed; - var i = find("*/", true); - var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n"); - // update stream position - forward(get_full_char_length(text) /* text length doesn't count \r\n as 2 char while S.pos - i does */ + 2); - S.comments_before.push(token("comment2", text, true)); - S.newline_before = S.newline_before || text.includes("\n"); - S.regex_allowed = regex_allowed; - return next_token; - }); - - var read_name = with_eof_error("Unterminated identifier name", function() { - var name = [], ch, escaped = false; - var read_escaped_identifier_char = function() { - escaped = true; - next(); - if (peek() !== "u") { - parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"); - } - return read_escaped_char(false, true); - }; - - // Read first character (ID_Start) - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_start(ch)) { - parse_error("First identifier char is an invalid identifier char"); - } - } else if (is_identifier_start(ch)) { - next(); - } else { - return ""; - } - - name.push(ch); - - // Read ID_Continue - while ((ch = peek()) != null) { - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_char(ch)) { - parse_error("Invalid escaped identifier char"); - } - } else { - if (!is_identifier_char(ch)) { - break; - } - next(); - } - name.push(ch); - } - const name_str = name.join(""); - if (RESERVED_WORDS.has(name_str) && escaped) { - parse_error("Escaped characters are not allowed in keywords"); - } - return name_str; - }); - - var read_regexp = with_eof_error("Unterminated regular expression", function(source) { - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (NEWLINE_CHARS.has(ch)) { - parse_error("Unexpected line terminator"); - } else if (prev_backslash) { - source += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - source += ch; - } else if (ch == "]" && in_class) { - in_class = false; - source += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - source += ch; - } - const flags = read_name(); - return token("regexp", "/" + source + "/" + flags); - }); - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (OPERATORS.has(bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - } - return token("operator", grow(prefix || next())); - } - - function handle_slash() { - next(); - switch (peek()) { - case "/": - next(); - return skip_line_comment("comment1"); - case "*": - next(); - return skip_multiline_comment(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - } - - function handle_eq_sign() { - next(); - if (peek() === ">") { - next(); - return token("arrow", "=>"); - } else { - return read_operator("="); - } - } - - function handle_dot() { - next(); - if (is_digit(peek().charCodeAt(0))) { - return read_num("."); - } - if (peek() === ".") { - next(); // Consume second dot - next(); // Consume third dot - return token("expand", "..."); - } - - return token("punc", "."); - } - - function read_word() { - var word = read_name(); - if (prev_was_dot) return token("name", word); - return KEYWORDS_ATOM.has(word) ? token("atom", word) - : !KEYWORDS.has(word) ? token("name", word) - : OPERATORS.has(word) ? token("operator", word) - : token("keyword", word); - } - - function read_private_word() { - next(); - return token("privatename", read_name()); - } - - function with_eof_error(eof_error, cont) { - return function(x) { - try { - return cont(x); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - } - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - if (shebang && S.pos == 0 && looking_at("#!")) { - start_token(); - forward(2); - skip_line_comment("comment5"); - } - for (;;) { - skip_whitespace(); - start_token(); - if (html5_comments) { - if (looking_at("") && S.newline_before) { - forward(3); - skip_line_comment("comment4"); - continue; - } - } - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: case 39: return read_string(); - case 46: return handle_dot(); - case 47: { - var tok = handle_slash(); - if (tok === next_token) continue; - return tok; - } - case 61: return handle_eq_sign(); - case 63: { - if (!is_option_chain_op()) break; // Handled below - - next(); // ? - next(); // . - - return token("punc", "?."); - } - case 96: return read_template_characters(true); - case 123: - S.brace_counter++; - break; - case 125: - S.brace_counter--; - if (S.template_braces.length > 0 - && S.template_braces[S.template_braces.length - 1] === S.brace_counter) - return read_template_characters(false); - break; - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS.has(ch)) return token("punc", next()); - if (OPERATOR_CHARS.has(ch)) return read_operator(); - if (code == 92 || is_identifier_start(ch)) return read_word(); - if (code == 35) return read_private_word(); - break; - } - parse_error("Unexpected character '" + ch + "'"); - } - - next_token.next = next; - next_token.peek = peek; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - next_token.add_directive = function(directive) { - S.directive_stack[S.directive_stack.length - 1].push(directive); - - if (S.directives[directive] === undefined) { - S.directives[directive] = 1; - } else { - S.directives[directive]++; - } - }; - - next_token.push_directives_stack = function() { - S.directive_stack.push([]); - }; - - next_token.pop_directives_stack = function() { - var directives = S.directive_stack[S.directive_stack.length - 1]; - - for (var i = 0; i < directives.length; i++) { - S.directives[directives[i]]--; - } - - S.directive_stack.pop(); - }; - - next_token.has_directive = function(directive) { - return S.directives[directive] > 0; - }; - - return next_token; - -} - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = makePredicate([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = makePredicate([ "--", "++" ]); - -var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "??=", "&&=", "||=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var LOGICAL_ASSIGNMENT = makePredicate([ "??=", "&&=", "||=" ]); - -var PRECEDENCE = (function(a, ret) { - for (var i = 0; i < a.length; ++i) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = i + 1; - } - } - return ret; -})( - [ - ["||"], - ["??"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"], - ["**"] - ], - {} -); - -var ATOMIC_START_TOKEN = makePredicate([ "atom", "num", "big_int", "string", "regexp", "name"]); - -/* -----[ Parser ]----- */ - -function parse($TEXT, options) { - // maps start tokens to count of comments found outside of their parens - // Example: /* I count */ ( /* I don't */ foo() ) - // Useful because comments_before property of call with parens outside - // contains both comments inside and outside these parens. Used to find the - // right #__PURE__ comments for an expression - const outer_comments_before_counts = new WeakMap(); - - options = defaults(options, { - bare_returns : false, - ecma : null, // Legacy - expression : false, - filename : null, - html5_comments : true, - module : false, - shebang : true, - strict : false, - toplevel : null, - }, true); - - var S = { - input : (typeof $TEXT == "string" - ? tokenizer($TEXT, options.filename, - options.html5_comments, options.shebang) - : $TEXT), - token : null, - prev : null, - peeked : null, - in_function : 0, - in_async : -1, - in_generator : -1, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - } - - function peek() { return S.peeked || (S.peeked = S.input()); } - - function next() { - S.prev = S.token; - - if (!S.peeked) peek(); - S.token = S.peeked; - S.peeked = null; - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - } - - function prev() { - return S.prev; - } - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - ctx.filename, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - } - - function token_error(token, msg) { - croak(msg, token.line, token.col); - } - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - } - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); - } - - function expect(punc) { return expect_token("punc", punc); } - - function has_newline_before(token) { - return token.nlb || !token.comments_before.every((comment) => !comment.nlb); - } - - function can_insert_semicolon() { - return !options.strict - && (is("eof") || is("punc", "}") || has_newline_before(S.token)); - } - - function is_in_generator() { - return S.in_generator === S.in_function; - } - - function is_in_async() { - return S.in_async === S.in_function; - } - - function can_await() { - return ( - S.in_async === S.in_function - || S.in_function === 0 && S.input.has_directive("use strict") - ); - } - - function semicolon(optional) { - if (is("punc", ";")) next(); - else if (!optional && !can_insert_semicolon()) unexpected(); - } - - function parenthesised() { - expect("("); - var exp = expression(true); - expect(")"); - return exp; - } - - function embed_tokens(parser) { - return function _embed_tokens_wrapper(...args) { - const start = S.token; - const expr = parser(...args); - expr.start = start; - expr.end = prev(); - return expr; - }; - } - - function handle_regexp() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - } - - var statement = embed_tokens(function statement(is_export_default, is_for_body, is_if_body) { - handle_regexp(); - switch (S.token.type) { - case "string": - if (S.in_directives) { - var token = peek(); - if (!LATEST_RAW.includes("\\") - && (is_token(token, "punc", ";") - || is_token(token, "punc", "}") - || has_newline_before(token) - || is_token(token, "eof"))) { - S.input.add_directive(S.token.value); - } else { - S.in_directives = false; - } - } - var dir = S.in_directives, stat = simple_statement(); - return dir && stat.body instanceof AST_String ? new AST_Directive(stat.body) : stat; - case "template_head": - case "num": - case "big_int": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - case "privatename": - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - - if (S.token.value == "async" && is_token(peek(), "keyword", "function")) { - next(); - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(AST_Defun, false, true, is_export_default); - } - if (S.token.value == "import" && !is_token(peek(), "punc", "(") && !is_token(peek(), "punc", ".")) { - next(); - var node = import_statement(); - semicolon(); - return node; - } - return is_token(peek(), "punc", ":") - ? labeled_statement() - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new AST_BlockStatement({ - start : S.token, - body : block_(), - end : prev() - }); - case "[": - case "(": - return simple_statement(); - case ";": - S.in_directives = false; - next(); - return new AST_EmptyStatement(); - default: - unexpected(); - } - - case "keyword": - switch (S.token.value) { - case "break": - next(); - return break_cont(AST_Break); - - case "continue": - next(); - return break_cont(AST_Continue); - - case "debugger": - next(); - semicolon(); - return new AST_Debugger(); - - case "do": - next(); - var body = in_loop(statement); - expect_token("keyword", "while"); - var condition = parenthesised(); - semicolon(true); - return new AST_Do({ - body : body, - condition : condition - }); - - case "while": - next(); - return new AST_While({ - condition : parenthesised(), - body : in_loop(function() { return statement(false, true); }) - }); - - case "for": - next(); - return for_(); - - case "class": - next(); - if (is_for_body) { - croak("classes are not allowed as the body of a loop"); - } - if (is_if_body) { - croak("classes are not allowed as the body of an if"); - } - return class_(AST_DefClass, is_export_default); - - case "function": - next(); - if (is_for_body) { - croak("functions are not allowed as the body of a loop"); - } - return function_(AST_Defun, false, false, is_export_default); - - case "if": - next(); - return if_(); - - case "return": - if (S.in_function == 0 && !options.bare_returns) - croak("'return' outside of function"); - next(); - var value = null; - if (is("punc", ";")) { - next(); - } else if (!can_insert_semicolon()) { - value = expression(true); - semicolon(); - } - return new AST_Return({ - value: value - }); - - case "switch": - next(); - return new AST_Switch({ - expression : parenthesised(), - body : in_loop(switch_body_) - }); - - case "throw": - next(); - if (has_newline_before(S.token)) - croak("Illegal newline after 'throw'"); - var value = expression(true); - semicolon(); - return new AST_Throw({ - value: value - }); - - case "try": - next(); - return try_(); - - case "var": - next(); - var node = var_(); - semicolon(); - return node; - - case "let": - next(); - var node = let_(); - semicolon(); - return node; - - case "const": - next(); - var node = const_(); - semicolon(); - return node; - - case "with": - if (S.input.has_directive("use strict")) { - croak("Strict mode may not include a with statement"); - } - next(); - return new AST_With({ - expression : parenthesised(), - body : statement() - }); - - case "export": - if (!is_token(peek(), "punc", "(")) { - next(); - var node = export_statement(); - if (is("punc", ";")) semicolon(); - return node; - } - } - } - unexpected(); - }); - - function labeled_statement() { - var label = as_symbol(AST_Label); - if (label.name === "await" && is_in_async()) { - token_error(S.prev, "await cannot be used as label inside async function"); - } - if (S.labels.some((l) => l.name === label.name)) { - // ECMA-262, 12.12: An ECMAScript program is considered - // syntactically incorrect if it contains a - // LabelledStatement that is enclosed by a - // LabelledStatement with the same Identifier as label. - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - if (!(stat instanceof AST_IterationStatement)) { - // check for `continue` that refers to this label. - // those should be reported as syntax errors. - // https://github.com/mishoo/UglifyJS2/issues/287 - label.references.forEach(function(ref) { - if (ref instanceof AST_Continue) { - ref = ref.label.start; - croak("Continue label `" + label.name + "` refers to non-IterationStatement.", - ref.line, ref.col, ref.pos); - } - }); - } - return new AST_LabeledStatement({ body: stat, label: label }); - } - - function simple_statement(tmp) { - return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); - } - - function break_cont(type) { - var label = null, ldef; - if (!can_insert_semicolon()) { - label = as_symbol(AST_LabelRef, true); - } - if (label != null) { - ldef = S.labels.find((l) => l.name === label.name); - if (!ldef) - croak("Undefined label " + label.name); - label.thedef = ldef; - } else if (S.in_loop == 0) - croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - var stat = new type({ label: label }); - if (ldef) ldef.references.push(stat); - return stat; - } - - function for_() { - var for_await_error = "`for await` invalid in this context"; - var await_tok = S.token; - if (await_tok.type == "name" && await_tok.value == "await") { - if (!can_await()) { - token_error(await_tok, for_await_error); - } - next(); - } else { - await_tok = false; - } - expect("("); - var init = null; - if (!is("punc", ";")) { - init = - is("keyword", "var") ? (next(), var_(true)) : - is("keyword", "let") ? (next(), let_(true)) : - is("keyword", "const") ? (next(), const_(true)) : - expression(true, true); - var is_in = is("operator", "in"); - var is_of = is("name", "of"); - if (await_tok && !is_of) { - token_error(await_tok, for_await_error); - } - if (is_in || is_of) { - if (init instanceof AST_Definitions) { - if (init.definitions.length > 1) - token_error(init.start, "Only one variable declaration allowed in for..in loop"); - } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) { - token_error(init.start, "Invalid left-hand side in for..in loop"); - } - next(); - if (is_in) { - return for_in(init); - } else { - return for_of(init, !!await_tok); - } - } - } else if (await_tok) { - token_error(await_tok, for_await_error); - } - return regular_for(init); - } - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(true); - expect(";"); - var step = is("punc", ")") ? null : expression(true); - expect(")"); - return new AST_For({ - init : init, - condition : test, - step : step, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_of(init, is_await) { - var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null; - var obj = expression(true); - expect(")"); - return new AST_ForOf({ - await : is_await, - init : init, - name : lhs, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - function for_in(init) { - var obj = expression(true); - expect(")"); - return new AST_ForIn({ - init : init, - object : obj, - body : in_loop(function() { return statement(false, true); }) - }); - } - - var arrow_function = function(start, argnames, is_async) { - if (has_newline_before(S.token)) { - croak("Unexpected newline before arrow (=>)"); - } - - expect_token("arrow", "=>"); - - var body = _function_body(is("punc", "{"), false, is_async); - - var end = - body instanceof Array && body.length ? body[body.length - 1].end : - body instanceof Array ? start : - body.end; - - return new AST_Arrow({ - start : start, - end : end, - async : is_async, - argnames : argnames, - body : body - }); - }; - - var function_ = function(ctor, is_generator_property, is_async, is_export_default) { - var in_statement = ctor === AST_Defun; - var is_generator = is("operator", "*"); - if (is_generator) { - next(); - } - - var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null; - if (in_statement && !name) { - if (is_export_default) { - ctor = AST_Function; - } else { - unexpected(); - } - } - - if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration)) - unexpected(prev()); - - var args = []; - var body = _function_body(true, is_generator || is_generator_property, is_async, name, args); - return new ctor({ - start : args.start, - end : body.end, - is_generator: is_generator, - async : is_async, - name : name, - argnames: args, - body : body - }); - }; - - class UsedParametersTracker { - constructor(is_parameter, strict, duplicates_ok = false) { - this.is_parameter = is_parameter; - this.duplicates_ok = duplicates_ok; - this.parameters = new Set(); - this.duplicate = null; - this.default_assignment = false; - this.spread = false; - this.strict_mode = !!strict; - } - add_parameter(token) { - if (this.parameters.has(token.value)) { - if (this.duplicate === null) { - this.duplicate = token; - } - this.check_strict(); - } else { - this.parameters.add(token.value); - if (this.is_parameter) { - switch (token.value) { - case "arguments": - case "eval": - case "yield": - if (this.strict_mode) { - token_error(token, "Unexpected " + token.value + " identifier as parameter inside strict mode"); - } - break; - default: - if (RESERVED_WORDS.has(token.value)) { - unexpected(); - } - } - } - } - } - mark_default_assignment(token) { - if (this.default_assignment === false) { - this.default_assignment = token; - } - } - mark_spread(token) { - if (this.spread === false) { - this.spread = token; - } - } - mark_strict_mode() { - this.strict_mode = true; - } - is_strict() { - return this.default_assignment !== false || this.spread !== false || this.strict_mode; - } - check_strict() { - if (this.is_strict() && this.duplicate !== null && !this.duplicates_ok) { - token_error(this.duplicate, "Parameter " + this.duplicate.value + " was used already"); - } - } - } - - function parameters(params) { - var used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); - - expect("("); - - while (!is("punc", ")")) { - var param = parameter(used_parameters); - params.push(param); - - if (!is("punc", ")")) { - expect(","); - } - - if (param instanceof AST_Expansion) { - break; - } - } - - next(); - } - - function parameter(used_parameters, symbol_type) { - var param; - var expand = false; - if (used_parameters === undefined) { - used_parameters = new UsedParametersTracker(true, S.input.has_directive("use strict")); - } - if (is("expand", "...")) { - expand = S.token; - used_parameters.mark_spread(S.token); - next(); - } - param = binding_element(used_parameters, symbol_type); - - if (is("operator", "=") && expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - param = new AST_DefaultAssign({ - start: param.start, - left: param, - operator: "=", - right: expression(false), - end: S.token - }); - } - - if (expand !== false) { - if (!is("punc", ")")) { - unexpected(); - } - param = new AST_Expansion({ - start: expand, - expression: param, - end: expand - }); - } - used_parameters.check_strict(); - - return param; - } - - function binding_element(used_parameters, symbol_type) { - var elements = []; - var first = true; - var is_expand = false; - var expand_token; - var first_token = S.token; - if (used_parameters === undefined) { - const strict = S.input.has_directive("use strict"); - const duplicates_ok = symbol_type === AST_SymbolVar; - used_parameters = new UsedParametersTracker(false, strict, duplicates_ok); - } - symbol_type = symbol_type === undefined ? AST_SymbolFunarg : symbol_type; - if (is("punc", "[")) { - next(); - while (!is("punc", "]")) { - if (first) { - first = false; - } else { - expect(","); - } - - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("punc")) { - switch (S.token.value) { - case ",": - elements.push(new AST_Hole({ - start: S.token, - end: S.token - })); - continue; - case "]": // Trailing comma after last element - break; - case "[": - case "{": - elements.push(binding_element(used_parameters, symbol_type)); - break; - default: - unexpected(); - } - } else if (is("name")) { - used_parameters.add_parameter(S.token); - elements.push(as_symbol(symbol_type)); - } else { - croak("Invalid function parameter"); - } - if (is("operator", "=") && is_expand === false) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1] = new AST_DefaultAssign({ - start: elements[elements.length - 1].start, - left: elements[elements.length - 1], - operator: "=", - right: expression(false), - end: S.token - }); - } - if (is_expand) { - if (!is("punc", "]")) { - croak("Rest element must be last element"); - } - elements[elements.length - 1] = new AST_Expansion({ - start: expand_token, - expression: elements[elements.length - 1], - end: expand_token - }); - } - } - expect("]"); - used_parameters.check_strict(); - return new AST_Destructuring({ - start: first_token, - names: elements, - is_array: true, - end: prev() - }); - } else if (is("punc", "{")) { - next(); - while (!is("punc", "}")) { - if (first) { - first = false; - } else { - expect(","); - } - if (is("expand", "...")) { - is_expand = true; - expand_token = S.token; - used_parameters.mark_spread(S.token); - next(); - } - if (is("name") && (is_token(peek(), "punc") || is_token(peek(), "operator")) && [",", "}", "="].includes(peek().value)) { - used_parameters.add_parameter(S.token); - var start = prev(); - var value = as_symbol(symbol_type); - if (is_expand) { - elements.push(new AST_Expansion({ - start: expand_token, - expression: value, - end: value.end, - })); - } else { - elements.push(new AST_ObjectKeyVal({ - start: start, - key: value.name, - value: value, - end: value.end, - })); - } - } else if (is("punc", "}")) { - continue; // Allow trailing hole - } else { - var property_token = S.token; - var property = as_property_name(); - if (property === null) { - unexpected(prev()); - } else if (prev().type === "name" && !is("punc", ":")) { - elements.push(new AST_ObjectKeyVal({ - start: prev(), - key: property, - value: new symbol_type({ - start: prev(), - name: property, - end: prev() - }), - end: prev() - })); - } else { - expect(":"); - elements.push(new AST_ObjectKeyVal({ - start: property_token, - quote: property_token.quote, - key: property, - value: binding_element(used_parameters, symbol_type), - end: prev() - })); - } - } - if (is_expand) { - if (!is("punc", "}")) { - croak("Rest element must be last element"); - } - } else if (is("operator", "=")) { - used_parameters.mark_default_assignment(S.token); - next(); - elements[elements.length - 1].value = new AST_DefaultAssign({ - start: elements[elements.length - 1].value.start, - left: elements[elements.length - 1].value, - operator: "=", - right: expression(false), - end: S.token - }); - } - } - expect("}"); - used_parameters.check_strict(); - return new AST_Destructuring({ - start: first_token, - names: elements, - is_array: false, - end: prev() - }); - } else if (is("name")) { - used_parameters.add_parameter(S.token); - return as_symbol(symbol_type); - } else { - croak("Invalid function parameter"); - } - } - - function params_or_seq_(allow_arrows, maybe_sequence) { - var spread_token; - var invalid_sequence; - var trailing_comma; - var a = []; - expect("("); - while (!is("punc", ")")) { - if (spread_token) unexpected(spread_token); - if (is("expand", "...")) { - spread_token = S.token; - if (maybe_sequence) invalid_sequence = S.token; - next(); - a.push(new AST_Expansion({ - start: prev(), - expression: expression(), - end: S.token, - })); - } else { - a.push(expression()); - } - if (!is("punc", ")")) { - expect(","); - if (is("punc", ")")) { - trailing_comma = prev(); - if (maybe_sequence) invalid_sequence = trailing_comma; - } - } - } - expect(")"); - if (allow_arrows && is("arrow", "=>")) { - if (spread_token && trailing_comma) unexpected(trailing_comma); - } else if (invalid_sequence) { - unexpected(invalid_sequence); - } - return a; - } - - function _function_body(block, generator, is_async, name, args) { - var loop = S.in_loop; - var labels = S.labels; - var current_generator = S.in_generator; - var current_async = S.in_async; - ++S.in_function; - if (generator) - S.in_generator = S.in_function; - if (is_async) - S.in_async = S.in_function; - if (args) parameters(args); - if (block) - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - if (block) { - S.input.push_directives_stack(); - var a = block_(); - if (name) _verify_symbol(name); - if (args) args.forEach(_verify_symbol); - S.input.pop_directives_stack(); - } else { - var a = [new AST_Return({ - start: S.token, - value: expression(false), - end: S.token - })]; - } - --S.in_function; - S.in_loop = loop; - S.labels = labels; - S.in_generator = current_generator; - S.in_async = current_async; - return a; - } - - function _await_expression() { - // Previous token must be "await" and not be interpreted as an identifier - if (!can_await()) { - croak("Unexpected await expression outside async function", - S.prev.line, S.prev.col, S.prev.pos); - } - // the await expression is parsed as a unary expression in Babel - return new AST_Await({ - start: prev(), - end: S.token, - expression : maybe_unary(true), - }); - } - - function _yield_expression() { - // Previous token must be keyword yield and not be interpret as an identifier - if (!is_in_generator()) { - croak("Unexpected yield expression outside generator function", - S.prev.line, S.prev.col, S.prev.pos); - } - var start = S.token; - var star = false; - var has_expression = true; - - // Attempt to get expression or star (and then the mandatory expression) - // behind yield on the same line. - // - // If nothing follows on the same line of the yieldExpression, - // it should default to the value `undefined` for yield to return. - // In that case, the `undefined` stored as `null` in ast. - // - // Note 1: It isn't allowed for yield* to close without an expression - // Note 2: If there is a nlb between yield and star, it is interpret as - // yield * - if (can_insert_semicolon() || - (is("punc") && PUNC_AFTER_EXPRESSION.has(S.token.value))) { - has_expression = false; - - } else if (is("operator", "*")) { - star = true; - next(); - } - - return new AST_Yield({ - start : start, - is_star : star, - expression : has_expression ? expression() : null, - end : prev() - }); - } - - function if_() { - var cond = parenthesised(), body = statement(false, false, true), belse = null; - if (is("keyword", "else")) { - next(); - belse = statement(false, false, true); - } - return new AST_If({ - condition : cond, - body : body, - alternative : belse - }); - } - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - } - - function switch_body_() { - expect("{"); - var a = [], cur = null, branch = null, tmp; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Case({ - start : (tmp = S.token, next(), tmp), - expression : expression(true), - body : cur - }); - a.push(branch); - expect(":"); - } else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Default({ - start : (tmp = S.token, next(), expect(":"), tmp), - body : cur - }); - a.push(branch); - } else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - } - - function try_() { - var body, bcatch = null, bfinally = null; - body = new AST_TryBlock({ - start : S.token, - body : block_(), - end : prev(), - }); - if (is("keyword", "catch")) { - var start = S.token; - next(); - if (is("punc", "{")) { - var name = null; - } else { - expect("("); - var name = parameter(undefined, AST_SymbolCatch); - expect(")"); - } - bcatch = new AST_Catch({ - start : start, - argname : name, - body : block_(), - end : prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new AST_Finally({ - start : start, - body : block_(), - end : prev() - }); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return new AST_Try({ - body : body, - bcatch : bcatch, - bfinally : bfinally - }); - } - - /** - * var - * vardef1 = 2, - * vardef2 = 3; - */ - function vardefs(no_in, kind) { - var var_defs = []; - var def; - for (;;) { - var sym_type = - kind === "var" ? AST_SymbolVar : - kind === "const" ? AST_SymbolConst : - kind === "let" ? AST_SymbolLet : null; - // var { a } = b - if (is("punc", "{") || is("punc", "[")) { - def = new AST_VarDef({ - start: S.token, - name: binding_element(undefined, sym_type), - value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null, - end: prev() - }); - } else { - def = new AST_VarDef({ - start : S.token, - name : as_symbol(sym_type), - value : is("operator", "=") - ? (next(), expression(false, no_in)) - : !no_in && kind === "const" - ? croak("Missing initializer in const declaration") : null, - end : prev() - }); - if (def.name.name == "import") croak("Unexpected token: import"); - } - var_defs.push(def); - if (!is("punc", ",")) - break; - next(); - } - return var_defs; - } - - var var_ = function(no_in) { - return new AST_Var({ - start : prev(), - definitions : vardefs(no_in, "var"), - end : prev() - }); - }; - - var let_ = function(no_in) { - return new AST_Let({ - start : prev(), - definitions : vardefs(no_in, "let"), - end : prev() - }); - }; - - var const_ = function(no_in) { - return new AST_Const({ - start : prev(), - definitions : vardefs(no_in, "const"), - end : prev() - }); - }; - - var new_ = function(allow_calls) { - var start = S.token; - expect_token("operator", "new"); - if (is("punc", ".")) { - next(); - expect_token("name", "target"); - return subscripts(new AST_NewTarget({ - start : start, - end : prev() - }), allow_calls); - } - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")", true); - } else { - args = []; - } - var call = new AST_New({ - start : start, - expression : newexp, - args : args, - end : prev() - }); - annotate(call); - return subscripts(call, allow_calls); - }; - - function as_atom_node() { - var tok = S.token, ret; - switch (tok.type) { - case "name": - ret = _make_symbol(AST_SymbolRef); - break; - case "num": - ret = new AST_Number({ - start: tok, - end: tok, - value: tok.value, - raw: LATEST_RAW - }); - break; - case "big_int": - ret = new AST_BigInt({ start: tok, end: tok, value: tok.value }); - break; - case "string": - ret = new AST_String({ - start : tok, - end : tok, - value : tok.value, - quote : tok.quote - }); - annotate(ret); - break; - case "regexp": - const [_, source, flags] = tok.value.match(/^\/(.*)\/(\w*)$/); - - ret = new AST_RegExp({ start: tok, end: tok, value: { source, flags } }); - break; - case "atom": - switch (tok.value) { - case "false": - ret = new AST_False({ start: tok, end: tok }); - break; - case "true": - ret = new AST_True({ start: tok, end: tok }); - break; - case "null": - ret = new AST_Null({ start: tok, end: tok }); - break; - } - break; - } - next(); - return ret; - } - - function to_fun_args(ex, default_seen_above) { - var insert_default = function(ex, default_value) { - if (default_value) { - return new AST_DefaultAssign({ - start: ex.start, - left: ex, - operator: "=", - right: default_value, - end: default_value.end - }); - } - return ex; - }; - if (ex instanceof AST_Object) { - return insert_default(new AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: false, - names: ex.properties.map(prop => to_fun_args(prop)) - }), default_seen_above); - } else if (ex instanceof AST_ObjectKeyVal) { - ex.value = to_fun_args(ex.value); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_Hole) { - return ex; - } else if (ex instanceof AST_Destructuring) { - ex.names = ex.names.map(name => to_fun_args(name)); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_SymbolRef) { - return insert_default(new AST_SymbolFunarg({ - name: ex.name, - start: ex.start, - end: ex.end - }), default_seen_above); - } else if (ex instanceof AST_Expansion) { - ex.expression = to_fun_args(ex.expression); - return insert_default(ex, default_seen_above); - } else if (ex instanceof AST_Array) { - return insert_default(new AST_Destructuring({ - start: ex.start, - end: ex.end, - is_array: true, - names: ex.elements.map(elm => to_fun_args(elm)) - }), default_seen_above); - } else if (ex instanceof AST_Assign) { - return insert_default(to_fun_args(ex.left, ex.right), default_seen_above); - } else if (ex instanceof AST_DefaultAssign) { - ex.left = to_fun_args(ex.left); - return ex; - } else { - croak("Invalid function parameter", ex.start.line, ex.start.col); - } - } - - var expr_atom = function(allow_calls, allow_arrows) { - if (is("operator", "new")) { - return new_(allow_calls); - } - if (is("name", "import") && is_token(peek(), "punc", ".")) { - return import_meta(allow_calls); - } - var start = S.token; - var peeked; - var async = is("name", "async") - && (peeked = peek()).value != "[" - && peeked.type != "arrow" - && as_atom_node(); - if (is("punc")) { - switch (S.token.value) { - case "(": - if (async && !allow_calls) break; - var exprs = params_or_seq_(allow_arrows, !async); - if (allow_arrows && is("arrow", "=>")) { - return arrow_function(start, exprs.map(e => to_fun_args(e)), !!async); - } - var ex = async ? new AST_Call({ - expression: async, - args: exprs - }) : to_expr_or_sequence(start, exprs); - if (ex.start) { - const outer_comments_before = start.comments_before.length; - outer_comments_before_counts.set(start, outer_comments_before); - ex.start.comments_before.unshift(...start.comments_before); - start.comments_before = ex.start.comments_before; - if (outer_comments_before == 0 && start.comments_before.length > 0) { - var comment = start.comments_before[0]; - if (!comment.nlb) { - comment.nlb = start.nlb; - start.nlb = false; - } - } - start.comments_after = ex.start.comments_after; - } - ex.start = start; - var end = prev(); - if (ex.end) { - end.comments_before = ex.end.comments_before; - ex.end.comments_after.push(...end.comments_after); - end.comments_after = ex.end.comments_after; - } - ex.end = end; - if (ex instanceof AST_Call) annotate(ex); - return subscripts(ex, allow_calls); - case "[": - return subscripts(array_(), allow_calls); - case "{": - return subscripts(object_or_destructuring_(), allow_calls); - } - if (!async) unexpected(); - } - if (allow_arrows && is("name") && is_token(peek(), "arrow")) { - var param = new AST_SymbolFunarg({ - name: S.token.value, - start: start, - end: start, - }); - next(); - return arrow_function(start, [param], !!async); - } - if (is("keyword", "function")) { - next(); - var func = function_(AST_Function, false, !!async); - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (async) return subscripts(async, allow_calls); - if (is("keyword", "class")) { - next(); - var cls = class_(AST_ClassExpression); - cls.start = start; - cls.end = prev(); - return subscripts(cls, allow_calls); - } - if (is("template_head")) { - return subscripts(template_string(), allow_calls); - } - if (is("privatename")) { - if(!S.in_class) { - croak("Private field must be used in an enclosing class"); - } - - const start = S.token; - const key = new AST_SymbolPrivateProperty({ - start, - name: start.value, - end: start - }); - next(); - expect_token("operator", "in"); - - const private_in = new AST_PrivateIn({ - start, - key, - value: subscripts(as_atom_node(), allow_calls), - end: prev() - }); - - return subscripts(private_in, allow_calls); - } - if (ATOMIC_START_TOKEN.has(S.token.type)) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - - function template_string() { - var segments = [], start = S.token; - - segments.push(new AST_TemplateSegment({ - start: S.token, - raw: TEMPLATE_RAWS.get(S.token), - value: S.token.value, - end: S.token - })); - - while (!S.token.template_end) { - next(); - handle_regexp(); - segments.push(expression(true)); - - segments.push(new AST_TemplateSegment({ - start: S.token, - raw: TEMPLATE_RAWS.get(S.token), - value: S.token.value, - end: S.token - })); - } - next(); - - return new AST_TemplateString({ - start: start, - segments: segments, - end: S.token - }); - } - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push(new AST_Hole({ start: S.token, end: S.token })); - } else if (is("expand", "...")) { - next(); - a.push(new AST_Expansion({start: prev(), expression: expression(),end: S.token})); - } else { - a.push(expression(false)); - } - } - next(); - return a; - } - - var array_ = embed_tokens(function() { - expect("["); - return new AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - - var create_accessor = embed_tokens((is_generator, is_async) => { - return function_(AST_Accessor, is_generator, is_async); - }); - - var object_or_destructuring_ = embed_tokens(function object_or_destructuring_() { - var start = S.token, first = true, a = []; - expect("{"); - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!options.strict && is("punc", "}")) - // allow trailing comma - break; - - start = S.token; - if (start.type == "expand") { - next(); - a.push(new AST_Expansion({ - start: start, - expression: expression(false), - end: prev(), - })); - continue; - } - if(is("privatename")) { - croak("private fields are not allowed in an object"); - } - var name = as_property_name(); - var value; - - // Check property and fetch value - if (!is("punc", ":")) { - var concise = concise_method_or_getset(name, start); - if (concise) { - a.push(concise); - continue; - } - - value = new AST_SymbolRef({ - start: prev(), - name: name, - end: prev() - }); - } else if (name === null) { - unexpected(prev()); - } else { - next(); // `:` - see first condition - value = expression(false); - } - - // Check for default value and alter value accordingly if necessary - if (is("operator", "=")) { - next(); - value = new AST_Assign({ - start: start, - left: value, - operator: "=", - right: expression(false), - logical: false, - end: prev() - }); - } - - // Create property - const kv = new AST_ObjectKeyVal({ - start: start, - quote: start.quote, - key: name instanceof AST_Node ? name : "" + name, - value: value, - end: prev() - }); - a.push(annotate(kv)); - } - next(); - return new AST_Object({ properties: a }); - }); - - function class_(KindOfClass, is_export_default) { - var start, method, class_name, extends_, a = []; - - S.input.push_directives_stack(); // Push directive stack, but not scope stack - S.input.add_directive("use strict"); - - if (S.token.type == "name" && S.token.value != "extends") { - class_name = as_symbol(KindOfClass === AST_DefClass ? AST_SymbolDefClass : AST_SymbolClass); - } - - if (KindOfClass === AST_DefClass && !class_name) { - if (is_export_default) { - KindOfClass = AST_ClassExpression; - } else { - unexpected(); - } - } - - if (S.token.value == "extends") { - next(); - extends_ = expression(true); - } - - expect("{"); - // mark in class feild, - const save_in_class = S.in_class; - S.in_class = true; - while (is("punc", ";")) { next(); } // Leading semicolons are okay in class bodies. - while (!is("punc", "}")) { - start = S.token; - method = concise_method_or_getset(as_property_name(), start, true); - if (!method) { unexpected(); } - a.push(method); - while (is("punc", ";")) { next(); } - } - // mark in class feild, - S.in_class = save_in_class; - - S.input.pop_directives_stack(); - - next(); - - return new KindOfClass({ - start: start, - name: class_name, - extends: extends_, - properties: a, - end: prev(), - }); - } - - function concise_method_or_getset(name, start, is_class) { - const get_symbol_ast = (name, SymbolClass = AST_SymbolMethod) => { - if (typeof name === "string" || typeof name === "number") { - return new SymbolClass({ - start, - name: "" + name, - end: prev() - }); - } else if (name === null) { - unexpected(); - } - return name; - }; - - const is_not_method_start = () => - !is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "="); - - var is_async = false; - var is_static = false; - var is_generator = false; - var is_private = false; - var accessor_type = null; - - if (is_class && name === "static" && is_not_method_start()) { - const static_block = class_static_block(); - if (static_block != null) { - return static_block; - } - is_static = true; - name = as_property_name(); - } - if (name === "async" && is_not_method_start()) { - is_async = true; - name = as_property_name(); - } - if (prev().type === "operator" && prev().value === "*") { - is_generator = true; - name = as_property_name(); - } - if ((name === "get" || name === "set") && is_not_method_start()) { - accessor_type = name; - name = as_property_name(); - } - if (prev().type === "privatename") { - is_private = true; - } - - const property_token = prev(); - - if (accessor_type != null) { - if (!is_private) { - const AccessorClass = accessor_type === "get" - ? AST_ObjectGetter - : AST_ObjectSetter; - - name = get_symbol_ast(name); - return annotate(new AccessorClass({ - start, - static: is_static, - key: name, - quote: name instanceof AST_SymbolMethod ? property_token.quote : undefined, - value: create_accessor(), - end: prev() - })); - } else { - const AccessorClass = accessor_type === "get" - ? AST_PrivateGetter - : AST_PrivateSetter; - - return annotate(new AccessorClass({ - start, - static: is_static, - key: get_symbol_ast(name), - value: create_accessor(), - end: prev(), - })); - } - } - - if (is("punc", "(")) { - name = get_symbol_ast(name); - const AST_MethodVariant = is_private - ? AST_PrivateMethod - : AST_ConciseMethod; - var node = new AST_MethodVariant({ - start : start, - static : is_static, - is_generator: is_generator, - async : is_async, - key : name, - quote : name instanceof AST_SymbolMethod ? - property_token.quote : undefined, - value : create_accessor(is_generator, is_async), - end : prev() - }); - return annotate(node); - } - - if (is_class) { - const key = get_symbol_ast(name, AST_SymbolClassProperty); - const quote = key instanceof AST_SymbolClassProperty - ? property_token.quote - : undefined; - const AST_ClassPropertyVariant = is_private - ? AST_ClassPrivateProperty - : AST_ClassProperty; - if (is("operator", "=")) { - next(); - return annotate( - new AST_ClassPropertyVariant({ - start, - static: is_static, - quote, - key, - value: expression(false), - end: prev() - }) - ); - } else if ( - is("name") - || is("privatename") - || is("operator", "*") - || is("punc", ";") - || is("punc", "}") - ) { - return annotate( - new AST_ClassPropertyVariant({ - start, - static: is_static, - quote, - key, - end: prev() - }) - ); - } - } - } - - function class_static_block() { - if (!is("punc", "{")) { - return null; - } - - const start = S.token; - const body = []; - - next(); - - while (!is("punc", "}")) { - body.push(statement()); - } - - next(); - - return new AST_ClassStaticBlock({ start, body, end: prev() }); - } - - function maybe_import_assertion() { - if (is("name", "assert") && !has_newline_before(S.token)) { - next(); - return object_or_destructuring_(); - } - return null; - } - - function import_statement() { - var start = prev(); - - var imported_name; - var imported_names; - if (is("name")) { - imported_name = as_symbol(AST_SymbolImport); - } - - if (is("punc", ",")) { - next(); - } - - imported_names = map_names(true); - - if (imported_names || imported_name) { - expect_token("name", "from"); - } - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - const assert_clause = maybe_import_assertion(); - - return new AST_Import({ - start, - imported_name, - imported_names, - module_name: new AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - assert_clause, - end: S.token, - }); - } - - function import_meta(allow_calls) { - var start = S.token; - expect_token("name", "import"); - expect_token("punc", "."); - expect_token("name", "meta"); - return subscripts(new AST_ImportMeta({ - start: start, - end: prev() - }), allow_calls); - } - - function map_name(is_import) { - function make_symbol(type, quote) { - return new type({ - name: as_property_name(), - quote: quote || undefined, - start: prev(), - end: prev() - }); - } - - var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; - var type = is_import ? AST_SymbolImport : AST_SymbolExport; - var start = S.token; - var foreign_name; - var name; - - if (is_import) { - foreign_name = make_symbol(foreign_type, start.quote); - } else { - name = make_symbol(type, start.quote); - } - if (is("name", "as")) { - next(); // The "as" word - if (is_import) { - name = make_symbol(type); - } else { - foreign_name = make_symbol(foreign_type, S.token.quote); - } - } else if (is_import) { - name = new type(foreign_name); - } else { - foreign_name = new foreign_type(name); - } - - return new AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: prev(), - }); - } - - function map_nameAsterisk(is_import, import_or_export_foreign_name) { - var foreign_type = is_import ? AST_SymbolImportForeign : AST_SymbolExportForeign; - var type = is_import ? AST_SymbolImport : AST_SymbolExport; - var start = S.token; - var name, foreign_name; - var end = prev(); - - if (is_import) { - name = import_or_export_foreign_name; - } else { - foreign_name = import_or_export_foreign_name; - } - - name = name || new type({ - start: start, - name: "*", - end: end, - }); - - foreign_name = foreign_name || new foreign_type({ - start: start, - name: "*", - end: end, - }); - - return new AST_NameMapping({ - start: start, - foreign_name: foreign_name, - name: name, - end: end, - }); - } - - function map_names(is_import) { - var names; - if (is("punc", "{")) { - next(); - names = []; - while (!is("punc", "}")) { - names.push(map_name(is_import)); - if (is("punc", ",")) { - next(); - } - } - next(); - } else if (is("operator", "*")) { - var name; - next(); - if (is("name", "as")) { - next(); // The "as" word - name = is_import ? as_symbol(AST_SymbolImport) : as_symbol_or_string(AST_SymbolExportForeign); - } - names = [map_nameAsterisk(is_import, name)]; - } - return names; - } - - function export_statement() { - var start = S.token; - var is_default; - var exported_names; - - if (is("keyword", "default")) { - is_default = true; - next(); - } else if (exported_names = map_names(false)) { - if (is("name", "from")) { - next(); - - var mod_str = S.token; - if (mod_str.type !== "string") { - unexpected(); - } - next(); - - const assert_clause = maybe_import_assertion(); - - return new AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - module_name: new AST_String({ - start: mod_str, - value: mod_str.value, - quote: mod_str.quote, - end: mod_str, - }), - end: prev(), - assert_clause - }); - } else { - return new AST_Export({ - start: start, - is_default: is_default, - exported_names: exported_names, - end: prev(), - }); - } - } - - var node; - var exported_value; - var exported_definition; - if (is("punc", "{") - || is_default - && (is("keyword", "class") || is("keyword", "function")) - && is_token(peek(), "punc")) { - exported_value = expression(false); - semicolon(); - } else if ((node = statement(is_default)) instanceof AST_Definitions && is_default) { - unexpected(node.start); - } else if ( - node instanceof AST_Definitions - || node instanceof AST_Defun - || node instanceof AST_DefClass - ) { - exported_definition = node; - } else if ( - node instanceof AST_ClassExpression - || node instanceof AST_Function - ) { - exported_value = node; - } else if (node instanceof AST_SimpleStatement) { - exported_value = node.body; - } else { - unexpected(node.start); - } - - return new AST_Export({ - start: start, - is_default: is_default, - exported_value: exported_value, - exported_definition: exported_definition, - end: prev(), - assert_clause: null - }); - } - - function as_property_name() { - var tmp = S.token; - switch (tmp.type) { - case "punc": - if (tmp.value === "[") { - next(); - var ex = expression(false); - expect("]"); - return ex; - } else unexpected(tmp); - case "operator": - if (tmp.value === "*") { - next(); - return null; - } - if (!["delete", "in", "instanceof", "new", "typeof", "void"].includes(tmp.value)) { - unexpected(tmp); - } - /* falls through */ - case "name": - case "privatename": - case "string": - case "num": - case "big_int": - case "keyword": - case "atom": - next(); - return tmp.value; - default: - unexpected(tmp); - } - } - - function as_name() { - var tmp = S.token; - if (tmp.type != "name" && tmp.type != "privatename") unexpected(); - next(); - return tmp.value; - } - - function _make_symbol(type) { - var name = S.token.value; - return new (name == "this" ? AST_This : - name == "super" ? AST_Super : - type)({ - name : String(name), - start : S.token, - end : S.token - }); - } - - function _verify_symbol(sym) { - var name = sym.name; - if (is_in_generator() && name == "yield") { - token_error(sym.start, "Yield cannot be used as identifier inside generators"); - } - if (S.input.has_directive("use strict")) { - if (name == "yield") { - token_error(sym.start, "Unexpected yield identifier inside strict mode"); - } - if (sym instanceof AST_SymbolDeclaration && (name == "arguments" || name == "eval")) { - token_error(sym.start, "Unexpected " + name + " in strict mode"); - } - } - } - - function as_symbol(type, noerror) { - if (!is("name")) { - if (!noerror) croak("Name expected"); - return null; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - function as_symbol_or_string(type) { - if (!is("name")) { - if (!is("string")) { - croak("Name or string expected"); - } - var tok = S.token; - var ret = new type({ - start : tok, - end : tok, - name : tok.value, - quote : tok.quote - }); - next(); - return ret; - } - var sym = _make_symbol(type); - _verify_symbol(sym); - next(); - return sym; - } - - // Annotate AST_Call, AST_Lambda or AST_New with the special comments - function annotate(node, before_token = node.start) { - var comments = before_token.comments_before; - const comments_outside_parens = outer_comments_before_counts.get(before_token); - var i = comments_outside_parens != null ? comments_outside_parens : comments.length; - while (--i >= 0) { - var comment = comments[i]; - if (/[@#]__/.test(comment.value)) { - if (/[@#]__PURE__/.test(comment.value)) { - set_annotation(node, _PURE); - break; - } - if (/[@#]__INLINE__/.test(comment.value)) { - set_annotation(node, _INLINE); - break; - } - if (/[@#]__NOINLINE__/.test(comment.value)) { - set_annotation(node, _NOINLINE); - break; - } - if (/[@#]__KEY__/.test(comment.value)) { - set_annotation(node, _KEY); - break; - } - if (/[@#]__MANGLE_PROP__/.test(comment.value)) { - set_annotation(node, _MANGLEPROP); - break; - } - } - } - return node; - } - - var subscripts = function(expr, allow_calls, is_chain) { - var start = expr.start; - if (is("punc", ".")) { - next(); - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - const AST_DotVariant = is("privatename") ? AST_DotHash : AST_Dot; - return annotate(subscripts(new AST_DotVariant({ - start : start, - expression : expr, - optional : false, - property : as_name(), - end : prev() - }), allow_calls, is_chain)); - } - if (is("punc", "[")) { - next(); - var prop = expression(true); - expect("]"); - return annotate(subscripts(new AST_Sub({ - start : start, - expression : expr, - optional : false, - property : prop, - end : prev() - }), allow_calls, is_chain)); - } - if (allow_calls && is("punc", "(")) { - next(); - var call = new AST_Call({ - start : start, - expression : expr, - optional : false, - args : call_args(), - end : prev() - }); - annotate(call); - return subscripts(call, true, is_chain); - } - - if (is("punc", "?.")) { - next(); - - let chain_contents; - - if (allow_calls && is("punc", "(")) { - next(); - - const call = new AST_Call({ - start, - optional: true, - expression: expr, - args: call_args(), - end: prev() - }); - annotate(call); - - chain_contents = subscripts(call, true, true); - } else if (is("name") || is("privatename")) { - if(is("privatename") && !S.in_class) - croak("Private field must be used in an enclosing class"); - const AST_DotVariant = is("privatename") ? AST_DotHash : AST_Dot; - chain_contents = annotate(subscripts(new AST_DotVariant({ - start, - expression: expr, - optional: true, - property: as_name(), - end: prev() - }), allow_calls, true)); - } else if (is("punc", "[")) { - next(); - const property = expression(true); - expect("]"); - chain_contents = annotate(subscripts(new AST_Sub({ - start, - expression: expr, - optional: true, - property, - end: prev() - }), allow_calls, true)); - } - - if (!chain_contents) unexpected(); - - if (chain_contents instanceof AST_Chain) return chain_contents; - - return new AST_Chain({ - start, - expression: chain_contents, - end: prev() - }); - } - - if (is("template_head")) { - if (is_chain) { - // a?.b`c` is a syntax error - unexpected(); - } - - return subscripts(new AST_PrefixedTemplateString({ - start: start, - prefix: expr, - template_string: template_string(), - end: prev() - }), allow_calls); - } - return expr; - }; - - function call_args() { - var args = []; - while (!is("punc", ")")) { - if (is("expand", "...")) { - next(); - args.push(new AST_Expansion({ - start: prev(), - expression: expression(false), - end: prev() - })); - } else { - args.push(expression(false)); - } - if (!is("punc", ")")) { - expect(","); - } - } - next(); - return args; - } - - var maybe_unary = function(allow_calls, allow_arrows) { - var start = S.token; - if (start.type == "name" && start.value == "await" && can_await()) { - next(); - return _await_expression(); - } - if (is("operator") && UNARY_PREFIX.has(start.value)) { - next(); - handle_regexp(); - var ex = make_unary(AST_UnaryPrefix, start, maybe_unary(allow_calls)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(allow_calls, allow_arrows); - while (is("operator") && UNARY_POSTFIX.has(S.token.value) && !has_newline_before(S.token)) { - if (val instanceof AST_Arrow) unexpected(); - val = make_unary(AST_UnaryPostfix, S.token, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - }; - - function make_unary(ctor, token, expr) { - var op = token.value; - switch (op) { - case "++": - case "--": - if (!is_assignable(expr)) - croak("Invalid use of " + op + " operator", token.line, token.col, token.pos); - break; - case "delete": - if (expr instanceof AST_SymbolRef && S.input.has_directive("use strict")) - croak("Calling delete on expression not allowed in strict mode", expr.start.line, expr.start.col, expr.start.pos); - break; - } - return new ctor({ operator: op, expression: expr }); - } - - var expr_op = function(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - if (op == "**" && left instanceof AST_UnaryPrefix - /* unary token in front not allowed - parenthesis required */ - && !is_token(left.start, "punc", "(") - && left.operator !== "--" && left.operator !== "++") - unexpected(left.start); - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && (prec > min_prec || (op === "**" && min_prec === prec))) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(new AST_Binary({ - start : left.start, - left : left, - operator : op, - right : right, - end : right.end - }), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(true, true), 0, no_in); - } - - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return new AST_Conditional({ - start : start, - condition : expr, - consequent : yes, - alternative : expression(false, no_in), - end : prev() - }); - } - return expr; - }; - - function is_assignable(expr) { - return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef; - } - - function to_destructuring(node) { - if (node instanceof AST_Object) { - node = new AST_Destructuring({ - start: node.start, - names: node.properties.map(to_destructuring), - is_array: false, - end: node.end - }); - } else if (node instanceof AST_Array) { - var names = []; - - for (var i = 0; i < node.elements.length; i++) { - // Only allow expansion as last element - if (node.elements[i] instanceof AST_Expansion) { - if (i + 1 !== node.elements.length) { - token_error(node.elements[i].start, "Spread must the be last element in destructuring array"); - } - node.elements[i].expression = to_destructuring(node.elements[i].expression); - } - - names.push(to_destructuring(node.elements[i])); - } - - node = new AST_Destructuring({ - start: node.start, - names: names, - is_array: true, - end: node.end - }); - } else if (node instanceof AST_ObjectProperty) { - node.value = to_destructuring(node.value); - } else if (node instanceof AST_Assign) { - node = new AST_DefaultAssign({ - start: node.start, - left: node.left, - operator: "=", - right: node.right, - end: node.end - }); - } - return node; - } - - // In ES6, AssignmentExpression can also be an ArrowFunction - var maybe_assign = function(no_in) { - handle_regexp(); - var start = S.token; - - if (start.type == "name" && start.value == "yield") { - if (is_in_generator()) { - next(); - return _yield_expression(); - } else if (S.input.has_directive("use strict")) { - token_error(S.token, "Unexpected yield identifier inside strict mode"); - } - } - - var left = maybe_conditional(no_in); - var val = S.token.value; - - if (is("operator") && ASSIGNMENT.has(val)) { - if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { - next(); - - return new AST_Assign({ - start : start, - left : left, - operator : val, - right : maybe_assign(no_in), - logical : LOGICAL_ASSIGNMENT.has(val), - end : prev() - }); - } - croak("Invalid assignment"); - } - return left; - }; - - var to_expr_or_sequence = function(start, exprs) { - if (exprs.length === 1) { - return exprs[0]; - } else if (exprs.length > 1) { - return new AST_Sequence({ start, expressions: exprs, end: peek() }); - } else { - croak("Invalid parenthesized expression"); - } - }; - - var expression = function(commas, no_in) { - var start = S.token; - var exprs = []; - while (true) { - exprs.push(maybe_assign(no_in)); - if (!commas || !is("punc", ",")) break; - next(); - commas = true; - } - return to_expr_or_sequence(start, exprs); - }; - - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - } - - if (options.expression) { - return expression(true); - } - - return (function parse_toplevel() { - var start = S.token; - var body = []; - S.input.push_directives_stack(); - if (options.module) S.input.add_directive("use strict"); - while (!is("eof")) { - body.push(statement()); - } - S.input.pop_directives_stack(); - var end = prev(); - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new AST_Toplevel({ start: start, body: body, end: end }); - } - TEMPLATE_RAWS = new Map(); - return toplevel; - })(); - -} - -export { - get_full_char_code, - get_full_char, - is_identifier_char, - is_basic_identifier_string, - is_identifier_string, - is_surrogate_pair_head, - is_surrogate_pair_tail, - js_error, - JS_Parse_Error, - parse, - PRECEDENCE, - ALL_RESERVED_WORDS, - tokenizer, -}; diff --git a/node_modules/terser/lib/propmangle.js b/node_modules/terser/lib/propmangle.js deleted file mode 100644 index e895705..0000000 --- a/node_modules/terser/lib/propmangle.js +++ /dev/null @@ -1,432 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; -/* global global, self */ - -import { - defaults, - push_uniq, - has_annotation, - clear_annotation, -} from "./utils/index.js"; -import { base54 } from "./scope.js"; -import { - AST_Binary, - AST_Call, - AST_ClassPrivateProperty, - AST_Conditional, - AST_Dot, - AST_DotHash, - AST_ObjectKeyVal, - AST_ObjectProperty, - AST_PrivateMethod, - AST_PrivateGetter, - AST_PrivateSetter, - AST_PrivateIn, - AST_Sequence, - AST_String, - AST_Sub, - TreeTransformer, - TreeWalker, - _KEY, - _MANGLEPROP, - - walk, -} from "./ast.js"; -import { domprops } from "../tools/domprops.js"; - -function find_builtins(reserved) { - domprops.forEach(add); - - // Compatibility fix for some standard defined globals not defined on every js environment - var new_globals = ["Symbol", "Map", "Promise", "Proxy", "Reflect", "Set", "WeakMap", "WeakSet"]; - var objects = {}; - var global_ref = typeof global === "object" ? global : self; - - new_globals.forEach(function (new_global) { - objects[new_global] = global_ref[new_global] || function() {}; - }); - - [ - "null", - "true", - "false", - "NaN", - "Infinity", - "-Infinity", - "undefined", - ].forEach(add); - [ Object, Array, Function, Number, - String, Boolean, Error, Math, - Date, RegExp, objects.Symbol, ArrayBuffer, - DataView, decodeURI, decodeURIComponent, - encodeURI, encodeURIComponent, eval, EvalError, - Float32Array, Float64Array, Int8Array, Int16Array, - Int32Array, isFinite, isNaN, JSON, objects.Map, parseFloat, - parseInt, objects.Promise, objects.Proxy, RangeError, ReferenceError, - objects.Reflect, objects.Set, SyntaxError, TypeError, Uint8Array, - Uint8ClampedArray, Uint16Array, Uint32Array, URIError, - objects.WeakMap, objects.WeakSet - ].forEach(function(ctor) { - Object.getOwnPropertyNames(ctor).map(add); - if (ctor.prototype) { - Object.getOwnPropertyNames(ctor.prototype).map(add); - } - }); - function add(name) { - reserved.add(name); - } -} - -function reserve_quoted_keys(ast, reserved) { - function add(name) { - push_uniq(reserved, name); - } - - ast.walk(new TreeWalker(function(node) { - if (node instanceof AST_ObjectKeyVal && node.quote) { - add(node.key); - } else if (node instanceof AST_ObjectProperty && node.quote) { - add(node.key.name); - } else if (node instanceof AST_Sub) { - addStrings(node.property, add); - } - })); -} - -function addStrings(node, add) { - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_Sequence) { - addStrings(node.tail_node(), add); - } else if (node instanceof AST_String) { - add(node.value); - } else if (node instanceof AST_Conditional) { - addStrings(node.consequent, add); - addStrings(node.alternative, add); - } - return true; - })); -} - -function mangle_private_properties(ast, options) { - var cprivate = -1; - var private_cache = new Map(); - var nth_identifier = options.nth_identifier || base54; - - ast = ast.transform(new TreeTransformer(function(node) { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_PrivateIn - ) { - node.key.name = mangle_private(node.key.name); - } else if (node instanceof AST_DotHash) { - node.property = mangle_private(node.property); - } - })); - return ast; - - function mangle_private(name) { - let mangled = private_cache.get(name); - if (!mangled) { - mangled = nth_identifier.get(++cprivate); - private_cache.set(name, mangled); - } - - return mangled; - } -} - -function find_annotated_props(ast) { - var annotated_props = new Set(); - walk(ast, node => { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_DotHash - ) { - // handled by mangle_private_properties - } else if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string" && has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - if (has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.key.name); - } - } else if (node instanceof AST_Dot) { - if (has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.property); - } - } else if (node instanceof AST_Sub) { - if (node.property instanceof AST_String && has_annotation(node, _MANGLEPROP)) { - annotated_props.add(node.property.value); - } - } - }); - return annotated_props; -} - -function mangle_properties(ast, options, annotated_props = find_annotated_props(ast)) { - options = defaults(options, { - builtins: false, - cache: null, - debug: false, - keep_quoted: false, - nth_identifier: base54, - only_cache: false, - regex: null, - reserved: null, - undeclared: false, - only_annotated: false, - }, true); - - var nth_identifier = options.nth_identifier; - - var reserved_option = options.reserved; - if (!Array.isArray(reserved_option)) reserved_option = [reserved_option]; - var reserved = new Set(reserved_option); - if (!options.builtins) find_builtins(reserved); - - var cname = -1; - - var cache; - if (options.cache) { - cache = options.cache.props; - } else { - cache = new Map(); - } - - var only_annotated = options.only_annotated; - var regex = options.regex && new RegExp(options.regex); - - // note debug is either false (disabled), or a string of the debug suffix to use (enabled). - // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true' - // the same as passing an empty string. - var debug = options.debug !== false; - var debug_name_suffix; - if (debug) { - debug_name_suffix = (options.debug === true ? "" : options.debug); - } - - var names_to_mangle = new Set(); - var unmangleable = new Set(); - // Track each already-mangled name to prevent nth_identifier from generating - // the same name. - cache.forEach((mangled_name) => unmangleable.add(mangled_name)); - - var keep_quoted = !!options.keep_quoted; - - // step 1: find candidates to mangle - ast.walk(new TreeWalker(function(node) { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_DotHash - ) { - // handled by mangle_private_properties - } else if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { - add(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter or getter, since KeyVal is handled above - if (!keep_quoted || !node.quote) { - add(node.key.name); - } - } else if (node instanceof AST_Dot) { - var declared = !!options.undeclared; - if (!declared) { - var root = node; - while (root.expression) { - root = root.expression; - } - declared = !(root.thedef && root.thedef.undeclared); - } - if (declared && - (!keep_quoted || !node.quote)) { - add(node.property); - } - } else if (node instanceof AST_Sub) { - if (!keep_quoted) { - addStrings(node.property, add); - } - } else if (node instanceof AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - addStrings(node.args[1], add); - } else if (node instanceof AST_Binary && node.operator === "in") { - addStrings(node.left, add); - } else if (node instanceof AST_String && has_annotation(node, _KEY)) { - add(node.value); - } - })); - - // step 2: transform the tree, renaming properties - return ast.transform(new TreeTransformer(function(node) { - if ( - node instanceof AST_ClassPrivateProperty - || node instanceof AST_PrivateMethod - || node instanceof AST_PrivateGetter - || node instanceof AST_PrivateSetter - || node instanceof AST_DotHash - ) { - // handled by mangle_private_properties - } else if (node instanceof AST_ObjectKeyVal) { - if (typeof node.key == "string" && (!keep_quoted || !node.quote)) { - node.key = mangle(node.key); - } - } else if (node instanceof AST_ObjectProperty) { - // setter, getter, method or class field - if (!keep_quoted || !node.quote) { - node.key.name = mangle(node.key.name); - } - } else if (node instanceof AST_Dot) { - if (!keep_quoted || !node.quote) { - node.property = mangle(node.property); - } - } else if (!keep_quoted && node instanceof AST_Sub) { - node.property = mangleStrings(node.property); - } else if (node instanceof AST_Call - && node.expression.print_to_string() == "Object.defineProperty") { - node.args[1] = mangleStrings(node.args[1]); - } else if (node instanceof AST_Binary && node.operator === "in") { - node.left = mangleStrings(node.left); - } else if (node instanceof AST_String && has_annotation(node, _KEY)) { - // Clear _KEY annotation to prevent double mangling - clear_annotation(node, _KEY); - node.value = mangle(node.value); - } - })); - - // only function declarations after this line - - function can_mangle(name) { - if (unmangleable.has(name)) return false; - if (reserved.has(name)) return false; - if (options.only_cache) { - return cache.has(name); - } - if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false; - return true; - } - - function should_mangle(name) { - if (only_annotated && !annotated_props.has(name)) return false; - if (regex && !regex.test(name)) { - return annotated_props.has(name); - } - if (reserved.has(name)) return false; - return cache.has(name) - || names_to_mangle.has(name); - } - - function add(name) { - if (can_mangle(name)) { - names_to_mangle.add(name); - } - - if (!should_mangle(name)) { - unmangleable.add(name); - } - } - - function mangle(name) { - if (!should_mangle(name)) { - return name; - } - - var mangled = cache.get(name); - if (!mangled) { - if (debug) { - // debug mode: use a prefix and suffix to preserve readability, e.g. o.foo -> o._$foo$NNN_. - var debug_mangled = "_$" + name + "$" + debug_name_suffix + "_"; - - if (can_mangle(debug_mangled)) { - mangled = debug_mangled; - } - } - - // either debug mode is off, or it is on and we could not use the mangled name - if (!mangled) { - do { - mangled = nth_identifier.get(++cname); - } while (!can_mangle(mangled)); - } - - cache.set(name, mangled); - } - return mangled; - } - - function mangleStrings(node) { - return node.transform(new TreeTransformer(function(node) { - if (node instanceof AST_Sequence) { - var last = node.expressions.length - 1; - node.expressions[last] = mangleStrings(node.expressions[last]); - } else if (node instanceof AST_String) { - // Clear _KEY annotation to prevent double mangling - clear_annotation(node, _KEY); - node.value = mangle(node.value); - } else if (node instanceof AST_Conditional) { - node.consequent = mangleStrings(node.consequent); - node.alternative = mangleStrings(node.alternative); - } - return node; - })); - } -} - -export { - reserve_quoted_keys, - mangle_properties, - mangle_private_properties, - find_annotated_props, -}; diff --git a/node_modules/terser/lib/scope.js b/node_modules/terser/lib/scope.js deleted file mode 100644 index f8a22a5..0000000 --- a/node_modules/terser/lib/scope.js +++ /dev/null @@ -1,1066 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -import { - defaults, - keep_name, - mergeSort, - push_uniq, - make_node, - return_false, - return_this, - return_true, - string_template, -} from "./utils/index.js"; -import { - AST_Arrow, - AST_Block, - AST_Call, - AST_Class, - AST_Conditional, - AST_DefClass, - AST_Defun, - AST_Destructuring, - AST_Dot, - AST_DotHash, - AST_Export, - AST_For, - AST_ForIn, - AST_ForOf, - AST_Function, - AST_Import, - AST_IterationStatement, - AST_Label, - AST_LabeledStatement, - AST_LabelRef, - AST_Lambda, - AST_LoopControl, - AST_NameMapping, - AST_Node, - AST_Scope, - AST_Sequence, - AST_String, - AST_Sub, - AST_Switch, - AST_SwitchBranch, - AST_Symbol, - AST_SymbolBlockDeclaration, - AST_SymbolCatch, - AST_SymbolClass, - AST_SymbolConst, - AST_SymbolDefClass, - AST_SymbolDefun, - AST_SymbolExport, - AST_SymbolFunarg, - AST_SymbolImport, - AST_SymbolLambda, - AST_SymbolLet, - AST_SymbolMethod, - AST_SymbolRef, - AST_SymbolVar, - AST_Toplevel, - AST_VarDef, - AST_With, - TreeWalker, - walk, - walk_abort -} from "./ast.js"; -import { - ALL_RESERVED_WORDS, - js_error, -} from "./parse.js"; - -const MASK_EXPORT_DONT_MANGLE = 1 << 0; -const MASK_EXPORT_WANT_MANGLE = 1 << 1; - -let function_defs = null; -let unmangleable_names = null; -/** - * When defined, there is a function declaration somewhere that's inside of a block. - * See https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-block-level-function-declarations-web-legacy-compatibility-semantics -*/ -let scopes_with_block_defuns = null; - -class SymbolDef { - constructor(scope, orig, init) { - this.name = orig.name; - this.orig = [ orig ]; - this.init = init; - this.eliminated = 0; - this.assignments = 0; - this.scope = scope; - this.replaced = 0; - this.global = false; - this.export = 0; - this.mangled_name = null; - this.undeclared = false; - this.id = SymbolDef.next_id++; - this.chained = false; - this.direct_access = false; - this.escaped = 0; - this.recursive_refs = 0; - this.references = []; - this.should_replace = undefined; - this.single_use = false; - this.fixed = false; - Object.seal(this); - } - fixed_value() { - if (!this.fixed || this.fixed instanceof AST_Node) return this.fixed; - return this.fixed(); - } - unmangleable(options) { - if (!options) options = {}; - - if ( - function_defs && - function_defs.has(this.id) && - keep_name(options.keep_fnames, this.orig[0].name) - ) return true; - - return this.global && !options.toplevel - || (this.export & MASK_EXPORT_DONT_MANGLE) - || this.undeclared - || !options.eval && this.scope.pinned() - || (this.orig[0] instanceof AST_SymbolLambda - || this.orig[0] instanceof AST_SymbolDefun) && keep_name(options.keep_fnames, this.orig[0].name) - || this.orig[0] instanceof AST_SymbolMethod - || (this.orig[0] instanceof AST_SymbolClass - || this.orig[0] instanceof AST_SymbolDefClass) && keep_name(options.keep_classnames, this.orig[0].name); - } - mangle(options) { - const cache = options.cache && options.cache.props; - if (this.global && cache && cache.has(this.name)) { - this.mangled_name = cache.get(this.name); - } else if (!this.mangled_name && !this.unmangleable(options)) { - var s = this.scope; - var sym = this.orig[0]; - if (options.ie8 && sym instanceof AST_SymbolLambda) - s = s.parent_scope; - const redefinition = redefined_catch_def(this); - this.mangled_name = redefinition - ? redefinition.mangled_name || redefinition.name - : s.next_mangled(options, this); - if (this.global && cache) { - cache.set(this.name, this.mangled_name); - } - } - } -} - -SymbolDef.next_id = 1; - -function redefined_catch_def(def) { - if (def.orig[0] instanceof AST_SymbolCatch - && def.scope.is_block_scope() - ) { - return def.scope.get_defun_scope().variables.get(def.name); - } -} - -AST_Scope.DEFMETHOD("figure_out_scope", function(options, { parent_scope = null, toplevel = this } = {}) { - options = defaults(options, { - cache: null, - ie8: false, - safari10: false, - module: false, - }); - - if (!(toplevel instanceof AST_Toplevel)) { - throw new Error("Invalid toplevel scope"); - } - - // pass 1: setup scope chaining and handle definitions - var scope = this.parent_scope = parent_scope; - var labels = new Map(); - var defun = null; - var in_destructuring = null; - var for_scopes = []; - var tw = new TreeWalker((node, descend) => { - if (node.is_block_scope()) { - const save_scope = scope; - node.block_scope = scope = new AST_Scope(node); - scope._block_scope = true; - scope.init_scope_vars(save_scope); - scope.uses_with = save_scope.uses_with; - scope.uses_eval = save_scope.uses_eval; - - if (options.safari10) { - if (node instanceof AST_For || node instanceof AST_ForIn || node instanceof AST_ForOf) { - for_scopes.push(scope); - } - } - - if (node instanceof AST_Switch) { - // XXX: HACK! Ensure the switch expression gets the correct scope (the parent scope) and the body gets the contained scope - // AST_Switch has a scope within the body, but it itself "is a block scope" - // This means the switched expression has to belong to the outer scope - // while the body inside belongs to the switch itself. - // This is pretty nasty and warrants an AST change - const the_block_scope = scope; - scope = save_scope; - node.expression.walk(tw); - scope = the_block_scope; - for (let i = 0; i < node.body.length; i++) { - node.body[i].walk(tw); - } - } else { - descend(); - } - scope = save_scope; - return true; - } - if (node instanceof AST_Destructuring) { - const save_destructuring = in_destructuring; - in_destructuring = node; - descend(); - in_destructuring = save_destructuring; - return true; - } - if (node instanceof AST_Scope) { - node.init_scope_vars(scope); - var save_scope = scope; - var save_defun = defun; - var save_labels = labels; - defun = scope = node; - labels = new Map(); - descend(); - scope = save_scope; - defun = save_defun; - labels = save_labels; - return true; // don't descend again in TreeWalker - } - if (node instanceof AST_LabeledStatement) { - var l = node.label; - if (labels.has(l.name)) { - throw new Error(string_template("Label {name} defined twice", l)); - } - labels.set(l.name, l); - descend(); - labels.delete(l.name); - return true; // no descend again - } - if (node instanceof AST_With) { - for (var s = scope; s; s = s.parent_scope) - s.uses_with = true; - return; - } - if (node instanceof AST_Symbol) { - node.scope = scope; - } - if (node instanceof AST_Label) { - node.thedef = node; - node.references = []; - } - if (node instanceof AST_SymbolLambda) { - defun.def_function(node, node.name == "arguments" ? undefined : defun); - } else if (node instanceof AST_SymbolDefun) { - // Careful here, the scope where this should be defined is - // the parent scope. The reason is that we enter a new - // scope when we encounter the AST_Defun node (which is - // instanceof AST_Scope) but we get to the symbol a bit - // later. - const closest_scope = defun.parent_scope; - - // In strict mode, function definitions are block-scoped - node.scope = tw.directives["use strict"] - ? closest_scope - : closest_scope.get_defun_scope(); - - mark_export(node.scope.def_function(node, defun), 1); - } else if (node instanceof AST_SymbolClass) { - mark_export(defun.def_variable(node, defun), 1); - } else if (node instanceof AST_SymbolImport) { - scope.def_variable(node); - } else if (node instanceof AST_SymbolDefClass) { - // This deals with the name of the class being available - // inside the class. - mark_export((node.scope = defun.parent_scope).def_function(node, defun), 1); - } else if ( - node instanceof AST_SymbolVar - || node instanceof AST_SymbolLet - || node instanceof AST_SymbolConst - || node instanceof AST_SymbolCatch - ) { - var def; - if (node instanceof AST_SymbolBlockDeclaration) { - def = scope.def_variable(node, null); - } else { - def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined); - } - if (!def.orig.every((sym) => { - if (sym === node) return true; - if (node instanceof AST_SymbolBlockDeclaration) { - return sym instanceof AST_SymbolLambda; - } - return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst); - })) { - js_error( - `"${node.name}" is redeclared`, - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - if (!(node instanceof AST_SymbolFunarg)) mark_export(def, 2); - if (defun !== scope) { - node.mark_enclosed(); - var def = scope.find_variable(node); - if (node.thedef !== def) { - node.thedef = def; - node.reference(); - } - } - } else if (node instanceof AST_LabelRef) { - var sym = labels.get(node.name); - if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { - name: node.name, - line: node.start.line, - col: node.start.col - })); - node.thedef = sym; - } - if (!(scope instanceof AST_Toplevel) && (node instanceof AST_Export || node instanceof AST_Import)) { - js_error( - `"${node.TYPE}" statement may only appear at the top level`, - node.start.file, - node.start.line, - node.start.col, - node.start.pos - ); - } - }); - - if (options.module) { - tw.directives["use strict"] = true; - } - - this.walk(tw); - - function mark_export(def, level) { - if (in_destructuring) { - var i = 0; - do { - level++; - } while (tw.parent(i++) !== in_destructuring); - } - var node = tw.parent(level); - if (def.export = node instanceof AST_Export ? MASK_EXPORT_DONT_MANGLE : 0) { - var exported = node.exported_definition; - if ((exported instanceof AST_Defun || exported instanceof AST_DefClass) && node.is_default) { - def.export = MASK_EXPORT_WANT_MANGLE; - } - } - } - - // pass 2: find back references and eval - const is_toplevel = this instanceof AST_Toplevel; - if (is_toplevel) { - this.globals = new Map(); - } - - var tw = new TreeWalker(node => { - if (node instanceof AST_LoopControl && node.label) { - node.label.thedef.references.push(node); - return true; - } - if (node instanceof AST_SymbolRef) { - var name = node.name; - if (name == "eval" && tw.parent() instanceof AST_Call) { - for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) { - s.uses_eval = true; - } - } - var sym; - if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name - || !(sym = node.scope.find_variable(name))) { - - sym = toplevel.def_global(node); - if (node instanceof AST_SymbolExport) sym.export = MASK_EXPORT_DONT_MANGLE; - } else if (sym.scope instanceof AST_Lambda && name == "arguments") { - sym.scope.get_defun_scope().uses_arguments = true; - } - node.thedef = sym; - node.reference(); - if (node.scope.is_block_scope() - && !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) { - node.scope = node.scope.get_defun_scope(); - } - return true; - } - // ensure mangling works if catch reuses a scope variable - var def; - if (node instanceof AST_SymbolCatch && (def = redefined_catch_def(node.definition()))) { - var s = node.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } - } - }); - this.walk(tw); - - // pass 3: work around IE8 and Safari catch scope bugs - if (options.ie8 || options.safari10) { - walk(this, node => { - if (node instanceof AST_SymbolCatch) { - var name = node.name; - var refs = node.thedef.references; - var scope = node.scope.get_defun_scope(); - var def = scope.find_variable(name) - || toplevel.globals.get(name) - || scope.def_variable(node); - refs.forEach(function(ref) { - ref.thedef = def; - ref.reference(); - }); - node.thedef = def; - node.reference(); - return true; - } - }); - } - - // pass 4: add symbol definitions to loop scopes - // Safari/Webkit bug workaround - loop init let variable shadowing argument. - // https://github.com/mishoo/UglifyJS2/issues/1753 - // https://bugs.webkit.org/show_bug.cgi?id=171041 - if (options.safari10) { - for (const scope of for_scopes) { - scope.parent_scope.variables.forEach(function(def) { - push_uniq(scope.enclosed, def); - }); - } - } -}); - -AST_Toplevel.DEFMETHOD("def_global", function(node) { - var globals = this.globals, name = node.name; - if (globals.has(name)) { - return globals.get(name); - } else { - var g = new SymbolDef(this, node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - return g; - } -}); - -AST_Scope.DEFMETHOD("init_scope_vars", function(parent_scope) { - this.variables = new Map(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) - this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement - this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` - this.parent_scope = parent_scope; // the parent scope - this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes - this.cname = -1; // the current index for mangling functions/variables -}); - -AST_Scope.DEFMETHOD("conflicting_def", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - || (this.parent_scope && this.parent_scope.conflicting_def(name)) - ); -}); - -AST_Scope.DEFMETHOD("conflicting_def_shallow", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - ); -}); - -AST_Scope.DEFMETHOD("add_child_scope", function (scope) { - // `scope` is going to be moved into `this` right now. - // Update the required scopes' information - - if (scope.parent_scope === this) return; - - scope.parent_scope = this; - - // Propagate to this.uses_arguments from arrow functions - if ((scope instanceof AST_Arrow) && !this.uses_arguments) { - this.uses_arguments = walk(scope, node => { - if ( - node instanceof AST_SymbolRef - && node.scope instanceof AST_Lambda - && node.name === "arguments" - ) { - return walk_abort; - } - - if (node instanceof AST_Lambda && !(node instanceof AST_Arrow)) { - return true; - } - }); - } - - this.uses_with = this.uses_with || scope.uses_with; - this.uses_eval = this.uses_eval || scope.uses_eval; - - const scope_ancestry = (() => { - const ancestry = []; - let cur = this; - do { - ancestry.push(cur); - } while ((cur = cur.parent_scope)); - ancestry.reverse(); - return ancestry; - })(); - - const new_scope_enclosed_set = new Set(scope.enclosed); - const to_enclose = []; - for (const scope_topdown of scope_ancestry) { - to_enclose.forEach(e => push_uniq(scope_topdown.enclosed, e)); - for (const def of scope_topdown.variables.values()) { - if (new_scope_enclosed_set.has(def)) { - push_uniq(to_enclose, def); - push_uniq(scope_topdown.enclosed, def); - } - } - } -}); - -function find_scopes_visible_from(scopes) { - const found_scopes = new Set(); - - for (const scope of new Set(scopes)) { - (function bubble_up(scope) { - if (scope == null || found_scopes.has(scope)) return; - - found_scopes.add(scope); - - bubble_up(scope.parent_scope); - })(scope); - } - - return [...found_scopes]; -} - -// Creates a symbol during compression -AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { - source, - tentative_name, - scope, - conflict_scopes = [scope], - init = null -} = {}) { - let symbol_name; - - conflict_scopes = find_scopes_visible_from(conflict_scopes); - - if (tentative_name) { - // Implement hygiene (no new names are conflicting with existing names) - tentative_name = - symbol_name = - tentative_name.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); - - let i = 0; - while (conflict_scopes.find(s => s.conflicting_def_shallow(symbol_name))) { - symbol_name = tentative_name + "$" + i++; - } - } - - if (!symbol_name) { - throw new Error("No symbol name could be generated in create_symbol()"); - } - - const symbol = make_node(SymClass, source, { - name: symbol_name, - scope - }); - - this.def_variable(symbol, init || null); - - symbol.mark_enclosed(); - - return symbol; -}); - - -AST_Node.DEFMETHOD("is_block_scope", return_false); -AST_Class.DEFMETHOD("is_block_scope", return_false); -AST_Lambda.DEFMETHOD("is_block_scope", return_false); -AST_Toplevel.DEFMETHOD("is_block_scope", return_false); -AST_SwitchBranch.DEFMETHOD("is_block_scope", return_false); -AST_Block.DEFMETHOD("is_block_scope", return_true); -AST_Scope.DEFMETHOD("is_block_scope", function () { - return this._block_scope || false; -}); -AST_IterationStatement.DEFMETHOD("is_block_scope", return_true); - -AST_Lambda.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; - this.def_variable(new AST_SymbolFunarg({ - name: "arguments", - start: this.start, - end: this.end - })); -}); - -AST_Arrow.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; -}); - -AST_Symbol.DEFMETHOD("mark_enclosed", function() { - var def = this.definition(); - var s = this.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } -}); - -AST_Symbol.DEFMETHOD("reference", function() { - this.definition().references.push(this); - this.mark_enclosed(); -}); - -AST_Scope.DEFMETHOD("find_variable", function(name) { - if (name instanceof AST_Symbol) name = name.name; - return this.variables.get(name) - || (this.parent_scope && this.parent_scope.find_variable(name)); -}); - -AST_Scope.DEFMETHOD("def_function", function(symbol, init) { - var def = this.def_variable(symbol, init); - if (!def.init || def.init instanceof AST_Defun) def.init = init; - return def; -}); - -AST_Scope.DEFMETHOD("def_variable", function(symbol, init) { - var def = this.variables.get(symbol.name); - if (def) { - def.orig.push(symbol); - if (def.init && (def.scope !== symbol.scope || def.init instanceof AST_Function)) { - def.init = init; - } - } else { - def = new SymbolDef(this, symbol, init); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } - return symbol.thedef = def; -}); - -function next_mangled(scope, options) { - let defun_scope; - if ( - scopes_with_block_defuns - && (defun_scope = scope.get_defun_scope()) - && scopes_with_block_defuns.has(defun_scope) - ) { - scope = defun_scope; - } - - var ext = scope.enclosed; - var nth_identifier = options.nth_identifier; - out: while (true) { - var m = nth_identifier.get(++scope.cname); - if (ALL_RESERVED_WORDS.has(m)) continue; // skip over "do" - - // https://github.com/mishoo/UglifyJS2/issues/242 -- do not - // shadow a name reserved from mangling. - if (options.reserved.has(m)) continue; - - // Functions with short names might collide with base54 output - // and therefore cause collisions when keep_fnames is true. - if (unmangleable_names && unmangleable_names.has(m)) continue out; - - // we must ensure that the mangled name does not shadow a name - // from some parent scope that is referenced in this or in - // inner scopes. - for (let i = ext.length; --i >= 0;) { - const def = ext[i]; - const name = def.mangled_name || (def.unmangleable(options) && def.name); - if (m == name) continue out; - } - return m; - } -} - -AST_Scope.DEFMETHOD("next_mangled", function(options) { - return next_mangled(this, options); -}); - -AST_Toplevel.DEFMETHOD("next_mangled", function(options) { - let name; - const mangled_names = this.mangled_names; - do { - name = next_mangled(this, options); - } while (mangled_names.has(name)); - return name; -}); - -AST_Function.DEFMETHOD("next_mangled", function(options, def) { - // #179, #326 - // in Safari strict mode, something like (function x(x){...}) is a syntax error; - // a function expression's argument cannot shadow the function expression's name - - var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition(); - - // the function's mangled_name is null when keep_fnames is true - var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null; - - while (true) { - var name = next_mangled(this, options); - if (!tricky_name || tricky_name != name) - return name; - } -}); - -AST_Symbol.DEFMETHOD("unmangleable", function(options) { - var def = this.definition(); - return !def || def.unmangleable(options); -}); - -// labels are always mangleable -AST_Label.DEFMETHOD("unmangleable", return_false); - -AST_Symbol.DEFMETHOD("unreferenced", function() { - return !this.definition().references.length && !this.scope.pinned(); -}); - -AST_Symbol.DEFMETHOD("definition", function() { - return this.thedef; -}); - -AST_Symbol.DEFMETHOD("global", function() { - return this.thedef.global; -}); - -/** - * Format the mangler options (if any) into their appropriate types - */ -export function format_mangler_options(options) { - options = defaults(options, { - eval : false, - nth_identifier : base54, - ie8 : false, - keep_classnames: false, - keep_fnames : false, - module : false, - reserved : [], - toplevel : false, - }); - if (options.module) options.toplevel = true; - if (!Array.isArray(options.reserved) - && !(options.reserved instanceof Set) - ) { - options.reserved = []; - } - options.reserved = new Set(options.reserved); - // Never mangle arguments - options.reserved.add("arguments"); - return options; -} - -AST_Toplevel.DEFMETHOD("mangle_names", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - - // We only need to mangle declaration nodes. Special logic wired - // into the code generator will display the mangled name if it's - // present (and for AST_SymbolRef-s it'll use the mangled name of - // the AST_SymbolDeclaration that it points to). - var lname = -1; - var to_mangle = []; - - if (options.keep_fnames) { - function_defs = new Set(); - } - - const mangled_names = this.mangled_names = new Set(); - unmangleable_names = new Set(); - - if (options.cache) { - this.globals.forEach(collect); - if (options.cache.props) { - options.cache.props.forEach(function(mangled_name) { - mangled_names.add(mangled_name); - }); - } - } - - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_LabeledStatement) { - // lname is incremented when we get to the AST_Label - var save_nesting = lname; - descend(); - lname = save_nesting; - return true; // don't descend again in TreeWalker - } - if ( - node instanceof AST_Defun - && !(tw.parent() instanceof AST_Scope) - ) { - scopes_with_block_defuns = scopes_with_block_defuns || new Set(); - scopes_with_block_defuns.add(node.parent_scope.get_defun_scope()); - } - if (node instanceof AST_Scope) { - node.variables.forEach(collect); - return; - } - if (node.is_block_scope()) { - node.block_scope.variables.forEach(collect); - return; - } - if ( - function_defs - && node instanceof AST_VarDef - && node.value instanceof AST_Lambda - && !node.value.name - && keep_name(options.keep_fnames, node.name.name) - ) { - function_defs.add(node.name.definition().id); - return; - } - if (node instanceof AST_Label) { - let name; - do { - name = nth_identifier.get(++lname); - } while (ALL_RESERVED_WORDS.has(name)); - node.mangled_name = name; - return true; - } - if (!(options.ie8 || options.safari10) && node instanceof AST_SymbolCatch) { - to_mangle.push(node.definition()); - return; - } - }); - - this.walk(tw); - - if (options.keep_fnames || options.keep_classnames) { - // Collect a set of short names which are unmangleable, - // for use in avoiding collisions in next_mangled. - to_mangle.forEach(def => { - if (def.name.length < 6 && def.unmangleable(options)) { - unmangleable_names.add(def.name); - } - }); - } - - to_mangle.forEach(def => { def.mangle(options); }); - - function_defs = null; - unmangleable_names = null; - scopes_with_block_defuns = null; - - function collect(symbol) { - if (symbol.export & MASK_EXPORT_DONT_MANGLE) { - unmangleable_names.add(symbol.name); - } else if (!options.reserved.has(symbol.name)) { - to_mangle.push(symbol); - } - } -}); - -AST_Toplevel.DEFMETHOD("find_colliding_names", function(options) { - const cache = options.cache && options.cache.props; - const avoid = new Set(); - options.reserved.forEach(to_avoid); - this.globals.forEach(add_def); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope) node.variables.forEach(add_def); - if (node instanceof AST_SymbolCatch) add_def(node.definition()); - })); - return avoid; - - function to_avoid(name) { - avoid.add(name); - } - - function add_def(def) { - var name = def.name; - if (def.global && cache && cache.has(name)) name = cache.get(name); - else if (!def.unmangleable(options)) return; - to_avoid(name); - } -}); - -AST_Toplevel.DEFMETHOD("expand_names", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - if (nth_identifier.reset && nth_identifier.sort) { - nth_identifier.reset(); - nth_identifier.sort(); - } - var avoid = this.find_colliding_names(options); - var cname = 0; - this.globals.forEach(rename); - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope) node.variables.forEach(rename); - if (node instanceof AST_SymbolCatch) rename(node.definition()); - })); - - function next_name() { - var name; - do { - name = nth_identifier.get(cname++); - } while (avoid.has(name) || ALL_RESERVED_WORDS.has(name)); - return name; - } - - function rename(def) { - if (def.global && options.cache) return; - if (def.unmangleable(options)) return; - if (options.reserved.has(def.name)) return; - const redefinition = redefined_catch_def(def); - const name = def.name = redefinition ? redefinition.name : next_name(); - def.orig.forEach(function(sym) { - sym.name = name; - }); - def.references.forEach(function(sym) { - sym.name = name; - }); - } -}); - -AST_Node.DEFMETHOD("tail_node", return_this); -AST_Sequence.DEFMETHOD("tail_node", function() { - return this.expressions[this.expressions.length - 1]; -}); - -AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { - options = format_mangler_options(options); - var nth_identifier = options.nth_identifier; - if (!nth_identifier.reset || !nth_identifier.consider || !nth_identifier.sort) { - // If the identifier mangler is invariant, skip computing character frequency. - return; - } - nth_identifier.reset(); - - try { - AST_Node.prototype.print = function(stream, force_parens) { - this._print(stream, force_parens); - if (this instanceof AST_Symbol && !this.unmangleable(options)) { - nth_identifier.consider(this.name, -1); - } else if (options.properties) { - if (this instanceof AST_DotHash) { - nth_identifier.consider("#" + this.property, -1); - } else if (this instanceof AST_Dot) { - nth_identifier.consider(this.property, -1); - } else if (this instanceof AST_Sub) { - skip_string(this.property); - } - } - }; - nth_identifier.consider(this.print_to_string(), 1); - } finally { - AST_Node.prototype.print = AST_Node.prototype._print; - } - nth_identifier.sort(); - - function skip_string(node) { - if (node instanceof AST_String) { - nth_identifier.consider(node.value, -1); - } else if (node instanceof AST_Conditional) { - skip_string(node.consequent); - skip_string(node.alternative); - } else if (node instanceof AST_Sequence) { - skip_string(node.tail_node()); - } - } -}); - -const base54 = (() => { - const leading = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""); - const digits = "0123456789".split(""); - let chars; - let frequency; - function reset() { - frequency = new Map(); - leading.forEach(function(ch) { - frequency.set(ch, 0); - }); - digits.forEach(function(ch) { - frequency.set(ch, 0); - }); - } - function consider(str, delta) { - for (var i = str.length; --i >= 0;) { - frequency.set(str[i], frequency.get(str[i]) + delta); - } - } - function compare(a, b) { - return frequency.get(b) - frequency.get(a); - } - function sort() { - chars = mergeSort(leading, compare).concat(mergeSort(digits, compare)); - } - // Ensure this is in a usable initial state. - reset(); - sort(); - function base54(num) { - var ret = "", base = 54; - num++; - do { - num--; - ret += chars[num % base]; - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - } - - return { - get: base54, - consider, - reset, - sort - }; -})(); - -export { - base54, - SymbolDef, -}; diff --git a/node_modules/terser/lib/size.js b/node_modules/terser/lib/size.js deleted file mode 100644 index 9fcddb5..0000000 --- a/node_modules/terser/lib/size.js +++ /dev/null @@ -1,495 +0,0 @@ -import { - AST_Accessor, - AST_Array, - AST_Arrow, - AST_Await, - AST_BigInt, - AST_Binary, - AST_Block, - AST_Break, - AST_Call, - AST_Case, - AST_Class, - AST_ClassStaticBlock, - AST_ClassPrivateProperty, - AST_ClassProperty, - AST_ConciseMethod, - AST_Conditional, - AST_Const, - AST_Continue, - AST_Debugger, - AST_Default, - AST_Defun, - AST_Destructuring, - AST_Directive, - AST_Do, - AST_Dot, - AST_DotHash, - AST_EmptyStatement, - AST_Expansion, - AST_Export, - AST_False, - AST_For, - AST_ForIn, - AST_Function, - AST_Hole, - AST_If, - AST_Import, - AST_ImportMeta, - AST_Infinity, - AST_LabeledStatement, - AST_Let, - AST_NameMapping, - AST_NaN, - AST_New, - AST_NewTarget, - AST_Node, - AST_Null, - AST_Number, - AST_Object, - AST_ObjectKeyVal, - AST_ObjectGetter, - AST_ObjectSetter, - AST_PrivateGetter, - AST_PrivateMethod, - AST_PrivateSetter, - AST_PrivateIn, - AST_RegExp, - AST_Return, - AST_Sequence, - AST_String, - AST_Sub, - AST_Super, - AST_Switch, - AST_Symbol, - AST_SymbolClassProperty, - AST_SymbolExportForeign, - AST_SymbolImportForeign, - AST_SymbolRef, - AST_SymbolDeclaration, - AST_TemplateSegment, - AST_TemplateString, - AST_This, - AST_Throw, - AST_Toplevel, - AST_True, - AST_Try, - AST_Catch, - AST_Finally, - AST_Unary, - AST_Undefined, - AST_Var, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, - walk_parent -} from "./ast.js"; -import { first_in_statement } from "./utils/first_in_statement.js"; - -let mangle_options = undefined; -AST_Node.prototype.size = function (compressor, stack) { - mangle_options = compressor && compressor._mangle_options; - - let size = 0; - walk_parent(this, (node, info) => { - size += node._size(info); - - // Braceless arrow functions have fake "return" statements - if (node instanceof AST_Arrow && node.is_braceless()) { - size += node.body[0].value._size(info); - return true; - } - }, stack || (compressor && compressor.stack)); - - // just to save a bit of memory - mangle_options = undefined; - - return size; -}; - -AST_Node.prototype._size = () => 0; - -AST_Debugger.prototype._size = () => 8; - -AST_Directive.prototype._size = function () { - // TODO string encoding stuff - return 2 + this.value.length; -}; - -/** Count commas/semicolons necessary to show a list of expressions/statements */ -const list_overhead = (array) => array.length && array.length - 1; - -AST_Block.prototype._size = function () { - return 2 + list_overhead(this.body); -}; - -AST_Toplevel.prototype._size = function() { - return list_overhead(this.body); -}; - -AST_EmptyStatement.prototype._size = () => 1; - -AST_LabeledStatement.prototype._size = () => 2; // x: - -AST_Do.prototype._size = () => 9; - -AST_While.prototype._size = () => 7; - -AST_For.prototype._size = () => 8; - -AST_ForIn.prototype._size = () => 8; -// AST_ForOf inherits ^ - -AST_With.prototype._size = () => 6; - -AST_Expansion.prototype._size = () => 3; - -const lambda_modifiers = func => - (func.is_generator ? 1 : 0) + (func.async ? 6 : 0); - -AST_Accessor.prototype._size = function () { - return lambda_modifiers(this) + 4 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -AST_Function.prototype._size = function (info) { - const first = !!first_in_statement(info); - return (first * 2) + lambda_modifiers(this) + 12 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -AST_Defun.prototype._size = function () { - return lambda_modifiers(this) + 13 + list_overhead(this.argnames) + list_overhead(this.body); -}; - -AST_Arrow.prototype._size = function () { - let args_and_arrow = 2 + list_overhead(this.argnames); - - if ( - !( - this.argnames.length === 1 - && this.argnames[0] instanceof AST_Symbol - ) - ) { - args_and_arrow += 2; // parens around the args - } - - const body_overhead = this.is_braceless() ? 0 : list_overhead(this.body) + 2; - - return lambda_modifiers(this) + args_and_arrow + body_overhead; -}; - -AST_Destructuring.prototype._size = () => 2; - -AST_TemplateString.prototype._size = function () { - return 2 + (Math.floor(this.segments.length / 2) * 3); /* "${}" */ -}; - -AST_TemplateSegment.prototype._size = function () { - return this.value.length; -}; - -AST_Return.prototype._size = function () { - return this.value ? 7 : 6; -}; - -AST_Throw.prototype._size = () => 6; - -AST_Break.prototype._size = function () { - return this.label ? 6 : 5; -}; - -AST_Continue.prototype._size = function () { - return this.label ? 9 : 8; -}; - -AST_If.prototype._size = () => 4; - -AST_Switch.prototype._size = function () { - return 8 + list_overhead(this.body); -}; - -AST_Case.prototype._size = function () { - return 5 + list_overhead(this.body); -}; - -AST_Default.prototype._size = function () { - return 8 + list_overhead(this.body); -}; - -AST_Try.prototype._size = () => 3; - -AST_Catch.prototype._size = function () { - let size = 7 + list_overhead(this.body); - if (this.argname) { - size += 2; - } - return size; -}; - -AST_Finally.prototype._size = function () { - return 7 + list_overhead(this.body); -}; - -AST_Var.prototype._size = function () { - return 4 + list_overhead(this.definitions); -}; - -AST_Let.prototype._size = function () { - return 4 + list_overhead(this.definitions); -}; - -AST_Const.prototype._size = function () { - return 6 + list_overhead(this.definitions); -}; - -AST_VarDef.prototype._size = function () { - return this.value ? 1 : 0; -}; - -AST_NameMapping.prototype._size = function () { - // foreign name isn't mangled - return this.name ? 4 : 0; -}; - -AST_Import.prototype._size = function () { - // import - let size = 6; - - if (this.imported_name) size += 1; - - // from - if (this.imported_name || this.imported_names) size += 5; - - // braces, and the commas - if (this.imported_names) { - size += 2 + list_overhead(this.imported_names); - } - - return size; -}; - -AST_ImportMeta.prototype._size = () => 11; - -AST_Export.prototype._size = function () { - let size = 7 + (this.is_default ? 8 : 0); - - if (this.exported_value) { - size += this.exported_value._size(); - } - - if (this.exported_names) { - // Braces and commas - size += 2 + list_overhead(this.exported_names); - } - - if (this.module_name) { - // "from " - size += 5; - } - - return size; -}; - -AST_Call.prototype._size = function () { - if (this.optional) { - return 4 + list_overhead(this.args); - } - return 2 + list_overhead(this.args); -}; - -AST_New.prototype._size = function () { - return 6 + list_overhead(this.args); -}; - -AST_Sequence.prototype._size = function () { - return list_overhead(this.expressions); -}; - -AST_Dot.prototype._size = function () { - if (this.optional) { - return this.property.length + 2; - } - return this.property.length + 1; -}; - -AST_DotHash.prototype._size = function () { - if (this.optional) { - return this.property.length + 3; - } - return this.property.length + 2; -}; - -AST_Sub.prototype._size = function () { - return this.optional ? 4 : 2; -}; - -AST_Unary.prototype._size = function () { - if (this.operator === "typeof") return 7; - if (this.operator === "void") return 5; - return this.operator.length; -}; - -AST_Binary.prototype._size = function (info) { - if (this.operator === "in") return 4; - - let size = this.operator.length; - - if ( - (this.operator === "+" || this.operator === "-") - && this.right instanceof AST_Unary && this.right.operator === this.operator - ) { - // 1+ +a > needs space between the + - size += 1; - } - - if (this.needs_parens(info)) { - size += 2; - } - - return size; -}; - -AST_Conditional.prototype._size = () => 3; - -AST_Array.prototype._size = function () { - return 2 + list_overhead(this.elements); -}; - -AST_Object.prototype._size = function (info) { - let base = 2; - if (first_in_statement(info)) { - base += 2; // parens - } - return base + list_overhead(this.properties); -}; - -/*#__INLINE__*/ -const key_size = key => - typeof key === "string" ? key.length : 0; - -AST_ObjectKeyVal.prototype._size = function () { - return key_size(this.key) + 1; -}; - -/*#__INLINE__*/ -const static_size = is_static => is_static ? 7 : 0; - -AST_ObjectGetter.prototype._size = function () { - return 5 + static_size(this.static) + key_size(this.key); -}; - -AST_ObjectSetter.prototype._size = function () { - return 5 + static_size(this.static) + key_size(this.key); -}; - -AST_ConciseMethod.prototype._size = function () { - return static_size(this.static) + key_size(this.key) + lambda_modifiers(this); -}; - -AST_PrivateMethod.prototype._size = function () { - return AST_ConciseMethod.prototype._size.call(this) + 1; -}; - -AST_PrivateGetter.prototype._size = AST_PrivateSetter.prototype._size = function () { - return AST_ConciseMethod.prototype._size.call(this) + 4; -}; - -AST_PrivateIn.prototype._size = function () { - return 5; // "#", and " in " -}; - -AST_Class.prototype._size = function () { - return ( - (this.name ? 8 : 7) - + (this.extends ? 8 : 0) - ); -}; - -AST_ClassStaticBlock.prototype._size = function () { - // "class{}" + semicolons - return 7 + list_overhead(this.body); -}; - -AST_ClassProperty.prototype._size = function () { - return ( - static_size(this.static) - + (typeof this.key === "string" ? this.key.length + 2 : 0) - + (this.value ? 1 : 0) - ); -}; - -AST_ClassPrivateProperty.prototype._size = function () { - return AST_ClassProperty.prototype._size.call(this) + 1; -}; - -AST_Symbol.prototype._size = function () { - if (!(mangle_options && this.thedef && !this.thedef.unmangleable(mangle_options))) { - return this.name.length; - } else { - return 1; - } -}; - -// TODO take propmangle into account -AST_SymbolClassProperty.prototype._size = function () { - return this.name.length; -}; - -AST_SymbolRef.prototype._size = AST_SymbolDeclaration.prototype._size = function () { - if (this.name === "arguments") return 9; - - return AST_Symbol.prototype._size.call(this); -}; - -AST_NewTarget.prototype._size = () => 10; - -AST_SymbolImportForeign.prototype._size = function () { - return this.name.length; -}; - -AST_SymbolExportForeign.prototype._size = function () { - return this.name.length; -}; - -AST_This.prototype._size = () => 4; - -AST_Super.prototype._size = () => 5; - -AST_String.prototype._size = function () { - return this.value.length + 2; -}; - -AST_Number.prototype._size = function () { - const { value } = this; - if (value === 0) return 1; - if (value > 0 && Math.floor(value) === value) { - return Math.floor(Math.log10(value) + 1); - } - return value.toString().length; -}; - -AST_BigInt.prototype._size = function () { - return this.value.length; -}; - -AST_RegExp.prototype._size = function () { - return this.value.toString().length; -}; - -AST_Null.prototype._size = () => 4; - -AST_NaN.prototype._size = () => 3; - -AST_Undefined.prototype._size = () => 6; // "void 0" - -AST_Hole.prototype._size = () => 0; // comma is taken into account by list_overhead() - -AST_Infinity.prototype._size = () => 8; - -AST_True.prototype._size = () => 4; - -AST_False.prototype._size = () => 5; - -AST_Await.prototype._size = () => 6; - -AST_Yield.prototype._size = () => 6; diff --git a/node_modules/terser/lib/sourcemap.js b/node_modules/terser/lib/sourcemap.js deleted file mode 100644 index 101c748..0000000 --- a/node_modules/terser/lib/sourcemap.js +++ /dev/null @@ -1,148 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -import {SourceMapConsumer, SourceMapGenerator} from "@jridgewell/source-map"; -import {defaults, HOP} from "./utils/index.js"; - -// a small wrapper around source-map and @jridgewell/source-map -function* SourceMap(options) { - options = defaults(options, { - file : null, - root : null, - orig : null, - files: {}, - }); - - var orig_map; - var generator = new SourceMapGenerator({ - file : options.file, - sourceRoot : options.root - }); - - let sourcesContent = {__proto__: null}; - let files = options.files; - for (var name in files) if (HOP(files, name)) { - sourcesContent[name] = files[name]; - } - if (options.orig) { - // We support both @jridgewell/source-map (which has a sync - // SourceMapConsumer) and source-map (which has an async - // SourceMapConsumer). - orig_map = yield new SourceMapConsumer(options.orig); - if (orig_map.sourcesContent) { - orig_map.sources.forEach(function(source, i) { - var content = orig_map.sourcesContent[i]; - if (content) { - sourcesContent[source] = content; - } - }); - } - } - - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - let generatedPos = { line: gen_line, column: gen_col }; - - if (orig_map) { - var info = orig_map.originalPositionFor({ - line: orig_line, - column: orig_col - }); - if (info.source === null) { - generator.addMapping({ - generated: generatedPos, - original: null, - source: null, - name: null - }); - return; - } - source = info.source; - orig_line = info.line; - orig_col = info.column; - name = info.name || name; - } - generator.addMapping({ - generated : generatedPos, - original : { line: orig_line, column: orig_col }, - source : source, - name : name - }); - generator.setSourceContent(source, sourcesContent[source]); - } - - function clean(map) { - const allNull = map.sourcesContent && map.sourcesContent.every(c => c == null); - if (allNull) delete map.sourcesContent; - if (map.file === undefined) delete map.file; - if (map.sourceRoot === undefined) delete map.sourceRoot; - return map; - } - - function getDecoded() { - if (!generator.toDecodedMap) return null; - return clean(generator.toDecodedMap()); - } - - function getEncoded() { - return clean(generator.toJSON()); - } - - function destroy() { - // @jridgewell/source-map's SourceMapConsumer does not need to be - // manually freed. - if (orig_map && orig_map.destroy) orig_map.destroy(); - } - - return { - add, - getDecoded, - getEncoded, - destroy, - }; -} - -export { - SourceMap, -}; diff --git a/node_modules/terser/lib/transform.js b/node_modules/terser/lib/transform.js deleted file mode 100644 index 7dd880a..0000000 --- a/node_modules/terser/lib/transform.js +++ /dev/null @@ -1,323 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -import { - AST_Array, - AST_Await, - AST_Binary, - AST_PrivateIn, - AST_Block, - AST_Call, - AST_Case, - AST_Catch, - AST_Chain, - AST_Class, - AST_ClassStaticBlock, - AST_Conditional, - AST_Definitions, - AST_Destructuring, - AST_Do, - AST_Exit, - AST_Expansion, - AST_Export, - AST_For, - AST_ForIn, - AST_If, - AST_Import, - AST_LabeledStatement, - AST_Lambda, - AST_LoopControl, - AST_NameMapping, - AST_Node, - AST_Number, - AST_Object, - AST_ObjectProperty, - AST_PrefixedTemplateString, - AST_PropAccess, - AST_Sequence, - AST_SimpleStatement, - AST_Sub, - AST_Switch, - AST_TemplateString, - AST_Try, - AST_Unary, - AST_VarDef, - AST_While, - AST_With, - AST_Yield, -} from "./ast.js"; -import { - MAP as do_list, - noop, -} from "./utils/index.js"; - -function def_transform(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list) { - let transformed = undefined; - tw.push(this); - if (tw.before) transformed = tw.before(this, descend, in_list); - if (transformed === undefined) { - transformed = this; - descend(transformed, tw); - if (tw.after) { - const after_ret = tw.after(transformed, in_list); - if (after_ret !== undefined) transformed = after_ret; - } - } - tw.pop(); - return transformed; - }); -} - -def_transform(AST_Node, noop); - -def_transform(AST_LabeledStatement, function(self, tw) { - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_SimpleStatement, function(self, tw) { - self.body = self.body.transform(tw); -}); - -def_transform(AST_Block, function(self, tw) { - self.body = do_list(self.body, tw); -}); - -def_transform(AST_Do, function(self, tw) { - self.body = self.body.transform(tw); - self.condition = self.condition.transform(tw); -}); - -def_transform(AST_While, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_For, function(self, tw) { - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_ForIn, function(self, tw) { - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_With, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); -}); - -def_transform(AST_Exit, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(AST_LoopControl, function(self, tw) { - if (self.label) self.label = self.label.transform(tw); -}); - -def_transform(AST_If, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); -}); - -def_transform(AST_Switch, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); -}); - -def_transform(AST_Case, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); -}); - -def_transform(AST_Try, function(self, tw) { - self.body = self.body.transform(tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); -}); - -def_transform(AST_Catch, function(self, tw) { - if (self.argname) self.argname = self.argname.transform(tw); - self.body = do_list(self.body, tw); -}); - -def_transform(AST_Definitions, function(self, tw) { - self.definitions = do_list(self.definitions, tw); -}); - -def_transform(AST_VarDef, function(self, tw) { - self.name = self.name.transform(tw); - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(AST_Destructuring, function(self, tw) { - self.names = do_list(self.names, tw); -}); - -def_transform(AST_Lambda, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - self.argnames = do_list(self.argnames, tw, /* allow_splicing */ false); - if (self.body instanceof AST_Node) { - self.body = self.body.transform(tw); - } else { - self.body = do_list(self.body, tw); - } -}); - -def_transform(AST_Call, function(self, tw) { - self.expression = self.expression.transform(tw); - self.args = do_list(self.args, tw, /* allow_splicing */ false); -}); - -def_transform(AST_Sequence, function(self, tw) { - const result = do_list(self.expressions, tw); - self.expressions = result.length - ? result - : [new AST_Number({ value: 0 })]; -}); - -def_transform(AST_PropAccess, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Sub, function(self, tw) { - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); -}); - -def_transform(AST_Chain, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Yield, function(self, tw) { - if (self.expression) self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Await, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Unary, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_Binary, function(self, tw) { - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); -}); - -def_transform(AST_PrivateIn, function(self, tw) { - self.key = self.key.transform(tw); - self.value = self.value.transform(tw); -}); - -def_transform(AST_Conditional, function(self, tw) { - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); -}); - -def_transform(AST_Array, function(self, tw) { - self.elements = do_list(self.elements, tw); -}); - -def_transform(AST_Object, function(self, tw) { - self.properties = do_list(self.properties, tw); -}); - -def_transform(AST_ObjectProperty, function(self, tw) { - if (self.key instanceof AST_Node) { - self.key = self.key.transform(tw); - } - if (self.value) self.value = self.value.transform(tw); -}); - -def_transform(AST_Class, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - if (self.extends) self.extends = self.extends.transform(tw); - self.properties = do_list(self.properties, tw); -}); - -def_transform(AST_ClassStaticBlock, function(self, tw) { - self.body = do_list(self.body, tw); -}); - -def_transform(AST_Expansion, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - -def_transform(AST_NameMapping, function(self, tw) { - self.foreign_name = self.foreign_name.transform(tw); - self.name = self.name.transform(tw); -}); - -def_transform(AST_Import, function(self, tw) { - if (self.imported_name) self.imported_name = self.imported_name.transform(tw); - if (self.imported_names) do_list(self.imported_names, tw); - self.module_name = self.module_name.transform(tw); -}); - -def_transform(AST_Export, function(self, tw) { - if (self.exported_definition) self.exported_definition = self.exported_definition.transform(tw); - if (self.exported_value) self.exported_value = self.exported_value.transform(tw); - if (self.exported_names) do_list(self.exported_names, tw); - if (self.module_name) self.module_name = self.module_name.transform(tw); -}); - -def_transform(AST_TemplateString, function(self, tw) { - self.segments = do_list(self.segments, tw); -}); - -def_transform(AST_PrefixedTemplateString, function(self, tw) { - self.prefix = self.prefix.transform(tw); - self.template_string = self.template_string.transform(tw); -}); - diff --git a/node_modules/terser/lib/utils/first_in_statement.js b/node_modules/terser/lib/utils/first_in_statement.js deleted file mode 100644 index 6aa4628..0000000 --- a/node_modules/terser/lib/utils/first_in_statement.js +++ /dev/null @@ -1,53 +0,0 @@ -import { - AST_Binary, - AST_Conditional, - AST_Chain, - AST_Dot, - AST_Object, - AST_Sequence, - AST_Statement, - AST_Sub, - AST_UnaryPostfix, - AST_PrefixedTemplateString -} from "../ast.js"; - -// return true if the node at the top of the stack (that means the -// innermost node in the current output) is lexically the first in -// a statement. -function first_in_statement(stack) { - let node = stack.parent(-1); - for (let i = 0, p; p = stack.parent(i); i++) { - if (p instanceof AST_Statement && p.body === node) - return true; - if ((p instanceof AST_Sequence && p.expressions[0] === node) || - (p.TYPE === "Call" && p.expression === node) || - (p instanceof AST_PrefixedTemplateString && p.prefix === node) || - (p instanceof AST_Dot && p.expression === node) || - (p instanceof AST_Sub && p.expression === node) || - (p instanceof AST_Chain && p.expression === node) || - (p instanceof AST_Conditional && p.condition === node) || - (p instanceof AST_Binary && p.left === node) || - (p instanceof AST_UnaryPostfix && p.expression === node) - ) { - node = p; - } else { - return false; - } - } -} - -// Returns whether the leftmost item in the expression is an object -function left_is_object(node) { - if (node instanceof AST_Object) return true; - if (node instanceof AST_Sequence) return left_is_object(node.expressions[0]); - if (node.TYPE === "Call") return left_is_object(node.expression); - if (node instanceof AST_PrefixedTemplateString) return left_is_object(node.prefix); - if (node instanceof AST_Dot || node instanceof AST_Sub) return left_is_object(node.expression); - if (node instanceof AST_Chain) return left_is_object(node.expression); - if (node instanceof AST_Conditional) return left_is_object(node.condition); - if (node instanceof AST_Binary) return left_is_object(node.left); - if (node instanceof AST_UnaryPostfix) return left_is_object(node.expression); - return false; -} - -export { first_in_statement, left_is_object }; diff --git a/node_modules/terser/lib/utils/index.js b/node_modules/terser/lib/utils/index.js deleted file mode 100644 index 65fa989..0000000 --- a/node_modules/terser/lib/utils/index.js +++ /dev/null @@ -1,295 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -"use strict"; - -import { AST_Node } from "../ast.js"; - -function characters(str) { - return str.split(""); -} - -function member(name, array) { - return array.includes(name); -} - -class DefaultsError extends Error { - constructor(msg, defs) { - super(); - - this.name = "DefaultsError"; - this.message = msg; - this.defs = defs; - } -} - -function defaults(args, defs, croak) { - if (args === true) { - args = {}; - } else if (args != null && typeof args === "object") { - args = {...args}; - } - - const ret = args || {}; - - if (croak) for (const i in ret) if (HOP(ret, i) && !HOP(defs, i)) { - throw new DefaultsError("`" + i + "` is not a supported option", defs); - } - - for (const i in defs) if (HOP(defs, i)) { - if (!args || !HOP(args, i)) { - ret[i] = defs[i]; - } else if (i === "ecma") { - let ecma = args[i] | 0; - if (ecma > 5 && ecma < 2015) ecma += 2009; - ret[i] = ecma; - } else { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - } - - return ret; -} - -function noop() {} -function return_false() { return false; } -function return_true() { return true; } -function return_this() { return this; } -function return_null() { return null; } - -var MAP = (function() { - function MAP(a, tw, allow_splicing = true) { - const new_a = []; - - for (let i = 0; i < a.length; ++i) { - let item = a[i]; - let ret = item.transform(tw, allow_splicing); - - if (ret instanceof AST_Node) { - new_a.push(ret); - } else if (ret instanceof Splice) { - new_a.push(...ret.v); - } - } - - return new_a; - } - - MAP.splice = function(val) { return new Splice(val); }; - MAP.skip = {}; - function Splice(val) { this.v = val; } - return MAP; -})(); - -function make_node(ctor, orig, props) { - if (!props) props = {}; - if (orig) { - if (!props.start) props.start = orig.start; - if (!props.end) props.end = orig.end; - } - return new ctor(props); -} - -function push_uniq(array, el) { - if (!array.includes(el)) - array.push(el); -} - -function string_template(text, props) { - return text.replace(/{(.+?)}/g, function(str, p) { - return props && props[p]; - }); -} - -function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } -} - -function mergeSort(array, cmp) { - if (array.length < 2) return array.slice(); - function merge(a, b) { - var r = [], ai = 0, bi = 0, i = 0; - while (ai < a.length && bi < b.length) { - cmp(a[ai], b[bi]) <= 0 - ? r[i++] = a[ai++] - : r[i++] = b[bi++]; - } - if (ai < a.length) r.push.apply(r, a.slice(ai)); - if (bi < b.length) r.push.apply(r, b.slice(bi)); - return r; - } - function _ms(a) { - if (a.length <= 1) - return a; - var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); - left = _ms(left); - right = _ms(right); - return merge(left, right); - } - return _ms(array); -} - -function makePredicate(words) { - if (!Array.isArray(words)) words = words.split(" "); - - return new Set(words.sort()); -} - -function map_add(map, key, value) { - if (map.has(key)) { - map.get(key).push(value); - } else { - map.set(key, [ value ]); - } -} - -function map_from_object(obj) { - var map = new Map(); - for (var key in obj) { - if (HOP(obj, key) && key.charAt(0) === "$") { - map.set(key.substr(1), obj[key]); - } - } - return map; -} - -function map_to_object(map) { - var obj = Object.create(null); - map.forEach(function (value, key) { - obj["$" + key] = value; - }); - return obj; -} - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -function keep_name(keep_setting, name) { - return keep_setting === true - || (keep_setting instanceof RegExp && keep_setting.test(name)); -} - -var lineTerminatorEscape = { - "\0": "0", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029", -}; -function regexp_source_fix(source) { - // V8 does not escape line terminators in regexp patterns in node 12 - // We'll also remove literal \0 - return source.replace(/[\0\n\r\u2028\u2029]/g, function (match, offset) { - var escaped = source[offset - 1] == "\\" - && (source[offset - 2] != "\\" - || /(?:^|[^\\])(?:\\{2})*$/.test(source.slice(0, offset - 1))); - return (escaped ? "" : "\\") + lineTerminatorEscape[match]; - }); -} - -// Subset of regexps that is not going to cause regexp based DDOS -// https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS -const re_safe_regexp = /^[\\/|\0\s\w^$.[\]()]*$/; - -/** Check if the regexp is safe for Terser to create without risking a RegExp DOS */ -export const regexp_is_safe = (source) => re_safe_regexp.test(source); - -const all_flags = "dgimsuyv"; -function sort_regexp_flags(flags) { - const existing_flags = new Set(flags.split("")); - let out = ""; - for (const flag of all_flags) { - if (existing_flags.has(flag)) { - out += flag; - existing_flags.delete(flag); - } - } - if (existing_flags.size) { - // Flags Terser doesn't know about - existing_flags.forEach(flag => { out += flag; }); - } - return out; -} - -function has_annotation(node, annotation) { - return node._annotations & annotation; -} - -function set_annotation(node, annotation) { - node._annotations |= annotation; -} - -function clear_annotation(node, annotation) { - node._annotations &= ~annotation; -} - -export { - characters, - defaults, - HOP, - keep_name, - make_node, - makePredicate, - map_add, - map_from_object, - map_to_object, - MAP, - member, - mergeSort, - noop, - push_uniq, - regexp_source_fix, - remove, - return_false, - return_null, - return_this, - return_true, - sort_regexp_flags, - string_template, - has_annotation, - set_annotation, - clear_annotation, -}; diff --git a/node_modules/terser/main.js b/node_modules/terser/main.js deleted file mode 100644 index 56ab363..0000000 --- a/node_modules/terser/main.js +++ /dev/null @@ -1,27 +0,0 @@ -import "./lib/transform.js"; -import "./lib/mozilla-ast.js"; -import { minify } from "./lib/minify.js"; - -export { minify, minify_sync } from "./lib/minify.js"; -export { run_cli as _run_cli } from "./lib/cli.js"; - -export async function _default_options() { - const defs = {}; - - Object.keys(infer_options({ 0: 0 })).forEach((component) => { - const options = infer_options({ - [component]: {0: 0} - }); - - if (options) defs[component] = options; - }); - return defs; -} - -async function infer_options(options) { - try { - await minify("", options); - } catch (error) { - return error.defs; - } -} diff --git a/node_modules/terser/package.json b/node_modules/terser/package.json deleted file mode 100644 index cb5c81d..0000000 --- a/node_modules/terser/package.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "name": "terser", - "description": "JavaScript parser, mangler/compressor and beautifier toolkit for ES6+", - "homepage": "https://terser.org", - "author": "Mihai Bazon (http://lisperator.net/)", - "license": "BSD-2-Clause", - "version": "5.27.0", - "engines": { - "node": ">=10" - }, - "maintainers": [ - "Fábio Santos " - ], - "repository": "https://github.com/terser/terser", - "main": "dist/bundle.min.js", - "type": "module", - "module": "./main.js", - "exports": { - ".": [ - { - "types": "./tools/terser.d.ts", - "import": "./main.js", - "require": "./dist/bundle.min.js" - }, - "./dist/bundle.min.js" - ], - "./package": "./package.json", - "./package.json": "./package.json", - "./bin/terser": "./bin/terser" - }, - "types": "tools/terser.d.ts", - "bin": { - "terser": "bin/terser" - }, - "files": [ - "bin", - "dist", - "lib", - "tools", - "LICENSE", - "README.md", - "CHANGELOG.md", - "PATRONS.md", - "main.js" - ], - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "devDependencies": { - "@ls-lint/ls-lint": "^1.11.2", - "astring": "^1.8.5", - "eslint": "^7.32.0", - "eslump": "^3.0.0", - "esm": "^3.2.25", - "mocha": "^9.2.0", - "pre-commit": "^1.2.2", - "rollup": "^2.56.3", - "semver": "^7.5.1", - "source-map": "~0.8.0-beta.0" - }, - "scripts": { - "test": "node test/compress.js && mocha test/mocha", - "test:compress": "node test/compress.js", - "test:mocha": "mocha test/mocha", - "lint": "eslint lib", - "lint-fix": "eslint --fix lib", - "ls-lint": "ls-lint", - "build": "rollup --config --silent", - "prepare": "npm run build", - "postversion": "echo 'Remember to update the changelog!'" - }, - "keywords": [ - "uglify", - "terser", - "uglify-es", - "uglify-js", - "minify", - "minifier", - "javascript", - "ecmascript", - "es5", - "es6", - "es7", - "es8", - "es2015", - "es2016", - "es2017", - "async", - "await" - ], - "eslintConfig": { - "parserOptions": { - "sourceType": "module", - "ecmaVersion": 2020 - }, - "env": { - "node": true, - "browser": true, - "es2020": true - }, - "globals": { - "describe": false, - "it": false, - "require": false, - "before": false, - "after": false, - "global": false, - "process": false - }, - "rules": { - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": true - } - ], - "quotes": [ - "error", - "double", - "avoid-escape" - ], - "no-debugger": "error", - "no-undef": "error", - "no-unused-vars": [ - "error", - { - "varsIgnorePattern": "^_" - } - ], - "no-tabs": "error", - "semi": [ - "error", - "always" - ], - "no-extra-semi": "error", - "no-irregular-whitespace": "error", - "space-before-blocks": [ - "error", - "always" - ] - } - }, - "pre-commit": [ - "build", - "lint-fix", - "ls-lint", - "test" - ] -} diff --git a/node_modules/terser/tools/domprops.js b/node_modules/terser/tools/domprops.js deleted file mode 100644 index 7ce2aff..0000000 --- a/node_modules/terser/tools/domprops.js +++ /dev/null @@ -1,8022 +0,0 @@ -export var domprops = [ - "$&", - "$'", - "$*", - "$+", - "$1", - "$2", - "$3", - "$4", - "$5", - "$6", - "$7", - "$8", - "$9", - "$_", - "$`", - "$input", - "-moz-animation", - "-moz-animation-delay", - "-moz-animation-direction", - "-moz-animation-duration", - "-moz-animation-fill-mode", - "-moz-animation-iteration-count", - "-moz-animation-name", - "-moz-animation-play-state", - "-moz-animation-timing-function", - "-moz-appearance", - "-moz-backface-visibility", - "-moz-border-end", - "-moz-border-end-color", - "-moz-border-end-style", - "-moz-border-end-width", - "-moz-border-image", - "-moz-border-start", - "-moz-border-start-color", - "-moz-border-start-style", - "-moz-border-start-width", - "-moz-box-align", - "-moz-box-direction", - "-moz-box-flex", - "-moz-box-ordinal-group", - "-moz-box-orient", - "-moz-box-pack", - "-moz-box-sizing", - "-moz-float-edge", - "-moz-font-feature-settings", - "-moz-font-language-override", - "-moz-force-broken-image-icon", - "-moz-hyphens", - "-moz-image-region", - "-moz-margin-end", - "-moz-margin-start", - "-moz-orient", - "-moz-osx-font-smoothing", - "-moz-outline-radius", - "-moz-outline-radius-bottomleft", - "-moz-outline-radius-bottomright", - "-moz-outline-radius-topleft", - "-moz-outline-radius-topright", - "-moz-padding-end", - "-moz-padding-start", - "-moz-perspective", - "-moz-perspective-origin", - "-moz-tab-size", - "-moz-text-size-adjust", - "-moz-transform", - "-moz-transform-origin", - "-moz-transform-style", - "-moz-transition", - "-moz-transition-delay", - "-moz-transition-duration", - "-moz-transition-property", - "-moz-transition-timing-function", - "-moz-user-focus", - "-moz-user-input", - "-moz-user-modify", - "-moz-user-select", - "-moz-window-dragging", - "-webkit-align-content", - "-webkit-align-items", - "-webkit-align-self", - "-webkit-animation", - "-webkit-animation-delay", - "-webkit-animation-direction", - "-webkit-animation-duration", - "-webkit-animation-fill-mode", - "-webkit-animation-iteration-count", - "-webkit-animation-name", - "-webkit-animation-play-state", - "-webkit-animation-timing-function", - "-webkit-appearance", - "-webkit-backface-visibility", - "-webkit-background-clip", - "-webkit-background-origin", - "-webkit-background-size", - "-webkit-border-bottom-left-radius", - "-webkit-border-bottom-right-radius", - "-webkit-border-image", - "-webkit-border-radius", - "-webkit-border-top-left-radius", - "-webkit-border-top-right-radius", - "-webkit-box-align", - "-webkit-box-direction", - "-webkit-box-flex", - "-webkit-box-ordinal-group", - "-webkit-box-orient", - "-webkit-box-pack", - "-webkit-box-shadow", - "-webkit-box-sizing", - "-webkit-filter", - "-webkit-flex", - "-webkit-flex-basis", - "-webkit-flex-direction", - "-webkit-flex-flow", - "-webkit-flex-grow", - "-webkit-flex-shrink", - "-webkit-flex-wrap", - "-webkit-justify-content", - "-webkit-line-clamp", - "-webkit-mask", - "-webkit-mask-clip", - "-webkit-mask-composite", - "-webkit-mask-image", - "-webkit-mask-origin", - "-webkit-mask-position", - "-webkit-mask-position-x", - "-webkit-mask-position-y", - "-webkit-mask-repeat", - "-webkit-mask-size", - "-webkit-order", - "-webkit-perspective", - "-webkit-perspective-origin", - "-webkit-text-fill-color", - "-webkit-text-size-adjust", - "-webkit-text-stroke", - "-webkit-text-stroke-color", - "-webkit-text-stroke-width", - "-webkit-transform", - "-webkit-transform-origin", - "-webkit-transform-style", - "-webkit-transition", - "-webkit-transition-delay", - "-webkit-transition-duration", - "-webkit-transition-property", - "-webkit-transition-timing-function", - "-webkit-user-select", - "0", - "1", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "2", - "20", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "@@iterator", - "ABORT_ERR", - "ACTIVE", - "ACTIVE_ATTRIBUTES", - "ACTIVE_TEXTURE", - "ACTIVE_UNIFORMS", - "ACTIVE_UNIFORM_BLOCKS", - "ADDITION", - "ALIASED_LINE_WIDTH_RANGE", - "ALIASED_POINT_SIZE_RANGE", - "ALL", - "ALLOW_KEYBOARD_INPUT", - "ALLPASS", - "ALPHA", - "ALPHA_BITS", - "ALREADY_SIGNALED", - "ALT_MASK", - "ALWAYS", - "ANY_SAMPLES_PASSED", - "ANY_SAMPLES_PASSED_CONSERVATIVE", - "ANY_TYPE", - "ANY_UNORDERED_NODE_TYPE", - "ARRAY_BUFFER", - "ARRAY_BUFFER_BINDING", - "ATTACHED_SHADERS", - "ATTRIBUTE_NODE", - "AT_TARGET", - "AbortController", - "AbortSignal", - "AbsoluteOrientationSensor", - "AbstractRange", - "Accelerometer", - "AddSearchProvider", - "AggregateError", - "AnalyserNode", - "Animation", - "AnimationEffect", - "AnimationEvent", - "AnimationPlaybackEvent", - "AnimationTimeline", - "AnonXMLHttpRequest", - "Any", - "ApplicationCache", - "ApplicationCacheErrorEvent", - "Array", - "ArrayBuffer", - "ArrayType", - "Atomics", - "Attr", - "Audio", - "AudioBuffer", - "AudioBufferSourceNode", - "AudioContext", - "AudioDestinationNode", - "AudioListener", - "AudioNode", - "AudioParam", - "AudioParamMap", - "AudioProcessingEvent", - "AudioScheduledSourceNode", - "AudioStreamTrack", - "AudioWorklet", - "AudioWorkletNode", - "AuthenticatorAssertionResponse", - "AuthenticatorAttestationResponse", - "AuthenticatorResponse", - "AutocompleteErrorEvent", - "BACK", - "BAD_BOUNDARYPOINTS_ERR", - "BAD_REQUEST", - "BANDPASS", - "BLEND", - "BLEND_COLOR", - "BLEND_DST_ALPHA", - "BLEND_DST_RGB", - "BLEND_EQUATION", - "BLEND_EQUATION_ALPHA", - "BLEND_EQUATION_RGB", - "BLEND_SRC_ALPHA", - "BLEND_SRC_RGB", - "BLUE", - "BLUE_BITS", - "BLUR", - "BOOL", - "BOOLEAN_TYPE", - "BOOL_VEC2", - "BOOL_VEC3", - "BOOL_VEC4", - "BOTH", - "BROWSER_DEFAULT_WEBGL", - "BUBBLING_PHASE", - "BUFFER_SIZE", - "BUFFER_USAGE", - "BYTE", - "BYTES_PER_ELEMENT", - "BackgroundFetchManager", - "BackgroundFetchRecord", - "BackgroundFetchRegistration", - "BarProp", - "BarcodeDetector", - "BaseAudioContext", - "BaseHref", - "BatteryManager", - "BeforeInstallPromptEvent", - "BeforeLoadEvent", - "BeforeUnloadEvent", - "BigInt", - "BigInt64Array", - "BigUint64Array", - "BiquadFilterNode", - "Blob", - "BlobEvent", - "Bluetooth", - "BluetoothCharacteristicProperties", - "BluetoothDevice", - "BluetoothRemoteGATTCharacteristic", - "BluetoothRemoteGATTDescriptor", - "BluetoothRemoteGATTServer", - "BluetoothRemoteGATTService", - "BluetoothUUID", - "Boolean", - "BroadcastChannel", - "ByteLengthQueuingStrategy", - "CAPTURING_PHASE", - "CCW", - "CDATASection", - "CDATA_SECTION_NODE", - "CHANGE", - "CHARSET_RULE", - "CHECKING", - "CLAMP_TO_EDGE", - "CLICK", - "CLOSED", - "CLOSING", - "COLOR", - "COLOR_ATTACHMENT0", - "COLOR_ATTACHMENT1", - "COLOR_ATTACHMENT10", - "COLOR_ATTACHMENT11", - "COLOR_ATTACHMENT12", - "COLOR_ATTACHMENT13", - "COLOR_ATTACHMENT14", - "COLOR_ATTACHMENT15", - "COLOR_ATTACHMENT2", - "COLOR_ATTACHMENT3", - "COLOR_ATTACHMENT4", - "COLOR_ATTACHMENT5", - "COLOR_ATTACHMENT6", - "COLOR_ATTACHMENT7", - "COLOR_ATTACHMENT8", - "COLOR_ATTACHMENT9", - "COLOR_BUFFER_BIT", - "COLOR_CLEAR_VALUE", - "COLOR_WRITEMASK", - "COMMENT_NODE", - "COMPARE_REF_TO_TEXTURE", - "COMPILE_STATUS", - "COMPLETION_STATUS_KHR", - "COMPRESSED_RGBA_S3TC_DXT1_EXT", - "COMPRESSED_RGBA_S3TC_DXT3_EXT", - "COMPRESSED_RGBA_S3TC_DXT5_EXT", - "COMPRESSED_RGB_S3TC_DXT1_EXT", - "COMPRESSED_TEXTURE_FORMATS", - "COMPUTE", - "CONDITION_SATISFIED", - "CONFIGURATION_UNSUPPORTED", - "CONNECTING", - "CONSTANT_ALPHA", - "CONSTANT_COLOR", - "CONSTRAINT_ERR", - "CONTEXT_LOST_WEBGL", - "CONTROL_MASK", - "COPY_DST", - "COPY_READ_BUFFER", - "COPY_READ_BUFFER_BINDING", - "COPY_SRC", - "COPY_WRITE_BUFFER", - "COPY_WRITE_BUFFER_BINDING", - "COUNTER_STYLE_RULE", - "CSS", - "CSS2Properties", - "CSSAnimation", - "CSSCharsetRule", - "CSSConditionRule", - "CSSCounterStyleRule", - "CSSFontFaceRule", - "CSSFontFeatureValuesRule", - "CSSGroupingRule", - "CSSImageValue", - "CSSImportRule", - "CSSKeyframeRule", - "CSSKeyframesRule", - "CSSKeywordValue", - "CSSMathInvert", - "CSSMathMax", - "CSSMathMin", - "CSSMathNegate", - "CSSMathProduct", - "CSSMathSum", - "CSSMathValue", - "CSSMatrixComponent", - "CSSMediaRule", - "CSSMozDocumentRule", - "CSSNameSpaceRule", - "CSSNamespaceRule", - "CSSNumericArray", - "CSSNumericValue", - "CSSPageRule", - "CSSPerspective", - "CSSPositionValue", - "CSSPrimitiveValue", - "CSSRotate", - "CSSRule", - "CSSRuleList", - "CSSScale", - "CSSSkew", - "CSSSkewX", - "CSSSkewY", - "CSSStyleDeclaration", - "CSSStyleRule", - "CSSStyleSheet", - "CSSStyleValue", - "CSSSupportsRule", - "CSSTransformComponent", - "CSSTransformValue", - "CSSTransition", - "CSSTranslate", - "CSSUnitValue", - "CSSUnknownRule", - "CSSUnparsedValue", - "CSSValue", - "CSSValueList", - "CSSVariableReferenceValue", - "CSSVariablesDeclaration", - "CSSVariablesRule", - "CSSViewportRule", - "CSS_ATTR", - "CSS_CM", - "CSS_COUNTER", - "CSS_CUSTOM", - "CSS_DEG", - "CSS_DIMENSION", - "CSS_EMS", - "CSS_EXS", - "CSS_FILTER_BLUR", - "CSS_FILTER_BRIGHTNESS", - "CSS_FILTER_CONTRAST", - "CSS_FILTER_CUSTOM", - "CSS_FILTER_DROP_SHADOW", - "CSS_FILTER_GRAYSCALE", - "CSS_FILTER_HUE_ROTATE", - "CSS_FILTER_INVERT", - "CSS_FILTER_OPACITY", - "CSS_FILTER_REFERENCE", - "CSS_FILTER_SATURATE", - "CSS_FILTER_SEPIA", - "CSS_GRAD", - "CSS_HZ", - "CSS_IDENT", - "CSS_IN", - "CSS_INHERIT", - "CSS_KHZ", - "CSS_MATRIX", - "CSS_MATRIX3D", - "CSS_MM", - "CSS_MS", - "CSS_NUMBER", - "CSS_PC", - "CSS_PERCENTAGE", - "CSS_PERSPECTIVE", - "CSS_PRIMITIVE_VALUE", - "CSS_PT", - "CSS_PX", - "CSS_RAD", - "CSS_RECT", - "CSS_RGBCOLOR", - "CSS_ROTATE", - "CSS_ROTATE3D", - "CSS_ROTATEX", - "CSS_ROTATEY", - "CSS_ROTATEZ", - "CSS_S", - "CSS_SCALE", - "CSS_SCALE3D", - "CSS_SCALEX", - "CSS_SCALEY", - "CSS_SCALEZ", - "CSS_SKEW", - "CSS_SKEWX", - "CSS_SKEWY", - "CSS_STRING", - "CSS_TRANSLATE", - "CSS_TRANSLATE3D", - "CSS_TRANSLATEX", - "CSS_TRANSLATEY", - "CSS_TRANSLATEZ", - "CSS_UNKNOWN", - "CSS_URI", - "CSS_VALUE_LIST", - "CSS_VH", - "CSS_VMAX", - "CSS_VMIN", - "CSS_VW", - "CULL_FACE", - "CULL_FACE_MODE", - "CURRENT_PROGRAM", - "CURRENT_QUERY", - "CURRENT_VERTEX_ATTRIB", - "CUSTOM", - "CW", - "Cache", - "CacheStorage", - "CanvasCaptureMediaStream", - "CanvasCaptureMediaStreamTrack", - "CanvasGradient", - "CanvasPattern", - "CanvasRenderingContext2D", - "CaretPosition", - "ChannelMergerNode", - "ChannelSplitterNode", - "CharacterData", - "ClientRect", - "ClientRectList", - "Clipboard", - "ClipboardEvent", - "ClipboardItem", - "CloseEvent", - "Collator", - "CommandEvent", - "Comment", - "CompileError", - "CompositionEvent", - "CompressionStream", - "Console", - "ConstantSourceNode", - "Controllers", - "ConvolverNode", - "CountQueuingStrategy", - "Counter", - "Credential", - "CredentialsContainer", - "Crypto", - "CryptoKey", - "CustomElementRegistry", - "CustomEvent", - "DATABASE_ERR", - "DATA_CLONE_ERR", - "DATA_ERR", - "DBLCLICK", - "DECR", - "DECR_WRAP", - "DELETE_STATUS", - "DEPTH", - "DEPTH24_STENCIL8", - "DEPTH32F_STENCIL8", - "DEPTH_ATTACHMENT", - "DEPTH_BITS", - "DEPTH_BUFFER_BIT", - "DEPTH_CLEAR_VALUE", - "DEPTH_COMPONENT", - "DEPTH_COMPONENT16", - "DEPTH_COMPONENT24", - "DEPTH_COMPONENT32F", - "DEPTH_FUNC", - "DEPTH_RANGE", - "DEPTH_STENCIL", - "DEPTH_STENCIL_ATTACHMENT", - "DEPTH_TEST", - "DEPTH_WRITEMASK", - "DEVICE_INELIGIBLE", - "DIRECTION_DOWN", - "DIRECTION_LEFT", - "DIRECTION_RIGHT", - "DIRECTION_UP", - "DISABLED", - "DISPATCH_REQUEST_ERR", - "DITHER", - "DOCUMENT_FRAGMENT_NODE", - "DOCUMENT_NODE", - "DOCUMENT_POSITION_CONTAINED_BY", - "DOCUMENT_POSITION_CONTAINS", - "DOCUMENT_POSITION_DISCONNECTED", - "DOCUMENT_POSITION_FOLLOWING", - "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", - "DOCUMENT_POSITION_PRECEDING", - "DOCUMENT_TYPE_NODE", - "DOMCursor", - "DOMError", - "DOMException", - "DOMImplementation", - "DOMImplementationLS", - "DOMMatrix", - "DOMMatrixReadOnly", - "DOMParser", - "DOMPoint", - "DOMPointReadOnly", - "DOMQuad", - "DOMRect", - "DOMRectList", - "DOMRectReadOnly", - "DOMRequest", - "DOMSTRING_SIZE_ERR", - "DOMSettableTokenList", - "DOMStringList", - "DOMStringMap", - "DOMTokenList", - "DOMTransactionEvent", - "DOM_DELTA_LINE", - "DOM_DELTA_PAGE", - "DOM_DELTA_PIXEL", - "DOM_INPUT_METHOD_DROP", - "DOM_INPUT_METHOD_HANDWRITING", - "DOM_INPUT_METHOD_IME", - "DOM_INPUT_METHOD_KEYBOARD", - "DOM_INPUT_METHOD_MULTIMODAL", - "DOM_INPUT_METHOD_OPTION", - "DOM_INPUT_METHOD_PASTE", - "DOM_INPUT_METHOD_SCRIPT", - "DOM_INPUT_METHOD_UNKNOWN", - "DOM_INPUT_METHOD_VOICE", - "DOM_KEY_LOCATION_JOYSTICK", - "DOM_KEY_LOCATION_LEFT", - "DOM_KEY_LOCATION_MOBILE", - "DOM_KEY_LOCATION_NUMPAD", - "DOM_KEY_LOCATION_RIGHT", - "DOM_KEY_LOCATION_STANDARD", - "DOM_VK_0", - "DOM_VK_1", - "DOM_VK_2", - "DOM_VK_3", - "DOM_VK_4", - "DOM_VK_5", - "DOM_VK_6", - "DOM_VK_7", - "DOM_VK_8", - "DOM_VK_9", - "DOM_VK_A", - "DOM_VK_ACCEPT", - "DOM_VK_ADD", - "DOM_VK_ALT", - "DOM_VK_ALTGR", - "DOM_VK_AMPERSAND", - "DOM_VK_ASTERISK", - "DOM_VK_AT", - "DOM_VK_ATTN", - "DOM_VK_B", - "DOM_VK_BACKSPACE", - "DOM_VK_BACK_QUOTE", - "DOM_VK_BACK_SLASH", - "DOM_VK_BACK_SPACE", - "DOM_VK_C", - "DOM_VK_CANCEL", - "DOM_VK_CAPS_LOCK", - "DOM_VK_CIRCUMFLEX", - "DOM_VK_CLEAR", - "DOM_VK_CLOSE_BRACKET", - "DOM_VK_CLOSE_CURLY_BRACKET", - "DOM_VK_CLOSE_PAREN", - "DOM_VK_COLON", - "DOM_VK_COMMA", - "DOM_VK_CONTEXT_MENU", - "DOM_VK_CONTROL", - "DOM_VK_CONVERT", - "DOM_VK_CRSEL", - "DOM_VK_CTRL", - "DOM_VK_D", - "DOM_VK_DECIMAL", - "DOM_VK_DELETE", - "DOM_VK_DIVIDE", - "DOM_VK_DOLLAR", - "DOM_VK_DOUBLE_QUOTE", - "DOM_VK_DOWN", - "DOM_VK_E", - "DOM_VK_EISU", - "DOM_VK_END", - "DOM_VK_ENTER", - "DOM_VK_EQUALS", - "DOM_VK_EREOF", - "DOM_VK_ESCAPE", - "DOM_VK_EXCLAMATION", - "DOM_VK_EXECUTE", - "DOM_VK_EXSEL", - "DOM_VK_F", - "DOM_VK_F1", - "DOM_VK_F10", - "DOM_VK_F11", - "DOM_VK_F12", - "DOM_VK_F13", - "DOM_VK_F14", - "DOM_VK_F15", - "DOM_VK_F16", - "DOM_VK_F17", - "DOM_VK_F18", - "DOM_VK_F19", - "DOM_VK_F2", - "DOM_VK_F20", - "DOM_VK_F21", - "DOM_VK_F22", - "DOM_VK_F23", - "DOM_VK_F24", - "DOM_VK_F25", - "DOM_VK_F26", - "DOM_VK_F27", - "DOM_VK_F28", - "DOM_VK_F29", - "DOM_VK_F3", - "DOM_VK_F30", - "DOM_VK_F31", - "DOM_VK_F32", - "DOM_VK_F33", - "DOM_VK_F34", - "DOM_VK_F35", - "DOM_VK_F36", - "DOM_VK_F4", - "DOM_VK_F5", - "DOM_VK_F6", - "DOM_VK_F7", - "DOM_VK_F8", - "DOM_VK_F9", - "DOM_VK_FINAL", - "DOM_VK_FRONT", - "DOM_VK_G", - "DOM_VK_GREATER_THAN", - "DOM_VK_H", - "DOM_VK_HANGUL", - "DOM_VK_HANJA", - "DOM_VK_HASH", - "DOM_VK_HELP", - "DOM_VK_HK_TOGGLE", - "DOM_VK_HOME", - "DOM_VK_HYPHEN_MINUS", - "DOM_VK_I", - "DOM_VK_INSERT", - "DOM_VK_J", - "DOM_VK_JUNJA", - "DOM_VK_K", - "DOM_VK_KANA", - "DOM_VK_KANJI", - "DOM_VK_L", - "DOM_VK_LEFT", - "DOM_VK_LEFT_TAB", - "DOM_VK_LESS_THAN", - "DOM_VK_M", - "DOM_VK_META", - "DOM_VK_MODECHANGE", - "DOM_VK_MULTIPLY", - "DOM_VK_N", - "DOM_VK_NONCONVERT", - "DOM_VK_NUMPAD0", - "DOM_VK_NUMPAD1", - "DOM_VK_NUMPAD2", - "DOM_VK_NUMPAD3", - "DOM_VK_NUMPAD4", - "DOM_VK_NUMPAD5", - "DOM_VK_NUMPAD6", - "DOM_VK_NUMPAD7", - "DOM_VK_NUMPAD8", - "DOM_VK_NUMPAD9", - "DOM_VK_NUM_LOCK", - "DOM_VK_O", - "DOM_VK_OEM_1", - "DOM_VK_OEM_102", - "DOM_VK_OEM_2", - "DOM_VK_OEM_3", - "DOM_VK_OEM_4", - "DOM_VK_OEM_5", - "DOM_VK_OEM_6", - "DOM_VK_OEM_7", - "DOM_VK_OEM_8", - "DOM_VK_OEM_COMMA", - "DOM_VK_OEM_MINUS", - "DOM_VK_OEM_PERIOD", - "DOM_VK_OEM_PLUS", - "DOM_VK_OPEN_BRACKET", - "DOM_VK_OPEN_CURLY_BRACKET", - "DOM_VK_OPEN_PAREN", - "DOM_VK_P", - "DOM_VK_PA1", - "DOM_VK_PAGEDOWN", - "DOM_VK_PAGEUP", - "DOM_VK_PAGE_DOWN", - "DOM_VK_PAGE_UP", - "DOM_VK_PAUSE", - "DOM_VK_PERCENT", - "DOM_VK_PERIOD", - "DOM_VK_PIPE", - "DOM_VK_PLAY", - "DOM_VK_PLUS", - "DOM_VK_PRINT", - "DOM_VK_PRINTSCREEN", - "DOM_VK_PROCESSKEY", - "DOM_VK_PROPERITES", - "DOM_VK_Q", - "DOM_VK_QUESTION_MARK", - "DOM_VK_QUOTE", - "DOM_VK_R", - "DOM_VK_REDO", - "DOM_VK_RETURN", - "DOM_VK_RIGHT", - "DOM_VK_S", - "DOM_VK_SCROLL_LOCK", - "DOM_VK_SELECT", - "DOM_VK_SEMICOLON", - "DOM_VK_SEPARATOR", - "DOM_VK_SHIFT", - "DOM_VK_SLASH", - "DOM_VK_SLEEP", - "DOM_VK_SPACE", - "DOM_VK_SUBTRACT", - "DOM_VK_T", - "DOM_VK_TAB", - "DOM_VK_TILDE", - "DOM_VK_U", - "DOM_VK_UNDERSCORE", - "DOM_VK_UNDO", - "DOM_VK_UNICODE", - "DOM_VK_UP", - "DOM_VK_V", - "DOM_VK_VOLUME_DOWN", - "DOM_VK_VOLUME_MUTE", - "DOM_VK_VOLUME_UP", - "DOM_VK_W", - "DOM_VK_WIN", - "DOM_VK_WINDOW", - "DOM_VK_WIN_ICO_00", - "DOM_VK_WIN_ICO_CLEAR", - "DOM_VK_WIN_ICO_HELP", - "DOM_VK_WIN_OEM_ATTN", - "DOM_VK_WIN_OEM_AUTO", - "DOM_VK_WIN_OEM_BACKTAB", - "DOM_VK_WIN_OEM_CLEAR", - "DOM_VK_WIN_OEM_COPY", - "DOM_VK_WIN_OEM_CUSEL", - "DOM_VK_WIN_OEM_ENLW", - "DOM_VK_WIN_OEM_FINISH", - "DOM_VK_WIN_OEM_FJ_JISHO", - "DOM_VK_WIN_OEM_FJ_LOYA", - "DOM_VK_WIN_OEM_FJ_MASSHOU", - "DOM_VK_WIN_OEM_FJ_ROYA", - "DOM_VK_WIN_OEM_FJ_TOUROKU", - "DOM_VK_WIN_OEM_JUMP", - "DOM_VK_WIN_OEM_PA1", - "DOM_VK_WIN_OEM_PA2", - "DOM_VK_WIN_OEM_PA3", - "DOM_VK_WIN_OEM_RESET", - "DOM_VK_WIN_OEM_WSCTRL", - "DOM_VK_X", - "DOM_VK_XF86XK_ADD_FAVORITE", - "DOM_VK_XF86XK_APPLICATION_LEFT", - "DOM_VK_XF86XK_APPLICATION_RIGHT", - "DOM_VK_XF86XK_AUDIO_CYCLE_TRACK", - "DOM_VK_XF86XK_AUDIO_FORWARD", - "DOM_VK_XF86XK_AUDIO_LOWER_VOLUME", - "DOM_VK_XF86XK_AUDIO_MEDIA", - "DOM_VK_XF86XK_AUDIO_MUTE", - "DOM_VK_XF86XK_AUDIO_NEXT", - "DOM_VK_XF86XK_AUDIO_PAUSE", - "DOM_VK_XF86XK_AUDIO_PLAY", - "DOM_VK_XF86XK_AUDIO_PREV", - "DOM_VK_XF86XK_AUDIO_RAISE_VOLUME", - "DOM_VK_XF86XK_AUDIO_RANDOM_PLAY", - "DOM_VK_XF86XK_AUDIO_RECORD", - "DOM_VK_XF86XK_AUDIO_REPEAT", - "DOM_VK_XF86XK_AUDIO_REWIND", - "DOM_VK_XF86XK_AUDIO_STOP", - "DOM_VK_XF86XK_AWAY", - "DOM_VK_XF86XK_BACK", - "DOM_VK_XF86XK_BACK_FORWARD", - "DOM_VK_XF86XK_BATTERY", - "DOM_VK_XF86XK_BLUE", - "DOM_VK_XF86XK_BLUETOOTH", - "DOM_VK_XF86XK_BOOK", - "DOM_VK_XF86XK_BRIGHTNESS_ADJUST", - "DOM_VK_XF86XK_CALCULATOR", - "DOM_VK_XF86XK_CALENDAR", - "DOM_VK_XF86XK_CD", - "DOM_VK_XF86XK_CLOSE", - "DOM_VK_XF86XK_COMMUNITY", - "DOM_VK_XF86XK_CONTRAST_ADJUST", - "DOM_VK_XF86XK_COPY", - "DOM_VK_XF86XK_CUT", - "DOM_VK_XF86XK_CYCLE_ANGLE", - "DOM_VK_XF86XK_DISPLAY", - "DOM_VK_XF86XK_DOCUMENTS", - "DOM_VK_XF86XK_DOS", - "DOM_VK_XF86XK_EJECT", - "DOM_VK_XF86XK_EXCEL", - "DOM_VK_XF86XK_EXPLORER", - "DOM_VK_XF86XK_FAVORITES", - "DOM_VK_XF86XK_FINANCE", - "DOM_VK_XF86XK_FORWARD", - "DOM_VK_XF86XK_FRAME_BACK", - "DOM_VK_XF86XK_FRAME_FORWARD", - "DOM_VK_XF86XK_GAME", - "DOM_VK_XF86XK_GO", - "DOM_VK_XF86XK_GREEN", - "DOM_VK_XF86XK_HIBERNATE", - "DOM_VK_XF86XK_HISTORY", - "DOM_VK_XF86XK_HOME_PAGE", - "DOM_VK_XF86XK_HOT_LINKS", - "DOM_VK_XF86XK_I_TOUCH", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_KBD_BRIGHTNESS_UP", - "DOM_VK_XF86XK_KBD_LIGHT_ON_OFF", - "DOM_VK_XF86XK_LAUNCH0", - "DOM_VK_XF86XK_LAUNCH1", - "DOM_VK_XF86XK_LAUNCH2", - "DOM_VK_XF86XK_LAUNCH3", - "DOM_VK_XF86XK_LAUNCH4", - "DOM_VK_XF86XK_LAUNCH5", - "DOM_VK_XF86XK_LAUNCH6", - "DOM_VK_XF86XK_LAUNCH7", - "DOM_VK_XF86XK_LAUNCH8", - "DOM_VK_XF86XK_LAUNCH9", - "DOM_VK_XF86XK_LAUNCH_A", - "DOM_VK_XF86XK_LAUNCH_B", - "DOM_VK_XF86XK_LAUNCH_C", - "DOM_VK_XF86XK_LAUNCH_D", - "DOM_VK_XF86XK_LAUNCH_E", - "DOM_VK_XF86XK_LAUNCH_F", - "DOM_VK_XF86XK_LIGHT_BULB", - "DOM_VK_XF86XK_LOG_OFF", - "DOM_VK_XF86XK_MAIL", - "DOM_VK_XF86XK_MAIL_FORWARD", - "DOM_VK_XF86XK_MARKET", - "DOM_VK_XF86XK_MEETING", - "DOM_VK_XF86XK_MEMO", - "DOM_VK_XF86XK_MENU_KB", - "DOM_VK_XF86XK_MENU_PB", - "DOM_VK_XF86XK_MESSENGER", - "DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN", - "DOM_VK_XF86XK_MON_BRIGHTNESS_UP", - "DOM_VK_XF86XK_MUSIC", - "DOM_VK_XF86XK_MY_COMPUTER", - "DOM_VK_XF86XK_MY_SITES", - "DOM_VK_XF86XK_NEW", - "DOM_VK_XF86XK_NEWS", - "DOM_VK_XF86XK_OFFICE_HOME", - "DOM_VK_XF86XK_OPEN", - "DOM_VK_XF86XK_OPEN_URL", - "DOM_VK_XF86XK_OPTION", - "DOM_VK_XF86XK_PASTE", - "DOM_VK_XF86XK_PHONE", - "DOM_VK_XF86XK_PICTURES", - "DOM_VK_XF86XK_POWER_DOWN", - "DOM_VK_XF86XK_POWER_OFF", - "DOM_VK_XF86XK_RED", - "DOM_VK_XF86XK_REFRESH", - "DOM_VK_XF86XK_RELOAD", - "DOM_VK_XF86XK_REPLY", - "DOM_VK_XF86XK_ROCKER_DOWN", - "DOM_VK_XF86XK_ROCKER_ENTER", - "DOM_VK_XF86XK_ROCKER_UP", - "DOM_VK_XF86XK_ROTATE_WINDOWS", - "DOM_VK_XF86XK_ROTATION_KB", - "DOM_VK_XF86XK_ROTATION_PB", - "DOM_VK_XF86XK_SAVE", - "DOM_VK_XF86XK_SCREEN_SAVER", - "DOM_VK_XF86XK_SCROLL_CLICK", - "DOM_VK_XF86XK_SCROLL_DOWN", - "DOM_VK_XF86XK_SCROLL_UP", - "DOM_VK_XF86XK_SEARCH", - "DOM_VK_XF86XK_SEND", - "DOM_VK_XF86XK_SHOP", - "DOM_VK_XF86XK_SPELL", - "DOM_VK_XF86XK_SPLIT_SCREEN", - "DOM_VK_XF86XK_STANDBY", - "DOM_VK_XF86XK_START", - "DOM_VK_XF86XK_STOP", - "DOM_VK_XF86XK_SUBTITLE", - "DOM_VK_XF86XK_SUPPORT", - "DOM_VK_XF86XK_SUSPEND", - "DOM_VK_XF86XK_TASK_PANE", - "DOM_VK_XF86XK_TERMINAL", - "DOM_VK_XF86XK_TIME", - "DOM_VK_XF86XK_TOOLS", - "DOM_VK_XF86XK_TOP_MENU", - "DOM_VK_XF86XK_TO_DO_LIST", - "DOM_VK_XF86XK_TRAVEL", - "DOM_VK_XF86XK_USER1KB", - "DOM_VK_XF86XK_USER2KB", - "DOM_VK_XF86XK_USER_PB", - "DOM_VK_XF86XK_UWB", - "DOM_VK_XF86XK_VENDOR_HOME", - "DOM_VK_XF86XK_VIDEO", - "DOM_VK_XF86XK_VIEW", - "DOM_VK_XF86XK_WAKE_UP", - "DOM_VK_XF86XK_WEB_CAM", - "DOM_VK_XF86XK_WHEEL_BUTTON", - "DOM_VK_XF86XK_WLAN", - "DOM_VK_XF86XK_WORD", - "DOM_VK_XF86XK_WWW", - "DOM_VK_XF86XK_XFER", - "DOM_VK_XF86XK_YELLOW", - "DOM_VK_XF86XK_ZOOM_IN", - "DOM_VK_XF86XK_ZOOM_OUT", - "DOM_VK_Y", - "DOM_VK_Z", - "DOM_VK_ZOOM", - "DONE", - "DONT_CARE", - "DOWNLOADING", - "DRAGDROP", - "DRAW_BUFFER0", - "DRAW_BUFFER1", - "DRAW_BUFFER10", - "DRAW_BUFFER11", - "DRAW_BUFFER12", - "DRAW_BUFFER13", - "DRAW_BUFFER14", - "DRAW_BUFFER15", - "DRAW_BUFFER2", - "DRAW_BUFFER3", - "DRAW_BUFFER4", - "DRAW_BUFFER5", - "DRAW_BUFFER6", - "DRAW_BUFFER7", - "DRAW_BUFFER8", - "DRAW_BUFFER9", - "DRAW_FRAMEBUFFER", - "DRAW_FRAMEBUFFER_BINDING", - "DST_ALPHA", - "DST_COLOR", - "DYNAMIC_COPY", - "DYNAMIC_DRAW", - "DYNAMIC_READ", - "DataChannel", - "DataTransfer", - "DataTransferItem", - "DataTransferItemList", - "DataView", - "Date", - "DateTimeFormat", - "DecompressionStream", - "DelayNode", - "DeprecationReportBody", - "DesktopNotification", - "DesktopNotificationCenter", - "DeviceLightEvent", - "DeviceMotionEvent", - "DeviceMotionEventAcceleration", - "DeviceMotionEventRotationRate", - "DeviceOrientationEvent", - "DeviceProximityEvent", - "DeviceStorage", - "DeviceStorageChangeEvent", - "Directory", - "DisplayNames", - "Document", - "DocumentFragment", - "DocumentTimeline", - "DocumentType", - "DragEvent", - "DynamicsCompressorNode", - "E", - "ELEMENT_ARRAY_BUFFER", - "ELEMENT_ARRAY_BUFFER_BINDING", - "ELEMENT_NODE", - "EMPTY", - "ENCODING_ERR", - "ENDED", - "END_TO_END", - "END_TO_START", - "ENTITY_NODE", - "ENTITY_REFERENCE_NODE", - "EPSILON", - "EQUAL", - "EQUALPOWER", - "ERROR", - "EXPONENTIAL_DISTANCE", - "Element", - "ElementInternals", - "ElementQuery", - "EnterPictureInPictureEvent", - "Entity", - "EntityReference", - "Error", - "ErrorEvent", - "EvalError", - "Event", - "EventException", - "EventSource", - "EventTarget", - "External", - "FASTEST", - "FIDOSDK", - "FILTER_ACCEPT", - "FILTER_INTERRUPT", - "FILTER_REJECT", - "FILTER_SKIP", - "FINISHED_STATE", - "FIRST_ORDERED_NODE_TYPE", - "FLOAT", - "FLOAT_32_UNSIGNED_INT_24_8_REV", - "FLOAT_MAT2", - "FLOAT_MAT2x3", - "FLOAT_MAT2x4", - "FLOAT_MAT3", - "FLOAT_MAT3x2", - "FLOAT_MAT3x4", - "FLOAT_MAT4", - "FLOAT_MAT4x2", - "FLOAT_MAT4x3", - "FLOAT_VEC2", - "FLOAT_VEC3", - "FLOAT_VEC4", - "FOCUS", - "FONT_FACE_RULE", - "FONT_FEATURE_VALUES_RULE", - "FRAGMENT", - "FRAGMENT_SHADER", - "FRAGMENT_SHADER_DERIVATIVE_HINT", - "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", - "FRAMEBUFFER", - "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", - "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", - "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", - "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", - "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", - "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", - "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", - "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", - "FRAMEBUFFER_ATTACHMENT_RED_SIZE", - "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", - "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", - "FRAMEBUFFER_BINDING", - "FRAMEBUFFER_COMPLETE", - "FRAMEBUFFER_DEFAULT", - "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", - "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", - "FRAMEBUFFER_UNSUPPORTED", - "FRONT", - "FRONT_AND_BACK", - "FRONT_FACE", - "FUNC_ADD", - "FUNC_REVERSE_SUBTRACT", - "FUNC_SUBTRACT", - "FeaturePolicy", - "FeaturePolicyViolationReportBody", - "FederatedCredential", - "Feed", - "FeedEntry", - "File", - "FileError", - "FileList", - "FileReader", - "FileSystem", - "FileSystemDirectoryEntry", - "FileSystemDirectoryReader", - "FileSystemEntry", - "FileSystemFileEntry", - "FinalizationRegistry", - "FindInPage", - "Float32Array", - "Float64Array", - "FocusEvent", - "FontFace", - "FontFaceSet", - "FontFaceSetLoadEvent", - "FormData", - "FormDataEvent", - "FragmentDirective", - "Function", - "GENERATE_MIPMAP_HINT", - "GEQUAL", - "GREATER", - "GREEN", - "GREEN_BITS", - "GainNode", - "Gamepad", - "GamepadAxisMoveEvent", - "GamepadButton", - "GamepadButtonEvent", - "GamepadEvent", - "GamepadHapticActuator", - "GamepadPose", - "Geolocation", - "GeolocationCoordinates", - "GeolocationPosition", - "GeolocationPositionError", - "GestureEvent", - "Global", - "Gyroscope", - "HALF_FLOAT", - "HAVE_CURRENT_DATA", - "HAVE_ENOUGH_DATA", - "HAVE_FUTURE_DATA", - "HAVE_METADATA", - "HAVE_NOTHING", - "HEADERS_RECEIVED", - "HIDDEN", - "HIERARCHY_REQUEST_ERR", - "HIGHPASS", - "HIGHSHELF", - "HIGH_FLOAT", - "HIGH_INT", - "HORIZONTAL", - "HORIZONTAL_AXIS", - "HRTF", - "HTMLAllCollection", - "HTMLAnchorElement", - "HTMLAppletElement", - "HTMLAreaElement", - "HTMLAudioElement", - "HTMLBRElement", - "HTMLBaseElement", - "HTMLBaseFontElement", - "HTMLBlockquoteElement", - "HTMLBodyElement", - "HTMLButtonElement", - "HTMLCanvasElement", - "HTMLCollection", - "HTMLCommandElement", - "HTMLContentElement", - "HTMLDListElement", - "HTMLDataElement", - "HTMLDataListElement", - "HTMLDetailsElement", - "HTMLDialogElement", - "HTMLDirectoryElement", - "HTMLDivElement", - "HTMLDocument", - "HTMLElement", - "HTMLEmbedElement", - "HTMLFieldSetElement", - "HTMLFontElement", - "HTMLFormControlsCollection", - "HTMLFormElement", - "HTMLFrameElement", - "HTMLFrameSetElement", - "HTMLHRElement", - "HTMLHeadElement", - "HTMLHeadingElement", - "HTMLHtmlElement", - "HTMLIFrameElement", - "HTMLImageElement", - "HTMLInputElement", - "HTMLIsIndexElement", - "HTMLKeygenElement", - "HTMLLIElement", - "HTMLLabelElement", - "HTMLLegendElement", - "HTMLLinkElement", - "HTMLMapElement", - "HTMLMarqueeElement", - "HTMLMediaElement", - "HTMLMenuElement", - "HTMLMenuItemElement", - "HTMLMetaElement", - "HTMLMeterElement", - "HTMLModElement", - "HTMLOListElement", - "HTMLObjectElement", - "HTMLOptGroupElement", - "HTMLOptionElement", - "HTMLOptionsCollection", - "HTMLOutputElement", - "HTMLParagraphElement", - "HTMLParamElement", - "HTMLPictureElement", - "HTMLPreElement", - "HTMLProgressElement", - "HTMLPropertiesCollection", - "HTMLQuoteElement", - "HTMLScriptElement", - "HTMLSelectElement", - "HTMLShadowElement", - "HTMLSlotElement", - "HTMLSourceElement", - "HTMLSpanElement", - "HTMLStyleElement", - "HTMLTableCaptionElement", - "HTMLTableCellElement", - "HTMLTableColElement", - "HTMLTableElement", - "HTMLTableRowElement", - "HTMLTableSectionElement", - "HTMLTemplateElement", - "HTMLTextAreaElement", - "HTMLTimeElement", - "HTMLTitleElement", - "HTMLTrackElement", - "HTMLUListElement", - "HTMLUnknownElement", - "HTMLVideoElement", - "HashChangeEvent", - "Headers", - "History", - "Hz", - "ICE_CHECKING", - "ICE_CLOSED", - "ICE_COMPLETED", - "ICE_CONNECTED", - "ICE_FAILED", - "ICE_GATHERING", - "ICE_WAITING", - "IDBCursor", - "IDBCursorWithValue", - "IDBDatabase", - "IDBDatabaseException", - "IDBFactory", - "IDBFileHandle", - "IDBFileRequest", - "IDBIndex", - "IDBKeyRange", - "IDBMutableFile", - "IDBObjectStore", - "IDBOpenDBRequest", - "IDBRequest", - "IDBTransaction", - "IDBVersionChangeEvent", - "IDLE", - "IIRFilterNode", - "IMPLEMENTATION_COLOR_READ_FORMAT", - "IMPLEMENTATION_COLOR_READ_TYPE", - "IMPORT_RULE", - "INCR", - "INCR_WRAP", - "INDEX", - "INDEX_SIZE_ERR", - "INDIRECT", - "INT", - "INTERLEAVED_ATTRIBS", - "INT_2_10_10_10_REV", - "INT_SAMPLER_2D", - "INT_SAMPLER_2D_ARRAY", - "INT_SAMPLER_3D", - "INT_SAMPLER_CUBE", - "INT_VEC2", - "INT_VEC3", - "INT_VEC4", - "INUSE_ATTRIBUTE_ERR", - "INVALID_ACCESS_ERR", - "INVALID_CHARACTER_ERR", - "INVALID_ENUM", - "INVALID_EXPRESSION_ERR", - "INVALID_FRAMEBUFFER_OPERATION", - "INVALID_INDEX", - "INVALID_MODIFICATION_ERR", - "INVALID_NODE_TYPE_ERR", - "INVALID_OPERATION", - "INVALID_STATE_ERR", - "INVALID_VALUE", - "INVERSE_DISTANCE", - "INVERT", - "IceCandidate", - "IdleDeadline", - "Image", - "ImageBitmap", - "ImageBitmapRenderingContext", - "ImageCapture", - "ImageData", - "Infinity", - "InputDeviceCapabilities", - "InputDeviceInfo", - "InputEvent", - "InputMethodContext", - "InstallTrigger", - "InstallTriggerImpl", - "Instance", - "Int16Array", - "Int32Array", - "Int8Array", - "Intent", - "InternalError", - "IntersectionObserver", - "IntersectionObserverEntry", - "Intl", - "IsSearchProviderInstalled", - "Iterator", - "JSON", - "KEEP", - "KEYDOWN", - "KEYFRAMES_RULE", - "KEYFRAME_RULE", - "KEYPRESS", - "KEYUP", - "KeyEvent", - "Keyboard", - "KeyboardEvent", - "KeyboardLayoutMap", - "KeyframeEffect", - "LENGTHADJUST_SPACING", - "LENGTHADJUST_SPACINGANDGLYPHS", - "LENGTHADJUST_UNKNOWN", - "LEQUAL", - "LESS", - "LINEAR", - "LINEAR_DISTANCE", - "LINEAR_MIPMAP_LINEAR", - "LINEAR_MIPMAP_NEAREST", - "LINES", - "LINE_LOOP", - "LINE_STRIP", - "LINE_WIDTH", - "LINK_STATUS", - "LIVE", - "LN10", - "LN2", - "LOADED", - "LOADING", - "LOG10E", - "LOG2E", - "LOWPASS", - "LOWSHELF", - "LOW_FLOAT", - "LOW_INT", - "LSException", - "LSParserFilter", - "LUMINANCE", - "LUMINANCE_ALPHA", - "LargestContentfulPaint", - "LayoutShift", - "LayoutShiftAttribution", - "LinearAccelerationSensor", - "LinkError", - "ListFormat", - "LocalMediaStream", - "Locale", - "Location", - "Lock", - "LockManager", - "MAP_READ", - "MAP_WRITE", - "MAX", - "MAX_3D_TEXTURE_SIZE", - "MAX_ARRAY_TEXTURE_LAYERS", - "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", - "MAX_COLOR_ATTACHMENTS", - "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_COMBINED_TEXTURE_IMAGE_UNITS", - "MAX_COMBINED_UNIFORM_BLOCKS", - "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", - "MAX_CUBE_MAP_TEXTURE_SIZE", - "MAX_DRAW_BUFFERS", - "MAX_ELEMENTS_INDICES", - "MAX_ELEMENTS_VERTICES", - "MAX_ELEMENT_INDEX", - "MAX_FRAGMENT_INPUT_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_BLOCKS", - "MAX_FRAGMENT_UNIFORM_COMPONENTS", - "MAX_FRAGMENT_UNIFORM_VECTORS", - "MAX_PROGRAM_TEXEL_OFFSET", - "MAX_RENDERBUFFER_SIZE", - "MAX_SAFE_INTEGER", - "MAX_SAMPLES", - "MAX_SERVER_WAIT_TIMEOUT", - "MAX_TEXTURE_IMAGE_UNITS", - "MAX_TEXTURE_LOD_BIAS", - "MAX_TEXTURE_MAX_ANISOTROPY_EXT", - "MAX_TEXTURE_SIZE", - "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", - "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", - "MAX_UNIFORM_BLOCK_SIZE", - "MAX_UNIFORM_BUFFER_BINDINGS", - "MAX_VALUE", - "MAX_VARYING_COMPONENTS", - "MAX_VARYING_VECTORS", - "MAX_VERTEX_ATTRIBS", - "MAX_VERTEX_OUTPUT_COMPONENTS", - "MAX_VERTEX_TEXTURE_IMAGE_UNITS", - "MAX_VERTEX_UNIFORM_BLOCKS", - "MAX_VERTEX_UNIFORM_COMPONENTS", - "MAX_VERTEX_UNIFORM_VECTORS", - "MAX_VIEWPORT_DIMS", - "MEDIA_ERR_ABORTED", - "MEDIA_ERR_DECODE", - "MEDIA_ERR_ENCRYPTED", - "MEDIA_ERR_NETWORK", - "MEDIA_ERR_SRC_NOT_SUPPORTED", - "MEDIA_KEYERR_CLIENT", - "MEDIA_KEYERR_DOMAIN", - "MEDIA_KEYERR_HARDWARECHANGE", - "MEDIA_KEYERR_OUTPUT", - "MEDIA_KEYERR_SERVICE", - "MEDIA_KEYERR_UNKNOWN", - "MEDIA_RULE", - "MEDIUM_FLOAT", - "MEDIUM_INT", - "META_MASK", - "MIDIAccess", - "MIDIConnectionEvent", - "MIDIInput", - "MIDIInputMap", - "MIDIMessageEvent", - "MIDIOutput", - "MIDIOutputMap", - "MIDIPort", - "MIN", - "MIN_PROGRAM_TEXEL_OFFSET", - "MIN_SAFE_INTEGER", - "MIN_VALUE", - "MIRRORED_REPEAT", - "MODE_ASYNCHRONOUS", - "MODE_SYNCHRONOUS", - "MODIFICATION", - "MOUSEDOWN", - "MOUSEDRAG", - "MOUSEMOVE", - "MOUSEOUT", - "MOUSEOVER", - "MOUSEUP", - "MOZ_KEYFRAMES_RULE", - "MOZ_KEYFRAME_RULE", - "MOZ_SOURCE_CURSOR", - "MOZ_SOURCE_ERASER", - "MOZ_SOURCE_KEYBOARD", - "MOZ_SOURCE_MOUSE", - "MOZ_SOURCE_PEN", - "MOZ_SOURCE_TOUCH", - "MOZ_SOURCE_UNKNOWN", - "MSGESTURE_FLAG_BEGIN", - "MSGESTURE_FLAG_CANCEL", - "MSGESTURE_FLAG_END", - "MSGESTURE_FLAG_INERTIA", - "MSGESTURE_FLAG_NONE", - "MSPOINTER_TYPE_MOUSE", - "MSPOINTER_TYPE_PEN", - "MSPOINTER_TYPE_TOUCH", - "MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE", - "MS_ASYNC_CALLBACK_STATUS_CANCEL", - "MS_ASYNC_CALLBACK_STATUS_CHOOSEANY", - "MS_ASYNC_CALLBACK_STATUS_ERROR", - "MS_ASYNC_CALLBACK_STATUS_JOIN", - "MS_ASYNC_OP_STATUS_CANCELED", - "MS_ASYNC_OP_STATUS_ERROR", - "MS_ASYNC_OP_STATUS_SUCCESS", - "MS_MANIPULATION_STATE_ACTIVE", - "MS_MANIPULATION_STATE_CANCELLED", - "MS_MANIPULATION_STATE_COMMITTED", - "MS_MANIPULATION_STATE_DRAGGING", - "MS_MANIPULATION_STATE_INERTIA", - "MS_MANIPULATION_STATE_PRESELECT", - "MS_MANIPULATION_STATE_SELECTING", - "MS_MANIPULATION_STATE_STOPPED", - "MS_MEDIA_ERR_ENCRYPTED", - "MS_MEDIA_KEYERR_CLIENT", - "MS_MEDIA_KEYERR_DOMAIN", - "MS_MEDIA_KEYERR_HARDWARECHANGE", - "MS_MEDIA_KEYERR_OUTPUT", - "MS_MEDIA_KEYERR_SERVICE", - "MS_MEDIA_KEYERR_UNKNOWN", - "Map", - "Math", - "MathMLElement", - "MediaCapabilities", - "MediaCapabilitiesInfo", - "MediaController", - "MediaDeviceInfo", - "MediaDevices", - "MediaElementAudioSourceNode", - "MediaEncryptedEvent", - "MediaError", - "MediaKeyError", - "MediaKeyEvent", - "MediaKeyMessageEvent", - "MediaKeyNeededEvent", - "MediaKeySession", - "MediaKeyStatusMap", - "MediaKeySystemAccess", - "MediaKeys", - "MediaList", - "MediaMetadata", - "MediaQueryList", - "MediaQueryListEvent", - "MediaRecorder", - "MediaRecorderErrorEvent", - "MediaSession", - "MediaSettingsRange", - "MediaSource", - "MediaStream", - "MediaStreamAudioDestinationNode", - "MediaStreamAudioSourceNode", - "MediaStreamEvent", - "MediaStreamTrack", - "MediaStreamTrackAudioSourceNode", - "MediaStreamTrackEvent", - "Memory", - "MessageChannel", - "MessageEvent", - "MessagePort", - "Methods", - "MimeType", - "MimeTypeArray", - "Module", - "MouseEvent", - "MouseScrollEvent", - "MozAnimation", - "MozAnimationDelay", - "MozAnimationDirection", - "MozAnimationDuration", - "MozAnimationFillMode", - "MozAnimationIterationCount", - "MozAnimationName", - "MozAnimationPlayState", - "MozAnimationTimingFunction", - "MozAppearance", - "MozBackfaceVisibility", - "MozBinding", - "MozBorderBottomColors", - "MozBorderEnd", - "MozBorderEndColor", - "MozBorderEndStyle", - "MozBorderEndWidth", - "MozBorderImage", - "MozBorderLeftColors", - "MozBorderRightColors", - "MozBorderStart", - "MozBorderStartColor", - "MozBorderStartStyle", - "MozBorderStartWidth", - "MozBorderTopColors", - "MozBoxAlign", - "MozBoxDirection", - "MozBoxFlex", - "MozBoxOrdinalGroup", - "MozBoxOrient", - "MozBoxPack", - "MozBoxSizing", - "MozCSSKeyframeRule", - "MozCSSKeyframesRule", - "MozColumnCount", - "MozColumnFill", - "MozColumnGap", - "MozColumnRule", - "MozColumnRuleColor", - "MozColumnRuleStyle", - "MozColumnRuleWidth", - "MozColumnWidth", - "MozColumns", - "MozContactChangeEvent", - "MozFloatEdge", - "MozFontFeatureSettings", - "MozFontLanguageOverride", - "MozForceBrokenImageIcon", - "MozHyphens", - "MozImageRegion", - "MozMarginEnd", - "MozMarginStart", - "MozMmsEvent", - "MozMmsMessage", - "MozMobileMessageThread", - "MozOSXFontSmoothing", - "MozOrient", - "MozOsxFontSmoothing", - "MozOutlineRadius", - "MozOutlineRadiusBottomleft", - "MozOutlineRadiusBottomright", - "MozOutlineRadiusTopleft", - "MozOutlineRadiusTopright", - "MozPaddingEnd", - "MozPaddingStart", - "MozPerspective", - "MozPerspectiveOrigin", - "MozPowerManager", - "MozSettingsEvent", - "MozSmsEvent", - "MozSmsMessage", - "MozStackSizing", - "MozTabSize", - "MozTextAlignLast", - "MozTextDecorationColor", - "MozTextDecorationLine", - "MozTextDecorationStyle", - "MozTextSizeAdjust", - "MozTransform", - "MozTransformOrigin", - "MozTransformStyle", - "MozTransition", - "MozTransitionDelay", - "MozTransitionDuration", - "MozTransitionProperty", - "MozTransitionTimingFunction", - "MozUserFocus", - "MozUserInput", - "MozUserModify", - "MozUserSelect", - "MozWindowDragging", - "MozWindowShadow", - "MutationEvent", - "MutationObserver", - "MutationRecord", - "NAMESPACE_ERR", - "NAMESPACE_RULE", - "NEAREST", - "NEAREST_MIPMAP_LINEAR", - "NEAREST_MIPMAP_NEAREST", - "NEGATIVE_INFINITY", - "NETWORK_EMPTY", - "NETWORK_ERR", - "NETWORK_IDLE", - "NETWORK_LOADED", - "NETWORK_LOADING", - "NETWORK_NO_SOURCE", - "NEVER", - "NEW", - "NEXT", - "NEXT_NO_DUPLICATE", - "NICEST", - "NODE_AFTER", - "NODE_BEFORE", - "NODE_BEFORE_AND_AFTER", - "NODE_INSIDE", - "NONE", - "NON_TRANSIENT_ERR", - "NOTATION_NODE", - "NOTCH", - "NOTEQUAL", - "NOT_ALLOWED_ERR", - "NOT_FOUND_ERR", - "NOT_READABLE_ERR", - "NOT_SUPPORTED_ERR", - "NO_DATA_ALLOWED_ERR", - "NO_ERR", - "NO_ERROR", - "NO_MODIFICATION_ALLOWED_ERR", - "NUMBER_TYPE", - "NUM_COMPRESSED_TEXTURE_FORMATS", - "NaN", - "NamedNodeMap", - "NavigationPreloadManager", - "Navigator", - "NearbyLinks", - "NetworkInformation", - "Node", - "NodeFilter", - "NodeIterator", - "NodeList", - "Notation", - "Notification", - "NotifyPaintEvent", - "Number", - "NumberFormat", - "OBJECT_TYPE", - "OBSOLETE", - "OK", - "ONE", - "ONE_MINUS_CONSTANT_ALPHA", - "ONE_MINUS_CONSTANT_COLOR", - "ONE_MINUS_DST_ALPHA", - "ONE_MINUS_DST_COLOR", - "ONE_MINUS_SRC_ALPHA", - "ONE_MINUS_SRC_COLOR", - "OPEN", - "OPENED", - "OPENING", - "ORDERED_NODE_ITERATOR_TYPE", - "ORDERED_NODE_SNAPSHOT_TYPE", - "OTHER_ERROR", - "OUT_OF_MEMORY", - "Object", - "OfflineAudioCompletionEvent", - "OfflineAudioContext", - "OfflineResourceList", - "OffscreenCanvas", - "OffscreenCanvasRenderingContext2D", - "Option", - "OrientationSensor", - "OscillatorNode", - "OverconstrainedError", - "OverflowEvent", - "PACK_ALIGNMENT", - "PACK_ROW_LENGTH", - "PACK_SKIP_PIXELS", - "PACK_SKIP_ROWS", - "PAGE_RULE", - "PARSE_ERR", - "PATHSEG_ARC_ABS", - "PATHSEG_ARC_REL", - "PATHSEG_CLOSEPATH", - "PATHSEG_CURVETO_CUBIC_ABS", - "PATHSEG_CURVETO_CUBIC_REL", - "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", - "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", - "PATHSEG_CURVETO_QUADRATIC_ABS", - "PATHSEG_CURVETO_QUADRATIC_REL", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", - "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", - "PATHSEG_LINETO_ABS", - "PATHSEG_LINETO_HORIZONTAL_ABS", - "PATHSEG_LINETO_HORIZONTAL_REL", - "PATHSEG_LINETO_REL", - "PATHSEG_LINETO_VERTICAL_ABS", - "PATHSEG_LINETO_VERTICAL_REL", - "PATHSEG_MOVETO_ABS", - "PATHSEG_MOVETO_REL", - "PATHSEG_UNKNOWN", - "PATH_EXISTS_ERR", - "PEAKING", - "PERMISSION_DENIED", - "PERSISTENT", - "PI", - "PIXEL_PACK_BUFFER", - "PIXEL_PACK_BUFFER_BINDING", - "PIXEL_UNPACK_BUFFER", - "PIXEL_UNPACK_BUFFER_BINDING", - "PLAYING_STATE", - "POINTS", - "POLYGON_OFFSET_FACTOR", - "POLYGON_OFFSET_FILL", - "POLYGON_OFFSET_UNITS", - "POSITION_UNAVAILABLE", - "POSITIVE_INFINITY", - "PREV", - "PREV_NO_DUPLICATE", - "PROCESSING_INSTRUCTION_NODE", - "PageChangeEvent", - "PageTransitionEvent", - "PaintRequest", - "PaintRequestList", - "PannerNode", - "PasswordCredential", - "Path2D", - "PaymentAddress", - "PaymentInstruments", - "PaymentManager", - "PaymentMethodChangeEvent", - "PaymentRequest", - "PaymentRequestUpdateEvent", - "PaymentResponse", - "Performance", - "PerformanceElementTiming", - "PerformanceEntry", - "PerformanceEventTiming", - "PerformanceLongTaskTiming", - "PerformanceMark", - "PerformanceMeasure", - "PerformanceNavigation", - "PerformanceNavigationTiming", - "PerformanceObserver", - "PerformanceObserverEntryList", - "PerformancePaintTiming", - "PerformanceResourceTiming", - "PerformanceServerTiming", - "PerformanceTiming", - "PeriodicSyncManager", - "PeriodicWave", - "PermissionStatus", - "Permissions", - "PhotoCapabilities", - "PictureInPictureWindow", - "Plugin", - "PluginArray", - "PluralRules", - "PointerEvent", - "PopStateEvent", - "PopupBlockedEvent", - "Presentation", - "PresentationAvailability", - "PresentationConnection", - "PresentationConnectionAvailableEvent", - "PresentationConnectionCloseEvent", - "PresentationConnectionList", - "PresentationReceiver", - "PresentationRequest", - "ProcessingInstruction", - "ProgressEvent", - "Promise", - "PromiseRejectionEvent", - "PropertyNodeList", - "Proxy", - "PublicKeyCredential", - "PushManager", - "PushSubscription", - "PushSubscriptionOptions", - "Q", - "QUERY_RESOLVE", - "QUERY_RESULT", - "QUERY_RESULT_AVAILABLE", - "QUOTA_ERR", - "QUOTA_EXCEEDED_ERR", - "QueryInterface", - "R11F_G11F_B10F", - "R16F", - "R16I", - "R16UI", - "R32F", - "R32I", - "R32UI", - "R8", - "R8I", - "R8UI", - "R8_SNORM", - "RASTERIZER_DISCARD", - "READ", - "READ_BUFFER", - "READ_FRAMEBUFFER", - "READ_FRAMEBUFFER_BINDING", - "READ_ONLY", - "READ_ONLY_ERR", - "READ_WRITE", - "RED", - "RED_BITS", - "RED_INTEGER", - "REMOVAL", - "RENDERBUFFER", - "RENDERBUFFER_ALPHA_SIZE", - "RENDERBUFFER_BINDING", - "RENDERBUFFER_BLUE_SIZE", - "RENDERBUFFER_DEPTH_SIZE", - "RENDERBUFFER_GREEN_SIZE", - "RENDERBUFFER_HEIGHT", - "RENDERBUFFER_INTERNAL_FORMAT", - "RENDERBUFFER_RED_SIZE", - "RENDERBUFFER_SAMPLES", - "RENDERBUFFER_STENCIL_SIZE", - "RENDERBUFFER_WIDTH", - "RENDERER", - "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", - "RENDERING_INTENT_AUTO", - "RENDERING_INTENT_PERCEPTUAL", - "RENDERING_INTENT_RELATIVE_COLORIMETRIC", - "RENDERING_INTENT_SATURATION", - "RENDERING_INTENT_UNKNOWN", - "RENDER_ATTACHMENT", - "REPEAT", - "REPLACE", - "RG", - "RG16F", - "RG16I", - "RG16UI", - "RG32F", - "RG32I", - "RG32UI", - "RG8", - "RG8I", - "RG8UI", - "RG8_SNORM", - "RGB", - "RGB10_A2", - "RGB10_A2UI", - "RGB16F", - "RGB16I", - "RGB16UI", - "RGB32F", - "RGB32I", - "RGB32UI", - "RGB565", - "RGB5_A1", - "RGB8", - "RGB8I", - "RGB8UI", - "RGB8_SNORM", - "RGB9_E5", - "RGBA", - "RGBA16F", - "RGBA16I", - "RGBA16UI", - "RGBA32F", - "RGBA32I", - "RGBA32UI", - "RGBA4", - "RGBA8", - "RGBA8I", - "RGBA8UI", - "RGBA8_SNORM", - "RGBA_INTEGER", - "RGBColor", - "RGB_INTEGER", - "RG_INTEGER", - "ROTATION_CLOCKWISE", - "ROTATION_COUNTERCLOCKWISE", - "RTCCertificate", - "RTCDTMFSender", - "RTCDTMFToneChangeEvent", - "RTCDataChannel", - "RTCDataChannelEvent", - "RTCDtlsTransport", - "RTCError", - "RTCErrorEvent", - "RTCIceCandidate", - "RTCIceTransport", - "RTCPeerConnection", - "RTCPeerConnectionIceErrorEvent", - "RTCPeerConnectionIceEvent", - "RTCRtpReceiver", - "RTCRtpSender", - "RTCRtpTransceiver", - "RTCSctpTransport", - "RTCSessionDescription", - "RTCStatsReport", - "RTCTrackEvent", - "RadioNodeList", - "Range", - "RangeError", - "RangeException", - "ReadableStream", - "ReadableStreamDefaultReader", - "RecordErrorEvent", - "Rect", - "ReferenceError", - "Reflect", - "RegExp", - "RelativeOrientationSensor", - "RelativeTimeFormat", - "RemotePlayback", - "Report", - "ReportBody", - "ReportingObserver", - "Request", - "ResizeObserver", - "ResizeObserverEntry", - "ResizeObserverSize", - "Response", - "RuntimeError", - "SAMPLER_2D", - "SAMPLER_2D_ARRAY", - "SAMPLER_2D_ARRAY_SHADOW", - "SAMPLER_2D_SHADOW", - "SAMPLER_3D", - "SAMPLER_BINDING", - "SAMPLER_CUBE", - "SAMPLER_CUBE_SHADOW", - "SAMPLES", - "SAMPLE_ALPHA_TO_COVERAGE", - "SAMPLE_BUFFERS", - "SAMPLE_COVERAGE", - "SAMPLE_COVERAGE_INVERT", - "SAMPLE_COVERAGE_VALUE", - "SAWTOOTH", - "SCHEDULED_STATE", - "SCISSOR_BOX", - "SCISSOR_TEST", - "SCROLL_PAGE_DOWN", - "SCROLL_PAGE_UP", - "SDP_ANSWER", - "SDP_OFFER", - "SDP_PRANSWER", - "SECURITY_ERR", - "SELECT", - "SEPARATE_ATTRIBS", - "SERIALIZE_ERR", - "SEVERITY_ERROR", - "SEVERITY_FATAL_ERROR", - "SEVERITY_WARNING", - "SHADER_COMPILER", - "SHADER_TYPE", - "SHADING_LANGUAGE_VERSION", - "SHIFT_MASK", - "SHORT", - "SHOWING", - "SHOW_ALL", - "SHOW_ATTRIBUTE", - "SHOW_CDATA_SECTION", - "SHOW_COMMENT", - "SHOW_DOCUMENT", - "SHOW_DOCUMENT_FRAGMENT", - "SHOW_DOCUMENT_TYPE", - "SHOW_ELEMENT", - "SHOW_ENTITY", - "SHOW_ENTITY_REFERENCE", - "SHOW_NOTATION", - "SHOW_PROCESSING_INSTRUCTION", - "SHOW_TEXT", - "SIGNALED", - "SIGNED_NORMALIZED", - "SINE", - "SOUNDFIELD", - "SQLException", - "SQRT1_2", - "SQRT2", - "SQUARE", - "SRC_ALPHA", - "SRC_ALPHA_SATURATE", - "SRC_COLOR", - "SRGB", - "SRGB8", - "SRGB8_ALPHA8", - "START_TO_END", - "START_TO_START", - "STATIC_COPY", - "STATIC_DRAW", - "STATIC_READ", - "STENCIL", - "STENCIL_ATTACHMENT", - "STENCIL_BACK_FAIL", - "STENCIL_BACK_FUNC", - "STENCIL_BACK_PASS_DEPTH_FAIL", - "STENCIL_BACK_PASS_DEPTH_PASS", - "STENCIL_BACK_REF", - "STENCIL_BACK_VALUE_MASK", - "STENCIL_BACK_WRITEMASK", - "STENCIL_BITS", - "STENCIL_BUFFER_BIT", - "STENCIL_CLEAR_VALUE", - "STENCIL_FAIL", - "STENCIL_FUNC", - "STENCIL_INDEX", - "STENCIL_INDEX8", - "STENCIL_PASS_DEPTH_FAIL", - "STENCIL_PASS_DEPTH_PASS", - "STENCIL_REF", - "STENCIL_TEST", - "STENCIL_VALUE_MASK", - "STENCIL_WRITEMASK", - "STORAGE", - "STORAGE_BINDING", - "STREAM_COPY", - "STREAM_DRAW", - "STREAM_READ", - "STRING_TYPE", - "STYLE_RULE", - "SUBPIXEL_BITS", - "SUPPORTS_RULE", - "SVGAElement", - "SVGAltGlyphDefElement", - "SVGAltGlyphElement", - "SVGAltGlyphItemElement", - "SVGAngle", - "SVGAnimateColorElement", - "SVGAnimateElement", - "SVGAnimateMotionElement", - "SVGAnimateTransformElement", - "SVGAnimatedAngle", - "SVGAnimatedBoolean", - "SVGAnimatedEnumeration", - "SVGAnimatedInteger", - "SVGAnimatedLength", - "SVGAnimatedLengthList", - "SVGAnimatedNumber", - "SVGAnimatedNumberList", - "SVGAnimatedPreserveAspectRatio", - "SVGAnimatedRect", - "SVGAnimatedString", - "SVGAnimatedTransformList", - "SVGAnimationElement", - "SVGCircleElement", - "SVGClipPathElement", - "SVGColor", - "SVGComponentTransferFunctionElement", - "SVGCursorElement", - "SVGDefsElement", - "SVGDescElement", - "SVGDiscardElement", - "SVGDocument", - "SVGElement", - "SVGElementInstance", - "SVGElementInstanceList", - "SVGEllipseElement", - "SVGException", - "SVGFEBlendElement", - "SVGFEColorMatrixElement", - "SVGFEComponentTransferElement", - "SVGFECompositeElement", - "SVGFEConvolveMatrixElement", - "SVGFEDiffuseLightingElement", - "SVGFEDisplacementMapElement", - "SVGFEDistantLightElement", - "SVGFEDropShadowElement", - "SVGFEFloodElement", - "SVGFEFuncAElement", - "SVGFEFuncBElement", - "SVGFEFuncGElement", - "SVGFEFuncRElement", - "SVGFEGaussianBlurElement", - "SVGFEImageElement", - "SVGFEMergeElement", - "SVGFEMergeNodeElement", - "SVGFEMorphologyElement", - "SVGFEOffsetElement", - "SVGFEPointLightElement", - "SVGFESpecularLightingElement", - "SVGFESpotLightElement", - "SVGFETileElement", - "SVGFETurbulenceElement", - "SVGFilterElement", - "SVGFontElement", - "SVGFontFaceElement", - "SVGFontFaceFormatElement", - "SVGFontFaceNameElement", - "SVGFontFaceSrcElement", - "SVGFontFaceUriElement", - "SVGForeignObjectElement", - "SVGGElement", - "SVGGeometryElement", - "SVGGlyphElement", - "SVGGlyphRefElement", - "SVGGradientElement", - "SVGGraphicsElement", - "SVGHKernElement", - "SVGImageElement", - "SVGLength", - "SVGLengthList", - "SVGLineElement", - "SVGLinearGradientElement", - "SVGMPathElement", - "SVGMarkerElement", - "SVGMaskElement", - "SVGMatrix", - "SVGMetadataElement", - "SVGMissingGlyphElement", - "SVGNumber", - "SVGNumberList", - "SVGPaint", - "SVGPathElement", - "SVGPathSeg", - "SVGPathSegArcAbs", - "SVGPathSegArcRel", - "SVGPathSegClosePath", - "SVGPathSegCurvetoCubicAbs", - "SVGPathSegCurvetoCubicRel", - "SVGPathSegCurvetoCubicSmoothAbs", - "SVGPathSegCurvetoCubicSmoothRel", - "SVGPathSegCurvetoQuadraticAbs", - "SVGPathSegCurvetoQuadraticRel", - "SVGPathSegCurvetoQuadraticSmoothAbs", - "SVGPathSegCurvetoQuadraticSmoothRel", - "SVGPathSegLinetoAbs", - "SVGPathSegLinetoHorizontalAbs", - "SVGPathSegLinetoHorizontalRel", - "SVGPathSegLinetoRel", - "SVGPathSegLinetoVerticalAbs", - "SVGPathSegLinetoVerticalRel", - "SVGPathSegList", - "SVGPathSegMovetoAbs", - "SVGPathSegMovetoRel", - "SVGPatternElement", - "SVGPoint", - "SVGPointList", - "SVGPolygonElement", - "SVGPolylineElement", - "SVGPreserveAspectRatio", - "SVGRadialGradientElement", - "SVGRect", - "SVGRectElement", - "SVGRenderingIntent", - "SVGSVGElement", - "SVGScriptElement", - "SVGSetElement", - "SVGStopElement", - "SVGStringList", - "SVGStyleElement", - "SVGSwitchElement", - "SVGSymbolElement", - "SVGTRefElement", - "SVGTSpanElement", - "SVGTextContentElement", - "SVGTextElement", - "SVGTextPathElement", - "SVGTextPositioningElement", - "SVGTitleElement", - "SVGTransform", - "SVGTransformList", - "SVGUnitTypes", - "SVGUseElement", - "SVGVKernElement", - "SVGViewElement", - "SVGViewSpec", - "SVGZoomAndPan", - "SVGZoomEvent", - "SVG_ANGLETYPE_DEG", - "SVG_ANGLETYPE_GRAD", - "SVG_ANGLETYPE_RAD", - "SVG_ANGLETYPE_UNKNOWN", - "SVG_ANGLETYPE_UNSPECIFIED", - "SVG_CHANNEL_A", - "SVG_CHANNEL_B", - "SVG_CHANNEL_G", - "SVG_CHANNEL_R", - "SVG_CHANNEL_UNKNOWN", - "SVG_COLORTYPE_CURRENTCOLOR", - "SVG_COLORTYPE_RGBCOLOR", - "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", - "SVG_COLORTYPE_UNKNOWN", - "SVG_EDGEMODE_DUPLICATE", - "SVG_EDGEMODE_NONE", - "SVG_EDGEMODE_UNKNOWN", - "SVG_EDGEMODE_WRAP", - "SVG_FEBLEND_MODE_COLOR", - "SVG_FEBLEND_MODE_COLOR_BURN", - "SVG_FEBLEND_MODE_COLOR_DODGE", - "SVG_FEBLEND_MODE_DARKEN", - "SVG_FEBLEND_MODE_DIFFERENCE", - "SVG_FEBLEND_MODE_EXCLUSION", - "SVG_FEBLEND_MODE_HARD_LIGHT", - "SVG_FEBLEND_MODE_HUE", - "SVG_FEBLEND_MODE_LIGHTEN", - "SVG_FEBLEND_MODE_LUMINOSITY", - "SVG_FEBLEND_MODE_MULTIPLY", - "SVG_FEBLEND_MODE_NORMAL", - "SVG_FEBLEND_MODE_OVERLAY", - "SVG_FEBLEND_MODE_SATURATION", - "SVG_FEBLEND_MODE_SCREEN", - "SVG_FEBLEND_MODE_SOFT_LIGHT", - "SVG_FEBLEND_MODE_UNKNOWN", - "SVG_FECOLORMATRIX_TYPE_HUEROTATE", - "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", - "SVG_FECOLORMATRIX_TYPE_MATRIX", - "SVG_FECOLORMATRIX_TYPE_SATURATE", - "SVG_FECOLORMATRIX_TYPE_UNKNOWN", - "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", - "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", - "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", - "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", - "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", - "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", - "SVG_FECOMPOSITE_OPERATOR_ATOP", - "SVG_FECOMPOSITE_OPERATOR_IN", - "SVG_FECOMPOSITE_OPERATOR_OUT", - "SVG_FECOMPOSITE_OPERATOR_OVER", - "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", - "SVG_FECOMPOSITE_OPERATOR_XOR", - "SVG_INVALID_VALUE_ERR", - "SVG_LENGTHTYPE_CM", - "SVG_LENGTHTYPE_EMS", - "SVG_LENGTHTYPE_EXS", - "SVG_LENGTHTYPE_IN", - "SVG_LENGTHTYPE_MM", - "SVG_LENGTHTYPE_NUMBER", - "SVG_LENGTHTYPE_PC", - "SVG_LENGTHTYPE_PERCENTAGE", - "SVG_LENGTHTYPE_PT", - "SVG_LENGTHTYPE_PX", - "SVG_LENGTHTYPE_UNKNOWN", - "SVG_MARKERUNITS_STROKEWIDTH", - "SVG_MARKERUNITS_UNKNOWN", - "SVG_MARKERUNITS_USERSPACEONUSE", - "SVG_MARKER_ORIENT_ANGLE", - "SVG_MARKER_ORIENT_AUTO", - "SVG_MARKER_ORIENT_UNKNOWN", - "SVG_MASKTYPE_ALPHA", - "SVG_MASKTYPE_LUMINANCE", - "SVG_MATRIX_NOT_INVERTABLE", - "SVG_MEETORSLICE_MEET", - "SVG_MEETORSLICE_SLICE", - "SVG_MEETORSLICE_UNKNOWN", - "SVG_MORPHOLOGY_OPERATOR_DILATE", - "SVG_MORPHOLOGY_OPERATOR_ERODE", - "SVG_MORPHOLOGY_OPERATOR_UNKNOWN", - "SVG_PAINTTYPE_CURRENTCOLOR", - "SVG_PAINTTYPE_NONE", - "SVG_PAINTTYPE_RGBCOLOR", - "SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", - "SVG_PAINTTYPE_UNKNOWN", - "SVG_PAINTTYPE_URI", - "SVG_PAINTTYPE_URI_CURRENTCOLOR", - "SVG_PAINTTYPE_URI_NONE", - "SVG_PAINTTYPE_URI_RGBCOLOR", - "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", - "SVG_PRESERVEASPECTRATIO_NONE", - "SVG_PRESERVEASPECTRATIO_UNKNOWN", - "SVG_PRESERVEASPECTRATIO_XMAXYMAX", - "SVG_PRESERVEASPECTRATIO_XMAXYMID", - "SVG_PRESERVEASPECTRATIO_XMAXYMIN", - "SVG_PRESERVEASPECTRATIO_XMIDYMAX", - "SVG_PRESERVEASPECTRATIO_XMIDYMID", - "SVG_PRESERVEASPECTRATIO_XMIDYMIN", - "SVG_PRESERVEASPECTRATIO_XMINYMAX", - "SVG_PRESERVEASPECTRATIO_XMINYMID", - "SVG_PRESERVEASPECTRATIO_XMINYMIN", - "SVG_SPREADMETHOD_PAD", - "SVG_SPREADMETHOD_REFLECT", - "SVG_SPREADMETHOD_REPEAT", - "SVG_SPREADMETHOD_UNKNOWN", - "SVG_STITCHTYPE_NOSTITCH", - "SVG_STITCHTYPE_STITCH", - "SVG_STITCHTYPE_UNKNOWN", - "SVG_TRANSFORM_MATRIX", - "SVG_TRANSFORM_ROTATE", - "SVG_TRANSFORM_SCALE", - "SVG_TRANSFORM_SKEWX", - "SVG_TRANSFORM_SKEWY", - "SVG_TRANSFORM_TRANSLATE", - "SVG_TRANSFORM_UNKNOWN", - "SVG_TURBULENCE_TYPE_FRACTALNOISE", - "SVG_TURBULENCE_TYPE_TURBULENCE", - "SVG_TURBULENCE_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", - "SVG_UNIT_TYPE_UNKNOWN", - "SVG_UNIT_TYPE_USERSPACEONUSE", - "SVG_WRONG_TYPE_ERR", - "SVG_ZOOMANDPAN_DISABLE", - "SVG_ZOOMANDPAN_MAGNIFY", - "SVG_ZOOMANDPAN_UNKNOWN", - "SYNC_CONDITION", - "SYNC_FENCE", - "SYNC_FLAGS", - "SYNC_FLUSH_COMMANDS_BIT", - "SYNC_GPU_COMMANDS_COMPLETE", - "SYNC_STATUS", - "SYNTAX_ERR", - "SavedPages", - "Screen", - "ScreenOrientation", - "Script", - "ScriptProcessorNode", - "ScrollAreaEvent", - "SecurityPolicyViolationEvent", - "Selection", - "Sensor", - "SensorErrorEvent", - "ServiceWorker", - "ServiceWorkerContainer", - "ServiceWorkerRegistration", - "SessionDescription", - "Set", - "ShadowRoot", - "SharedArrayBuffer", - "SharedWorker", - "SimpleGestureEvent", - "SourceBuffer", - "SourceBufferList", - "SpeechSynthesis", - "SpeechSynthesisErrorEvent", - "SpeechSynthesisEvent", - "SpeechSynthesisUtterance", - "SpeechSynthesisVoice", - "StaticRange", - "StereoPannerNode", - "StopIteration", - "Storage", - "StorageEvent", - "StorageManager", - "String", - "StructType", - "StylePropertyMap", - "StylePropertyMapReadOnly", - "StyleSheet", - "StyleSheetList", - "SubmitEvent", - "SubtleCrypto", - "Symbol", - "SyncManager", - "SyntaxError", - "TEMPORARY", - "TEXTPATH_METHODTYPE_ALIGN", - "TEXTPATH_METHODTYPE_STRETCH", - "TEXTPATH_METHODTYPE_UNKNOWN", - "TEXTPATH_SPACINGTYPE_AUTO", - "TEXTPATH_SPACINGTYPE_EXACT", - "TEXTPATH_SPACINGTYPE_UNKNOWN", - "TEXTURE", - "TEXTURE0", - "TEXTURE1", - "TEXTURE10", - "TEXTURE11", - "TEXTURE12", - "TEXTURE13", - "TEXTURE14", - "TEXTURE15", - "TEXTURE16", - "TEXTURE17", - "TEXTURE18", - "TEXTURE19", - "TEXTURE2", - "TEXTURE20", - "TEXTURE21", - "TEXTURE22", - "TEXTURE23", - "TEXTURE24", - "TEXTURE25", - "TEXTURE26", - "TEXTURE27", - "TEXTURE28", - "TEXTURE29", - "TEXTURE3", - "TEXTURE30", - "TEXTURE31", - "TEXTURE4", - "TEXTURE5", - "TEXTURE6", - "TEXTURE7", - "TEXTURE8", - "TEXTURE9", - "TEXTURE_2D", - "TEXTURE_2D_ARRAY", - "TEXTURE_3D", - "TEXTURE_BASE_LEVEL", - "TEXTURE_BINDING", - "TEXTURE_BINDING_2D", - "TEXTURE_BINDING_2D_ARRAY", - "TEXTURE_BINDING_3D", - "TEXTURE_BINDING_CUBE_MAP", - "TEXTURE_COMPARE_FUNC", - "TEXTURE_COMPARE_MODE", - "TEXTURE_CUBE_MAP", - "TEXTURE_CUBE_MAP_NEGATIVE_X", - "TEXTURE_CUBE_MAP_NEGATIVE_Y", - "TEXTURE_CUBE_MAP_NEGATIVE_Z", - "TEXTURE_CUBE_MAP_POSITIVE_X", - "TEXTURE_CUBE_MAP_POSITIVE_Y", - "TEXTURE_CUBE_MAP_POSITIVE_Z", - "TEXTURE_IMMUTABLE_FORMAT", - "TEXTURE_IMMUTABLE_LEVELS", - "TEXTURE_MAG_FILTER", - "TEXTURE_MAX_ANISOTROPY_EXT", - "TEXTURE_MAX_LEVEL", - "TEXTURE_MAX_LOD", - "TEXTURE_MIN_FILTER", - "TEXTURE_MIN_LOD", - "TEXTURE_WRAP_R", - "TEXTURE_WRAP_S", - "TEXTURE_WRAP_T", - "TEXT_NODE", - "TIMEOUT", - "TIMEOUT_ERR", - "TIMEOUT_EXPIRED", - "TIMEOUT_IGNORED", - "TOO_LARGE_ERR", - "TRANSACTION_INACTIVE_ERR", - "TRANSFORM_FEEDBACK", - "TRANSFORM_FEEDBACK_ACTIVE", - "TRANSFORM_FEEDBACK_BINDING", - "TRANSFORM_FEEDBACK_BUFFER", - "TRANSFORM_FEEDBACK_BUFFER_BINDING", - "TRANSFORM_FEEDBACK_BUFFER_MODE", - "TRANSFORM_FEEDBACK_BUFFER_SIZE", - "TRANSFORM_FEEDBACK_BUFFER_START", - "TRANSFORM_FEEDBACK_PAUSED", - "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", - "TRANSFORM_FEEDBACK_VARYINGS", - "TRIANGLE", - "TRIANGLES", - "TRIANGLE_FAN", - "TRIANGLE_STRIP", - "TYPE_BACK_FORWARD", - "TYPE_ERR", - "TYPE_MISMATCH_ERR", - "TYPE_NAVIGATE", - "TYPE_RELOAD", - "TYPE_RESERVED", - "Table", - "TaskAttributionTiming", - "Text", - "TextDecoder", - "TextDecoderStream", - "TextEncoder", - "TextEncoderStream", - "TextEvent", - "TextMetrics", - "TextTrack", - "TextTrackCue", - "TextTrackCueList", - "TextTrackList", - "TimeEvent", - "TimeRanges", - "Touch", - "TouchEvent", - "TouchList", - "TrackEvent", - "TransformStream", - "TransitionEvent", - "TreeWalker", - "TrustedHTML", - "TrustedScript", - "TrustedScriptURL", - "TrustedTypePolicy", - "TrustedTypePolicyFactory", - "TypeError", - "TypedObject", - "U2F", - "UIEvent", - "UNCACHED", - "UNIFORM", - "UNIFORM_ARRAY_STRIDE", - "UNIFORM_BLOCK_ACTIVE_UNIFORMS", - "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", - "UNIFORM_BLOCK_BINDING", - "UNIFORM_BLOCK_DATA_SIZE", - "UNIFORM_BLOCK_INDEX", - "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", - "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", - "UNIFORM_BUFFER", - "UNIFORM_BUFFER_BINDING", - "UNIFORM_BUFFER_OFFSET_ALIGNMENT", - "UNIFORM_BUFFER_SIZE", - "UNIFORM_BUFFER_START", - "UNIFORM_IS_ROW_MAJOR", - "UNIFORM_MATRIX_STRIDE", - "UNIFORM_OFFSET", - "UNIFORM_SIZE", - "UNIFORM_TYPE", - "UNKNOWN_ERR", - "UNKNOWN_RULE", - "UNMASKED_RENDERER_WEBGL", - "UNMASKED_VENDOR_WEBGL", - "UNORDERED_NODE_ITERATOR_TYPE", - "UNORDERED_NODE_SNAPSHOT_TYPE", - "UNPACK_ALIGNMENT", - "UNPACK_COLORSPACE_CONVERSION_WEBGL", - "UNPACK_FLIP_Y_WEBGL", - "UNPACK_IMAGE_HEIGHT", - "UNPACK_PREMULTIPLY_ALPHA_WEBGL", - "UNPACK_ROW_LENGTH", - "UNPACK_SKIP_IMAGES", - "UNPACK_SKIP_PIXELS", - "UNPACK_SKIP_ROWS", - "UNSCHEDULED_STATE", - "UNSENT", - "UNSIGNALED", - "UNSIGNED_BYTE", - "UNSIGNED_INT", - "UNSIGNED_INT_10F_11F_11F_REV", - "UNSIGNED_INT_24_8", - "UNSIGNED_INT_2_10_10_10_REV", - "UNSIGNED_INT_5_9_9_9_REV", - "UNSIGNED_INT_SAMPLER_2D", - "UNSIGNED_INT_SAMPLER_2D_ARRAY", - "UNSIGNED_INT_SAMPLER_3D", - "UNSIGNED_INT_SAMPLER_CUBE", - "UNSIGNED_INT_VEC2", - "UNSIGNED_INT_VEC3", - "UNSIGNED_INT_VEC4", - "UNSIGNED_NORMALIZED", - "UNSIGNED_SHORT", - "UNSIGNED_SHORT_4_4_4_4", - "UNSIGNED_SHORT_5_5_5_1", - "UNSIGNED_SHORT_5_6_5", - "UNSPECIFIED_EVENT_TYPE_ERR", - "UPDATEREADY", - "URIError", - "URL", - "URLSearchParams", - "URLUnencoded", - "URL_MISMATCH_ERR", - "USB", - "USBAlternateInterface", - "USBConfiguration", - "USBConnectionEvent", - "USBDevice", - "USBEndpoint", - "USBInTransferResult", - "USBInterface", - "USBIsochronousInTransferPacket", - "USBIsochronousInTransferResult", - "USBIsochronousOutTransferPacket", - "USBIsochronousOutTransferResult", - "USBOutTransferResult", - "UTC", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "UserActivation", - "UserMessageHandler", - "UserMessageHandlersNamespace", - "UserProximityEvent", - "VALIDATE_STATUS", - "VALIDATION_ERR", - "VARIABLES_RULE", - "VENDOR", - "VERSION", - "VERSION_CHANGE", - "VERSION_ERR", - "VERTEX", - "VERTEX_ARRAY_BINDING", - "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", - "VERTEX_ATTRIB_ARRAY_DIVISOR", - "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", - "VERTEX_ATTRIB_ARRAY_ENABLED", - "VERTEX_ATTRIB_ARRAY_INTEGER", - "VERTEX_ATTRIB_ARRAY_NORMALIZED", - "VERTEX_ATTRIB_ARRAY_POINTER", - "VERTEX_ATTRIB_ARRAY_SIZE", - "VERTEX_ATTRIB_ARRAY_STRIDE", - "VERTEX_ATTRIB_ARRAY_TYPE", - "VERTEX_SHADER", - "VERTICAL", - "VERTICAL_AXIS", - "VER_ERR", - "VIEWPORT", - "VIEWPORT_RULE", - "VRDisplay", - "VRDisplayCapabilities", - "VRDisplayEvent", - "VREyeParameters", - "VRFieldOfView", - "VRFrameData", - "VRPose", - "VRStageParameters", - "VTTCue", - "VTTRegion", - "ValidityState", - "VideoPlaybackQuality", - "VideoStreamTrack", - "VisualViewport", - "WAIT_FAILED", - "WEBKIT_FILTER_RULE", - "WEBKIT_KEYFRAMES_RULE", - "WEBKIT_KEYFRAME_RULE", - "WEBKIT_REGION_RULE", - "WRITE", - "WRONG_DOCUMENT_ERR", - "WakeLock", - "WakeLockSentinel", - "WasmAnyRef", - "WaveShaperNode", - "WeakMap", - "WeakRef", - "WeakSet", - "WebAssembly", - "WebGL2RenderingContext", - "WebGLActiveInfo", - "WebGLBuffer", - "WebGLContextEvent", - "WebGLFramebuffer", - "WebGLProgram", - "WebGLQuery", - "WebGLRenderbuffer", - "WebGLRenderingContext", - "WebGLSampler", - "WebGLShader", - "WebGLShaderPrecisionFormat", - "WebGLSync", - "WebGLTexture", - "WebGLTransformFeedback", - "WebGLUniformLocation", - "WebGLVertexArray", - "WebGLVertexArrayObject", - "WebKitAnimationEvent", - "WebKitBlobBuilder", - "WebKitCSSFilterRule", - "WebKitCSSFilterValue", - "WebKitCSSKeyframeRule", - "WebKitCSSKeyframesRule", - "WebKitCSSMatrix", - "WebKitCSSRegionRule", - "WebKitCSSTransformValue", - "WebKitDataCue", - "WebKitGamepad", - "WebKitMediaKeyError", - "WebKitMediaKeyMessageEvent", - "WebKitMediaKeySession", - "WebKitMediaKeys", - "WebKitMediaSource", - "WebKitMutationObserver", - "WebKitNamespace", - "WebKitPlaybackTargetAvailabilityEvent", - "WebKitPoint", - "WebKitShadowRoot", - "WebKitSourceBuffer", - "WebKitSourceBufferList", - "WebKitTransitionEvent", - "WebSocket", - "WebkitAlignContent", - "WebkitAlignItems", - "WebkitAlignSelf", - "WebkitAnimation", - "WebkitAnimationDelay", - "WebkitAnimationDirection", - "WebkitAnimationDuration", - "WebkitAnimationFillMode", - "WebkitAnimationIterationCount", - "WebkitAnimationName", - "WebkitAnimationPlayState", - "WebkitAnimationTimingFunction", - "WebkitAppearance", - "WebkitBackfaceVisibility", - "WebkitBackgroundClip", - "WebkitBackgroundOrigin", - "WebkitBackgroundSize", - "WebkitBorderBottomLeftRadius", - "WebkitBorderBottomRightRadius", - "WebkitBorderImage", - "WebkitBorderRadius", - "WebkitBorderTopLeftRadius", - "WebkitBorderTopRightRadius", - "WebkitBoxAlign", - "WebkitBoxDirection", - "WebkitBoxFlex", - "WebkitBoxOrdinalGroup", - "WebkitBoxOrient", - "WebkitBoxPack", - "WebkitBoxShadow", - "WebkitBoxSizing", - "WebkitFilter", - "WebkitFlex", - "WebkitFlexBasis", - "WebkitFlexDirection", - "WebkitFlexFlow", - "WebkitFlexGrow", - "WebkitFlexShrink", - "WebkitFlexWrap", - "WebkitJustifyContent", - "WebkitLineClamp", - "WebkitMask", - "WebkitMaskClip", - "WebkitMaskComposite", - "WebkitMaskImage", - "WebkitMaskOrigin", - "WebkitMaskPosition", - "WebkitMaskPositionX", - "WebkitMaskPositionY", - "WebkitMaskRepeat", - "WebkitMaskSize", - "WebkitOrder", - "WebkitPerspective", - "WebkitPerspectiveOrigin", - "WebkitTextFillColor", - "WebkitTextSizeAdjust", - "WebkitTextStroke", - "WebkitTextStrokeColor", - "WebkitTextStrokeWidth", - "WebkitTransform", - "WebkitTransformOrigin", - "WebkitTransformStyle", - "WebkitTransition", - "WebkitTransitionDelay", - "WebkitTransitionDuration", - "WebkitTransitionProperty", - "WebkitTransitionTimingFunction", - "WebkitUserSelect", - "WheelEvent", - "Window", - "Worker", - "Worklet", - "WritableStream", - "WritableStreamDefaultWriter", - "XMLDocument", - "XMLHttpRequest", - "XMLHttpRequestEventTarget", - "XMLHttpRequestException", - "XMLHttpRequestProgressEvent", - "XMLHttpRequestUpload", - "XMLSerializer", - "XMLStylesheetProcessingInstruction", - "XPathEvaluator", - "XPathException", - "XPathExpression", - "XPathNSResolver", - "XPathResult", - "XRBoundedReferenceSpace", - "XRDOMOverlayState", - "XRFrame", - "XRHitTestResult", - "XRHitTestSource", - "XRInputSource", - "XRInputSourceArray", - "XRInputSourceEvent", - "XRInputSourcesChangeEvent", - "XRLayer", - "XRPose", - "XRRay", - "XRReferenceSpace", - "XRReferenceSpaceEvent", - "XRRenderState", - "XRRigidTransform", - "XRSession", - "XRSessionEvent", - "XRSpace", - "XRSystem", - "XRTransientInputHitTestResult", - "XRTransientInputHitTestSource", - "XRView", - "XRViewerPose", - "XRViewport", - "XRWebGLLayer", - "XSLTProcessor", - "ZERO", - "_XD0M_", - "_YD0M_", - "__brand", - "__defineGetter__", - "__defineSetter__", - "__lookupGetter__", - "__lookupSetter__", - "__opera", - "__proto__", - "_browserjsran", - "a", - "aLink", - "abbr", - "abort", - "aborted", - "abs", - "absolute", - "acceleration", - "accelerationIncludingGravity", - "accelerator", - "accept", - "acceptCharset", - "acceptNode", - "access", - "accessKey", - "accessKeyLabel", - "accuracy", - "acos", - "acosh", - "action", - "actionURL", - "actions", - "activated", - "active", - "activeCues", - "activeElement", - "activeSourceBuffers", - "activeSourceCount", - "activeTexture", - "activeVRDisplays", - "actualBoundingBoxAscent", - "actualBoundingBoxDescent", - "actualBoundingBoxLeft", - "actualBoundingBoxRight", - "add", - "addAll", - "addBehavior", - "addCandidate", - "addColorStop", - "addCue", - "addElement", - "addEventListener", - "addFilter", - "addFromString", - "addFromUri", - "addIceCandidate", - "addImport", - "addListener", - "addModule", - "addNamed", - "addPageRule", - "addPath", - "addPointer", - "addRange", - "addRegion", - "addRule", - "addSearchEngine", - "addSourceBuffer", - "addStream", - "addTextTrack", - "addTrack", - "addTransceiver", - "addWakeLockListener", - "added", - "addedNodes", - "additionalName", - "additiveSymbols", - "addons", - "address", - "addressLine", - "addressModeU", - "addressModeV", - "addressModeW", - "adoptNode", - "adoptedStyleSheets", - "adr", - "advance", - "after", - "album", - "alert", - "algorithm", - "align", - "align-content", - "align-items", - "align-self", - "alignContent", - "alignItems", - "alignSelf", - "alignmentBaseline", - "alinkColor", - "all", - "allSettled", - "allow", - "allowFullscreen", - "allowPaymentRequest", - "allowedDirections", - "allowedFeatures", - "allowedToPlay", - "allowsFeature", - "alpha", - "alphaMode", - "alphaToCoverageEnabled", - "alt", - "altGraphKey", - "altHtml", - "altKey", - "altLeft", - "alternate", - "alternateSetting", - "alternates", - "altitude", - "altitudeAccuracy", - "amplitude", - "ancestorOrigins", - "anchor", - "anchorNode", - "anchorOffset", - "anchors", - "and", - "angle", - "angularAcceleration", - "angularVelocity", - "animVal", - "animate", - "animatedInstanceRoot", - "animatedNormalizedPathSegList", - "animatedPathSegList", - "animatedPoints", - "animation", - "animation-delay", - "animation-direction", - "animation-duration", - "animation-fill-mode", - "animation-iteration-count", - "animation-name", - "animation-play-state", - "animation-timing-function", - "animationDelay", - "animationDirection", - "animationDuration", - "animationFillMode", - "animationIterationCount", - "animationName", - "animationPlayState", - "animationStartTime", - "animationTimingFunction", - "animationsPaused", - "anniversary", - "antialias", - "anticipatedRemoval", - "any", - "app", - "appCodeName", - "appMinorVersion", - "appName", - "appNotifications", - "appVersion", - "appearance", - "append", - "appendBuffer", - "appendChild", - "appendData", - "appendItem", - "appendMedium", - "appendNamed", - "appendRule", - "appendStream", - "appendWindowEnd", - "appendWindowStart", - "applets", - "applicationCache", - "applicationServerKey", - "apply", - "applyConstraints", - "applyElement", - "arc", - "arcTo", - "architecture", - "archive", - "areas", - "arguments", - "ariaAtomic", - "ariaAutoComplete", - "ariaBusy", - "ariaChecked", - "ariaColCount", - "ariaColIndex", - "ariaColSpan", - "ariaCurrent", - "ariaDescription", - "ariaDisabled", - "ariaExpanded", - "ariaHasPopup", - "ariaHidden", - "ariaKeyShortcuts", - "ariaLabel", - "ariaLevel", - "ariaLive", - "ariaModal", - "ariaMultiLine", - "ariaMultiSelectable", - "ariaOrientation", - "ariaPlaceholder", - "ariaPosInSet", - "ariaPressed", - "ariaReadOnly", - "ariaRelevant", - "ariaRequired", - "ariaRoleDescription", - "ariaRowCount", - "ariaRowIndex", - "ariaRowSpan", - "ariaSelected", - "ariaSetSize", - "ariaSort", - "ariaValueMax", - "ariaValueMin", - "ariaValueNow", - "ariaValueText", - "arrayBuffer", - "arrayLayerCount", - "arrayStride", - "artist", - "artwork", - "as", - "asIntN", - "asUintN", - "asin", - "asinh", - "aspect", - "assert", - "assign", - "assignedElements", - "assignedNodes", - "assignedSlot", - "async", - "asyncIterator", - "atEnd", - "atan", - "atan2", - "atanh", - "atob", - "attachEvent", - "attachInternals", - "attachShader", - "attachShadow", - "attachments", - "attack", - "attestationObject", - "attrChange", - "attrName", - "attributeFilter", - "attributeName", - "attributeNamespace", - "attributeOldValue", - "attributeStyleMap", - "attributes", - "attribution", - "audioBitsPerSecond", - "audioTracks", - "audioWorklet", - "authenticatedSignedWrites", - "authenticatorData", - "autoIncrement", - "autobuffer", - "autocapitalize", - "autocomplete", - "autocorrect", - "autofocus", - "automationRate", - "autoplay", - "availHeight", - "availLeft", - "availTop", - "availWidth", - "availability", - "available", - "aversion", - "ax", - "axes", - "axis", - "ay", - "azimuth", - "b", - "back", - "backface-visibility", - "backfaceVisibility", - "background", - "background-attachment", - "background-blend-mode", - "background-clip", - "background-color", - "background-image", - "background-origin", - "background-position", - "background-position-x", - "background-position-y", - "background-repeat", - "background-size", - "backgroundAttachment", - "backgroundBlendMode", - "backgroundClip", - "backgroundColor", - "backgroundFetch", - "backgroundImage", - "backgroundOrigin", - "backgroundPosition", - "backgroundPositionX", - "backgroundPositionY", - "backgroundRepeat", - "backgroundSize", - "badInput", - "badge", - "balance", - "baseArrayLayer", - "baseFrequencyX", - "baseFrequencyY", - "baseLatency", - "baseLayer", - "baseMipLevel", - "baseNode", - "baseOffset", - "baseURI", - "baseVal", - "baselineShift", - "battery", - "bday", - "before", - "beginComputePass", - "beginElement", - "beginElementAt", - "beginOcclusionQuery", - "beginPath", - "beginQuery", - "beginRenderPass", - "beginTransformFeedback", - "beginningOfPassWriteIndex", - "behavior", - "behaviorCookie", - "behaviorPart", - "behaviorUrns", - "beta", - "bezierCurveTo", - "bgColor", - "bgProperties", - "bias", - "big", - "bigint64", - "biguint64", - "binaryType", - "bind", - "bindAttribLocation", - "bindBuffer", - "bindBufferBase", - "bindBufferRange", - "bindFramebuffer", - "bindGroupLayouts", - "bindRenderbuffer", - "bindSampler", - "bindTexture", - "bindTransformFeedback", - "bindVertexArray", - "binding", - "bitness", - "blend", - "blendColor", - "blendEquation", - "blendEquationSeparate", - "blendFunc", - "blendFuncSeparate", - "blink", - "blitFramebuffer", - "blob", - "block-size", - "blockDirection", - "blockSize", - "blockedURI", - "blue", - "bluetooth", - "blur", - "body", - "bodyUsed", - "bold", - "bookmarks", - "booleanValue", - "border", - "border-block", - "border-block-color", - "border-block-end", - "border-block-end-color", - "border-block-end-style", - "border-block-end-width", - "border-block-start", - "border-block-start-color", - "border-block-start-style", - "border-block-start-width", - "border-block-style", - "border-block-width", - "border-bottom", - "border-bottom-color", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-bottom-style", - "border-bottom-width", - "border-collapse", - "border-color", - "border-end-end-radius", - "border-end-start-radius", - "border-image", - "border-image-outset", - "border-image-repeat", - "border-image-slice", - "border-image-source", - "border-image-width", - "border-inline", - "border-inline-color", - "border-inline-end", - "border-inline-end-color", - "border-inline-end-style", - "border-inline-end-width", - "border-inline-start", - "border-inline-start-color", - "border-inline-start-style", - "border-inline-start-width", - "border-inline-style", - "border-inline-width", - "border-left", - "border-left-color", - "border-left-style", - "border-left-width", - "border-radius", - "border-right", - "border-right-color", - "border-right-style", - "border-right-width", - "border-spacing", - "border-start-end-radius", - "border-start-start-radius", - "border-style", - "border-top", - "border-top-color", - "border-top-left-radius", - "border-top-right-radius", - "border-top-style", - "border-top-width", - "border-width", - "borderBlock", - "borderBlockColor", - "borderBlockEnd", - "borderBlockEndColor", - "borderBlockEndStyle", - "borderBlockEndWidth", - "borderBlockStart", - "borderBlockStartColor", - "borderBlockStartStyle", - "borderBlockStartWidth", - "borderBlockStyle", - "borderBlockWidth", - "borderBottom", - "borderBottomColor", - "borderBottomLeftRadius", - "borderBottomRightRadius", - "borderBottomStyle", - "borderBottomWidth", - "borderBoxSize", - "borderCollapse", - "borderColor", - "borderColorDark", - "borderColorLight", - "borderEndEndRadius", - "borderEndStartRadius", - "borderImage", - "borderImageOutset", - "borderImageRepeat", - "borderImageSlice", - "borderImageSource", - "borderImageWidth", - "borderInline", - "borderInlineColor", - "borderInlineEnd", - "borderInlineEndColor", - "borderInlineEndStyle", - "borderInlineEndWidth", - "borderInlineStart", - "borderInlineStartColor", - "borderInlineStartStyle", - "borderInlineStartWidth", - "borderInlineStyle", - "borderInlineWidth", - "borderLeft", - "borderLeftColor", - "borderLeftStyle", - "borderLeftWidth", - "borderRadius", - "borderRight", - "borderRightColor", - "borderRightStyle", - "borderRightWidth", - "borderSpacing", - "borderStartEndRadius", - "borderStartStartRadius", - "borderStyle", - "borderTop", - "borderTopColor", - "borderTopLeftRadius", - "borderTopRightRadius", - "borderTopStyle", - "borderTopWidth", - "borderWidth", - "bottom", - "bottomMargin", - "bound", - "boundElements", - "boundingClientRect", - "boundingHeight", - "boundingLeft", - "boundingTop", - "boundingWidth", - "bounds", - "boundsGeometry", - "box-decoration-break", - "box-shadow", - "box-sizing", - "boxDecorationBreak", - "boxShadow", - "boxSizing", - "brand", - "brands", - "break-after", - "break-before", - "break-inside", - "breakAfter", - "breakBefore", - "breakInside", - "broadcast", - "browserLanguage", - "btoa", - "bubbles", - "buffer", - "bufferData", - "bufferDepth", - "bufferSize", - "bufferSubData", - "buffered", - "bufferedAmount", - "bufferedAmountLowThreshold", - "buffers", - "buildID", - "buildNumber", - "button", - "buttonID", - "buttons", - "byteLength", - "byteOffset", - "bytesPerRow", - "bytesWritten", - "c", - "cache", - "caches", - "call", - "caller", - "canBeFormatted", - "canBeMounted", - "canBeShared", - "canHaveChildren", - "canHaveHTML", - "canInsertDTMF", - "canMakePayment", - "canPlayType", - "canPresent", - "canTrickleIceCandidates", - "cancel", - "cancelAndHoldAtTime", - "cancelAnimationFrame", - "cancelBubble", - "cancelIdleCallback", - "cancelScheduledValues", - "cancelVideoFrameCallback", - "cancelWatchAvailability", - "cancelable", - "candidate", - "canonicalUUID", - "canvas", - "capabilities", - "caption", - "caption-side", - "captionSide", - "capture", - "captureEvents", - "captureStackTrace", - "captureStream", - "caret-color", - "caretBidiLevel", - "caretColor", - "caretPositionFromPoint", - "caretRangeFromPoint", - "cast", - "catch", - "category", - "cbrt", - "cd", - "ceil", - "cellIndex", - "cellPadding", - "cellSpacing", - "cells", - "ch", - "chOff", - "chain", - "challenge", - "changeType", - "changedTouches", - "channel", - "channelCount", - "channelCountMode", - "channelInterpretation", - "char", - "charAt", - "charCode", - "charCodeAt", - "charIndex", - "charLength", - "characterData", - "characterDataOldValue", - "characterSet", - "characteristic", - "charging", - "chargingTime", - "charset", - "check", - "checkEnclosure", - "checkFramebufferStatus", - "checkIntersection", - "checkValidity", - "checked", - "childElementCount", - "childList", - "childNodes", - "children", - "chrome", - "ciphertext", - "cite", - "city", - "claimInterface", - "claimed", - "classList", - "className", - "classid", - "clear", - "clearAppBadge", - "clearAttributes", - "clearBuffer", - "clearBufferfi", - "clearBufferfv", - "clearBufferiv", - "clearBufferuiv", - "clearColor", - "clearData", - "clearDepth", - "clearHalt", - "clearImmediate", - "clearInterval", - "clearLiveSeekableRange", - "clearMarks", - "clearMaxGCPauseAccumulator", - "clearMeasures", - "clearParameters", - "clearRect", - "clearResourceTimings", - "clearShadow", - "clearStencil", - "clearTimeout", - "clearValue", - "clearWatch", - "click", - "clickCount", - "clientDataJSON", - "clientHeight", - "clientInformation", - "clientLeft", - "clientRect", - "clientRects", - "clientTop", - "clientWaitSync", - "clientWidth", - "clientX", - "clientY", - "clip", - "clip-path", - "clip-rule", - "clipBottom", - "clipLeft", - "clipPath", - "clipPathUnits", - "clipRight", - "clipRule", - "clipTop", - "clipboard", - "clipboardData", - "clone", - "cloneContents", - "cloneNode", - "cloneRange", - "close", - "closePath", - "closed", - "closest", - "clz", - "clz32", - "cm", - "cmp", - "code", - "codeBase", - "codePointAt", - "codeType", - "colSpan", - "collapse", - "collapseToEnd", - "collapseToStart", - "collapsed", - "collect", - "colno", - "color", - "color-adjust", - "color-interpolation", - "color-interpolation-filters", - "colorAdjust", - "colorAttachments", - "colorDepth", - "colorFormats", - "colorInterpolation", - "colorInterpolationFilters", - "colorMask", - "colorSpace", - "colorType", - "cols", - "column-count", - "column-fill", - "column-gap", - "column-rule", - "column-rule-color", - "column-rule-style", - "column-rule-width", - "column-span", - "column-width", - "columnCount", - "columnFill", - "columnGap", - "columnNumber", - "columnRule", - "columnRuleColor", - "columnRuleStyle", - "columnRuleWidth", - "columnSpan", - "columnWidth", - "columns", - "command", - "commit", - "commitPreferences", - "commitStyles", - "commonAncestorContainer", - "compact", - "compare", - "compareBoundaryPoints", - "compareDocumentPosition", - "compareEndPoints", - "compareExchange", - "compareNode", - "comparePoint", - "compatMode", - "compatible", - "compile", - "compileShader", - "compileStreaming", - "complete", - "component", - "componentFromPoint", - "composed", - "composedPath", - "composite", - "compositionEndOffset", - "compositionStartOffset", - "compressedTexImage2D", - "compressedTexImage3D", - "compressedTexSubImage2D", - "compressedTexSubImage3D", - "compute", - "computedStyleMap", - "concat", - "conditionText", - "coneInnerAngle", - "coneOuterAngle", - "coneOuterGain", - "configurable", - "configuration", - "configurationName", - "configurationValue", - "configurations", - "configure", - "confirm", - "confirmComposition", - "confirmSiteSpecificTrackingException", - "confirmWebWideTrackingException", - "connect", - "connectEnd", - "connectShark", - "connectStart", - "connected", - "connection", - "connectionList", - "connectionSpeed", - "connectionState", - "connections", - "console", - "consolidate", - "constants", - "constraint", - "constrictionActive", - "construct", - "constructor", - "contactID", - "contain", - "containerId", - "containerName", - "containerSrc", - "containerType", - "contains", - "containsNode", - "content", - "contentBoxSize", - "contentDocument", - "contentEditable", - "contentHint", - "contentOverflow", - "contentRect", - "contentScriptType", - "contentStyleType", - "contentType", - "contentWindow", - "context", - "contextMenu", - "contextmenu", - "continue", - "continuePrimaryKey", - "continuous", - "control", - "controlTransferIn", - "controlTransferOut", - "controller", - "controls", - "controlsList", - "convertPointFromNode", - "convertQuadFromNode", - "convertRectFromNode", - "convertToBlob", - "convertToSpecifiedUnits", - "cookie", - "cookieEnabled", - "coords", - "copyBufferSubData", - "copyBufferToBuffer", - "copyBufferToTexture", - "copyExternalImageToTexture", - "copyFromChannel", - "copyTexImage2D", - "copyTexSubImage2D", - "copyTexSubImage3D", - "copyTextureToBuffer", - "copyTextureToTexture", - "copyToChannel", - "copyWithin", - "correspondingElement", - "correspondingUseElement", - "corruptedVideoFrames", - "cos", - "cosh", - "count", - "countReset", - "counter-increment", - "counter-reset", - "counter-set", - "counterIncrement", - "counterReset", - "counterSet", - "country", - "cpuClass", - "cpuSleepAllowed", - "create", - "createAnalyser", - "createAnswer", - "createAttribute", - "createAttributeNS", - "createBindGroup", - "createBindGroupLayout", - "createBiquadFilter", - "createBuffer", - "createBufferSource", - "createCDATASection", - "createCSSStyleSheet", - "createCaption", - "createChannelMerger", - "createChannelSplitter", - "createCommandEncoder", - "createComment", - "createComputePipeline", - "createComputePipelineAsync", - "createConstantSource", - "createContextualFragment", - "createControlRange", - "createConvolver", - "createDTMFSender", - "createDataChannel", - "createDelay", - "createDelayNode", - "createDocument", - "createDocumentFragment", - "createDocumentType", - "createDynamicsCompressor", - "createElement", - "createElementNS", - "createEntityReference", - "createEvent", - "createEventObject", - "createExpression", - "createFramebuffer", - "createFunction", - "createGain", - "createGainNode", - "createHTML", - "createHTMLDocument", - "createIIRFilter", - "createImageBitmap", - "createImageData", - "createIndex", - "createJavaScriptNode", - "createLinearGradient", - "createMediaElementSource", - "createMediaKeys", - "createMediaStreamDestination", - "createMediaStreamSource", - "createMediaStreamTrackSource", - "createMutableFile", - "createNSResolver", - "createNodeIterator", - "createNotification", - "createObjectStore", - "createObjectURL", - "createOffer", - "createOscillator", - "createPanner", - "createPattern", - "createPeriodicWave", - "createPipelineLayout", - "createPolicy", - "createPopup", - "createProcessingInstruction", - "createProgram", - "createQuery", - "createQuerySet", - "createRadialGradient", - "createRange", - "createRangeCollection", - "createReader", - "createRenderBundleEncoder", - "createRenderPipeline", - "createRenderPipelineAsync", - "createRenderbuffer", - "createSVGAngle", - "createSVGLength", - "createSVGMatrix", - "createSVGNumber", - "createSVGPathSegArcAbs", - "createSVGPathSegArcRel", - "createSVGPathSegClosePath", - "createSVGPathSegCurvetoCubicAbs", - "createSVGPathSegCurvetoCubicRel", - "createSVGPathSegCurvetoCubicSmoothAbs", - "createSVGPathSegCurvetoCubicSmoothRel", - "createSVGPathSegCurvetoQuadraticAbs", - "createSVGPathSegCurvetoQuadraticRel", - "createSVGPathSegCurvetoQuadraticSmoothAbs", - "createSVGPathSegCurvetoQuadraticSmoothRel", - "createSVGPathSegLinetoAbs", - "createSVGPathSegLinetoHorizontalAbs", - "createSVGPathSegLinetoHorizontalRel", - "createSVGPathSegLinetoRel", - "createSVGPathSegLinetoVerticalAbs", - "createSVGPathSegLinetoVerticalRel", - "createSVGPathSegMovetoAbs", - "createSVGPathSegMovetoRel", - "createSVGPoint", - "createSVGRect", - "createSVGTransform", - "createSVGTransformFromMatrix", - "createSampler", - "createScript", - "createScriptProcessor", - "createScriptURL", - "createSession", - "createShader", - "createShaderModule", - "createShadowRoot", - "createStereoPanner", - "createStyleSheet", - "createTBody", - "createTFoot", - "createTHead", - "createTextNode", - "createTextRange", - "createTexture", - "createTouch", - "createTouchList", - "createTransformFeedback", - "createTreeWalker", - "createVertexArray", - "createView", - "createWaveShaper", - "creationTime", - "credentials", - "crossOrigin", - "crossOriginIsolated", - "crypto", - "csi", - "csp", - "cssFloat", - "cssRules", - "cssText", - "cssValueType", - "ctrlKey", - "ctrlLeft", - "cues", - "cullFace", - "cullMode", - "currentDirection", - "currentLocalDescription", - "currentNode", - "currentPage", - "currentRect", - "currentRemoteDescription", - "currentScale", - "currentScript", - "currentSrc", - "currentState", - "currentStyle", - "currentTarget", - "currentTime", - "currentTranslate", - "currentView", - "cursor", - "curve", - "customElements", - "customError", - "cx", - "cy", - "d", - "data", - "dataFld", - "dataFormatAs", - "dataLoss", - "dataLossMessage", - "dataPageSize", - "dataSrc", - "dataTransfer", - "database", - "databases", - "dataset", - "dateTime", - "db", - "debug", - "debuggerEnabled", - "declare", - "decode", - "decodeAudioData", - "decodeURI", - "decodeURIComponent", - "decodedBodySize", - "decoding", - "decodingInfo", - "decrypt", - "default", - "defaultCharset", - "defaultChecked", - "defaultMuted", - "defaultPlaybackRate", - "defaultPolicy", - "defaultPrevented", - "defaultQueue", - "defaultRequest", - "defaultSelected", - "defaultStatus", - "defaultURL", - "defaultValue", - "defaultView", - "defaultstatus", - "defer", - "define", - "defineMagicFunction", - "defineMagicVariable", - "defineProperties", - "defineProperty", - "deg", - "delay", - "delayTime", - "delegatesFocus", - "delete", - "deleteBuffer", - "deleteCaption", - "deleteCell", - "deleteContents", - "deleteData", - "deleteDatabase", - "deleteFramebuffer", - "deleteFromDocument", - "deleteIndex", - "deleteMedium", - "deleteObjectStore", - "deleteProgram", - "deleteProperty", - "deleteQuery", - "deleteRenderbuffer", - "deleteRow", - "deleteRule", - "deleteSampler", - "deleteShader", - "deleteSync", - "deleteTFoot", - "deleteTHead", - "deleteTexture", - "deleteTransformFeedback", - "deleteVertexArray", - "deliverChangeRecords", - "delivery", - "deliveryInfo", - "deliveryStatus", - "deliveryTimestamp", - "delta", - "deltaMode", - "deltaX", - "deltaY", - "deltaZ", - "dependentLocality", - "depthBias", - "depthBiasClamp", - "depthBiasSlopeScale", - "depthClearValue", - "depthCompare", - "depthFailOp", - "depthFar", - "depthFunc", - "depthLoadOp", - "depthMask", - "depthNear", - "depthOrArrayLayers", - "depthRange", - "depthReadOnly", - "depthStencil", - "depthStencilAttachment", - "depthStencilFormat", - "depthStoreOp", - "depthWriteEnabled", - "deref", - "deriveBits", - "deriveKey", - "description", - "deselectAll", - "designMode", - "desiredSize", - "destination", - "destinationURL", - "destroy", - "detach", - "detachEvent", - "detachShader", - "detail", - "details", - "detect", - "detune", - "device", - "deviceClass", - "deviceId", - "deviceMemory", - "devicePixelContentBoxSize", - "devicePixelRatio", - "deviceProtocol", - "deviceSubclass", - "deviceVersionMajor", - "deviceVersionMinor", - "deviceVersionSubminor", - "deviceXDPI", - "deviceYDPI", - "didTimeout", - "diffuseConstant", - "digest", - "dimension", - "dimensions", - "dir", - "dirName", - "direction", - "dirxml", - "disable", - "disablePictureInPicture", - "disableRemotePlayback", - "disableVertexAttribArray", - "disabled", - "dischargingTime", - "disconnect", - "disconnectShark", - "dispatchEvent", - "dispatchWorkgroups", - "dispatchWorkgroupsIndirect", - "display", - "displayId", - "displayName", - "disposition", - "distanceModel", - "div", - "divisor", - "djsapi", - "djsproxy", - "doImport", - "doNotTrack", - "doScroll", - "doctype", - "document", - "documentElement", - "documentMode", - "documentURI", - "dolphin", - "dolphinGameCenter", - "dolphininfo", - "dolphinmeta", - "domComplete", - "domContentLoadedEventEnd", - "domContentLoadedEventStart", - "domInteractive", - "domLoading", - "domOverlayState", - "domain", - "domainLookupEnd", - "domainLookupStart", - "dominant-baseline", - "dominantBaseline", - "done", - "dopplerFactor", - "dotAll", - "downDegrees", - "downlink", - "download", - "downloadTotal", - "downloaded", - "dpcm", - "dpi", - "dppx", - "dragDrop", - "draggable", - "draw", - "drawArrays", - "drawArraysInstanced", - "drawArraysInstancedANGLE", - "drawBuffers", - "drawCustomFocusRing", - "drawElements", - "drawElementsInstanced", - "drawElementsInstancedANGLE", - "drawFocusIfNeeded", - "drawImage", - "drawImageFromRect", - "drawIndexed", - "drawIndexedIndirect", - "drawIndirect", - "drawRangeElements", - "drawSystemFocusRing", - "drawingBufferHeight", - "drawingBufferWidth", - "dropEffect", - "droppedVideoFrames", - "dropzone", - "dstFactor", - "dtmf", - "dump", - "dumpProfile", - "duplicate", - "durability", - "duration", - "dvname", - "dvnum", - "dx", - "dy", - "dynsrc", - "e", - "edgeMode", - "effect", - "effectAllowed", - "effectiveDirective", - "effectiveType", - "elapsedTime", - "element", - "elementFromPoint", - "elementTiming", - "elements", - "elementsFromPoint", - "elevation", - "ellipse", - "em", - "email", - "embeds", - "emma", - "empty", - "empty-cells", - "emptyCells", - "emptyHTML", - "emptyScript", - "emulatedPosition", - "enable", - "enableBackground", - "enableDelegations", - "enableStyleSheetsForSet", - "enableVertexAttribArray", - "enabled", - "enabledPlugin", - "encode", - "encodeInto", - "encodeURI", - "encodeURIComponent", - "encodedBodySize", - "encoding", - "encodingInfo", - "encrypt", - "enctype", - "end", - "endContainer", - "endElement", - "endElementAt", - "endOcclusionQuery", - "endOfPassWriteIndex", - "endOfStream", - "endOffset", - "endQuery", - "endTime", - "endTransformFeedback", - "ended", - "endpoint", - "endpointNumber", - "endpoints", - "endsWith", - "enterKeyHint", - "entities", - "entries", - "entryPoint", - "entryType", - "enumerable", - "enumerate", - "enumerateDevices", - "enumerateEditable", - "environmentBlendMode", - "equals", - "error", - "errorCode", - "errorDetail", - "errorText", - "escape", - "estimate", - "eval", - "evaluate", - "event", - "eventPhase", - "every", - "ex", - "exception", - "exchange", - "exec", - "execCommand", - "execCommandShowHelp", - "execScript", - "executeBundles", - "exitFullscreen", - "exitPictureInPicture", - "exitPointerLock", - "exitPresent", - "exp", - "expand", - "expandEntityReferences", - "expando", - "expansion", - "expiration", - "expirationTime", - "expires", - "expiryDate", - "explicitOriginalTarget", - "expm1", - "exponent", - "exponentialRampToValueAtTime", - "exportKey", - "exports", - "extend", - "extensions", - "extentNode", - "extentOffset", - "external", - "externalResourcesRequired", - "externalTexture", - "extractContents", - "extractable", - "eye", - "f", - "face", - "factoryReset", - "failOp", - "failureReason", - "fallback", - "family", - "familyName", - "farthestViewportElement", - "fastSeek", - "fatal", - "featureId", - "featurePolicy", - "featureSettings", - "features", - "fenceSync", - "fetch", - "fetchStart", - "fftSize", - "fgColor", - "fieldOfView", - "file", - "fileCreatedDate", - "fileHandle", - "fileModifiedDate", - "fileName", - "fileSize", - "fileUpdatedDate", - "filename", - "files", - "filesystem", - "fill", - "fill-opacity", - "fill-rule", - "fillLightMode", - "fillOpacity", - "fillRect", - "fillRule", - "fillStyle", - "fillText", - "filter", - "filterResX", - "filterResY", - "filterUnits", - "filters", - "finally", - "find", - "findIndex", - "findRule", - "findText", - "finish", - "finished", - "fireEvent", - "firesTouchEvents", - "firstChild", - "firstElementChild", - "firstPage", - "fixed", - "flags", - "flat", - "flatMap", - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "flexBasis", - "flexDirection", - "flexFlow", - "flexGrow", - "flexShrink", - "flexWrap", - "flipX", - "flipY", - "float", - "float32", - "float64", - "flood-color", - "flood-opacity", - "floodColor", - "floodOpacity", - "floor", - "flush", - "focus", - "focusNode", - "focusOffset", - "font", - "font-family", - "font-feature-settings", - "font-kerning", - "font-language-override", - "font-optical-sizing", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-synthesis", - "font-variant", - "font-variant-alternates", - "font-variant-caps", - "font-variant-east-asian", - "font-variant-ligatures", - "font-variant-numeric", - "font-variant-position", - "font-variation-settings", - "font-weight", - "fontFamily", - "fontFeatureSettings", - "fontKerning", - "fontLanguageOverride", - "fontOpticalSizing", - "fontSize", - "fontSizeAdjust", - "fontSmoothingEnabled", - "fontStretch", - "fontStyle", - "fontSynthesis", - "fontVariant", - "fontVariantAlternates", - "fontVariantCaps", - "fontVariantEastAsian", - "fontVariantLigatures", - "fontVariantNumeric", - "fontVariantPosition", - "fontVariationSettings", - "fontWeight", - "fontcolor", - "fontfaces", - "fonts", - "fontsize", - "for", - "forEach", - "force", - "forceFallbackAdapter", - "forceRedraw", - "form", - "formAction", - "formData", - "formEnctype", - "formMethod", - "formNoValidate", - "formTarget", - "format", - "formatToParts", - "forms", - "forward", - "forwardX", - "forwardY", - "forwardZ", - "foundation", - "fr", - "fragment", - "fragmentDirective", - "frame", - "frameBorder", - "frameElement", - "frameSpacing", - "framebuffer", - "framebufferHeight", - "framebufferRenderbuffer", - "framebufferTexture2D", - "framebufferTextureLayer", - "framebufferWidth", - "frames", - "freeSpace", - "freeze", - "frequency", - "frequencyBinCount", - "from", - "fromCharCode", - "fromCodePoint", - "fromElement", - "fromEntries", - "fromFloat32Array", - "fromFloat64Array", - "fromMatrix", - "fromPoint", - "fromQuad", - "fromRect", - "frontFace", - "fround", - "fullPath", - "fullScreen", - "fullVersionList", - "fullscreen", - "fullscreenElement", - "fullscreenEnabled", - "fx", - "fy", - "g", - "gain", - "gamepad", - "gamma", - "gap", - "gatheringState", - "gatt", - "genderIdentity", - "generateCertificate", - "generateKey", - "generateMipmap", - "generateRequest", - "geolocation", - "gestureObject", - "get", - "getActiveAttrib", - "getActiveUniform", - "getActiveUniformBlockName", - "getActiveUniformBlockParameter", - "getActiveUniforms", - "getAdjacentText", - "getAll", - "getAllKeys", - "getAllResponseHeaders", - "getAllowlistForFeature", - "getAnimations", - "getAsFile", - "getAsString", - "getAttachedShaders", - "getAttribLocation", - "getAttribute", - "getAttributeNS", - "getAttributeNames", - "getAttributeNode", - "getAttributeNodeNS", - "getAttributeType", - "getAudioTracks", - "getAvailability", - "getBBox", - "getBattery", - "getBigInt64", - "getBigUint64", - "getBindGroupLayout", - "getBlob", - "getBookmark", - "getBoundingClientRect", - "getBounds", - "getBoxQuads", - "getBufferParameter", - "getBufferSubData", - "getByteFrequencyData", - "getByteTimeDomainData", - "getCSSCanvasContext", - "getCTM", - "getCandidateWindowClientRect", - "getCanonicalLocales", - "getCapabilities", - "getChannelData", - "getCharNumAtPosition", - "getCharacteristic", - "getCharacteristics", - "getClientExtensionResults", - "getClientRect", - "getClientRects", - "getCoalescedEvents", - "getCompilationInfo", - "getCompositionAlternatives", - "getComputedStyle", - "getComputedTextLength", - "getComputedTiming", - "getConfiguration", - "getConstraints", - "getContext", - "getContextAttributes", - "getContributingSources", - "getCounterValue", - "getCueAsHTML", - "getCueById", - "getCurrentPosition", - "getCurrentTexture", - "getCurrentTime", - "getData", - "getDatabaseNames", - "getDate", - "getDay", - "getDefaultComputedStyle", - "getDescriptor", - "getDescriptors", - "getDestinationInsertionPoints", - "getDevices", - "getDirectory", - "getDisplayMedia", - "getDistributedNodes", - "getEditable", - "getElementById", - "getElementsByClassName", - "getElementsByName", - "getElementsByTagName", - "getElementsByTagNameNS", - "getEnclosureList", - "getEndPositionOfChar", - "getEntries", - "getEntriesByName", - "getEntriesByType", - "getError", - "getExtension", - "getExtentOfChar", - "getEyeParameters", - "getFeature", - "getFile", - "getFiles", - "getFilesAndDirectories", - "getFingerprints", - "getFloat32", - "getFloat64", - "getFloatFrequencyData", - "getFloatTimeDomainData", - "getFloatValue", - "getFragDataLocation", - "getFrameData", - "getFramebufferAttachmentParameter", - "getFrequencyResponse", - "getFullYear", - "getGamepads", - "getHighEntropyValues", - "getHitTestResults", - "getHitTestResultsForTransientInput", - "getHours", - "getIdentityAssertion", - "getIds", - "getImageData", - "getIndexedParameter", - "getInstalledRelatedApps", - "getInt16", - "getInt32", - "getInt8", - "getInternalformatParameter", - "getIntersectionList", - "getItem", - "getItems", - "getKey", - "getKeyframes", - "getLayers", - "getLayoutMap", - "getLineDash", - "getLocalCandidates", - "getLocalParameters", - "getLocalStreams", - "getMappedRange", - "getMarks", - "getMatchedCSSRules", - "getMaxGCPauseSinceClear", - "getMeasures", - "getMetadata", - "getMilliseconds", - "getMinutes", - "getModifierState", - "getMonth", - "getNamedItem", - "getNamedItemNS", - "getNativeFramebufferScaleFactor", - "getNotifications", - "getNotifier", - "getNumberOfChars", - "getOffsetReferenceSpace", - "getOutputTimestamp", - "getOverrideHistoryNavigationMode", - "getOverrideStyle", - "getOwnPropertyDescriptor", - "getOwnPropertyDescriptors", - "getOwnPropertyNames", - "getOwnPropertySymbols", - "getParameter", - "getParameters", - "getParent", - "getPathSegAtLength", - "getPhotoCapabilities", - "getPhotoSettings", - "getPointAtLength", - "getPose", - "getPredictedEvents", - "getPreference", - "getPreferenceDefault", - "getPreferredCanvasFormat", - "getPresentationAttribute", - "getPreventDefault", - "getPrimaryService", - "getPrimaryServices", - "getProgramInfoLog", - "getProgramParameter", - "getPropertyCSSValue", - "getPropertyPriority", - "getPropertyShorthand", - "getPropertyType", - "getPropertyValue", - "getPrototypeOf", - "getQuery", - "getQueryParameter", - "getRGBColorValue", - "getRandomValues", - "getRangeAt", - "getReader", - "getReceivers", - "getRectValue", - "getRegistration", - "getRegistrations", - "getRemoteCandidates", - "getRemoteCertificates", - "getRemoteParameters", - "getRemoteStreams", - "getRenderbufferParameter", - "getResponseHeader", - "getRoot", - "getRootNode", - "getRotationOfChar", - "getSVGDocument", - "getSamplerParameter", - "getScreenCTM", - "getSeconds", - "getSelectedCandidatePair", - "getSelection", - "getSenders", - "getService", - "getSettings", - "getShaderInfoLog", - "getShaderParameter", - "getShaderPrecisionFormat", - "getShaderSource", - "getSimpleDuration", - "getSiteIcons", - "getSources", - "getSpeculativeParserUrls", - "getStartPositionOfChar", - "getStartTime", - "getState", - "getStats", - "getStatusForPolicy", - "getStorageUpdates", - "getStreamById", - "getStringValue", - "getSubStringLength", - "getSubscription", - "getSupportedConstraints", - "getSupportedExtensions", - "getSupportedFormats", - "getSyncParameter", - "getSynchronizationSources", - "getTags", - "getTargetRanges", - "getTexParameter", - "getTime", - "getTimezoneOffset", - "getTiming", - "getTotalLength", - "getTrackById", - "getTracks", - "getTransceivers", - "getTransform", - "getTransformFeedbackVarying", - "getTransformToElement", - "getTransports", - "getType", - "getTypeMapping", - "getUTCDate", - "getUTCDay", - "getUTCFullYear", - "getUTCHours", - "getUTCMilliseconds", - "getUTCMinutes", - "getUTCMonth", - "getUTCSeconds", - "getUint16", - "getUint32", - "getUint8", - "getUniform", - "getUniformBlockIndex", - "getUniformIndices", - "getUniformLocation", - "getUserMedia", - "getVRDisplays", - "getValues", - "getVarDate", - "getVariableValue", - "getVertexAttrib", - "getVertexAttribOffset", - "getVideoPlaybackQuality", - "getVideoTracks", - "getViewerPose", - "getViewport", - "getVoices", - "getWakeLockState", - "getWriter", - "getYear", - "givenName", - "global", - "globalAlpha", - "globalCompositeOperation", - "globalThis", - "glyphOrientationHorizontal", - "glyphOrientationVertical", - "glyphRef", - "go", - "gpu", - "grabFrame", - "grad", - "gradientTransform", - "gradientUnits", - "grammars", - "green", - "grid", - "grid-area", - "grid-auto-columns", - "grid-auto-flow", - "grid-auto-rows", - "grid-column", - "grid-column-end", - "grid-column-gap", - "grid-column-start", - "grid-gap", - "grid-row", - "grid-row-end", - "grid-row-gap", - "grid-row-start", - "grid-template", - "grid-template-areas", - "grid-template-columns", - "grid-template-rows", - "gridArea", - "gridAutoColumns", - "gridAutoFlow", - "gridAutoRows", - "gridColumn", - "gridColumnEnd", - "gridColumnGap", - "gridColumnStart", - "gridGap", - "gridRow", - "gridRowEnd", - "gridRowGap", - "gridRowStart", - "gridTemplate", - "gridTemplateAreas", - "gridTemplateColumns", - "gridTemplateRows", - "gripSpace", - "group", - "groups", - "groupCollapsed", - "groupEnd", - "groupId", - "hadRecentInput", - "hand", - "handedness", - "hapticActuators", - "hardwareConcurrency", - "has", - "hasAttribute", - "hasAttributeNS", - "hasAttributes", - "hasBeenActive", - "hasChildNodes", - "hasComposition", - "hasDynamicOffset", - "hasEnrolledInstrument", - "hasExtension", - "hasExternalDisplay", - "hasFeature", - "hasFocus", - "hasInstance", - "hasLayout", - "hasOrientation", - "hasOwnProperty", - "hasPointerCapture", - "hasPosition", - "hasReading", - "hasStorageAccess", - "hash", - "head", - "headers", - "heading", - "height", - "hidden", - "hide", - "hideFocus", - "high", - "highWaterMark", - "hint", - "hints", - "history", - "honorificPrefix", - "honorificSuffix", - "horizontalOverflow", - "host", - "hostCandidate", - "hostname", - "href", - "hrefTranslate", - "hreflang", - "hspace", - "html5TagCheckInerface", - "htmlFor", - "htmlText", - "httpEquiv", - "httpRequestStatusCode", - "hwTimestamp", - "hyphens", - "hypot", - "iccId", - "iceConnectionState", - "iceGatheringState", - "iceTransport", - "icon", - "iconURL", - "id", - "identifier", - "identity", - "idpLoginUrl", - "ignoreBOM", - "ignoreCase", - "ignoreDepthValues", - "image-orientation", - "image-rendering", - "imageHeight", - "imageOrientation", - "imageRendering", - "imageSizes", - "imageSmoothingEnabled", - "imageSmoothingQuality", - "imageSrcset", - "imageWidth", - "images", - "ime-mode", - "imeMode", - "implementation", - "importExternalTexture", - "importKey", - "importNode", - "importStylesheet", - "imports", - "impp", - "imul", - "in", - "in1", - "in2", - "inBandMetadataTrackDispatchType", - "inRange", - "includes", - "incremental", - "indeterminate", - "index", - "indexNames", - "indexOf", - "indexedDB", - "indicate", - "indices", - "inert", - "inertiaDestinationX", - "inertiaDestinationY", - "info", - "init", - "initAnimationEvent", - "initBeforeLoadEvent", - "initClipboardEvent", - "initCloseEvent", - "initCommandEvent", - "initCompositionEvent", - "initCustomEvent", - "initData", - "initDataType", - "initDeviceMotionEvent", - "initDeviceOrientationEvent", - "initDragEvent", - "initErrorEvent", - "initEvent", - "initFocusEvent", - "initGestureEvent", - "initHashChangeEvent", - "initKeyEvent", - "initKeyboardEvent", - "initMSManipulationEvent", - "initMessageEvent", - "initMouseEvent", - "initMouseScrollEvent", - "initMouseWheelEvent", - "initMutationEvent", - "initNSMouseEvent", - "initOverflowEvent", - "initPageEvent", - "initPageTransitionEvent", - "initPointerEvent", - "initPopStateEvent", - "initProgressEvent", - "initScrollAreaEvent", - "initSimpleGestureEvent", - "initStorageEvent", - "initTextEvent", - "initTimeEvent", - "initTouchEvent", - "initTransitionEvent", - "initUIEvent", - "initWebKitAnimationEvent", - "initWebKitTransitionEvent", - "initWebKitWheelEvent", - "initWheelEvent", - "initialTime", - "initialize", - "initiatorType", - "inline-size", - "inlineSize", - "inlineVerticalFieldOfView", - "inner", - "innerHTML", - "innerHeight", - "innerText", - "innerWidth", - "input", - "inputBuffer", - "inputEncoding", - "inputMethod", - "inputMode", - "inputSource", - "inputSources", - "inputType", - "inputs", - "insertAdjacentElement", - "insertAdjacentHTML", - "insertAdjacentText", - "insertBefore", - "insertCell", - "insertDTMF", - "insertData", - "insertDebugMarker", - "insertItemBefore", - "insertNode", - "insertRow", - "insertRule", - "inset", - "inset-block", - "inset-block-end", - "inset-block-start", - "inset-inline", - "inset-inline-end", - "inset-inline-start", - "insetBlock", - "insetBlockEnd", - "insetBlockStart", - "insetInline", - "insetInlineEnd", - "insetInlineStart", - "installing", - "instanceRoot", - "instantiate", - "instantiateStreaming", - "instruments", - "int16", - "int32", - "int8", - "integrity", - "interactionMode", - "intercept", - "interfaceClass", - "interfaceName", - "interfaceNumber", - "interfaceProtocol", - "interfaceSubclass", - "interfaces", - "interimResults", - "internalSubset", - "interpretation", - "intersectionRatio", - "intersectionRect", - "intersectsNode", - "interval", - "invalidIteratorState", - "invalidateFramebuffer", - "invalidateSubFramebuffer", - "inverse", - "invertSelf", - "is", - "is2D", - "isActive", - "isAlternate", - "isArray", - "isBingCurrentSearchDefault", - "isBuffer", - "isCandidateWindowVisible", - "isChar", - "isCollapsed", - "isComposing", - "isConcatSpreadable", - "isConnected", - "isContentEditable", - "isContentHandlerRegistered", - "isContextLost", - "isDefaultNamespace", - "isDirectory", - "isDisabled", - "isEnabled", - "isEqual", - "isEqualNode", - "isExtensible", - "isExternalCTAP2SecurityKeySupported", - "isFallbackAdapter", - "isFile", - "isFinite", - "isFramebuffer", - "isFrozen", - "isGenerator", - "isHTML", - "isHistoryNavigation", - "isId", - "isIdentity", - "isInjected", - "isInteger", - "isIntersecting", - "isLockFree", - "isMap", - "isMultiLine", - "isNaN", - "isOpen", - "isPointInFill", - "isPointInPath", - "isPointInRange", - "isPointInStroke", - "isPrefAlternate", - "isPresenting", - "isPrimary", - "isProgram", - "isPropertyImplicit", - "isProtocolHandlerRegistered", - "isPrototypeOf", - "isQuery", - "isRenderbuffer", - "isSafeInteger", - "isSameNode", - "isSampler", - "isScript", - "isScriptURL", - "isSealed", - "isSecureContext", - "isSessionSupported", - "isShader", - "isSupported", - "isSync", - "isTextEdit", - "isTexture", - "isTransformFeedback", - "isTrusted", - "isTypeSupported", - "isUserVerifyingPlatformAuthenticatorAvailable", - "isVertexArray", - "isView", - "isVisible", - "isochronousTransferIn", - "isochronousTransferOut", - "isolation", - "italics", - "item", - "itemId", - "itemProp", - "itemRef", - "itemScope", - "itemType", - "itemValue", - "items", - "iterateNext", - "iterationComposite", - "iterator", - "javaEnabled", - "jobTitle", - "join", - "json", - "justify-content", - "justify-items", - "justify-self", - "justifyContent", - "justifyItems", - "justifySelf", - "k1", - "k2", - "k3", - "k4", - "kHz", - "keepalive", - "kernelMatrix", - "kernelUnitLengthX", - "kernelUnitLengthY", - "kerning", - "key", - "keyCode", - "keyFor", - "keyIdentifier", - "keyLightEnabled", - "keyLocation", - "keyPath", - "keyStatuses", - "keySystem", - "keyText", - "keyUsage", - "keyboard", - "keys", - "keytype", - "kind", - "knee", - "label", - "labels", - "lang", - "language", - "languages", - "largeArcFlag", - "lastChild", - "lastElementChild", - "lastEventId", - "lastIndex", - "lastIndexOf", - "lastInputTime", - "lastMatch", - "lastMessageSubject", - "lastMessageType", - "lastModified", - "lastModifiedDate", - "lastPage", - "lastParen", - "lastState", - "lastStyleSheetSet", - "latitude", - "layerX", - "layerY", - "layout", - "layoutFlow", - "layoutGrid", - "layoutGridChar", - "layoutGridLine", - "layoutGridMode", - "layoutGridType", - "lbound", - "left", - "leftContext", - "leftDegrees", - "leftMargin", - "leftProjectionMatrix", - "leftViewMatrix", - "length", - "lengthAdjust", - "lengthComputable", - "letter-spacing", - "letterSpacing", - "level", - "lighting-color", - "lightingColor", - "limitingConeAngle", - "limits", - "line", - "line-break", - "line-height", - "lineAlign", - "lineBreak", - "lineCap", - "lineDashOffset", - "lineHeight", - "lineJoin", - "lineNum", - "lineNumber", - "linePos", - "lineTo", - "lineWidth", - "linearAcceleration", - "linearRampToValueAtTime", - "linearVelocity", - "lineno", - "lines", - "link", - "linkColor", - "linkProgram", - "links", - "list", - "list-style", - "list-style-image", - "list-style-position", - "list-style-type", - "listStyle", - "listStyleImage", - "listStylePosition", - "listStyleType", - "listener", - "load", - "loadEventEnd", - "loadEventStart", - "loadOp", - "loadTime", - "loadTimes", - "loaded", - "loading", - "localDescription", - "localName", - "localService", - "localStorage", - "locale", - "localeCompare", - "location", - "locationbar", - "lock", - "locked", - "lockedFile", - "locks", - "lodMaxClamp", - "lodMinClamp", - "log", - "log10", - "log1p", - "log2", - "logicalXDPI", - "logicalYDPI", - "longDesc", - "longitude", - "lookupNamespaceURI", - "lookupPrefix", - "loop", - "loopEnd", - "loopStart", - "looping", - "lost", - "low", - "lower", - "lowerBound", - "lowerOpen", - "lowsrc", - "m11", - "m12", - "m13", - "m14", - "m21", - "m22", - "m23", - "m24", - "m31", - "m32", - "m33", - "m34", - "m41", - "m42", - "m43", - "m44", - "magFilter", - "makeXRCompatible", - "manifest", - "manufacturer", - "manufacturerName", - "map", - "mapAsync", - "mapState", - "mappedAtCreation", - "mapping", - "margin", - "margin-block", - "margin-block-end", - "margin-block-start", - "margin-bottom", - "margin-inline", - "margin-inline-end", - "margin-inline-start", - "margin-left", - "margin-right", - "margin-top", - "marginBlock", - "marginBlockEnd", - "marginBlockStart", - "marginBottom", - "marginHeight", - "marginInline", - "marginInlineEnd", - "marginInlineStart", - "marginLeft", - "marginRight", - "marginTop", - "marginWidth", - "mark", - "marker", - "marker-end", - "marker-mid", - "marker-offset", - "marker-start", - "markerEnd", - "markerHeight", - "markerMid", - "markerOffset", - "markerStart", - "markerUnits", - "markerWidth", - "marks", - "mask", - "mask-clip", - "mask-composite", - "mask-image", - "mask-mode", - "mask-origin", - "mask-position", - "mask-position-x", - "mask-position-y", - "mask-repeat", - "mask-size", - "mask-type", - "maskClip", - "maskComposite", - "maskContentUnits", - "maskImage", - "maskMode", - "maskOrigin", - "maskPosition", - "maskPositionX", - "maskPositionY", - "maskRepeat", - "maskSize", - "maskType", - "maskUnits", - "match", - "matchAll", - "matchMedia", - "matchMedium", - "matches", - "matrix", - "matrixTransform", - "max", - "max-block-size", - "max-height", - "max-inline-size", - "max-width", - "maxActions", - "maxAlternatives", - "maxAnisotropy", - "maxBindGroups", - "maxBindGroupsPlusVertexBuffers", - "maxBindingsPerBindGroup", - "maxBlockSize", - "maxBufferSize", - "maxChannelCount", - "maxChannels", - "maxColorAttachmentBytesPerSample", - "maxColorAttachments", - "maxComputeInvocationsPerWorkgroup", - "maxComputeWorkgroupSizeX", - "maxComputeWorkgroupSizeY", - "maxComputeWorkgroupSizeZ", - "maxComputeWorkgroupStorageSize", - "maxComputeWorkgroupsPerDimension", - "maxConnectionsPerServer", - "maxDecibels", - "maxDistance", - "maxDrawCount", - "maxDynamicStorageBuffersPerPipelineLayout", - "maxDynamicUniformBuffersPerPipelineLayout", - "maxHeight", - "maxInlineSize", - "maxInterStageShaderComponents", - "maxInterStageShaderVariables", - "maxLayers", - "maxLength", - "maxMessageSize", - "maxPacketLifeTime", - "maxRetransmits", - "maxSampledTexturesPerShaderStage", - "maxSamplersPerShaderStage", - "maxStorageBufferBindingSize", - "maxStorageBuffersPerShaderStage", - "maxStorageTexturesPerShaderStage", - "maxTextureArrayLayers", - "maxTextureDimension1D", - "maxTextureDimension2D", - "maxTextureDimension3D", - "maxTouchPoints", - "maxUniformBufferBindingSize", - "maxUniformBuffersPerShaderStage", - "maxValue", - "maxVertexAttributes", - "maxVertexBufferArrayStride", - "maxVertexBuffers", - "maxWidth", - "measure", - "measureText", - "media", - "mediaCapabilities", - "mediaDevices", - "mediaElement", - "mediaGroup", - "mediaKeys", - "mediaSession", - "mediaStream", - "mediaText", - "meetOrSlice", - "memory", - "menubar", - "mergeAttributes", - "message", - "messageClass", - "messageHandlers", - "messageType", - "messages", - "metaKey", - "metadata", - "method", - "methodDetails", - "methodName", - "mid", - "mimeType", - "mimeTypes", - "min", - "min-block-size", - "min-height", - "min-inline-size", - "min-width", - "minBindingSize", - "minBlockSize", - "minDecibels", - "minFilter", - "minHeight", - "minInlineSize", - "minLength", - "minStorageBufferOffsetAlignment", - "minUniformBufferOffsetAlignment", - "minValue", - "minWidth", - "mipLevel", - "mipLevelCount", - "mipmapFilter", - "miterLimit", - "mix-blend-mode", - "mixBlendMode", - "mm", - "mobile", - "mode", - "model", - "modify", - "module", - "mount", - "move", - "moveBy", - "moveEnd", - "moveFirst", - "moveFocusDown", - "moveFocusLeft", - "moveFocusRight", - "moveFocusUp", - "moveNext", - "moveRow", - "moveStart", - "moveTo", - "moveToBookmark", - "moveToElementText", - "moveToPoint", - "movementX", - "movementY", - "mozAdd", - "mozAnimationStartTime", - "mozAnon", - "mozApps", - "mozAudioCaptured", - "mozAudioChannelType", - "mozAutoplayEnabled", - "mozCancelAnimationFrame", - "mozCancelFullScreen", - "mozCancelRequestAnimationFrame", - "mozCaptureStream", - "mozCaptureStreamUntilEnded", - "mozClearDataAt", - "mozContact", - "mozContacts", - "mozCreateFileHandle", - "mozCurrentTransform", - "mozCurrentTransformInverse", - "mozCursor", - "mozDash", - "mozDashOffset", - "mozDecodedFrames", - "mozExitPointerLock", - "mozFillRule", - "mozFragmentEnd", - "mozFrameDelay", - "mozFullScreen", - "mozFullScreenElement", - "mozFullScreenEnabled", - "mozGetAll", - "mozGetAllKeys", - "mozGetAsFile", - "mozGetDataAt", - "mozGetMetadata", - "mozGetUserMedia", - "mozHasAudio", - "mozHasItem", - "mozHidden", - "mozImageSmoothingEnabled", - "mozIndexedDB", - "mozInnerScreenX", - "mozInnerScreenY", - "mozInputSource", - "mozIsTextField", - "mozItem", - "mozItemCount", - "mozItems", - "mozLength", - "mozLockOrientation", - "mozMatchesSelector", - "mozMovementX", - "mozMovementY", - "mozOpaque", - "mozOrientation", - "mozPaintCount", - "mozPaintedFrames", - "mozParsedFrames", - "mozPay", - "mozPointerLockElement", - "mozPresentedFrames", - "mozPreservesPitch", - "mozPressure", - "mozPrintCallback", - "mozRTCIceCandidate", - "mozRTCPeerConnection", - "mozRTCSessionDescription", - "mozRemove", - "mozRequestAnimationFrame", - "mozRequestFullScreen", - "mozRequestPointerLock", - "mozSetDataAt", - "mozSetImageElement", - "mozSourceNode", - "mozSrcObject", - "mozSystem", - "mozTCPSocket", - "mozTextStyle", - "mozTypesAt", - "mozUnlockOrientation", - "mozUserCancelled", - "mozVisibilityState", - "ms", - "msAnimation", - "msAnimationDelay", - "msAnimationDirection", - "msAnimationDuration", - "msAnimationFillMode", - "msAnimationIterationCount", - "msAnimationName", - "msAnimationPlayState", - "msAnimationStartTime", - "msAnimationTimingFunction", - "msBackfaceVisibility", - "msBlockProgression", - "msCSSOMElementFloatMetrics", - "msCaching", - "msCachingEnabled", - "msCancelRequestAnimationFrame", - "msCapsLockWarningOff", - "msClearImmediate", - "msClose", - "msContentZoomChaining", - "msContentZoomFactor", - "msContentZoomLimit", - "msContentZoomLimitMax", - "msContentZoomLimitMin", - "msContentZoomSnap", - "msContentZoomSnapPoints", - "msContentZoomSnapType", - "msContentZooming", - "msConvertURL", - "msCrypto", - "msDoNotTrack", - "msElementsFromPoint", - "msElementsFromRect", - "msExitFullscreen", - "msExtendedCode", - "msFillRule", - "msFirstPaint", - "msFlex", - "msFlexAlign", - "msFlexDirection", - "msFlexFlow", - "msFlexItemAlign", - "msFlexLinePack", - "msFlexNegative", - "msFlexOrder", - "msFlexPack", - "msFlexPositive", - "msFlexPreferredSize", - "msFlexWrap", - "msFlowFrom", - "msFlowInto", - "msFontFeatureSettings", - "msFullscreenElement", - "msFullscreenEnabled", - "msGetInputContext", - "msGetRegionContent", - "msGetUntransformedBounds", - "msGraphicsTrustStatus", - "msGridColumn", - "msGridColumnAlign", - "msGridColumnSpan", - "msGridColumns", - "msGridRow", - "msGridRowAlign", - "msGridRowSpan", - "msGridRows", - "msHidden", - "msHighContrastAdjust", - "msHyphenateLimitChars", - "msHyphenateLimitLines", - "msHyphenateLimitZone", - "msHyphens", - "msImageSmoothingEnabled", - "msImeAlign", - "msIndexedDB", - "msInterpolationMode", - "msIsStaticHTML", - "msKeySystem", - "msKeys", - "msLaunchUri", - "msLockOrientation", - "msManipulationViewsEnabled", - "msMatchMedia", - "msMatchesSelector", - "msMaxTouchPoints", - "msOrientation", - "msOverflowStyle", - "msPerspective", - "msPerspectiveOrigin", - "msPlayToDisabled", - "msPlayToPreferredSourceUri", - "msPlayToPrimary", - "msPointerEnabled", - "msRegionOverflow", - "msReleasePointerCapture", - "msRequestAnimationFrame", - "msRequestFullscreen", - "msSaveBlob", - "msSaveOrOpenBlob", - "msScrollChaining", - "msScrollLimit", - "msScrollLimitXMax", - "msScrollLimitXMin", - "msScrollLimitYMax", - "msScrollLimitYMin", - "msScrollRails", - "msScrollSnapPointsX", - "msScrollSnapPointsY", - "msScrollSnapType", - "msScrollSnapX", - "msScrollSnapY", - "msScrollTranslation", - "msSetImmediate", - "msSetMediaKeys", - "msSetPointerCapture", - "msTextCombineHorizontal", - "msTextSizeAdjust", - "msToBlob", - "msTouchAction", - "msTouchSelect", - "msTraceAsyncCallbackCompleted", - "msTraceAsyncCallbackStarting", - "msTraceAsyncOperationCompleted", - "msTraceAsyncOperationStarting", - "msTransform", - "msTransformOrigin", - "msTransformStyle", - "msTransition", - "msTransitionDelay", - "msTransitionDuration", - "msTransitionProperty", - "msTransitionTimingFunction", - "msUnlockOrientation", - "msUpdateAsyncCallbackRelation", - "msUserSelect", - "msVisibilityState", - "msWrapFlow", - "msWrapMargin", - "msWrapThrough", - "msWriteProfilerMark", - "msZoom", - "msZoomTo", - "mt", - "mul", - "multiEntry", - "multiSelectionObj", - "multiline", - "multiple", - "multiply", - "multiplySelf", - "multisample", - "multisampled", - "mutableFile", - "muted", - "n", - "name", - "nameProp", - "namedItem", - "namedRecordset", - "names", - "namespaceURI", - "namespaces", - "naturalHeight", - "naturalWidth", - "navigate", - "navigation", - "navigationMode", - "navigationPreload", - "navigationStart", - "navigator", - "near", - "nearestViewportElement", - "negative", - "negotiated", - "netscape", - "networkState", - "newScale", - "newTranslate", - "newURL", - "newValue", - "newValueSpecifiedUnits", - "newVersion", - "newhome", - "next", - "nextElementSibling", - "nextHopProtocol", - "nextNode", - "nextPage", - "nextSibling", - "nickname", - "noHref", - "noModule", - "noResize", - "noShade", - "noValidate", - "noWrap", - "node", - "nodeName", - "nodeType", - "nodeValue", - "nonce", - "normalize", - "normalizedPathSegList", - "notationName", - "notations", - "note", - "noteGrainOn", - "noteOff", - "noteOn", - "notify", - "now", - "numOctaves", - "number", - "numberOfChannels", - "numberOfInputs", - "numberOfItems", - "numberOfOutputs", - "numberValue", - "oMatchesSelector", - "object", - "object-fit", - "object-position", - "objectFit", - "objectPosition", - "objectStore", - "objectStoreNames", - "objectType", - "observe", - "occlusionQuerySet", - "of", - "offscreenBuffering", - "offset", - "offset-anchor", - "offset-distance", - "offset-path", - "offset-rotate", - "offsetAnchor", - "offsetDistance", - "offsetHeight", - "offsetLeft", - "offsetNode", - "offsetParent", - "offsetPath", - "offsetRotate", - "offsetTop", - "offsetWidth", - "offsetX", - "offsetY", - "ok", - "oldURL", - "oldValue", - "oldVersion", - "olderShadowRoot", - "onLine", - "onSubmittedWorkDone", - "onabort", - "onabsolutedeviceorientation", - "onactivate", - "onactive", - "onaddsourcebuffer", - "onaddstream", - "onaddtrack", - "onafterprint", - "onafterscriptexecute", - "onafterupdate", - "onanimationcancel", - "onanimationend", - "onanimationiteration", - "onanimationstart", - "onappinstalled", - "onaudioend", - "onaudioprocess", - "onaudiostart", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onbeforeactivate", - "onbeforecopy", - "onbeforecut", - "onbeforedeactivate", - "onbeforeeditfocus", - "onbeforeinstallprompt", - "onbeforepaste", - "onbeforeprint", - "onbeforescriptexecute", - "onbeforeunload", - "onbeforeupdate", - "onbeforexrselect", - "onbegin", - "onblocked", - "onblur", - "onbounce", - "onboundary", - "onbufferedamountlow", - "oncached", - "oncancel", - "oncandidatewindowhide", - "oncandidatewindowshow", - "oncandidatewindowupdate", - "oncanplay", - "oncanplaythrough", - "once", - "oncellchange", - "onchange", - "oncharacteristicvaluechanged", - "onchargingchange", - "onchargingtimechange", - "onchecking", - "onclick", - "onclose", - "onclosing", - "oncompassneedscalibration", - "oncomplete", - "onconnect", - "onconnecting", - "onconnectionavailable", - "onconnectionstatechange", - "oncontextmenu", - "oncontrollerchange", - "oncontrolselect", - "oncopy", - "oncuechange", - "oncut", - "ondataavailable", - "ondatachannel", - "ondatasetchanged", - "ondatasetcomplete", - "ondblclick", - "ondeactivate", - "ondevicechange", - "ondevicelight", - "ondevicemotion", - "ondeviceorientation", - "ondeviceorientationabsolute", - "ondeviceproximity", - "ondischargingtimechange", - "ondisconnect", - "ondisplay", - "ondownloading", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onencrypted", - "onend", - "onended", - "onenter", - "onenterpictureinpicture", - "onerror", - "onerrorupdate", - "onexit", - "onfilterchange", - "onfinish", - "onfocus", - "onfocusin", - "onfocusout", - "onformdata", - "onfreeze", - "onfullscreenchange", - "onfullscreenerror", - "ongatheringstatechange", - "ongattserverdisconnected", - "ongesturechange", - "ongestureend", - "ongesturestart", - "ongotpointercapture", - "onhashchange", - "onhelp", - "onicecandidate", - "onicecandidateerror", - "oniceconnectionstatechange", - "onicegatheringstatechange", - "oninactive", - "oninput", - "oninputsourceschange", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeystatuseschange", - "onkeyup", - "onlanguagechange", - "onlayoutcomplete", - "onleavepictureinpicture", - "onlevelchange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloading", - "onloadingdone", - "onloadingerror", - "onloadstart", - "onlosecapture", - "onlostpointercapture", - "only", - "onmark", - "onmessage", - "onmessageerror", - "onmidimessage", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onmove", - "onmoveend", - "onmovestart", - "onmozfullscreenchange", - "onmozfullscreenerror", - "onmozorientationchange", - "onmozpointerlockchange", - "onmozpointerlockerror", - "onmscontentzoom", - "onmsfullscreenchange", - "onmsfullscreenerror", - "onmsgesturechange", - "onmsgesturedoubletap", - "onmsgestureend", - "onmsgesturehold", - "onmsgesturestart", - "onmsgesturetap", - "onmsgotpointercapture", - "onmsinertiastart", - "onmslostpointercapture", - "onmsmanipulationstatechanged", - "onmsneedkey", - "onmsorientationchange", - "onmspointercancel", - "onmspointerdown", - "onmspointerenter", - "onmspointerhover", - "onmspointerleave", - "onmspointermove", - "onmspointerout", - "onmspointerover", - "onmspointerup", - "onmssitemodejumplistitemremoved", - "onmsthumbnailclick", - "onmute", - "onnegotiationneeded", - "onnomatch", - "onnoupdate", - "onobsolete", - "onoffline", - "ononline", - "onopen", - "onorientationchange", - "onpagechange", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onpayerdetailchange", - "onpaymentmethodchange", - "onplay", - "onplaying", - "onpluginstreamstart", - "onpointercancel", - "onpointerdown", - "onpointerenter", - "onpointerleave", - "onpointerlockchange", - "onpointerlockerror", - "onpointermove", - "onpointerout", - "onpointerover", - "onpointerrawupdate", - "onpointerup", - "onpopstate", - "onprocessorerror", - "onprogress", - "onpropertychange", - "onratechange", - "onreading", - "onreadystatechange", - "onrejectionhandled", - "onrelease", - "onremove", - "onremovesourcebuffer", - "onremovestream", - "onremovetrack", - "onrepeat", - "onreset", - "onresize", - "onresizeend", - "onresizestart", - "onresourcetimingbufferfull", - "onresult", - "onresume", - "onrowenter", - "onrowexit", - "onrowsdelete", - "onrowsinserted", - "onscroll", - "onsearch", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onselectedcandidatepairchange", - "onselectend", - "onselectionchange", - "onselectstart", - "onshippingaddresschange", - "onshippingoptionchange", - "onshow", - "onsignalingstatechange", - "onsoundend", - "onsoundstart", - "onsourceclose", - "onsourceclosed", - "onsourceended", - "onsourceopen", - "onspeechend", - "onspeechstart", - "onsqueeze", - "onsqueezeend", - "onsqueezestart", - "onstalled", - "onstart", - "onstatechange", - "onstop", - "onstorage", - "onstoragecommit", - "onsubmit", - "onsuccess", - "onsuspend", - "onterminate", - "ontextinput", - "ontimeout", - "ontimeupdate", - "ontoggle", - "ontonechange", - "ontouchcancel", - "ontouchend", - "ontouchmove", - "ontouchstart", - "ontrack", - "ontransitioncancel", - "ontransitionend", - "ontransitionrun", - "ontransitionstart", - "onuncapturederror", - "onunhandledrejection", - "onunload", - "onunmute", - "onupdate", - "onupdateend", - "onupdatefound", - "onupdateready", - "onupdatestart", - "onupgradeneeded", - "onuserproximity", - "onversionchange", - "onvisibilitychange", - "onvoiceschanged", - "onvolumechange", - "onvrdisplayactivate", - "onvrdisplayconnect", - "onvrdisplaydeactivate", - "onvrdisplaydisconnect", - "onvrdisplaypresentchange", - "onwaiting", - "onwaitingforkey", - "onwarning", - "onwebkitanimationend", - "onwebkitanimationiteration", - "onwebkitanimationstart", - "onwebkitcurrentplaybacktargetiswirelesschanged", - "onwebkitfullscreenchange", - "onwebkitfullscreenerror", - "onwebkitkeyadded", - "onwebkitkeyerror", - "onwebkitkeymessage", - "onwebkitneedkey", - "onwebkitorientationchange", - "onwebkitplaybacktargetavailabilitychanged", - "onwebkitpointerlockchange", - "onwebkitpointerlockerror", - "onwebkitresourcetimingbufferfull", - "onwebkittransitionend", - "onwheel", - "onzoom", - "opacity", - "open", - "openCursor", - "openDatabase", - "openKeyCursor", - "opened", - "opener", - "opera", - "operation", - "operationType", - "operator", - "opr", - "optimum", - "options", - "or", - "order", - "orderX", - "orderY", - "ordered", - "org", - "organization", - "orient", - "orientAngle", - "orientType", - "orientation", - "orientationX", - "orientationY", - "orientationZ", - "origin", - "originalPolicy", - "originalTarget", - "orphans", - "oscpu", - "outerHTML", - "outerHeight", - "outerText", - "outerWidth", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "outlineColor", - "outlineOffset", - "outlineStyle", - "outlineWidth", - "outputBuffer", - "outputChannelCount", - "outputLatency", - "outputs", - "overflow", - "overflow-anchor", - "overflow-block", - "overflow-inline", - "overflow-wrap", - "overflow-x", - "overflow-y", - "overflowAnchor", - "overflowBlock", - "overflowInline", - "overflowWrap", - "overflowX", - "overflowY", - "overrideMimeType", - "oversample", - "overscroll-behavior", - "overscroll-behavior-block", - "overscroll-behavior-inline", - "overscroll-behavior-x", - "overscroll-behavior-y", - "overscrollBehavior", - "overscrollBehaviorBlock", - "overscrollBehaviorInline", - "overscrollBehaviorX", - "overscrollBehaviorY", - "ownKeys", - "ownerDocument", - "ownerElement", - "ownerNode", - "ownerRule", - "ownerSVGElement", - "owningElement", - "p1", - "p2", - "p3", - "p4", - "packetSize", - "packets", - "pad", - "padEnd", - "padStart", - "padding", - "padding-block", - "padding-block-end", - "padding-block-start", - "padding-bottom", - "padding-inline", - "padding-inline-end", - "padding-inline-start", - "padding-left", - "padding-right", - "padding-top", - "paddingBlock", - "paddingBlockEnd", - "paddingBlockStart", - "paddingBottom", - "paddingInline", - "paddingInlineEnd", - "paddingInlineStart", - "paddingLeft", - "paddingRight", - "paddingTop", - "page", - "page-break-after", - "page-break-before", - "page-break-inside", - "pageBreakAfter", - "pageBreakBefore", - "pageBreakInside", - "pageCount", - "pageLeft", - "pageTop", - "pageX", - "pageXOffset", - "pageY", - "pageYOffset", - "pages", - "paint-order", - "paintOrder", - "paintRequests", - "paintType", - "paintWorklet", - "palette", - "pan", - "panningModel", - "parameterData", - "parameters", - "parent", - "parentElement", - "parentNode", - "parentRule", - "parentStyleSheet", - "parentTextEdit", - "parentWindow", - "parse", - "parseAll", - "parseFloat", - "parseFromString", - "parseInt", - "part", - "participants", - "passOp", - "passive", - "password", - "pasteHTML", - "path", - "pathLength", - "pathSegList", - "pathSegType", - "pathSegTypeAsLetter", - "pathname", - "pattern", - "patternContentUnits", - "patternMismatch", - "patternTransform", - "patternUnits", - "pause", - "pauseAnimations", - "pauseOnExit", - "pauseProfilers", - "pauseTransformFeedback", - "paused", - "payerEmail", - "payerName", - "payerPhone", - "paymentManager", - "pc", - "peerIdentity", - "pending", - "pendingLocalDescription", - "pendingRemoteDescription", - "percent", - "performance", - "periodicSync", - "permission", - "permissionState", - "permissions", - "persist", - "persisted", - "personalbar", - "perspective", - "perspective-origin", - "perspectiveOrigin", - "phone", - "phoneticFamilyName", - "phoneticGivenName", - "photo", - "pictureInPictureElement", - "pictureInPictureEnabled", - "pictureInPictureWindow", - "ping", - "pipeThrough", - "pipeTo", - "pitch", - "pixelBottom", - "pixelDepth", - "pixelHeight", - "pixelLeft", - "pixelRight", - "pixelStorei", - "pixelTop", - "pixelUnitToMillimeterX", - "pixelUnitToMillimeterY", - "pixelWidth", - "place-content", - "place-items", - "place-self", - "placeContent", - "placeItems", - "placeSelf", - "placeholder", - "platform", - "platformVersion", - "platforms", - "play", - "playEffect", - "playState", - "playbackRate", - "playbackState", - "playbackTime", - "played", - "playoutDelayHint", - "playsInline", - "plugins", - "pluginspage", - "pname", - "pointer-events", - "pointerBeforeReferenceNode", - "pointerEnabled", - "pointerEvents", - "pointerId", - "pointerLockElement", - "pointerType", - "points", - "pointsAtX", - "pointsAtY", - "pointsAtZ", - "polygonOffset", - "pop", - "popDebugGroup", - "popErrorScope", - "populateMatrix", - "popupWindowFeatures", - "popupWindowName", - "popupWindowURI", - "port", - "port1", - "port2", - "ports", - "posBottom", - "posHeight", - "posLeft", - "posRight", - "posTop", - "posWidth", - "pose", - "position", - "positionAlign", - "positionX", - "positionY", - "positionZ", - "postError", - "postMessage", - "postalCode", - "poster", - "pow", - "powerEfficient", - "powerOff", - "powerPreference", - "preMultiplySelf", - "precision", - "preferredStyleSheetSet", - "preferredStylesheetSet", - "prefix", - "preload", - "premultipliedAlpha", - "prepend", - "presentation", - "preserveAlpha", - "preserveAspectRatio", - "preserveAspectRatioString", - "pressed", - "pressure", - "prevValue", - "preventDefault", - "preventExtensions", - "preventSilentAccess", - "previousElementSibling", - "previousNode", - "previousPage", - "previousRect", - "previousScale", - "previousSibling", - "previousTranslate", - "primaryKey", - "primitive", - "primitiveType", - "primitiveUnits", - "principals", - "print", - "priority", - "privateKey", - "probablySupportsContext", - "process", - "processIceMessage", - "processingEnd", - "processingStart", - "processorOptions", - "product", - "productId", - "productName", - "productSub", - "profile", - "profileEnd", - "profiles", - "projectionMatrix", - "promise", - "prompt", - "properties", - "propertyIsEnumerable", - "propertyName", - "protocol", - "protocolLong", - "prototype", - "provider", - "pseudoClass", - "pseudoElement", - "pt", - "publicId", - "publicKey", - "published", - "pulse", - "push", - "pushDebugGroup", - "pushErrorScope", - "pushManager", - "pushNotification", - "pushState", - "put", - "putImageData", - "px", - "quadraticCurveTo", - "qualifier", - "quaternion", - "query", - "queryCommandEnabled", - "queryCommandIndeterm", - "queryCommandState", - "queryCommandSupported", - "queryCommandText", - "queryCommandValue", - "querySelector", - "querySelectorAll", - "querySet", - "queue", - "queueMicrotask", - "quote", - "quotes", - "r", - "r1", - "r2", - "race", - "rad", - "radiogroup", - "radiusX", - "radiusY", - "random", - "range", - "rangeCount", - "rangeMax", - "rangeMin", - "rangeOffset", - "rangeOverflow", - "rangeParent", - "rangeUnderflow", - "rate", - "ratio", - "raw", - "rawId", - "read", - "readAsArrayBuffer", - "readAsBinaryString", - "readAsBlob", - "readAsDataURL", - "readAsText", - "readBuffer", - "readEntries", - "readOnly", - "readPixels", - "readReportRequested", - "readText", - "readValue", - "readable", - "ready", - "readyState", - "reason", - "reboot", - "receivedAlert", - "receiver", - "receivers", - "recipient", - "reconnect", - "recordNumber", - "recordsAvailable", - "recordset", - "rect", - "red", - "redEyeReduction", - "redirect", - "redirectCount", - "redirectEnd", - "redirectStart", - "redirected", - "reduce", - "reduceRight", - "reduction", - "refDistance", - "refX", - "refY", - "referenceNode", - "referenceSpace", - "referrer", - "referrerPolicy", - "refresh", - "region", - "regionAnchorX", - "regionAnchorY", - "regionId", - "regions", - "register", - "registerContentHandler", - "registerElement", - "registerProperty", - "registerProtocolHandler", - "reject", - "rel", - "relList", - "relatedAddress", - "relatedNode", - "relatedPort", - "relatedTarget", - "release", - "releaseCapture", - "releaseEvents", - "releaseInterface", - "releaseLock", - "releasePointerCapture", - "releaseShaderCompiler", - "reliable", - "reliableWrite", - "reload", - "rem", - "remainingSpace", - "remote", - "remoteDescription", - "remove", - "removeAllRanges", - "removeAttribute", - "removeAttributeNS", - "removeAttributeNode", - "removeBehavior", - "removeChild", - "removeCue", - "removeEventListener", - "removeFilter", - "removeImport", - "removeItem", - "removeListener", - "removeNamedItem", - "removeNamedItemNS", - "removeNode", - "removeParameter", - "removeProperty", - "removeRange", - "removeRegion", - "removeRule", - "removeSiteSpecificTrackingException", - "removeSourceBuffer", - "removeStream", - "removeTrack", - "removeVariable", - "removeWakeLockListener", - "removeWebWideTrackingException", - "removed", - "removedNodes", - "renderHeight", - "renderState", - "renderTime", - "renderWidth", - "renderbufferStorage", - "renderbufferStorageMultisample", - "renderedBuffer", - "renderingMode", - "renotify", - "repeat", - "replace", - "replaceAdjacentText", - "replaceAll", - "replaceChild", - "replaceChildren", - "replaceData", - "replaceId", - "replaceItem", - "replaceNode", - "replaceState", - "replaceSync", - "replaceTrack", - "replaceWholeText", - "replaceWith", - "reportValidity", - "request", - "requestAdapter", - "requestAdapterInfo", - "requestAnimationFrame", - "requestAutocomplete", - "requestData", - "requestDevice", - "requestFrame", - "requestFullscreen", - "requestHitTestSource", - "requestHitTestSourceForTransientInput", - "requestId", - "requestIdleCallback", - "requestMIDIAccess", - "requestMediaKeySystemAccess", - "requestPermission", - "requestPictureInPicture", - "requestPointerLock", - "requestPresent", - "requestReferenceSpace", - "requestSession", - "requestStart", - "requestStorageAccess", - "requestSubmit", - "requestVideoFrameCallback", - "requestingWindow", - "requireInteraction", - "required", - "requiredExtensions", - "requiredFeatures", - "requiredLimits", - "reset", - "resetPose", - "resetTransform", - "resize", - "resizeBy", - "resizeTo", - "resolve", - "resolveQuerySet", - "resolveTarget", - "resource", - "response", - "responseBody", - "responseEnd", - "responseReady", - "responseStart", - "responseText", - "responseType", - "responseURL", - "responseXML", - "restartIce", - "restore", - "result", - "resultIndex", - "resultType", - "results", - "resume", - "resumeProfilers", - "resumeTransformFeedback", - "retry", - "returnValue", - "rev", - "reverse", - "reversed", - "revocable", - "revokeObjectURL", - "rgbColor", - "right", - "rightContext", - "rightDegrees", - "rightMargin", - "rightProjectionMatrix", - "rightViewMatrix", - "role", - "rolloffFactor", - "root", - "rootBounds", - "rootElement", - "rootMargin", - "rotate", - "rotateAxisAngle", - "rotateAxisAngleSelf", - "rotateFromVector", - "rotateFromVectorSelf", - "rotateSelf", - "rotation", - "rotationAngle", - "rotationRate", - "round", - "roundRect", - "row-gap", - "rowGap", - "rowIndex", - "rowSpan", - "rows", - "rowsPerImage", - "rtcpTransport", - "rtt", - "ruby-align", - "ruby-position", - "rubyAlign", - "rubyOverhang", - "rubyPosition", - "rules", - "runtime", - "runtimeStyle", - "rx", - "ry", - "s", - "safari", - "sample", - "sampleCount", - "sampleCoverage", - "sampleRate", - "sampleType", - "sampler", - "samplerParameterf", - "samplerParameteri", - "sandbox", - "save", - "saveData", - "scale", - "scale3d", - "scale3dSelf", - "scaleNonUniform", - "scaleNonUniformSelf", - "scaleSelf", - "scheme", - "scissor", - "scope", - "scopeName", - "scoped", - "screen", - "screenBrightness", - "screenEnabled", - "screenLeft", - "screenPixelToMillimeterX", - "screenPixelToMillimeterY", - "screenTop", - "screenX", - "screenY", - "scriptURL", - "scripts", - "scroll", - "scroll-behavior", - "scroll-margin", - "scroll-margin-block", - "scroll-margin-block-end", - "scroll-margin-block-start", - "scroll-margin-bottom", - "scroll-margin-inline", - "scroll-margin-inline-end", - "scroll-margin-inline-start", - "scroll-margin-left", - "scroll-margin-right", - "scroll-margin-top", - "scroll-padding", - "scroll-padding-block", - "scroll-padding-block-end", - "scroll-padding-block-start", - "scroll-padding-bottom", - "scroll-padding-inline", - "scroll-padding-inline-end", - "scroll-padding-inline-start", - "scroll-padding-left", - "scroll-padding-right", - "scroll-padding-top", - "scroll-snap-align", - "scroll-snap-type", - "scrollAmount", - "scrollBehavior", - "scrollBy", - "scrollByLines", - "scrollByPages", - "scrollDelay", - "scrollHeight", - "scrollIntoView", - "scrollIntoViewIfNeeded", - "scrollLeft", - "scrollLeftMax", - "scrollMargin", - "scrollMarginBlock", - "scrollMarginBlockEnd", - "scrollMarginBlockStart", - "scrollMarginBottom", - "scrollMarginInline", - "scrollMarginInlineEnd", - "scrollMarginInlineStart", - "scrollMarginLeft", - "scrollMarginRight", - "scrollMarginTop", - "scrollMaxX", - "scrollMaxY", - "scrollPadding", - "scrollPaddingBlock", - "scrollPaddingBlockEnd", - "scrollPaddingBlockStart", - "scrollPaddingBottom", - "scrollPaddingInline", - "scrollPaddingInlineEnd", - "scrollPaddingInlineStart", - "scrollPaddingLeft", - "scrollPaddingRight", - "scrollPaddingTop", - "scrollRestoration", - "scrollSnapAlign", - "scrollSnapType", - "scrollTo", - "scrollTop", - "scrollTopMax", - "scrollWidth", - "scrollX", - "scrollY", - "scrollbar-color", - "scrollbar-width", - "scrollbar3dLightColor", - "scrollbarArrowColor", - "scrollbarBaseColor", - "scrollbarColor", - "scrollbarDarkShadowColor", - "scrollbarFaceColor", - "scrollbarHighlightColor", - "scrollbarShadowColor", - "scrollbarTrackColor", - "scrollbarWidth", - "scrollbars", - "scrolling", - "scrollingElement", - "sctp", - "sctpCauseCode", - "sdp", - "sdpLineNumber", - "sdpMLineIndex", - "sdpMid", - "seal", - "search", - "searchBox", - "searchBoxJavaBridge_", - "searchParams", - "sectionRowIndex", - "secureConnectionStart", - "security", - "seed", - "seekToNextFrame", - "seekable", - "seeking", - "select", - "selectAllChildren", - "selectAlternateInterface", - "selectConfiguration", - "selectNode", - "selectNodeContents", - "selectNodes", - "selectSingleNode", - "selectSubString", - "selected", - "selectedIndex", - "selectedOptions", - "selectedStyleSheetSet", - "selectedStylesheetSet", - "selection", - "selectionDirection", - "selectionEnd", - "selectionStart", - "selector", - "selectorText", - "self", - "send", - "sendAsBinary", - "sendBeacon", - "sender", - "sentAlert", - "sentTimestamp", - "separator", - "serialNumber", - "serializeToString", - "serverTiming", - "service", - "serviceWorker", - "session", - "sessionId", - "sessionStorage", - "set", - "setActionHandler", - "setActive", - "setAlpha", - "setAppBadge", - "setAttribute", - "setAttributeNS", - "setAttributeNode", - "setAttributeNodeNS", - "setBaseAndExtent", - "setBigInt64", - "setBigUint64", - "setBindGroup", - "setBingCurrentSearchDefault", - "setBlendConstant", - "setCapture", - "setCodecPreferences", - "setColor", - "setCompositeOperation", - "setConfiguration", - "setCurrentTime", - "setCustomValidity", - "setData", - "setDate", - "setDragImage", - "setEnd", - "setEndAfter", - "setEndBefore", - "setEndPoint", - "setFillColor", - "setFilterRes", - "setFloat32", - "setFloat64", - "setFloatValue", - "setFormValue", - "setFullYear", - "setHeaderValue", - "setHours", - "setIdentityProvider", - "setImmediate", - "setIndexBuffer", - "setInt16", - "setInt32", - "setInt8", - "setInterval", - "setItem", - "setKeyframes", - "setLineCap", - "setLineDash", - "setLineJoin", - "setLineWidth", - "setLiveSeekableRange", - "setLocalDescription", - "setMatrix", - "setMatrixValue", - "setMediaKeys", - "setMilliseconds", - "setMinutes", - "setMiterLimit", - "setMonth", - "setNamedItem", - "setNamedItemNS", - "setNonUserCodeExceptions", - "setOrientToAngle", - "setOrientToAuto", - "setOrientation", - "setOverrideHistoryNavigationMode", - "setPaint", - "setParameter", - "setParameters", - "setPeriodicWave", - "setPipeline", - "setPointerCapture", - "setPosition", - "setPositionState", - "setPreference", - "setProperty", - "setPrototypeOf", - "setRGBColor", - "setRGBColorICCColor", - "setRadius", - "setRangeText", - "setRemoteDescription", - "setRequestHeader", - "setResizable", - "setResourceTimingBufferSize", - "setRotate", - "setScale", - "setScissorRect", - "setSeconds", - "setSelectionRange", - "setServerCertificate", - "setShadow", - "setSinkId", - "setSkewX", - "setSkewY", - "setStart", - "setStartAfter", - "setStartBefore", - "setStdDeviation", - "setStencilReference", - "setStreams", - "setStringValue", - "setStrokeColor", - "setSuggestResult", - "setTargetAtTime", - "setTargetValueAtTime", - "setTime", - "setTimeout", - "setTransform", - "setTranslate", - "setUTCDate", - "setUTCFullYear", - "setUTCHours", - "setUTCMilliseconds", - "setUTCMinutes", - "setUTCMonth", - "setUTCSeconds", - "setUint16", - "setUint32", - "setUint8", - "setUri", - "setValidity", - "setValueAtTime", - "setValueCurveAtTime", - "setVariable", - "setVelocity", - "setVersion", - "setVertexBuffer", - "setViewport", - "setYear", - "settingName", - "settingValue", - "sex", - "shaderLocation", - "shaderSource", - "shadowBlur", - "shadowColor", - "shadowOffsetX", - "shadowOffsetY", - "shadowRoot", - "shape", - "shape-image-threshold", - "shape-margin", - "shape-outside", - "shape-rendering", - "shapeImageThreshold", - "shapeMargin", - "shapeOutside", - "shapeRendering", - "sheet", - "shift", - "shiftKey", - "shiftLeft", - "shippingAddress", - "shippingOption", - "shippingType", - "show", - "showHelp", - "showModal", - "showModalDialog", - "showModelessDialog", - "showNotification", - "sidebar", - "sign", - "signal", - "signalingState", - "signature", - "silent", - "sin", - "singleNodeValue", - "sinh", - "sinkId", - "sittingToStandingTransform", - "size", - "sizeToContent", - "sizeX", - "sizeZ", - "sizes", - "skewX", - "skewXSelf", - "skewY", - "skewYSelf", - "slice", - "slope", - "slot", - "small", - "smil", - "smooth", - "smoothingTimeConstant", - "snapToLines", - "snapshotItem", - "snapshotLength", - "some", - "sort", - "sortingCode", - "source", - "sourceBuffer", - "sourceBuffers", - "sourceCapabilities", - "sourceFile", - "sourceIndex", - "sourceMap", - "sources", - "spacing", - "span", - "speak", - "speakAs", - "speaking", - "species", - "specified", - "specularConstant", - "specularExponent", - "speechSynthesis", - "speed", - "speedOfSound", - "spellcheck", - "splice", - "split", - "splitText", - "spreadMethod", - "sqrt", - "src", - "srcElement", - "srcFactor", - "srcFilter", - "srcObject", - "srcUrn", - "srcdoc", - "srclang", - "srcset", - "stack", - "stackTraceLimit", - "stacktrace", - "stageParameters", - "standalone", - "standby", - "start", - "startContainer", - "startIce", - "startMessages", - "startNotifications", - "startOffset", - "startProfiling", - "startRendering", - "startShark", - "startTime", - "startsWith", - "state", - "status", - "statusCode", - "statusMessage", - "statusText", - "statusbar", - "stdDeviationX", - "stdDeviationY", - "stencilBack", - "stencilClearValue", - "stencilFront", - "stencilFunc", - "stencilFuncSeparate", - "stencilLoadOp", - "stencilMask", - "stencilMaskSeparate", - "stencilOp", - "stencilOpSeparate", - "stencilReadMask", - "stencilReadOnly", - "stencilStoreOp", - "stencilWriteMask", - "step", - "stepDown", - "stepMismatch", - "stepMode", - "stepUp", - "sticky", - "stitchTiles", - "stop", - "stop-color", - "stop-opacity", - "stopColor", - "stopImmediatePropagation", - "stopNotifications", - "stopOpacity", - "stopProfiling", - "stopPropagation", - "stopShark", - "stopped", - "storage", - "storageArea", - "storageName", - "storageStatus", - "storageTexture", - "store", - "storeOp", - "storeSiteSpecificTrackingException", - "storeWebWideTrackingException", - "stpVersion", - "stream", - "streams", - "stretch", - "strike", - "string", - "stringValue", - "stringify", - "stripIndexFormat", - "stroke", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "strokeDasharray", - "strokeDashoffset", - "strokeLinecap", - "strokeLinejoin", - "strokeMiterlimit", - "strokeOpacity", - "strokeRect", - "strokeStyle", - "strokeText", - "strokeWidth", - "style", - "styleFloat", - "styleMap", - "styleMedia", - "styleSheet", - "styleSheetSets", - "styleSheets", - "sub", - "subarray", - "subject", - "submit", - "submitFrame", - "submitter", - "subscribe", - "substr", - "substring", - "substringData", - "subtle", - "subtree", - "suffix", - "suffixes", - "summary", - "sup", - "supported", - "supportedContentEncodings", - "supportedEntryTypes", - "supports", - "supportsSession", - "surfaceScale", - "surroundContents", - "suspend", - "suspendRedraw", - "swapCache", - "swapNode", - "sweepFlag", - "symbols", - "sync", - "sysexEnabled", - "system", - "systemCode", - "systemId", - "systemLanguage", - "systemXDPI", - "systemYDPI", - "tBodies", - "tFoot", - "tHead", - "tabIndex", - "table", - "table-layout", - "tableLayout", - "tableValues", - "tag", - "tagName", - "tagUrn", - "tags", - "taintEnabled", - "takePhoto", - "takeRecords", - "tan", - "tangentialPressure", - "tanh", - "target", - "targetElement", - "targetRayMode", - "targetRaySpace", - "targetTouches", - "targetX", - "targetY", - "targets", - "tcpType", - "tee", - "tel", - "terminate", - "test", - "texImage2D", - "texImage3D", - "texParameterf", - "texParameteri", - "texStorage2D", - "texStorage3D", - "texSubImage2D", - "texSubImage3D", - "text", - "text-align", - "text-align-last", - "text-anchor", - "text-combine-upright", - "text-decoration", - "text-decoration-color", - "text-decoration-line", - "text-decoration-skip-ink", - "text-decoration-style", - "text-decoration-thickness", - "text-emphasis", - "text-emphasis-color", - "text-emphasis-position", - "text-emphasis-style", - "text-indent", - "text-justify", - "text-orientation", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "text-underline-offset", - "text-underline-position", - "textAlign", - "textAlignLast", - "textAnchor", - "textAutospace", - "textBaseline", - "textCombineUpright", - "textContent", - "textDecoration", - "textDecorationBlink", - "textDecorationColor", - "textDecorationLine", - "textDecorationLineThrough", - "textDecorationNone", - "textDecorationOverline", - "textDecorationSkipInk", - "textDecorationStyle", - "textDecorationThickness", - "textDecorationUnderline", - "textEmphasis", - "textEmphasisColor", - "textEmphasisPosition", - "textEmphasisStyle", - "textIndent", - "textJustify", - "textJustifyTrim", - "textKashida", - "textKashidaSpace", - "textLength", - "textOrientation", - "textOverflow", - "textRendering", - "textShadow", - "textTracks", - "textTransform", - "textUnderlineOffset", - "textUnderlinePosition", - "texture", - "then", - "threadId", - "threshold", - "thresholds", - "tiltX", - "tiltY", - "time", - "timeEnd", - "timeLog", - "timeOrigin", - "timeRemaining", - "timeStamp", - "timecode", - "timeline", - "timelineTime", - "timeout", - "timestamp", - "timestampOffset", - "timestampWrites", - "timing", - "title", - "to", - "toArray", - "toBlob", - "toDataURL", - "toDateString", - "toElement", - "toExponential", - "toFixed", - "toFloat32Array", - "toFloat64Array", - "toGMTString", - "toISOString", - "toJSON", - "toLocaleDateString", - "toLocaleFormat", - "toLocaleLowerCase", - "toLocaleString", - "toLocaleTimeString", - "toLocaleUpperCase", - "toLowerCase", - "toMatrix", - "toMethod", - "toPrecision", - "toPrimitive", - "toSdp", - "toSource", - "toStaticHTML", - "toString", - "toStringTag", - "toSum", - "toTimeString", - "toUTCString", - "toUpperCase", - "toggle", - "toggleAttribute", - "toggleLongPressEnabled", - "tone", - "toneBuffer", - "tooLong", - "tooShort", - "toolbar", - "top", - "topMargin", - "topology", - "total", - "totalFrameDelay", - "totalVideoFrames", - "touch-action", - "touchAction", - "touched", - "touches", - "trace", - "track", - "trackVisibility", - "transaction", - "transactions", - "transceiver", - "transferControlToOffscreen", - "transferFromImageBitmap", - "transferImageBitmap", - "transferIn", - "transferOut", - "transferSize", - "transferToImageBitmap", - "transform", - "transform-box", - "transform-origin", - "transform-style", - "transformBox", - "transformFeedbackVaryings", - "transformOrigin", - "transformPoint", - "transformString", - "transformStyle", - "transformToDocument", - "transformToFragment", - "transition", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "transitionDelay", - "transitionDuration", - "transitionProperty", - "transitionTimingFunction", - "translate", - "translateSelf", - "translationX", - "translationY", - "transport", - "trim", - "trimEnd", - "trimLeft", - "trimRight", - "trimStart", - "trueSpeed", - "trunc", - "truncate", - "trustedTypes", - "turn", - "twist", - "type", - "typeDetail", - "typeMismatch", - "typeMustMatch", - "types", - "u2f", - "ubound", - "uint16", - "uint32", - "uint8", - "uint8Clamped", - "unclippedDepth", - "unconfigure", - "undefined", - "unescape", - "uneval", - "unicode", - "unicode-bidi", - "unicodeBidi", - "unicodeRange", - "uniform1f", - "uniform1fv", - "uniform1i", - "uniform1iv", - "uniform1ui", - "uniform1uiv", - "uniform2f", - "uniform2fv", - "uniform2i", - "uniform2iv", - "uniform2ui", - "uniform2uiv", - "uniform3f", - "uniform3fv", - "uniform3i", - "uniform3iv", - "uniform3ui", - "uniform3uiv", - "uniform4f", - "uniform4fv", - "uniform4i", - "uniform4iv", - "uniform4ui", - "uniform4uiv", - "uniformBlockBinding", - "uniformMatrix2fv", - "uniformMatrix2x3fv", - "uniformMatrix2x4fv", - "uniformMatrix3fv", - "uniformMatrix3x2fv", - "uniformMatrix3x4fv", - "uniformMatrix4fv", - "uniformMatrix4x2fv", - "uniformMatrix4x3fv", - "unique", - "uniqueID", - "uniqueNumber", - "unit", - "unitType", - "units", - "unloadEventEnd", - "unloadEventStart", - "unlock", - "unmap", - "unmount", - "unobserve", - "unpause", - "unpauseAnimations", - "unreadCount", - "unregister", - "unregisterContentHandler", - "unregisterProtocolHandler", - "unscopables", - "unselectable", - "unshift", - "unsubscribe", - "unsuspendRedraw", - "unsuspendRedrawAll", - "unwatch", - "unwrapKey", - "upDegrees", - "upX", - "upY", - "upZ", - "update", - "updateCommands", - "updateIce", - "updateInterval", - "updatePlaybackRate", - "updateRenderState", - "updateSettings", - "updateTiming", - "updateViaCache", - "updateWith", - "updated", - "updating", - "upgrade", - "upload", - "uploadTotal", - "uploaded", - "upper", - "upperBound", - "upperOpen", - "uri", - "url", - "urn", - "urns", - "usage", - "usages", - "usb", - "usbVersionMajor", - "usbVersionMinor", - "usbVersionSubminor", - "useCurrentView", - "useMap", - "useProgram", - "usedSpace", - "user-select", - "userActivation", - "userAgent", - "userAgentData", - "userChoice", - "userHandle", - "userHint", - "userLanguage", - "userSelect", - "userVisibleOnly", - "username", - "usernameFragment", - "utterance", - "uuid", - "v8BreakIterator", - "vAlign", - "vLink", - "valid", - "validate", - "validateProgram", - "validationMessage", - "validity", - "value", - "valueAsDate", - "valueAsNumber", - "valueAsString", - "valueInSpecifiedUnits", - "valueMissing", - "valueOf", - "valueText", - "valueType", - "values", - "variable", - "variant", - "variationSettings", - "vector-effect", - "vectorEffect", - "velocityAngular", - "velocityExpansion", - "velocityX", - "velocityY", - "vendor", - "vendorId", - "vendorSub", - "verify", - "version", - "vertex", - "vertexAttrib1f", - "vertexAttrib1fv", - "vertexAttrib2f", - "vertexAttrib2fv", - "vertexAttrib3f", - "vertexAttrib3fv", - "vertexAttrib4f", - "vertexAttrib4fv", - "vertexAttribDivisor", - "vertexAttribDivisorANGLE", - "vertexAttribI4i", - "vertexAttribI4iv", - "vertexAttribI4ui", - "vertexAttribI4uiv", - "vertexAttribIPointer", - "vertexAttribPointer", - "vertical", - "vertical-align", - "verticalAlign", - "verticalOverflow", - "vh", - "vibrate", - "vibrationActuator", - "videoBitsPerSecond", - "videoHeight", - "videoTracks", - "videoWidth", - "view", - "viewBox", - "viewBoxString", - "viewDimension", - "viewFormats", - "viewTarget", - "viewTargetString", - "viewport", - "viewportAnchorX", - "viewportAnchorY", - "viewportElement", - "views", - "violatedDirective", - "visibility", - "visibilityState", - "visible", - "visualViewport", - "vlinkColor", - "vmax", - "vmin", - "voice", - "voiceURI", - "volume", - "vrml", - "vspace", - "vw", - "w", - "wait", - "waitSync", - "waiting", - "wake", - "wakeLock", - "wand", - "warn", - "wasClean", - "wasDiscarded", - "watch", - "watchAvailability", - "watchPosition", - "webdriver", - "webkitAddKey", - "webkitAlignContent", - "webkitAlignItems", - "webkitAlignSelf", - "webkitAnimation", - "webkitAnimationDelay", - "webkitAnimationDirection", - "webkitAnimationDuration", - "webkitAnimationFillMode", - "webkitAnimationIterationCount", - "webkitAnimationName", - "webkitAnimationPlayState", - "webkitAnimationTimingFunction", - "webkitAppearance", - "webkitAudioContext", - "webkitAudioDecodedByteCount", - "webkitAudioPannerNode", - "webkitBackfaceVisibility", - "webkitBackground", - "webkitBackgroundAttachment", - "webkitBackgroundClip", - "webkitBackgroundColor", - "webkitBackgroundImage", - "webkitBackgroundOrigin", - "webkitBackgroundPosition", - "webkitBackgroundPositionX", - "webkitBackgroundPositionY", - "webkitBackgroundRepeat", - "webkitBackgroundSize", - "webkitBackingStorePixelRatio", - "webkitBorderBottomLeftRadius", - "webkitBorderBottomRightRadius", - "webkitBorderImage", - "webkitBorderImageOutset", - "webkitBorderImageRepeat", - "webkitBorderImageSlice", - "webkitBorderImageSource", - "webkitBorderImageWidth", - "webkitBorderRadius", - "webkitBorderTopLeftRadius", - "webkitBorderTopRightRadius", - "webkitBoxAlign", - "webkitBoxDirection", - "webkitBoxFlex", - "webkitBoxOrdinalGroup", - "webkitBoxOrient", - "webkitBoxPack", - "webkitBoxShadow", - "webkitBoxSizing", - "webkitCancelAnimationFrame", - "webkitCancelFullScreen", - "webkitCancelKeyRequest", - "webkitCancelRequestAnimationFrame", - "webkitClearResourceTimings", - "webkitClosedCaptionsVisible", - "webkitConvertPointFromNodeToPage", - "webkitConvertPointFromPageToNode", - "webkitCreateShadowRoot", - "webkitCurrentFullScreenElement", - "webkitCurrentPlaybackTargetIsWireless", - "webkitDecodedFrameCount", - "webkitDirectionInvertedFromDevice", - "webkitDisplayingFullscreen", - "webkitDroppedFrameCount", - "webkitEnterFullScreen", - "webkitEnterFullscreen", - "webkitEntries", - "webkitExitFullScreen", - "webkitExitFullscreen", - "webkitExitPointerLock", - "webkitFilter", - "webkitFlex", - "webkitFlexBasis", - "webkitFlexDirection", - "webkitFlexFlow", - "webkitFlexGrow", - "webkitFlexShrink", - "webkitFlexWrap", - "webkitFullScreenKeyboardInputAllowed", - "webkitFullscreenElement", - "webkitFullscreenEnabled", - "webkitGenerateKeyRequest", - "webkitGetAsEntry", - "webkitGetDatabaseNames", - "webkitGetEntries", - "webkitGetEntriesByName", - "webkitGetEntriesByType", - "webkitGetFlowByName", - "webkitGetGamepads", - "webkitGetImageDataHD", - "webkitGetNamedFlows", - "webkitGetRegionFlowRanges", - "webkitGetUserMedia", - "webkitHasClosedCaptions", - "webkitHidden", - "webkitIDBCursor", - "webkitIDBDatabase", - "webkitIDBDatabaseError", - "webkitIDBDatabaseException", - "webkitIDBFactory", - "webkitIDBIndex", - "webkitIDBKeyRange", - "webkitIDBObjectStore", - "webkitIDBRequest", - "webkitIDBTransaction", - "webkitImageSmoothingEnabled", - "webkitIndexedDB", - "webkitInitMessageEvent", - "webkitIsFullScreen", - "webkitJustifyContent", - "webkitKeys", - "webkitLineClamp", - "webkitLineDashOffset", - "webkitLockOrientation", - "webkitMask", - "webkitMaskClip", - "webkitMaskComposite", - "webkitMaskImage", - "webkitMaskOrigin", - "webkitMaskPosition", - "webkitMaskPositionX", - "webkitMaskPositionY", - "webkitMaskRepeat", - "webkitMaskSize", - "webkitMatchesSelector", - "webkitMediaStream", - "webkitNotifications", - "webkitOfflineAudioContext", - "webkitOrder", - "webkitOrientation", - "webkitPeerConnection00", - "webkitPersistentStorage", - "webkitPerspective", - "webkitPerspectiveOrigin", - "webkitPointerLockElement", - "webkitPostMessage", - "webkitPreservesPitch", - "webkitPutImageDataHD", - "webkitRTCPeerConnection", - "webkitRegionOverset", - "webkitRelativePath", - "webkitRequestAnimationFrame", - "webkitRequestFileSystem", - "webkitRequestFullScreen", - "webkitRequestFullscreen", - "webkitRequestPointerLock", - "webkitResolveLocalFileSystemURL", - "webkitSetMediaKeys", - "webkitSetResourceTimingBufferSize", - "webkitShadowRoot", - "webkitShowPlaybackTargetPicker", - "webkitSlice", - "webkitSpeechGrammar", - "webkitSpeechGrammarList", - "webkitSpeechRecognition", - "webkitSpeechRecognitionError", - "webkitSpeechRecognitionEvent", - "webkitStorageInfo", - "webkitSupportsFullscreen", - "webkitTemporaryStorage", - "webkitTextFillColor", - "webkitTextSizeAdjust", - "webkitTextStroke", - "webkitTextStrokeColor", - "webkitTextStrokeWidth", - "webkitTransform", - "webkitTransformOrigin", - "webkitTransformStyle", - "webkitTransition", - "webkitTransitionDelay", - "webkitTransitionDuration", - "webkitTransitionProperty", - "webkitTransitionTimingFunction", - "webkitURL", - "webkitUnlockOrientation", - "webkitUserSelect", - "webkitVideoDecodedByteCount", - "webkitVisibilityState", - "webkitWirelessVideoPlaybackDisabled", - "webkitdirectory", - "webkitdropzone", - "webstore", - "weight", - "wgslLanguageFeatures", - "whatToShow", - "wheelDelta", - "wheelDeltaX", - "wheelDeltaY", - "whenDefined", - "which", - "white-space", - "whiteSpace", - "wholeText", - "widows", - "width", - "will-change", - "willChange", - "willValidate", - "window", - "withCredentials", - "word-break", - "word-spacing", - "word-wrap", - "wordBreak", - "wordSpacing", - "wordWrap", - "workerStart", - "wow64", - "wrap", - "wrapKey", - "writable", - "writableAuxiliaries", - "write", - "writeBuffer", - "writeMask", - "writeText", - "writeTexture", - "writeTimestamp", - "writeValue", - "writeWithoutResponse", - "writeln", - "writing-mode", - "writingMode", - "x", - "x1", - "x2", - "xChannelSelector", - "xmlEncoding", - "xmlStandalone", - "xmlVersion", - "xmlbase", - "xmllang", - "xmlspace", - "xor", - "xr", - "y", - "y1", - "y2", - "yChannelSelector", - "yandex", - "z", - "z-index", - "zIndex", - "zoom", - "zoomAndPan", - "zoomRectScreen", -]; diff --git a/node_modules/terser/tools/exit.cjs b/node_modules/terser/tools/exit.cjs deleted file mode 100644 index 46a970b..0000000 --- a/node_modules/terser/tools/exit.cjs +++ /dev/null @@ -1,7 +0,0 @@ -// workaround for tty output truncation upon process.exit() -// https://github.com/nodejs/node/issues/6456 - -[process.stdout, process.stderr].forEach((s) => { - s && s.isTTY && s._handle && s._handle.setBlocking && - s._handle.setBlocking(true) -}); diff --git a/node_modules/terser/tools/props.html b/node_modules/terser/tools/props.html deleted file mode 100644 index eeae8a6..0000000 --- a/node_modules/terser/tools/props.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - diff --git a/node_modules/terser/tools/terser.d.ts b/node_modules/terser/tools/terser.d.ts deleted file mode 100644 index 2d7ca19..0000000 --- a/node_modules/terser/tools/terser.d.ts +++ /dev/null @@ -1,216 +0,0 @@ -/// - -import { SectionedSourceMapInput, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/source-map'; - -export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020; - -export type ConsoleProperty = keyof typeof console; -type DropConsoleOption = boolean | ConsoleProperty[]; - -export interface ParseOptions { - bare_returns?: boolean; - /** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */ - ecma?: ECMA; - html5_comments?: boolean; - shebang?: boolean; -} - -export interface CompressOptions { - arguments?: boolean; - arrows?: boolean; - booleans_as_integers?: boolean; - booleans?: boolean; - collapse_vars?: boolean; - comparisons?: boolean; - computed_props?: boolean; - conditionals?: boolean; - dead_code?: boolean; - defaults?: boolean; - directives?: boolean; - drop_console?: DropConsoleOption; - drop_debugger?: boolean; - ecma?: ECMA; - evaluate?: boolean; - expression?: boolean; - global_defs?: object; - hoist_funs?: boolean; - hoist_props?: boolean; - hoist_vars?: boolean; - ie8?: boolean; - if_return?: boolean; - inline?: boolean | InlineFunctions; - join_vars?: boolean; - keep_classnames?: boolean | RegExp; - keep_fargs?: boolean; - keep_fnames?: boolean | RegExp; - keep_infinity?: boolean; - loops?: boolean; - module?: boolean; - negate_iife?: boolean; - passes?: number; - properties?: boolean; - pure_funcs?: string[]; - pure_new?: boolean; - pure_getters?: boolean | 'strict'; - reduce_funcs?: boolean; - reduce_vars?: boolean; - sequences?: boolean | number; - side_effects?: boolean; - switches?: boolean; - toplevel?: boolean; - top_retain?: null | string | string[] | RegExp; - typeofs?: boolean; - unsafe_arrows?: boolean; - unsafe?: boolean; - unsafe_comps?: boolean; - unsafe_Function?: boolean; - unsafe_math?: boolean; - unsafe_symbols?: boolean; - unsafe_methods?: boolean; - unsafe_proto?: boolean; - unsafe_regexp?: boolean; - unsafe_undefined?: boolean; - unused?: boolean; -} - -export enum InlineFunctions { - Disabled = 0, - SimpleFunctions = 1, - WithArguments = 2, - WithArgumentsAndVariables = 3 -} - -export interface MangleOptions { - eval?: boolean; - keep_classnames?: boolean | RegExp; - keep_fnames?: boolean | RegExp; - module?: boolean; - nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler; - properties?: boolean | ManglePropertiesOptions; - reserved?: string[]; - safari10?: boolean; - toplevel?: boolean; -} - -/** - * An identifier mangler for which the output is invariant with respect to the source code. - */ -export interface SimpleIdentifierMangler { - /** - * Obtains the nth most favored (usually shortest) identifier to rename a variable to. - * The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word. - * This function is expected to be stable; Evaluating get(n) === get(n) should always return true. - * @param n The ordinal of the identifier. - */ - get(n: number): string; -} - -/** - * An identifier mangler that leverages character frequency analysis to determine identifier precedence. - */ -export interface WeightedIdentifierMangler extends SimpleIdentifierMangler { - /** - * Modifies the internal weighting of the input characters by the specified delta. - * Will be invoked on the entire printed AST, and then deduct mangleable identifiers. - * @param chars The characters to modify the weighting of. - * @param delta The numeric weight to add to the characters. - */ - consider(chars: string, delta: number): number; - /** - * Resets character weights. - */ - reset(): void; - /** - * Sorts identifiers by character frequency, in preparation for calls to get(n). - */ - sort(): void; -} - -export interface ManglePropertiesOptions { - builtins?: boolean; - debug?: boolean; - keep_quoted?: boolean | 'strict'; - nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler; - regex?: RegExp | string; - reserved?: string[]; -} - -export interface FormatOptions { - ascii_only?: boolean; - /** @deprecated Not implemented anymore */ - beautify?: boolean; - braces?: boolean; - comments?: boolean | 'all' | 'some' | RegExp | ( (node: any, comment: { - value: string, - type: 'comment1' | 'comment2' | 'comment3' | 'comment4', - pos: number, - line: number, - col: number, - }) => boolean ); - ecma?: ECMA; - ie8?: boolean; - keep_numbers?: boolean; - indent_level?: number; - indent_start?: number; - inline_script?: boolean; - keep_quoted_props?: boolean; - max_line_len?: number | false; - preamble?: string; - preserve_annotations?: boolean; - quote_keys?: boolean; - quote_style?: OutputQuoteStyle; - safari10?: boolean; - semicolons?: boolean; - shebang?: boolean; - shorthand?: boolean; - source_map?: SourceMapOptions; - webkit?: boolean; - width?: number; - wrap_iife?: boolean; - wrap_func_args?: boolean; -} - -export enum OutputQuoteStyle { - PreferDouble = 0, - AlwaysSingle = 1, - AlwaysDouble = 2, - AlwaysOriginal = 3 -} - -export interface MinifyOptions { - compress?: boolean | CompressOptions; - ecma?: ECMA; - enclose?: boolean | string; - ie8?: boolean; - keep_classnames?: boolean | RegExp; - keep_fnames?: boolean | RegExp; - mangle?: boolean | MangleOptions; - module?: boolean; - nameCache?: object; - format?: FormatOptions; - /** @deprecated */ - output?: FormatOptions; - parse?: ParseOptions; - safari10?: boolean; - sourceMap?: boolean | SourceMapOptions; - toplevel?: boolean; -} - -export interface MinifyOutput { - code?: string; - map?: EncodedSourceMap | string; - decoded_map?: DecodedSourceMap | null; -} - -export interface SourceMapOptions { - /** Source map object, 'inline' or source map file content */ - content?: SectionedSourceMapInput | string; - includeSources?: boolean; - filename?: string; - root?: string; - asObject?: boolean; - url?: string | 'inline'; -} - -export function minify(files: string | string[] | { [file: string]: string }, options?: MinifyOptions): Promise; -export function minify_sync(files: string | string[] | { [file: string]: string }, options?: MinifyOptions): MinifyOutput; diff --git a/node_modules/ts-node/LICENSE b/node_modules/ts-node/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/node_modules/ts-node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/ts-node/README.md b/node_modules/ts-node/README.md deleted file mode 100644 index 63625d5..0000000 --- a/node_modules/ts-node/README.md +++ /dev/null @@ -1,1442 +0,0 @@ - - -# [![TypeScript Node](logo.svg?sanitize=true)](https://typestrong.org/ts-node) - -[![NPM version](https://img.shields.io/npm/v/ts-node.svg?style=flat)](https://npmjs.org/package/ts-node) -[![NPM downloads](https://img.shields.io/npm/dm/ts-node.svg?style=flat)](https://npmjs.org/package/ts-node) -[![Build status](https://img.shields.io/github/workflow/status/TypeStrong/ts-node/Continuous%20Integration)](https://github.com/TypeStrong/ts-node/actions?query=workflow%3A%22Continuous+Integration%22) -[![Test coverage](https://codecov.io/gh/TypeStrong/ts-node/branch/main/graph/badge.svg)](https://codecov.io/gh/TypeStrong/ts-node) - -> TypeScript execution and REPL for node.js, with source map and native ESM support. - -The latest documentation can also be found on our website: - -# Table of Contents - -* [Overview](#overview) - * [Features](#features) -* [Installation](#installation) -* [Usage](#usage) - * [Command Line](#command-line) - * [Shebang](#shebang) - * [node flags and other tools](#node-flags-and-other-tools) - * [Programmatic](#programmatic) -* [Configuration](#configuration) - * [CLI flags](#cli-flags) - * [Via tsconfig.json (recommended)](#via-tsconfigjson-recommended) - * [@tsconfig/bases](#tsconfigbases) - * [Default config](#default-config) - * [`node` flags](#node-flags) -* [Options](#options) - * [CLI Options](#cli-options) - * [help](#help) - * [version](#version) - * [eval](#eval) - * [print](#print) - * [interactive](#interactive) - * [esm](#esm) - * [TSConfig Options](#tsconfig-options) - * [project](#project) - * [skipProject](#skipproject) - * [cwdMode](#cwdmode) - * [compilerOptions](#compileroptions) - * [showConfig](#showconfig) - * [Typechecking](#typechecking) - * [transpileOnly](#transpileonly) - * [typeCheck](#typecheck) - * [compilerHost](#compilerhost) - * [files](#files) - * [ignoreDiagnostics](#ignorediagnostics) - * [Transpilation Options](#transpilation-options) - * [ignore](#ignore) - * [skipIgnore](#skipignore) - * [compiler](#compiler) - * [swc](#swc) - * [transpiler](#transpiler) - * [preferTsExts](#prefertsexts) - * [Diagnostic Options](#diagnostic-options) - * [logError](#logerror) - * [pretty](#pretty) - * [TS_NODE_DEBUG](#ts_node_debug) - * [Advanced Options](#advanced-options) - * [require](#require) - * [cwd](#cwd) - * [emit](#emit) - * [scope](#scope) - * [scopeDir](#scopedir) - * [moduleTypes](#moduletypes) - * [TS_NODE_HISTORY](#ts_node_history) - * [noExperimentalReplAwait](#noexperimentalreplawait) - * [experimentalResolver](#experimentalresolver) - * [experimentalSpecifierResolution](#experimentalspecifierresolution) - * [API Options](#api-options) -* [SWC](#swc-1) -* [CommonJS vs native ECMAScript modules](#commonjs-vs-native-ecmascript-modules) - * [CommonJS](#commonjs) - * [Native ECMAScript modules](#native-ecmascript-modules) -* [Troubleshooting](#troubleshooting) - * [Configuration](#configuration-1) - * [Common errors](#common-errors) - * [`TSError`](#tserror) - * [`SyntaxError`](#syntaxerror) - * [Unsupported JavaScript syntax](#unsupported-javascript-syntax) - * [`ERR_REQUIRE_ESM`](#err_require_esm) - * [`ERR_UNKNOWN_FILE_EXTENSION`](#err_unknown_file_extension) - * [Missing Types](#missing-types) - * [npx, yarn dlx, and node_modules](#npx-yarn-dlx-and-node_modules) -* [Performance](#performance) - * [Skip typechecking](#skip-typechecking) - * [With typechecking](#with-typechecking) -* [Advanced](#advanced) - * [How it works](#how-it-works) - * [Ignored files](#ignored-files) - * [File extensions](#file-extensions) - * [Skipping `node_modules`](#skipping-node_modules) - * [Skipping pre-compiled TypeScript](#skipping-pre-compiled-typescript) - * [Scope by directory](#scope-by-directory) - * [Ignore by regexp](#ignore-by-regexp) - * [paths and baseUrl - ](#paths-and-baseurl) - * [Why is this not built-in to ts-node?](#why-is-this-not-built-in-to-ts-node) - * [Third-party compilers](#third-party-compilers) - * [Transpilers](#transpilers) - * [Third-party plugins](#third-party-plugins) - * [Write your own plugin](#write-your-own-plugin) - * [Module type overrides](#module-type-overrides) - * [Caveats](#caveats) - * [API](#api) -* [Recipes](#recipes) - * [Watching and restarting](#watching-and-restarting) - * [AVA](#ava) - * [CommonJS](#commonjs-1) - * [Native ECMAScript modules](#native-ecmascript-modules-1) - * [Gulp](#gulp) - * [IntelliJ and Webstorm](#intellij-and-webstorm) - * [Mocha](#mocha) - * [Mocha 7 and newer](#mocha-7-and-newer) - * [Mocha <=6](#mocha-6) - * [Tape](#tape) - * [Visual Studio Code](#visual-studio-code) - * [Other](#other) -* [License](#license) - -# Overview - -ts-node is a TypeScript execution engine and REPL for Node.js. - -It JIT transforms TypeScript into JavaScript, enabling you to directly execute TypeScript on Node.js without precompiling. -This is accomplished by hooking node's module loading APIs, enabling it to be used seamlessly alongside other Node.js -tools and libraries. - -## Features - -* Automatic sourcemaps in stack traces -* Automatic `tsconfig.json` parsing -* Automatic defaults to match your node version -* Typechecking (optional) -* REPL -* Write standalone scripts -* Native ESM loader -* Use third-party transpilers -* Use custom transformers -* Integrate with test runners, debuggers, and CLI tools -* Compatible with pre-compilation for production - -![TypeScript REPL](website/static/img/screenshot.png) - -# Installation - -```shell -# Locally in your project. -npm install -D typescript -npm install -D ts-node - -# Or globally with TypeScript. -npm install -g typescript -npm install -g ts-node - -# Depending on configuration, you may also need these -npm install -D tslib @types/node -``` - -**Tip:** Installing modules locally allows you to control and share the versions through `package.json`. ts-node will always resolve the compiler from `cwd` before checking relative to its own installation. - -# Usage - -## Command Line - -```shell -# Execute a script as `node` + `tsc`. -ts-node script.ts - -# Starts a TypeScript REPL. -ts-node - -# Execute code with TypeScript. -ts-node -e 'console.log("Hello, world!")' - -# Execute, and print, code with TypeScript. -ts-node -p -e '"Hello, world!"' - -# Pipe scripts to execute with TypeScript. -echo 'console.log("Hello, world!")' | ts-node - -# Equivalent to ts-node --transpileOnly -ts-node-transpile-only script.ts - -# Equivalent to ts-node --cwdMode -ts-node-cwd script.ts - -# Equivalent to ts-node --esm -ts-node-esm script.ts -``` - -## Shebang - -To write scripts with maximum portability, [specify options in your `tsconfig.json`](#via-tsconfigjson-recommended) and omit them from the shebang. - -```typescript twoslash -#!/usr/bin/env ts-node - -// ts-node options are read from tsconfig.json - -console.log("Hello, world!") -``` - -Including options within the shebang requires the [`env -S` flag](https://manpages.debian.org/bullseye/coreutils/env.1.en.html#S), which is available on recent versions of `env`. ([compatibility](https://github.com/TypeStrong/ts-node/pull/1448#issuecomment-913895766)) - -```typescript twoslash -#!/usr/bin/env -S ts-node --files -// This shebang works on Mac and Linux with newer versions of env -// Technically, Mac allows omitting `-S`, but Linux requires it -``` - -To test your version of `env` for compatibility with `-S`: - -```shell -# Note that these unusual quotes are necessary -/usr/bin/env --debug '-S echo foo bar' -``` - -## node flags and other tools - -You can register ts-node without using our CLI: `node -r ts-node/register` and `node --loader ts-node/esm` - -In many cases, setting [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#cli_node_options_options) will enable `ts-node` within other node tools, child processes, and worker threads. This can be combined with other node flags. - -```shell -NODE_OPTIONS="-r ts-node/register --no-warnings" node ./index.ts -``` - -Or, if you require native ESM support: - -```shell -NODE_OPTIONS="--loader ts-node/esm" -``` - -This tells any node processes which receive this environment variable to install `ts-node`'s hooks before executing other code. - -If you are invoking node directly, you can avoid the environment variable and pass those flags to node. - -```shell -node --loader ts-node/esm --inspect ./index.ts -``` - -## Programmatic - -You can require ts-node and register the loader for future requires by using `require('ts-node').register({ /* options */ })`. - -Check out our [API](#api) for more features. - -# Configuration - -ts-node supports a variety of options which can be specified via `tsconfig.json`, as CLI flags, as environment variables, or programmatically. - -For a complete list, see [Options](#options). - -## CLI flags - -ts-node CLI flags must come *before* the entrypoint script. For example: - -```shell -$ ts-node --project tsconfig-dev.json say-hello.ts Ronald -Hello, Ronald! -``` - -## Via tsconfig.json (recommended) - -ts-node automatically finds and loads `tsconfig.json`. Most ts-node options can be specified in a `"ts-node"` object using their programmatic, camelCase names. We recommend this because it works even when you cannot pass CLI flags, such as `node --require ts-node/register` and when using shebangs. - -Use `--skipProject` to skip loading the `tsconfig.json`. Use `--project` to explicitly specify the path to a `tsconfig.json`. - -When searching, it is resolved using [the same search behavior as `tsc`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). By default, this search is performed relative to the entrypoint script. In `--cwdMode` or if no entrypoint is specified -- for example when using the REPL -- the search is performed relative to `--cwd` / `process.cwd()`. - -You can use this sample configuration as a starting point: - -```jsonc title="tsconfig.json" -{ - // This is an alias to @tsconfig/node16: https://github.com/tsconfig/bases - "extends": "ts-node/node16/tsconfig.json", - - // Most ts-node options can be specified here using their programmatic names. - "ts-node": { - // It is faster to skip typechecking. - // Remove if you want ts-node to do typechecking. - "transpileOnly": true, - - "files": true, - - "compilerOptions": { - // compilerOptions specified here will override those declared below, - // but *only* in ts-node. Useful if you want ts-node and tsc to use - // different options with a single tsconfig.json. - } - }, - "compilerOptions": { - // typescript options here - } -} -``` - -Our bundled [JSON schema](https://unpkg.com/browse/ts-node@latest/tsconfig.schema.json) lists all compatible options. - -### @tsconfig/bases - -[@tsconfig/bases](https://github.com/tsconfig/bases) maintains recommended configurations for several node versions. -As a convenience, these are bundled with ts-node. - -```jsonc title="tsconfig.json" -{ - "extends": "ts-node/node16/tsconfig.json", - - // Or install directly with `npm i -D @tsconfig/node16` - "extends": "@tsconfig/node16/tsconfig.json", -} -``` - -### Default config - -If no `tsconfig.json` is loaded from disk, ts-node will use the newest recommended defaults from -[@tsconfig/bases](https://github.com/tsconfig/bases/) compatible with your `node` and `typescript` versions. -With the latest `node` and `typescript`, this is [`@tsconfig/node16`](https://github.com/tsconfig/bases/blob/master/bases/node16.json). - -Older versions of `typescript` are incompatible with `@tsconfig/node16`. In those cases we will use an older default configuration. - -When in doubt, `ts-node --showConfig` will log the configuration being used, and `ts-node -vv` will log `node` and `typescript` versions. - -## `node` flags - -[`node` flags](https://nodejs.org/api/cli.html) must be passed directly to `node`; they cannot be passed to the ts-node binary nor can they be specified in `tsconfig.json` - -We recommend using the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#cli_node_options_options) environment variable to pass options to `node`. - -```shell -NODE_OPTIONS='--trace-deprecation --abort-on-uncaught-exception' ts-node ./index.ts -``` - -Alternatively, you can invoke `node` directly and install ts-node via `--require`/`-r` - -```shell -node --trace-deprecation --abort-on-uncaught-exception -r ts-node/register ./index.ts -``` - -# Options - -All command-line flags support both `--camelCase` and `--hyphen-case`. - -Most options can be declared in your tsconfig.json: [Configuration via tsconfig.json](#via-tsconfigjson-recommended) - -`ts-node` supports `--print` (`-p`), `--eval` (`-e`), `--require` (`-r`) and `--interactive` (`-i`) similar to the [node.js CLI](https://nodejs.org/api/cli.html). - -`ts-node` supports `--project` and `--showConfig` similar to the [tsc CLI](https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options). - -*Environment variables, where available, are in `ALL_CAPS`* - -## CLI Options - -### help - -```shell -ts-node --help -``` - -Prints the help text - -### version - -```shell -ts-node -v -ts-node -vvv -``` - -Prints the version. `-vv` includes node and typescript compiler versions. `-vvv` includes absolute paths to ts-node and -typescript installations. - -### eval - -```shell -ts-node -e -# Example -ts-node -e 'console.log("Hello world!")' -``` - -Evaluate code - -### print - -```shell -ts-node -p -e -# Example -ts-node -p -e '"Hello world!"' -``` - -Print result of `--eval` - -### interactive - -```shell -ts-node -i -``` - -Opens the REPL even if stdin does not appear to be a terminal - -### esm - -```shell -ts-node --esm -ts-node-esm -``` - -Bootstrap with the ESM loader, enabling full ESM support - -## TSConfig Options - -### project - -```shell -ts-node -P -ts-node --project -``` - -Path to tsconfig file. - -*Note the uppercase `-P`. This is different from `tsc`'s `-p/--project` option.* - -*Environment:* `TS_NODE_PROJECT` - -### skipProject - -```shell -ts-node --skipProject -``` - -Skip project config resolution and loading - -*Default:* `false`
-*Environment:* `TS_NODE_SKIP_PROJECT` - -### cwdMode - -```shell -ts-node -c -ts-node --cwdMode -ts-node-cwd -``` - -Resolve config relative to the current directory instead of the directory of the entrypoint script - -### compilerOptions - -```shell -ts-node -O -ts-node --compilerOptions -``` - -JSON object to merge with compiler options - -*Environment:* `TS_NODE_COMPILER_OPTIONS` - -### showConfig - -```shell -ts-node --showConfig -``` - -Print resolved `tsconfig.json`, including `ts-node` options, and exit - -## Typechecking - -### transpileOnly - -```shell -ts-node -T -ts-node --transpileOnly -``` - -Use TypeScript's faster `transpileModule` - -*Default:* `false`
-*Environment:* `TS_NODE_TRANSPILE_ONLY` - -### typeCheck - -```shell -ts-node --typeCheck -``` - -Opposite of `--transpileOnly` - -*Default:* `true`
-*Environment:* `TS_NODE_TYPE_CHECK` - -### compilerHost - -```shell -ts-node -H -ts-node --compilerHost -``` - -Use TypeScript's compiler host API - -*Default:* `false`
-*Environment:* `TS_NODE_COMPILER_HOST` - -### files - -```shell -ts-node --files -``` - -Load `files`, `include` and `exclude` from `tsconfig.json` on startup. This may -avoid certain typechecking failures. See [Missing types](#missing-types) for details. - -*Default:* `false`
-*Environment:* `TS_NODE_FILES` - -### ignoreDiagnostics - -```shell -ts-node -D -ts-node --ignoreDiagnostics -``` - -Ignore TypeScript warnings by diagnostic code - -*Environment:* `TS_NODE_IGNORE_DIAGNOSTICS` - -## Transpilation Options - -### ignore - -```shell -ts-node -I -ts-node --ignore -``` - -Override the path patterns to skip compilation - -*Default:* `/node_modules/`
-*Environment:* `TS_NODE_IGNORE` - -### skipIgnore - -```shell -ts-node --skipIgnore -``` - -Skip ignore checks - -*Default:* `false`
-*Environment:* `TS_NODE_SKIP_IGNORE` - -### compiler - -```shell -ts-node -C -ts-node --compiler -``` - -Specify a custom TypeScript compiler - -*Default:* `typescript`
-*Environment:* `TS_NODE_COMPILER` - -### swc - -```shell -ts-node --swc -``` - -Transpile with [swc](#swc). Implies `--transpileOnly` - -*Default:* `false` - -### transpiler - -```shell -ts-node --transpiler -# Example -ts-node --transpiler ts-node/transpilers/swc -``` - -Use a third-party, non-typechecking transpiler - -### preferTsExts - -```shell -ts-node --preferTsExts -``` - -Re-order file extensions so that TypeScript imports are preferred - -*Default:* `false`
-*Environment:* `TS_NODE_PREFER_TS_EXTS` - -## Diagnostic Options - -### logError - -```shell -ts-node --logError -``` - -Logs TypeScript errors to stderr instead of throwing exceptions - -*Default:* `false`
-*Environment:* `TS_NODE_LOG_ERROR` - -### pretty - -```shell -ts-node --pretty -``` - -Use pretty diagnostic formatter - -*Default:* `false`
-*Environment:* `TS_NODE_PRETTY` - -### TS_NODE_DEBUG - -```shell -TS_NODE_DEBUG=true ts-node -``` - -Enable debug logging - -## Advanced Options - -### require - -```shell -ts-node -r -ts-node --require -``` - -Require a node module before execution - -### cwd - -```shell -ts-node --cwd -``` - -Behave as if invoked in this working directory - -*Default:* `process.cwd()`
-*Environment:* `TS_NODE_CWD` - -### emit - -```shell -ts-node --emit -``` - -Emit output files into `.ts-node` directory. Requires `--compilerHost` - -*Default:* `false`
-*Environment:* `TS_NODE_EMIT` - -### scope - -```shell -ts-node --scope -``` - -Scope compiler to files within `scopeDir`. Anything outside this directory is ignored. - -*Default:* `false`
-*Environment:* `TS_NODE_SCOPE` - -### scopeDir - -```shell -ts-node --scopeDir -``` - -Directory within which compiler is limited when `scope` is enabled. - -*Default:* First of: `tsconfig.json` "rootDir" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.
-*Environment:* `TS_NODE_SCOPE_DIR` - -### moduleTypes - -Override the module type of certain files, ignoring the `package.json` `"type"` field. See [Module type overrides](#module-type-overrides) for details. - -*Default:* obeys `package.json` `"type"` and `tsconfig.json` `"module"`
-*Can only be specified via `tsconfig.json` or API.* - -### TS_NODE_HISTORY - -```shell -TS_NODE_HISTORY= ts-node -``` - -Path to history file for REPL - -*Default:* `~/.ts_node_repl_history` - -### noExperimentalReplAwait - -```shell -ts-node --noExperimentalReplAwait -``` - -Disable top-level await in REPL. Equivalent to node's [`--no-experimental-repl-await`](https://nodejs.org/api/cli.html#cli_no_experimental_repl_await) - -*Default:* Enabled if TypeScript version is 3.8 or higher and target is ES2018 or higher.
-*Environment:* `TS_NODE_EXPERIMENTAL_REPL_AWAIT` set `false` to disable - -### experimentalResolver - -Enable experimental hooks that re-map imports and require calls to support: - -* remapping extensions, e.g. so that `import "./foo.js"` will execute `foo.ts`. Currently the following extensions will be mapped: - * `.js` to `.ts`, `.tsx`, or `.jsx` - * `.cjs` to `.cts` - * `.mjs` to `.mts` - * `.jsx` to `.tsx` -* including file extensions in CommonJS, for consistency with ESM where this is often mandatory - -In the future, this hook will also support: - -* `baseUrl`, `paths` -* `rootDirs` -* `outDir` to `rootDir` mappings for composite projects and monorepos - -For details, see [#1514](https://github.com/TypeStrong/ts-node/issues/1514). - -*Default:* `false`, but will likely be enabled by default in a future version
-*Can only be specified via `tsconfig.json` or API.* - -### experimentalSpecifierResolution - -```shell -ts-node --experimentalSpecifierResolution node -``` - -Like node's [`--experimental-specifier-resolution`](https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm), but can also be set in your `tsconfig.json` for convenience. -Requires [`esm`](#esm) to be enabled. - -*Default:* `explicit`
- -## API Options - -The API includes [additional options](https://typestrong.org/ts-node/api/interfaces/RegisterOptions.html) not shown here. - -# SWC - -SWC support is built-in via the `--swc` flag or `"swc": true` tsconfig option. - -[SWC](https://swc.rs) is a TypeScript-compatible transpiler implemented in Rust. This makes it an order of magnitude faster than vanilla `transpileOnly`. - -To use it, first install `@swc/core` or `@swc/wasm`. If using `importHelpers`, also install `@swc/helpers`. If `target` is less than "es2015" and using `async`/`await` or generator functions, also install `regenerator-runtime`. - -```shell -npm i -D @swc/core @swc/helpers regenerator-runtime -``` - -Then add the following to your `tsconfig.json`. - -```jsonc title="tsconfig.json" -{ - "ts-node": { - "swc": true - } -} -``` - -> SWC uses `@swc/helpers` instead of `tslib`. If you have enabled `importHelpers`, you must also install `@swc/helpers`. - -# CommonJS vs native ECMAScript modules - -TypeScript is almost always written using modern `import` syntax, but it is also transformed before being executed by the underlying runtime. You can choose to either transform to CommonJS or to preserve the native `import` syntax, using node's native ESM support. Configuration is different for each. - -Here is a brief comparison of the two. - -| CommonJS | Native ECMAScript modules | -|---|---| -| Write native `import` syntax | Write native `import` syntax | -| Transforms `import` into `require()` | Does not transform `import` | -| Node executes scripts using the classic [CommonJS loader](https://nodejs.org/dist/latest-v16.x/docs/api/modules.html) | Node executes scripts using the new [ESM loader](https://nodejs.org/dist/latest-v16.x/docs/api/esm.html) | -| Use any of:
`ts-node`
`node -r ts-node/register`
`NODE_OPTIONS="ts-node/register" node`
`require('ts-node').register({/* options */})` | Use any of:
`ts-node --esm`
`ts-node-esm`
Set `"esm": true` in `tsconfig.json`
`node --loader ts-node/esm`
`NODE_OPTIONS="--loader ts-node/esm" node` | - -## CommonJS - -Transforming to CommonJS is typically simpler and more widely supported because it is older. You must remove [`"type": "module"`](https://nodejs.org/api/packages.html#packages_type) from `package.json` and set [`"module": "CommonJS"`](https://www.typescriptlang.org/tsconfig/#module) in `tsconfig.json`. - -```jsonc title="package.json" -{ - // This can be omitted; commonjs is the default - "type": "commonjs" -} -``` - -```jsonc title="tsconfig.json" -{ - "compilerOptions": { - "module": "CommonJS" - } -} -``` - -If you must keep `"module": "ESNext"` for `tsc`, webpack, or another build tool, you can set an override for ts-node. - -```jsonc title="tsconfig.json" -{ - "compilerOptions": { - "module": "ESNext" - }, - "ts-node": { - "compilerOptions": { - "module": "CommonJS" - } - } -} -``` - -## Native ECMAScript modules - -[Node's ESM loader hooks](https://nodejs.org/api/esm.html#esm_experimental_loaders) are [**experimental**](https://nodejs.org/api/documentation.html#documentation_stability_index) and subject to change. ts-node's ESM support is as stable as possible, but it relies on APIs which node can *and will* break in new versions of node. Thus it is not recommended for production. - -For complete usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007). - -You must set [`"type": "module"`](https://nodejs.org/api/packages.html#packages_type) in `package.json` and [`"module": "ESNext"`](https://www.typescriptlang.org/tsconfig/#module) in `tsconfig.json`. - -```jsonc title="package.json" -{ - "type": "module" -} -``` - -```jsonc title="tsconfig.json" -{ - "compilerOptions": { - "module": "ESNext" // or ES2015, ES2020 - }, - "ts-node": { - // Tell ts-node CLI to install the --loader automatically, explained below - "esm": true - } -} -``` - -You must also ensure node is passed `--loader`. The ts-node CLI will do this automatically with our `esm` option. - -> Note: `--esm` must spawn a child process to pass it `--loader`. This may change if node adds the ability to install loader hooks -> into the current process. - -```shell -# pass the flag -ts-node --esm -# Use the convenience binary -ts-node-esm -# or add `"esm": true` to your tsconfig.json to make it automatic -ts-node -``` - -If you are not using our CLI, pass the loader flag to node. - -```shell -node --loader ts-node/esm ./index.ts -# Or via environment variable -NODE_OPTIONS="--loader ts-node/esm" node ./index.ts -``` - -# Troubleshooting - -## Configuration - -ts-node uses sensible default configurations to reduce boilerplate while still respecting `tsconfig.json` if you -have one. If you are unsure which configuration is used, you can log it with `ts-node --showConfig`. This is similar to -`tsc --showConfig` but includes `"ts-node"` options as well. - -ts-node also respects your locally-installed `typescript` version, but global installations fallback to the globally-installed -`typescript`. If you are unsure which versions are used, `ts-node -vv` will log them. - -```shell -$ ts-node -vv -ts-node v10.0.0 -node v16.1.0 -compiler v4.2.2 - -$ ts-node --showConfig -{ - "compilerOptions": { - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "rootDir": "./src", - "outDir": "./.ts-node", - "module": "commonjs", - "moduleResolution": "node", - "strict": true, - "declaration": false, - "sourceMap": true, - "inlineSources": true, - "types": [ - "node" - ], - "stripInternal": true, - "incremental": true, - "skipLibCheck": true, - "importsNotUsedAsValues": "error", - "inlineSourceMap": false, - "noEmit": false - }, - "ts-node": { - "cwd": "/d/project", - "projectSearchDir": "/d/project", - "require": [], - "project": "/d/project/tsconfig.json" - } -} -``` - -## Common errors - -It is important to differentiate between errors from ts-node, errors from the TypeScript compiler, and errors from `node`. It is also important to understand when errors are caused by a type error in your code, a bug in your code, or a flaw in your configuration. - -### `TSError` - -Type errors from the compiler are thrown as a `TSError`. These are the same as errors you get from `tsc`. - -### `SyntaxError` - -Any error that is not a `TSError` is from node.js (e.g. `SyntaxError`), and cannot be fixed by TypeScript or ts-node. These are bugs in your code or configuration. - -#### Unsupported JavaScript syntax - -Your version of `node` may not support all JavaScript syntax supported by TypeScript. The compiler must transform this syntax via "downleveling," which is controlled by -the [tsconfig `"target"` option](https://www.typescriptlang.org/tsconfig#target). Otherwise your code will compile fine, but node will throw a `SyntaxError`. - -For example, `node` 12 does not understand the `?.` optional chaining operator. If you use `"target": "esnext"`, then the following TypeScript syntax: - -```typescript twoslash -const bar: string | undefined = foo?.bar; -``` - -will compile into this JavaScript: - -```javascript -const a = foo?.bar; -``` - -When you try to run this code, node 12 will throw a `SyntaxError`. To fix this, you must switch to `"target": "es2019"` or lower so TypeScript transforms `?.` into something `node` can understand. - -### `ERR_REQUIRE_ESM` - -This error is thrown by node when a module is `require()`d, but node believes it should execute as native ESM. This can happen for a few reasons: - -* You have installed an ESM dependency but your own code compiles to CommonJS. - * Solution: configure your project to compile and execute as native ESM. [Docs](#native-ecmascript-modules) - * Solution: downgrade the dependency to an older, CommonJS version. -* You have moved your project to ESM but still have a config file, such as `webpack.config.ts`, which must be executed as CommonJS - * Solution: if supported by the relevant tool, rename your config file to `.cts` - * Solution: Configure a module type override. [Docs](#module-type-overrides) -* You have a mix of CommonJS and native ESM in your project - * Solution: double-check all package.json "type" and tsconfig.json "module" configuration [Docs](#commonjs-vs-native-ecmascript-modules) - * Solution: consider simplifying by making your project entirely CommonJS or entirely native ESM - -### `ERR_UNKNOWN_FILE_EXTENSION` - -This error is thrown by node when a module has an unrecognized file extension, or no extension at all, and is being executed as native ESM. This can happen for a few reasons: - -* You are using a tool which has an extensionless binary, such as `mocha`. - * CommonJS supports extensionless files but native ESM does not. - * Solution: upgrade to ts-node >=[v10.6.0](https://github.com/TypeStrong/ts-node/releases/tag/v10.6.0), which implements a workaround. -* Our ESM loader is not installed. - * Solution: Use `ts-node-esm`, `ts-node --esm`, or add `"ts-node": {"esm": true}` to your tsconfig.json. [Docs](#native-ecmascript-modules) -* You have moved your project to ESM but still have a config file, such as `webpack.config.ts`, which must be executed as CommonJS - * Solution: if supported by the relevant tool, rename your config file to `.cts` - * Solution: Configure a module type override. [Docs](#module-type-overrides) - -## Missing Types - -ts-node does *not* eagerly load `files`, `include` or `exclude` by default. This is because a large majority of projects do not use all of the files in a project directory (e.g. `Gulpfile.ts`, runtime vs tests) and parsing every file for types slows startup time. Instead, ts-node starts with the script file (e.g. `ts-node index.ts`) and TypeScript resolves dependencies based on imports and references. - -Occasionally, this optimization leads to missing types. Fortunately, there are other ways to include them in typechecking. - -For global definitions, you can use the `typeRoots` compiler option. This requires that your type definitions be structured as type packages (not loose TypeScript definition files). More details on how this works can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types). - -Example `tsconfig.json`: - -```jsonc -{ - "compilerOptions": { - "typeRoots" : ["./node_modules/@types", "./typings"] - } -} -``` - -Example project structure: - -```text -/ --- tsconfig.json --- typings/ - -- / - -- index.d.ts -``` - -Example module declaration file: - -```typescript twoslash -declare module '' { - // module definitions go here -} -``` - -For module definitions, you can use [`paths`](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping): - -```jsonc title="tsconfig.json" -{ - "compilerOptions": { - "baseUrl": ".", - "paths": { - "custom-module-type": ["types/custom-module-type"] - } - } -} -``` - -Another option is [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). This may be helpful if you prefer not to change your `compilerOptions` or structure your type definitions for `typeRoots`. Below is an example of a triple-slash directive as a relative path within your project: - -```typescript twoslash -/// -import {Greeter} from "lib_greeter" -const g = new Greeter(); -g.sayHello(); -``` - -If none of the above work, and you *must* use `files`, `include`, or `exclude`, enable our [`files`](#files) option. - -## npx, yarn dlx, and node_modules - -When executing TypeScript with `npx` or `yarn dlx`, the code resides within a temporary `node_modules` directory. - -The contents of `node_modules` are ignored by default. If execution fails, enable [`skipIgnore`](#skipignore). - - - -# Performance - -These tricks will make ts-node faster. - -## Skip typechecking - -It is often better to typecheck as part of your tests or linting. You can run `tsc --noEmit` to do this. In these cases, ts-node can skip typechecking, making it much faster. - -To skip typechecking in ts-node, do one of the following: - -* Enable [swc](#swc) - * This is by far the fastest option -* Enable [`transpileOnly`](#transpileonly) to skip typechecking without swc - -## With typechecking - -If you absolutely must typecheck in ts-node: - -* Avoid dynamic `require()` which may trigger repeated typechecking; prefer `import` -* Try with and without `--files`; one may be faster depending on your project -* Check `tsc --showConfig`; make sure all executed files are included -* Enable [`skipLibCheck`](https://www.typescriptlang.org/tsconfig#skipLibCheck) -* Set a [`types`](https://www.typescriptlang.org/tsconfig#types) array to avoid loading unnecessary `@types` - -# Advanced - -## How it works - -ts-node works by registering hooks for `.ts`, `.tsx`, `.js`, and/or `.jsx` extensions. - -Vanilla `node` loads `.js` by reading code from disk and executing it. Our hook runs in the middle, transforming code from TypeScript to JavaScript and passing the result to `node` for execution. This transformation will respect your `tsconfig.json` as if you had compiled via `tsc`. - -We also register a few other hooks to apply sourcemaps to stack traces and remap from `.js` imports to `.ts`. - -## Ignored files - -ts-node transforms certain files and ignores others. We refer to this mechanism as "scoping." There are various -options to configure scoping, so that ts-node transforms only the files in your project. - -> **Warning:** -> -> An ignored file can still be executed by node.js. Ignoring a file means we do not transform it from TypeScript into JavaScript, but it does not prevent execution. -> -> If a file requires transformation but is ignored, node may either fail to resolve it or attempt to execute it as vanilla JavaScript. This may cause syntax errors or other failures, because node does not understand TypeScript type syntax nor bleeding-edge ECMAScript features. - -### File extensions - -`.js` and `.jsx` are only transformed when [`allowJs`](https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options) is enabled. - -`.tsx` and `.jsx` are only transformed when [`jsx`](https://www.typescriptlang.org/docs/handbook/jsx.html) is enabled. - -> **Warning:** -> -> When ts-node is used with `allowJs`, *all* non-ignored JavaScript files are transformed by ts-node. - -### Skipping `node_modules` - -By default, ts-node avoids compiling files in `/node_modules/` for three reasons: - -1. Modules should always be published in a format node.js can consume -2. Transpiling the entire dependency tree will make your project slower -3. Differing behaviours between TypeScript and node.js (e.g. ES2015 modules) can result in a project that works until you decide to support a feature natively from node.js - -If you need to import uncompiled TypeScript in `node_modules`, use [`--skipIgnore`](#skipignore) or [`TS_NODE_SKIP_IGNORE`](#skipignore) to bypass this restriction. - -### Skipping pre-compiled TypeScript - -If a compiled JavaScript file with the same name as a TypeScript file already exists, the TypeScript file will be ignored. ts-node will import the pre-compiled JavaScript. - -To force ts-node to import the TypeScript source, not the precompiled JavaScript, use [`--preferTsExts`](#prefertsexts). - -### Scope by directory - -Our [`scope`](#scope) and [`scopeDir`](#scopedir) options will limit transformation to files -within a directory. - -### Ignore by regexp - -Our [`ignore`](#ignore) option will ignore files matching one or more regular expressions. - -## paths and baseUrl - -You can use ts-node together with [tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) to load modules according to the `paths` section in `tsconfig.json`. - -```jsonc title="tsconfig.json" -{ - "ts-node": { - // Do not forget to `npm i -D tsconfig-paths` - "require": ["tsconfig-paths/register"] - } -} -``` - -### Why is this not built-in to ts-node? - -The official TypeScript Handbook explains the intended purpose for `"paths"` in ["Additional module resolution flags"](https://www.typescriptlang.org/docs/handbook/module-resolution.html#additional-module-resolution-flags). - -> The TypeScript compiler has a set of additional flags to *inform* the compiler of transformations that are expected to happen to the sources to generate the final output. -> -> It is important to note that the compiler will not perform any of these transformations; it just uses these pieces of information to guide the process of resolving a module import to its definition file. - -This means `"paths"` are intended to describe mappings that the build tool or runtime *already* performs, not to tell the build tool or -runtime how to resolve modules. In other words, they intend us to write our imports in a way `node` already understands. For this reason, ts-node does not modify `node`'s module resolution behavior to implement `"paths"` mappings. - -## Third-party compilers - -Some projects require a patched typescript compiler which adds additional features. For example, [`ttypescript`](https://github.com/cevek/ttypescript/tree/master/packages/ttypescript) and [`ts-patch`](https://github.com/nonara/ts-patch#readme) -add the ability to configure custom transformers. These are drop-in replacements for the vanilla `typescript` module and -implement the same API. - -For example, to use `ttypescript` and `ts-transformer-keys`, add this to your `tsconfig.json`: - -```jsonc title="tsconfig.json" -{ - "ts-node": { - // This can be omitted when using ts-patch - "compiler": "ttypescript" - }, - "compilerOptions": { - // plugin configuration is the same for both ts-patch and ttypescript - "plugins": [ - { "transform": "ts-transformer-keys/transformer" } - ] - } -} -``` - -## Transpilers - -ts-node supports third-party transpilers as plugins. Transpilers such as swc can transform TypeScript into JavaScript -much faster than the TypeScript compiler. You will still benefit from ts-node's automatic `tsconfig.json` discovery, -sourcemap support, and global ts-node CLI. Plugins automatically derive an appropriate configuration from your existing -`tsconfig.json` which simplifies project boilerplate. - -> **What is the difference between a compiler and a transpiler?** -> -> For our purposes, a compiler implements TypeScript's API and can perform typechecking. -> A third-party transpiler does not. Both transform TypeScript into JavaScript. - -### Third-party plugins - -The `transpiler` option allows using third-party transpiler plugins with ts-node. `transpiler` must be given the -name of a module which can be `require()`d. The built-in `swc` plugin is exposed as `ts-node/transpilers/swc`. - -For example, to use a hypothetical "@cspotcode/fast-ts-compiler", first install it into your project: `npm install @cspotcode/fast-ts-compiler` - -Then add the following to your tsconfig: - -```jsonc title="tsconfig.json" -{ - "ts-node": { - "transpileOnly": true, - "transpiler": "@cspotcode/fast-ts-compiler" - } -} -``` - -### Write your own plugin - -To write your own transpiler plugin, check our [API docs](https://typestrong.org/ts-node/api/interfaces/TranspilerModule.html). - -Plugins are `require()`d by ts-node, so they can be a local script or a node module published to npm. The module must -export a `create` function described by our -[`TranspilerModule`](https://typestrong.org/ts-node/api/interfaces/TranspilerModule.html) interface. `create` is -invoked by ts-node at startup to create one or more transpiler instances. The instances are used to transform -TypeScript into JavaScript. - -For a working example, check out out our bundled swc plugin: https://github.com/TypeStrong/ts-node/blob/main/src/transpilers/swc.ts - -## Module type overrides - -> Wherever possible, it is recommended to use TypeScript's [`NodeNext` or `Node16` mode](https://www.typescriptlang.org/docs/handbook/esm-node.html) instead of the options described -> in this section. Setting `"module": "NodeNext"` and using the `.cts` file extension should work well for most projects. - -When deciding how a file should be compiled and executed -- as either CommonJS or native ECMAScript module -- ts-node matches -`node` and `tsc` behavior. This means TypeScript files are transformed according to your `tsconfig.json` `"module"` -option and executed according to node's rules for the `package.json` `"type"` field. Set `"module": "NodeNext"` and everything should work. - -In rare cases, you may need to override this behavior for some files. For example, some tools read a `name-of-tool.config.ts` -and require that file to execute as CommonJS. If you have `package.json` configured with `"type": "module"` and `tsconfig.json` with -`"module": "esnext"`, the config is native ECMAScript by default and will raise an error. You will need to force the config and -any supporting scripts to execute as CommonJS. - -In these situations, our `moduleTypes` option can override certain files to be -CommonJS or ESM. Similar overriding is possible by using `.mts`, `.cts`, `.cjs` and `.mjs` file extensions. -`moduleTypes` achieves the same effect for `.ts` and `.js` files, and *also* overrides your `tsconfig.json` `"module"` -config appropriately. - -The following example tells ts-node to execute a webpack config as CommonJS: - -```jsonc title="tsconfig.json" -{ - "ts-node": { - "transpileOnly": true, - "moduleTypes": { - "webpack.config.ts": "cjs", - // Globs are also supported with the same behavior as tsconfig "include" - "webpack-config-scripts/**/*": "cjs" - } - }, - "compilerOptions": { - "module": "es2020", - "target": "es2020" - } -} -``` - -Each key is a glob pattern with the same syntax as tsconfig's `"include"` array. -When multiple patterns match the same file, the last pattern takes precedence. - -* `cjs` overrides matches files to compile and execute as CommonJS. -* `esm` overrides matches files to compile and execute as native ECMAScript modules. -* `package` resets either of the above to default behavior, which obeys `package.json` `"type"` and `tsconfig.json` `"module"` options. - -### Caveats - -Files with an overridden module type are transformed with the same limitations as [`isolatedModules`](https://www.typescriptlang.org/tsconfig#isolatedModules). This will only affect rare cases such as using `const enum`s with [`preserveConstEnums`](https://www.typescriptlang.org/tsconfig#preserveConstEnums) disabled. - -This feature is meant to facilitate scenarios where normal `compilerOptions` and `package.json` configuration is not possible. For example, a `webpack.config.ts` cannot be given its own `package.json` to override `"type"`. Wherever possible you should favor using traditional `package.json` and `tsconfig.json` configurations. - -## API - -ts-node's complete API is documented here: [API Docs](https://typestrong.org/ts-node/api/) - -Here are a few highlights of what you can accomplish: - -* [`create()`](https://typestrong.org/ts-node/api/index.html#create) creates ts-node's compiler service without - registering any hooks. -* [`createRepl()`](https://typestrong.org/ts-node/api/index.html#createRepl) creates an instance of our REPL service, so - you can create your own TypeScript-powered REPLs. -* [`createEsmHooks()`](https://typestrong.org/ts-node/api/index.html#createEsmHooks) creates our ESM loader hooks, - suitable for composing with other loaders or augmenting with additional features. - -# Recipes - -## Watching and restarting - -ts-node focuses on adding first-class TypeScript support to node. Watching files and code reloads are out of scope for the project. - -If you want to restart the `ts-node` process on file change, existing node.js tools such as [nodemon](https://github.com/remy/nodemon), [onchange](https://github.com/Qard/onchange) and [node-dev](https://github.com/fgnass/node-dev) work. - -There's also [`ts-node-dev`](https://github.com/whitecolor/ts-node-dev), a modified version of [`node-dev`](https://github.com/fgnass/node-dev) using `ts-node` for compilation that will restart the process on file change. Note that `ts-node-dev` is incompatible with our native ESM loader. - -## AVA - -Assuming you are configuring AVA via your `package.json`, add one of the following configurations. - -### CommonJS - -Use this configuration if your `package.json` does not have `"type": "module"`. - -```jsonc title="package.json" -{ - "ava": { - "extensions": [ - "ts" - ], - "require": [ - "ts-node/register" - ] - } -} -``` - -### Native ECMAScript modules - -This configuration is necessary if your `package.json` has `"type": "module"`. - -```jsonc title="package.json" -{ - "ava": { - "extensions": { - "ts": "module" - }, - "nonSemVerExperiments": { - "configurableModuleFormat": true - }, - "nodeArguments": [ - "--loader=ts-node/esm" - ] - } -} -``` - -## Gulp - -ts-node support is built-in to gulp. - -```sh -# Create a `gulpfile.ts` and run `gulp`. -gulp -``` - -See also: https://gulpjs.com/docs/en/getting-started/javascript-and-gulpfiles#transpilation - -## IntelliJ and Webstorm - -Create a new Node.js configuration and add `-r ts-node/register` to "Node parameters." - -**Note:** If you are using the `--project ` command line argument as per the [Configuration Options](#configuration), and want to apply this same behavior when launching in IntelliJ, specify under "Environment Variables": `TS_NODE_PROJECT=`. - -## Mocha - -### Mocha 7 and newer - -```shell -mocha --require ts-node/register --extensions ts,tsx --watch --watch-files src 'tests/**/*.{ts,tsx}' [...args] -``` - -Or specify options via your mocha config file. - -```jsonc title=".mocharc.json" -{ - // Specify "require" for CommonJS - "require": "ts-node/register", - // Specify "loader" for native ESM - "loader": "ts-node/esm", - "extensions": ["ts", "tsx"], - "spec": [ - "tests/**/*.spec.*" - ], - "watch-files": [ - "src" - ] -} -``` - -See also: https://mochajs.org/#configuring-mocha-nodejs - -### Mocha <=6 - -```shell -mocha --require ts-node/register --watch-extensions ts,tsx "test/**/*.{ts,tsx}" [...args] -``` - -**Note:** `--watch-extensions` is only used in `--watch` mode. - -## Tape - -```shell -ts-node node_modules/tape/bin/tape [...args] -``` - -## Visual Studio Code - -Create a new Node.js debug configuration, add `-r ts-node/register` to node args and move the `program` to the `args` list (so VS Code doesn't look for `outFiles`). - -```jsonc title=".vscode/launch.json" -{ - "configurations": [{ - "type": "node", - "request": "launch", - "name": "Launch Program", - "runtimeArgs": [ - "-r", - "ts-node/register" - ], - "args": [ - "${workspaceFolder}/src/index.ts" - ] - }], -} -``` - -**Note:** If you are using the `--project ` command line argument as per the [Configuration Options](#configuration), and want to apply this same behavior when launching in VS Code, add an "env" key into the launch configuration: `"env": { "TS_NODE_PROJECT": "" }`. - -## Other - -In many cases, setting [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#cli_node_options_options) will enable `ts-node` within other node tools, child processes, and worker threads. - -```shell -NODE_OPTIONS="-r ts-node/register" -``` - -Or, if you require native ESM support: - -```shell -NODE_OPTIONS="--loader ts-node/esm" -``` - -This tells any node processes which receive this environment variable to install `ts-node`'s hooks before executing other code. - -# License - -ts-node is licensed under the MIT license. [MIT](https://github.com/TypeStrong/ts-node/blob/main/LICENSE) - -ts-node includes source code from Node.js which is licensed under the MIT license. [Node.js license information](https://raw.githubusercontent.com/nodejs/node/master/LICENSE) - -ts-node includes source code from the TypeScript compiler which is licensed under the Apache License 2.0. [TypeScript license information](https://github.com/microsoft/TypeScript/blob/master/LICENSE.txt) diff --git a/node_modules/ts-node/child-loader.mjs b/node_modules/ts-node/child-loader.mjs deleted file mode 100644 index 6ef592a..0000000 --- a/node_modules/ts-node/child-loader.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { fileURLToPath } from 'url'; -import { createRequire } from 'module'; -const require = createRequire(fileURLToPath(import.meta.url)); - -// TODO why use require() here? I think we can just `import` -/** @type {import('./dist/child-loader')} */ -const childLoader = require('./dist/child/child-loader'); -export const { resolve, load, getFormat, transformSource } = childLoader; diff --git a/node_modules/ts-node/dist-raw/NODE-LICENSE.md b/node_modules/ts-node/dist-raw/NODE-LICENSE.md deleted file mode 100644 index c1de8e9..0000000 --- a/node_modules/ts-node/dist-raw/NODE-LICENSE.md +++ /dev/null @@ -1,24 +0,0 @@ -This directory contains portions of Node.js source code which is licensed as follows: - ---- - -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ts-node/dist-raw/README.md b/node_modules/ts-node/dist-raw/README.md deleted file mode 100644 index 9eeaed3..0000000 --- a/node_modules/ts-node/dist-raw/README.md +++ /dev/null @@ -1,36 +0,0 @@ -The `dist-raw` directory contains JS sources that are distributed verbatim, not compiled nor typechecked via TS. - -To implement ESM support, we unfortunately must duplicate some of node's built-in functionality that is not -exposed via an API. We have copy-pasted the necessary code from https://github.com/nodejs/node/tree/master/lib -then modified it to suite our needs. - -Formatting may be intentionally bad to keep the diff as small as possible, to make it easier to merge -upstream changes and understand our modifications. For example, when we need to wrap node's source code -in a factory function, we will not indent the function body, to avoid whitespace changes in the diff. - -One obvious problem with this approach: the code has been pulled from one version of node, whereas users of ts-node -run multiple versions of node. -Users running node 12 may see that ts-node behaves like node 14, for example. - -## `raw` directory - -Within the `raw` directory, we keep unmodified copies of the node source files. This allows us to use diffing tools to -compare files in `raw` to those in `dist-raw`, which will highlight all of the changes we have made. Hopefully, these -changes are as minimal as possible. - -## Naming convention - -Not used consistently, but the idea is: - -`node-(...-)-.js` - -`node-internal-errors.js` -> `github.com/nodejs/node/blob/TAG/lib/internal/errors.js` - -So, take the path within node's `lib/` directory, and replace slashes with hyphens. - -In the `raw` directory, files are suffixed with the version number or revision from which -they were downloaded. - -If they have a `stripped` suffix, this means they have large chunks of code deleted, but no other modifications. -This is useful when diffing. Sometimes our `dist-raw` files only have a small part of a much larger node source file. -It is easier to diff `raw/*-stripped.js` against `dist-raw/*.js`. diff --git a/node_modules/ts-node/dist-raw/node-internal-constants.js b/node_modules/ts-node/dist-raw/node-internal-constants.js deleted file mode 100644 index b4aa7aa..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-constants.js +++ /dev/null @@ -1,4 +0,0 @@ -// Copied from https://github.com/nodejs/node/blob/master/lib/internal/constants.js -module.exports = { - CHAR_FORWARD_SLASH: 47, /* / */ -}; diff --git a/node_modules/ts-node/dist-raw/node-internal-errors.js b/node_modules/ts-node/dist-raw/node-internal-errors.js deleted file mode 100644 index ddcd661..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-errors.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -const path = require('path'); - -exports.codes = { - ERR_INPUT_TYPE_NOT_ALLOWED: createErrorCtor(joinArgs('ERR_INPUT_TYPE_NOT_ALLOWED')), - ERR_INVALID_ARG_VALUE: createErrorCtor(joinArgs('ERR_INVALID_ARG_VALUE')), - ERR_INVALID_MODULE_SPECIFIER: createErrorCtor(joinArgs('ERR_INVALID_MODULE_SPECIFIER')), - ERR_INVALID_PACKAGE_CONFIG: createErrorCtor(joinArgs('ERR_INVALID_PACKAGE_CONFIG')), - ERR_INVALID_PACKAGE_TARGET: createErrorCtor(joinArgs('ERR_INVALID_PACKAGE_TARGET')), - ERR_MANIFEST_DEPENDENCY_MISSING: createErrorCtor(joinArgs('ERR_MANIFEST_DEPENDENCY_MISSING')), - ERR_MODULE_NOT_FOUND: createErrorCtor((path, base, type = 'package') => { - return `Cannot find ${type} '${path}' imported from ${base}` - }), - ERR_PACKAGE_IMPORT_NOT_DEFINED: createErrorCtor(joinArgs('ERR_PACKAGE_IMPORT_NOT_DEFINED')), - ERR_PACKAGE_PATH_NOT_EXPORTED: createErrorCtor(joinArgs('ERR_PACKAGE_PATH_NOT_EXPORTED')), - ERR_UNSUPPORTED_DIR_IMPORT: createErrorCtor(joinArgs('ERR_UNSUPPORTED_DIR_IMPORT')), - ERR_UNSUPPORTED_ESM_URL_SCHEME: createErrorCtor(joinArgs('ERR_UNSUPPORTED_ESM_URL_SCHEME')), - ERR_UNKNOWN_FILE_EXTENSION: createErrorCtor(joinArgs('ERR_UNKNOWN_FILE_EXTENSION')), -} - -function joinArgs(name) { - return (...args) => { - return [name, ...args].join(' ') - } -} - -function createErrorCtor(errorMessageCreator) { - return class CustomError extends Error { - constructor(...args) { - super(errorMessageCreator(...args)) - } - } -} -exports.createErrRequireEsm = createErrRequireEsm; - -// Native ERR_REQUIRE_ESM Error is declared here: -// https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/errors.js#L1294-L1313 -// Error class factory is implemented here: -// function E: https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/errors.js#L323-L341 -// function makeNodeErrorWithCode: https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/errors.js#L251-L278 -// The code below should create an error that matches the native error as closely as possible. -// Third-party libraries which attempt to catch the native ERR_REQUIRE_ESM should recognize our imitation error. -function createErrRequireEsm(filename, parentPath, packageJsonPath) { - const code = 'ERR_REQUIRE_ESM' - const err = new Error(getErrRequireEsmMessage(filename, parentPath, packageJsonPath)) - // Set `name` to be used in stack trace, generate stack trace with that name baked in, then re-declare the `name` field. - // This trick is copied from node's source. - err.name = `Error [${ code }]` - err.stack - Object.defineProperty(err, 'name', { - value: 'Error', - enumerable: false, - writable: true, - configurable: true - }) - err.code = code - return err -} - -// Copy-pasted from https://github.com/nodejs/node/blob/b533fb3508009e5f567cc776daba8fbf665386a6/lib/internal/errors.js#L1293-L1311 -// so that our error message is identical to the native message. -function getErrRequireEsmMessage(filename, parentPath = null, packageJsonPath = null) { - const ext = path.extname(filename) - let msg = `Must use import to load ES Module: ${filename}`; - if (parentPath && packageJsonPath) { - const path = require('path'); - const basename = path.basename(filename) === path.basename(parentPath) ? - filename : path.basename(filename); - msg += - '\nrequire() of ES modules is not supported.\nrequire() of ' + - `${filename} ${parentPath ? `from ${parentPath} ` : ''}` + - `is an ES module file as it is a ${ext} file whose nearest parent ` + - `package.json contains "type": "module" which defines all ${ext} ` + - 'files in that package scope as ES modules.\nInstead ' + - 'change the requiring code to use ' + - 'import(), or remove "type": "module" from ' + - `${packageJsonPath}.\n`; - return msg; - } - return msg; -} diff --git a/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js b/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js deleted file mode 100644 index bd4f702..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copied from https://github.com/nodejs/node/blob/v17.0.1/lib/internal/modules/cjs/helpers.js - -'use strict'; - -const { - ArrayPrototypeForEach, - ObjectDefineProperty, - ObjectPrototypeHasOwnProperty, - SafeSet, - StringPrototypeIncludes, - StringPrototypeStartsWith, -} = require('./node-primordials'); - -const { getOptionValue } = require('./node-options'); -const userConditions = getOptionValue('--conditions'); - -const noAddons = getOptionValue('--no-addons'); -const addonConditions = noAddons ? [] : ['node-addons']; - -// TODO: Use this set when resolving pkg#exports conditions in loader.js. -const cjsConditions = new SafeSet([ - 'require', - 'node', - ...addonConditions, - ...userConditions, -]); - -/** - * @param {any} object - * @param {string} [dummyModuleName] - * @return {void} - */ -function addBuiltinLibsToObject(object, dummyModuleName) { - // Make built-in modules available directly (loaded lazily). - const Module = require('module').Module; - const { builtinModules } = Module; - - // To require built-in modules in user-land and ignore modules whose - // `canBeRequiredByUsers` is false. So we create a dummy module object and not - // use `require()` directly. - const dummyModule = new Module(dummyModuleName); - - ArrayPrototypeForEach(builtinModules, (name) => { - // Neither add underscored modules, nor ones that contain slashes (e.g., - // 'fs/promises') or ones that are already defined. - if (StringPrototypeStartsWith(name, '_') || - StringPrototypeIncludes(name, '/') || - ObjectPrototypeHasOwnProperty(object, name)) { - return; - } - // Goals of this mechanism are: - // - Lazy loading of built-in modules - // - Having all built-in modules available as non-enumerable properties - // - Allowing the user to re-assign these variables as if there were no - // pre-existing globals with the same name. - - const setReal = (val) => { - // Deleting the property before re-assigning it disables the - // getter/setter mechanism. - delete object[name]; - object[name] = val; - }; - - ObjectDefineProperty(object, name, { - get: () => { - // Node 12 hack; remove when we drop node12 support - const lib = (dummyModule.require || require)(name); - - // Disable the current getter/setter and set up a new - // non-enumerable property. - delete object[name]; - ObjectDefineProperty(object, name, { - get: () => lib, - set: setReal, - configurable: true, - enumerable: false - }); - - return lib; - }, - set: setReal, - configurable: true, - enumerable: false - }); - }); -} - -exports.addBuiltinLibsToObject = addBuiltinLibsToObject; -exports.cjsConditions = cjsConditions; diff --git a/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js b/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js deleted file mode 100644 index cb83c35..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +++ /dev/null @@ -1,593 +0,0 @@ -// Copied from several files in node's source code. -// https://github.com/nodejs/node/blob/2d5d77306f6dff9110c1f77fefab25f973415770/lib/internal/modules/cjs/loader.js -// Each function and variable below must have a comment linking to the source in node's github repo. - -'use strict'; - -const { - ArrayIsArray, - ArrayPrototypeIncludes, - ArrayPrototypeJoin, - ArrayPrototypePush, - JSONParse, - ObjectKeys, - RegExpPrototypeTest, - SafeMap, - SafeWeakMap, - StringPrototypeCharCodeAt, - StringPrototypeEndsWith, - StringPrototypeLastIndexOf, - StringPrototypeIndexOf, - StringPrototypeMatch, - StringPrototypeSlice, - StringPrototypeStartsWith, -} = require('./node-primordials'); -const { NativeModule } = require('./node-nativemodule'); -const { pathToFileURL, fileURLToPath } = require('url'); -const fs = require('fs'); -const path = require('path'); -const { sep } = path; -const { internalModuleStat } = require('./node-internalBinding-fs'); -const packageJsonReader = require('./node-internal-modules-package_json_reader'); -const { - cjsConditions, -} = require('./node-internal-modules-cjs-helpers'); -const { getOptionValue } = require('./node-options'); -const preserveSymlinks = getOptionValue('--preserve-symlinks'); -const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); -const {normalizeSlashes} = require('../dist/util'); -const {createErrRequireEsm} = require('./node-internal-errors'); -const { - codes: { - ERR_INVALID_MODULE_SPECIFIER, - }, -} = require('./node-internal-errors'); - -const { - CHAR_FORWARD_SLASH, -} = require('./node-internal-constants'); - -const Module = require('module'); - -const isWindows = process.platform === 'win32'; - -let statCache = null; - -function stat(filename) { - filename = path.toNamespacedPath(filename); - if (statCache !== null) { - const result = statCache.get(filename); - if (result !== undefined) return result; - } - const result = internalModuleStat(filename); - if (statCache !== null && result >= 0) { - // Only set cache when `internalModuleStat(filename)` succeeds. - statCache.set(filename, result); - } - return result; -} - -// Note: -// we cannot get access to node's internal cache, which is populated from -// within node's Module constructor. So the cache here will always be empty. -// It's possible we could approximate our own cache by building it up with -// hacky workarounds, but it's not worth the complexity and flakiness. -const moduleParentCache = new SafeWeakMap(); - -// Given a module name, and a list of paths to test, returns the first -// matching file in the following precedence. -// -// require("a.") -// -> a. -// -// require("a") -// -> a -// -> a. -// -> a/index. - -const packageJsonCache = new SafeMap(); - -function readPackage(requestPath) { - const jsonPath = path.resolve(requestPath, 'package.json'); - - const existing = packageJsonCache.get(jsonPath); - if (existing !== undefined) return existing; - - const result = packageJsonReader.read(jsonPath); - const json = result.containsKeys === false ? '{}' : result.string; - if (json === undefined) { - packageJsonCache.set(jsonPath, false); - return false; - } - - try { - const parsed = JSONParse(json); - const filtered = { - name: parsed.name, - main: parsed.main, - exports: parsed.exports, - imports: parsed.imports, - type: parsed.type - }; - packageJsonCache.set(jsonPath, filtered); - return filtered; - } catch (e) { - e.path = jsonPath; - e.message = 'Error parsing ' + jsonPath + ': ' + e.message; - throw e; - } -} - -function readPackageScope(checkPath) { - const rootSeparatorIndex = StringPrototypeIndexOf(checkPath, sep); - let separatorIndex; - do { - separatorIndex = StringPrototypeLastIndexOf(checkPath, sep); - checkPath = StringPrototypeSlice(checkPath, 0, separatorIndex); - if (StringPrototypeEndsWith(checkPath, sep + 'node_modules')) - return false; - const pjson = readPackage(checkPath + sep); - if (pjson) return { - data: pjson, - path: checkPath, - }; - } while (separatorIndex > rootSeparatorIndex); - return false; -} - -/** - * @param {{ - * nodeEsmResolver: ReturnType, - * extensions: import('../src/file-extensions').Extensions, - * preferTsExts - * }} opts - */ -function createCjsLoader(opts) { -const {nodeEsmResolver, preferTsExts} = opts; -const {replacementsForCjs, replacementsForJs, replacementsForMjs, replacementsForJsx} = opts.extensions; -const { - encodedSepRegEx, - packageExportsResolve, - packageImportsResolve -} = nodeEsmResolver; - -function tryPackage(requestPath, exts, isMain, originalPath) { - // const pkg = readPackage(requestPath)?.main; - const tmp = readPackage(requestPath) - const pkg = tmp != null ? tmp.main : undefined; - - if (!pkg) { - return tryExtensions(path.resolve(requestPath, 'index'), exts, isMain); - } - - const filename = path.resolve(requestPath, pkg); - let actual = tryReplacementExtensions(filename, isMain) || - tryFile(filename, isMain) || - tryExtensions(filename, exts, isMain) || - tryExtensions(path.resolve(filename, 'index'), exts, isMain); - if (actual === false) { - actual = tryExtensions(path.resolve(requestPath, 'index'), exts, isMain); - if (!actual) { - // eslint-disable-next-line no-restricted-syntax - const err = new Error( - `Cannot find module '${filename}'. ` + - 'Please verify that the package.json has a valid "main" entry' - ); - err.code = 'MODULE_NOT_FOUND'; - err.path = path.resolve(requestPath, 'package.json'); - err.requestPath = originalPath; - // TODO(BridgeAR): Add the requireStack as well. - throw err; - } else { - const jsonPath = path.resolve(requestPath, 'package.json'); - process.emitWarning( - `Invalid 'main' field in '${jsonPath}' of '${pkg}'. ` + - 'Please either fix that or report it to the module author', - 'DeprecationWarning', - 'DEP0128' - ); - } - } - return actual; -} - -// In order to minimize unnecessary lstat() calls, -// this cache is a list of known-real paths. -// Set to an empty Map to reset. -const realpathCache = new SafeMap(); - -// Check if the file exists and is not a directory -// if using --preserve-symlinks and isMain is false, -// keep symlinks intact, otherwise resolve to the -// absolute realpath. -function tryFile(requestPath, isMain) { - const rc = stat(requestPath); - if (rc !== 0) return; - if (preserveSymlinks && !isMain) { - return path.resolve(requestPath); - } - return toRealPath(requestPath); -} - -function toRealPath(requestPath) { - return fs.realpathSync(requestPath, { - // [internalFS.realpathCacheKey]: realpathCache - }); -} - -function statReplacementExtensions(p) { - const lastDotIndex = p.lastIndexOf('.'); - if(lastDotIndex >= 0) { - const ext = p.slice(lastDotIndex); - if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') { - const pathnameWithoutExtension = p.slice(0, lastDotIndex); - const replacementExts = - ext === '.js' ? replacementsForJs - : ext === '.jsx' ? replacementsForJsx - : ext === '.mjs' ? replacementsForMjs - : replacementsForCjs; - for (let i = 0; i < replacementExts.length; i++) { - const filename = pathnameWithoutExtension + replacementExts[i]; - const rc = stat(filename); - if (rc === 0) { - return [rc, filename]; - } - } - } - } - return [stat(p), p]; -} -function tryReplacementExtensions(p, isMain) { - const lastDotIndex = p.lastIndexOf('.'); - if(lastDotIndex >= 0) { - const ext = p.slice(lastDotIndex); - if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') { - const pathnameWithoutExtension = p.slice(0, lastDotIndex); - const replacementExts = - ext === '.js' ? replacementsForJs - : ext === '.jsx' ? replacementsForJsx - : ext === '.mjs' ? replacementsForMjs - : replacementsForCjs; - for (let i = 0; i < replacementExts.length; i++) { - const filename = tryFile(pathnameWithoutExtension + replacementExts[i], isMain); - if (filename) { - return filename; - } - } - } - } - return false; -} - -// Given a path, check if the file exists with any of the set extensions -function tryExtensions(p, exts, isMain) { - for (let i = 0; i < exts.length; i++) { - const filename = tryFile(p + exts[i], isMain); - - if (filename) { - return filename; - } - } - return false; -} - -function trySelfParentPath(parent) { - if (!parent) return false; - - if (parent.filename) { - return parent.filename; - } else if (parent.id === '' || parent.id === 'internal/preload') { - try { - return process.cwd() + path.sep; - } catch { - return false; - } - } -} - -function trySelf(parentPath, request) { - if (!parentPath) return false; - - const { data: pkg, path: pkgPath } = readPackageScope(parentPath) || {}; - if (!pkg || pkg.exports === undefined) return false; - if (typeof pkg.name !== 'string') return false; - - let expansion; - if (request === pkg.name) { - expansion = '.'; - } else if (StringPrototypeStartsWith(request, `${pkg.name}/`)) { - expansion = '.' + StringPrototypeSlice(request, pkg.name.length); - } else { - return false; - } - - try { - return finalizeEsmResolution(packageExportsResolve( - pathToFileURL(pkgPath + '/package.json'), expansion, pkg, - pathToFileURL(parentPath), cjsConditions).resolved, parentPath, pkgPath); - } catch (e) { - if (e.code === 'ERR_MODULE_NOT_FOUND') - throw createEsmNotFoundErr(request, pkgPath + '/package.json'); - throw e; - } -} - -// This only applies to requests of a specific form: -// 1. name/.* -// 2. @scope/name/.* -const EXPORTS_PATTERN = /^((?:@[^/\\%]+\/)?[^./\\%][^/\\%]*)(\/.*)?$/; -function resolveExports(nmPath, request) { - // The implementation's behavior is meant to mirror resolution in ESM. - const { 1: name, 2: expansion = '' } = - StringPrototypeMatch(request, EXPORTS_PATTERN) || []; - if (!name) - return; - const pkgPath = path.resolve(nmPath, name); - const pkg = readPackage(pkgPath); - // if (pkg?.exports != null) { - if (pkg != null && pkg.exports != null) { - try { - return finalizeEsmResolution(packageExportsResolve( - pathToFileURL(pkgPath + '/package.json'), '.' + expansion, pkg, null, - cjsConditions).resolved, null, pkgPath); - } catch (e) { - if (e.code === 'ERR_MODULE_NOT_FOUND') - throw createEsmNotFoundErr(request, pkgPath + '/package.json'); - throw e; - } - } -} - -// Backwards compat for old node versions -const hasModulePathCache = !!require('module')._pathCache; -const Module_pathCache = Object.create(null); -const Module_pathCache_get = hasModulePathCache ? (cacheKey) => Module._pathCache[cacheKey] : (cacheKey) => Module_pathCache[cacheKey]; -const Module_pathCache_set = hasModulePathCache ? (cacheKey, value) => (Module._pathCache[cacheKey] = value) : (cacheKey) => (Module_pathCache[cacheKey] = value); - -const trailingSlashRegex = /(?:^|\/)\.?\.$/; -const Module_findPath = function _findPath(request, paths, isMain) { - const absoluteRequest = path.isAbsolute(request); - if (absoluteRequest) { - paths = ['']; - } else if (!paths || paths.length === 0) { - return false; - } - - const cacheKey = request + '\x00' + ArrayPrototypeJoin(paths, '\x00'); - const entry = Module_pathCache_get(cacheKey); - if (entry) - return entry; - - let exts; - let trailingSlash = request.length > 0 && - StringPrototypeCharCodeAt(request, request.length - 1) === - CHAR_FORWARD_SLASH; - if (!trailingSlash) { - trailingSlash = RegExpPrototypeTest(trailingSlashRegex, request); - } - - // For each path - for (let i = 0; i < paths.length; i++) { - // Don't search further if path doesn't exist - const curPath = paths[i]; - if (curPath && stat(curPath) < 1) continue; - - if (!absoluteRequest) { - const exportsResolved = resolveExports(curPath, request); - if (exportsResolved) - return exportsResolved; - } - - const _basePath = path.resolve(curPath, request); - let filename; - - const [rc, basePath] = statReplacementExtensions(_basePath); - if (!trailingSlash) { - if (rc === 0) { // File. - if (!isMain) { - if (preserveSymlinks) { - filename = path.resolve(basePath); - } else { - filename = toRealPath(basePath); - } - } else if (preserveSymlinksMain) { - // For the main module, we use the preserveSymlinksMain flag instead - // mainly for backward compatibility, as the preserveSymlinks flag - // historically has not applied to the main module. Most likely this - // was intended to keep .bin/ binaries working, as following those - // symlinks is usually required for the imports in the corresponding - // files to resolve; that said, in some use cases following symlinks - // causes bigger problems which is why the preserveSymlinksMain option - // is needed. - filename = path.resolve(basePath); - } else { - filename = toRealPath(basePath); - } - } - - if (!filename) { - // Try it with each of the extensions - if (exts === undefined) - exts = ObjectKeys(Module._extensions); - filename = tryExtensions(basePath, exts, isMain); - } - } - - if (!filename && rc === 1) { // Directory. - // try it with each of the extensions at "index" - if (exts === undefined) - exts = ObjectKeys(Module._extensions); - filename = tryPackage(basePath, exts, isMain, request); - } - - if (filename) { - Module_pathCache_set(cacheKey, filename); - return filename; - } - } - - return false; -}; - -const Module_resolveFilename = function _resolveFilename(request, parent, isMain, options) { - if (StringPrototypeStartsWith(request, 'node:') || - NativeModule.canBeRequiredByUsers(request)) { - return request; - } - - let paths; - - if (typeof options === 'object' && options !== null) { - if (ArrayIsArray(options.paths)) { - const isRelative = StringPrototypeStartsWith(request, './') || - StringPrototypeStartsWith(request, '../') || - ((isWindows && StringPrototypeStartsWith(request, '.\\')) || - StringPrototypeStartsWith(request, '..\\')); - - if (isRelative) { - paths = options.paths; - } else { - const fakeParent = new Module('', null); - - paths = []; - - for (let i = 0; i < options.paths.length; i++) { - const path = options.paths[i]; - fakeParent.paths = Module._nodeModulePaths(path); - const lookupPaths = Module._resolveLookupPaths(request, fakeParent); - - for (let j = 0; j < lookupPaths.length; j++) { - if (!ArrayPrototypeIncludes(paths, lookupPaths[j])) - ArrayPrototypePush(paths, lookupPaths[j]); - } - } - } - } else if (options.paths === undefined) { - paths = Module._resolveLookupPaths(request, parent); - } else { - throw new ERR_INVALID_ARG_VALUE('options.paths', options.paths); - } - } else { - paths = Module._resolveLookupPaths(request, parent); - } - - // if (parent?.filename) { - // node 12 hack - if (parent != null && parent.filename) { - if (request[0] === '#') { - const pkg = readPackageScope(parent.filename) || {}; - - // if (pkg.data?.imports != null) { - // node 12 hack - if (pkg.data != null && pkg.data.imports != null) { - try { - return finalizeEsmResolution( - packageImportsResolve(request, pathToFileURL(parent.filename), - cjsConditions), parent.filename, - pkg.path); - } catch (e) { - if (e.code === 'ERR_MODULE_NOT_FOUND') - throw createEsmNotFoundErr(request); - throw e; - } - } - } - } - - // Try module self resolution first - const parentPath = trySelfParentPath(parent); - const selfResolved = trySelf(parentPath, request); - if (selfResolved) { - const cacheKey = request + '\x00' + - (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, '\x00')); - Module._pathCache[cacheKey] = selfResolved; - return selfResolved; - } - - // Look up the filename first, since that's the cache key. - const filename = Module._findPath(request, paths, isMain, false); - if (filename) return filename; - const requireStack = []; - for (let cursor = parent; - cursor; - cursor = moduleParentCache.get(cursor)) { - ArrayPrototypePush(requireStack, cursor.filename || cursor.id); - } - let message = `Cannot find module '${request}'`; - if (requireStack.length > 0) { - message = message + '\nRequire stack:\n- ' + - ArrayPrototypeJoin(requireStack, '\n- '); - } - // eslint-disable-next-line no-restricted-syntax - const err = new Error(message); - err.code = 'MODULE_NOT_FOUND'; - err.requireStack = requireStack; - throw err; -}; - -function finalizeEsmResolution(resolved, parentPath, pkgPath) { - if (RegExpPrototypeTest(encodedSepRegEx, resolved)) - throw new ERR_INVALID_MODULE_SPECIFIER( - resolved, 'must not include encoded "/" or "\\" characters', parentPath); - const filename = fileURLToPath(resolved); - const actual = tryReplacementExtensions(filename) || tryFile(filename); - if (actual) - return actual; - const err = createEsmNotFoundErr(filename, - path.resolve(pkgPath, 'package.json')); - throw err; -} - -function createEsmNotFoundErr(request, path) { - // eslint-disable-next-line no-restricted-syntax - const err = new Error(`Cannot find module '${request}'`); - err.code = 'MODULE_NOT_FOUND'; - if (path) - err.path = path; - // TODO(BridgeAR): Add the requireStack as well. - return err; -} - - -return { - Module_findPath, - Module_resolveFilename -} - -} - -/** - * copied from Module._extensions['.js'] - * https://github.com/nodejs/node/blob/v15.3.0/lib/internal/modules/cjs/loader.js#L1113-L1120 - * @param {import('../src/index').Service} service - * @param {NodeJS.Module} module - * @param {string} filename - */ -function assertScriptCanLoadAsCJSImpl(service, module, filename) { - const pkg = readPackageScope(filename); - - // ts-node modification: allow our configuration to override - const tsNodeClassification = service.moduleTypeClassifier.classifyModuleByModuleTypeOverrides(normalizeSlashes(filename)); - if(tsNodeClassification.moduleType === 'cjs') return; - - // ignore package.json when file extension is ESM-only or CJS-only - // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] - const lastDotIndex = filename.lastIndexOf('.'); - const ext = lastDotIndex >= 0 ? filename.slice(lastDotIndex) : ''; - - if((ext === '.cts' || ext === '.cjs') && tsNodeClassification.moduleType === 'auto') return; - - // Function require shouldn't be used in ES modules. - if (ext === '.mts' || ext === '.mjs' || tsNodeClassification.moduleType === 'esm' || (pkg && pkg.data && pkg.data.type === 'module')) { - const parentPath = module.parent && module.parent.filename; - const packageJsonPath = pkg ? path.resolve(pkg.path, 'package.json') : null; - throw createErrRequireEsm(filename, parentPath, packageJsonPath); - } -} - - -module.exports = { - createCjsLoader, - assertScriptCanLoadAsCJSImpl, - readPackageScope -}; diff --git a/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js b/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js deleted file mode 100644 index e85e0ab..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copied from https://raw.githubusercontent.com/nodejs/node/v15.3.0/lib/internal/modules/esm/get_format.js - -'use strict'; -const { - RegExpPrototypeExec, - StringPrototypeStartsWith, -} = require('./node-primordials'); -const { extname } = require('path'); -const { getOptionValue } = require('./node-options'); - -const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(s => parseInt(s, 10)); -const experimentalJsonModules = - nodeMajor > 17 - || (nodeMajor === 17 && nodeMinor >= 5) - || (nodeMajor === 16 && nodeMinor >= 15) - || getOptionValue('--experimental-json-modules'); -const experimentalWasmModules = getOptionValue('--experimental-wasm-modules'); -const { URL, fileURLToPath } = require('url'); -const { ERR_UNKNOWN_FILE_EXTENSION } = require('./node-internal-errors').codes; - -const extensionFormatMap = { - '__proto__': null, - '.cjs': 'commonjs', - '.js': 'module', - '.mjs': 'module' -}; - -const legacyExtensionFormatMap = { - '__proto__': null, - '.cjs': 'commonjs', - '.js': 'commonjs', - '.json': 'commonjs', - '.mjs': 'module', - '.node': 'commonjs' -}; - -if (experimentalWasmModules) - extensionFormatMap['.wasm'] = legacyExtensionFormatMap['.wasm'] = 'wasm'; - -if (experimentalJsonModules) - extensionFormatMap['.json'] = legacyExtensionFormatMap['.json'] = 'json'; - -/** - * - * @param {'node' | 'explicit'} [tsNodeExperimentalSpecifierResolution] - * @param {ReturnType< - * typeof import('../dist-raw/node-internal-modules-esm-resolve').createResolve - * >} nodeEsmResolver - */ -function createGetFormat(tsNodeExperimentalSpecifierResolution, nodeEsmResolver) { -// const experimentalSpeciferResolution = tsNodeExperimentalSpecifierResolution ?? getOptionValue('--experimental-specifier-resolution'); -let experimentalSpeciferResolution = tsNodeExperimentalSpecifierResolution != null ? tsNodeExperimentalSpecifierResolution : getOptionValue('--experimental-specifier-resolution'); -const { getPackageType } = nodeEsmResolver; - -/** - * @param {string} url - * @param {{}} context - * @param {any} defaultGetFormatUnused - * @returns {ReturnType} - */ -function defaultGetFormat(url, context, defaultGetFormatUnused) { - if (StringPrototypeStartsWith(url, 'node:')) { - return { format: 'builtin' }; - } - const parsed = new URL(url); - if (parsed.protocol === 'data:') { - const [ , mime ] = RegExpPrototypeExec( - /^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/, - parsed.pathname, - ) || [ null, null, null ]; - const format = ({ - '__proto__': null, - 'text/javascript': 'module', - 'application/json': experimentalJsonModules ? 'json' : null, - 'application/wasm': experimentalWasmModules ? 'wasm' : null - })[mime] || null; - return { format }; - } else if (parsed.protocol === 'file:') { - const ext = extname(parsed.pathname); - let format; - if (ext === '.js') { - format = getPackageType(parsed.href) === 'module' ? 'module' : 'commonjs'; - } else { - format = extensionFormatMap[ext]; - } - if (!format) { - if (experimentalSpeciferResolution === 'node') { - process.emitWarning( - 'The Node.js specifier resolution in ESM is experimental.', - 'ExperimentalWarning'); - format = legacyExtensionFormatMap[ext]; - } else { - throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url)); - } - } - return { format: format || null }; - } - return { format: null }; -} - -return {defaultGetFormat}; -} - -module.exports = { - createGetFormat -}; diff --git a/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js b/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js deleted file mode 100644 index 2fbd832..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +++ /dev/null @@ -1,962 +0,0 @@ -// Copied from https://raw.githubusercontent.com/nodejs/node/v15.3.0/lib/internal/modules/esm/resolve.js - -'use strict'; - -const {versionGteLt} = require('../dist/util'); - -// Test for node >14.13.1 || (>=12.20.0 && <13) -const builtinModuleProtocol = - versionGteLt(process.versions.node, '14.13.1') || - versionGteLt(process.versions.node, '12.20.0', '13.0.0') - ? 'node:' - : 'nodejs:'; - -const { - ArrayIsArray, - ArrayPrototypeJoin, - ArrayPrototypeShift, - JSONParse, - JSONStringify, - ObjectFreeze, - ObjectGetOwnPropertyNames, - ObjectPrototypeHasOwnProperty, - RegExpPrototypeTest, - SafeMap, - SafeSet, - StringPrototypeEndsWith, - StringPrototypeIndexOf, - StringPrototypeLastIndexOf, - StringPrototypeReplace, - StringPrototypeSlice, - StringPrototypeSplit, - StringPrototypeStartsWith, - StringPrototypeSubstr, -} = require('./node-primordials'); - -// const internalFS = require('internal/fs/utils'); -const Module = require('module'); -const { NativeModule } = require('./node-nativemodule'); -const { - realpathSync, - statSync, - Stats, -} = require('fs'); -// const { getOptionValue } = require('internal/options'); -const { getOptionValue } = require('./node-options'); -// // Do not eagerly grab .manifest, it may be in TDZ -// const policy = getOptionValue('--experimental-policy') ? -// require('internal/process/policy') : -// null; -// disabled for now. I am not sure if/how we should support this -const policy = null; -const { sep, relative } = require('path'); -const preserveSymlinks = getOptionValue('--preserve-symlinks'); -const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); -const typeFlag = getOptionValue('--input-type'); -// const { URL, pathToFileURL, fileURLToPath } = require('internal/url'); -const { URL, pathToFileURL, fileURLToPath } = require('url'); -const { - ERR_INPUT_TYPE_NOT_ALLOWED, - ERR_INVALID_ARG_VALUE, - ERR_INVALID_MODULE_SPECIFIER, - ERR_INVALID_PACKAGE_CONFIG, - ERR_INVALID_PACKAGE_TARGET, - ERR_MANIFEST_DEPENDENCY_MISSING, - ERR_MODULE_NOT_FOUND, - ERR_PACKAGE_IMPORT_NOT_DEFINED, - ERR_PACKAGE_PATH_NOT_EXPORTED, - ERR_UNSUPPORTED_DIR_IMPORT, - ERR_UNSUPPORTED_ESM_URL_SCHEME, -// } = require('internal/errors').codes; -} = require('./node-internal-errors').codes; - -// const { Module: CJSModule } = require('internal/modules/cjs/loader'); -const CJSModule = Module; - -// const packageJsonReader = require('internal/modules/package_json_reader'); -const packageJsonReader = require('./node-internal-modules-package_json_reader'); -const userConditions = getOptionValue('--conditions'); -const DEFAULT_CONDITIONS = ObjectFreeze(['node', 'import', ...userConditions]); -const DEFAULT_CONDITIONS_SET = new SafeSet(DEFAULT_CONDITIONS); - -const pendingDeprecation = getOptionValue('--pending-deprecation'); - -/** - * @param {{ - * extensions: import('../src/file-extensions').Extensions, - * preferTsExts: boolean | undefined; - * tsNodeExperimentalSpecifierResolution: import('../src/index').ExperimentalSpecifierResolution | undefined; - * }} opts - */ -function createResolve(opts) { -// TODO receive cached fs implementations here -const {preferTsExts, tsNodeExperimentalSpecifierResolution, extensions} = opts; -const esrnExtensions = extensions.experimentalSpecifierResolutionAddsIfOmitted; -const {legacyMainResolveAddsIfOmitted, replacementsForCjs, replacementsForJs, replacementsForMjs, replacementsForJsx} = extensions; -// const experimentalSpecifierResolution = tsNodeExperimentalSpecifierResolution ?? getOptionValue('--experimental-specifier-resolution'); -const experimentalSpecifierResolution = tsNodeExperimentalSpecifierResolution != null ? tsNodeExperimentalSpecifierResolution : getOptionValue('--experimental-specifier-resolution'); - -const emittedPackageWarnings = new SafeSet(); -function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) { - const pjsonPath = fileURLToPath(pjsonUrl); - if (!pendingDeprecation) { - const nodeModulesIndex = StringPrototypeLastIndexOf(pjsonPath, - '/node_modules/'); - if (nodeModulesIndex !== -1) { - const afterNodeModulesPath = StringPrototypeSlice(pjsonPath, - nodeModulesIndex + 14, - -13); - try { - const { packageSubpath } = parsePackageName(afterNodeModulesPath); - if (packageSubpath === '.') - return; - } catch {} - } - } - if (emittedPackageWarnings.has(pjsonPath + '|' + match)) - return; - emittedPackageWarnings.add(pjsonPath + '|' + match); - process.emitWarning( - `Use of deprecated folder mapping "${match}" in the ${isExports ? - '"exports"' : '"imports"'} field module resolution of the package at ${ - pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ''}.\n` + - `Update this package.json to use a subpath pattern like "${match}*".`, - 'DeprecationWarning', - 'DEP0148' - ); -} - -function getConditionsSet(conditions) { - if (conditions !== undefined && conditions !== DEFAULT_CONDITIONS) { - if (!ArrayIsArray(conditions)) { - throw new ERR_INVALID_ARG_VALUE('conditions', conditions, - 'expected an array'); - } - return new SafeSet(conditions); - } - return DEFAULT_CONDITIONS_SET; -} - -const realpathCache = new SafeMap(); -const packageJSONCache = new SafeMap(); /* string -> PackageConfig */ - -const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, '15.3.0') || - versionGteLt(process.versions.node, '14.17.0', '15.0.0'); -const tryStatSync = statSupportsThrowIfNoEntry ? tryStatSyncWithoutErrors : tryStatSyncWithErrors; -const statsIfNotFound = new Stats(); -function tryStatSyncWithoutErrors(path) { - const stats = statSync(path, { throwIfNoEntry: false }); - if(stats != null) return stats; - return statsIfNotFound; -} -function tryStatSyncWithErrors(path) { - try { - return statSync(path); - } catch { - return statsIfNotFound; - } -} - -function getPackageConfig(path, specifier, base) { - const existing = packageJSONCache.get(path); - if (existing !== undefined) { - return existing; - } - const source = packageJsonReader.read(path).string; - if (source === undefined) { - const packageConfig = { - pjsonPath: path, - exists: false, - main: undefined, - name: undefined, - type: 'none', - exports: undefined, - imports: undefined, - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; - } - - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier), - error.message - ); - } - - let { imports, main, name, type } = packageJSON; - const { exports } = packageJSON; - if (typeof imports !== 'object' || imports === null) imports = undefined; - if (typeof main !== 'string') main = undefined; - if (typeof name !== 'string') name = undefined; - // Ignore unknown types for forwards compatibility - if (type !== 'module' && type !== 'commonjs') type = 'none'; - - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports, - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} - -function getPackageScopeConfig(resolved) { - let packageJSONUrl = new URL('./package.json', resolved); - while (true) { - const packageJSONPath = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath, 'node_modules/package.json')) - break; - const packageConfig = getPackageConfig(fileURLToPath(packageJSONUrl), - resolved); - if (packageConfig.exists) return packageConfig; - - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL('../package.json', packageJSONUrl); - - // Terminates at root where ../package.json equals ../../package.json - // (can't just check "/package.json" for Windows support). - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) break; - } - const packageJSONPath = fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: undefined, - name: undefined, - type: 'none', - exports: undefined, - imports: undefined, - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -/* - * Legacy CommonJS main resolution: - * 1. let M = pkg_url + (json main field) - * 2. TRY(M, M.js, M.json, M.node) - * 3. TRY(M/index.js, M/index.json, M/index.node) - * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node) - * 5. NOT_FOUND - */ -function fileExists(url) { - return tryStatSync(fileURLToPath(url)).isFile(); -} - -function legacyMainResolve(packageJSONUrl, packageConfig, base) { - let guess; - if (packageConfig.main !== undefined) { - // Note: fs check redundances will be handled by Descriptor cache here. - if(guess = resolveReplacementExtensions(new URL(`./${packageConfig.main}`, packageJSONUrl))) { - return guess; - } - if (fileExists(guess = new URL(`./${packageConfig.main}`, - packageJSONUrl))) { - return guess; - } - for(const extension of legacyMainResolveAddsIfOmitted) { - if (fileExists(guess = new URL(`./${packageConfig.main}${extension}`, - packageJSONUrl))) { - return guess; - } - } - for(const extension of legacyMainResolveAddsIfOmitted) { - if (fileExists(guess = new URL(`./${packageConfig.main}/index${extension}`, - packageJSONUrl))) { - return guess; - } - } - // Fallthrough. - } - for(const extension of legacyMainResolveAddsIfOmitted) { - if (fileExists(guess = new URL(`./index${extension}`, packageJSONUrl))) { - return guess; - } - } - // Not found. - throw new ERR_MODULE_NOT_FOUND( - fileURLToPath(new URL('.', packageJSONUrl)), fileURLToPath(base)); -} - -/** attempts replacement extensions, then tries exact name, then attempts appending extensions */ -function resolveExtensionsWithTryExactName(search) { - const resolvedReplacementExtension = resolveReplacementExtensions(search); - if(resolvedReplacementExtension) return resolvedReplacementExtension; - if (fileExists(search)) return search; - return resolveExtensions(search); -} - -// This appends missing extensions -function resolveExtensions(search) { - for (let i = 0; i < esrnExtensions.length; i++) { - const extension = esrnExtensions[i]; - const guess = new URL(`${search.pathname}${extension}`, search); - if (fileExists(guess)) return guess; - } - return undefined; -} - -/** This replaces JS with TS extensions */ -function resolveReplacementExtensions(search) { - const lastDotIndex = search.pathname.lastIndexOf('.'); - if(lastDotIndex >= 0) { - const ext = search.pathname.slice(lastDotIndex); - if (ext === '.js' || ext === '.jsx' || ext === '.mjs' || ext === '.cjs') { - const pathnameWithoutExtension = search.pathname.slice(0, lastDotIndex); - const replacementExts = - ext === '.js' ? replacementsForJs - : ext === '.jsx' ? replacementsForJsx - : ext === '.mjs' ? replacementsForMjs - : replacementsForCjs; - const guess = new URL(search.toString()); - for (let i = 0; i < replacementExts.length; i++) { - const extension = replacementExts[i]; - guess.pathname = `${pathnameWithoutExtension}${extension}`; - if (fileExists(guess)) return guess; - } - } - } - return undefined; -} - -function resolveIndex(search) { - return resolveExtensions(new URL('index', search)); -} - -const encodedSepRegEx = /%2F|%2C/i; -function finalizeResolution(resolved, base) { - if (RegExpPrototypeTest(encodedSepRegEx, resolved.pathname)) - throw new ERR_INVALID_MODULE_SPECIFIER( - resolved.pathname, 'must not include encoded "/" or "\\" characters', - fileURLToPath(base)); - - if (experimentalSpecifierResolution === 'node') { - const path = fileURLToPath(resolved); - let file = resolveExtensionsWithTryExactName(resolved); - if (file !== undefined) return file; - if (!StringPrototypeEndsWith(path, '/')) { - file = resolveIndex(new URL(`${resolved}/`)); - if (file !== undefined) return file; - } else { - return resolveIndex(resolved) || resolved; - } - throw new ERR_MODULE_NOT_FOUND( - resolved.pathname, fileURLToPath(base), 'module'); - } - - const file = resolveReplacementExtensions(resolved) || resolved; - const path = fileURLToPath(file); - - const stats = tryStatSync(StringPrototypeEndsWith(path, '/') ? - StringPrototypeSlice(path, -1) : path); - if (stats.isDirectory()) { - const err = new ERR_UNSUPPORTED_DIR_IMPORT(path, fileURLToPath(base)); - err.url = String(resolved); - throw err; - } else if (!stats.isFile()) { - throw new ERR_MODULE_NOT_FOUND( - path || resolved.pathname, fileURLToPath(base), 'module'); - } - - return file; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, packageJSONUrl && fileURLToPath(new URL('.', packageJSONUrl)), - fileURLToPath(base)); -} - -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - fileURLToPath(new URL('.', packageJSONUrl)), subpath, - base && fileURLToPath(base)); -} - -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? - 'imports' : 'exports'}" resolution of ${fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER(subpath, reason, - base && fileURLToPath(base)); -} - -function throwInvalidPackageTarget( - subpath, target, packageJSONUrl, internal, base) { - if (typeof target === 'object' && target !== null) { - target = JSONStringify(target, null, ''); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - fileURLToPath(new URL('.', packageJSONUrl)), subpath, target, - internal, base && fileURLToPath(base)); -} - -const invalidSegmentRegEx = /(^|\\|\/)(\.\.?|node_modules)(\\|\/|$)/; -const patternRegEx = /\*/g; - -function resolvePackageTargetString( - target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== '' && !pattern && target[target.length - 1] !== '/') - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - - if (!StringPrototypeStartsWith(target, './')) { - if (internal && !StringPrototypeStartsWith(target, '../') && - !StringPrototypeStartsWith(target, '/')) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch {} - if (!isURL) { - const exportTarget = pattern ? - StringPrototypeReplace(target, patternRegEx, subpath) : - target + subpath; - return packageResolve(exportTarget, packageJSONUrl, conditions); - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - - if (RegExpPrototypeTest(invalidSegmentRegEx, StringPrototypeSlice(target, 2))) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL('.', packageJSONUrl).pathname; - - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - - if (subpath === '') return resolved; - - if (RegExpPrototypeTest(invalidSegmentRegEx, subpath)) - throwInvalidSubpath(match + subpath, packageJSONUrl, internal, base); - - if (pattern) - return new URL(StringPrototypeReplace(resolved.href, patternRegEx, - subpath)); - return new URL(subpath, resolved); -} - -/** - * @param {string} key - * @returns {boolean} - */ -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) return false; - return keyNum >= 0 && keyNum < 0xFFFF_FFFF; -} - -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, - base, pattern, internal, conditions) { - if (typeof target === 'string') { - return resolvePackageTargetString( - target, subpath, packageSubpath, packageJSONUrl, base, pattern, internal, - conditions); - } else if (ArrayIsArray(target)) { - if (target.length === 0) - return null; - - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolved; - try { - resolved = resolvePackageTarget( - packageJSONUrl, targetItem, subpath, packageSubpath, base, pattern, - internal, conditions); - } catch (e) { - lastException = e; - if (e.code === 'ERR_INVALID_PACKAGE_TARGET') - continue; - throw e; - } - if (resolved === undefined) - continue; - if (resolved === null) { - lastException = null; - continue; - } - return resolved; - } - if (lastException === undefined || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === 'object' && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - fileURLToPath(packageJSONUrl), base, - '"exports" cannot contain numeric property keys.'); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === 'default' || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolved = resolvePackageTarget( - packageJSONUrl, conditionalTarget, subpath, packageSubpath, base, - pattern, internal, conditions); - if (resolved === undefined) - continue; - return resolved; - } - } - return undefined; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget(packageSubpath, target, packageJSONUrl, internal, - base); -} - -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === 'string' || ArrayIsArray(exports)) return true; - if (typeof exports !== 'object' || exports === null) return false; - - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === '' || key[0] !== '.'; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - fileURLToPath(packageJSONUrl), base, - '"exports" cannot contain some keys starting with \'.\' and some not.' + - ' The exports object must either be an object of package subpath keys' + - ' or an object of main entry condition name keys only.'); - } - } - return isConditionalSugar; -} - -/** - * @param {URL} packageJSONUrl - * @param {string} packageSubpath - * @param {object} packageConfig - * @param {string} base - * @param {Set} conditions - * @returns {{resolved: URL, exact: boolean}} - */ -function packageExportsResolve( - packageJSONUrl, packageSubpath, packageConfig, base, conditions) { - let exports = packageConfig.exports; - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { '.': exports }; - - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath)) { - const target = exports[packageSubpath]; - const resolved = resolvePackageTarget( - packageJSONUrl, target, '', packageSubpath, base, false, false, conditions - ); - if (resolved === null || resolved === undefined) - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - return { resolved, exact: true }; - } - - let bestMatch = ''; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key[key.length - 1] === '*' && - StringPrototypeStartsWith(packageSubpath, - StringPrototypeSlice(key, 0, -1)) && - packageSubpath.length >= key.length && - key.length > bestMatch.length) { - bestMatch = key; - } else if (key[key.length - 1] === '/' && - StringPrototypeStartsWith(packageSubpath, key) && - key.length > bestMatch.length) { - bestMatch = key; - } - } - - if (bestMatch) { - const target = exports[bestMatch]; - const pattern = bestMatch[bestMatch.length - 1] === '*'; - const subpath = StringPrototypeSubstr(packageSubpath, bestMatch.length - - (pattern ? 1 : 0)); - const resolved = resolvePackageTarget(packageJSONUrl, target, subpath, - bestMatch, base, pattern, false, - conditions); - if (resolved === null || resolved === undefined) - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - if (!pattern) - emitFolderMapDeprecation(bestMatch, packageJSONUrl, true, base); - return { resolved, exact: pattern }; - } - - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} - -function packageImportsResolve(name, base, conditions) { - if (name === '#' || StringPrototypeStartsWith(name, '#/')) { - const reason = 'is not a valid internal imports specifier name'; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base); - if (packageConfig.exists) { - packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name)) { - const resolved = resolvePackageTarget( - packageJSONUrl, imports[name], '', name, base, false, true, conditions - ); - if (resolved !== null) - return { resolved, exact: true }; - } else { - let bestMatch = ''; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key[key.length - 1] === '*' && - StringPrototypeStartsWith(name, - StringPrototypeSlice(key, 0, -1)) && - name.length >= key.length && - key.length > bestMatch.length) { - bestMatch = key; - } else if (key[key.length - 1] === '/' && - StringPrototypeStartsWith(name, key) && - key.length > bestMatch.length) { - bestMatch = key; - } - } - - if (bestMatch) { - const target = imports[bestMatch]; - const pattern = bestMatch[bestMatch.length - 1] === '*'; - const subpath = StringPrototypeSubstr(name, bestMatch.length - - (pattern ? 1 : 0)); - const resolved = resolvePackageTarget( - packageJSONUrl, target, subpath, bestMatch, base, pattern, true, - conditions); - if (resolved !== null) { - if (!pattern) - emitFolderMapDeprecation(bestMatch, packageJSONUrl, false, base); - return { resolved, exact: pattern }; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -function getPackageType(url) { - const packageConfig = getPackageScopeConfig(url); - return packageConfig.type; -} - -function parsePackageName(specifier, base) { - let separatorIndex = StringPrototypeIndexOf(specifier, '/'); - let validPackageName = true; - let isScoped = false; - if (specifier[0] === '@') { - isScoped = true; - if (separatorIndex === -1 || specifier.length === 0) { - validPackageName = false; - } else { - separatorIndex = StringPrototypeIndexOf( - specifier, '/', separatorIndex + 1); - } - } - - const packageName = separatorIndex === -1 ? - specifier : StringPrototypeSlice(specifier, 0, separatorIndex); - - // Package name cannot have leading . and cannot have percent-encoding or - // separators. - for (let i = 0; i < packageName.length; i++) { - if (packageName[i] === '%' || packageName[i] === '\\') { - validPackageName = false; - break; - } - } - - if (!validPackageName) { - throw new ERR_INVALID_MODULE_SPECIFIER( - specifier, 'is not a valid package name', fileURLToPath(base)); - } - - const packageSubpath = '.' + (separatorIndex === -1 ? '' : - StringPrototypeSlice(specifier, separatorIndex)); - - return { packageName, packageSubpath, isScoped }; -} - -/** - * @param {string} specifier - * @param {URL} base - * @param {Set} conditions - * @returns {URL} - */ -function packageResolve(specifier, base, conditions) { - const { packageName, packageSubpath, isScoped } = - parsePackageName(specifier, base); - - // ResolveSelf - const packageConfig = getPackageScopeConfig(base); - if (packageConfig.exists) { - const packageJSONUrl = pathToFileURL(packageConfig.pjsonPath); - if (packageConfig.name === packageName && - packageConfig.exports !== undefined && packageConfig.exports !== null) { - return packageExportsResolve( - packageJSONUrl, packageSubpath, packageConfig, base, conditions - ).resolved; - } - } - - let packageJSONUrl = - new URL('./node_modules/' + packageName + '/package.json', base); - let packageJSONPath = fileURLToPath(packageJSONUrl); - let lastPath; - do { - const stat = tryStatSync(StringPrototypeSlice(packageJSONPath, 0, - packageJSONPath.length - 13)); - if (!stat.isDirectory()) { - lastPath = packageJSONPath; - packageJSONUrl = new URL((isScoped ? - '../../../../node_modules/' : '../../../node_modules/') + - packageName + '/package.json', packageJSONUrl); - packageJSONPath = fileURLToPath(packageJSONUrl); - continue; - } - - // Package match. - const packageConfig = getPackageConfig(packageJSONPath, specifier, base); - if (packageConfig.exports !== undefined && packageConfig.exports !== null) - return packageExportsResolve( - packageJSONUrl, packageSubpath, packageConfig, base, conditions - ).resolved; - if (packageSubpath === '.') - return legacyMainResolve(packageJSONUrl, packageConfig, base); - return new URL(packageSubpath, packageJSONUrl); - // Cross-platform root check. - } while (packageJSONPath.length !== lastPath.length); - - // eslint can't handle the above code. - // eslint-disable-next-line no-unreachable - throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base)); -} - -function isBareSpecifier(specifier) { - return specifier[0] && specifier[0] !== '/' && specifier[0] !== '.'; -} - -function isRelativeSpecifier(specifier) { - if (specifier[0] === '.') { - if (specifier.length === 1 || specifier[1] === '/') return true; - if (specifier[1] === '.') { - if (specifier.length === 2 || specifier[2] === '/') return true; - } - } - return false; -} - -function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { - if (specifier === '') return false; - if (specifier[0] === '/') return true; - return isRelativeSpecifier(specifier); -} - -/** - * @param {string} specifier - * @param {URL} base - * @param {Set} conditions - * @returns {URL} - */ -function moduleResolve(specifier, base, conditions) { - // Order swapped from spec for minor perf gain. - // Ok since relative URLs cannot parse as URLs. - let resolved; - if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { - resolved = new URL(specifier, base); - } else if (specifier[0] === '#') { - ({ resolved } = packageImportsResolve(specifier, base, conditions)); - } else { - try { - resolved = new URL(specifier); - } catch { - resolved = packageResolve(specifier, base, conditions); - } - } - return finalizeResolution(resolved, base); -} - -/** - * Try to resolve an import as a CommonJS module - * @param {string} specifier - * @param {string} parentURL - * @returns {boolean|string} - */ -function resolveAsCommonJS(specifier, parentURL) { - try { - const parent = fileURLToPath(parentURL); - const tmpModule = new CJSModule(parent, null); - tmpModule.paths = CJSModule._nodeModulePaths(parent); - - let found = CJSModule._resolveFilename(specifier, tmpModule, false); - - // If it is a relative specifier return the relative path - // to the parent - if (isRelativeSpecifier(specifier)) { - found = relative(parent, found); - // Add '.separator if the path does not start with '..separator' - // This should be a safe assumption because when loading - // esm modules there should be always a file specified so - // there should not be a specifier like '..' or '.' - if (!StringPrototypeStartsWith(found, `..${sep}`)) { - found = `.${sep}${found}`; - } - } else if (isBareSpecifier(specifier)) { - // If it is a bare specifier return the relative path within the - // module - const pkg = StringPrototypeSplit(specifier, '/')[0]; - const index = StringPrototypeIndexOf(found, pkg); - if (index !== -1) { - found = StringPrototypeSlice(found, index); - } - } - // Normalize the path separator to give a valid suggestion - // on Windows - if (process.platform === 'win32') { - found = StringPrototypeReplace(found, new RegExp(`\\${sep}`, 'g'), '/'); - } - return found; - } catch { - return false; - } -} - -function defaultResolve(specifier, context = {}, defaultResolveUnused) { - let { parentURL, conditions } = context; - if (parentURL && policy != null && policy.manifest) { - const redirects = policy.manifest.getDependencyMapper(parentURL); - if (redirects) { - const { resolve, reaction } = redirects; - const destination = resolve(specifier, new SafeSet(conditions)); - let missing = true; - if (destination === true) { - missing = false; - } else if (destination) { - const href = destination.href; - return { url: href }; - } - if (missing) { - reaction(new ERR_MANIFEST_DEPENDENCY_MISSING( - parentURL, - specifier, - ArrayPrototypeJoin([...conditions], ', ')) - ); - } - } - } - let parsed; - try { - parsed = new URL(specifier); - if (parsed.protocol === 'data:') { - return { - url: specifier - }; - } - } catch {} - if (parsed && parsed.protocol === builtinModuleProtocol) - return { url: specifier }; - if (parsed && parsed.protocol !== 'file:' && parsed.protocol !== 'data:') - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed); - if (NativeModule.canBeRequiredByUsers(specifier)) { - return { - url: builtinModuleProtocol + specifier - }; - } - if (parentURL && StringPrototypeStartsWith(parentURL, 'data:')) { - // This is gonna blow up, we want the error - new URL(specifier, parentURL); - } - - const isMain = parentURL === undefined; - if (isMain) { - parentURL = pathToFileURL(`${process.cwd()}/`).href; - - // This is the initial entry point to the program, and --input-type has - // been passed as an option; but --input-type can only be used with - // --eval, --print or STDIN string input. It is not allowed with file - // input, to avoid user confusion over how expansive the effect of the - // flag should be (i.e. entry point only, package scope surrounding the - // entry point, etc.). - if (typeFlag) - throw new ERR_INPUT_TYPE_NOT_ALLOWED(); - } - - conditions = getConditionsSet(conditions); - let url; - try { - url = moduleResolve(specifier, parentURL, conditions); - } catch (error) { - // Try to give the user a hint of what would have been the - // resolved CommonJS module - if (error.code === 'ERR_MODULE_NOT_FOUND' || - error.code === 'ERR_UNSUPPORTED_DIR_IMPORT') { - if (StringPrototypeStartsWith(specifier, 'file://')) { - specifier = fileURLToPath(specifier); - } - const found = resolveAsCommonJS(specifier, parentURL); - if (found) { - // Modify the stack and message string to include the hint - const lines = StringPrototypeSplit(error.stack, '\n'); - const hint = `Did you mean to import ${found}?`; - error.stack = - ArrayPrototypeShift(lines) + '\n' + - hint + '\n' + - ArrayPrototypeJoin(lines, '\n'); - error.message += `\n${hint}`; - } - } - throw error; - } - - if (isMain ? !preserveSymlinksMain : !preserveSymlinks) { - const urlPath = fileURLToPath(url); - const real = realpathSync(urlPath, { - // [internalFS.realpathCacheKey]: realpathCache - }); - const old = url; - url = pathToFileURL( - real + (StringPrototypeEndsWith(urlPath, sep) ? '/' : '')); - url.search = old.search; - url.hash = old.hash; - } - - return { url: `${url}` }; -} - -return { - DEFAULT_CONDITIONS, - defaultResolve, - encodedSepRegEx, - getPackageType, - packageExportsResolve, - packageImportsResolve -}; -} -module.exports = { - createResolve -}; diff --git a/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js b/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js deleted file mode 100644 index 9266bc1..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +++ /dev/null @@ -1,44 +0,0 @@ -// copied from https://github.com/nodejs/node/blob/v15.3.0/lib/internal/modules/package_json_reader.js -'use strict'; - -const { SafeMap } = require('./node-primordials'); -const { internalModuleReadJSON } = require('./node-internalBinding-fs'); -const { pathToFileURL } = require('url'); -const { toNamespacedPath } = require('path'); -// const { getOptionValue } = require('./node-options'); - -const cache = new SafeMap(); - -let manifest; - -/** - * @param {string} jsonPath - * @return {{string: string, containsKeys: boolean}} - */ -function read(jsonPath) { - if (cache.has(jsonPath)) { - return cache.get(jsonPath); - } - - const [string, containsKeys] = internalModuleReadJSON( - toNamespacedPath(jsonPath) - ); - const result = { string, containsKeys }; - if (string !== undefined) { - if (manifest === undefined) { - // manifest = getOptionValue('--experimental-policy') ? - // require('internal/process/policy').manifest : - // null; - // disabled for now. I am not sure if/how we should support this - manifest = null; - } - if (manifest !== null) { - const jsonURL = pathToFileURL(jsonPath); - manifest.assertIntegrity(jsonURL, string); - } - } - cache.set(jsonPath, result); - return result; -} - -module.exports = { read }; diff --git a/node_modules/ts-node/dist-raw/node-internal-repl-await.js b/node_modules/ts-node/dist-raw/node-internal-repl-await.js deleted file mode 100644 index 85bff2d..0000000 --- a/node_modules/ts-node/dist-raw/node-internal-repl-await.js +++ /dev/null @@ -1,254 +0,0 @@ -// copied from https://github.com/nodejs/node/blob/88799930794045795e8abac874730f9eba7e2300/lib/internal/repl/await.js -'use strict'; - -const { - ArrayFrom, - ArrayPrototypeForEach, - ArrayPrototypeIncludes, - ArrayPrototypeJoin, - ArrayPrototypePop, - ArrayPrototypePush, - FunctionPrototype, - ObjectKeys, - RegExpPrototypeSymbolReplace, - StringPrototypeEndsWith, - StringPrototypeIncludes, - StringPrototypeIndexOf, - StringPrototypeRepeat, - StringPrototypeSplit, - StringPrototypeStartsWith, - SyntaxError, -} = require('./node-primordials'); - -const parser = require('acorn').Parser; -const walk = require('acorn-walk'); -const { Recoverable } = require('repl'); - -function isTopLevelDeclaration(state) { - return state.ancestors[state.ancestors.length - 2] === state.body; -} - -const noop = FunctionPrototype; -const visitorsWithoutAncestors = { - ClassDeclaration(node, state, c) { - if (isTopLevelDeclaration(state)) { - state.prepend(node, `${node.id.name}=`); - ArrayPrototypePush( - state.hoistedDeclarationStatements, - `let ${node.id.name}; ` - ); - } - - walk.base.ClassDeclaration(node, state, c); - }, - ForOfStatement(node, state, c) { - if (node.await === true) { - state.containsAwait = true; - } - walk.base.ForOfStatement(node, state, c); - }, - FunctionDeclaration(node, state, c) { - state.prepend(node, `${node.id.name}=`); - ArrayPrototypePush( - state.hoistedDeclarationStatements, - `var ${node.id.name}; ` - ); - }, - FunctionExpression: noop, - ArrowFunctionExpression: noop, - MethodDefinition: noop, - AwaitExpression(node, state, c) { - state.containsAwait = true; - walk.base.AwaitExpression(node, state, c); - }, - ReturnStatement(node, state, c) { - state.containsReturn = true; - walk.base.ReturnStatement(node, state, c); - }, - VariableDeclaration(node, state, c) { - const variableKind = node.kind; - const isIterableForDeclaration = ArrayPrototypeIncludes( - ['ForOfStatement', 'ForInStatement'], - state.ancestors[state.ancestors.length - 2].type - ); - - if (variableKind === 'var' || isTopLevelDeclaration(state)) { - state.replace( - node.start, - node.start + variableKind.length + (isIterableForDeclaration ? 1 : 0), - variableKind === 'var' && isIterableForDeclaration ? - '' : - 'void' + (node.declarations.length === 1 ? '' : ' (') - ); - - if (!isIterableForDeclaration) { - ArrayPrototypeForEach(node.declarations, (decl) => { - state.prepend(decl, '('); - state.append(decl, decl.init ? ')' : '=undefined)'); - }); - - if (node.declarations.length !== 1) { - state.append(node.declarations[node.declarations.length - 1], ')'); - } - } - - const variableIdentifiersToHoist = [ - ['var', []], - ['let', []], - ]; - function registerVariableDeclarationIdentifiers(node) { - switch (node.type) { - case 'Identifier': - ArrayPrototypePush( - variableIdentifiersToHoist[variableKind === 'var' ? 0 : 1][1], - node.name - ); - break; - case 'ObjectPattern': - ArrayPrototypeForEach(node.properties, (property) => { - registerVariableDeclarationIdentifiers(property.value); - }); - break; - case 'ArrayPattern': - ArrayPrototypeForEach(node.elements, (element) => { - registerVariableDeclarationIdentifiers(element); - }); - break; - } - } - - ArrayPrototypeForEach(node.declarations, (decl) => { - registerVariableDeclarationIdentifiers(decl.id); - }); - - ArrayPrototypeForEach( - variableIdentifiersToHoist, - ({ 0: kind, 1: identifiers }) => { - if (identifiers.length > 0) { - ArrayPrototypePush( - state.hoistedDeclarationStatements, - `${kind} ${ArrayPrototypeJoin(identifiers, ', ')}; ` - ); - } - } - ); - } - - walk.base.VariableDeclaration(node, state, c); - } -}; - -const visitors = {}; -for (const nodeType of ObjectKeys(walk.base)) { - const callback = visitorsWithoutAncestors[nodeType] || walk.base[nodeType]; - visitors[nodeType] = (node, state, c) => { - const isNew = node !== state.ancestors[state.ancestors.length - 1]; - if (isNew) { - ArrayPrototypePush(state.ancestors, node); - } - callback(node, state, c); - if (isNew) { - ArrayPrototypePop(state.ancestors); - } - }; -} - -function processTopLevelAwait(src) { - const wrapPrefix = '(async () => { '; - const wrapped = `${wrapPrefix}${src} })()`; - const wrappedArray = ArrayFrom(wrapped); - let root; - try { - root = parser.parse(wrapped, { ecmaVersion: 'latest' }); - } catch (e) { - if (StringPrototypeStartsWith(e.message, 'Unterminated ')) - throw new Recoverable(e); - // If the parse error is before the first "await", then use the execution - // error. Otherwise we must emit this parse error, making it look like a - // proper syntax error. - const awaitPos = StringPrototypeIndexOf(src, 'await'); - const errPos = e.pos - wrapPrefix.length; - if (awaitPos > errPos) - return null; - // Convert keyword parse errors on await into their original errors when - // possible. - if (errPos === awaitPos + 6 && - StringPrototypeIncludes(e.message, 'Expecting Unicode escape sequence')) - return null; - if (errPos === awaitPos + 7 && - StringPrototypeIncludes(e.message, 'Unexpected token')) - return null; - const line = e.loc.line; - const column = line === 1 ? e.loc.column - wrapPrefix.length : e.loc.column; - let message = '\n' + StringPrototypeSplit(src, '\n')[line - 1] + '\n' + - StringPrototypeRepeat(' ', column) + - '^\n\n' + RegExpPrototypeSymbolReplace(/ \([^)]+\)/, e.message, ''); - // V8 unexpected token errors include the token string. - if (StringPrototypeEndsWith(message, 'Unexpected token')) - message += " '" + - // Wrapper end may cause acorn to report error position after the source - ((src.length - 1) >= (e.pos - wrapPrefix.length) - ? src[e.pos - wrapPrefix.length] - : src[src.length - 1]) + - "'"; - // eslint-disable-next-line no-restricted-syntax - throw new SyntaxError(message); - } - const body = root.body[0].expression.callee.body; - const state = { - body, - ancestors: [], - hoistedDeclarationStatements: [], - replace(from, to, str) { - for (let i = from; i < to; i++) { - wrappedArray[i] = ''; - } - if (from === to) str += wrappedArray[from]; - wrappedArray[from] = str; - }, - prepend(node, str) { - wrappedArray[node.start] = str + wrappedArray[node.start]; - }, - append(node, str) { - wrappedArray[node.end - 1] += str; - }, - containsAwait: false, - containsReturn: false - }; - - walk.recursive(body, state, visitors); - - // Do not transform if - // 1. False alarm: there isn't actually an await expression. - // 2. There is a top-level return, which is not allowed. - if (!state.containsAwait || state.containsReturn) { - return null; - } - - const last = body.body[body.body.length - 1]; - if (last.type === 'ExpressionStatement') { - // For an expression statement of the form - // ( expr ) ; - // ^^^^^^^^^^ // last - // ^^^^ // last.expression - // - // We do not want the left parenthesis before the `return` keyword; - // therefore we prepend the `return (` to `last`. - // - // On the other hand, we do not want the right parenthesis after the - // semicolon. Since there can only be more right parentheses between - // last.expression.end and the semicolon, appending one more to - // last.expression should be fine. - state.prepend(last, 'return ('); - state.append(last.expression, ')'); - } - - return ( - ArrayPrototypeJoin(state.hoistedDeclarationStatements, '') + - ArrayPrototypeJoin(wrappedArray, '') - ); -} - -module.exports = { - processTopLevelAwait -}; diff --git a/node_modules/ts-node/dist-raw/node-internalBinding-fs.js b/node_modules/ts-node/dist-raw/node-internalBinding-fs.js deleted file mode 100644 index e85bc82..0000000 --- a/node_modules/ts-node/dist-raw/node-internalBinding-fs.js +++ /dev/null @@ -1,58 +0,0 @@ -const fs = require('fs'); -const {versionGteLt} = require('../dist/util'); - -// In node's core, this is implemented in C -// https://github.com/nodejs/node/blob/v15.3.0/src/node_file.cc#L891-L985 -/** - * @param {string} path - * @returns {[] | [string, boolean]} - */ -function internalModuleReadJSON(path) { - let string - try { - string = fs.readFileSync(path, 'utf8') - } catch (e) { - if (e.code === 'ENOENT') return [] - throw e - } - // Node's implementation checks for the presence of relevant keys: main, name, type, exports, imports - // Node does this for performance to skip unnecessary parsing. - // This would slow us down and, based on our usage, we can skip it. - const containsKeys = true - return [string, containsKeys] -} - -// In node's core, this is implemented in C -// https://github.com/nodejs/node/blob/63e7dc1e5c71b70c80ed9eda230991edb00811e2/src/node_file.cc#L987-L1005 -/** - * @param {string} path - * @returns {number} 0 = file, 1 = dir, negative = error - */ -function internalModuleStat(path) { - const stat = fs.statSync(path, { throwIfNoEntry: false }); - if(!stat) return -1; - if(stat.isFile()) return 0; - if(stat.isDirectory()) return 1; -} - -/** - * @param {string} path - * @returns {number} 0 = file, 1 = dir, negative = error - */ -function internalModuleStatInefficient(path) { - try { - const stat = fs.statSync(path); - if(stat.isFile()) return 0; - if(stat.isDirectory()) return 1; - } catch(e) { - return -e.errno || -1; - } -} - -const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, '15.3.0') || - versionGteLt(process.versions.node, '14.17.0', '15.0.0'); - -module.exports = { - internalModuleReadJSON, - internalModuleStat: statSupportsThrowIfNoEntry ? internalModuleStat : internalModuleStatInefficient -}; diff --git a/node_modules/ts-node/dist-raw/node-nativemodule.js b/node_modules/ts-node/dist-raw/node-nativemodule.js deleted file mode 100644 index ea54fcd..0000000 --- a/node_modules/ts-node/dist-raw/node-nativemodule.js +++ /dev/null @@ -1,9 +0,0 @@ - -// Node imports this from 'internal/bootstrap/loaders' -const Module = require('module'); -const NativeModule = { - canBeRequiredByUsers(specifier) { - return Module.builtinModules.includes(specifier) - } -}; -exports.NativeModule = NativeModule; diff --git a/node_modules/ts-node/dist-raw/node-options.js b/node_modules/ts-node/dist-raw/node-options.js deleted file mode 100644 index 2272275..0000000 --- a/node_modules/ts-node/dist-raw/node-options.js +++ /dev/null @@ -1,103 +0,0 @@ -// Replacement for node's internal 'internal/options' module - -exports.getOptionValue = getOptionValue; -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} - -let options; -function parseOptions() { - if (!options) { - options = { - '--preserve-symlinks': false, - '--preserve-symlinks-main': false, - '--input-type': undefined, - '--experimental-specifier-resolution': 'explicit', - '--experimental-policy': undefined, - '--conditions': [], - '--pending-deprecation': false, - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv), - ...getOptionValuesFromOtherEnvVars() - } - } -} - -function parseArgv(argv) { - return require('arg')({ - '--preserve-symlinks': Boolean, - '--preserve-symlinks-main': Boolean, - '--input-type': String, - '--experimental-specifier-resolution': String, - // Legacy alias for node versions prior to 12.16 - '--es-module-specifier-resolution': '--experimental-specifier-resolution', - '--experimental-policy': String, - '--conditions': [String], - '--pending-deprecation': Boolean, - '--experimental-json-modules': Boolean, - '--experimental-wasm-modules': Boolean, - }, { - argv, - permissive: true - }); -} - -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || '', errors); - if (errors.length !== 0) { - // TODO: handle errors somehow - } - return envArgv; -} - -// Direct JS port of C implementation: https://github.com/nodejs/node/blob/67ba825037b4082d5d16f922fb9ce54516b4a869/src/node_options.cc#L1024-L1063 -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - - // Backslashes escape the following character - if (c === '\\' && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS " + - "(invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === ' ' && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS " + - "(unterminated string)\n"); - } - return env_argv; -} - -// Get option values that can be specified via env vars besides NODE_OPTIONS -function getOptionValuesFromOtherEnvVars() { - const options = {}; - if(process.env.NODE_PENDING_DEPRECATION === '1') { - options['--pending-deprecation'] = true; - } - return options; -} diff --git a/node_modules/ts-node/dist-raw/node-primordials.js b/node_modules/ts-node/dist-raw/node-primordials.js deleted file mode 100644 index a7c1574..0000000 --- a/node_modules/ts-node/dist-raw/node-primordials.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = { - ArrayFrom: Array.from, - ArrayIsArray: Array.isArray, - ArrayPrototypeShift: (obj) => Array.prototype.shift.call(obj), - ArrayPrototypeForEach: (arr, ...rest) => Array.prototype.forEach.apply(arr, rest), - ArrayPrototypeIncludes: (arr, ...rest) => Array.prototype.includes.apply(arr, rest), - ArrayPrototypeJoin: (arr, ...rest) => Array.prototype.join.apply(arr, rest), - ArrayPrototypePop: (arr, ...rest) => Array.prototype.pop.apply(arr, rest), - ArrayPrototypePush: (arr, ...rest) => Array.prototype.push.apply(arr, rest), - FunctionPrototype: Function.prototype, - JSONParse: JSON.parse, - JSONStringify: JSON.stringify, - ObjectFreeze: Object.freeze, - ObjectKeys: Object.keys, - ObjectGetOwnPropertyNames: Object.getOwnPropertyNames, - ObjectDefineProperty: Object.defineProperty, - ObjectPrototypeHasOwnProperty: (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop), - RegExpPrototypeExec: (obj, string) => RegExp.prototype.exec.call(obj, string), - RegExpPrototypeTest: (obj, string) => RegExp.prototype.test.call(obj, string), - RegExpPrototypeSymbolReplace: (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest), - SafeMap: Map, - SafeSet: Set, - SafeWeakMap: WeakMap, - StringPrototypeEndsWith: (str, ...rest) => String.prototype.endsWith.apply(str, rest), - StringPrototypeIncludes: (str, ...rest) => String.prototype.includes.apply(str, rest), - StringPrototypeLastIndexOf: (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest), - StringPrototypeIndexOf: (str, ...rest) => String.prototype.indexOf.apply(str, rest), - StringPrototypeRepeat: (str, ...rest) => String.prototype.repeat.apply(str, rest), - StringPrototypeReplace: (str, ...rest) => String.prototype.replace.apply(str, rest), - StringPrototypeSlice: (str, ...rest) => String.prototype.slice.apply(str, rest), - StringPrototypeSplit: (str, ...rest) => String.prototype.split.apply(str, rest), - StringPrototypeStartsWith: (str, ...rest) => String.prototype.startsWith.apply(str, rest), - StringPrototypeSubstr: (str, ...rest) => String.prototype.substr.apply(str, rest), - StringPrototypeCharCodeAt: (str, ...rest) => String.prototype.charCodeAt.apply(str, rest), - StringPrototypeMatch: (str, ...rest) => String.prototype.match.apply(str, rest), - SyntaxError: SyntaxError -}; diff --git a/node_modules/ts-node/dist-raw/runmain-hack.js b/node_modules/ts-node/dist-raw/runmain-hack.js deleted file mode 100644 index 6c0688e..0000000 --- a/node_modules/ts-node/dist-raw/runmain-hack.js +++ /dev/null @@ -1,9 +0,0 @@ -const {pathToFileURL} = require('url'); - -// Hack to avoid Module.runMain on node 18.6.0 -// Keeping it simple for now, isolated in this file. -// Could theoretically probe `getFormat` impl to determine if `import()` or `Module._load()` is best -// Note that I attempted a try-catch around `Module._load`, but it poisons some sort of cache such that subsequent `import()` is impossible. -exports.run = function(entryPointPath) { - import(pathToFileURL(entryPointPath)); -} diff --git a/node_modules/ts-node/dist/bin-cwd.d.ts b/node_modules/ts-node/dist/bin-cwd.d.ts deleted file mode 100644 index b798801..0000000 --- a/node_modules/ts-node/dist/bin-cwd.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -export {}; diff --git a/node_modules/ts-node/dist/bin-cwd.js b/node_modules/ts-node/dist/bin-cwd.js deleted file mode 100644 index dc241b6..0000000 --- a/node_modules/ts-node/dist/bin-cwd.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bin_1 = require("./bin"); -(0, bin_1.main)(undefined, { '--cwdMode': true }); -//# sourceMappingURL=bin-cwd.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-cwd.js.map b/node_modules/ts-node/dist/bin-cwd.js.map deleted file mode 100644 index f50e7e3..0000000 --- a/node_modules/ts-node/dist/bin-cwd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bin-cwd.js","sourceRoot":"","sources":["../src/bin-cwd.ts"],"names":[],"mappings":";;;AAEA,+BAA6B;AAE7B,IAAA,UAAI,EAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { main } from './bin';\n\nmain(undefined, { '--cwdMode': true });\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-esm.d.ts b/node_modules/ts-node/dist/bin-esm.d.ts deleted file mode 100644 index b798801..0000000 --- a/node_modules/ts-node/dist/bin-esm.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -export {}; diff --git a/node_modules/ts-node/dist/bin-esm.js b/node_modules/ts-node/dist/bin-esm.js deleted file mode 100644 index 3c7a778..0000000 --- a/node_modules/ts-node/dist/bin-esm.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bin_1 = require("./bin"); -(0, bin_1.main)(undefined, { '--esm': true }); -//# sourceMappingURL=bin-esm.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-esm.js.map b/node_modules/ts-node/dist/bin-esm.js.map deleted file mode 100644 index a5fc896..0000000 --- a/node_modules/ts-node/dist/bin-esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bin-esm.js","sourceRoot":"","sources":["../src/bin-esm.ts"],"names":[],"mappings":";;;AAEA,+BAA6B;AAE7B,IAAA,UAAI,EAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { main } from './bin';\n\nmain(undefined, { '--esm': true });\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-script-deprecated.d.ts b/node_modules/ts-node/dist/bin-script-deprecated.d.ts deleted file mode 100644 index b798801..0000000 --- a/node_modules/ts-node/dist/bin-script-deprecated.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -export {}; diff --git a/node_modules/ts-node/dist/bin-script-deprecated.js b/node_modules/ts-node/dist/bin-script-deprecated.js deleted file mode 100644 index 94029dc..0000000 --- a/node_modules/ts-node/dist/bin-script-deprecated.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bin_1 = require("./bin"); -console.warn('ts-script has been deprecated and will be removed in the next major release.', 'Please use ts-node-script instead'); -(0, bin_1.main)(undefined, { '--scriptMode': true }); -//# sourceMappingURL=bin-script-deprecated.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-script-deprecated.js.map b/node_modules/ts-node/dist/bin-script-deprecated.js.map deleted file mode 100644 index 7a116c0..0000000 --- a/node_modules/ts-node/dist/bin-script-deprecated.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bin-script-deprecated.js","sourceRoot":"","sources":["../src/bin-script-deprecated.ts"],"names":[],"mappings":";;;AAEA,+BAA6B;AAE7B,OAAO,CAAC,IAAI,CACV,8EAA8E,EAC9E,mCAAmC,CACpC,CAAC;AAEF,IAAA,UAAI,EAAC,SAAS,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { main } from './bin';\n\nconsole.warn(\n 'ts-script has been deprecated and will be removed in the next major release.',\n 'Please use ts-node-script instead'\n);\n\nmain(undefined, { '--scriptMode': true });\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-script.d.ts b/node_modules/ts-node/dist/bin-script.d.ts deleted file mode 100644 index b798801..0000000 --- a/node_modules/ts-node/dist/bin-script.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -export {}; diff --git a/node_modules/ts-node/dist/bin-script.js b/node_modules/ts-node/dist/bin-script.js deleted file mode 100644 index 3a9c821..0000000 --- a/node_modules/ts-node/dist/bin-script.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bin_1 = require("./bin"); -(0, bin_1.main)(undefined, { '--scriptMode': true }); -//# sourceMappingURL=bin-script.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-script.js.map b/node_modules/ts-node/dist/bin-script.js.map deleted file mode 100644 index 004c805..0000000 --- a/node_modules/ts-node/dist/bin-script.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bin-script.js","sourceRoot":"","sources":["../src/bin-script.ts"],"names":[],"mappings":";;;AAEA,+BAA6B;AAE7B,IAAA,UAAI,EAAC,SAAS,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { main } from './bin';\n\nmain(undefined, { '--scriptMode': true });\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-transpile.d.ts b/node_modules/ts-node/dist/bin-transpile.d.ts deleted file mode 100644 index b798801..0000000 --- a/node_modules/ts-node/dist/bin-transpile.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -export {}; diff --git a/node_modules/ts-node/dist/bin-transpile.js b/node_modules/ts-node/dist/bin-transpile.js deleted file mode 100644 index 7bcdc38..0000000 --- a/node_modules/ts-node/dist/bin-transpile.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bin_1 = require("./bin"); -(0, bin_1.main)(undefined, { '--transpileOnly': true }); -//# sourceMappingURL=bin-transpile.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin-transpile.js.map b/node_modules/ts-node/dist/bin-transpile.js.map deleted file mode 100644 index deb663e..0000000 --- a/node_modules/ts-node/dist/bin-transpile.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bin-transpile.js","sourceRoot":"","sources":["../src/bin-transpile.ts"],"names":[],"mappings":";;;AAEA,+BAA6B;AAE7B,IAAA,UAAI,EAAC,SAAS,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { main } from './bin';\n\nmain(undefined, { '--transpileOnly': true });\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin.d.ts b/node_modules/ts-node/dist/bin.d.ts deleted file mode 100644 index 0817f88..0000000 --- a/node_modules/ts-node/dist/bin.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node -/** - * Main `bin` functionality. - * - * This file is split into a chain of functions (phases), each one adding to a shared state object. - * This is done so that the next function can either be invoked in-process or, if necessary, invoked in a child process. - * - * The functions are intentionally given uncreative names and left in the same order as the original code, to make a - * smaller git diff. - */ -export declare function main(argv?: string[], entrypointArgs?: Record): void; diff --git a/node_modules/ts-node/dist/bin.js b/node_modules/ts-node/dist/bin.js deleted file mode 100644 index 0e6fe23..0000000 --- a/node_modules/ts-node/dist/bin.js +++ /dev/null @@ -1,581 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bootstrap = exports.main = void 0; -const path_1 = require("path"); -const util_1 = require("util"); -const Module = require("module"); -let arg; -const util_2 = require("./util"); -const repl_1 = require("./repl"); -const index_1 = require("./index"); -const node_internal_modules_cjs_helpers_1 = require("../dist-raw/node-internal-modules-cjs-helpers"); -const spawn_child_1 = require("./child/spawn-child"); -const configuration_1 = require("./configuration"); -/** - * Main `bin` functionality. - * - * This file is split into a chain of functions (phases), each one adding to a shared state object. - * This is done so that the next function can either be invoked in-process or, if necessary, invoked in a child process. - * - * The functions are intentionally given uncreative names and left in the same order as the original code, to make a - * smaller git diff. - */ -function main(argv = process.argv.slice(2), entrypointArgs = {}) { - const args = parseArgv(argv, entrypointArgs); - const state = { - shouldUseChildProcess: false, - isInChildProcess: false, - isCli: true, - tsNodeScript: __filename, - parseArgvResult: args, - }; - return bootstrap(state); -} -exports.main = main; -/** @internal */ -function bootstrap(state) { - if (!state.phase2Result) { - state.phase2Result = phase2(state); - if (state.shouldUseChildProcess && !state.isInChildProcess) { - // Note: When transitioning into the child-process after `phase2`, - // the updated working directory needs to be preserved. - return (0, spawn_child_1.callInChild)(state); - } - } - if (!state.phase3Result) { - state.phase3Result = phase3(state); - if (state.shouldUseChildProcess && !state.isInChildProcess) { - // Note: When transitioning into the child-process after `phase2`, - // the updated working directory needs to be preserved. - return (0, spawn_child_1.callInChild)(state); - } - } - return phase4(state); -} -exports.bootstrap = bootstrap; -function parseArgv(argv, entrypointArgs) { - arg !== null && arg !== void 0 ? arg : (arg = require('arg')); - // HACK: technically, this function is not marked @internal so it's possible - // that libraries in the wild are doing `require('ts-node/dist/bin').main({'--transpile-only': true})` - // We can mark this function @internal in next major release. - // For now, rewrite args to avoid a breaking change. - entrypointArgs = { ...entrypointArgs }; - for (const key of Object.keys(entrypointArgs)) { - entrypointArgs[key.replace(/([a-z])-([a-z])/g, (_$0, $1, $2) => `${$1}${$2.toUpperCase()}`)] = entrypointArgs[key]; - } - const args = { - ...entrypointArgs, - ...arg({ - // Node.js-like options. - '--eval': String, - '--interactive': Boolean, - '--print': Boolean, - '--require': [String], - // CLI options. - '--help': Boolean, - '--cwdMode': Boolean, - '--scriptMode': Boolean, - '--version': arg.COUNT, - '--showConfig': Boolean, - '--esm': Boolean, - // Project options. - '--cwd': String, - '--files': Boolean, - '--compiler': String, - '--compilerOptions': util_2.parse, - '--project': String, - '--ignoreDiagnostics': [String], - '--ignore': [String], - '--transpileOnly': Boolean, - '--transpiler': String, - '--swc': Boolean, - '--typeCheck': Boolean, - '--compilerHost': Boolean, - '--pretty': Boolean, - '--skipProject': Boolean, - '--skipIgnore': Boolean, - '--preferTsExts': Boolean, - '--logError': Boolean, - '--emit': Boolean, - '--scope': Boolean, - '--scopeDir': String, - '--noExperimentalReplAwait': Boolean, - '--experimentalSpecifierResolution': String, - // Aliases. - '-e': '--eval', - '-i': '--interactive', - '-p': '--print', - '-r': '--require', - '-h': '--help', - '-s': '--script-mode', - '-v': '--version', - '-T': '--transpileOnly', - '-H': '--compilerHost', - '-I': '--ignore', - '-P': '--project', - '-C': '--compiler', - '-D': '--ignoreDiagnostics', - '-O': '--compilerOptions', - '--dir': '--cwd', - // Support both tsc-style camelCase and node-style hypen-case for *all* flags - '--cwd-mode': '--cwdMode', - '--script-mode': '--scriptMode', - '--show-config': '--showConfig', - '--compiler-options': '--compilerOptions', - '--ignore-diagnostics': '--ignoreDiagnostics', - '--transpile-only': '--transpileOnly', - '--type-check': '--typeCheck', - '--compiler-host': '--compilerHost', - '--skip-project': '--skipProject', - '--skip-ignore': '--skipIgnore', - '--prefer-ts-exts': '--preferTsExts', - '--log-error': '--logError', - '--scope-dir': '--scopeDir', - '--no-experimental-repl-await': '--noExperimentalReplAwait', - '--experimental-specifier-resolution': '--experimentalSpecifierResolution', - }, { - argv, - stopAtPositional: true, - }), - }; - // Only setting defaults for CLI-specific flags - // Anything passed to `register()` can be `undefined`; `create()` will apply - // defaults. - const { '--cwd': cwdArg, '--help': help = false, '--scriptMode': scriptMode, '--cwdMode': cwdMode, '--version': version = 0, '--showConfig': showConfig, '--require': argsRequire = [], '--eval': code = undefined, '--print': print = false, '--interactive': interactive = false, '--files': files, '--compiler': compiler, '--compilerOptions': compilerOptions, '--project': project, '--ignoreDiagnostics': ignoreDiagnostics, '--ignore': ignore, '--transpileOnly': transpileOnly, '--typeCheck': typeCheck, '--transpiler': transpiler, '--swc': swc, '--compilerHost': compilerHost, '--pretty': pretty, '--skipProject': skipProject, '--skipIgnore': skipIgnore, '--preferTsExts': preferTsExts, '--logError': logError, '--emit': emit, '--scope': scope = undefined, '--scopeDir': scopeDir = undefined, '--noExperimentalReplAwait': noExperimentalReplAwait, '--experimentalSpecifierResolution': experimentalSpecifierResolution, '--esm': esm, _: restArgs, } = args; - return { - // Note: argv and restArgs may be overwritten by child process - argv: process.argv, - restArgs, - cwdArg, - help, - scriptMode, - cwdMode, - version, - showConfig, - argsRequire, - code, - print, - interactive, - files, - compiler, - compilerOptions, - project, - ignoreDiagnostics, - ignore, - transpileOnly, - typeCheck, - transpiler, - swc, - compilerHost, - pretty, - skipProject, - skipIgnore, - preferTsExts, - logError, - emit, - scope, - scopeDir, - noExperimentalReplAwait, - experimentalSpecifierResolution, - esm, - }; -} -function phase2(payload) { - const { help, version, cwdArg, esm } = payload.parseArgvResult; - if (help) { - console.log(` -Usage: ts-node [options] [ -e script | script.ts ] [arguments] - -Options: - - -e, --eval [code] Evaluate code - -p, --print Print result of \`--eval\` - -r, --require [path] Require a node module before execution - -i, --interactive Opens the REPL even if stdin does not appear to be a terminal - - --esm Bootstrap with the ESM loader, enabling full ESM support - --swc Use the faster swc transpiler - - -h, --help Print CLI usage - -v, --version Print module version information. -vvv to print additional information - --showConfig Print resolved configuration and exit - - -T, --transpileOnly Use TypeScript's faster \`transpileModule\` or a third-party transpiler - -H, --compilerHost Use TypeScript's compiler host API - -I, --ignore [pattern] Override the path patterns to skip compilation - -P, --project [path] Path to TypeScript JSON project file - -C, --compiler [name] Specify a custom TypeScript compiler - --transpiler [name] Specify a third-party, non-typechecking transpiler - -D, --ignoreDiagnostics [code] Ignore TypeScript warnings by diagnostic code - -O, --compilerOptions [opts] JSON object to merge with compiler options - - --cwd Behave as if invoked within this working directory. - --files Load \`files\`, \`include\` and \`exclude\` from \`tsconfig.json\` on startup - --pretty Use pretty diagnostic formatter (usually enabled by default) - --cwdMode Use current directory instead of for config resolution - --skipProject Skip reading \`tsconfig.json\` - --skipIgnore Skip \`--ignore\` checks - --emit Emit output files into \`.ts-node\` directory - --scope Scope compiler to files within \`scopeDir\`. Anything outside this directory is ignored. - --scopeDir Directory for \`--scope\` - --preferTsExts Prefer importing TypeScript files over JavaScript files - --logError Logs TypeScript errors to stderr instead of throwing exceptions - --noExperimentalReplAwait Disable top-level await in REPL. Equivalent to node's --no-experimental-repl-await - --experimentalSpecifierResolution [node|explicit] - Equivalent to node's --experimental-specifier-resolution -`); - process.exit(0); - } - // Output project information. - if (version === 1) { - console.log(`v${index_1.VERSION}`); - process.exit(0); - } - const cwd = cwdArg ? (0, path_1.resolve)(cwdArg) : process.cwd(); - // If ESM is explicitly enabled through the flag, stage3 should be run in a child process - // with the ESM loaders configured. - if (esm) - payload.shouldUseChildProcess = true; - return { - cwd, - }; -} -function phase3(payload) { - const { emit, files, pretty, transpileOnly, transpiler, noExperimentalReplAwait, typeCheck, swc, compilerHost, ignore, preferTsExts, logError, scriptMode, cwdMode, project, skipProject, skipIgnore, compiler, ignoreDiagnostics, compilerOptions, argsRequire, scope, scopeDir, esm, experimentalSpecifierResolution, } = payload.parseArgvResult; - const { cwd } = payload.phase2Result; - // NOTE: When we transition to a child process for ESM, the entry-point script determined - // here might not be the one used later in `phase4`. This can happen when we execute the - // original entry-point but then the process forks itself using e.g. `child_process.fork`. - // We will always use the original TS project in forked processes anyway, so it is - // expected and acceptable to retrieve the entry-point information here in `phase2`. - // See: https://github.com/TypeStrong/ts-node/issues/1812. - const { entryPointPath } = getEntryPointInfo(payload); - const preloadedConfig = (0, configuration_1.findAndReadConfig)({ - cwd, - emit, - files, - pretty, - transpileOnly: (transpileOnly !== null && transpileOnly !== void 0 ? transpileOnly : transpiler != null) ? true : undefined, - experimentalReplAwait: noExperimentalReplAwait ? false : undefined, - typeCheck, - transpiler, - swc, - compilerHost, - ignore, - logError, - projectSearchDir: getProjectSearchDir(cwd, scriptMode, cwdMode, entryPointPath), - project, - skipProject, - skipIgnore, - compiler, - ignoreDiagnostics, - compilerOptions, - require: argsRequire, - scope, - scopeDir, - preferTsExts, - esm, - experimentalSpecifierResolution: experimentalSpecifierResolution, - }); - // If ESM is enabled through the parsed tsconfig, stage4 should be run in a child - // process with the ESM loaders configured. - if (preloadedConfig.options.esm) - payload.shouldUseChildProcess = true; - return { preloadedConfig }; -} -/** - * Determines the entry-point information from the argv and phase2 result. This - * method will be invoked in two places: - * - * 1. In phase 3 to be able to find a project from the potential entry-point script. - * 2. In phase 4 to determine the actual entry-point script. - * - * Note that we need to explicitly re-resolve the entry-point information in the final - * stage because the previous stage information could be modified when the bootstrap - * invocation transitioned into a child process for ESM. - * - * Stages before (phase 4) can and will be cached by the child process through the Brotli - * configuration and entry-point information is only reliable in the final phase. More - * details can be found in here: https://github.com/TypeStrong/ts-node/issues/1812. - */ -function getEntryPointInfo(state) { - const { code, interactive, restArgs } = state.parseArgvResult; - const { cwd } = state.phase2Result; - const { isCli } = state; - // Figure out which we are executing: piped stdin, --eval, REPL, and/or entrypoint - // This is complicated because node's behavior is complicated - // `node -e code -i ./script.js` ignores -e - const executeEval = code != null && !(interactive && restArgs.length); - const executeEntrypoint = !executeEval && restArgs.length > 0; - const executeRepl = !executeEntrypoint && - (interactive || (process.stdin.isTTY && !executeEval)); - const executeStdin = !executeEval && !executeRepl && !executeEntrypoint; - /** - * Unresolved. May point to a symlink, not realpath. May be missing file extension - * NOTE: resolution relative to cwd option (not `process.cwd()`) is legacy backwards-compat; should be changed in next major: https://github.com/TypeStrong/ts-node/issues/1834 - */ - const entryPointPath = executeEntrypoint - ? isCli - ? (0, path_1.resolve)(cwd, restArgs[0]) - : (0, path_1.resolve)(restArgs[0]) - : undefined; - return { - executeEval, - executeEntrypoint, - executeRepl, - executeStdin, - entryPointPath, - }; -} -function phase4(payload) { - var _a, _b, _c, _d, _e, _f, _g; - const { isInChildProcess, tsNodeScript } = payload; - const { version, showConfig, restArgs, code, print, argv } = payload.parseArgvResult; - const { cwd } = payload.phase2Result; - const { preloadedConfig } = payload.phase3Result; - const { entryPointPath, executeEntrypoint, executeEval, executeRepl, executeStdin, } = getEntryPointInfo(payload); - let evalStuff; - let replStuff; - let stdinStuff; - let evalAwarePartialHost = undefined; - if (executeEval) { - const state = new repl_1.EvalState((0, path_1.join)(cwd, repl_1.EVAL_FILENAME)); - evalStuff = { - state, - repl: (0, repl_1.createRepl)({ - state, - composeWithEvalAwarePartialHost: evalAwarePartialHost, - ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl: false, - }), - }; - ({ evalAwarePartialHost } = evalStuff.repl); - // Create a local module instance based on `cwd`. - const module = (evalStuff.module = new Module(repl_1.EVAL_NAME)); - module.filename = evalStuff.state.path; - module.paths = Module._nodeModulePaths(cwd); - } - if (executeStdin) { - const state = new repl_1.EvalState((0, path_1.join)(cwd, repl_1.STDIN_FILENAME)); - stdinStuff = { - state, - repl: (0, repl_1.createRepl)({ - state, - composeWithEvalAwarePartialHost: evalAwarePartialHost, - ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl: false, - }), - }; - ({ evalAwarePartialHost } = stdinStuff.repl); - // Create a local module instance based on `cwd`. - const module = (stdinStuff.module = new Module(repl_1.STDIN_NAME)); - module.filename = stdinStuff.state.path; - module.paths = Module._nodeModulePaths(cwd); - } - if (executeRepl) { - const state = new repl_1.EvalState((0, path_1.join)(cwd, repl_1.REPL_FILENAME)); - replStuff = { - state, - repl: (0, repl_1.createRepl)({ - state, - composeWithEvalAwarePartialHost: evalAwarePartialHost, - }), - }; - ({ evalAwarePartialHost } = replStuff.repl); - } - // Register the TypeScript compiler instance. - const service = (0, index_1.createFromPreloadedConfig)({ - // Since this struct may have been marshalled across thread or process boundaries, we must restore - // un-marshall-able values. - ...preloadedConfig, - options: { - ...preloadedConfig.options, - readFile: (_a = evalAwarePartialHost === null || evalAwarePartialHost === void 0 ? void 0 : evalAwarePartialHost.readFile) !== null && _a !== void 0 ? _a : undefined, - fileExists: (_b = evalAwarePartialHost === null || evalAwarePartialHost === void 0 ? void 0 : evalAwarePartialHost.fileExists) !== null && _b !== void 0 ? _b : undefined, - tsTrace: index_1.DEFAULTS.tsTrace, - }, - }); - (0, index_1.register)(service); - if (isInChildProcess) - require('./child/child-loader').lateBindHooks((0, index_1.createEsmHooks)(service)); - // Bind REPL service to ts-node compiler service (chicken-and-egg problem) - replStuff === null || replStuff === void 0 ? void 0 : replStuff.repl.setService(service); - evalStuff === null || evalStuff === void 0 ? void 0 : evalStuff.repl.setService(service); - stdinStuff === null || stdinStuff === void 0 ? void 0 : stdinStuff.repl.setService(service); - // Output project information. - if (version === 2) { - console.log(`ts-node v${index_1.VERSION}`); - console.log(`node ${process.version}`); - console.log(`compiler v${service.ts.version}`); - process.exit(0); - } - if (version >= 3) { - console.log(`ts-node v${index_1.VERSION} ${(0, path_1.dirname)(__dirname)}`); - console.log(`node ${process.version}`); - console.log(`compiler v${service.ts.version} ${(_c = service.compilerPath) !== null && _c !== void 0 ? _c : ''}`); - process.exit(0); - } - if (showConfig) { - const ts = service.ts; - if (typeof ts.convertToTSConfig !== 'function') { - console.error('Error: --showConfig requires a typescript versions >=3.2 that support --showConfig'); - process.exit(1); - } - let moduleTypes = undefined; - if (service.options.moduleTypes) { - // Assumption: this codepath requires CLI invocation, so moduleTypes must have come from a tsconfig, not API. - const showRelativeTo = (0, path_1.dirname)(service.configFilePath); - moduleTypes = {}; - for (const [key, value] of Object.entries(service.options.moduleTypes)) { - moduleTypes[(0, path_1.relative)(showRelativeTo, (0, path_1.resolve)((_d = service.options.optionBasePaths) === null || _d === void 0 ? void 0 : _d.moduleTypes, key))] = value; - } - } - const json = { - ['ts-node']: { - ...service.options, - require: ((_e = service.options.require) === null || _e === void 0 ? void 0 : _e.length) - ? service.options.require - : undefined, - moduleTypes, - optionBasePaths: undefined, - compilerOptions: undefined, - project: (_f = service.configFilePath) !== null && _f !== void 0 ? _f : service.options.project, - }, - ...ts.convertToTSConfig(service.config, (_g = service.configFilePath) !== null && _g !== void 0 ? _g : (0, path_1.join)(cwd, 'ts-node-implicit-tsconfig.json'), service.ts.sys), - }; - console.log( - // Assumes that all configuration options which can possibly be specified via the CLI are JSON-compatible. - // If, in the future, we must log functions, for example readFile and fileExists, then we can implement a JSON - // replacer function. - JSON.stringify(json, null, 2)); - process.exit(0); - } - // Prepend `ts-node` arguments to CLI for child processes. - process.execArgv.push(tsNodeScript, ...argv.slice(2, argv.length - restArgs.length)); - // TODO this comes from BootstrapState - process.argv = [process.argv[1]] - .concat(executeEntrypoint ? [entryPointPath] : []) - .concat(restArgs.slice(executeEntrypoint ? 1 : 0)); - // Execute the main contents (either eval, script or piped). - if (executeEntrypoint) { - if (payload.isInChildProcess && - (0, util_2.versionGteLt)(process.versions.node, '18.6.0')) { - // HACK workaround node regression - require('../dist-raw/runmain-hack.js').run(entryPointPath); - } - else { - Module.runMain(); - } - } - else { - // Note: eval and repl may both run, but never with stdin. - // If stdin runs, eval and repl will not. - if (executeEval) { - (0, node_internal_modules_cjs_helpers_1.addBuiltinLibsToObject)(global); - evalAndExitOnTsError(evalStuff.repl, evalStuff.module, code, print, 'eval'); - } - if (executeRepl) { - replStuff.repl.start(); - } - if (executeStdin) { - let buffer = code || ''; - process.stdin.on('data', (chunk) => (buffer += chunk)); - process.stdin.on('end', () => { - evalAndExitOnTsError(stdinStuff.repl, stdinStuff.module, buffer, - // `echo 123 | node -p` still prints 123 - print, 'stdin'); - }); - } - } -} -/** - * Get project search path from args. - */ -function getProjectSearchDir(cwd, scriptMode, cwdMode, scriptPath) { - // Validate `--script-mode` / `--cwd-mode` / `--cwd` usage is correct. - if (scriptMode && cwdMode) { - throw new TypeError('--cwd-mode cannot be combined with --script-mode'); - } - if (scriptMode && !scriptPath) { - throw new TypeError('--script-mode must be used with a script name, e.g. `ts-node --script-mode `'); - } - const doScriptMode = scriptMode === true ? true : cwdMode === true ? false : !!scriptPath; - if (doScriptMode) { - // Use node's own resolution behavior to ensure we follow symlinks. - // scriptPath may omit file extension or point to a directory with or without package.json. - // This happens before we are registered, so we tell node's resolver to consider ts, tsx, and jsx files. - // In extremely rare cases, is is technically possible to resolve the wrong directory, - // because we do not yet know preferTsExts, jsx, nor allowJs. - // See also, justification why this will not happen in real-world situations: - // https://github.com/TypeStrong/ts-node/pull/1009#issuecomment-613017081 - const exts = ['.js', '.jsx', '.ts', '.tsx']; - const extsTemporarilyInstalled = []; - for (const ext of exts) { - if (!(0, util_2.hasOwnProperty)(require.extensions, ext)) { - extsTemporarilyInstalled.push(ext); - require.extensions[ext] = function () { }; - } - } - try { - return (0, path_1.dirname)(requireResolveNonCached(scriptPath)); - } - finally { - for (const ext of extsTemporarilyInstalled) { - delete require.extensions[ext]; - } - } - } - return cwd; -} -const guaranteedNonexistentDirectoryPrefix = (0, path_1.resolve)(__dirname, 'doesnotexist'); -let guaranteedNonexistentDirectorySuffix = 0; -/** - * require.resolve an absolute path, tricking node into *not* caching the results. - * Necessary so that we do not pollute require.resolve cache prior to installing require.extensions - * - * Is a terrible hack, because node does not expose the necessary cache invalidation APIs - * https://stackoverflow.com/questions/59865584/how-to-invalidate-cached-require-resolve-results - */ -function requireResolveNonCached(absoluteModuleSpecifier) { - // node <= 12.1.x fallback: The trick below triggers a node bug on old versions. - // On these old versions, pollute the require cache instead. This is a deliberate - // ts-node limitation that will *rarely* manifest, and will not matter once node 12 - // is end-of-life'd on 2022-04-30 - const isSupportedNodeVersion = (0, util_2.versionGteLt)(process.versions.node, '12.2.0'); - if (!isSupportedNodeVersion) - return require.resolve(absoluteModuleSpecifier); - const { dir, base } = (0, path_1.parse)(absoluteModuleSpecifier); - const relativeModuleSpecifier = `./${base}`; - const req = (0, util_2.createRequire)((0, path_1.join)(dir, 'imaginaryUncacheableRequireResolveScript')); - return req.resolve(relativeModuleSpecifier, { - paths: [ - `${guaranteedNonexistentDirectoryPrefix}${guaranteedNonexistentDirectorySuffix++}`, - ...(req.resolve.paths(relativeModuleSpecifier) || []), - ], - }); -} -/** - * Evaluate an [eval] or [stdin] script - */ -function evalAndExitOnTsError(replService, module, code, isPrinted, filenameAndDirname) { - let result; - (0, repl_1.setupContext)(global, module, filenameAndDirname); - try { - result = replService.evalCode(code); - } - catch (error) { - if (error instanceof index_1.TSError) { - console.error(error); - process.exit(1); - } - throw error; - } - if (isPrinted) { - console.log(typeof result === 'string' - ? result - : (0, util_1.inspect)(result, { colors: process.stdout.isTTY })); - } -} -if (require.main === module) { - main(); -} -//# sourceMappingURL=bin.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/bin.js.map b/node_modules/ts-node/dist/bin.js.map deleted file mode 100644 index efb2739..0000000 --- a/node_modules/ts-node/dist/bin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;;AAEA,+BAA4E;AAC5E,+BAA+B;AAC/B,iCAAkC;AAClC,IAAI,GAAyB,CAAC;AAC9B,iCAA4E;AAC5E,iCAWgB;AAChB,mCAQiB;AAEjB,qGAAuF;AACvF,qDAAkD;AAClD,mDAAoD;AAEpD;;;;;;;;GAQG;AACH,SAAgB,IAAI,CAClB,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EACtC,iBAAsC,EAAE;IAExC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAmB;QAC5B,qBAAqB,EAAE,KAAK;QAC5B,gBAAgB,EAAE,KAAK;QACvB,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,UAAU;QACxB,eAAe,EAAE,IAAI;KACtB,CAAC;IACF,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAbD,oBAaC;AAqBD,gBAAgB;AAChB,SAAgB,SAAS,CAAC,KAAqB;IAC7C,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;QACvB,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC1D,kEAAkE;YAClE,uDAAuD;YACvD,OAAO,IAAA,yBAAW,EAAC,KAAK,CAAC,CAAC;SAC3B;KACF;IACD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;QACvB,KAAK,CAAC,YAAY,GAAG,MAAM,C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xB,MAAc,EACd,IAAY,EACZ,SAAkB,EAClB,kBAAoC;IAEpC,IAAI,MAAW,CAAC;IAChB,IAAA,mBAAY,EAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAEjD,IAAI;QACF,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,YAAY,eAAO,EAAE;YAC5B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;QAED,MAAM,KAAK,CAAC;KACb;IAED,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,GAAG,CACT,OAAO,MAAM,KAAK,QAAQ;YACxB,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,IAAA,cAAO,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CACtD,CAAC;KACH;AACH,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAC3B,IAAI,EAAE,CAAC;CACR","sourcesContent":["#!/usr/bin/env node\n\nimport { join, resolve, dirname, parse as parsePath, relative } from 'path';\nimport { inspect } from 'util';\nimport Module = require('module');\nlet arg: typeof import('arg');\nimport { parse, createRequire, hasOwnProperty, versionGteLt } from './util';\nimport {\n EVAL_FILENAME,\n EvalState,\n createRepl,\n ReplService,\n setupContext,\n STDIN_FILENAME,\n EvalAwarePartialHost,\n EVAL_NAME,\n STDIN_NAME,\n REPL_FILENAME,\n} from './repl';\nimport {\n VERSION,\n TSError,\n register,\n createEsmHooks,\n createFromPreloadedConfig,\n DEFAULTS,\n ExperimentalSpecifierResolution,\n} from './index';\nimport type { TSInternal } from './ts-compiler-types';\nimport { addBuiltinLibsToObject } from '../dist-raw/node-internal-modules-cjs-helpers';\nimport { callInChild } from './child/spawn-child';\nimport { findAndReadConfig } from './configuration';\n\n/**\n * Main `bin` functionality.\n *\n * This file is split into a chain of functions (phases), each one adding to a shared state object.\n * This is done so that the next function can either be invoked in-process or, if necessary, invoked in a child process.\n *\n * The functions are intentionally given uncreative names and left in the same order as the original code, to make a\n * smaller git diff.\n */\nexport function main(\n argv: string[] = process.argv.slice(2),\n entrypointArgs: Record = {}\n) {\n const args = parseArgv(argv, entrypointArgs);\n const state: BootstrapState = {\n shouldUseChildProcess: false,\n isInChildProcess: false,\n isCli: true,\n tsNodeScript: __filename,\n parseArgvResult: args,\n };\n return bootstrap(state);\n}\n\n/**\n * @internal\n * Describes state of CLI bootstrapping.\n * Can be marshalled when necessary to resume bootstrapping in a child process.\n */\nexport interface BootstrapState {\n isInChildProcess: boolean;\n shouldUseChildProcess: boolean;\n /**\n * True if bootstrapping the ts-node CLI process or the direct child necessitated by `--esm`.\n * false if bootstrapping a subsequently `fork()`ed child.\n */\n isCli: boolean;\n tsNodeScript: string;\n parseArgvResult: ReturnType;\n phase2Result?: ReturnType;\n phase3Result?: ReturnType;\n}\n\n/** @internal */\nexport function bootstrap(state: BootstrapState) {\n if (!state.phase2Result) {\n state.phase2Result = phase2(state);\n if (state.shouldUseChildProcess && !state.isInChildProcess) {\n // Note: When transitioning into the child-process after `phase2`,\n // the updated working directory needs to be preserved.\n return callInChild(state);\n }\n }\n if (!state.phase3Result) {\n state.phase3Result = phase3(state);\n if (state.shouldUseChildProcess && !state.isInChildProcess) {\n // Note: When transitioning into the child-process after `phase2`,\n // the updated working directory needs to be preserved.\n return callInChild(state);\n }\n }\n return phase4(state);\n}\n\nfunction parseArgv(argv: string[], entrypointArgs: Record) {\n arg ??= require('arg');\n // HACK: technically, this function is not marked @internal so it's possible\n // that libraries in the wild are doing `require('ts-node/dist/bin').main({'--transpile-only': true})`\n // We can mark this function @internal in next major release.\n // For now, rewrite args to avoid a breaking change.\n entrypointArgs = { ...entrypointArgs };\n for (const key of Object.keys(entrypointArgs)) {\n entrypointArgs[\n key.replace(\n /([a-z])-([a-z])/g,\n (_$0, $1, $2: string) => `${$1}${$2.toUpperCase()}`\n )\n ] = entrypointArgs[key];\n }\n\n const args = {\n ...entrypointArgs,\n ...arg(\n {\n // Node.js-like options.\n '--eval': String,\n '--interactive': Boolean,\n '--print': Boolean,\n '--require': [String],\n\n // CLI options.\n '--help': Boolean,\n '--cwdMode': Boolean,\n '--scriptMode': Boolean,\n '--version': arg.COUNT,\n '--showConfig': Boolean,\n '--esm': Boolean,\n\n // Project options.\n '--cwd': String,\n '--files': Boolean,\n '--compiler': String,\n '--compilerOptions': parse,\n '--project': String,\n '--ignoreDiagnostics': [String],\n '--ignore': [String],\n '--transpileOnly': Boolean,\n '--transpiler': String,\n '--swc': Boolean,\n '--typeCheck': Boolean,\n '--compilerHost': Boolean,\n '--pretty': Boolean,\n '--skipProject': Boolean,\n '--skipIgnore': Boolean,\n '--preferTsExts': Boolean,\n '--logError': Boolean,\n '--emit': Boolean,\n '--scope': Boolean,\n '--scopeDir': String,\n '--noExperimentalReplAwait': Boolean,\n '--experimentalSpecifierResolution': String,\n\n // Aliases.\n '-e': '--eval',\n '-i': '--interactive',\n '-p': '--print',\n '-r': '--require',\n '-h': '--help',\n '-s': '--script-mode',\n '-v': '--version',\n '-T': '--transpileOnly',\n '-H': '--compilerHost',\n '-I': '--ignore',\n '-P': '--project',\n '-C': '--compiler',\n '-D': '--ignoreDiagnostics',\n '-O': '--compilerOptions',\n '--dir': '--cwd',\n\n // Support both tsc-style camelCase and node-style hypen-case for *all* flags\n '--cwd-mode': '--cwdMode',\n '--script-mode': '--scriptMode',\n '--show-config': '--showConfig',\n '--compiler-options': '--compilerOptions',\n '--ignore-diagnostics': '--ignoreDiagnostics',\n '--transpile-only': '--transpileOnly',\n '--type-check': '--typeCheck',\n '--compiler-host': '--compilerHost',\n '--skip-project': '--skipProject',\n '--skip-ignore': '--skipIgnore',\n '--prefer-ts-exts': '--preferTsExts',\n '--log-error': '--logError',\n '--scope-dir': '--scopeDir',\n '--no-experimental-repl-await': '--noExperimentalReplAwait',\n '--experimental-specifier-resolution':\n '--experimentalSpecifierResolution',\n },\n {\n argv,\n stopAtPositional: true,\n }\n ),\n };\n\n // Only setting defaults for CLI-specific flags\n // Anything passed to `register()` can be `undefined`; `create()` will apply\n // defaults.\n const {\n '--cwd': cwdArg,\n '--help': help = false,\n '--scriptMode': scriptMode,\n '--cwdMode': cwdMode,\n '--version': version = 0,\n '--showConfig': showConfig,\n '--require': argsRequire = [],\n '--eval': code = undefined,\n '--print': print = false,\n '--interactive': interactive = false,\n '--files': files,\n '--compiler': compiler,\n '--compilerOptions': compilerOptions,\n '--project': project,\n '--ignoreDiagnostics': ignoreDiagnostics,\n '--ignore': ignore,\n '--transpileOnly': transpileOnly,\n '--typeCheck': typeCheck,\n '--transpiler': transpiler,\n '--swc': swc,\n '--compilerHost': compilerHost,\n '--pretty': pretty,\n '--skipProject': skipProject,\n '--skipIgnore': skipIgnore,\n '--preferTsExts': preferTsExts,\n '--logError': logError,\n '--emit': emit,\n '--scope': scope = undefined,\n '--scopeDir': scopeDir = undefined,\n '--noExperimentalReplAwait': noExperimentalReplAwait,\n '--experimentalSpecifierResolution': experimentalSpecifierResolution,\n '--esm': esm,\n _: restArgs,\n } = args;\n return {\n // Note: argv and restArgs may be overwritten by child process\n argv: process.argv,\n restArgs,\n\n cwdArg,\n help,\n scriptMode,\n cwdMode,\n version,\n showConfig,\n argsRequire,\n code,\n print,\n interactive,\n files,\n compiler,\n compilerOptions,\n project,\n ignoreDiagnostics,\n ignore,\n transpileOnly,\n typeCheck,\n transpiler,\n swc,\n compilerHost,\n pretty,\n skipProject,\n skipIgnore,\n preferTsExts,\n logError,\n emit,\n scope,\n scopeDir,\n noExperimentalReplAwait,\n experimentalSpecifierResolution,\n esm,\n };\n}\n\nfunction phase2(payload: BootstrapState) {\n const { help, version, cwdArg, esm } = payload.parseArgvResult;\n\n if (help) {\n console.log(`\nUsage: ts-node [options] [ -e script | script.ts ] [arguments]\n\nOptions:\n\n -e, --eval [code] Evaluate code\n -p, --print Print result of \\`--eval\\`\n -r, --require [path] Require a node module before execution\n -i, --interactive Opens the REPL even if stdin does not appear to be a terminal\n\n --esm Bootstrap with the ESM loader, enabling full ESM support\n --swc Use the faster swc transpiler\n\n -h, --help Print CLI usage\n -v, --version Print module version information. -vvv to print additional information\n --showConfig Print resolved configuration and exit\n\n -T, --transpileOnly Use TypeScript's faster \\`transpileModule\\` or a third-party transpiler\n -H, --compilerHost Use TypeScript's compiler host API\n -I, --ignore [pattern] Override the path patterns to skip compilation\n -P, --project [path] Path to TypeScript JSON project file\n -C, --compiler [name] Specify a custom TypeScript compiler\n --transpiler [name] Specify a third-party, non-typechecking transpiler\n -D, --ignoreDiagnostics [code] Ignore TypeScript warnings by diagnostic code\n -O, --compilerOptions [opts] JSON object to merge with compiler options\n\n --cwd Behave as if invoked within this working directory.\n --files Load \\`files\\`, \\`include\\` and \\`exclude\\` from \\`tsconfig.json\\` on startup\n --pretty Use pretty diagnostic formatter (usually enabled by default)\n --cwdMode Use current directory instead of for config resolution\n --skipProject Skip reading \\`tsconfig.json\\`\n --skipIgnore Skip \\`--ignore\\` checks\n --emit Emit output files into \\`.ts-node\\` directory\n --scope Scope compiler to files within \\`scopeDir\\`. Anything outside this directory is ignored.\n --scopeDir Directory for \\`--scope\\`\n --preferTsExts Prefer importing TypeScript files over JavaScript files\n --logError Logs TypeScript errors to stderr instead of throwing exceptions\n --noExperimentalReplAwait Disable top-level await in REPL. Equivalent to node's --no-experimental-repl-await\n --experimentalSpecifierResolution [node|explicit]\n Equivalent to node's --experimental-specifier-resolution\n`);\n\n process.exit(0);\n }\n\n // Output project information.\n if (version === 1) {\n console.log(`v${VERSION}`);\n process.exit(0);\n }\n\n const cwd = cwdArg ? resolve(cwdArg) : process.cwd();\n\n // If ESM is explicitly enabled through the flag, stage3 should be run in a child process\n // with the ESM loaders configured.\n if (esm) payload.shouldUseChildProcess = true;\n\n return {\n cwd,\n };\n}\n\nfunction phase3(payload: BootstrapState) {\n const {\n emit,\n files,\n pretty,\n transpileOnly,\n transpiler,\n noExperimentalReplAwait,\n typeCheck,\n swc,\n compilerHost,\n ignore,\n preferTsExts,\n logError,\n scriptMode,\n cwdMode,\n project,\n skipProject,\n skipIgnore,\n compiler,\n ignoreDiagnostics,\n compilerOptions,\n argsRequire,\n scope,\n scopeDir,\n esm,\n experimentalSpecifierResolution,\n } = payload.parseArgvResult;\n const { cwd } = payload.phase2Result!;\n\n // NOTE: When we transition to a child process for ESM, the entry-point script determined\n // here might not be the one used later in `phase4`. This can happen when we execute the\n // original entry-point but then the process forks itself using e.g. `child_process.fork`.\n // We will always use the original TS project in forked processes anyway, so it is\n // expected and acceptable to retrieve the entry-point information here in `phase2`.\n // See: https://github.com/TypeStrong/ts-node/issues/1812.\n const { entryPointPath } = getEntryPointInfo(payload);\n\n const preloadedConfig = findAndReadConfig({\n cwd,\n emit,\n files,\n pretty,\n transpileOnly: transpileOnly ?? transpiler != null ? true : undefined,\n experimentalReplAwait: noExperimentalReplAwait ? false : undefined,\n typeCheck,\n transpiler,\n swc,\n compilerHost,\n ignore,\n logError,\n projectSearchDir: getProjectSearchDir(\n cwd,\n scriptMode,\n cwdMode,\n entryPointPath\n ),\n project,\n skipProject,\n skipIgnore,\n compiler,\n ignoreDiagnostics,\n compilerOptions,\n require: argsRequire,\n scope,\n scopeDir,\n preferTsExts,\n esm,\n experimentalSpecifierResolution:\n experimentalSpecifierResolution as ExperimentalSpecifierResolution,\n });\n\n // If ESM is enabled through the parsed tsconfig, stage4 should be run in a child\n // process with the ESM loaders configured.\n if (preloadedConfig.options.esm) payload.shouldUseChildProcess = true;\n\n return { preloadedConfig };\n}\n\n/**\n * Determines the entry-point information from the argv and phase2 result. This\n * method will be invoked in two places:\n *\n * 1. In phase 3 to be able to find a project from the potential entry-point script.\n * 2. In phase 4 to determine the actual entry-point script.\n *\n * Note that we need to explicitly re-resolve the entry-point information in the final\n * stage because the previous stage information could be modified when the bootstrap\n * invocation transitioned into a child process for ESM.\n *\n * Stages before (phase 4) can and will be cached by the child process through the Brotli\n * configuration and entry-point information is only reliable in the final phase. More\n * details can be found in here: https://github.com/TypeStrong/ts-node/issues/1812.\n */\nfunction getEntryPointInfo(state: BootstrapState) {\n const { code, interactive, restArgs } = state.parseArgvResult!;\n const { cwd } = state.phase2Result!;\n const { isCli } = state;\n\n // Figure out which we are executing: piped stdin, --eval, REPL, and/or entrypoint\n // This is complicated because node's behavior is complicated\n // `node -e code -i ./script.js` ignores -e\n const executeEval = code != null && !(interactive && restArgs.length);\n const executeEntrypoint = !executeEval && restArgs.length > 0;\n const executeRepl =\n !executeEntrypoint &&\n (interactive || (process.stdin.isTTY && !executeEval));\n const executeStdin = !executeEval && !executeRepl && !executeEntrypoint;\n\n /**\n * Unresolved. May point to a symlink, not realpath. May be missing file extension\n * NOTE: resolution relative to cwd option (not `process.cwd()`) is legacy backwards-compat; should be changed in next major: https://github.com/TypeStrong/ts-node/issues/1834\n */\n const entryPointPath = executeEntrypoint\n ? isCli\n ? resolve(cwd, restArgs[0])\n : resolve(restArgs[0])\n : undefined;\n\n return {\n executeEval,\n executeEntrypoint,\n executeRepl,\n executeStdin,\n entryPointPath,\n };\n}\n\nfunction phase4(payload: BootstrapState) {\n const { isInChildProcess, tsNodeScript } = payload;\n const { version, showConfig, restArgs, code, print, argv } =\n payload.parseArgvResult;\n const { cwd } = payload.phase2Result!;\n const { preloadedConfig } = payload.phase3Result!;\n\n const {\n entryPointPath,\n executeEntrypoint,\n executeEval,\n executeRepl,\n executeStdin,\n } = getEntryPointInfo(payload);\n\n /**\n * , [stdin], and [eval] are all essentially virtual files that do not exist on disc and are backed by a REPL\n * service to handle eval-ing of code.\n */\n interface VirtualFileState {\n state: EvalState;\n repl: ReplService;\n module?: Module;\n }\n let evalStuff: VirtualFileState | undefined;\n let replStuff: VirtualFileState | undefined;\n let stdinStuff: VirtualFileState | undefined;\n let evalAwarePartialHost: EvalAwarePartialHost | undefined = undefined;\n if (executeEval) {\n const state = new EvalState(join(cwd, EVAL_FILENAME));\n evalStuff = {\n state,\n repl: createRepl({\n state,\n composeWithEvalAwarePartialHost: evalAwarePartialHost,\n ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl: false,\n }),\n };\n ({ evalAwarePartialHost } = evalStuff.repl);\n // Create a local module instance based on `cwd`.\n const module = (evalStuff.module = new Module(EVAL_NAME));\n module.filename = evalStuff.state.path;\n module.paths = (Module as any)._nodeModulePaths(cwd);\n }\n if (executeStdin) {\n const state = new EvalState(join(cwd, STDIN_FILENAME));\n stdinStuff = {\n state,\n repl: createRepl({\n state,\n composeWithEvalAwarePartialHost: evalAwarePartialHost,\n ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl: false,\n }),\n };\n ({ evalAwarePartialHost } = stdinStuff.repl);\n // Create a local module instance based on `cwd`.\n const module = (stdinStuff.module = new Module(STDIN_NAME));\n module.filename = stdinStuff.state.path;\n module.paths = (Module as any)._nodeModulePaths(cwd);\n }\n if (executeRepl) {\n const state = new EvalState(join(cwd, REPL_FILENAME));\n replStuff = {\n state,\n repl: createRepl({\n state,\n composeWithEvalAwarePartialHost: evalAwarePartialHost,\n }),\n };\n ({ evalAwarePartialHost } = replStuff.repl);\n }\n\n // Register the TypeScript compiler instance.\n const service = createFromPreloadedConfig({\n // Since this struct may have been marshalled across thread or process boundaries, we must restore\n // un-marshall-able values.\n ...preloadedConfig,\n options: {\n ...preloadedConfig.options,\n readFile: evalAwarePartialHost?.readFile ?? undefined,\n fileExists: evalAwarePartialHost?.fileExists ?? undefined,\n tsTrace: DEFAULTS.tsTrace,\n },\n });\n register(service);\n if (isInChildProcess)\n (\n require('./child/child-loader') as typeof import('./child/child-loader')\n ).lateBindHooks(createEsmHooks(service));\n\n // Bind REPL service to ts-node compiler service (chicken-and-egg problem)\n replStuff?.repl.setService(service);\n evalStuff?.repl.setService(service);\n stdinStuff?.repl.setService(service);\n\n // Output project information.\n if (version === 2) {\n console.log(`ts-node v${VERSION}`);\n console.log(`node ${process.version}`);\n console.log(`compiler v${service.ts.version}`);\n process.exit(0);\n }\n if (version >= 3) {\n console.log(`ts-node v${VERSION} ${dirname(__dirname)}`);\n console.log(`node ${process.version}`);\n console.log(\n `compiler v${service.ts.version} ${service.compilerPath ?? ''}`\n );\n process.exit(0);\n }\n\n if (showConfig) {\n const ts = service.ts as any as TSInternal;\n if (typeof ts.convertToTSConfig !== 'function') {\n console.error(\n 'Error: --showConfig requires a typescript versions >=3.2 that support --showConfig'\n );\n process.exit(1);\n }\n let moduleTypes = undefined;\n if (service.options.moduleTypes) {\n // Assumption: this codepath requires CLI invocation, so moduleTypes must have come from a tsconfig, not API.\n const showRelativeTo = dirname(service.configFilePath!);\n moduleTypes = {} as Record;\n for (const [key, value] of Object.entries(service.options.moduleTypes)) {\n moduleTypes[\n relative(\n showRelativeTo,\n resolve(service.options.optionBasePaths?.moduleTypes!, key)\n )\n ] = value;\n }\n }\n const json = {\n ['ts-node']: {\n ...service.options,\n require: service.options.require?.length\n ? service.options.require\n : undefined,\n moduleTypes,\n optionBasePaths: undefined,\n compilerOptions: undefined,\n project: service.configFilePath ?? service.options.project,\n },\n ...ts.convertToTSConfig(\n service.config,\n service.configFilePath ?? join(cwd, 'ts-node-implicit-tsconfig.json'),\n service.ts.sys\n ),\n };\n console.log(\n // Assumes that all configuration options which can possibly be specified via the CLI are JSON-compatible.\n // If, in the future, we must log functions, for example readFile and fileExists, then we can implement a JSON\n // replacer function.\n JSON.stringify(json, null, 2)\n );\n process.exit(0);\n }\n\n // Prepend `ts-node` arguments to CLI for child processes.\n process.execArgv.push(\n tsNodeScript,\n ...argv.slice(2, argv.length - restArgs.length)\n );\n\n // TODO this comes from BootstrapState\n process.argv = [process.argv[1]]\n .concat(executeEntrypoint ? ([entryPointPath] as string[]) : [])\n .concat(restArgs.slice(executeEntrypoint ? 1 : 0));\n\n // Execute the main contents (either eval, script or piped).\n if (executeEntrypoint) {\n if (\n payload.isInChildProcess &&\n versionGteLt(process.versions.node, '18.6.0')\n ) {\n // HACK workaround node regression\n require('../dist-raw/runmain-hack.js').run(entryPointPath);\n } else {\n Module.runMain();\n }\n } else {\n // Note: eval and repl may both run, but never with stdin.\n // If stdin runs, eval and repl will not.\n if (executeEval) {\n addBuiltinLibsToObject(global);\n evalAndExitOnTsError(\n evalStuff!.repl,\n evalStuff!.module!,\n code!,\n print,\n 'eval'\n );\n }\n\n if (executeRepl) {\n replStuff!.repl.start();\n }\n\n if (executeStdin) {\n let buffer = code || '';\n process.stdin.on('data', (chunk: Buffer) => (buffer += chunk));\n process.stdin.on('end', () => {\n evalAndExitOnTsError(\n stdinStuff!.repl,\n stdinStuff!.module!,\n buffer,\n // `echo 123 | node -p` still prints 123\n print,\n 'stdin'\n );\n });\n }\n }\n}\n\n/**\n * Get project search path from args.\n */\nfunction getProjectSearchDir(\n cwd?: string,\n scriptMode?: boolean,\n cwdMode?: boolean,\n scriptPath?: string\n) {\n // Validate `--script-mode` / `--cwd-mode` / `--cwd` usage is correct.\n if (scriptMode && cwdMode) {\n throw new TypeError('--cwd-mode cannot be combined with --script-mode');\n }\n if (scriptMode && !scriptPath) {\n throw new TypeError(\n '--script-mode must be used with a script name, e.g. `ts-node --script-mode `'\n );\n }\n const doScriptMode =\n scriptMode === true ? true : cwdMode === true ? false : !!scriptPath;\n if (doScriptMode) {\n // Use node's own resolution behavior to ensure we follow symlinks.\n // scriptPath may omit file extension or point to a directory with or without package.json.\n // This happens before we are registered, so we tell node's resolver to consider ts, tsx, and jsx files.\n // In extremely rare cases, is is technically possible to resolve the wrong directory,\n // because we do not yet know preferTsExts, jsx, nor allowJs.\n // See also, justification why this will not happen in real-world situations:\n // https://github.com/TypeStrong/ts-node/pull/1009#issuecomment-613017081\n const exts = ['.js', '.jsx', '.ts', '.tsx'];\n const extsTemporarilyInstalled: string[] = [];\n for (const ext of exts) {\n if (!hasOwnProperty(require.extensions, ext)) {\n extsTemporarilyInstalled.push(ext);\n require.extensions[ext] = function () {};\n }\n }\n try {\n return dirname(requireResolveNonCached(scriptPath!));\n } finally {\n for (const ext of extsTemporarilyInstalled) {\n delete require.extensions[ext];\n }\n }\n }\n\n return cwd;\n}\n\nconst guaranteedNonexistentDirectoryPrefix = resolve(__dirname, 'doesnotexist');\nlet guaranteedNonexistentDirectorySuffix = 0;\n\n/**\n * require.resolve an absolute path, tricking node into *not* caching the results.\n * Necessary so that we do not pollute require.resolve cache prior to installing require.extensions\n *\n * Is a terrible hack, because node does not expose the necessary cache invalidation APIs\n * https://stackoverflow.com/questions/59865584/how-to-invalidate-cached-require-resolve-results\n */\nfunction requireResolveNonCached(absoluteModuleSpecifier: string) {\n // node <= 12.1.x fallback: The trick below triggers a node bug on old versions.\n // On these old versions, pollute the require cache instead. This is a deliberate\n // ts-node limitation that will *rarely* manifest, and will not matter once node 12\n // is end-of-life'd on 2022-04-30\n const isSupportedNodeVersion = versionGteLt(process.versions.node, '12.2.0');\n if (!isSupportedNodeVersion) return require.resolve(absoluteModuleSpecifier);\n\n const { dir, base } = parsePath(absoluteModuleSpecifier);\n const relativeModuleSpecifier = `./${base}`;\n\n const req = createRequire(\n join(dir, 'imaginaryUncacheableRequireResolveScript')\n );\n return req.resolve(relativeModuleSpecifier, {\n paths: [\n `${guaranteedNonexistentDirectoryPrefix}${guaranteedNonexistentDirectorySuffix++}`,\n ...(req.resolve.paths(relativeModuleSpecifier) || []),\n ],\n });\n}\n\n/**\n * Evaluate an [eval] or [stdin] script\n */\nfunction evalAndExitOnTsError(\n replService: ReplService,\n module: Module,\n code: string,\n isPrinted: boolean,\n filenameAndDirname: 'eval' | 'stdin'\n) {\n let result: any;\n setupContext(global, module, filenameAndDirname);\n\n try {\n result = replService.evalCode(code);\n } catch (error) {\n if (error instanceof TSError) {\n console.error(error);\n process.exit(1);\n }\n\n throw error;\n }\n\n if (isPrinted) {\n console.log(\n typeof result === 'string'\n ? result\n : inspect(result, { colors: process.stdout.isTTY })\n );\n }\n}\n\nif (require.main === module) {\n main();\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/argv-payload.d.ts b/node_modules/ts-node/dist/child/argv-payload.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/child/argv-payload.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/child/argv-payload.js b/node_modules/ts-node/dist/child/argv-payload.js deleted file mode 100644 index 669e747..0000000 --- a/node_modules/ts-node/dist/child/argv-payload.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decompress = exports.compress = exports.argPrefix = void 0; -const zlib_1 = require("zlib"); -/** @internal */ -exports.argPrefix = '--brotli-base64-config='; -/** @internal */ -function compress(object) { - return (0, zlib_1.brotliCompressSync)(Buffer.from(JSON.stringify(object), 'utf8'), { - [zlib_1.constants.BROTLI_PARAM_QUALITY]: zlib_1.constants.BROTLI_MIN_QUALITY, - }).toString('base64'); -} -exports.compress = compress; -/** @internal */ -function decompress(str) { - return JSON.parse((0, zlib_1.brotliDecompressSync)(Buffer.from(str, 'base64')).toString()); -} -exports.decompress = decompress; -//# sourceMappingURL=argv-payload.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/argv-payload.js.map b/node_modules/ts-node/dist/child/argv-payload.js.map deleted file mode 100644 index 84a3b8f..0000000 --- a/node_modules/ts-node/dist/child/argv-payload.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argv-payload.js","sourceRoot":"","sources":["../../src/child/argv-payload.ts"],"names":[],"mappings":";;;AAAA,+BAA2E;AAE3E,gBAAgB;AACH,QAAA,SAAS,GAAG,yBAAyB,CAAC;AAEnD,gBAAgB;AAChB,SAAgB,QAAQ,CAAC,MAAW;IAClC,OAAO,IAAA,yBAAkB,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE;QACrE,CAAC,gBAAS,CAAC,oBAAoB,CAAC,EAAE,gBAAS,CAAC,kBAAkB;KAC/D,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAJD,4BAIC;AAED,gBAAgB;AAChB,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,IAAI,CAAC,KAAK,CACf,IAAA,2BAAoB,EAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAC5D,CAAC;AACJ,CAAC;AAJD,gCAIC","sourcesContent":["import { brotliCompressSync, brotliDecompressSync, constants } from 'zlib';\n\n/** @internal */\nexport const argPrefix = '--brotli-base64-config=';\n\n/** @internal */\nexport function compress(object: any) {\n return brotliCompressSync(Buffer.from(JSON.stringify(object), 'utf8'), {\n [constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MIN_QUALITY,\n }).toString('base64');\n}\n\n/** @internal */\nexport function decompress(str: string) {\n return JSON.parse(\n brotliDecompressSync(Buffer.from(str, 'base64')).toString()\n );\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/child-entrypoint.d.ts b/node_modules/ts-node/dist/child/child-entrypoint.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/child/child-entrypoint.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/child/child-entrypoint.js b/node_modules/ts-node/dist/child/child-entrypoint.js deleted file mode 100644 index f498b4c..0000000 --- a/node_modules/ts-node/dist/child/child-entrypoint.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bin_1 = require("../bin"); -const argv_payload_1 = require("./argv-payload"); -const base64ConfigArg = process.argv[2]; -if (!base64ConfigArg.startsWith(argv_payload_1.argPrefix)) - throw new Error('unexpected argv'); -const base64Payload = base64ConfigArg.slice(argv_payload_1.argPrefix.length); -const state = (0, argv_payload_1.decompress)(base64Payload); -state.isInChildProcess = true; -state.tsNodeScript = __filename; -state.parseArgvResult.argv = process.argv; -state.parseArgvResult.restArgs = process.argv.slice(3); -// Modify and re-compress the payload delivered to subsequent child processes. -// This logic may be refactored into bin.ts by https://github.com/TypeStrong/ts-node/issues/1831 -if (state.isCli) { - const stateForChildren = { - ...state, - isCli: false, - }; - state.parseArgvResult.argv[2] = `${argv_payload_1.argPrefix}${(0, argv_payload_1.compress)(stateForChildren)}`; -} -(0, bin_1.bootstrap)(state); -//# sourceMappingURL=child-entrypoint.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/child-entrypoint.js.map b/node_modules/ts-node/dist/child/child-entrypoint.js.map deleted file mode 100644 index bdab0f0..0000000 --- a/node_modules/ts-node/dist/child/child-entrypoint.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"child-entrypoint.js","sourceRoot":"","sources":["../../src/child/child-entrypoint.ts"],"names":[],"mappings":";;AAAA,gCAAmD;AACnD,iDAAiE;AAEjE,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACxC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,wBAAS,CAAC;IAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAC/E,MAAM,aAAa,GAAG,eAAe,CAAC,KAAK,CAAC,wBAAS,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,KAAK,GAAG,IAAA,yBAAU,EAAC,aAAa,CAAmB,CAAC;AAE1D,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;AAC9B,KAAK,CAAC,YAAY,GAAG,UAAU,CAAC;AAChC,KAAK,CAAC,eAAe,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC1C,KAAK,CAAC,eAAe,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEvD,8EAA8E;AAC9E,gGAAgG;AAChG,IAAI,KAAK,CAAC,KAAK,EAAE;IACf,MAAM,gBAAgB,GAAmB;QACvC,GAAG,KAAK;QACR,KAAK,EAAE,KAAK;KACb,CAAC;IACF,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,wBAAS,GAAG,IAAA,uBAAQ,EAAC,gBAAgB,CAAC,EAAE,CAAC;CAC7E;AAED,IAAA,eAAS,EAAC,KAAK,CAAC,CAAC","sourcesContent":["import { BootstrapState, bootstrap } from '../bin';\nimport { argPrefix, compress, decompress } from './argv-payload';\n\nconst base64ConfigArg = process.argv[2];\nif (!base64ConfigArg.startsWith(argPrefix)) throw new Error('unexpected argv');\nconst base64Payload = base64ConfigArg.slice(argPrefix.length);\nconst state = decompress(base64Payload) as BootstrapState;\n\nstate.isInChildProcess = true;\nstate.tsNodeScript = __filename;\nstate.parseArgvResult.argv = process.argv;\nstate.parseArgvResult.restArgs = process.argv.slice(3);\n\n// Modify and re-compress the payload delivered to subsequent child processes.\n// This logic may be refactored into bin.ts by https://github.com/TypeStrong/ts-node/issues/1831\nif (state.isCli) {\n const stateForChildren: BootstrapState = {\n ...state,\n isCli: false,\n };\n state.parseArgvResult.argv[2] = `${argPrefix}${compress(stateForChildren)}`;\n}\n\nbootstrap(state);\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/child-loader.d.ts b/node_modules/ts-node/dist/child/child-loader.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/child/child-loader.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/child/child-loader.js b/node_modules/ts-node/dist/child/child-loader.js deleted file mode 100644 index a56286e..0000000 --- a/node_modules/ts-node/dist/child/child-loader.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -var _a; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformSource = exports.getFormat = exports.load = exports.resolve = exports.lateBindHooks = void 0; -const esm_1 = require("../esm"); -let hooks; -/** @internal */ -function lateBindHooks(_hooks) { - hooks = _hooks; -} -exports.lateBindHooks = lateBindHooks; -const proxy = { - resolve(...args) { - var _a; - return ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.resolve) !== null && _a !== void 0 ? _a : args[2])(...args); - }, - load(...args) { - var _a; - return ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.load) !== null && _a !== void 0 ? _a : args[2])(...args); - }, - getFormat(...args) { - var _a; - return ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.getFormat) !== null && _a !== void 0 ? _a : args[2])(...args); - }, - transformSource(...args) { - var _a; - return ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.transformSource) !== null && _a !== void 0 ? _a : args[2])(...args); - }, -}; -/** @internal */ -_a = (0, esm_1.filterHooksByAPIVersion)(proxy), exports.resolve = _a.resolve, exports.load = _a.load, exports.getFormat = _a.getFormat, exports.transformSource = _a.transformSource; -//# sourceMappingURL=child-loader.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/child-loader.js.map b/node_modules/ts-node/dist/child/child-loader.js.map deleted file mode 100644 index 3c59ed6..0000000 --- a/node_modules/ts-node/dist/child/child-loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"child-loader.js","sourceRoot":"","sources":["../../src/child/child-loader.ts"],"names":[],"mappings":";;;;AACA,gCAAiD;AAEjD,IAAI,KAAgD,CAAC;AAErD,gBAAgB;AAChB,SAAgB,aAAa,CAC3B,MAAiD;IAEjD,KAAK,GAAG,MAAmD,CAAC;AAC9D,CAAC;AAJD,sCAIC;AAED,MAAM,KAAK,GAA8C;IACvD,OAAO,CAAC,GAAG,IAAgD;;QACzD,OAAO,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,GAAG,IAA6C;;QACnD,OAAO,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,SAAS,CAAC,GAAG,IAAkD;;QAC7D,OAAO,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAChD,CAAC;IACD,eAAe,CAAC,GAAG,IAAwD;;QACzE,OAAO,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACtD,CAAC;CACF,CAAC;AAEF,gBAAgB;AACH,KACX,IAAA,6BAAuB,EAAC,KAAK,CAA8C,EAD9D,eAAO,eAAE,YAAI,YAAE,iBAAS,iBAAE,uBAAe,sBACsB","sourcesContent":["import type { NodeLoaderHooksAPI1, NodeLoaderHooksAPI2 } from '..';\nimport { filterHooksByAPIVersion } from '../esm';\n\nlet hooks: NodeLoaderHooksAPI1 & NodeLoaderHooksAPI2;\n\n/** @internal */\nexport function lateBindHooks(\n _hooks: NodeLoaderHooksAPI1 | NodeLoaderHooksAPI2\n) {\n hooks = _hooks as NodeLoaderHooksAPI1 & NodeLoaderHooksAPI2;\n}\n\nconst proxy: NodeLoaderHooksAPI1 & NodeLoaderHooksAPI2 = {\n resolve(...args: Parameters) {\n return (hooks?.resolve ?? args[2])(...args);\n },\n load(...args: Parameters) {\n return (hooks?.load ?? args[2])(...args);\n },\n getFormat(...args: Parameters) {\n return (hooks?.getFormat ?? args[2])(...args);\n },\n transformSource(...args: Parameters) {\n return (hooks?.transformSource ?? args[2])(...args);\n },\n};\n\n/** @internal */\nexport const { resolve, load, getFormat, transformSource } =\n filterHooksByAPIVersion(proxy) as NodeLoaderHooksAPI1 & NodeLoaderHooksAPI2;\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/child-require.d.ts b/node_modules/ts-node/dist/child/child-require.d.ts deleted file mode 100644 index 1dae4d8..0000000 --- a/node_modules/ts-node/dist/child/child-require.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -interface EventEmitterInternals { - _events: Record>; -} -declare const _process: EventEmitterInternals; -declare let originalOnWarning: Function | undefined; -declare const messageMatch: RegExp; -declare function onWarning(this: any, warning: Error, ...rest: any[]): any; diff --git a/node_modules/ts-node/dist/child/child-require.js b/node_modules/ts-node/dist/child/child-require.js deleted file mode 100644 index 2dbde85..0000000 --- a/node_modules/ts-node/dist/child/child-require.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -const _process = process; -// Not shown here: Additional logic to correctly interact with process's events, either using this direct manipulation, or via the API -let originalOnWarning; -if (Array.isArray(_process._events.warning)) { - originalOnWarning = _process._events.warning[0]; - _process._events.warning[0] = onWarning; -} -else { - originalOnWarning = _process._events.warning; - _process._events.warning = onWarning; -} -const messageMatch = /(?:--(?:experimental-)?loader\b|\bCustom ESM Loaders\b)/; -function onWarning(warning, ...rest) { - // Suppress warning about how `--loader` is experimental - if ((warning === null || warning === void 0 ? void 0 : warning.name) === 'ExperimentalWarning' && - messageMatch.test(warning === null || warning === void 0 ? void 0 : warning.message)) - return; - // Will be undefined if `--no-warnings` - return originalOnWarning === null || originalOnWarning === void 0 ? void 0 : originalOnWarning.call(this, warning, ...rest); -} -//# sourceMappingURL=child-require.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/child-require.js.map b/node_modules/ts-node/dist/child/child-require.js.map deleted file mode 100644 index 51f712c..0000000 --- a/node_modules/ts-node/dist/child/child-require.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"child-require.js","sourceRoot":"","sources":["../../src/child/child-require.ts"],"names":[],"mappings":";AAGA,MAAM,QAAQ,GAAG,OAAuC,CAAC;AAEzD,sIAAsI;AAEtI,IAAI,iBAAuC,CAAC;AAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IAC3C,iBAAiB,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACzC;KAAM;IACL,iBAAiB,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7C,QAAQ,CAAC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,YAAY,GAAG,yDAAyD,CAAC;AAC/E,SAAS,SAAS,CAAY,OAAc,EAAE,GAAG,IAAW;IAC1D,wDAAwD;IACxD,IACE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAK,qBAAqB;QACvC,YAAY,CAAC,IAAI,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC;QAEnC,OAAO;IACT,uCAAuC;IACvC,OAAO,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACzD,CAAC","sourcesContent":["interface EventEmitterInternals {\n _events: Record>;\n}\nconst _process = process as any as EventEmitterInternals;\n\n// Not shown here: Additional logic to correctly interact with process's events, either using this direct manipulation, or via the API\n\nlet originalOnWarning: Function | undefined;\nif (Array.isArray(_process._events.warning)) {\n originalOnWarning = _process._events.warning[0];\n _process._events.warning[0] = onWarning;\n} else {\n originalOnWarning = _process._events.warning;\n _process._events.warning = onWarning;\n}\n\nconst messageMatch = /(?:--(?:experimental-)?loader\\b|\\bCustom ESM Loaders\\b)/;\nfunction onWarning(this: any, warning: Error, ...rest: any[]) {\n // Suppress warning about how `--loader` is experimental\n if (\n warning?.name === 'ExperimentalWarning' &&\n messageMatch.test(warning?.message)\n )\n return;\n // Will be undefined if `--no-warnings`\n return originalOnWarning?.call(this, warning, ...rest);\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/spawn-child.d.ts b/node_modules/ts-node/dist/child/spawn-child.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/child/spawn-child.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/child/spawn-child.js b/node_modules/ts-node/dist/child/spawn-child.js deleted file mode 100644 index 6efdfd7..0000000 --- a/node_modules/ts-node/dist/child/spawn-child.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.callInChild = void 0; -const child_process_1 = require("child_process"); -const url_1 = require("url"); -const util_1 = require("../util"); -const argv_payload_1 = require("./argv-payload"); -/** - * @internal - * @param state Bootstrap state to be transferred into the child process. - * @param targetCwd Working directory to be preserved when transitioning to - * the child process. - */ -function callInChild(state) { - if (!(0, util_1.versionGteLt)(process.versions.node, '12.17.0')) { - throw new Error('`ts-node-esm` and `ts-node --esm` require node version 12.17.0 or newer.'); - } - const child = (0, child_process_1.spawn)(process.execPath, [ - '--require', - require.resolve('./child-require.js'), - '--loader', - // Node on Windows doesn't like `c:\` absolute paths here; must be `file:///c:/` - (0, url_1.pathToFileURL)(require.resolve('../../child-loader.mjs')).toString(), - require.resolve('./child-entrypoint.js'), - `${argv_payload_1.argPrefix}${(0, argv_payload_1.compress)(state)}`, - ...state.parseArgvResult.restArgs, - ], { - stdio: 'inherit', - argv0: process.argv0, - }); - child.on('error', (error) => { - console.error(error); - process.exit(1); - }); - child.on('exit', (code) => { - child.removeAllListeners(); - process.off('SIGINT', sendSignalToChild); - process.off('SIGTERM', sendSignalToChild); - process.exitCode = code === null ? 1 : code; - }); - // Ignore sigint and sigterm in parent; pass them to child - process.on('SIGINT', sendSignalToChild); - process.on('SIGTERM', sendSignalToChild); - function sendSignalToChild(signal) { - process.kill(child.pid, signal); - } -} -exports.callInChild = callInChild; -//# sourceMappingURL=spawn-child.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/child/spawn-child.js.map b/node_modules/ts-node/dist/child/spawn-child.js.map deleted file mode 100644 index 12e7f60..0000000 --- a/node_modules/ts-node/dist/child/spawn-child.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spawn-child.js","sourceRoot":"","sources":["../../src/child/spawn-child.ts"],"names":[],"mappings":";;;AACA,iDAAsC;AACtC,6BAAoC;AACpC,kCAAuC;AACvC,iDAAqD;AAErD;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAqB;IAC/C,IAAI,CAAC,IAAA,mBAAY,EAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;QACnD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;KACH;IACD,MAAM,KAAK,GAAG,IAAA,qBAAK,EACjB,OAAO,CAAC,QAAQ,EAChB;QACE,WAAW;QACX,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACrC,UAAU;QACV,gFAAgF;QAChF,IAAA,mBAAa,EAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,EAAE;QACnE,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC;QACxC,GAAG,wBAAS,GAAG,IAAA,uBAAQ,EAAC,KAAK,CAAC,EAAE;QAChC,GAAG,KAAK,CAAC,eAAe,CAAC,QAAQ;KAClC,EACD;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CACF,CAAC;IACF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACxB,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,0DAA0D;IAC1D,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IACzC,SAAS,iBAAiB,CAAC,MAAc;QACvC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAvCD,kCAuCC","sourcesContent":["import type { BootstrapState } from '../bin';\nimport { spawn } from 'child_process';\nimport { pathToFileURL } from 'url';\nimport { versionGteLt } from '../util';\nimport { argPrefix, compress } from './argv-payload';\n\n/**\n * @internal\n * @param state Bootstrap state to be transferred into the child process.\n * @param targetCwd Working directory to be preserved when transitioning to\n * the child process.\n */\nexport function callInChild(state: BootstrapState) {\n if (!versionGteLt(process.versions.node, '12.17.0')) {\n throw new Error(\n '`ts-node-esm` and `ts-node --esm` require node version 12.17.0 or newer.'\n );\n }\n const child = spawn(\n process.execPath,\n [\n '--require',\n require.resolve('./child-require.js'),\n '--loader',\n // Node on Windows doesn't like `c:\\` absolute paths here; must be `file:///c:/`\n pathToFileURL(require.resolve('../../child-loader.mjs')).toString(),\n require.resolve('./child-entrypoint.js'),\n `${argPrefix}${compress(state)}`,\n ...state.parseArgvResult.restArgs,\n ],\n {\n stdio: 'inherit',\n argv0: process.argv0,\n }\n );\n child.on('error', (error) => {\n console.error(error);\n process.exit(1);\n });\n child.on('exit', (code) => {\n child.removeAllListeners();\n process.off('SIGINT', sendSignalToChild);\n process.off('SIGTERM', sendSignalToChild);\n process.exitCode = code === null ? 1 : code;\n });\n // Ignore sigint and sigterm in parent; pass them to child\n process.on('SIGINT', sendSignalToChild);\n process.on('SIGTERM', sendSignalToChild);\n function sendSignalToChild(signal: string) {\n process.kill(child.pid, signal);\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts b/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/cjs-resolve-hooks.js b/node_modules/ts-node/dist/cjs-resolve-hooks.js deleted file mode 100644 index 8e05695..0000000 --- a/node_modules/ts-node/dist/cjs-resolve-hooks.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.installCommonjsResolveHooksIfNecessary = void 0; -/** - * @internal - */ -function installCommonjsResolveHooksIfNecessary(tsNodeService) { - const Module = require('module'); - const originalResolveFilename = Module._resolveFilename; - const originalFindPath = Module._findPath; - const shouldInstallHook = tsNodeService.options.experimentalResolver; - if (shouldInstallHook) { - const { Module_findPath, Module_resolveFilename } = tsNodeService.getNodeCjsLoader(); - Module._resolveFilename = _resolveFilename; - Module._findPath = _findPath; - function _resolveFilename(request, parent, isMain, options, ...rest) { - if (!tsNodeService.enabled()) - return originalResolveFilename.call(this, request, parent, isMain, options, ...rest); - return Module_resolveFilename.call(this, request, parent, isMain, options, ...rest); - } - function _findPath() { - if (!tsNodeService.enabled()) - return originalFindPath.apply(this, arguments); - return Module_findPath.apply(this, arguments); - } - } -} -exports.installCommonjsResolveHooksIfNecessary = installCommonjsResolveHooksIfNecessary; -//# sourceMappingURL=cjs-resolve-hooks.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/cjs-resolve-hooks.js.map b/node_modules/ts-node/dist/cjs-resolve-hooks.js.map deleted file mode 100644 index 3f49b7d..0000000 --- a/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cjs-resolve-hooks.js","sourceRoot":"","sources":["../src/cjs-resolve-hooks.ts"],"names":[],"mappings":";;;AAoBA;;GAEG;AACH,SAAgB,sCAAsC,CAAC,aAAsB;IAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAmC,CAAC;IACnE,MAAM,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC;IAC1C,MAAM,iBAAiB,GAAG,aAAa,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrE,IAAI,iBAAiB,EAAE;QACrB,MAAM,EAAE,eAAe,EAAE,sBAAsB,EAAE,GAC/C,aAAa,CAAC,gBAAgB,EAAE,CAAC;QACnC,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAC3C,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,SAAS,gBAAgB,CAEvB,OAAe,EACf,MAAe,EACf,MAAgB,EAChB,OAAsC,EACtC,GAAG,IAAQ;YAEX,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;gBAC1B,OAAO,uBAAuB,CAAC,IAAI,CACjC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,GAAG,IAAI,CACR,CAAC;YAEJ,OAAO,sBAAsB,CAAC,IAAI,CAChC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,GAAG,IAAI,CACR,CAAC;QACJ,CAAC;QACD,SAAS,SAAS;YAChB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;gBAC1B,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,SAAgB,CAAC,CAAC;YACxD,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,SAAgB,CAAC,CAAC;QACvD,CAAC;KACF;AACH,CAAC;AA3CD,wFA2CC","sourcesContent":["import type Module = require('module');\nimport type { Service } from '.';\n\n/** @internal */\nexport type ModuleConstructorWithInternals = typeof Module & {\n _resolveFilename(\n request: string,\n parent?: Module,\n isMain?: boolean,\n options?: ModuleResolveFilenameOptions,\n ...rest: any[]\n ): string;\n _preloadModules(requests?: string[]): void;\n _findPath(request: string, paths: string[], isMain: boolean): string;\n};\n\ninterface ModuleResolveFilenameOptions {\n paths?: Array;\n}\n\n/**\n * @internal\n */\nexport function installCommonjsResolveHooksIfNecessary(tsNodeService: Service) {\n const Module = require('module') as ModuleConstructorWithInternals;\n const originalResolveFilename = Module._resolveFilename;\n const originalFindPath = Module._findPath;\n const shouldInstallHook = tsNodeService.options.experimentalResolver;\n if (shouldInstallHook) {\n const { Module_findPath, Module_resolveFilename } =\n tsNodeService.getNodeCjsLoader();\n Module._resolveFilename = _resolveFilename;\n Module._findPath = _findPath;\n function _resolveFilename(\n this: any,\n request: string,\n parent?: Module,\n isMain?: boolean,\n options?: ModuleResolveFilenameOptions,\n ...rest: []\n ): string {\n if (!tsNodeService.enabled())\n return originalResolveFilename.call(\n this,\n request,\n parent,\n isMain,\n options,\n ...rest\n );\n\n return Module_resolveFilename.call(\n this,\n request,\n parent,\n isMain,\n options,\n ...rest\n );\n }\n function _findPath(this: any): string {\n if (!tsNodeService.enabled())\n return originalFindPath.apply(this, arguments as any);\n return Module_findPath.apply(this, arguments as any);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/configuration.d.ts b/node_modules/ts-node/dist/configuration.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/configuration.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/configuration.js b/node_modules/ts-node/dist/configuration.js deleted file mode 100644 index 2e55dcd..0000000 --- a/node_modules/ts-node/dist/configuration.js +++ /dev/null @@ -1,308 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getTsConfigDefaults = exports.ComputeAsCommonRootOfFiles = exports.loadCompiler = exports.resolveAndLoadCompiler = exports.readConfig = exports.findAndReadConfig = void 0; -const path_1 = require("path"); -const index_1 = require("./index"); -const ts_internals_1 = require("./ts-internals"); -const tsconfigs_1 = require("./tsconfigs"); -const util_1 = require("./util"); -/** - * TypeScript compiler option values required by `ts-node` which cannot be overridden. - */ -const TS_NODE_COMPILER_OPTIONS = { - sourceMap: true, - inlineSourceMap: false, - inlineSources: true, - declaration: false, - noEmit: false, - outDir: '.ts-node', -}; -/* - * Do post-processing on config options to support `ts-node`. - */ -function fixConfig(ts, config) { - // Delete options that *should not* be passed through. - delete config.options.out; - delete config.options.outFile; - delete config.options.composite; - delete config.options.declarationDir; - delete config.options.declarationMap; - delete config.options.emitDeclarationOnly; - // Target ES5 output by default (instead of ES3). - if (config.options.target === undefined) { - config.options.target = ts.ScriptTarget.ES5; - } - // Target CommonJS modules by default (instead of magically switching to ES6 when the target is ES6). - if (config.options.module === undefined) { - config.options.module = ts.ModuleKind.CommonJS; - } - return config; -} -/** @internal */ -function findAndReadConfig(rawOptions) { - var _a, _b, _c, _d, _e; - const cwd = (0, path_1.resolve)((_c = (_b = (_a = rawOptions.cwd) !== null && _a !== void 0 ? _a : rawOptions.dir) !== null && _b !== void 0 ? _b : index_1.DEFAULTS.cwd) !== null && _c !== void 0 ? _c : process.cwd()); - const compilerName = (_d = rawOptions.compiler) !== null && _d !== void 0 ? _d : index_1.DEFAULTS.compiler; - // Compute minimum options to read the config file. - let projectLocalResolveDir = (0, util_1.getBasePathForProjectLocalDependencyResolution)(undefined, rawOptions.projectSearchDir, rawOptions.project, cwd); - let { compiler, ts } = resolveAndLoadCompiler(compilerName, projectLocalResolveDir); - // Read config file and merge new options between env and CLI options. - const { configFilePath, config, tsNodeOptionsFromTsconfig, optionBasePaths } = readConfig(cwd, ts, rawOptions); - const options = (0, util_1.assign)({}, index_1.DEFAULTS, tsNodeOptionsFromTsconfig || {}, { optionBasePaths }, rawOptions); - options.require = [ - ...(tsNodeOptionsFromTsconfig.require || []), - ...(rawOptions.require || []), - ]; - // Re-resolve the compiler in case it has changed. - // Compiler is loaded relative to tsconfig.json, so tsconfig discovery may cause us to load a - // different compiler than we did above, even if the name has not changed. - if (configFilePath) { - projectLocalResolveDir = (0, util_1.getBasePathForProjectLocalDependencyResolution)(configFilePath, rawOptions.projectSearchDir, rawOptions.project, cwd); - ({ compiler } = resolveCompiler(options.compiler, (_e = optionBasePaths.compiler) !== null && _e !== void 0 ? _e : projectLocalResolveDir)); - } - return { - options, - config, - projectLocalResolveDir, - optionBasePaths, - configFilePath, - cwd, - compiler, - }; -} -exports.findAndReadConfig = findAndReadConfig; -/** - * Load TypeScript configuration. Returns the parsed TypeScript config and - * any `ts-node` options specified in the config file. - * - * Even when a tsconfig.json is not loaded, this function still handles merging - * compilerOptions from various sources: API, environment variables, etc. - * - * @internal - */ -function readConfig(cwd, ts, rawApiOptions) { - var _a, _b, _c; - // Ordered [a, b, c] where config a extends b extends c - const configChain = []; - let config = { compilerOptions: {} }; - let basePath = cwd; - let configFilePath = undefined; - const projectSearchDir = (0, path_1.resolve)(cwd, (_a = rawApiOptions.projectSearchDir) !== null && _a !== void 0 ? _a : cwd); - const { fileExists = ts.sys.fileExists, readFile = ts.sys.readFile, skipProject = index_1.DEFAULTS.skipProject, project = index_1.DEFAULTS.project, tsTrace = index_1.DEFAULTS.tsTrace, } = rawApiOptions; - // Read project configuration when available. - if (!skipProject) { - if (project) { - const resolved = (0, path_1.resolve)(cwd, project); - const nested = (0, path_1.join)(resolved, 'tsconfig.json'); - configFilePath = fileExists(nested) ? nested : resolved; - } - else { - configFilePath = ts.findConfigFile(projectSearchDir, fileExists); - } - if (configFilePath) { - let pathToNextConfigInChain = configFilePath; - const tsInternals = (0, ts_internals_1.createTsInternals)(ts); - const errors = []; - // Follow chain of "extends" - while (true) { - const result = ts.readConfigFile(pathToNextConfigInChain, readFile); - // Return diagnostics. - if (result.error) { - return { - configFilePath, - config: { errors: [result.error], fileNames: [], options: {} }, - tsNodeOptionsFromTsconfig: {}, - optionBasePaths: {}, - }; - } - const c = result.config; - const bp = (0, path_1.dirname)(pathToNextConfigInChain); - configChain.push({ - config: c, - basePath: bp, - configPath: pathToNextConfigInChain, - }); - if (c.extends == null) - break; - const resolvedExtendedConfigPath = tsInternals.getExtendsConfigPath(c.extends, { - fileExists, - readDirectory: ts.sys.readDirectory, - readFile, - useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, - trace: tsTrace, - }, bp, errors, ts.createCompilerDiagnostic); - if (errors.length) { - return { - configFilePath, - config: { errors, fileNames: [], options: {} }, - tsNodeOptionsFromTsconfig: {}, - optionBasePaths: {}, - }; - } - if (resolvedExtendedConfigPath == null) - break; - pathToNextConfigInChain = resolvedExtendedConfigPath; - } - ({ config, basePath } = configChain[0]); - } - } - // Merge and fix ts-node options that come from tsconfig.json(s) - const tsNodeOptionsFromTsconfig = {}; - const optionBasePaths = {}; - for (let i = configChain.length - 1; i >= 0; i--) { - const { config, basePath, configPath } = configChain[i]; - const options = filterRecognizedTsConfigTsNodeOptions(config['ts-node']).recognized; - // Some options are relative to the config file, so must be converted to absolute paths here - if (options.require) { - // Modules are found relative to the tsconfig file, not the `dir` option - const tsconfigRelativeResolver = (0, util_1.createProjectLocalResolveHelper)((0, path_1.dirname)(configPath)); - options.require = options.require.map((path) => tsconfigRelativeResolver(path, false)); - } - if (options.scopeDir) { - options.scopeDir = (0, path_1.resolve)(basePath, options.scopeDir); - } - // Downstream code uses the basePath; we do not do that here. - if (options.moduleTypes) { - optionBasePaths.moduleTypes = basePath; - } - if (options.transpiler != null) { - optionBasePaths.transpiler = basePath; - } - if (options.compiler != null) { - optionBasePaths.compiler = basePath; - } - if (options.swc != null) { - optionBasePaths.swc = basePath; - } - (0, util_1.assign)(tsNodeOptionsFromTsconfig, options); - } - // Remove resolution of "files". - const files = (_c = (_b = rawApiOptions.files) !== null && _b !== void 0 ? _b : tsNodeOptionsFromTsconfig.files) !== null && _c !== void 0 ? _c : index_1.DEFAULTS.files; - // Only if a config file is *not* loaded, load an implicit configuration from @tsconfig/bases - const skipDefaultCompilerOptions = configFilePath != null; - const defaultCompilerOptionsForNodeVersion = skipDefaultCompilerOptions - ? undefined - : { - ...(0, tsconfigs_1.getDefaultTsconfigJsonForNodeVersion)(ts).compilerOptions, - types: ['node'], - }; - // Merge compilerOptions from all sources - config.compilerOptions = Object.assign({}, - // automatically-applied options from @tsconfig/bases - defaultCompilerOptionsForNodeVersion, - // tsconfig.json "compilerOptions" - config.compilerOptions, - // from env var - index_1.DEFAULTS.compilerOptions, - // tsconfig.json "ts-node": "compilerOptions" - tsNodeOptionsFromTsconfig.compilerOptions, - // passed programmatically - rawApiOptions.compilerOptions, - // overrides required by ts-node, cannot be changed - TS_NODE_COMPILER_OPTIONS); - const fixedConfig = fixConfig(ts, ts.parseJsonConfigFileContent(config, { - fileExists, - readFile, - // Only used for globbing "files", "include", "exclude" - // When `files` option disabled, we want to avoid the fs calls - readDirectory: files ? ts.sys.readDirectory : () => [], - useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, - }, basePath, undefined, configFilePath)); - return { - configFilePath, - config: fixedConfig, - tsNodeOptionsFromTsconfig, - optionBasePaths, - }; -} -exports.readConfig = readConfig; -/** - * Load the typescript compiler. It is required to load the tsconfig but might - * be changed by the tsconfig, so we have to do this twice. - * @internal - */ -function resolveAndLoadCompiler(name, relativeToPath) { - const { compiler } = resolveCompiler(name, relativeToPath); - const ts = loadCompiler(compiler); - return { compiler, ts }; -} -exports.resolveAndLoadCompiler = resolveAndLoadCompiler; -function resolveCompiler(name, relativeToPath) { - const projectLocalResolveHelper = (0, util_1.createProjectLocalResolveHelper)(relativeToPath); - const compiler = projectLocalResolveHelper(name || 'typescript', true); - return { compiler }; -} -/** @internal */ -function loadCompiler(compiler) { - return (0, util_1.attemptRequireWithV8CompileCache)(require, compiler); -} -exports.loadCompiler = loadCompiler; -/** - * Given the raw "ts-node" sub-object from a tsconfig, return an object with only the properties - * recognized by "ts-node" - */ -function filterRecognizedTsConfigTsNodeOptions(jsonObject) { - if (jsonObject == null) - return { recognized: {}, unrecognized: {} }; - const { compiler, compilerHost, compilerOptions, emit, files, ignore, ignoreDiagnostics, logError, preferTsExts, pretty, require, skipIgnore, transpileOnly, typeCheck, transpiler, scope, scopeDir, moduleTypes, experimentalReplAwait, swc, experimentalResolver, esm, experimentalSpecifierResolution, experimentalTsImportSpecifiers, ...unrecognized } = jsonObject; - const filteredTsConfigOptions = { - compiler, - compilerHost, - compilerOptions, - emit, - experimentalReplAwait, - files, - ignore, - ignoreDiagnostics, - logError, - preferTsExts, - pretty, - require, - skipIgnore, - transpileOnly, - typeCheck, - transpiler, - scope, - scopeDir, - moduleTypes, - swc, - experimentalResolver, - esm, - experimentalSpecifierResolution, - experimentalTsImportSpecifiers, - }; - // Use the typechecker to make sure this implementation has the correct set of properties - const catchExtraneousProps = null; - const catchMissingProps = null; - return { recognized: filteredTsConfigOptions, unrecognized }; -} -/** @internal */ -exports.ComputeAsCommonRootOfFiles = Symbol(); -/** - * Some TS compiler options have defaults which are not provided by TS's config parsing functions. - * This function centralizes the logic for computing those defaults. - * @internal - */ -function getTsConfigDefaults(config, basePath, _files, _include, _exclude) { - const { composite = false } = config.options; - let rootDir = config.options.rootDir; - if (rootDir == null) { - if (composite) - rootDir = basePath; - // Return this symbol to avoid computing from `files`, which would require fs calls - else - rootDir = exports.ComputeAsCommonRootOfFiles; - } - const { outDir = rootDir } = config.options; - // Docs are wrong: https://www.typescriptlang.org/tsconfig#include - // Docs say **, but it's actually **/*; compiler throws error for ** - const include = _files ? [] : ['**/*']; - const files = _files !== null && _files !== void 0 ? _files : []; - // Docs are misleading: https://www.typescriptlang.org/tsconfig#exclude - // Docs say it excludes node_modules, bower_components, jspm_packages, but actually those are excluded via behavior of "include" - const exclude = _exclude !== null && _exclude !== void 0 ? _exclude : [outDir]; // TODO technically, outDir is absolute path, but exclude should be relative glob pattern? - // TODO compute baseUrl - return { rootDir, outDir, include, files, exclude, composite }; -} -exports.getTsConfigDefaults = getTsConfigDefaults; -//# sourceMappingURL=configuration.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/configuration.js.map b/node_modules/ts-node/dist/configuration.js.map deleted file mode 100644 index 392a32f..0000000 --- a/node_modules/ts-node/dist/configuration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":";;;AAAA,+BAA8C;AAE9C,mCAOiB;AAEjB,iDAAmD;AACnD,2CAAmE;AACnE,iCAKgB;AAEhB;;GAEG;AACH,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,UAAU;CACnB,CAAC;AAEF;;GAEG;AACH,SAAS,SAAS,CAAC,EAAY,EAAE,MAA6B;IAC5D,sDAAsD;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;IAC1B,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,OAAO,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;IACrC,OAAO,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;IACrC,OAAO,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAE1C,iDAAiD;IACjD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE;QACvC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC;KAC7C;IAED,qGAAqG;IACrG,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE;QACvC,MAAM,CAAC,OA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AA0B,CAAC;KAC3C;IACD,MAAM,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;IAC5C,kEAAkE;IAClE,oEAAoE;IACpE,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;IAC3B,uEAAuE;IACvE,gIAAgI;IAChI,MAAM,OAAO,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,MAAM,CAAC,CAAC,CAAC,0FAA0F;IAEhI,uBAAuB;IAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACjE,CAAC;AA3BD,kDA2BC","sourcesContent":["import { resolve, dirname, join } from 'path';\nimport type * as _ts from 'typescript';\nimport {\n CreateOptions,\n DEFAULTS,\n OptionBasePaths,\n RegisterOptions,\n TSCommon,\n TsConfigOptions,\n} from './index';\nimport type { TSInternal } from './ts-compiler-types';\nimport { createTsInternals } from './ts-internals';\nimport { getDefaultTsconfigJsonForNodeVersion } from './tsconfigs';\nimport {\n assign,\n attemptRequireWithV8CompileCache,\n createProjectLocalResolveHelper,\n getBasePathForProjectLocalDependencyResolution,\n} from './util';\n\n/**\n * TypeScript compiler option values required by `ts-node` which cannot be overridden.\n */\nconst TS_NODE_COMPILER_OPTIONS = {\n sourceMap: true,\n inlineSourceMap: false,\n inlineSources: true,\n declaration: false,\n noEmit: false,\n outDir: '.ts-node',\n};\n\n/*\n * Do post-processing on config options to support `ts-node`.\n */\nfunction fixConfig(ts: TSCommon, config: _ts.ParsedCommandLine) {\n // Delete options that *should not* be passed through.\n delete config.options.out;\n delete config.options.outFile;\n delete config.options.composite;\n delete config.options.declarationDir;\n delete config.options.declarationMap;\n delete config.options.emitDeclarationOnly;\n\n // Target ES5 output by default (instead of ES3).\n if (config.options.target === undefined) {\n config.options.target = ts.ScriptTarget.ES5;\n }\n\n // Target CommonJS modules by default (instead of magically switching to ES6 when the target is ES6).\n if (config.options.module === undefined) {\n config.options.module = ts.ModuleKind.CommonJS;\n }\n\n return config;\n}\n\n/** @internal */\nexport function findAndReadConfig(rawOptions: CreateOptions) {\n const cwd = resolve(\n rawOptions.cwd ?? rawOptions.dir ?? DEFAULTS.cwd ?? process.cwd()\n );\n const compilerName = rawOptions.compiler ?? DEFAULTS.compiler;\n\n // Compute minimum options to read the config file.\n let projectLocalResolveDir = getBasePathForProjectLocalDependencyResolution(\n undefined,\n rawOptions.projectSearchDir,\n rawOptions.project,\n cwd\n );\n let { compiler, ts } = resolveAndLoadCompiler(\n compilerName,\n projectLocalResolveDir\n );\n\n // Read config file and merge new options between env and CLI options.\n const { configFilePath, config, tsNodeOptionsFromTsconfig, optionBasePaths } =\n readConfig(cwd, ts, rawOptions);\n\n const options = assign(\n {},\n DEFAULTS,\n tsNodeOptionsFromTsconfig || {},\n { optionBasePaths },\n rawOptions\n );\n options.require = [\n ...(tsNodeOptionsFromTsconfig.require || []),\n ...(rawOptions.require || []),\n ];\n\n // Re-resolve the compiler in case it has changed.\n // Compiler is loaded relative to tsconfig.json, so tsconfig discovery may cause us to load a\n // different compiler than we did above, even if the name has not changed.\n if (configFilePath) {\n projectLocalResolveDir = getBasePathForProjectLocalDependencyResolution(\n configFilePath,\n rawOptions.projectSearchDir,\n rawOptions.project,\n cwd\n );\n ({ compiler } = resolveCompiler(\n options.compiler,\n optionBasePaths.compiler ?? projectLocalResolveDir\n ));\n }\n\n return {\n options,\n config,\n projectLocalResolveDir,\n optionBasePaths,\n configFilePath,\n cwd,\n compiler,\n };\n}\n\n/**\n * Load TypeScript configuration. Returns the parsed TypeScript config and\n * any `ts-node` options specified in the config file.\n *\n * Even when a tsconfig.json is not loaded, this function still handles merging\n * compilerOptions from various sources: API, environment variables, etc.\n *\n * @internal\n */\nexport function readConfig(\n cwd: string,\n ts: TSCommon,\n rawApiOptions: CreateOptions\n): {\n /**\n * Path of tsconfig file if one was loaded\n */\n configFilePath: string | undefined;\n /**\n * Parsed TypeScript configuration with compilerOptions merged from all other sources (env vars, etc)\n */\n config: _ts.ParsedCommandLine;\n /**\n * ts-node options pulled from `tsconfig.json`, NOT merged with any other sources. Merging must happen outside\n * this function.\n */\n tsNodeOptionsFromTsconfig: TsConfigOptions;\n optionBasePaths: OptionBasePaths;\n} {\n // Ordered [a, b, c] where config a extends b extends c\n const configChain: Array<{\n config: any;\n basePath: string;\n configPath: string;\n }> = [];\n let config: any = { compilerOptions: {} };\n let basePath = cwd;\n let configFilePath: string | undefined = undefined;\n const projectSearchDir = resolve(cwd, rawApiOptions.projectSearchDir ?? cwd);\n\n const {\n fileExists = ts.sys.fileExists,\n readFile = ts.sys.readFile,\n skipProject = DEFAULTS.skipProject,\n project = DEFAULTS.project,\n tsTrace = DEFAULTS.tsTrace,\n } = rawApiOptions;\n\n // Read project configuration when available.\n if (!skipProject) {\n if (project) {\n const resolved = resolve(cwd, project);\n const nested = join(resolved, 'tsconfig.json');\n configFilePath = fileExists(nested) ? nested : resolved;\n } else {\n configFilePath = ts.findConfigFile(projectSearchDir, fileExists);\n }\n\n if (configFilePath) {\n let pathToNextConfigInChain = configFilePath;\n const tsInternals = createTsInternals(ts);\n const errors: Array<_ts.Diagnostic> = [];\n\n // Follow chain of \"extends\"\n while (true) {\n const result = ts.readConfigFile(pathToNextConfigInChain, readFile);\n\n // Return diagnostics.\n if (result.error) {\n return {\n configFilePath,\n config: { errors: [result.error], fileNames: [], options: {} },\n tsNodeOptionsFromTsconfig: {},\n optionBasePaths: {},\n };\n }\n\n const c = result.config;\n const bp = dirname(pathToNextConfigInChain);\n configChain.push({\n config: c,\n basePath: bp,\n configPath: pathToNextConfigInChain,\n });\n\n if (c.extends == null) break;\n const resolvedExtendedConfigPath = tsInternals.getExtendsConfigPath(\n c.extends,\n {\n fileExists,\n readDirectory: ts.sys.readDirectory,\n readFile,\n useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,\n trace: tsTrace,\n },\n bp,\n errors,\n (ts as unknown as TSInternal).createCompilerDiagnostic\n );\n if (errors.length) {\n return {\n configFilePath,\n config: { errors, fileNames: [], options: {} },\n tsNodeOptionsFromTsconfig: {},\n optionBasePaths: {},\n };\n }\n if (resolvedExtendedConfigPath == null) break;\n pathToNextConfigInChain = resolvedExtendedConfigPath;\n }\n\n ({ config, basePath } = configChain[0]);\n }\n }\n\n // Merge and fix ts-node options that come from tsconfig.json(s)\n const tsNodeOptionsFromTsconfig: TsConfigOptions = {};\n const optionBasePaths: OptionBasePaths = {};\n for (let i = configChain.length - 1; i >= 0; i--) {\n const { config, basePath, configPath } = configChain[i];\n const options = filterRecognizedTsConfigTsNodeOptions(\n config['ts-node']\n ).recognized;\n\n // Some options are relative to the config file, so must be converted to absolute paths here\n if (options.require) {\n // Modules are found relative to the tsconfig file, not the `dir` option\n const tsconfigRelativeResolver = createProjectLocalResolveHelper(\n dirname(configPath)\n );\n options.require = options.require.map((path: string) =>\n tsconfigRelativeResolver(path, false)\n );\n }\n if (options.scopeDir) {\n options.scopeDir = resolve(basePath, options.scopeDir!);\n }\n\n // Downstream code uses the basePath; we do not do that here.\n if (options.moduleTypes) {\n optionBasePaths.moduleTypes = basePath;\n }\n if (options.transpiler != null) {\n optionBasePaths.transpiler = basePath;\n }\n if (options.compiler != null) {\n optionBasePaths.compiler = basePath;\n }\n if (options.swc != null) {\n optionBasePaths.swc = basePath;\n }\n\n assign(tsNodeOptionsFromTsconfig, options);\n }\n\n // Remove resolution of \"files\".\n const files =\n rawApiOptions.files ?? tsNodeOptionsFromTsconfig.files ?? DEFAULTS.files;\n\n // Only if a config file is *not* loaded, load an implicit configuration from @tsconfig/bases\n const skipDefaultCompilerOptions = configFilePath != null;\n const defaultCompilerOptionsForNodeVersion = skipDefaultCompilerOptions\n ? undefined\n : {\n ...getDefaultTsconfigJsonForNodeVersion(ts).compilerOptions,\n types: ['node'],\n };\n\n // Merge compilerOptions from all sources\n config.compilerOptions = Object.assign(\n {},\n // automatically-applied options from @tsconfig/bases\n defaultCompilerOptionsForNodeVersion,\n // tsconfig.json \"compilerOptions\"\n config.compilerOptions,\n // from env var\n DEFAULTS.compilerOptions,\n // tsconfig.json \"ts-node\": \"compilerOptions\"\n tsNodeOptionsFromTsconfig.compilerOptions,\n // passed programmatically\n rawApiOptions.compilerOptions,\n // overrides required by ts-node, cannot be changed\n TS_NODE_COMPILER_OPTIONS\n );\n\n const fixedConfig = fixConfig(\n ts,\n ts.parseJsonConfigFileContent(\n config,\n {\n fileExists,\n readFile,\n // Only used for globbing \"files\", \"include\", \"exclude\"\n // When `files` option disabled, we want to avoid the fs calls\n readDirectory: files ? ts.sys.readDirectory : () => [],\n useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,\n },\n basePath,\n undefined,\n configFilePath\n )\n );\n\n return {\n configFilePath,\n config: fixedConfig,\n tsNodeOptionsFromTsconfig,\n optionBasePaths,\n };\n}\n\n/**\n * Load the typescript compiler. It is required to load the tsconfig but might\n * be changed by the tsconfig, so we have to do this twice.\n * @internal\n */\nexport function resolveAndLoadCompiler(\n name: string | undefined,\n relativeToPath: string\n) {\n const { compiler } = resolveCompiler(name, relativeToPath);\n const ts = loadCompiler(compiler);\n return { compiler, ts };\n}\n\nfunction resolveCompiler(name: string | undefined, relativeToPath: string) {\n const projectLocalResolveHelper =\n createProjectLocalResolveHelper(relativeToPath);\n const compiler = projectLocalResolveHelper(name || 'typescript', true);\n return { compiler };\n}\n\n/** @internal */\nexport function loadCompiler(compiler: string): TSCommon {\n return attemptRequireWithV8CompileCache(require, compiler);\n}\n\n/**\n * Given the raw \"ts-node\" sub-object from a tsconfig, return an object with only the properties\n * recognized by \"ts-node\"\n */\nfunction filterRecognizedTsConfigTsNodeOptions(jsonObject: any): {\n recognized: TsConfigOptions;\n unrecognized: any;\n} {\n if (jsonObject == null) return { recognized: {}, unrecognized: {} };\n const {\n compiler,\n compilerHost,\n compilerOptions,\n emit,\n files,\n ignore,\n ignoreDiagnostics,\n logError,\n preferTsExts,\n pretty,\n require,\n skipIgnore,\n transpileOnly,\n typeCheck,\n transpiler,\n scope,\n scopeDir,\n moduleTypes,\n experimentalReplAwait,\n swc,\n experimentalResolver,\n esm,\n experimentalSpecifierResolution,\n experimentalTsImportSpecifiers,\n ...unrecognized\n } = jsonObject as TsConfigOptions;\n const filteredTsConfigOptions = {\n compiler,\n compilerHost,\n compilerOptions,\n emit,\n experimentalReplAwait,\n files,\n ignore,\n ignoreDiagnostics,\n logError,\n preferTsExts,\n pretty,\n require,\n skipIgnore,\n transpileOnly,\n typeCheck,\n transpiler,\n scope,\n scopeDir,\n moduleTypes,\n swc,\n experimentalResolver,\n esm,\n experimentalSpecifierResolution,\n experimentalTsImportSpecifiers,\n };\n // Use the typechecker to make sure this implementation has the correct set of properties\n const catchExtraneousProps: keyof TsConfigOptions =\n null as any as keyof typeof filteredTsConfigOptions;\n const catchMissingProps: keyof typeof filteredTsConfigOptions =\n null as any as keyof TsConfigOptions;\n return { recognized: filteredTsConfigOptions, unrecognized };\n}\n\n/** @internal */\nexport const ComputeAsCommonRootOfFiles = Symbol();\n\n/**\n * Some TS compiler options have defaults which are not provided by TS's config parsing functions.\n * This function centralizes the logic for computing those defaults.\n * @internal\n */\nexport function getTsConfigDefaults(\n config: _ts.ParsedCommandLine,\n basePath: string,\n _files: string[] | undefined,\n _include: string[] | undefined,\n _exclude: string[] | undefined\n) {\n const { composite = false } = config.options;\n let rootDir: string | typeof ComputeAsCommonRootOfFiles =\n config.options.rootDir!;\n if (rootDir == null) {\n if (composite) rootDir = basePath;\n // Return this symbol to avoid computing from `files`, which would require fs calls\n else rootDir = ComputeAsCommonRootOfFiles;\n }\n const { outDir = rootDir } = config.options;\n // Docs are wrong: https://www.typescriptlang.org/tsconfig#include\n // Docs say **, but it's actually **/*; compiler throws error for **\n const include = _files ? [] : ['**/*'];\n const files = _files ?? [];\n // Docs are misleading: https://www.typescriptlang.org/tsconfig#exclude\n // Docs say it excludes node_modules, bower_components, jspm_packages, but actually those are excluded via behavior of \"include\"\n const exclude = _exclude ?? [outDir]; // TODO technically, outDir is absolute path, but exclude should be relative glob pattern?\n\n // TODO compute baseUrl\n\n return { rootDir, outDir, include, files, exclude, composite };\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/esm.d.ts b/node_modules/ts-node/dist/esm.d.ts deleted file mode 100644 index bbd0e23..0000000 --- a/node_modules/ts-node/dist/esm.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/// -/// -import { Service } from './index'; -export interface NodeLoaderHooksAPI1 { - resolve: NodeLoaderHooksAPI1.ResolveHook; - getFormat: NodeLoaderHooksAPI1.GetFormatHook; - transformSource: NodeLoaderHooksAPI1.TransformSourceHook; -} -export declare namespace NodeLoaderHooksAPI1 { - type ResolveHook = NodeLoaderHooksAPI2.ResolveHook; - type GetFormatHook = (url: string, context: {}, defaultGetFormat: GetFormatHook) => Promise<{ - format: NodeLoaderHooksFormat; - }>; - type TransformSourceHook = (source: string | Buffer, context: { - url: string; - format: NodeLoaderHooksFormat; - }, defaultTransformSource: NodeLoaderHooksAPI1.TransformSourceHook) => Promise<{ - source: string | Buffer; - }>; -} -export interface NodeLoaderHooksAPI2 { - resolve: NodeLoaderHooksAPI2.ResolveHook; - load: NodeLoaderHooksAPI2.LoadHook; -} -export declare namespace NodeLoaderHooksAPI2 { - type ResolveHook = (specifier: string, context: { - conditions?: NodeImportConditions; - importAssertions?: NodeImportAssertions; - parentURL: string; - }, defaultResolve: ResolveHook) => Promise<{ - url: string; - format?: NodeLoaderHooksFormat; - shortCircuit?: boolean; - }>; - type LoadHook = (url: string, context: { - format: NodeLoaderHooksFormat | null | undefined; - importAssertions?: NodeImportAssertions; - }, defaultLoad: NodeLoaderHooksAPI2['load']) => Promise<{ - format: NodeLoaderHooksFormat; - source: string | Buffer | undefined; - shortCircuit?: boolean; - }>; - type NodeImportConditions = unknown; - interface NodeImportAssertions { - type?: 'json'; - } -} -export declare type NodeLoaderHooksFormat = 'builtin' | 'commonjs' | 'dynamic' | 'json' | 'module' | 'wasm'; -export declare type NodeImportConditions = unknown; -export interface NodeImportAssertions { - type?: 'json'; -} -export declare function createEsmHooks(tsNodeService: Service): NodeLoaderHooksAPI1 | NodeLoaderHooksAPI2; diff --git a/node_modules/ts-node/dist/esm.js b/node_modules/ts-node/dist/esm.js deleted file mode 100644 index 33a6b6b..0000000 --- a/node_modules/ts-node/dist/esm.js +++ /dev/null @@ -1,228 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createEsmHooks = exports.registerAndCreateEsmHooks = exports.filterHooksByAPIVersion = void 0; -const index_1 = require("./index"); -const url_1 = require("url"); -const path_1 = require("path"); -const assert = require("assert"); -const util_1 = require("./util"); -const module_1 = require("module"); -// The hooks API changed in node version X so we need to check for backwards compatibility. -const newHooksAPI = (0, util_1.versionGteLt)(process.versions.node, '16.12.0'); -/** @internal */ -function filterHooksByAPIVersion(hooks) { - const { getFormat, load, resolve, transformSource } = hooks; - // Explicit return type to avoid TS's non-ideal inferred type - const hooksAPI = newHooksAPI - ? { resolve, load, getFormat: undefined, transformSource: undefined } - : { resolve, getFormat, transformSource, load: undefined }; - return hooksAPI; -} -exports.filterHooksByAPIVersion = filterHooksByAPIVersion; -/** @internal */ -function registerAndCreateEsmHooks(opts) { - // Automatically performs registration just like `-r ts-node/register` - const tsNodeInstance = (0, index_1.register)(opts); - return createEsmHooks(tsNodeInstance); -} -exports.registerAndCreateEsmHooks = registerAndCreateEsmHooks; -function createEsmHooks(tsNodeService) { - tsNodeService.enableExperimentalEsmLoaderInterop(); - // Custom implementation that considers additional file extensions and automatically adds file extensions - const nodeResolveImplementation = tsNodeService.getNodeEsmResolver(); - const nodeGetFormatImplementation = tsNodeService.getNodeEsmGetFormat(); - const extensions = tsNodeService.extensions; - const hooksAPI = filterHooksByAPIVersion({ - resolve, - load, - getFormat, - transformSource, - }); - function isFileUrlOrNodeStyleSpecifier(parsed) { - // We only understand file:// URLs, but in node, the specifier can be a node-style `./foo` or `foo` - const { protocol } = parsed; - return protocol === null || protocol === 'file:'; - } - /** - * Named "probably" as a reminder that this is a guess. - * node does not explicitly tell us if we're resolving the entrypoint or not. - */ - function isProbablyEntrypoint(specifier, parentURL) { - return parentURL === undefined && specifier.startsWith('file://'); - } - // Side-channel between `resolve()` and `load()` hooks - const rememberIsProbablyEntrypoint = new Set(); - const rememberResolvedViaCommonjsFallback = new Set(); - async function resolve(specifier, context, defaultResolve) { - const defer = async () => { - const r = await defaultResolve(specifier, context, defaultResolve); - return r; - }; - // See: https://github.com/nodejs/node/discussions/41711 - // nodejs will likely implement a similar fallback. Till then, we can do our users a favor and fallback today. - async function entrypointFallback(cb) { - try { - const resolution = await cb(); - if ((resolution === null || resolution === void 0 ? void 0 : resolution.url) && - isProbablyEntrypoint(specifier, context.parentURL)) - rememberIsProbablyEntrypoint.add(resolution.url); - return resolution; - } - catch (esmResolverError) { - if (!isProbablyEntrypoint(specifier, context.parentURL)) - throw esmResolverError; - try { - let cjsSpecifier = specifier; - // Attempt to convert from ESM file:// to CommonJS path - try { - if (specifier.startsWith('file://')) - cjsSpecifier = (0, url_1.fileURLToPath)(specifier); - } - catch { } - const resolution = (0, url_1.pathToFileURL)((0, module_1.createRequire)(process.cwd()).resolve(cjsSpecifier)).toString(); - rememberIsProbablyEntrypoint.add(resolution); - rememberResolvedViaCommonjsFallback.add(resolution); - return { url: resolution, format: 'commonjs' }; - } - catch (commonjsResolverError) { - throw esmResolverError; - } - } - } - return addShortCircuitFlag(async () => { - const parsed = (0, url_1.parse)(specifier); - const { pathname, protocol, hostname } = parsed; - if (!isFileUrlOrNodeStyleSpecifier(parsed)) { - return entrypointFallback(defer); - } - if (protocol !== null && protocol !== 'file:') { - return entrypointFallback(defer); - } - // Malformed file:// URL? We should always see `null` or `''` - if (hostname) { - // TODO file://./foo sets `hostname` to `'.'`. Perhaps we should special-case this. - return entrypointFallback(defer); - } - // pathname is the path to be resolved - return entrypointFallback(() => nodeResolveImplementation.defaultResolve(specifier, context, defaultResolve)); - }); - } - // `load` from new loader hook API (See description at the top of this file) - async function load(url, context, defaultLoad) { - return addShortCircuitFlag(async () => { - var _a; - // If we get a format hint from resolve() on the context then use it - // otherwise call the old getFormat() hook using node's old built-in defaultGetFormat() that ships with ts-node - const format = (_a = context.format) !== null && _a !== void 0 ? _a : (await getFormat(url, context, nodeGetFormatImplementation.defaultGetFormat)).format; - let source = undefined; - if (format !== 'builtin' && format !== 'commonjs') { - // Call the new defaultLoad() to get the source - const { source: rawSource } = await defaultLoad(url, { - ...context, - format, - }, defaultLoad); - if (rawSource === undefined || rawSource === null) { - throw new Error(`Failed to load raw source: Format was '${format}' and url was '${url}''.`); - } - // Emulate node's built-in old defaultTransformSource() so we can re-use the old transformSource() hook - const defaultTransformSource = async (source, _context, _defaultTransformSource) => ({ source }); - // Call the old hook - const { source: transformedSource } = await transformSource(rawSource, { url, format }, defaultTransformSource); - source = transformedSource; - } - return { format, source }; - }); - } - async function getFormat(url, context, defaultGetFormat) { - const defer = (overrideUrl = url) => defaultGetFormat(overrideUrl, context, defaultGetFormat); - // See: https://github.com/nodejs/node/discussions/41711 - // nodejs will likely implement a similar fallback. Till then, we can do our users a favor and fallback today. - async function entrypointFallback(cb) { - try { - return await cb(); - } - catch (getFormatError) { - if (!rememberIsProbablyEntrypoint.has(url)) - throw getFormatError; - return { format: 'commonjs' }; - } - } - const parsed = (0, url_1.parse)(url); - if (!isFileUrlOrNodeStyleSpecifier(parsed)) { - return entrypointFallback(defer); - } - const { pathname } = parsed; - assert(pathname !== null, 'ESM getFormat() hook: URL should never have null pathname'); - const nativePath = (0, url_1.fileURLToPath)(url); - let nodeSays; - // If file has extension not understood by node, then ask node how it would treat the emitted extension. - // E.g. .mts compiles to .mjs, so ask node how to classify an .mjs file. - const ext = (0, path_1.extname)(nativePath); - const tsNodeIgnored = tsNodeService.ignored(nativePath); - const nodeEquivalentExt = extensions.nodeEquivalents.get(ext); - if (nodeEquivalentExt && !tsNodeIgnored) { - nodeSays = await entrypointFallback(() => defer((0, url_1.format)((0, url_1.pathToFileURL)(nativePath + nodeEquivalentExt)))); - } - else { - try { - nodeSays = await entrypointFallback(defer); - } - catch (e) { - if (e instanceof Error && - tsNodeIgnored && - extensions.nodeDoesNotUnderstand.includes(ext)) { - e.message += - `\n\n` + - `Hint:\n` + - `ts-node is configured to ignore this file.\n` + - `If you want ts-node to handle this file, consider enabling the "skipIgnore" option or adjusting your "ignore" patterns.\n` + - `https://typestrong.org/ts-node/docs/scope\n`; - } - throw e; - } - } - // For files compiled by ts-node that node believes are either CJS or ESM, check if we should override that classification - if (!tsNodeService.ignored(nativePath) && - (nodeSays.format === 'commonjs' || nodeSays.format === 'module')) { - const { moduleType } = tsNodeService.moduleTypeClassifier.classifyModuleByModuleTypeOverrides((0, util_1.normalizeSlashes)(nativePath)); - if (moduleType === 'cjs') { - return { format: 'commonjs' }; - } - else if (moduleType === 'esm') { - return { format: 'module' }; - } - } - return nodeSays; - } - async function transformSource(source, context, defaultTransformSource) { - if (source === null || source === undefined) { - throw new Error('No source'); - } - const defer = () => defaultTransformSource(source, context, defaultTransformSource); - const sourceAsString = typeof source === 'string' ? source : source.toString('utf8'); - const { url } = context; - const parsed = (0, url_1.parse)(url); - if (!isFileUrlOrNodeStyleSpecifier(parsed)) { - return defer(); - } - const nativePath = (0, url_1.fileURLToPath)(url); - if (tsNodeService.ignored(nativePath)) { - return defer(); - } - const emittedJs = tsNodeService.compile(sourceAsString, nativePath); - return { source: emittedJs }; - } - return hooksAPI; -} -exports.createEsmHooks = createEsmHooks; -async function addShortCircuitFlag(fn) { - const ret = await fn(); - // Not sure if this is necessary; being lazy. Can revisit in the future. - if (ret == null) - return ret; - return { - ...ret, - shortCircuit: true, - }; -} -//# sourceMappingURL=esm.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/esm.js.map b/node_modules/ts-node/dist/esm.js.map deleted file mode 100644 index 89b91ae..0000000 --- a/node_modules/ts-node/dist/esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"esm.js","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":";;;AAAA,mCAA6D;AAC7D,6BAMa;AACb,+BAA+B;AAC/B,iCAAiC;AACjC,iCAAwD;AACxD,mCAAuC;AAsFvC,2FAA2F;AAC3F,MAAM,WAAW,GAAG,IAAA,mBAAY,EAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAEnE,gBAAgB;AAChB,SAAgB,uBAAuB,CACrC,KAAgD;IAEhD,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC5D,6DAA6D;IAC7D,MAAM,QAAQ,GAA8C,WAAW;QACrE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE;QACrE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC7D,OAAO,QAAQ,CAAC;AAClB,CAAC;AATD,0DASC;AAED,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,IAAsB;IAC9D,sEAAsE;IACtE,MAAM,cAAc,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEtC,OAAO,cAAc,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC;AALD,8DAKC;AAED,SAAgB,cAAc,CAAC,aAAsB;IACnD,aAAa,CAAC,kCAAkC,EAAE,CAAC;IAEnD,yGAAyG;IACzG,MAAM,yBAAyB,GAAG,aAAa,CAAC,kBAAkB,EAAE,CAAC;IACrE,MAAM,2BAA2B,GAAG,aAAa,CAAC,mBAAmB,EAAE,CAAC;IACxE,MAAM,UAAU,GAAG,aAAa,CAAC,UA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AAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEhE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACxB,MAAM,MAAM,GAAG,IAAA,WAAQ,EAAC,GAAG,CAAC,CAAC;QAE7B,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,EAAE;YAC1C,OAAO,KAAK,EAAE,CAAC;SAChB;QACD,MAAM,UAAU,GAAG,IAAA,mBAAa,EAAC,GAAG,CAAC,CAAC;QAEtC,IAAI,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACrC,OAAO,KAAK,EAAE,CAAC;SAChB;QAED,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QAEpE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AA7RD,wCA6RC;AAED,KAAK,UAAU,mBAAmB,CAAI,EAAoB;IACxD,MAAM,GAAG,GAAG,MAAM,EAAE,EAAE,CAAC;IACvB,yEAAyE;IACzE,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,GAAG,CAAC;IAC5B,OAAO;QACL,GAAG,GAAG;QACN,YAAY,EAAE,IAAI;KACnB,CAAC;AACJ,CAAC","sourcesContent":["import { register, RegisterOptions, Service } from './index';\nimport {\n parse as parseUrl,\n format as formatUrl,\n UrlWithStringQuery,\n fileURLToPath,\n pathToFileURL,\n} from 'url';\nimport { extname } from 'path';\nimport * as assert from 'assert';\nimport { normalizeSlashes, versionGteLt } from './util';\nimport { createRequire } from 'module';\n\n// Note: On Windows, URLs look like this: file:///D:/dev/@TypeStrong/ts-node-examples/foo.ts\n\n// NOTE ABOUT MULTIPLE EXPERIMENTAL LOADER APIS\n//\n// At the time of writing, this file implements 2x different loader APIs.\n// Node made a breaking change to the loader API in https://github.com/nodejs/node/pull/37468\n//\n// We check the node version number and export either the *old* or the *new* API.\n//\n// Today, we are implementing the *new* API on top of our implementation of the *old* API,\n// which relies on copy-pasted code from the *old* hooks implementation in node.\n//\n// In the future, we will likely invert this: we will copy-paste the *new* API implementation\n// from node, build our implementation of the *new* API on top of it, and implement the *old*\n// hooks API as a shim to the *new* API.\n\nexport interface NodeLoaderHooksAPI1 {\n resolve: NodeLoaderHooksAPI1.ResolveHook;\n getFormat: NodeLoaderHooksAPI1.GetFormatHook;\n transformSource: NodeLoaderHooksAPI1.TransformSourceHook;\n}\nexport namespace NodeLoaderHooksAPI1 {\n export type ResolveHook = NodeLoaderHooksAPI2.ResolveHook;\n export type GetFormatHook = (\n url: string,\n context: {},\n defaultGetFormat: GetFormatHook\n ) => Promise<{ format: NodeLoaderHooksFormat }>;\n export type TransformSourceHook = (\n source: string | Buffer,\n context: { url: string; format: NodeLoaderHooksFormat },\n defaultTransformSource: NodeLoaderHooksAPI1.TransformSourceHook\n ) => Promise<{ source: string | Buffer }>;\n}\n\nexport interface NodeLoaderHooksAPI2 {\n resolve: NodeLoaderHooksAPI2.ResolveHook;\n load: NodeLoaderHooksAPI2.LoadHook;\n}\nexport namespace NodeLoaderHooksAPI2 {\n export type ResolveHook = (\n specifier: string,\n context: {\n conditions?: NodeImportConditions;\n importAssertions?: NodeImportAssertions;\n parentURL: string;\n },\n defaultResolve: ResolveHook\n ) => Promise<{\n url: string;\n format?: NodeLoaderHooksFormat;\n shortCircuit?: boolean;\n }>;\n export type LoadHook = (\n url: string,\n context: {\n format: NodeLoaderHooksFormat | null | undefined;\n importAssertions?: NodeImportAssertions;\n },\n defaultLoad: NodeLoaderHooksAPI2['load']\n ) => Promise<{\n format: NodeLoaderHooksFormat;\n source: string | Buffer | undefined;\n shortCircuit?: boolean;\n }>;\n export type NodeImportConditions = unknown;\n export interface NodeImportAssertions {\n type?: 'json';\n }\n}\n\nexport type NodeLoaderHooksFormat =\n | 'builtin'\n | 'commonjs'\n | 'dynamic'\n | 'json'\n | 'module'\n | 'wasm';\n\nexport type NodeImportConditions = unknown;\nexport interface NodeImportAssertions {\n type?: 'json';\n}\n\n// The hooks API changed in node version X so we need to check for backwards compatibility.\nconst newHooksAPI = versionGteLt(process.versions.node, '16.12.0');\n\n/** @internal */\nexport function filterHooksByAPIVersion(\n hooks: NodeLoaderHooksAPI1 & NodeLoaderHooksAPI2\n): NodeLoaderHooksAPI1 | NodeLoaderHooksAPI2 {\n const { getFormat, load, resolve, transformSource } = hooks;\n // Explicit return type to avoid TS's non-ideal inferred type\n const hooksAPI: NodeLoaderHooksAPI1 | NodeLoaderHooksAPI2 = newHooksAPI\n ? { resolve, load, getFormat: undefined, transformSource: undefined }\n : { resolve, getFormat, transformSource, load: undefined };\n return hooksAPI;\n}\n\n/** @internal */\nexport function registerAndCreateEsmHooks(opts?: RegisterOptions) {\n // Automatically performs registration just like `-r ts-node/register`\n const tsNodeInstance = register(opts);\n\n return createEsmHooks(tsNodeInstance);\n}\n\nexport function createEsmHooks(tsNodeService: Service) {\n tsNodeService.enableExperimentalEsmLoaderInterop();\n\n // Custom implementation that considers additional file extensions and automatically adds file extensions\n const nodeResolveImplementation = tsNodeService.getNodeEsmResolver();\n const nodeGetFormatImplementation = tsNodeService.getNodeEsmGetFormat();\n const extensions = tsNodeService.extensions;\n\n const hooksAPI = filterHooksByAPIVersion({\n resolve,\n load,\n getFormat,\n transformSource,\n });\n\n function isFileUrlOrNodeStyleSpecifier(parsed: UrlWithStringQuery) {\n // We only understand file:// URLs, but in node, the specifier can be a node-style `./foo` or `foo`\n const { protocol } = parsed;\n return protocol === null || protocol === 'file:';\n }\n\n /**\n * Named \"probably\" as a reminder that this is a guess.\n * node does not explicitly tell us if we're resolving the entrypoint or not.\n */\n function isProbablyEntrypoint(specifier: string, parentURL: string) {\n return parentURL === undefined && specifier.startsWith('file://');\n }\n // Side-channel between `resolve()` and `load()` hooks\n const rememberIsProbablyEntrypoint = new Set();\n const rememberResolvedViaCommonjsFallback = new Set();\n\n async function resolve(\n specifier: string,\n context: { parentURL: string },\n defaultResolve: typeof resolve\n ): Promise<{ url: string; format?: NodeLoaderHooksFormat }> {\n const defer = async () => {\n const r = await defaultResolve(specifier, context, defaultResolve);\n return r;\n };\n // See: https://github.com/nodejs/node/discussions/41711\n // nodejs will likely implement a similar fallback. Till then, we can do our users a favor and fallback today.\n async function entrypointFallback(\n cb: () => ReturnType | Awaited>\n ): ReturnType {\n try {\n const resolution = await cb();\n if (\n resolution?.url &&\n isProbablyEntrypoint(specifier, context.parentURL)\n )\n rememberIsProbablyEntrypoint.add(resolution.url);\n return resolution;\n } catch (esmResolverError) {\n if (!isProbablyEntrypoint(specifier, context.parentURL))\n throw esmResolverError;\n try {\n let cjsSpecifier = specifier;\n // Attempt to convert from ESM file:// to CommonJS path\n try {\n if (specifier.startsWith('file://'))\n cjsSpecifier = fileURLToPath(specifier);\n } catch {}\n const resolution = pathToFileURL(\n createRequire(process.cwd()).resolve(cjsSpecifier)\n ).toString();\n rememberIsProbablyEntrypoint.add(resolution);\n rememberResolvedViaCommonjsFallback.add(resolution);\n return { url: resolution, format: 'commonjs' };\n } catch (commonjsResolverError) {\n throw esmResolverError;\n }\n }\n }\n\n return addShortCircuitFlag(async () => {\n const parsed = parseUrl(specifier);\n const { pathname, protocol, hostname } = parsed;\n\n if (!isFileUrlOrNodeStyleSpecifier(parsed)) {\n return entrypointFallback(defer);\n }\n\n if (protocol !== null && protocol !== 'file:') {\n return entrypointFallback(defer);\n }\n\n // Malformed file:// URL? We should always see `null` or `''`\n if (hostname) {\n // TODO file://./foo sets `hostname` to `'.'`. Perhaps we should special-case this.\n return entrypointFallback(defer);\n }\n\n // pathname is the path to be resolved\n\n return entrypointFallback(() =>\n nodeResolveImplementation.defaultResolve(\n specifier,\n context,\n defaultResolve\n )\n );\n });\n }\n\n // `load` from new loader hook API (See description at the top of this file)\n async function load(\n url: string,\n context: {\n format: NodeLoaderHooksFormat | null | undefined;\n importAssertions?: NodeLoaderHooksAPI2.NodeImportAssertions;\n },\n defaultLoad: typeof load\n ): Promise<{\n format: NodeLoaderHooksFormat;\n source: string | Buffer | undefined;\n }> {\n return addShortCircuitFlag(async () => {\n // If we get a format hint from resolve() on the context then use it\n // otherwise call the old getFormat() hook using node's old built-in defaultGetFormat() that ships with ts-node\n const format =\n context.format ??\n (\n await getFormat(\n url,\n context,\n nodeGetFormatImplementation.defaultGetFormat\n )\n ).format;\n\n let source = undefined;\n if (format !== 'builtin' && format !== 'commonjs') {\n // Call the new defaultLoad() to get the source\n const { source: rawSource } = await defaultLoad(\n url,\n {\n ...context,\n format,\n },\n defaultLoad\n );\n\n if (rawSource === undefined || rawSource === null) {\n throw new Error(\n `Failed to load raw source: Format was '${format}' and url was '${url}''.`\n );\n }\n\n // Emulate node's built-in old defaultTransformSource() so we can re-use the old transformSource() hook\n const defaultTransformSource: typeof transformSource = async (\n source,\n _context,\n _defaultTransformSource\n ) => ({ source });\n\n // Call the old hook\n const { source: transformedSource } = await transformSource(\n rawSource,\n { url, format },\n defaultTransformSource\n );\n source = transformedSource;\n }\n\n return { format, source };\n });\n }\n\n async function getFormat(\n url: string,\n context: {},\n defaultGetFormat: typeof getFormat\n ): Promise<{ format: NodeLoaderHooksFormat }> {\n const defer = (overrideUrl: string = url) =>\n defaultGetFormat(overrideUrl, context, defaultGetFormat);\n\n // See: https://github.com/nodejs/node/discussions/41711\n // nodejs will likely implement a similar fallback. Till then, we can do our users a favor and fallback today.\n async function entrypointFallback(\n cb: () => ReturnType\n ): ReturnType {\n try {\n return await cb();\n } catch (getFormatError) {\n if (!rememberIsProbablyEntrypoint.has(url)) throw getFormatError;\n return { format: 'commonjs' };\n }\n }\n\n const parsed = parseUrl(url);\n\n if (!isFileUrlOrNodeStyleSpecifier(parsed)) {\n return entrypointFallback(defer);\n }\n\n const { pathname } = parsed;\n assert(\n pathname !== null,\n 'ESM getFormat() hook: URL should never have null pathname'\n );\n\n const nativePath = fileURLToPath(url);\n\n let nodeSays: { format: NodeLoaderHooksFormat };\n\n // If file has extension not understood by node, then ask node how it would treat the emitted extension.\n // E.g. .mts compiles to .mjs, so ask node how to classify an .mjs file.\n const ext = extname(nativePath);\n const tsNodeIgnored = tsNodeService.ignored(nativePath);\n const nodeEquivalentExt = extensions.nodeEquivalents.get(ext);\n if (nodeEquivalentExt && !tsNodeIgnored) {\n nodeSays = await entrypointFallback(() =>\n defer(formatUrl(pathToFileURL(nativePath + nodeEquivalentExt)))\n );\n } else {\n try {\n nodeSays = await entrypointFallback(defer);\n } catch (e) {\n if (\n e instanceof Error &&\n tsNodeIgnored &&\n extensions.nodeDoesNotUnderstand.includes(ext)\n ) {\n e.message +=\n `\\n\\n` +\n `Hint:\\n` +\n `ts-node is configured to ignore this file.\\n` +\n `If you want ts-node to handle this file, consider enabling the \"skipIgnore\" option or adjusting your \"ignore\" patterns.\\n` +\n `https://typestrong.org/ts-node/docs/scope\\n`;\n }\n throw e;\n }\n }\n // For files compiled by ts-node that node believes are either CJS or ESM, check if we should override that classification\n if (\n !tsNodeService.ignored(nativePath) &&\n (nodeSays.format === 'commonjs' || nodeSays.format === 'module')\n ) {\n const { moduleType } =\n tsNodeService.moduleTypeClassifier.classifyModuleByModuleTypeOverrides(\n normalizeSlashes(nativePath)\n );\n if (moduleType === 'cjs') {\n return { format: 'commonjs' };\n } else if (moduleType === 'esm') {\n return { format: 'module' };\n }\n }\n return nodeSays;\n }\n\n async function transformSource(\n source: string | Buffer,\n context: { url: string; format: NodeLoaderHooksFormat },\n defaultTransformSource: typeof transformSource\n ): Promise<{ source: string | Buffer }> {\n if (source === null || source === undefined) {\n throw new Error('No source');\n }\n\n const defer = () =>\n defaultTransformSource(source, context, defaultTransformSource);\n\n const sourceAsString =\n typeof source === 'string' ? source : source.toString('utf8');\n\n const { url } = context;\n const parsed = parseUrl(url);\n\n if (!isFileUrlOrNodeStyleSpecifier(parsed)) {\n return defer();\n }\n const nativePath = fileURLToPath(url);\n\n if (tsNodeService.ignored(nativePath)) {\n return defer();\n }\n\n const emittedJs = tsNodeService.compile(sourceAsString, nativePath);\n\n return { source: emittedJs };\n }\n\n return hooksAPI;\n}\n\nasync function addShortCircuitFlag(fn: () => Promise) {\n const ret = await fn();\n // Not sure if this is necessary; being lazy. Can revisit in the future.\n if (ret == null) return ret;\n return {\n ...ret,\n shortCircuit: true,\n };\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/file-extensions.d.ts b/node_modules/ts-node/dist/file-extensions.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/file-extensions.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/file-extensions.js b/node_modules/ts-node/dist/file-extensions.js deleted file mode 100644 index e148e04..0000000 --- a/node_modules/ts-node/dist/file-extensions.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getExtensions = void 0; -const util_1 = require("./util"); -const nodeEquivalents = new Map([ - ['.ts', '.js'], - ['.tsx', '.js'], - ['.jsx', '.js'], - ['.mts', '.mjs'], - ['.cts', '.cjs'], -]); -const tsResolverEquivalents = new Map([ - ['.ts', ['.js']], - ['.tsx', ['.js', '.jsx']], - ['.mts', ['.mjs']], - ['.cts', ['.cjs']], -]); -// All extensions understood by vanilla node -const vanillaNodeExtensions = [ - '.js', - '.json', - '.node', - '.mjs', - '.cjs', -]; -// Extensions added by vanilla node's require() if you omit them: -// js, json, node -// Extensions added by vanilla node if you omit them with --experimental-specifier-resolution=node -// js, json, node, mjs -// Extensions added by ESM codepath's legacy package.json "main" resolver -// js, json, node (not mjs!) -const nodeDoesNotUnderstand = [ - '.ts', - '.tsx', - '.jsx', - '.cts', - '.mts', -]; -/** - * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] - * @internal - */ -function getExtensions(config, options, tsVersion) { - // TS 4.5 is first version to understand .cts, .mts, .cjs, and .mjs extensions - const tsSupportsMtsCtsExts = (0, util_1.versionGteLt)(tsVersion, '4.5.0'); - const requiresHigherTypescriptVersion = []; - if (!tsSupportsMtsCtsExts) - requiresHigherTypescriptVersion.push('.cts', '.cjs', '.mts', '.mjs'); - const allPossibleExtensionsSortedByPreference = Array.from(new Set([ - ...(options.preferTsExts ? nodeDoesNotUnderstand : []), - ...vanillaNodeExtensions, - ...nodeDoesNotUnderstand, - ])); - const compiledJsUnsorted = ['.ts']; - const compiledJsxUnsorted = []; - if (config.options.jsx) - compiledJsxUnsorted.push('.tsx'); - if (tsSupportsMtsCtsExts) - compiledJsUnsorted.push('.mts', '.cts'); - if (config.options.allowJs) { - compiledJsUnsorted.push('.js'); - if (config.options.jsx) - compiledJsxUnsorted.push('.jsx'); - if (tsSupportsMtsCtsExts) - compiledJsUnsorted.push('.mjs', '.cjs'); - } - const compiledUnsorted = [...compiledJsUnsorted, ...compiledJsxUnsorted]; - const compiled = allPossibleExtensionsSortedByPreference.filter((ext) => compiledUnsorted.includes(ext)); - const compiledNodeDoesNotUnderstand = nodeDoesNotUnderstand.filter((ext) => compiled.includes(ext)); - /** - * TS's resolver can resolve foo.js to foo.ts, by replacing .js extension with several source extensions. - * IMPORTANT: Must preserve ordering according to preferTsExts! - * Must include the .js/.mjs/.cjs extension in the array! - * This affects resolution behavior! - * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] - */ - const r = allPossibleExtensionsSortedByPreference.filter((ext) => [...compiledUnsorted, '.js', '.mjs', '.cjs', '.mts', '.cts'].includes(ext)); - const replacementsForJs = r.filter((ext) => ['.js', '.jsx', '.ts', '.tsx'].includes(ext)); - const replacementsForJsx = r.filter((ext) => ['.jsx', '.tsx'].includes(ext)); - const replacementsForMjs = r.filter((ext) => ['.mjs', '.mts'].includes(ext)); - const replacementsForCjs = r.filter((ext) => ['.cjs', '.cts'].includes(ext)); - const replacementsForJsOrMjs = r.filter((ext) => ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.mts'].includes(ext)); - // Node allows omitting .js or .mjs extension in certain situations (CJS, ESM w/experimental flag) - // So anything that compiles to .js or .mjs can also be omitted. - const experimentalSpecifierResolutionAddsIfOmitted = Array.from(new Set([...replacementsForJsOrMjs, '.json', '.node'])); - // Same as above, except node curiuosly doesn't do .mjs here - const legacyMainResolveAddsIfOmitted = Array.from(new Set([...replacementsForJs, '.json', '.node'])); - return { - /** All file extensions we transform, ordered by resolution preference according to preferTsExts */ - compiled, - /** Resolved extensions that vanilla node will not understand; we should handle them */ - nodeDoesNotUnderstand, - /** Like the above, but only the ones we're compiling */ - compiledNodeDoesNotUnderstand, - /** - * Mapping from extensions understood by tsc to the equivalent for node, - * as far as getFormat is concerned. - */ - nodeEquivalents, - /** - * Mapping from extensions rejected by TSC in import specifiers, to the - * possible alternatives that TS's resolver will accept. - * - * When we allow users to opt-in to .ts extensions in import specifiers, TS's - * resolver requires us to replace the .ts extensions with .js alternatives. - * Otherwise, resolution fails. - * - * Note TS's resolver is only used by, and only required for, typechecking. - * This is separate from node's resolver, which we hook separately and which - * does not require this mapping. - */ - tsResolverEquivalents, - /** - * Extensions that we can support if the user upgrades their typescript version. - * Used when raising hints. - */ - requiresHigherTypescriptVersion, - /** - * --experimental-specifier-resolution=node will add these extensions. - */ - experimentalSpecifierResolutionAddsIfOmitted, - /** - * ESM loader will add these extensions to package.json "main" field - */ - legacyMainResolveAddsIfOmitted, - replacementsForMjs, - replacementsForCjs, - replacementsForJsx, - replacementsForJs, - }; -} -exports.getExtensions = getExtensions; -//# sourceMappingURL=file-extensions.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/file-extensions.js.map b/node_modules/ts-node/dist/file-extensions.js.map deleted file mode 100644 index 6b99baa..0000000 --- a/node_modules/ts-node/dist/file-extensions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"file-extensions.js","sourceRoot":"","sources":["../src/file-extensions.ts"],"names":[],"mappings":";;;AAEA,iCAAsC;AAWtC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAiB;IAC9C,CAAC,KAAK,EAAE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ACf;;;;;;;;;;;WAWG;QACH,qBAAqB;QACrB;;;WAGG;QACH,+BAA+B;QAC/B;;WAEG;QACH,4CAA4C;QAC5C;;WAEG;QACH,8BAA8B;QAC9B,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAjHD,sCAiHC","sourcesContent":["import type * as _ts from 'typescript';\nimport type { RegisterOptions } from '.';\nimport { versionGteLt } from './util';\n\n/**\n * Centralized specification of how we deal with file extensions based on\n * project options:\n * which ones we do/don't support, in what situations, etc. These rules drive\n * logic elsewhere.\n * @internal\n * */\nexport type Extensions = ReturnType;\n\nconst nodeEquivalents = new Map([\n ['.ts', '.js'],\n ['.tsx', '.js'],\n ['.jsx', '.js'],\n ['.mts', '.mjs'],\n ['.cts', '.cjs'],\n]);\n\nconst tsResolverEquivalents = new Map([\n ['.ts', ['.js']],\n ['.tsx', ['.js', '.jsx']],\n ['.mts', ['.mjs']],\n ['.cts', ['.cjs']],\n]);\n\n// All extensions understood by vanilla node\nconst vanillaNodeExtensions: readonly string[] = [\n '.js',\n '.json',\n '.node',\n '.mjs',\n '.cjs',\n];\n\n// Extensions added by vanilla node's require() if you omit them:\n// js, json, node\n// Extensions added by vanilla node if you omit them with --experimental-specifier-resolution=node\n// js, json, node, mjs\n// Extensions added by ESM codepath's legacy package.json \"main\" resolver\n// js, json, node (not mjs!)\n\nconst nodeDoesNotUnderstand: readonly string[] = [\n '.ts',\n '.tsx',\n '.jsx',\n '.cts',\n '.mts',\n];\n\n/**\n * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS]\n * @internal\n */\nexport function getExtensions(\n config: _ts.ParsedCommandLine,\n options: RegisterOptions,\n tsVersion: string\n) {\n // TS 4.5 is first version to understand .cts, .mts, .cjs, and .mjs extensions\n const tsSupportsMtsCtsExts = versionGteLt(tsVersion, '4.5.0');\n\n const requiresHigherTypescriptVersion: string[] = [];\n if (!tsSupportsMtsCtsExts)\n requiresHigherTypescriptVersion.push('.cts', '.cjs', '.mts', '.mjs');\n\n const allPossibleExtensionsSortedByPreference = Array.from(\n new Set([\n ...(options.preferTsExts ? nodeDoesNotUnderstand : []),\n ...vanillaNodeExtensions,\n ...nodeDoesNotUnderstand,\n ])\n );\n\n const compiledJsUnsorted: string[] = ['.ts'];\n const compiledJsxUnsorted: string[] = [];\n\n if (config.options.jsx) compiledJsxUnsorted.push('.tsx');\n if (tsSupportsMtsCtsExts) compiledJsUnsorted.push('.mts', '.cts');\n if (config.options.allowJs) {\n compiledJsUnsorted.push('.js');\n if (config.options.jsx) compiledJsxUnsorted.push('.jsx');\n if (tsSupportsMtsCtsExts) compiledJsUnsorted.push('.mjs', '.cjs');\n }\n\n const compiledUnsorted = [...compiledJsUnsorted, ...compiledJsxUnsorted];\n const compiled = allPossibleExtensionsSortedByPreference.filter((ext) =>\n compiledUnsorted.includes(ext)\n );\n\n const compiledNodeDoesNotUnderstand = nodeDoesNotUnderstand.filter((ext) =>\n compiled.includes(ext)\n );\n\n /**\n * TS's resolver can resolve foo.js to foo.ts, by replacing .js extension with several source extensions.\n * IMPORTANT: Must preserve ordering according to preferTsExts!\n * Must include the .js/.mjs/.cjs extension in the array!\n * This affects resolution behavior!\n * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS]\n */\n const r = allPossibleExtensionsSortedByPreference.filter((ext) =>\n [...compiledUnsorted, '.js', '.mjs', '.cjs', '.mts', '.cts'].includes(ext)\n );\n const replacementsForJs = r.filter((ext) =>\n ['.js', '.jsx', '.ts', '.tsx'].includes(ext)\n );\n const replacementsForJsx = r.filter((ext) => ['.jsx', '.tsx'].includes(ext));\n const replacementsForMjs = r.filter((ext) => ['.mjs', '.mts'].includes(ext));\n const replacementsForCjs = r.filter((ext) => ['.cjs', '.cts'].includes(ext));\n const replacementsForJsOrMjs = r.filter((ext) =>\n ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.mts'].includes(ext)\n );\n\n // Node allows omitting .js or .mjs extension in certain situations (CJS, ESM w/experimental flag)\n // So anything that compiles to .js or .mjs can also be omitted.\n const experimentalSpecifierResolutionAddsIfOmitted = Array.from(\n new Set([...replacementsForJsOrMjs, '.json', '.node'])\n );\n // Same as above, except node curiuosly doesn't do .mjs here\n const legacyMainResolveAddsIfOmitted = Array.from(\n new Set([...replacementsForJs, '.json', '.node'])\n );\n\n return {\n /** All file extensions we transform, ordered by resolution preference according to preferTsExts */\n compiled,\n /** Resolved extensions that vanilla node will not understand; we should handle them */\n nodeDoesNotUnderstand,\n /** Like the above, but only the ones we're compiling */\n compiledNodeDoesNotUnderstand,\n /**\n * Mapping from extensions understood by tsc to the equivalent for node,\n * as far as getFormat is concerned.\n */\n nodeEquivalents,\n /**\n * Mapping from extensions rejected by TSC in import specifiers, to the\n * possible alternatives that TS's resolver will accept.\n *\n * When we allow users to opt-in to .ts extensions in import specifiers, TS's\n * resolver requires us to replace the .ts extensions with .js alternatives.\n * Otherwise, resolution fails.\n *\n * Note TS's resolver is only used by, and only required for, typechecking.\n * This is separate from node's resolver, which we hook separately and which\n * does not require this mapping.\n */\n tsResolverEquivalents,\n /**\n * Extensions that we can support if the user upgrades their typescript version.\n * Used when raising hints.\n */\n requiresHigherTypescriptVersion,\n /**\n * --experimental-specifier-resolution=node will add these extensions.\n */\n experimentalSpecifierResolutionAddsIfOmitted,\n /**\n * ESM loader will add these extensions to package.json \"main\" field\n */\n legacyMainResolveAddsIfOmitted,\n replacementsForMjs,\n replacementsForCjs,\n replacementsForJsx,\n replacementsForJs,\n };\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/index.d.ts b/node_modules/ts-node/dist/index.d.ts deleted file mode 100644 index 8364b0e..0000000 --- a/node_modules/ts-node/dist/index.d.ts +++ /dev/null @@ -1,332 +0,0 @@ -import { BaseError } from 'make-error'; -import type * as _ts from 'typescript'; -import type { TSCommon } from './ts-compiler-types'; -import type { createEsmHooks as createEsmHooksFn } from './esm'; -export { TSCommon }; -export { createRepl, CreateReplOptions, ReplService, EvalAwarePartialHost, } from './repl'; -export type { TranspilerModule, TranspilerFactory, CreateTranspilerOptions, TranspileOutput, TranspileOptions, Transpiler, } from './transpilers/types'; -export type { NodeLoaderHooksAPI1, NodeLoaderHooksAPI2, NodeLoaderHooksFormat, } from './esm'; -/** - * Registered `ts-node` instance information. - */ -export declare const REGISTER_INSTANCE: unique symbol; -/** - * Expose `REGISTER_INSTANCE` information on node.js `process`. - */ -declare global { - namespace NodeJS { - interface Process { - [REGISTER_INSTANCE]?: Service; - } - } -} -/** - * Export the current version. - */ -export declare const VERSION: any; -/** - * Options for creating a new TypeScript compiler instance. - - * @category Basic - */ -export interface CreateOptions { - /** - * Behave as if invoked within this working directory. Roughly equivalent to `cd $dir && ts-node ...` - * - * @default process.cwd() - */ - cwd?: string; - /** - * Legacy alias for `cwd` - * - * @deprecated use `projectSearchDir` or `cwd` - */ - dir?: string; - /** - * Emit output files into `.ts-node` directory. - * - * @default false - */ - emit?: boolean; - /** - * Scope compiler to files within `scopeDir`. - * - * @default false - */ - scope?: boolean; - /** - * @default First of: `tsconfig.json` "rootDir" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded. - */ - scopeDir?: string; - /** - * Use pretty diagnostic formatter. - * - * @default false - */ - pretty?: boolean; - /** - * Use TypeScript's faster `transpileModule`. - * - * @default false - */ - transpileOnly?: boolean; - /** - * **DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`). - * - * @default true - */ - typeCheck?: boolean; - /** - * Use TypeScript's compiler host API instead of the language service API. - * - * @default false - */ - compilerHost?: boolean; - /** - * Logs TypeScript errors to stderr instead of throwing exceptions. - * - * @default false - */ - logError?: boolean; - /** - * Load "files" and "include" from `tsconfig.json` on startup. - * - * Default is to override `tsconfig.json` "files" and "include" to only include the entrypoint script. - * - * @default false - */ - files?: boolean; - /** - * Specify a custom TypeScript compiler. - * - * @default "typescript" - */ - compiler?: string; - /** - * Specify a custom transpiler for use with transpileOnly - */ - transpiler?: string | [string, object]; - /** - * Transpile with swc instead of the TypeScript compiler, and skip typechecking. - * - * Equivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'` - * - * For complete instructions: https://typestrong.org/ts-node/docs/transpilers - */ - swc?: boolean; - /** - * Paths which should not be compiled. - * - * Each string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation. - * - * Source paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded. - * - * Default is to ignore all node_modules subdirectories. - * - * @default ["(?:^|/)node_modules/"] - */ - ignore?: string[]; - /** - * Path to TypeScript config file or directory containing a `tsconfig.json`. - * Similar to the `tsc --project` flag: https://www.typescriptlang.org/docs/handbook/compiler-options.html - */ - project?: string; - /** - * Search for TypeScript config file (`tsconfig.json`) in this or parent directories. - */ - projectSearchDir?: string; - /** - * Skip project config resolution and loading. - * - * @default false - */ - skipProject?: boolean; - /** - * Skip ignore check, so that compilation will be attempted for all files with matching extensions. - * - * @default false - */ - skipIgnore?: boolean; - /** - * JSON object to merge with TypeScript `compilerOptions`. - * - * @allOf [{"$ref": "https://schemastore.azurewebsites.net/schemas/json/tsconfig.json#definitions/compilerOptionsDefinition/properties/compilerOptions"}] - */ - compilerOptions?: object; - /** - * Ignore TypeScript warnings by diagnostic code. - */ - ignoreDiagnostics?: Array; - /** - * Modules to require, like node's `--require` flag. - * - * If specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file. - * - * If specified programmatically, each input string should be pre-resolved to an absolute path for - * best results. - */ - require?: Array; - readFile?: (path: string) => string | undefined; - fileExists?: (path: string) => boolean; - transformers?: _ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers); - /** - * Allows the usage of top level await in REPL. - * - * Uses node's implementation which accomplishes this with an AST syntax transformation. - * - * Enabled by default when tsconfig target is es2018 or above. Set to false to disable. - * - * **Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined` - * to get default, automatic behavior. - */ - experimentalReplAwait?: boolean; - /** - * Override certain paths to be compiled and executed as CommonJS or ECMAScript modules. - * When overridden, the tsconfig "module" and package.json "type" fields are overridden, and - * the file extension is ignored. - * This is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions; - * it achieves the same effect. - * - * Each key is a glob pattern following the same rules as tsconfig's "include" array. - * When multiple patterns match the same file, the last pattern takes precedence. - * - * `cjs` overrides matches files to compile and execute as CommonJS. - * `esm` overrides matches files to compile and execute as native ECMAScript modules. - * `package` overrides either of the above to default behavior, which obeys package.json "type" and - * tsconfig.json "module" options. - */ - moduleTypes?: ModuleTypes; - /** - * A function to collect trace messages from the TypeScript compiler, for example when `traceResolution` is enabled. - * - * @default console.log - */ - tsTrace?: (str: string) => void; - /** - * Enable native ESM support. - * - * For details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules - */ - esm?: boolean; - /** - * Re-order file extensions so that TypeScript imports are preferred. - * - * For example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js` - * - * @default false - */ - preferTsExts?: boolean; - /** - * Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience. - * - * For details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm - */ - experimentalSpecifierResolution?: 'node' | 'explicit'; - /** - * Allow using voluntary `.ts` file extension in import specifiers. - * - * Typically, in ESM projects, import specifiers must have an emit extension, `.js`, `.cjs`, or `.mjs`, - * and we automatically map to the corresponding `.ts`, `.cts`, or `.mts` source file. This is the - * recommended approach. - * - * However, if you really want to use `.ts` in import specifiers, and are aware that this may - * break tooling, you can enable this flag. - */ - experimentalTsImportSpecifiers?: boolean; -} -export declare type ModuleTypes = Record; -export declare type ModuleTypeOverride = 'cjs' | 'esm' | 'package'; -/** - * Options for registering a TypeScript compiler instance globally. - - * @category Basic - */ -export interface RegisterOptions extends CreateOptions { - /** - * Enable experimental features that re-map imports and require calls to support: - * `baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings, - * `outDir` to `rootDir` mappings for composite projects and monorepos. - * - * For details, see https://github.com/TypeStrong/ts-node/issues/1514 - */ - experimentalResolver?: boolean; -} -export declare type ExperimentalSpecifierResolution = 'node' | 'explicit'; -/** - * Must be an interface to support `typescript-json-schema`. - */ -export interface TsConfigOptions extends Omit { -} -/** - * Information retrieved from type info check. - */ -export interface TypeInfo { - name: string; - comment: string; -} -/** - * TypeScript diagnostics error. - */ -export declare class TSError extends BaseError { - diagnosticCodes: number[]; - name: string; - diagnosticText: string; - diagnostics: ReadonlyArray<_ts.Diagnostic>; - constructor(diagnosticText: string, diagnosticCodes: number[], diagnostics?: ReadonlyArray<_ts.Diagnostic>); -} -/** - * Primary ts-node service, which wraps the TypeScript API and can compile TypeScript to JavaScript - */ -export interface Service { - ts: TSCommon; - config: _ts.ParsedCommandLine; - options: RegisterOptions; - enabled(enabled?: boolean): boolean; - ignored(fileName: string): boolean; - compile(code: string, fileName: string, lineOffset?: number): string; - getTypeInfo(code: string, fileName: string, position: number): TypeInfo; -} -/** - * Re-export of `Service` interface for backwards-compatibility - * @deprecated use `Service` instead - * @see {Service} - */ -export declare type Register = Service; -/** - * Create a new TypeScript compiler instance and register it onto node.js - * - * @category Basic - */ -export declare function register(opts?: RegisterOptions): Service; -/** - * Register TypeScript compiler instance onto node.js - - * @category Basic - */ -export declare function register(service: Service): Service; -/** - * Create TypeScript compiler instance. - * - * @category Basic - */ -export declare function create(rawOptions?: CreateOptions): Service; -/** - * Create an implementation of node's ESM loader hooks. - * - * This may be useful if you - * want to wrap or compose the loader hooks to add additional functionality or - * combine with another loader. - * - * Node changed the hooks API, so there are two possible APIs. This function - * detects your node version and returns the appropriate API. - * - * @category ESM Loader - */ -export declare const createEsmHooks: typeof createEsmHooksFn; -/** - * When using `module: nodenext` or `module: node12`, there are two possible styles of emit depending in file extension or package.json "type": - * - * - CommonJS with dynamic imports preserved (not transformed into `require()` calls) - * - ECMAScript modules with `import foo = require()` transformed into `require = createRequire(); const foo = require()` - */ -export declare type NodeModuleEmitKind = 'nodeesm' | 'nodecjs'; diff --git a/node_modules/ts-node/dist/index.js b/node_modules/ts-node/dist/index.js deleted file mode 100644 index c03afbf..0000000 --- a/node_modules/ts-node/dist/index.js +++ /dev/null @@ -1,953 +0,0 @@ -"use strict"; -var _a, _b; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createEsmHooks = exports.createFromPreloadedConfig = exports.create = exports.register = exports.TSError = exports.DEFAULTS = exports.VERSION = exports.debug = exports.INSPECT_CUSTOM = exports.env = exports.REGISTER_INSTANCE = exports.createRepl = void 0; -const path_1 = require("path"); -const module_1 = require("module"); -const util = require("util"); -const url_1 = require("url"); -const make_error_1 = require("make-error"); -const util_1 = require("./util"); -const configuration_1 = require("./configuration"); -const module_type_classifier_1 = require("./module-type-classifier"); -const resolver_functions_1 = require("./resolver-functions"); -const cjs_resolve_hooks_1 = require("./cjs-resolve-hooks"); -const node_module_type_classifier_1 = require("./node-module-type-classifier"); -const file_extensions_1 = require("./file-extensions"); -const ts_transpile_module_1 = require("./ts-transpile-module"); -var repl_1 = require("./repl"); -Object.defineProperty(exports, "createRepl", { enumerable: true, get: function () { return repl_1.createRepl; } }); -/** - * Does this version of node obey the package.json "type" field - * and throw ERR_REQUIRE_ESM when attempting to require() an ESM modules. - */ -const engineSupportsPackageTypeField = parseInt(process.versions.node.split('.')[0], 10) >= 12; -/** - * Assert that script can be loaded as CommonJS when we attempt to require it. - * If it should be loaded as ESM, throw ERR_REQUIRE_ESM like node does. - * - * Loaded conditionally so we don't need to support older node versions - */ -let assertScriptCanLoadAsCJS = engineSupportsPackageTypeField - ? require('../dist-raw/node-internal-modules-cjs-loader').assertScriptCanLoadAsCJSImpl - : () => { - /* noop */ - }; -/** - * Registered `ts-node` instance information. - */ -exports.REGISTER_INSTANCE = Symbol.for('ts-node.register.instance'); -/** @internal */ -exports.env = process.env; -/** - * @internal - */ -exports.INSPECT_CUSTOM = util.inspect.custom || 'inspect'; -/** - * Debugging `ts-node`. - */ -const shouldDebug = (0, util_1.yn)(exports.env.TS_NODE_DEBUG); -/** @internal */ -exports.debug = shouldDebug - ? (...args) => console.log(`[ts-node ${new Date().toISOString()}]`, ...args) - : () => undefined; -const debugFn = shouldDebug - ? (key, fn) => { - let i = 0; - return (x) => { - (0, exports.debug)(key, x, ++i); - return fn(x); - }; - } - : (_, fn) => fn; -/** - * Export the current version. - */ -exports.VERSION = require('../package.json').version; -/** - * Default register options, including values specified via environment - * variables. - * @internal - */ -exports.DEFAULTS = { - cwd: (_a = exports.env.TS_NODE_CWD) !== null && _a !== void 0 ? _a : exports.env.TS_NODE_DIR, - emit: (0, util_1.yn)(exports.env.TS_NODE_EMIT), - scope: (0, util_1.yn)(exports.env.TS_NODE_SCOPE), - scopeDir: exports.env.TS_NODE_SCOPE_DIR, - files: (0, util_1.yn)(exports.env.TS_NODE_FILES), - pretty: (0, util_1.yn)(exports.env.TS_NODE_PRETTY), - compiler: exports.env.TS_NODE_COMPILER, - compilerOptions: (0, util_1.parse)(exports.env.TS_NODE_COMPILER_OPTIONS), - ignore: (0, util_1.split)(exports.env.TS_NODE_IGNORE), - project: exports.env.TS_NODE_PROJECT, - skipProject: (0, util_1.yn)(exports.env.TS_NODE_SKIP_PROJECT), - skipIgnore: (0, util_1.yn)(exports.env.TS_NODE_SKIP_IGNORE), - preferTsExts: (0, util_1.yn)(exports.env.TS_NODE_PREFER_TS_EXTS), - ignoreDiagnostics: (0, util_1.split)(exports.env.TS_NODE_IGNORE_DIAGNOSTICS), - transpileOnly: (0, util_1.yn)(exports.env.TS_NODE_TRANSPILE_ONLY), - typeCheck: (0, util_1.yn)(exports.env.TS_NODE_TYPE_CHECK), - compilerHost: (0, util_1.yn)(exports.env.TS_NODE_COMPILER_HOST), - logError: (0, util_1.yn)(exports.env.TS_NODE_LOG_ERROR), - experimentalReplAwait: (_b = (0, util_1.yn)(exports.env.TS_NODE_EXPERIMENTAL_REPL_AWAIT)) !== null && _b !== void 0 ? _b : undefined, - tsTrace: console.log.bind(console), -}; -/** - * TypeScript diagnostics error. - */ -class TSError extends make_error_1.BaseError { - constructor(diagnosticText, diagnosticCodes, diagnostics = []) { - super(`⨯ Unable to compile TypeScript:\n${diagnosticText}`); - this.diagnosticCodes = diagnosticCodes; - this.name = 'TSError'; - Object.defineProperty(this, 'diagnosticText', { - configurable: true, - writable: true, - value: diagnosticText, - }); - Object.defineProperty(this, 'diagnostics', { - configurable: true, - writable: true, - value: diagnostics, - }); - } - /** - * @internal - */ - [exports.INSPECT_CUSTOM]() { - return this.diagnosticText; - } -} -exports.TSError = TSError; -const TS_NODE_SERVICE_BRAND = Symbol('TS_NODE_SERVICE_BRAND'); -function register(serviceOrOpts) { - // Is this a Service or a RegisterOptions? - let service = serviceOrOpts; - if (!(serviceOrOpts === null || serviceOrOpts === void 0 ? void 0 : serviceOrOpts[TS_NODE_SERVICE_BRAND])) { - // Not a service; is options - service = create((serviceOrOpts !== null && serviceOrOpts !== void 0 ? serviceOrOpts : {})); - } - const originalJsHandler = require.extensions['.js']; - // Expose registered instance globally. - process[exports.REGISTER_INSTANCE] = service; - // Register the extensions. - registerExtensions(service.options.preferTsExts, service.extensions.compiled, service, originalJsHandler); - (0, cjs_resolve_hooks_1.installCommonjsResolveHooksIfNecessary)(service); - // Require specified modules before start-up. - module_1.Module._preloadModules(service.options.require); - return service; -} -exports.register = register; -/** - * Create TypeScript compiler instance. - * - * @category Basic - */ -function create(rawOptions = {}) { - const foundConfigResult = (0, configuration_1.findAndReadConfig)(rawOptions); - return createFromPreloadedConfig(foundConfigResult); -} -exports.create = create; -/** @internal */ -function createFromPreloadedConfig(foundConfigResult) { - var _a, _b, _c, _d; - const { configFilePath, cwd, options, config, compiler, projectLocalResolveDir, optionBasePaths, } = foundConfigResult; - const projectLocalResolveHelper = (0, util_1.createProjectLocalResolveHelper)(projectLocalResolveDir); - const ts = (0, configuration_1.loadCompiler)(compiler); - // Experimental REPL await is not compatible targets lower than ES2018 - const targetSupportsTla = config.options.target >= ts.ScriptTarget.ES2018; - if (options.experimentalReplAwait === true && !targetSupportsTla) { - throw new Error('Experimental REPL await is not compatible with targets lower than ES2018'); - } - // Top-level await was added in TS 3.8 - const tsVersionSupportsTla = (0, util_1.versionGteLt)(ts.version, '3.8.0'); - if (options.experimentalReplAwait === true && !tsVersionSupportsTla) { - throw new Error('Experimental REPL await is not compatible with TypeScript versions older than 3.8'); - } - const shouldReplAwait = options.experimentalReplAwait !== false && - tsVersionSupportsTla && - targetSupportsTla; - // swc implies two other options - // typeCheck option was implemented specifically to allow overriding tsconfig transpileOnly from the command-line - // So we should allow using typeCheck to override swc - if (options.swc && !options.typeCheck) { - if (options.transpileOnly === false) { - throw new Error("Cannot enable 'swc' option with 'transpileOnly: false'. 'swc' implies 'transpileOnly'."); - } - if (options.transpiler) { - throw new Error("Cannot specify both 'swc' and 'transpiler' options. 'swc' uses the built-in swc transpiler."); - } - } - const readFile = options.readFile || ts.sys.readFile; - const fileExists = options.fileExists || ts.sys.fileExists; - // typeCheck can override transpileOnly, useful for CLI flag to override config file - const transpileOnly = (options.transpileOnly === true || options.swc === true) && - options.typeCheck !== true; - let transpiler = undefined; - let transpilerBasePath = undefined; - if (options.transpiler) { - transpiler = options.transpiler; - transpilerBasePath = optionBasePaths.transpiler; - } - else if (options.swc) { - transpiler = require.resolve('./transpilers/swc.js'); - transpilerBasePath = optionBasePaths.swc; - } - const transformers = options.transformers || undefined; - const diagnosticFilters = [ - { - appliesToAllFiles: true, - filenamesAbsolute: [], - diagnosticsIgnored: [ - 6059, - 18002, - 18003, - ...(options.experimentalTsImportSpecifiers - ? [ - 2691, // "An import path cannot end with a '.ts' extension. Consider importing '' instead." - ] - : []), - ...(options.ignoreDiagnostics || []), - ].map(Number), - }, - ]; - const configDiagnosticList = filterDiagnostics(config.errors, diagnosticFilters); - const outputCache = new Map(); - const configFileDirname = configFilePath ? (0, path_1.dirname)(configFilePath) : null; - const scopeDir = (_c = (_b = (_a = options.scopeDir) !== null && _a !== void 0 ? _a : config.options.rootDir) !== null && _b !== void 0 ? _b : configFileDirname) !== null && _c !== void 0 ? _c : cwd; - const ignoreBaseDir = configFileDirname !== null && configFileDirname !== void 0 ? configFileDirname : cwd; - const isScoped = options.scope - ? (fileName) => (0, path_1.relative)(scopeDir, fileName).charAt(0) !== '.' - : () => true; - const shouldIgnore = createIgnore(ignoreBaseDir, options.skipIgnore - ? [] - : (options.ignore || ['(?:^|/)node_modules/']).map((str) => new RegExp(str))); - const diagnosticHost = { - getNewLine: () => ts.sys.newLine, - getCurrentDirectory: () => cwd, - // TODO switch to getCanonicalFileName we already create later in scope - getCanonicalFileName: ts.sys.useCaseSensitiveFileNames - ? (x) => x - : (x) => x.toLowerCase(), - }; - if (options.transpileOnly && typeof transformers === 'function') { - throw new TypeError('Transformers function is unavailable in "--transpile-only"'); - } - let createTranspiler = initializeTranspilerFactory(); - function initializeTranspilerFactory() { - var _a; - if (transpiler) { - if (!transpileOnly) - throw new Error('Custom transpiler can only be used when transpileOnly is enabled.'); - const transpilerName = typeof transpiler === 'string' ? transpiler : transpiler[0]; - const transpilerOptions = typeof transpiler === 'string' ? {} : (_a = transpiler[1]) !== null && _a !== void 0 ? _a : {}; - const transpilerConfigLocalResolveHelper = transpilerBasePath - ? (0, util_1.createProjectLocalResolveHelper)(transpilerBasePath) - : projectLocalResolveHelper; - const transpilerPath = transpilerConfigLocalResolveHelper(transpilerName, true); - const transpilerFactory = require(transpilerPath) - .create; - return createTranspiler; - function createTranspiler(compilerOptions, nodeModuleEmitKind) { - return transpilerFactory === null || transpilerFactory === void 0 ? void 0 : transpilerFactory({ - service: { - options, - config: { - ...config, - options: compilerOptions, - }, - projectLocalResolveHelper, - }, - transpilerConfigLocalResolveHelper, - nodeModuleEmitKind, - ...transpilerOptions, - }); - } - } - } - /** - * True if require() hooks should interop with experimental ESM loader. - * Enabled explicitly via a flag since it is a breaking change. - */ - let experimentalEsmLoader = false; - function enableExperimentalEsmLoaderInterop() { - experimentalEsmLoader = true; - } - // Install source map support and read from memory cache. - installSourceMapSupport(); - function installSourceMapSupport() { - const sourceMapSupport = require('@cspotcode/source-map-support'); - sourceMapSupport.install({ - environment: 'node', - retrieveFile(pathOrUrl) { - var _a; - let path = pathOrUrl; - // If it's a file URL, convert to local path - // Note: fileURLToPath does not exist on early node v10 - // I could not find a way to handle non-URLs except to swallow an error - if (experimentalEsmLoader && path.startsWith('file://')) { - try { - path = (0, url_1.fileURLToPath)(path); - } - catch (e) { - /* swallow error */ - } - } - path = (0, util_1.normalizeSlashes)(path); - return ((_a = outputCache.get(path)) === null || _a === void 0 ? void 0 : _a.content) || ''; - }, - redirectConflictingLibrary: true, - onConflictingLibraryRedirect(request, parent, isMain, options, redirectedRequest) { - (0, exports.debug)(`Redirected an attempt to require source-map-support to instead receive @cspotcode/source-map-support. "${parent.filename}" attempted to require or resolve "${request}" and was redirected to "${redirectedRequest}".`); - }, - }); - } - const shouldHavePrettyErrors = options.pretty === undefined ? process.stdout.isTTY : options.pretty; - const formatDiagnostics = shouldHavePrettyErrors - ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics - : ts.formatDiagnostics; - function createTSError(diagnostics) { - const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost); - const diagnosticCodes = diagnostics.map((x) => x.code); - return new TSError(diagnosticText, diagnosticCodes, diagnostics); - } - function reportTSError(configDiagnosticList) { - const error = createTSError(configDiagnosticList); - if (options.logError) { - // Print error in red color and continue execution. - console.error('\x1b[31m%s\x1b[0m', error); - } - else { - // Throw error and exit the script. - throw error; - } - } - // Render the configuration errors. - if (configDiagnosticList.length) - reportTSError(configDiagnosticList); - const jsxEmitPreserve = config.options.jsx === ts.JsxEmit.Preserve; - /** - * Get the extension for a transpiled file. - * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] - */ - function getEmitExtension(path) { - const lastDotIndex = path.lastIndexOf('.'); - if (lastDotIndex >= 0) { - const ext = path.slice(lastDotIndex); - switch (ext) { - case '.js': - case '.ts': - return '.js'; - case '.jsx': - case '.tsx': - return jsxEmitPreserve ? '.jsx' : '.js'; - case '.mjs': - case '.mts': - return '.mjs'; - case '.cjs': - case '.cts': - return '.cjs'; - } - } - return '.js'; - } - /** - * Get output from TS compiler w/typechecking. `undefined` in `transpileOnly` - * mode. - */ - let getOutput; - let getTypeInfo; - const getCanonicalFileName = ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames); - const moduleTypeClassifier = (0, module_type_classifier_1.createModuleTypeClassifier)({ - basePath: (_d = options.optionBasePaths) === null || _d === void 0 ? void 0 : _d.moduleTypes, - patterns: options.moduleTypes, - }); - const extensions = (0, file_extensions_1.getExtensions)(config, options, ts.version); - // Use full language services when the fast option is disabled. - if (!transpileOnly) { - const fileContents = new Map(); - const rootFileNames = new Set(config.fileNames); - const cachedReadFile = (0, util_1.cachedLookup)(debugFn('readFile', readFile)); - // Use language services by default - if (!options.compilerHost) { - let projectVersion = 1; - const fileVersions = new Map(Array.from(rootFileNames).map((fileName) => [fileName, 0])); - const getCustomTransformers = () => { - if (typeof transformers === 'function') { - const program = service.getProgram(); - return program ? transformers(program) : undefined; - } - return transformers; - }; - // Create the compiler host for type checking. - const serviceHost = { - getProjectVersion: () => String(projectVersion), - getScriptFileNames: () => Array.from(rootFileNames), - getScriptVersion: (fileName) => { - const version = fileVersions.get(fileName); - return version ? version.toString() : ''; - }, - getScriptSnapshot(fileName) { - // TODO ordering of this with getScriptVersion? Should they sync up? - let contents = fileContents.get(fileName); - // Read contents into TypeScript memory cache. - if (contents === undefined) { - contents = cachedReadFile(fileName); - if (contents === undefined) - return; - fileVersions.set(fileName, 1); - fileContents.set(fileName, contents); - projectVersion++; - } - return ts.ScriptSnapshot.fromString(contents); - }, - readFile: cachedReadFile, - readDirectory: ts.sys.readDirectory, - getDirectories: (0, util_1.cachedLookup)(debugFn('getDirectories', ts.sys.getDirectories)), - fileExists: (0, util_1.cachedLookup)(debugFn('fileExists', fileExists)), - directoryExists: (0, util_1.cachedLookup)(debugFn('directoryExists', ts.sys.directoryExists)), - realpath: ts.sys.realpath - ? (0, util_1.cachedLookup)(debugFn('realpath', ts.sys.realpath)) - : undefined, - getNewLine: () => ts.sys.newLine, - useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames, - getCurrentDirectory: () => cwd, - getCompilationSettings: () => config.options, - getDefaultLibFileName: () => ts.getDefaultLibFilePath(config.options), - getCustomTransformers: getCustomTransformers, - trace: options.tsTrace, - }; - const { resolveModuleNames, getResolvedModuleWithFailedLookupLocationsFromCache, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal, } = (0, resolver_functions_1.createResolverFunctions)({ - host: serviceHost, - getCanonicalFileName, - ts, - cwd, - config, - projectLocalResolveHelper, - options, - extensions, - }); - serviceHost.resolveModuleNames = resolveModuleNames; - serviceHost.getResolvedModuleWithFailedLookupLocationsFromCache = - getResolvedModuleWithFailedLookupLocationsFromCache; - serviceHost.resolveTypeReferenceDirectives = - resolveTypeReferenceDirectives; - const registry = ts.createDocumentRegistry(ts.sys.useCaseSensitiveFileNames, cwd); - const service = ts.createLanguageService(serviceHost, registry); - const updateMemoryCache = (contents, fileName) => { - // Add to `rootFiles` as necessary, either to make TS include a file it has not seen, - // or to trigger a re-classification of files from external to internal. - if (!rootFileNames.has(fileName) && - !isFileKnownToBeInternal(fileName)) { - markBucketOfFilenameInternal(fileName); - rootFileNames.add(fileName); - // Increment project version for every change to rootFileNames. - projectVersion++; - } - const previousVersion = fileVersions.get(fileName) || 0; - const previousContents = fileContents.get(fileName); - // Avoid incrementing cache when nothing has changed. - if (contents !== previousContents) { - fileVersions.set(fileName, previousVersion + 1); - fileContents.set(fileName, contents); - // Increment project version for every file change. - projectVersion++; - } - }; - let previousProgram = undefined; - getOutput = (code, fileName) => { - updateMemoryCache(code, fileName); - const programBefore = service.getProgram(); - if (programBefore !== previousProgram) { - (0, exports.debug)(`compiler rebuilt Program instance when getting output for ${fileName}`); - } - const output = service.getEmitOutput(fileName); - // Get the relevant diagnostics - this is 3x faster than `getPreEmitDiagnostics`. - const diagnostics = service - .getSemanticDiagnostics(fileName) - .concat(service.getSyntacticDiagnostics(fileName)); - const programAfter = service.getProgram(); - (0, exports.debug)('invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ', programBefore === programAfter); - previousProgram = programAfter; - const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters); - if (diagnosticList.length) - reportTSError(diagnosticList); - if (output.emitSkipped) { - return [undefined, undefined, true]; - } - // Throw an error when requiring `.d.ts` files. - if (output.outputFiles.length === 0) { - throw new TypeError(`Unable to require file: ${(0, path_1.relative)(cwd, fileName)}\n` + - 'This is usually the result of a faulty configuration or import. ' + - 'Make sure there is a `.js`, `.json` or other executable extension with ' + - 'loader attached before `ts-node` available.'); - } - return [output.outputFiles[1].text, output.outputFiles[0].text, false]; - }; - getTypeInfo = (code, fileName, position) => { - const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); - updateMemoryCache(code, normalizedFileName); - const info = service.getQuickInfoAtPosition(normalizedFileName, position); - const name = ts.displayPartsToString(info ? info.displayParts : []); - const comment = ts.displayPartsToString(info ? info.documentation : []); - return { name, comment }; - }; - } - else { - const sys = { - ...ts.sys, - ...diagnosticHost, - readFile: (fileName) => { - const cacheContents = fileContents.get(fileName); - if (cacheContents !== undefined) - return cacheContents; - const contents = cachedReadFile(fileName); - if (contents) - fileContents.set(fileName, contents); - return contents; - }, - readDirectory: ts.sys.readDirectory, - getDirectories: (0, util_1.cachedLookup)(debugFn('getDirectories', ts.sys.getDirectories)), - fileExists: (0, util_1.cachedLookup)(debugFn('fileExists', fileExists)), - directoryExists: (0, util_1.cachedLookup)(debugFn('directoryExists', ts.sys.directoryExists)), - resolvePath: (0, util_1.cachedLookup)(debugFn('resolvePath', ts.sys.resolvePath)), - realpath: ts.sys.realpath - ? (0, util_1.cachedLookup)(debugFn('realpath', ts.sys.realpath)) - : undefined, - }; - const host = ts.createIncrementalCompilerHost - ? ts.createIncrementalCompilerHost(config.options, sys) - : { - ...sys, - getSourceFile: (fileName, languageVersion) => { - const contents = sys.readFile(fileName); - if (contents === undefined) - return; - return ts.createSourceFile(fileName, contents, languageVersion); - }, - getDefaultLibLocation: () => (0, util_1.normalizeSlashes)((0, path_1.dirname)(compiler)), - getDefaultLibFileName: () => (0, util_1.normalizeSlashes)((0, path_1.join)((0, path_1.dirname)(compiler), ts.getDefaultLibFileName(config.options))), - useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, - }; - host.trace = options.tsTrace; - const { resolveModuleNames, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal, } = (0, resolver_functions_1.createResolverFunctions)({ - host, - cwd, - config, - ts, - getCanonicalFileName, - projectLocalResolveHelper, - options, - extensions, - }); - host.resolveModuleNames = resolveModuleNames; - host.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives; - // Fallback for older TypeScript releases without incremental API. - let builderProgram = ts.createIncrementalProgram - ? ts.createIncrementalProgram({ - rootNames: Array.from(rootFileNames), - options: config.options, - host, - configFileParsingDiagnostics: config.errors, - projectReferences: config.projectReferences, - }) - : ts.createEmitAndSemanticDiagnosticsBuilderProgram(Array.from(rootFileNames), config.options, host, undefined, config.errors, config.projectReferences); - // Read and cache custom transformers. - const customTransformers = typeof transformers === 'function' - ? transformers(builderProgram.getProgram()) - : transformers; - // Set the file contents into cache manually. - const updateMemoryCache = (contents, fileName) => { - const previousContents = fileContents.get(fileName); - const contentsChanged = previousContents !== contents; - if (contentsChanged) { - fileContents.set(fileName, contents); - } - // Add to `rootFiles` when discovered by compiler for the first time. - let addedToRootFileNames = false; - if (!rootFileNames.has(fileName) && - !isFileKnownToBeInternal(fileName)) { - markBucketOfFilenameInternal(fileName); - rootFileNames.add(fileName); - addedToRootFileNames = true; - } - // Update program when file changes. - if (addedToRootFileNames || contentsChanged) { - builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(Array.from(rootFileNames), config.options, host, builderProgram, config.errors, config.projectReferences); - } - }; - getOutput = (code, fileName) => { - let outText = ''; - let outMap = ''; - updateMemoryCache(code, fileName); - const sourceFile = builderProgram.getSourceFile(fileName); - if (!sourceFile) - throw new TypeError(`Unable to read file: ${fileName}`); - const program = builderProgram.getProgram(); - const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile); - const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters); - if (diagnosticList.length) - reportTSError(diagnosticList); - const result = builderProgram.emit(sourceFile, (path, file, writeByteOrderMark) => { - if (path.endsWith('.map')) { - outMap = file; - } - else { - outText = file; - } - if (options.emit) - sys.writeFile(path, file, writeByteOrderMark); - }, undefined, undefined, customTransformers); - if (result.emitSkipped) { - return [undefined, undefined, true]; - } - // Throw an error when requiring files that cannot be compiled. - if (outText === '') { - if (program.isSourceFileFromExternalLibrary(sourceFile)) { - throw new TypeError(`Unable to compile file from external library: ${(0, path_1.relative)(cwd, fileName)}`); - } - throw new TypeError(`Unable to require file: ${(0, path_1.relative)(cwd, fileName)}\n` + - 'This is usually the result of a faulty configuration or import. ' + - 'Make sure there is a `.js`, `.json` or other executable extension with ' + - 'loader attached before `ts-node` available.'); - } - return [outText, outMap, false]; - }; - getTypeInfo = (code, fileName, position) => { - const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); - updateMemoryCache(code, normalizedFileName); - const sourceFile = builderProgram.getSourceFile(normalizedFileName); - if (!sourceFile) - throw new TypeError(`Unable to read file: ${fileName}`); - const node = getTokenAtPosition(ts, sourceFile, position); - const checker = builderProgram.getProgram().getTypeChecker(); - const symbol = checker.getSymbolAtLocation(node); - if (!symbol) - return { name: '', comment: '' }; - const type = checker.getTypeOfSymbolAtLocation(symbol, node); - const signatures = [ - ...type.getConstructSignatures(), - ...type.getCallSignatures(), - ]; - return { - name: signatures.length - ? signatures.map((x) => checker.signatureToString(x)).join('\n') - : checker.typeToString(type), - comment: ts.displayPartsToString(symbol ? symbol.getDocumentationComment(checker) : []), - }; - }; - // Write `.tsbuildinfo` when `--build` is enabled. - if (options.emit && config.options.incremental) { - process.on('exit', () => { - // Emits `.tsbuildinfo` to filesystem. - builderProgram.getProgram().emitBuildInfo(); - }); - } - } - } - else { - getTypeInfo = () => { - throw new TypeError('Type information is unavailable in "--transpile-only"'); - }; - } - function createTranspileOnlyGetOutputFunction(overrideModuleType, nodeModuleEmitKind) { - const compilerOptions = { ...config.options }; - if (overrideModuleType !== undefined) - compilerOptions.module = overrideModuleType; - let customTranspiler = createTranspiler === null || createTranspiler === void 0 ? void 0 : createTranspiler(compilerOptions, nodeModuleEmitKind); - let tsTranspileModule = (0, util_1.versionGteLt)(ts.version, '4.7.0') - ? (0, ts_transpile_module_1.createTsTranspileModule)(ts, { - compilerOptions, - reportDiagnostics: true, - transformers: transformers, - }) - : undefined; - return (code, fileName) => { - let result; - if (customTranspiler) { - result = customTranspiler.transpile(code, { - fileName, - }); - } - else if (tsTranspileModule) { - result = tsTranspileModule(code, { - fileName, - }, nodeModuleEmitKind === 'nodeesm' ? 'module' : 'commonjs'); - } - else { - result = ts.transpileModule(code, { - fileName, - compilerOptions, - reportDiagnostics: true, - transformers: transformers, - }); - } - const diagnosticList = filterDiagnostics(result.diagnostics || [], diagnosticFilters); - if (diagnosticList.length) - reportTSError(diagnosticList); - return [result.outputText, result.sourceMapText, false]; - }; - } - // When true, these mean that a `moduleType` override will cause a different emit - // than the TypeScript compiler, so we *must* overwrite the emit. - const shouldOverwriteEmitWhenForcingCommonJS = config.options.module !== ts.ModuleKind.CommonJS; - // [MUST_UPDATE_FOR_NEW_MODULEKIND] - const shouldOverwriteEmitWhenForcingEsm = !(config.options.module === ts.ModuleKind.ES2015 || - (ts.ModuleKind.ES2020 && config.options.module === ts.ModuleKind.ES2020) || - (ts.ModuleKind.ES2022 && config.options.module === ts.ModuleKind.ES2022) || - config.options.module === ts.ModuleKind.ESNext); - /** - * node16 or nodenext - * [MUST_UPDATE_FOR_NEW_MODULEKIND] - */ - const isNodeModuleType = (ts.ModuleKind.Node16 && config.options.module === ts.ModuleKind.Node16) || - (ts.ModuleKind.NodeNext && - config.options.module === ts.ModuleKind.NodeNext); - const getOutputForceCommonJS = createTranspileOnlyGetOutputFunction(ts.ModuleKind.CommonJS); - const getOutputForceNodeCommonJS = createTranspileOnlyGetOutputFunction(ts.ModuleKind.NodeNext, 'nodecjs'); - const getOutputForceNodeESM = createTranspileOnlyGetOutputFunction(ts.ModuleKind.NodeNext, 'nodeesm'); - // [MUST_UPDATE_FOR_NEW_MODULEKIND] - const getOutputForceESM = createTranspileOnlyGetOutputFunction(ts.ModuleKind.ES2022 || ts.ModuleKind.ES2020 || ts.ModuleKind.ES2015); - const getOutputTranspileOnly = createTranspileOnlyGetOutputFunction(); - // Create a simple TypeScript compiler proxy. - function compile(code, fileName, lineOffset = 0) { - const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); - const classification = moduleTypeClassifier.classifyModuleByModuleTypeOverrides(normalizedFileName); - let value = ''; - let sourceMap = ''; - let emitSkipped = true; - if (getOutput) { - // Must always call normal getOutput to throw typechecking errors - [value, sourceMap, emitSkipped] = getOutput(code, normalizedFileName); - } - // If module classification contradicts the above, call the relevant transpiler - if (classification.moduleType === 'cjs' && - (shouldOverwriteEmitWhenForcingCommonJS || emitSkipped)) { - [value, sourceMap] = getOutputForceCommonJS(code, normalizedFileName); - } - else if (classification.moduleType === 'esm' && - (shouldOverwriteEmitWhenForcingEsm || emitSkipped)) { - [value, sourceMap] = getOutputForceESM(code, normalizedFileName); - } - else if (emitSkipped) { - // Happens when ts compiler skips emit or in transpileOnly mode - const classification = (0, node_module_type_classifier_1.classifyModule)(fileName, isNodeModuleType); - [value, sourceMap] = - classification === 'nodecjs' - ? getOutputForceNodeCommonJS(code, normalizedFileName) - : classification === 'nodeesm' - ? getOutputForceNodeESM(code, normalizedFileName) - : classification === 'cjs' - ? getOutputForceCommonJS(code, normalizedFileName) - : classification === 'esm' - ? getOutputForceESM(code, normalizedFileName) - : getOutputTranspileOnly(code, normalizedFileName); - } - const output = updateOutput(value, normalizedFileName, sourceMap, getEmitExtension); - outputCache.set(normalizedFileName, { content: output }); - return output; - } - let active = true; - const enabled = (enabled) => enabled === undefined ? active : (active = !!enabled); - const ignored = (fileName) => { - if (!active) - return true; - const ext = (0, path_1.extname)(fileName); - if (extensions.compiled.includes(ext)) { - return !isScoped(fileName) || shouldIgnore(fileName); - } - return true; - }; - function addDiagnosticFilter(filter) { - diagnosticFilters.push({ - ...filter, - filenamesAbsolute: filter.filenamesAbsolute.map((f) => (0, util_1.normalizeSlashes)(f)), - }); - } - const getNodeEsmResolver = (0, util_1.once)(() => require('../dist-raw/node-internal-modules-esm-resolve').createResolve({ - extensions, - preferTsExts: options.preferTsExts, - tsNodeExperimentalSpecifierResolution: options.experimentalSpecifierResolution, - })); - const getNodeEsmGetFormat = (0, util_1.once)(() => require('../dist-raw/node-internal-modules-esm-get_format').createGetFormat(options.experimentalSpecifierResolution, getNodeEsmResolver())); - const getNodeCjsLoader = (0, util_1.once)(() => require('../dist-raw/node-internal-modules-cjs-loader').createCjsLoader({ - extensions, - preferTsExts: options.preferTsExts, - nodeEsmResolver: getNodeEsmResolver(), - })); - return { - [TS_NODE_SERVICE_BRAND]: true, - ts, - compilerPath: compiler, - config, - compile, - getTypeInfo, - ignored, - enabled, - options, - configFilePath, - moduleTypeClassifier, - shouldReplAwait, - addDiagnosticFilter, - installSourceMapSupport, - enableExperimentalEsmLoaderInterop, - transpileOnly, - projectLocalResolveHelper, - getNodeEsmResolver, - getNodeEsmGetFormat, - getNodeCjsLoader, - extensions, - }; -} -exports.createFromPreloadedConfig = createFromPreloadedConfig; -/** - * Check if the filename should be ignored. - */ -function createIgnore(ignoreBaseDir, ignore) { - return (fileName) => { - const relname = (0, path_1.relative)(ignoreBaseDir, fileName); - const path = (0, util_1.normalizeSlashes)(relname); - return ignore.some((x) => x.test(path)); - }; -} -/** - * Register the extensions to support when importing files. - */ -function registerExtensions(preferTsExts, extensions, service, originalJsHandler) { - const exts = new Set(extensions); - // Can't add these extensions cuz would allow omitting file extension; node requires ext for .cjs and .mjs - // Unless they're already registered by something else (nyc does this): - // then we *must* hook them or else our transformer will not be called. - for (const cannotAdd of ['.mts', '.cts', '.mjs', '.cjs']) { - if (exts.has(cannotAdd) && !(0, util_1.hasOwnProperty)(require.extensions, cannotAdd)) { - // Unrecognized file exts can be transformed via the `.js` handler. - exts.add('.js'); - exts.delete(cannotAdd); - } - } - // Register new extensions. - for (const ext of exts) { - registerExtension(ext, service, originalJsHandler); - } - if (preferTsExts) { - const preferredExtensions = new Set([ - ...exts, - ...Object.keys(require.extensions), - ]); - // Re-sort iteration order of Object.keys() - for (const ext of preferredExtensions) { - const old = Object.getOwnPropertyDescriptor(require.extensions, ext); - delete require.extensions[ext]; - Object.defineProperty(require.extensions, ext, old); - } - } -} -/** - * Register the extension for node. - */ -function registerExtension(ext, service, originalHandler) { - const old = require.extensions[ext] || originalHandler; - require.extensions[ext] = function (m, filename) { - if (service.ignored(filename)) - return old(m, filename); - assertScriptCanLoadAsCJS(service, m, filename); - const _compile = m._compile; - m._compile = function (code, fileName) { - (0, exports.debug)('module._compile', fileName); - const result = service.compile(code, fileName); - return _compile.call(this, result, fileName); - }; - return old(m, filename); - }; -} -/** - * Update the output remapping the source map. - */ -function updateOutput(outputText, fileName, sourceMap, getEmitExtension) { - const base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64'); - const sourceMapContent = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${base64Map}`; - // Expected form: `//# sourceMappingURL=foo bar.js.map` or `//# sourceMappingURL=foo%20bar.js.map` for input file "foo bar.tsx" - // Percent-encoding behavior added in TS 4.1.1: https://github.com/microsoft/TypeScript/issues/40951 - const prefix = '//# sourceMappingURL='; - const prefixLength = prefix.length; - const baseName = /*foo.tsx*/ (0, path_1.basename)(fileName); - const extName = /*.tsx*/ (0, path_1.extname)(fileName); - const extension = /*.js*/ getEmitExtension(fileName); - const sourcemapFilename = baseName.slice(0, -extName.length) + extension + '.map'; - const sourceMapLengthWithoutPercentEncoding = prefixLength + sourcemapFilename.length; - /* - * Only rewrite if existing directive exists at the location we expect, to support: - * a) compilers that do not append a sourcemap directive - * b) situations where we did the math wrong - * Not ideal, but appending our sourcemap *after* a pre-existing sourcemap still overrides, so the end-user is happy. - */ - if (outputText.substr(-sourceMapLengthWithoutPercentEncoding, prefixLength) === - prefix) { - return (outputText.slice(0, -sourceMapLengthWithoutPercentEncoding) + - sourceMapContent); - } - // If anyone asks why we're not using URL, the URL equivalent is: `u = new URL('http://d'); u.pathname = "/" + sourcemapFilename; return u.pathname.slice(1); - const sourceMapLengthWithPercentEncoding = prefixLength + encodeURI(sourcemapFilename).length; - if (outputText.substr(-sourceMapLengthWithPercentEncoding, prefixLength) === - prefix) { - return (outputText.slice(0, -sourceMapLengthWithPercentEncoding) + - sourceMapContent); - } - return `${outputText}\n${sourceMapContent}`; -} -/** - * Update the source map contents for improved output. - */ -function updateSourceMap(sourceMapText, fileName) { - const sourceMap = JSON.parse(sourceMapText); - sourceMap.file = fileName; - sourceMap.sources = [fileName]; - delete sourceMap.sourceRoot; - return JSON.stringify(sourceMap); -} -/** - * Filter diagnostics. - */ -function filterDiagnostics(diagnostics, filters) { - return diagnostics.filter((d) => filters.every((f) => { - var _a; - return (!f.appliesToAllFiles && - f.filenamesAbsolute.indexOf((_a = d.file) === null || _a === void 0 ? void 0 : _a.fileName) === -1) || - f.diagnosticsIgnored.indexOf(d.code) === -1; - })); -} -/** - * Get token at file position. - * - * Reference: https://github.com/microsoft/TypeScript/blob/fcd9334f57d85b73dd66ad2d21c02e84822f4841/src/services/utilities.ts#L705-L731 - */ -function getTokenAtPosition(ts, sourceFile, position) { - let current = sourceFile; - outer: while (true) { - for (const child of current.getChildren(sourceFile)) { - const start = child.getFullStart(); - if (start > position) - break; - const end = child.getEnd(); - if (position <= end) { - current = child; - continue outer; - } - } - return current; - } -} -/** - * Create an implementation of node's ESM loader hooks. - * - * This may be useful if you - * want to wrap or compose the loader hooks to add additional functionality or - * combine with another loader. - * - * Node changed the hooks API, so there are two possible APIs. This function - * detects your node version and returns the appropriate API. - * - * @category ESM Loader - */ -const createEsmHooks = (tsNodeService) => require('./esm').createEsmHooks(tsNodeService); -exports.createEsmHooks = createEsmHooks; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/index.js.map b/node_modules/ts-node/dist/index.js.map deleted file mode 100644 index c65cd12..0000000 --- a/node_modules/ts-node/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,+BAAkE;AAClE,mCAAgC;AAChC,6BAA6B;AAC7B,6BAAoC;AAGpC,2CAAuC;AAIvC,iCAWgB;AAChB,mDAAkE;AAElE,qEAGkC;AAClC,6DAA+D;AAE/D,2DAG6B;AAC7B,+EAA+D;AAI/D,uDAA8D;AAC9D,+DAAgE;AAGhE,+BAKgB;AAJd,kGAAA,UAAU,OAAA;AAmBZ;;;GAGG;AACH,MAAM,8BAA8B,GAClC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE1D;;;;;GAKG;AACH,IAAI,wBAAwB,GAIhB,8BAA8B;IACxC,CAAC,CACG,OAAO,CAAC,8CAA8C,CACvD,CAAC,4BAA4B;IAChC,CAAC,CAAC,GAAG,EAAE;QACH,UAAU;IACZ,CAAC,CAAC;AAEN;;GAEG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAazE,gBAAgB;AACH,QAAA,GAAG,GAAG,OAAO,CAAC,GAAiB,CAAC;AAkC7C;;GAEG;AACU,QAAA,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,G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,CAAC,CAAC;AAFnE,QAAA,cAAc,kBAEqD","sourcesContent":["import { relative, basename, extname, dirname, join } from 'path';\nimport { Module } from 'module';\nimport * as util from 'util';\nimport { fileURLToPath } from 'url';\n\nimport type * as _sourceMapSupport from '@cspotcode/source-map-support';\nimport { BaseError } from 'make-error';\nimport type * as _ts from 'typescript';\n\nimport type { Transpiler, TranspilerFactory } from './transpilers/types';\nimport {\n cachedLookup,\n createProjectLocalResolveHelper,\n hasOwnProperty,\n normalizeSlashes,\n once,\n parse,\n ProjectLocalResolveHelper,\n split,\n versionGteLt,\n yn,\n} from './util';\nimport { findAndReadConfig, loadCompiler } from './configuration';\nimport type { TSCommon, TSInternal } from './ts-compiler-types';\nimport {\n createModuleTypeClassifier,\n ModuleTypeClassifier,\n} from './module-type-classifier';\nimport { createResolverFunctions } from './resolver-functions';\nimport type { createEsmHooks as createEsmHooksFn } from './esm';\nimport {\n installCommonjsResolveHooksIfNecessary,\n ModuleConstructorWithInternals,\n} from './cjs-resolve-hooks';\nimport { classifyModule } from './node-module-type-classifier';\nimport type * as _nodeInternalModulesEsmResolve from '../dist-raw/node-internal-modules-esm-resolve';\nimport type * as _nodeInternalModulesEsmGetFormat from '../dist-raw/node-internal-modules-esm-get_format';\nimport type * as _nodeInternalModulesCjsLoader from '../dist-raw/node-internal-modules-cjs-loader';\nimport { Extensions, getExtensions } from './file-extensions';\nimport { createTsTranspileModule } from './ts-transpile-module';\n\nexport { TSCommon };\nexport {\n createRepl,\n CreateReplOptions,\n ReplService,\n EvalAwarePartialHost,\n} from './repl';\nexport type {\n TranspilerModule,\n TranspilerFactory,\n CreateTranspilerOptions,\n TranspileOutput,\n TranspileOptions,\n Transpiler,\n} from './transpilers/types';\nexport type {\n NodeLoaderHooksAPI1,\n NodeLoaderHooksAPI2,\n NodeLoaderHooksFormat,\n} from './esm';\n\n/**\n * Does this version of node obey the package.json \"type\" field\n * and throw ERR_REQUIRE_ESM when attempting to require() an ESM modules.\n */\nconst engineSupportsPackageTypeField =\n parseInt(process.versions.node.split('.')[0], 10) >= 12;\n\n/**\n * Assert that script can be loaded as CommonJS when we attempt to require it.\n * If it should be loaded as ESM, throw ERR_REQUIRE_ESM like node does.\n *\n * Loaded conditionally so we don't need to support older node versions\n */\nlet assertScriptCanLoadAsCJS: (\n service: Service,\n module: NodeJS.Module,\n filename: string\n) => void = engineSupportsPackageTypeField\n ? (\n require('../dist-raw/node-internal-modules-cjs-loader') as typeof _nodeInternalModulesCjsLoader\n ).assertScriptCanLoadAsCJSImpl\n : () => {\n /* noop */\n };\n\n/**\n * Registered `ts-node` instance information.\n */\nexport const REGISTER_INSTANCE = Symbol.for('ts-node.register.instance');\n\n/**\n * Expose `REGISTER_INSTANCE` information on node.js `process`.\n */\ndeclare global {\n namespace NodeJS {\n interface Process {\n [REGISTER_INSTANCE]?: Service;\n }\n }\n}\n\n/** @internal */\nexport const env = process.env as ProcessEnv;\n/**\n * Declare all env vars, to aid discoverability.\n * If an env var affects ts-node's behavior, it should not be buried somewhere in our codebase.\n * @internal\n */\nexport interface ProcessEnv {\n TS_NODE_DEBUG?: string;\n TS_NODE_CWD?: string;\n /** @deprecated */\n TS_NODE_DIR?: string;\n TS_NODE_EMIT?: string;\n TS_NODE_SCOPE?: string;\n TS_NODE_SCOPE_DIR?: string;\n TS_NODE_FILES?: string;\n TS_NODE_PRETTY?: string;\n TS_NODE_COMPILER?: string;\n TS_NODE_COMPILER_OPTIONS?: string;\n TS_NODE_IGNORE?: string;\n TS_NODE_PROJECT?: string;\n TS_NODE_SKIP_PROJECT?: string;\n TS_NODE_SKIP_IGNORE?: string;\n TS_NODE_PREFER_TS_EXTS?: string;\n TS_NODE_IGNORE_DIAGNOSTICS?: string;\n TS_NODE_TRANSPILE_ONLY?: string;\n TS_NODE_TYPE_CHECK?: string;\n TS_NODE_COMPILER_HOST?: string;\n TS_NODE_LOG_ERROR?: string;\n TS_NODE_HISTORY?: string;\n TS_NODE_EXPERIMENTAL_REPL_AWAIT?: string;\n\n NODE_NO_READLINE?: string;\n}\n\n/**\n * @internal\n */\nexport const INSPECT_CUSTOM = util.inspect.custom || 'inspect';\n\n/**\n * Debugging `ts-node`.\n */\nconst shouldDebug = yn(env.TS_NODE_DEBUG);\n/** @internal */\nexport const debug = shouldDebug\n ? (...args: any) =>\n console.log(`[ts-node ${new Date().toISOString()}]`, ...args)\n : () => undefined;\nconst debugFn = shouldDebug\n ? (key: string, fn: (arg: T) => U) => {\n let i = 0;\n return (x: T) => {\n debug(key, x, ++i);\n return fn(x);\n };\n }\n : (_: string, fn: (arg: T) => U) => fn;\n\n/**\n * Export the current version.\n */\nexport const VERSION = require('../package.json').version;\n\n/**\n * Options for creating a new TypeScript compiler instance.\n\n * @category Basic\n */\nexport interface CreateOptions {\n /**\n * Behave as if invoked within this working directory. Roughly equivalent to `cd $dir && ts-node ...`\n *\n * @default process.cwd()\n */\n cwd?: string;\n /**\n * Legacy alias for `cwd`\n *\n * @deprecated use `projectSearchDir` or `cwd`\n */\n dir?: string;\n /**\n * Emit output files into `.ts-node` directory.\n *\n * @default false\n */\n emit?: boolean;\n /**\n * Scope compiler to files within `scopeDir`.\n *\n * @default false\n */\n scope?: boolean;\n /**\n * @default First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.\n */\n scopeDir?: string;\n /**\n * Use pretty diagnostic formatter.\n *\n * @default false\n */\n pretty?: boolean;\n /**\n * Use TypeScript's faster `transpileModule`.\n *\n * @default false\n */\n transpileOnly?: boolean;\n /**\n * **DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).\n *\n * @default true\n */\n typeCheck?: boolean;\n /**\n * Use TypeScript's compiler host API instead of the language service API.\n *\n * @default false\n */\n compilerHost?: boolean;\n /**\n * Logs TypeScript errors to stderr instead of throwing exceptions.\n *\n * @default false\n */\n logError?: boolean;\n /**\n * Load \"files\" and \"include\" from `tsconfig.json` on startup.\n *\n * Default is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.\n *\n * @default false\n */\n files?: boolean;\n /**\n * Specify a custom TypeScript compiler.\n *\n * @default \"typescript\"\n */\n compiler?: string;\n /**\n * Specify a custom transpiler for use with transpileOnly\n */\n transpiler?: string | [string, object];\n /**\n * Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n *\n * Equivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n *\n * For complete instructions: https://typestrong.org/ts-node/docs/transpilers\n */\n swc?: boolean;\n /**\n * Paths which should not be compiled.\n *\n * Each string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n *\n * Source paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n *\n * Default is to ignore all node_modules subdirectories.\n *\n * @default [\"(?:^|/)node_modules/\"]\n */\n ignore?: string[];\n /**\n * Path to TypeScript config file or directory containing a `tsconfig.json`.\n * Similar to the `tsc --project` flag: https://www.typescriptlang.org/docs/handbook/compiler-options.html\n */\n project?: string;\n /**\n * Search for TypeScript config file (`tsconfig.json`) in this or parent directories.\n */\n projectSearchDir?: string;\n /**\n * Skip project config resolution and loading.\n *\n * @default false\n */\n skipProject?: boolean;\n /**\n * Skip ignore check, so that compilation will be attempted for all files with matching extensions.\n *\n * @default false\n */\n skipIgnore?: boolean;\n /**\n * JSON object to merge with TypeScript `compilerOptions`.\n *\n * @allOf [{\"$ref\": \"https://schemastore.azurewebsites.net/schemas/json/tsconfig.json#definitions/compilerOptionsDefinition/properties/compilerOptions\"}]\n */\n compilerOptions?: object;\n /**\n * Ignore TypeScript warnings by diagnostic code.\n */\n ignoreDiagnostics?: Array;\n /**\n * Modules to require, like node's `--require` flag.\n *\n * If specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n *\n * If specified programmatically, each input string should be pre-resolved to an absolute path for\n * best results.\n */\n require?: Array;\n readFile?: (path: string) => string | undefined;\n fileExists?: (path: string) => boolean;\n transformers?:\n | _ts.CustomTransformers\n | ((p: _ts.Program) => _ts.CustomTransformers);\n /**\n * Allows the usage of top level await in REPL.\n *\n * Uses node's implementation which accomplishes this with an AST syntax transformation.\n *\n * Enabled by default when tsconfig target is es2018 or above. Set to false to disable.\n *\n * **Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\n * to get default, automatic behavior.\n */\n experimentalReplAwait?: boolean;\n /**\n * Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\n * When overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\n * the file extension is ignored.\n * This is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\n * it achieves the same effect.\n *\n * Each key is a glob pattern following the same rules as tsconfig's \"include\" array.\n * When multiple patterns match the same file, the last pattern takes precedence.\n *\n * `cjs` overrides matches files to compile and execute as CommonJS.\n * `esm` overrides matches files to compile and execute as native ECMAScript modules.\n * `package` overrides either of the above to default behavior, which obeys package.json \"type\" and\n * tsconfig.json \"module\" options.\n */\n moduleTypes?: ModuleTypes;\n /**\n * @internal\n * Set by our configuration loader whenever a config file contains options that\n * are relative to the config file they came from, *and* when other logic needs\n * to know this. Some options can be eagerly resolved to absolute paths by\n * the configuration loader, so it is *not* necessary for their source to be set here.\n */\n optionBasePaths?: OptionBasePaths;\n /**\n * A function to collect trace messages from the TypeScript compiler, for example when `traceResolution` is enabled.\n *\n * @default console.log\n */\n tsTrace?: (str: string) => void;\n /**\n * Enable native ESM support.\n *\n * For details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules\n */\n esm?: boolean;\n /**\n * Re-order file extensions so that TypeScript imports are preferred.\n *\n * For example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`\n *\n * @default false\n */\n preferTsExts?: boolean;\n /**\n * Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n *\n * For details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm\n */\n experimentalSpecifierResolution?: 'node' | 'explicit';\n /**\n * Allow using voluntary `.ts` file extension in import specifiers.\n *\n * Typically, in ESM projects, import specifiers must have an emit extension, `.js`, `.cjs`, or `.mjs`,\n * and we automatically map to the corresponding `.ts`, `.cts`, or `.mts` source file. This is the\n * recommended approach.\n *\n * However, if you really want to use `.ts` in import specifiers, and are aware that this may\n * break tooling, you can enable this flag.\n */\n experimentalTsImportSpecifiers?: boolean;\n}\n\nexport type ModuleTypes = Record;\nexport type ModuleTypeOverride = 'cjs' | 'esm' | 'package';\n\n/** @internal */\nexport interface OptionBasePaths {\n moduleTypes?: string;\n transpiler?: string;\n compiler?: string;\n swc?: string;\n}\n\n/**\n * Options for registering a TypeScript compiler instance globally.\n\n * @category Basic\n */\nexport interface RegisterOptions extends CreateOptions {\n /**\n * Enable experimental features that re-map imports and require calls to support:\n * `baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n * `outDir` to `rootDir` mappings for composite projects and monorepos.\n *\n * For details, see https://github.com/TypeStrong/ts-node/issues/1514\n */\n experimentalResolver?: boolean;\n}\n\nexport type ExperimentalSpecifierResolution = 'node' | 'explicit';\n\n/**\n * Must be an interface to support `typescript-json-schema`.\n */\nexport interface TsConfigOptions\n extends Omit<\n RegisterOptions,\n | 'transformers'\n | 'readFile'\n | 'fileExists'\n | 'skipProject'\n | 'project'\n | 'dir'\n | 'cwd'\n | 'projectSearchDir'\n | 'optionBasePaths'\n | 'tsTrace'\n > {}\n\n/**\n * Information retrieved from type info check.\n */\nexport interface TypeInfo {\n name: string;\n comment: string;\n}\n\n/**\n * Default register options, including values specified via environment\n * variables.\n * @internal\n */\nexport const DEFAULTS: RegisterOptions = {\n cwd: env.TS_NODE_CWD ?? env.TS_NODE_DIR,\n emit: yn(env.TS_NODE_EMIT),\n scope: yn(env.TS_NODE_SCOPE),\n scopeDir: env.TS_NODE_SCOPE_DIR,\n files: yn(env.TS_NODE_FILES),\n pretty: yn(env.TS_NODE_PRETTY),\n compiler: env.TS_NODE_COMPILER,\n compilerOptions: parse(env.TS_NODE_COMPILER_OPTIONS),\n ignore: split(env.TS_NODE_IGNORE),\n project: env.TS_NODE_PROJECT,\n skipProject: yn(env.TS_NODE_SKIP_PROJECT),\n skipIgnore: yn(env.TS_NODE_SKIP_IGNORE),\n preferTsExts: yn(env.TS_NODE_PREFER_TS_EXTS),\n ignoreDiagnostics: split(env.TS_NODE_IGNORE_DIAGNOSTICS),\n transpileOnly: yn(env.TS_NODE_TRANSPILE_ONLY),\n typeCheck: yn(env.TS_NODE_TYPE_CHECK),\n compilerHost: yn(env.TS_NODE_COMPILER_HOST),\n logError: yn(env.TS_NODE_LOG_ERROR),\n experimentalReplAwait: yn(env.TS_NODE_EXPERIMENTAL_REPL_AWAIT) ?? undefined,\n tsTrace: console.log.bind(console),\n};\n\n/**\n * TypeScript diagnostics error.\n */\nexport class TSError extends BaseError {\n name = 'TSError';\n diagnosticText!: string;\n diagnostics!: ReadonlyArray<_ts.Diagnostic>;\n\n constructor(\n diagnosticText: string,\n public diagnosticCodes: number[],\n diagnostics: ReadonlyArray<_ts.Diagnostic> = []\n ) {\n super(`⨯ Unable to compile TypeScript:\\n${diagnosticText}`);\n Object.defineProperty(this, 'diagnosticText', {\n configurable: true,\n writable: true,\n value: diagnosticText,\n });\n Object.defineProperty(this, 'diagnostics', {\n configurable: true,\n writable: true,\n value: diagnostics,\n });\n }\n\n /**\n * @internal\n */\n [INSPECT_CUSTOM]() {\n return this.diagnosticText;\n }\n}\n\nconst TS_NODE_SERVICE_BRAND = Symbol('TS_NODE_SERVICE_BRAND');\n\n/**\n * Primary ts-node service, which wraps the TypeScript API and can compile TypeScript to JavaScript\n */\nexport interface Service {\n /** @internal */\n [TS_NODE_SERVICE_BRAND]: true;\n ts: TSCommon;\n /** @internal */\n compilerPath: string;\n config: _ts.ParsedCommandLine;\n options: RegisterOptions;\n enabled(enabled?: boolean): boolean;\n ignored(fileName: string): boolean;\n compile(code: string, fileName: string, lineOffset?: number): string;\n getTypeInfo(code: string, fileName: string, position: number): TypeInfo;\n /** @internal */\n configFilePath: string | undefined;\n /** @internal */\n moduleTypeClassifier: ModuleTypeClassifier;\n /** @internal */\n readonly shouldReplAwait: boolean;\n /** @internal */\n addDiagnosticFilter(filter: DiagnosticFilter): void;\n /** @internal */\n installSourceMapSupport(): void;\n /** @internal */\n enableExperimentalEsmLoaderInterop(): void;\n /** @internal */\n transpileOnly: boolean;\n /** @internal */\n projectLocalResolveHelper: ProjectLocalResolveHelper;\n /** @internal */\n getNodeEsmResolver: () => ReturnType<\n typeof import('../dist-raw/node-internal-modules-esm-resolve').createResolve\n >;\n /** @internal */\n getNodeEsmGetFormat: () => ReturnType<\n typeof import('../dist-raw/node-internal-modules-esm-get_format').createGetFormat\n >;\n /** @internal */\n getNodeCjsLoader: () => ReturnType<\n typeof import('../dist-raw/node-internal-modules-cjs-loader').createCjsLoader\n >;\n /** @internal */\n extensions: Extensions;\n}\n\n/**\n * Re-export of `Service` interface for backwards-compatibility\n * @deprecated use `Service` instead\n * @see {Service}\n */\nexport type Register = Service;\n\n/** @internal */\nexport interface DiagnosticFilter {\n /** if true, filter applies to all files */\n appliesToAllFiles: boolean;\n /** Filter applies onto to these filenames. Only used if appliesToAllFiles is false */\n filenamesAbsolute: string[];\n /** these diagnostic codes are ignored */\n diagnosticsIgnored: number[];\n}\n\n/**\n * Create a new TypeScript compiler instance and register it onto node.js\n *\n * @category Basic\n */\nexport function register(opts?: RegisterOptions): Service;\n/**\n * Register TypeScript compiler instance onto node.js\n\n * @category Basic\n */\nexport function register(service: Service): Service;\nexport function register(\n serviceOrOpts: Service | RegisterOptions | undefined\n): Service {\n // Is this a Service or a RegisterOptions?\n let service = serviceOrOpts as Service;\n if (!(serviceOrOpts as Service)?.[TS_NODE_SERVICE_BRAND]) {\n // Not a service; is options\n service = create((serviceOrOpts ?? {}) as RegisterOptions);\n }\n\n const originalJsHandler = require.extensions['.js'];\n\n // Expose registered instance globally.\n process[REGISTER_INSTANCE] = service;\n\n // Register the extensions.\n registerExtensions(\n service.options.preferTsExts,\n service.extensions.compiled,\n service,\n originalJsHandler\n );\n\n installCommonjsResolveHooksIfNecessary(service);\n\n // Require specified modules before start-up.\n (Module as ModuleConstructorWithInternals)._preloadModules(\n service.options.require\n );\n\n return service;\n}\n\n/**\n * Create TypeScript compiler instance.\n *\n * @category Basic\n */\nexport function create(rawOptions: CreateOptions = {}): Service {\n const foundConfigResult = findAndReadConfig(rawOptions);\n return createFromPreloadedConfig(foundConfigResult);\n}\n\n/** @internal */\nexport function createFromPreloadedConfig(\n foundConfigResult: ReturnType\n): Service {\n const {\n configFilePath,\n cwd,\n options,\n config,\n compiler,\n projectLocalResolveDir,\n optionBasePaths,\n } = foundConfigResult;\n\n const projectLocalResolveHelper = createProjectLocalResolveHelper(\n projectLocalResolveDir\n );\n\n const ts = loadCompiler(compiler);\n\n // Experimental REPL await is not compatible targets lower than ES2018\n const targetSupportsTla = config.options.target! >= ts.ScriptTarget.ES2018;\n if (options.experimentalReplAwait === true && !targetSupportsTla) {\n throw new Error(\n 'Experimental REPL await is not compatible with targets lower than ES2018'\n );\n }\n // Top-level await was added in TS 3.8\n const tsVersionSupportsTla = versionGteLt(ts.version, '3.8.0');\n if (options.experimentalReplAwait === true && !tsVersionSupportsTla) {\n throw new Error(\n 'Experimental REPL await is not compatible with TypeScript versions older than 3.8'\n );\n }\n\n const shouldReplAwait =\n options.experimentalReplAwait !== false &&\n tsVersionSupportsTla &&\n targetSupportsTla;\n\n // swc implies two other options\n // typeCheck option was implemented specifically to allow overriding tsconfig transpileOnly from the command-line\n // So we should allow using typeCheck to override swc\n if (options.swc && !options.typeCheck) {\n if (options.transpileOnly === false) {\n throw new Error(\n \"Cannot enable 'swc' option with 'transpileOnly: false'. 'swc' implies 'transpileOnly'.\"\n );\n }\n if (options.transpiler) {\n throw new Error(\n \"Cannot specify both 'swc' and 'transpiler' options. 'swc' uses the built-in swc transpiler.\"\n );\n }\n }\n\n const readFile = options.readFile || ts.sys.readFile;\n const fileExists = options.fileExists || ts.sys.fileExists;\n // typeCheck can override transpileOnly, useful for CLI flag to override config file\n const transpileOnly =\n (options.transpileOnly === true || options.swc === true) &&\n options.typeCheck !== true;\n let transpiler: RegisterOptions['transpiler'] | undefined = undefined;\n let transpilerBasePath: string | undefined = undefined;\n if (options.transpiler) {\n transpiler = options.transpiler;\n transpilerBasePath = optionBasePaths.transpiler;\n } else if (options.swc) {\n transpiler = require.resolve('./transpilers/swc.js');\n transpilerBasePath = optionBasePaths.swc;\n }\n const transformers = options.transformers || undefined;\n const diagnosticFilters: Array = [\n {\n appliesToAllFiles: true,\n filenamesAbsolute: [],\n diagnosticsIgnored: [\n 6059, // \"'rootDir' is expected to contain all source files.\"\n 18002, // \"The 'files' list in config file is empty.\"\n 18003, // \"No inputs were found in config file.\"\n ...(options.experimentalTsImportSpecifiers\n ? [\n 2691, // \"An import path cannot end with a '.ts' extension. Consider importing '' instead.\"\n ]\n : []),\n ...(options.ignoreDiagnostics || []),\n ].map(Number),\n },\n ];\n\n const configDiagnosticList = filterDiagnostics(\n config.errors,\n diagnosticFilters\n );\n const outputCache = new Map<\n string,\n {\n content: string;\n }\n >();\n\n const configFileDirname = configFilePath ? dirname(configFilePath) : null;\n const scopeDir =\n options.scopeDir ?? config.options.rootDir ?? configFileDirname ?? cwd;\n const ignoreBaseDir = configFileDirname ?? cwd;\n const isScoped = options.scope\n ? (fileName: string) => relative(scopeDir, fileName).charAt(0) !== '.'\n : () => true;\n const shouldIgnore = createIgnore(\n ignoreBaseDir,\n options.skipIgnore\n ? []\n : (options.ignore || ['(?:^|/)node_modules/']).map(\n (str) => new RegExp(str)\n )\n );\n\n const diagnosticHost: _ts.FormatDiagnosticsHost = {\n getNewLine: () => ts.sys.newLine,\n getCurrentDirectory: () => cwd,\n // TODO switch to getCanonicalFileName we already create later in scope\n getCanonicalFileName: ts.sys.useCaseSensitiveFileNames\n ? (x) => x\n : (x) => x.toLowerCase(),\n };\n\n if (options.transpileOnly && typeof transformers === 'function') {\n throw new TypeError(\n 'Transformers function is unavailable in \"--transpile-only\"'\n );\n }\n let createTranspiler = initializeTranspilerFactory();\n function initializeTranspilerFactory() {\n if (transpiler) {\n if (!transpileOnly)\n throw new Error(\n 'Custom transpiler can only be used when transpileOnly is enabled.'\n );\n const transpilerName =\n typeof transpiler === 'string' ? transpiler : transpiler[0];\n const transpilerOptions =\n typeof transpiler === 'string' ? {} : transpiler[1] ?? {};\n const transpilerConfigLocalResolveHelper = transpilerBasePath\n ? createProjectLocalResolveHelper(transpilerBasePath)\n : projectLocalResolveHelper;\n const transpilerPath = transpilerConfigLocalResolveHelper(\n transpilerName,\n true\n );\n const transpilerFactory = require(transpilerPath)\n .create as TranspilerFactory;\n return createTranspiler;\n\n function createTranspiler(\n compilerOptions: TSCommon.CompilerOptions,\n nodeModuleEmitKind?: NodeModuleEmitKind\n ) {\n return transpilerFactory?.({\n service: {\n options,\n config: {\n ...config,\n options: compilerOptions,\n },\n projectLocalResolveHelper,\n },\n transpilerConfigLocalResolveHelper,\n nodeModuleEmitKind,\n ...transpilerOptions,\n });\n }\n }\n }\n\n /**\n * True if require() hooks should interop with experimental ESM loader.\n * Enabled explicitly via a flag since it is a breaking change.\n */\n let experimentalEsmLoader = false;\n function enableExperimentalEsmLoaderInterop() {\n experimentalEsmLoader = true;\n }\n\n // Install source map support and read from memory cache.\n installSourceMapSupport();\n function installSourceMapSupport() {\n const sourceMapSupport =\n require('@cspotcode/source-map-support') as typeof _sourceMapSupport;\n sourceMapSupport.install({\n environment: 'node',\n retrieveFile(pathOrUrl: string) {\n let path = pathOrUrl;\n // If it's a file URL, convert to local path\n // Note: fileURLToPath does not exist on early node v10\n // I could not find a way to handle non-URLs except to swallow an error\n if (experimentalEsmLoader && path.startsWith('file://')) {\n try {\n path = fileURLToPath(path);\n } catch (e) {\n /* swallow error */\n }\n }\n path = normalizeSlashes(path);\n return outputCache.get(path)?.content || '';\n },\n redirectConflictingLibrary: true,\n onConflictingLibraryRedirect(\n request,\n parent,\n isMain,\n options,\n redirectedRequest\n ) {\n debug(\n `Redirected an attempt to require source-map-support to instead receive @cspotcode/source-map-support. \"${\n (parent as NodeJS.Module).filename\n }\" attempted to require or resolve \"${request}\" and was redirected to \"${redirectedRequest}\".`\n );\n },\n });\n }\n\n const shouldHavePrettyErrors =\n options.pretty === undefined ? process.stdout.isTTY : options.pretty;\n\n const formatDiagnostics = shouldHavePrettyErrors\n ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics\n : ts.formatDiagnostics;\n\n function createTSError(diagnostics: ReadonlyArray<_ts.Diagnostic>) {\n const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost);\n const diagnosticCodes = diagnostics.map((x) => x.code);\n return new TSError(diagnosticText, diagnosticCodes, diagnostics);\n }\n\n function reportTSError(configDiagnosticList: _ts.Diagnostic[]) {\n const error = createTSError(configDiagnosticList);\n if (options.logError) {\n // Print error in red color and continue execution.\n console.error('\\x1b[31m%s\\x1b[0m', error);\n } else {\n // Throw error and exit the script.\n throw error;\n }\n }\n\n // Render the configuration errors.\n if (configDiagnosticList.length) reportTSError(configDiagnosticList);\n\n const jsxEmitPreserve = config.options.jsx === ts.JsxEmit.Preserve;\n /**\n * Get the extension for a transpiled file.\n * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS]\n */\n function getEmitExtension(path: string) {\n const lastDotIndex = path.lastIndexOf('.');\n if (lastDotIndex >= 0) {\n const ext = path.slice(lastDotIndex);\n switch (ext) {\n case '.js':\n case '.ts':\n return '.js';\n case '.jsx':\n case '.tsx':\n return jsxEmitPreserve ? '.jsx' : '.js';\n case '.mjs':\n case '.mts':\n return '.mjs';\n case '.cjs':\n case '.cts':\n return '.cjs';\n }\n }\n return '.js';\n }\n\n type GetOutputFunction = (code: string, fileName: string) => SourceOutput;\n /**\n * Get output from TS compiler w/typechecking. `undefined` in `transpileOnly`\n * mode.\n */\n let getOutput: GetOutputFunction | undefined;\n let getTypeInfo: (\n _code: string,\n _fileName: string,\n _position: number\n ) => TypeInfo;\n\n const getCanonicalFileName = (\n ts as unknown as TSInternal\n ).createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames);\n\n const moduleTypeClassifier = createModuleTypeClassifier({\n basePath: options.optionBasePaths?.moduleTypes,\n patterns: options.moduleTypes,\n });\n\n const extensions = getExtensions(config, options, ts.version);\n\n // Use full language services when the fast option is disabled.\n if (!transpileOnly) {\n const fileContents = new Map();\n const rootFileNames = new Set(config.fileNames);\n const cachedReadFile = cachedLookup(debugFn('readFile', readFile));\n\n // Use language services by default\n if (!options.compilerHost) {\n let projectVersion = 1;\n const fileVersions = new Map(\n Array.from(rootFileNames).map((fileName) => [fileName, 0])\n );\n\n const getCustomTransformers = () => {\n if (typeof transformers === 'function') {\n const program = service.getProgram();\n return program ? transformers(program) : undefined;\n }\n\n return transformers;\n };\n\n // Create the compiler host for type checking.\n const serviceHost: _ts.LanguageServiceHost &\n Required> = {\n getProjectVersion: () => String(projectVersion),\n getScriptFileNames: () => Array.from(rootFileNames),\n getScriptVersion: (fileName: string) => {\n const version = fileVersions.get(fileName);\n return version ? version.toString() : '';\n },\n getScriptSnapshot(fileName: string) {\n // TODO ordering of this with getScriptVersion? Should they sync up?\n let contents = fileContents.get(fileName);\n\n // Read contents into TypeScript memory cache.\n if (contents === undefined) {\n contents = cachedReadFile(fileName);\n if (contents === undefined) return;\n\n fileVersions.set(fileName, 1);\n fileContents.set(fileName, contents);\n projectVersion++;\n }\n\n return ts.ScriptSnapshot.fromString(contents);\n },\n readFile: cachedReadFile,\n readDirectory: ts.sys.readDirectory,\n getDirectories: cachedLookup(\n debugFn('getDirectories', ts.sys.getDirectories)\n ),\n fileExists: cachedLookup(debugFn('fileExists', fileExists)),\n directoryExists: cachedLookup(\n debugFn('directoryExists', ts.sys.directoryExists)\n ),\n realpath: ts.sys.realpath\n ? cachedLookup(debugFn('realpath', ts.sys.realpath))\n : undefined,\n getNewLine: () => ts.sys.newLine,\n useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,\n getCurrentDirectory: () => cwd,\n getCompilationSettings: () => config.options,\n getDefaultLibFileName: () => ts.getDefaultLibFilePath(config.options),\n getCustomTransformers: getCustomTransformers,\n trace: options.tsTrace,\n };\n const {\n resolveModuleNames,\n getResolvedModuleWithFailedLookupLocationsFromCache,\n resolveTypeReferenceDirectives,\n isFileKnownToBeInternal,\n markBucketOfFilenameInternal,\n } = createResolverFunctions({\n host: serviceHost,\n getCanonicalFileName,\n ts,\n cwd,\n config,\n projectLocalResolveHelper,\n options,\n extensions,\n });\n serviceHost.resolveModuleNames = resolveModuleNames;\n serviceHost.getResolvedModuleWithFailedLookupLocationsFromCache =\n getResolvedModuleWithFailedLookupLocationsFromCache;\n serviceHost.resolveTypeReferenceDirectives =\n resolveTypeReferenceDirectives;\n\n const registry = ts.createDocumentRegistry(\n ts.sys.useCaseSensitiveFileNames,\n cwd\n );\n const service = ts.createLanguageService(serviceHost, registry);\n\n const updateMemoryCache = (contents: string, fileName: string) => {\n // Add to `rootFiles` as necessary, either to make TS include a file it has not seen,\n // or to trigger a re-classification of files from external to internal.\n if (\n !rootFileNames.has(fileName) &&\n !isFileKnownToBeInternal(fileName)\n ) {\n markBucketOfFilenameInternal(fileName);\n rootFileNames.add(fileName);\n // Increment project version for every change to rootFileNames.\n projectVersion++;\n }\n\n const previousVersion = fileVersions.get(fileName) || 0;\n const previousContents = fileContents.get(fileName);\n // Avoid incrementing cache when nothing has changed.\n if (contents !== previousContents) {\n fileVersions.set(fileName, previousVersion + 1);\n fileContents.set(fileName, contents);\n // Increment project version for every file change.\n projectVersion++;\n }\n };\n\n let previousProgram: _ts.Program | undefined = undefined;\n\n getOutput = (code: string, fileName: string) => {\n updateMemoryCache(code, fileName);\n\n const programBefore = service.getProgram();\n if (programBefore !== previousProgram) {\n debug(\n `compiler rebuilt Program instance when getting output for ${fileName}`\n );\n }\n\n const output = service.getEmitOutput(fileName);\n\n // Get the relevant diagnostics - this is 3x faster than `getPreEmitDiagnostics`.\n const diagnostics = service\n .getSemanticDiagnostics(fileName)\n .concat(service.getSyntacticDiagnostics(fileName));\n\n const programAfter = service.getProgram();\n\n debug(\n 'invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ',\n programBefore === programAfter\n );\n\n previousProgram = programAfter;\n\n const diagnosticList = filterDiagnostics(\n diagnostics,\n diagnosticFilters\n );\n if (diagnosticList.length) reportTSError(diagnosticList);\n\n if (output.emitSkipped) {\n return [undefined, undefined, true];\n }\n\n // Throw an error when requiring `.d.ts` files.\n if (output.outputFiles.length === 0) {\n throw new TypeError(\n `Unable to require file: ${relative(cwd, fileName)}\\n` +\n 'This is usually the result of a faulty configuration or import. ' +\n 'Make sure there is a `.js`, `.json` or other executable extension with ' +\n 'loader attached before `ts-node` available.'\n );\n }\n\n return [output.outputFiles[1].text, output.outputFiles[0].text, false];\n };\n\n getTypeInfo = (code: string, fileName: string, position: number) => {\n const normalizedFileName = normalizeSlashes(fileName);\n updateMemoryCache(code, normalizedFileName);\n\n const info = service.getQuickInfoAtPosition(\n normalizedFileName,\n position\n );\n const name = ts.displayPartsToString(info ? info.displayParts : []);\n const comment = ts.displayPartsToString(info ? info.documentation : []);\n\n return { name, comment };\n };\n } else {\n const sys: _ts.System & _ts.FormatDiagnosticsHost = {\n ...ts.sys,\n ...diagnosticHost,\n readFile: (fileName: string) => {\n const cacheContents = fileContents.get(fileName);\n if (cacheContents !== undefined) return cacheContents;\n const contents = cachedReadFile(fileName);\n if (contents) fileContents.set(fileName, contents);\n return contents;\n },\n readDirectory: ts.sys.readDirectory,\n getDirectories: cachedLookup(\n debugFn('getDirectories', ts.sys.getDirectories)\n ),\n fileExists: cachedLookup(debugFn('fileExists', fileExists)),\n directoryExists: cachedLookup(\n debugFn('directoryExists', ts.sys.directoryExists)\n ),\n resolvePath: cachedLookup(debugFn('resolvePath', ts.sys.resolvePath)),\n realpath: ts.sys.realpath\n ? cachedLookup(debugFn('realpath', ts.sys.realpath))\n : undefined,\n };\n\n const host: _ts.CompilerHost = ts.createIncrementalCompilerHost\n ? ts.createIncrementalCompilerHost(config.options, sys)\n : {\n ...sys,\n getSourceFile: (fileName, languageVersion) => {\n const contents = sys.readFile(fileName);\n if (contents === undefined) return;\n return ts.createSourceFile(fileName, contents, languageVersion);\n },\n getDefaultLibLocation: () => normalizeSlashes(dirname(compiler)),\n getDefaultLibFileName: () =>\n normalizeSlashes(\n join(\n dirname(compiler),\n ts.getDefaultLibFileName(config.options)\n )\n ),\n useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,\n };\n host.trace = options.tsTrace;\n const {\n resolveModuleNames,\n resolveTypeReferenceDirectives,\n isFileKnownToBeInternal,\n markBucketOfFilenameInternal,\n } = createResolverFunctions({\n host,\n cwd,\n config,\n ts,\n getCanonicalFileName,\n projectLocalResolveHelper,\n options,\n extensions,\n });\n host.resolveModuleNames = resolveModuleNames;\n host.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives;\n\n // Fallback for older TypeScript releases without incremental API.\n let builderProgram = ts.createIncrementalProgram\n ? ts.createIncrementalProgram({\n rootNames: Array.from(rootFileNames),\n options: config.options,\n host,\n configFileParsingDiagnostics: config.errors,\n projectReferences: config.projectReferences,\n })\n : ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n Array.from(rootFileNames),\n config.options,\n host,\n undefined,\n config.errors,\n config.projectReferences\n );\n\n // Read and cache custom transformers.\n const customTransformers =\n typeof transformers === 'function'\n ? transformers(builderProgram.getProgram())\n : transformers;\n\n // Set the file contents into cache manually.\n const updateMemoryCache = (contents: string, fileName: string) => {\n const previousContents = fileContents.get(fileName);\n const contentsChanged = previousContents !== contents;\n if (contentsChanged) {\n fileContents.set(fileName, contents);\n }\n\n // Add to `rootFiles` when discovered by compiler for the first time.\n let addedToRootFileNames = false;\n if (\n !rootFileNames.has(fileName) &&\n !isFileKnownToBeInternal(fileName)\n ) {\n markBucketOfFilenameInternal(fileName);\n rootFileNames.add(fileName);\n addedToRootFileNames = true;\n }\n\n // Update program when file changes.\n if (addedToRootFileNames || contentsChanged) {\n builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n Array.from(rootFileNames),\n config.options,\n host,\n builderProgram,\n config.errors,\n config.projectReferences\n );\n }\n };\n\n getOutput = (code: string, fileName: string) => {\n let outText = '';\n let outMap = '';\n\n updateMemoryCache(code, fileName);\n\n const sourceFile = builderProgram.getSourceFile(fileName);\n if (!sourceFile)\n throw new TypeError(`Unable to read file: ${fileName}`);\n\n const program = builderProgram.getProgram();\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);\n const diagnosticList = filterDiagnostics(\n diagnostics,\n diagnosticFilters\n );\n if (diagnosticList.length) reportTSError(diagnosticList);\n\n const result = builderProgram.emit(\n sourceFile,\n (path, file, writeByteOrderMark) => {\n if (path.endsWith('.map')) {\n outMap = file;\n } else {\n outText = file;\n }\n\n if (options.emit) sys.writeFile(path, file, writeByteOrderMark);\n },\n undefined,\n undefined,\n customTransformers\n );\n\n if (result.emitSkipped) {\n return [undefined, undefined, true];\n }\n\n // Throw an error when requiring files that cannot be compiled.\n if (outText === '') {\n if (program.isSourceFileFromExternalLibrary(sourceFile)) {\n throw new TypeError(\n `Unable to compile file from external library: ${relative(\n cwd,\n fileName\n )}`\n );\n }\n\n throw new TypeError(\n `Unable to require file: ${relative(cwd, fileName)}\\n` +\n 'This is usually the result of a faulty configuration or import. ' +\n 'Make sure there is a `.js`, `.json` or other executable extension with ' +\n 'loader attached before `ts-node` available.'\n );\n }\n\n return [outText, outMap, false];\n };\n\n getTypeInfo = (code: string, fileName: string, position: number) => {\n const normalizedFileName = normalizeSlashes(fileName);\n updateMemoryCache(code, normalizedFileName);\n\n const sourceFile = builderProgram.getSourceFile(normalizedFileName);\n if (!sourceFile)\n throw new TypeError(`Unable to read file: ${fileName}`);\n\n const node = getTokenAtPosition(ts, sourceFile, position);\n const checker = builderProgram.getProgram().getTypeChecker();\n const symbol = checker.getSymbolAtLocation(node);\n\n if (!symbol) return { name: '', comment: '' };\n\n const type = checker.getTypeOfSymbolAtLocation(symbol, node);\n const signatures = [\n ...type.getConstructSignatures(),\n ...type.getCallSignatures(),\n ];\n\n return {\n name: signatures.length\n ? signatures.map((x) => checker.signatureToString(x)).join('\\n')\n : checker.typeToString(type),\n comment: ts.displayPartsToString(\n symbol ? symbol.getDocumentationComment(checker) : []\n ),\n };\n };\n\n // Write `.tsbuildinfo` when `--build` is enabled.\n if (options.emit && config.options.incremental) {\n process.on('exit', () => {\n // Emits `.tsbuildinfo` to filesystem.\n (builderProgram.getProgram() as any).emitBuildInfo();\n });\n }\n }\n } else {\n getTypeInfo = () => {\n throw new TypeError(\n 'Type information is unavailable in \"--transpile-only\"'\n );\n };\n }\n\n function createTranspileOnlyGetOutputFunction(\n overrideModuleType?: _ts.ModuleKind,\n nodeModuleEmitKind?: NodeModuleEmitKind\n ): GetOutputFunction {\n const compilerOptions = { ...config.options };\n if (overrideModuleType !== undefined)\n compilerOptions.module = overrideModuleType;\n let customTranspiler = createTranspiler?.(\n compilerOptions,\n nodeModuleEmitKind\n );\n let tsTranspileModule = versionGteLt(ts.version, '4.7.0')\n ? createTsTranspileModule(ts, {\n compilerOptions,\n reportDiagnostics: true,\n transformers: transformers as _ts.CustomTransformers | undefined,\n })\n : undefined;\n return (code: string, fileName: string): SourceOutput => {\n let result: _ts.TranspileOutput;\n if (customTranspiler) {\n result = customTranspiler.transpile(code, {\n fileName,\n });\n } else if (tsTranspileModule) {\n result = tsTranspileModule(\n code,\n {\n fileName,\n },\n nodeModuleEmitKind === 'nodeesm' ? 'module' : 'commonjs'\n );\n } else {\n result = ts.transpileModule(code, {\n fileName,\n compilerOptions,\n reportDiagnostics: true,\n transformers: transformers as _ts.CustomTransformers | undefined,\n });\n }\n\n const diagnosticList = filterDiagnostics(\n result.diagnostics || [],\n diagnosticFilters\n );\n if (diagnosticList.length) reportTSError(diagnosticList);\n\n return [result.outputText, result.sourceMapText as string, false];\n };\n }\n\n // When true, these mean that a `moduleType` override will cause a different emit\n // than the TypeScript compiler, so we *must* overwrite the emit.\n const shouldOverwriteEmitWhenForcingCommonJS =\n config.options.module !== ts.ModuleKind.CommonJS;\n // [MUST_UPDATE_FOR_NEW_MODULEKIND]\n const shouldOverwriteEmitWhenForcingEsm = !(\n config.options.module === ts.ModuleKind.ES2015 ||\n (ts.ModuleKind.ES2020 && config.options.module === ts.ModuleKind.ES2020) ||\n (ts.ModuleKind.ES2022 && config.options.module === ts.ModuleKind.ES2022) ||\n config.options.module === ts.ModuleKind.ESNext\n );\n /**\n * node16 or nodenext\n * [MUST_UPDATE_FOR_NEW_MODULEKIND]\n */\n const isNodeModuleType =\n (ts.ModuleKind.Node16 && config.options.module === ts.ModuleKind.Node16) ||\n (ts.ModuleKind.NodeNext &&\n config.options.module === ts.ModuleKind.NodeNext);\n const getOutputForceCommonJS = createTranspileOnlyGetOutputFunction(\n ts.ModuleKind.CommonJS\n );\n const getOutputForceNodeCommonJS = createTranspileOnlyGetOutputFunction(\n ts.ModuleKind.NodeNext,\n 'nodecjs'\n );\n const getOutputForceNodeESM = createTranspileOnlyGetOutputFunction(\n ts.ModuleKind.NodeNext,\n 'nodeesm'\n );\n // [MUST_UPDATE_FOR_NEW_MODULEKIND]\n const getOutputForceESM = createTranspileOnlyGetOutputFunction(\n ts.ModuleKind.ES2022 || ts.ModuleKind.ES2020 || ts.ModuleKind.ES2015\n );\n const getOutputTranspileOnly = createTranspileOnlyGetOutputFunction();\n\n // Create a simple TypeScript compiler proxy.\n function compile(code: string, fileName: string, lineOffset = 0) {\n const normalizedFileName = normalizeSlashes(fileName);\n const classification =\n moduleTypeClassifier.classifyModuleByModuleTypeOverrides(\n normalizedFileName\n );\n let value: string | undefined = '';\n let sourceMap: string | undefined = '';\n let emitSkipped = true;\n if (getOutput) {\n // Must always call normal getOutput to throw typechecking errors\n [value, sourceMap, emitSkipped] = getOutput(code, normalizedFileName);\n }\n // If module classification contradicts the above, call the relevant transpiler\n if (\n classification.moduleType === 'cjs' &&\n (shouldOverwriteEmitWhenForcingCommonJS || emitSkipped)\n ) {\n [value, sourceMap] = getOutputForceCommonJS(code, normalizedFileName);\n } else if (\n classification.moduleType === 'esm' &&\n (shouldOverwriteEmitWhenForcingEsm || emitSkipped)\n ) {\n [value, sourceMap] = getOutputForceESM(code, normalizedFileName);\n } else if (emitSkipped) {\n // Happens when ts compiler skips emit or in transpileOnly mode\n const classification = classifyModule(fileName, isNodeModuleType);\n [value, sourceMap] =\n classification === 'nodecjs'\n ? getOutputForceNodeCommonJS(code, normalizedFileName)\n : classification === 'nodeesm'\n ? getOutputForceNodeESM(code, normalizedFileName)\n : classification === 'cjs'\n ? getOutputForceCommonJS(code, normalizedFileName)\n : classification === 'esm'\n ? getOutputForceESM(code, normalizedFileName)\n : getOutputTranspileOnly(code, normalizedFileName);\n }\n const output = updateOutput(\n value!,\n normalizedFileName,\n sourceMap!,\n getEmitExtension\n );\n outputCache.set(normalizedFileName, { content: output });\n return output;\n }\n\n let active = true;\n const enabled = (enabled?: boolean) =>\n enabled === undefined ? active : (active = !!enabled);\n const ignored = (fileName: string) => {\n if (!active) return true;\n const ext = extname(fileName);\n if (extensions.compiled.includes(ext)) {\n return !isScoped(fileName) || shouldIgnore(fileName);\n }\n return true;\n };\n\n function addDiagnosticFilter(filter: DiagnosticFilter) {\n diagnosticFilters.push({\n ...filter,\n filenamesAbsolute: filter.filenamesAbsolute.map((f) =>\n normalizeSlashes(f)\n ),\n });\n }\n\n const getNodeEsmResolver = once(() =>\n (\n require('../dist-raw/node-internal-modules-esm-resolve') as typeof _nodeInternalModulesEsmResolve\n ).createResolve({\n extensions,\n preferTsExts: options.preferTsExts,\n tsNodeExperimentalSpecifierResolution:\n options.experimentalSpecifierResolution,\n })\n );\n const getNodeEsmGetFormat = once(() =>\n (\n require('../dist-raw/node-internal-modules-esm-get_format') as typeof _nodeInternalModulesEsmGetFormat\n ).createGetFormat(\n options.experimentalSpecifierResolution,\n getNodeEsmResolver()\n )\n );\n const getNodeCjsLoader = once(() =>\n (\n require('../dist-raw/node-internal-modules-cjs-loader') as typeof _nodeInternalModulesCjsLoader\n ).createCjsLoader({\n extensions,\n preferTsExts: options.preferTsExts,\n nodeEsmResolver: getNodeEsmResolver(),\n })\n );\n\n return {\n [TS_NODE_SERVICE_BRAND]: true,\n ts,\n compilerPath: compiler,\n config,\n compile,\n getTypeInfo,\n ignored,\n enabled,\n options,\n configFilePath,\n moduleTypeClassifier,\n shouldReplAwait,\n addDiagnosticFilter,\n installSourceMapSupport,\n enableExperimentalEsmLoaderInterop,\n transpileOnly,\n projectLocalResolveHelper,\n getNodeEsmResolver,\n getNodeEsmGetFormat,\n getNodeCjsLoader,\n extensions,\n };\n}\n\n/**\n * Check if the filename should be ignored.\n */\nfunction createIgnore(ignoreBaseDir: string, ignore: RegExp[]) {\n return (fileName: string) => {\n const relname = relative(ignoreBaseDir, fileName);\n const path = normalizeSlashes(relname);\n\n return ignore.some((x) => x.test(path));\n };\n}\n\n/**\n * Register the extensions to support when importing files.\n */\nfunction registerExtensions(\n preferTsExts: boolean | null | undefined,\n extensions: string[],\n service: Service,\n originalJsHandler: (m: NodeModule, filename: string) => any\n) {\n const exts = new Set(extensions);\n // Can't add these extensions cuz would allow omitting file extension; node requires ext for .cjs and .mjs\n // Unless they're already registered by something else (nyc does this):\n // then we *must* hook them or else our transformer will not be called.\n for (const cannotAdd of ['.mts', '.cts', '.mjs', '.cjs']) {\n if (exts.has(cannotAdd) && !hasOwnProperty(require.extensions, cannotAdd)) {\n // Unrecognized file exts can be transformed via the `.js` handler.\n exts.add('.js');\n exts.delete(cannotAdd);\n }\n }\n\n // Register new extensions.\n for (const ext of exts) {\n registerExtension(ext, service, originalJsHandler);\n }\n\n if (preferTsExts) {\n const preferredExtensions = new Set([\n ...exts,\n ...Object.keys(require.extensions),\n ]);\n\n // Re-sort iteration order of Object.keys()\n for (const ext of preferredExtensions) {\n const old = Object.getOwnPropertyDescriptor(require.extensions, ext);\n delete require.extensions[ext];\n Object.defineProperty(require.extensions, ext, old!);\n }\n }\n}\n\n/**\n * Register the extension for node.\n */\nfunction registerExtension(\n ext: string,\n service: Service,\n originalHandler: (m: NodeModule, filename: string) => any\n) {\n const old = require.extensions[ext] || originalHandler;\n\n require.extensions[ext] = function (m: any, filename) {\n if (service.ignored(filename)) return old(m, filename);\n\n assertScriptCanLoadAsCJS(service, m, filename);\n\n const _compile = m._compile;\n\n m._compile = function (code: string, fileName: string) {\n debug('module._compile', fileName);\n\n const result = service.compile(code, fileName);\n return _compile.call(this, result, fileName);\n };\n\n return old(m, filename);\n };\n}\n\n/**\n * Internal source output.\n */\ntype SourceOutput = [string, string, false] | [undefined, undefined, true];\n\n/**\n * Update the output remapping the source map.\n */\nfunction updateOutput(\n outputText: string,\n fileName: string,\n sourceMap: string,\n getEmitExtension: (fileName: string) => string\n) {\n const base64Map = Buffer.from(\n updateSourceMap(sourceMap, fileName),\n 'utf8'\n ).toString('base64');\n const sourceMapContent = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${base64Map}`;\n // Expected form: `//# sourceMappingURL=foo bar.js.map` or `//# sourceMappingURL=foo%20bar.js.map` for input file \"foo bar.tsx\"\n // Percent-encoding behavior added in TS 4.1.1: https://github.com/microsoft/TypeScript/issues/40951\n const prefix = '//# sourceMappingURL=';\n const prefixLength = prefix.length;\n const baseName = /*foo.tsx*/ basename(fileName);\n const extName = /*.tsx*/ extname(fileName);\n const extension = /*.js*/ getEmitExtension(fileName);\n const sourcemapFilename =\n baseName.slice(0, -extName.length) + extension + '.map';\n const sourceMapLengthWithoutPercentEncoding =\n prefixLength + sourcemapFilename.length;\n /*\n * Only rewrite if existing directive exists at the location we expect, to support:\n * a) compilers that do not append a sourcemap directive\n * b) situations where we did the math wrong\n * Not ideal, but appending our sourcemap *after* a pre-existing sourcemap still overrides, so the end-user is happy.\n */\n if (\n outputText.substr(-sourceMapLengthWithoutPercentEncoding, prefixLength) ===\n prefix\n ) {\n return (\n outputText.slice(0, -sourceMapLengthWithoutPercentEncoding) +\n sourceMapContent\n );\n }\n // If anyone asks why we're not using URL, the URL equivalent is: `u = new URL('http://d'); u.pathname = \"/\" + sourcemapFilename; return u.pathname.slice(1);\n const sourceMapLengthWithPercentEncoding =\n prefixLength + encodeURI(sourcemapFilename).length;\n if (\n outputText.substr(-sourceMapLengthWithPercentEncoding, prefixLength) ===\n prefix\n ) {\n return (\n outputText.slice(0, -sourceMapLengthWithPercentEncoding) +\n sourceMapContent\n );\n }\n\n return `${outputText}\\n${sourceMapContent}`;\n}\n\n/**\n * Update the source map contents for improved output.\n */\nfunction updateSourceMap(sourceMapText: string, fileName: string) {\n const sourceMap = JSON.parse(sourceMapText);\n sourceMap.file = fileName;\n sourceMap.sources = [fileName];\n delete sourceMap.sourceRoot;\n return JSON.stringify(sourceMap);\n}\n\n/**\n * Filter diagnostics.\n */\nfunction filterDiagnostics(\n diagnostics: readonly _ts.Diagnostic[],\n filters: DiagnosticFilter[]\n) {\n return diagnostics.filter((d) =>\n filters.every(\n (f) =>\n (!f.appliesToAllFiles &&\n f.filenamesAbsolute.indexOf(d.file?.fileName!) === -1) ||\n f.diagnosticsIgnored.indexOf(d.code) === -1\n )\n );\n}\n\n/**\n * Get token at file position.\n *\n * Reference: https://github.com/microsoft/TypeScript/blob/fcd9334f57d85b73dd66ad2d21c02e84822f4841/src/services/utilities.ts#L705-L731\n */\nfunction getTokenAtPosition(\n ts: TSCommon,\n sourceFile: _ts.SourceFile,\n position: number\n): _ts.Node {\n let current: _ts.Node = sourceFile;\n\n outer: while (true) {\n for (const child of current.getChildren(sourceFile)) {\n const start = child.getFullStart();\n if (start > position) break;\n\n const end = child.getEnd();\n if (position <= end) {\n current = child;\n continue outer;\n }\n }\n\n return current;\n }\n}\n\n/**\n * Create an implementation of node's ESM loader hooks.\n *\n * This may be useful if you\n * want to wrap or compose the loader hooks to add additional functionality or\n * combine with another loader.\n *\n * Node changed the hooks API, so there are two possible APIs. This function\n * detects your node version and returns the appropriate API.\n *\n * @category ESM Loader\n */\nexport const createEsmHooks: typeof createEsmHooksFn = (\n tsNodeService: Service\n) => (require('./esm') as typeof import('./esm')).createEsmHooks(tsNodeService);\n\n/**\n * When using `module: nodenext` or `module: node12`, there are two possible styles of emit depending in file extension or package.json \"type\":\n *\n * - CommonJS with dynamic imports preserved (not transformed into `require()` calls)\n * - ECMAScript modules with `import foo = require()` transformed into `require = createRequire(); const foo = require()`\n */\nexport type NodeModuleEmitKind = 'nodeesm' | 'nodecjs';\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/module-type-classifier.d.ts b/node_modules/ts-node/dist/module-type-classifier.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/module-type-classifier.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/module-type-classifier.js b/node_modules/ts-node/dist/module-type-classifier.js deleted file mode 100644 index 4d2aabb..0000000 --- a/node_modules/ts-node/dist/module-type-classifier.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createModuleTypeClassifier = void 0; -const ts_internals_1 = require("./ts-internals"); -const util_1 = require("./util"); -/** - * @internal - * May receive non-normalized options -- basePath and patterns -- and will normalize them - * internally. - * However, calls to `classifyModule` must pass pre-normalized paths! - */ -function createModuleTypeClassifier(options) { - const { patterns, basePath: _basePath } = options; - const basePath = _basePath !== undefined - ? (0, util_1.normalizeSlashes)(_basePath).replace(/\/$/, '') - : undefined; - const patternTypePairs = Object.entries(patterns !== null && patterns !== void 0 ? patterns : []).map(([_pattern, type]) => { - const pattern = (0, util_1.normalizeSlashes)(_pattern); - return { pattern: parsePattern(basePath, pattern), type }; - }); - const classifications = { - package: { - moduleType: 'auto', - }, - cjs: { - moduleType: 'cjs', - }, - esm: { - moduleType: 'esm', - }, - }; - const auto = classifications.package; - // Passed path must be normalized! - function classifyModuleNonCached(path) { - const matched = matchPatterns(patternTypePairs, (_) => _.pattern, path); - if (matched) - return classifications[matched.type]; - return auto; - } - const classifyModule = (0, util_1.cachedLookup)(classifyModuleNonCached); - function classifyModuleAuto(path) { - return auto; - } - return { - classifyModuleByModuleTypeOverrides: patternTypePairs.length - ? classifyModule - : classifyModuleAuto, - }; -} -exports.createModuleTypeClassifier = createModuleTypeClassifier; -function parsePattern(basePath, patternString) { - const pattern = (0, ts_internals_1.getPatternFromSpec)(patternString, basePath); - return pattern !== undefined ? new RegExp(pattern) : /(?:)/; -} -function matchPatterns(objects, getPattern, candidate) { - for (let i = objects.length - 1; i >= 0; i--) { - const object = objects[i]; - const pattern = getPattern(object); - if (pattern === null || pattern === void 0 ? void 0 : pattern.test(candidate)) { - return object; - } - } -} -//# sourceMappingURL=module-type-classifier.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/module-type-classifier.js.map b/node_modules/ts-node/dist/module-type-classifier.js.map deleted file mode 100644 index 731dfad..0000000 --- a/node_modules/ts-node/dist/module-type-classifier.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"module-type-classifier.js","sourceRoot":"","sources":["../src/module-type-classifier.ts"],"names":[],"mappings":";;;AACA,iDAAoD;AACpD,iCAAwD;AAwBxD;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,OAAoC;IAEpC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClD,MAAM,QAAQ,GACZ,SAAS,KAAK,SAAS;QACrB,CAAC,CAAC,IAAA,uBAAgB,EAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QAChD,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC,CAAC,GAAG,CACzD,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;QACnB,MAAM,OAAO,GAAG,IAA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AK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAEnC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,SAAS,CAAC,EAAE;YAC5B,OAAO,MAAM,CAAC;SACf;KACF;AACH,CAAC","sourcesContent":["import type { ModuleTypeOverride, ModuleTypes } from '.';\nimport { getPatternFromSpec } from './ts-internals';\nimport { cachedLookup, normalizeSlashes } from './util';\n\n// Logic to support our `moduleTypes` option, which allows overriding node's default ESM / CJS\n// classification of `.js` files based on package.json `type` field.\n\n/**\n * Seperate internal type because `auto` is clearer than `package`, but changing\n * the public API is a breaking change.\n * @internal\n */\nexport type InternalModuleTypeOverride = 'cjs' | 'esm' | 'auto';\n/** @internal */\nexport interface ModuleTypeClassification {\n moduleType: InternalModuleTypeOverride;\n}\n/** @internal */\nexport interface ModuleTypeClassifierOptions {\n basePath?: string;\n patterns?: ModuleTypes;\n}\n/** @internal */\nexport type ModuleTypeClassifier = ReturnType<\n typeof createModuleTypeClassifier\n>;\n/**\n * @internal\n * May receive non-normalized options -- basePath and patterns -- and will normalize them\n * internally.\n * However, calls to `classifyModule` must pass pre-normalized paths!\n */\nexport function createModuleTypeClassifier(\n options: ModuleTypeClassifierOptions\n) {\n const { patterns, basePath: _basePath } = options;\n const basePath =\n _basePath !== undefined\n ? normalizeSlashes(_basePath).replace(/\\/$/, '')\n : undefined;\n\n const patternTypePairs = Object.entries(patterns ?? []).map(\n ([_pattern, type]) => {\n const pattern = normalizeSlashes(_pattern);\n return { pattern: parsePattern(basePath!, pattern), type };\n }\n );\n\n const classifications: Record =\n {\n package: {\n moduleType: 'auto',\n },\n cjs: {\n moduleType: 'cjs',\n },\n esm: {\n moduleType: 'esm',\n },\n };\n const auto = classifications.package;\n\n // Passed path must be normalized!\n function classifyModuleNonCached(path: string): ModuleTypeClassification {\n const matched = matchPatterns(patternTypePairs, (_) => _.pattern, path);\n if (matched) return classifications[matched.type];\n return auto;\n }\n\n const classifyModule = cachedLookup(classifyModuleNonCached);\n\n function classifyModuleAuto(path: String) {\n return auto;\n }\n\n return {\n classifyModuleByModuleTypeOverrides: patternTypePairs.length\n ? classifyModule\n : classifyModuleAuto,\n };\n}\n\nfunction parsePattern(basePath: string, patternString: string): RegExp {\n const pattern = getPatternFromSpec(patternString, basePath);\n return pattern !== undefined ? new RegExp(pattern) : /(?:)/;\n}\n\nfunction matchPatterns(\n objects: T[],\n getPattern: (t: T) => RegExp,\n candidate: string\n): T | undefined {\n for (let i = objects.length - 1; i >= 0; i--) {\n const object = objects[i];\n const pattern = getPattern(object);\n\n if (pattern?.test(candidate)) {\n return object;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/node-module-type-classifier.d.ts b/node_modules/ts-node/dist/node-module-type-classifier.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/node-module-type-classifier.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/node-module-type-classifier.js b/node_modules/ts-node/dist/node-module-type-classifier.js deleted file mode 100644 index 664cd9f..0000000 --- a/node_modules/ts-node/dist/node-module-type-classifier.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.classifyModule = void 0; -const node_internal_modules_cjs_loader_1 = require("../dist-raw/node-internal-modules-cjs-loader"); -/** - * Determine how to emit a module based on tsconfig "module" and package.json "type" - * - * Supports module=nodenext/node16 with transpileOnly, where we cannot ask the - * TS typechecker to tell us if a file is CJS or ESM. - * - * Return values indicate: - * - cjs - * - esm - * - nodecjs == node-flavored cjs where dynamic imports are *not* transformed into `require()` - * - undefined == emit according to tsconfig `module` config, whatever that is - * @internal - */ -function classifyModule(nativeFilename, isNodeModuleType) { - // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] - const lastDotIndex = nativeFilename.lastIndexOf('.'); - const ext = lastDotIndex >= 0 ? nativeFilename.slice(lastDotIndex) : ''; - switch (ext) { - case '.cjs': - case '.cts': - return isNodeModuleType ? 'nodecjs' : 'cjs'; - case '.mjs': - case '.mts': - return isNodeModuleType ? 'nodeesm' : 'esm'; - } - if (isNodeModuleType) { - const packageScope = (0, node_internal_modules_cjs_loader_1.readPackageScope)(nativeFilename); - if (packageScope && packageScope.data.type === 'module') - return 'nodeesm'; - return 'nodecjs'; - } - return undefined; -} -exports.classifyModule = classifyModule; -//# sourceMappingURL=node-module-type-classifier.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/node-module-type-classifier.js.map b/node_modules/ts-node/dist/node-module-type-classifier.js.map deleted file mode 100644 index b2f4bad..0000000 --- a/node_modules/ts-node/dist/node-module-type-classifier.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"node-module-type-classifier.js","sourceRoot":"","sources":["../src/node-module-type-classifier.ts"],"names":[],"mappings":";;;AAAA,mGAAgF;AAEhF;;;;;;;;;;;;GAYG;AACH,SAAgB,cAAc,CAC5B,cAAsB,EACtB,gBAAyB;IAEzB,wCAAwC;IACxC,MAAM,YAAY,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,QAAQ,GAAG,EAAE;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QAC9C,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;KAC/C;IACD,IAAI,gBAAgB,EAAE;QACpB,MAAM,YAAY,GAAG,IAAA,mDAAgB,EAAC,cAAc,CAAC,CAAC;QACtD,IAAI,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QAC1E,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AArBD,wCAqBC","sourcesContent":["import { readPackageScope } from '../dist-raw/node-internal-modules-cjs-loader';\n\n/**\n * Determine how to emit a module based on tsconfig \"module\" and package.json \"type\"\n *\n * Supports module=nodenext/node16 with transpileOnly, where we cannot ask the\n * TS typechecker to tell us if a file is CJS or ESM.\n *\n * Return values indicate:\n * - cjs\n * - esm\n * - nodecjs == node-flavored cjs where dynamic imports are *not* transformed into `require()`\n * - undefined == emit according to tsconfig `module` config, whatever that is\n * @internal\n */\nexport function classifyModule(\n nativeFilename: string,\n isNodeModuleType: boolean\n): 'nodecjs' | 'cjs' | 'esm' | 'nodeesm' | undefined {\n // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS]\n const lastDotIndex = nativeFilename.lastIndexOf('.');\n const ext = lastDotIndex >= 0 ? nativeFilename.slice(lastDotIndex) : '';\n switch (ext) {\n case '.cjs':\n case '.cts':\n return isNodeModuleType ? 'nodecjs' : 'cjs';\n case '.mjs':\n case '.mts':\n return isNodeModuleType ? 'nodeesm' : 'esm';\n }\n if (isNodeModuleType) {\n const packageScope = readPackageScope(nativeFilename);\n if (packageScope && packageScope.data.type === 'module') return 'nodeesm';\n return 'nodecjs';\n }\n return undefined;\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/repl.d.ts b/node_modules/ts-node/dist/repl.d.ts deleted file mode 100644 index 4cd68bb..0000000 --- a/node_modules/ts-node/dist/repl.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/// -import { Service, CreateOptions } from './index'; -export interface ReplService { - readonly state: EvalState; - /** - * Bind this REPL to a ts-node compiler service. A compiler service must be bound before `eval`-ing code or starting the REPL - */ - setService(service: Service): void; - /** - * Append code to the virtual source file, compile it to JavaScript, throw semantic errors if the typechecker is enabled, - * and execute it. - * - * Note: typically, you will want to call `start()` instead of using this method. - * - * @param code string of TypeScript. - */ - evalCode(code: string): any; - /** - * `eval` implementation compatible with node's REPL API - * - * Can be used in advanced scenarios if you want to manually create your own - * node REPL instance and delegate eval to this `ReplService`. - * - * Example: - * - * import {start} from 'repl'; - * const replService: tsNode.ReplService = ...; // assuming you have already created a ts-node ReplService - * const nodeRepl = start({eval: replService.eval}); - */ - nodeEval(code: string, context: any, _filename: string, callback: (err: Error | null, result?: any) => any): void; - evalAwarePartialHost: EvalAwarePartialHost; - /** Start a node REPL */ - start(): void; - /** - * Start a node REPL, evaling a string of TypeScript before it starts. - * @deprecated - */ - start(code: string): void; -} -/** @category REPL */ -export interface CreateReplOptions { - service?: Service; - state?: EvalState; - stdin?: NodeJS.ReadableStream; - stdout?: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream; -} -/** - * Create a ts-node REPL instance. - * - * Pay close attention to the example below. Today, the API requires a few lines - * of boilerplate to correctly bind the `ReplService` to the ts-node `Service` and - * vice-versa. - * - * Usage example: - * - * const repl = tsNode.createRepl(); - * const service = tsNode.create({...repl.evalAwarePartialHost}); - * repl.setService(service); - * repl.start(); - * - * @category REPL - */ -export declare function createRepl(options?: CreateReplOptions): ReplService; -/** - * Eval state management. Stores virtual `[eval].ts` file - */ -export declare class EvalState { - path: string; - __tsNodeEvalStateBrand: unknown; - constructor(path: string); -} -/** - * Filesystem host functions which are aware of the "virtual" `[eval].ts`, ``, or `[stdin].ts` file used to compile REPL inputs. - * Must be passed to `create()` to create a ts-node compiler service which can compile REPL inputs. - */ -export declare type EvalAwarePartialHost = Pick; -export declare function createEvalAwarePartialHost(state: EvalState, composeWith?: EvalAwarePartialHost): EvalAwarePartialHost; diff --git a/node_modules/ts-node/dist/repl.js b/node_modules/ts-node/dist/repl.js deleted file mode 100644 index 6955818..0000000 --- a/node_modules/ts-node/dist/repl.js +++ /dev/null @@ -1,561 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setupContext = exports.createEvalAwarePartialHost = exports.EvalState = exports.createRepl = exports.REPL_NAME = exports.REPL_FILENAME = exports.STDIN_NAME = exports.STDIN_FILENAME = exports.EVAL_NAME = exports.EVAL_FILENAME = void 0; -const os_1 = require("os"); -const path_1 = require("path"); -const repl_1 = require("repl"); -const vm_1 = require("vm"); -const index_1 = require("./index"); -const fs_1 = require("fs"); -const console_1 = require("console"); -const assert = require("assert"); -const module_1 = require("module"); -// Lazy-loaded. -let _processTopLevelAwait; -function getProcessTopLevelAwait() { - if (_processTopLevelAwait === undefined) { - ({ - processTopLevelAwait: _processTopLevelAwait, - } = require('../dist-raw/node-internal-repl-await')); - } - return _processTopLevelAwait; -} -let diff; -function getDiffLines() { - if (diff === undefined) { - diff = require('diff'); - } - return diff.diffLines; -} -/** @internal */ -exports.EVAL_FILENAME = `[eval].ts`; -/** @internal */ -exports.EVAL_NAME = `[eval]`; -/** @internal */ -exports.STDIN_FILENAME = `[stdin].ts`; -/** @internal */ -exports.STDIN_NAME = `[stdin]`; -/** @internal */ -exports.REPL_FILENAME = '.ts'; -/** @internal */ -exports.REPL_NAME = ''; -/** - * Create a ts-node REPL instance. - * - * Pay close attention to the example below. Today, the API requires a few lines - * of boilerplate to correctly bind the `ReplService` to the ts-node `Service` and - * vice-versa. - * - * Usage example: - * - * const repl = tsNode.createRepl(); - * const service = tsNode.create({...repl.evalAwarePartialHost}); - * repl.setService(service); - * repl.start(); - * - * @category REPL - */ -function createRepl(options = {}) { - var _a, _b, _c, _d, _e; - const { ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl = true } = options; - let service = options.service; - let nodeReplServer; - // If `useGlobal` is not true, then REPL creates a context when started. - // This stores a reference to it or to `global`, whichever is used, after REPL has started. - let context; - const state = (_a = options.state) !== null && _a !== void 0 ? _a : new EvalState((0, path_1.join)(process.cwd(), exports.REPL_FILENAME)); - const evalAwarePartialHost = createEvalAwarePartialHost(state, options.composeWithEvalAwarePartialHost); - const stdin = (_b = options.stdin) !== null && _b !== void 0 ? _b : process.stdin; - const stdout = (_c = options.stdout) !== null && _c !== void 0 ? _c : process.stdout; - const stderr = (_d = options.stderr) !== null && _d !== void 0 ? _d : process.stderr; - const _console = stdout === process.stdout && stderr === process.stderr - ? console - : new console_1.Console(stdout, stderr); - const replService = { - state: (_e = options.state) !== null && _e !== void 0 ? _e : new EvalState((0, path_1.join)(process.cwd(), exports.EVAL_FILENAME)), - setService, - evalCode, - evalCodeInternal, - nodeEval, - evalAwarePartialHost, - start, - startInternal, - stdin, - stdout, - stderr, - console: _console, - }; - return replService; - function setService(_service) { - service = _service; - if (ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl) { - service.addDiagnosticFilter({ - appliesToAllFiles: false, - filenamesAbsolute: [state.path], - diagnosticsIgnored: [ - 2393, - 6133, - 7027, - ...(service.shouldReplAwait ? topLevelAwaitDiagnosticCodes : []), - ], - }); - } - } - function evalCode(code) { - const result = appendCompileAndEvalInput({ - service: service, - state, - input: code, - context, - overrideIsCompletion: false, - }); - assert(result.containsTopLevelAwait === false); - return result.value; - } - function evalCodeInternal(options) { - const { code, enableTopLevelAwait, context } = options; - return appendCompileAndEvalInput({ - service: service, - state, - input: code, - enableTopLevelAwait, - context, - }); - } - function nodeEval(code, context, _filename, callback) { - // TODO: Figure out how to handle completion here. - if (code === '.scope') { - callback(null); - return; - } - try { - const evalResult = evalCodeInternal({ - code, - enableTopLevelAwait: true, - context, - }); - if (evalResult.containsTopLevelAwait) { - (async () => { - try { - callback(null, await evalResult.valuePromise); - } - catch (promiseError) { - handleError(promiseError); - } - })(); - } - else { - callback(null, evalResult.value); - } - } - catch (error) { - handleError(error); - } - // Log TSErrors, check if they're recoverable, log helpful hints for certain - // well-known errors, and invoke `callback()` - // TODO should evalCode API get the same error-handling benefits? - function handleError(error) { - var _a, _b; - // Don't show TLA hint if the user explicitly disabled repl top level await - const canLogTopLevelAwaitHint = service.options.experimentalReplAwait !== false && - !service.shouldReplAwait; - if (error instanceof index_1.TSError) { - // Support recoverable compilations using >= node 6. - if (repl_1.Recoverable && isRecoverable(error)) { - callback(new repl_1.Recoverable(error)); - return; - } - else { - _console.error(error); - if (canLogTopLevelAwaitHint && - error.diagnosticCodes.some((dC) => topLevelAwaitDiagnosticCodes.includes(dC))) { - _console.error(getTopLevelAwaitHint()); - } - callback(null); - } - } - else { - let _error = error; - if (canLogTopLevelAwaitHint && - _error instanceof SyntaxError && - ((_a = _error.message) === null || _a === void 0 ? void 0 : _a.includes('await is only valid'))) { - try { - // Only way I know to make our hint appear after the error - _error.message += `\n\n${getTopLevelAwaitHint()}`; - _error.stack = (_b = _error.stack) === null || _b === void 0 ? void 0 : _b.replace(/(SyntaxError:.*)/, (_, $1) => `${$1}\n\n${getTopLevelAwaitHint()}`); - } - catch { } - } - callback(_error); - } - } - function getTopLevelAwaitHint() { - return `Hint: REPL top-level await requires TypeScript version 3.8 or higher and target ES2018 or higher. You are using TypeScript ${service.ts.version} and target ${service.ts.ScriptTarget[service.config.options.target]}.`; - } - } - // Note: `code` argument is deprecated - function start(code) { - startInternal({ code }); - } - // Note: `code` argument is deprecated - function startInternal(options) { - const { code, forceToBeModule = true, ...optionsOverride } = options !== null && options !== void 0 ? options : {}; - // TODO assert that `service` is set; remove all `service!` non-null assertions - // Eval incoming code before the REPL starts. - // Note: deprecated - if (code) { - try { - evalCode(`${code}\n`); - } - catch (err) { - _console.error(err); - // Note: should not be killing the process here, but this codepath is deprecated anyway - process.exit(1); - } - } - // In case the typescript compiler hasn't compiled anything yet, - // make it run though compilation at least one time before - // the REPL starts for a snappier user experience on startup. - service === null || service === void 0 ? void 0 : service.compile('', state.path); - const repl = (0, repl_1.start)({ - prompt: '> ', - input: replService.stdin, - output: replService.stdout, - // Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30 - terminal: stdout.isTTY && - !parseInt(index_1.env.NODE_NO_READLINE, 10), - eval: nodeEval, - useGlobal: true, - ...optionsOverride, - }); - nodeReplServer = repl; - context = repl.context; - // Bookmark the point where we should reset the REPL state. - const resetEval = appendToEvalState(state, ''); - function reset() { - resetEval(); - // Hard fix for TypeScript forcing `Object.defineProperty(exports, ...)`. - runInContext('exports = module.exports', state.path, context); - if (forceToBeModule) { - state.input += 'export {};void 0;\n'; - } - // Declare node builtins. - // Skip the same builtins as `addBuiltinLibsToObject`: - // those starting with _ - // those containing / - // those that already exist as globals - // Intentionally suppress type errors in case @types/node does not declare any of them, and because - // `declare import` is technically invalid syntax. - // Avoid this when in transpileOnly, because third-party transpilers may not handle `declare import`. - if (!(service === null || service === void 0 ? void 0 : service.transpileOnly)) { - state.input += `// @ts-ignore\n${module_1.builtinModules - .filter((name) => !name.startsWith('_') && - !name.includes('/') && - !['console', 'module', 'process'].includes(name)) - .map((name) => `declare import ${name} = require('${name}')`) - .join(';')}\n`; - } - } - reset(); - repl.on('reset', reset); - repl.defineCommand('type', { - help: 'Check the type of a TypeScript identifier', - action: function (identifier) { - if (!identifier) { - repl.displayPrompt(); - return; - } - const undo = appendToEvalState(state, identifier); - const { name, comment } = service.getTypeInfo(state.input, state.path, state.input.length); - undo(); - if (name) - repl.outputStream.write(`${name}\n`); - if (comment) - repl.outputStream.write(`${comment}\n`); - repl.displayPrompt(); - }, - }); - // Set up REPL history when available natively via node.js >= 11. - if (repl.setupHistory) { - const historyPath = index_1.env.TS_NODE_HISTORY || (0, path_1.join)((0, os_1.homedir)(), '.ts_node_repl_history'); - repl.setupHistory(historyPath, (err) => { - if (!err) - return; - _console.error(err); - process.exit(1); - }); - } - return repl; - } -} -exports.createRepl = createRepl; -/** - * Eval state management. Stores virtual `[eval].ts` file - */ -class EvalState { - constructor(path) { - this.path = path; - /** @internal */ - this.input = ''; - /** @internal */ - this.output = ''; - /** @internal */ - this.version = 0; - /** @internal */ - this.lines = 0; - } -} -exports.EvalState = EvalState; -function createEvalAwarePartialHost(state, composeWith) { - function readFile(path) { - if (path === state.path) - return state.input; - if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.readFile) - return composeWith.readFile(path); - try { - return (0, fs_1.readFileSync)(path, 'utf8'); - } - catch (err) { - /* Ignore. */ - } - } - function fileExists(path) { - if (path === state.path) - return true; - if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.fileExists) - return composeWith.fileExists(path); - try { - const stats = (0, fs_1.statSync)(path); - return stats.isFile() || stats.isFIFO(); - } - catch (err) { - return false; - } - } - return { readFile, fileExists }; -} -exports.createEvalAwarePartialHost = createEvalAwarePartialHost; -const sourcemapCommentRe = /\/\/# ?sourceMappingURL=\S+[\s\r\n]*$/; -/** - * Evaluate the code snippet. - * - * Append it to virtual .ts file, compile, handle compiler errors, compute a diff of the JS, and eval any code that - * appears as "added" in the diff. - */ -function appendCompileAndEvalInput(options) { - const { service, state, wrappedErr, enableTopLevelAwait = false, context, overrideIsCompletion, } = options; - let { input } = options; - // It's confusing for `{ a: 1 }` to be interpreted as a block statement - // rather than an object literal. So, we first try to wrap it in - // parentheses, so that it will be interpreted as an expression. - // Based on https://github.com/nodejs/node/blob/c2e6822153bad023ab7ebd30a6117dcc049e475c/lib/repl.js#L413-L422 - let wrappedCmd = false; - if (!wrappedErr && /^\s*{/.test(input) && !/;\s*$/.test(input)) { - input = `(${input.trim()})\n`; - wrappedCmd = true; - } - const lines = state.lines; - const isCompletion = overrideIsCompletion !== null && overrideIsCompletion !== void 0 ? overrideIsCompletion : !/\n$/.test(input); - const undo = appendToEvalState(state, input); - let output; - // Based on https://github.com/nodejs/node/blob/92573721c7cff104ccb82b6ed3e8aa69c4b27510/lib/repl.js#L457-L461 - function adjustUseStrict(code) { - // "void 0" keeps the repl from returning "use strict" as the result - // value for statements and declarations that don't return a value. - return code.replace(/^"use strict";/, '"use strict"; void 0;'); - } - try { - output = service.compile(state.input, state.path, -lines); - } - catch (err) { - undo(); - if (wrappedCmd) { - if (err instanceof index_1.TSError && err.diagnosticCodes[0] === 2339) { - // Ensure consistent and more sane behavior between { a: 1 }['b'] and ({ a: 1 }['b']) - throw err; - } - // Unwrap and try again - return appendCompileAndEvalInput({ - ...options, - wrappedErr: err, - }); - } - if (wrappedErr) - throw wrappedErr; - throw err; - } - output = adjustUseStrict(output); - // Note: REPL does not respect sourcemaps! - // To properly do that, we'd need to prefix the code we eval -- which comes - // from `diffLines` -- with newlines so that it's at the proper line numbers. - // Then we'd need to ensure each bit of eval-ed code, if there are multiples, - // has the sourcemap appended to it. - // We might also need to integrate with our sourcemap hooks' cache; I'm not sure. - const outputWithoutSourcemapComment = output.replace(sourcemapCommentRe, ''); - const oldOutputWithoutSourcemapComment = state.output.replace(sourcemapCommentRe, ''); - // Use `diff` to check for new JavaScript to execute. - const changes = getDiffLines()(oldOutputWithoutSourcemapComment, outputWithoutSourcemapComment); - if (isCompletion) { - undo(); - } - else { - state.output = output; - // Insert a semicolon to make sure that the code doesn't interact with the next line, - // for example to prevent `2\n+ 2` from producing 4. - // This is safe since the output will not change since we can only get here with successful inputs, - // and adding a semicolon to the end of a successful input won't ever change the output. - state.input = state.input.replace(/([^\n\s])([\n\s]*)$/, (all, lastChar, whitespace) => { - if (lastChar !== ';') - return `${lastChar};${whitespace}`; - return all; - }); - } - let commands = []; - let containsTopLevelAwait = false; - // Build a list of "commands": bits of JS code in the diff that must be executed. - for (const change of changes) { - if (change.added) { - if (enableTopLevelAwait && - service.shouldReplAwait && - change.value.indexOf('await') > -1) { - const processTopLevelAwait = getProcessTopLevelAwait(); - // Newline prevents comments to mess with wrapper - const wrappedResult = processTopLevelAwait(change.value + '\n'); - if (wrappedResult !== null) { - containsTopLevelAwait = true; - commands.push({ - mustAwait: true, - execCommand: () => runInContext(wrappedResult, state.path, context), - }); - continue; - } - } - commands.push({ - execCommand: () => runInContext(change.value, state.path, context), - }); - } - } - // Execute all commands asynchronously if necessary, returning the result or a - // promise of the result. - if (containsTopLevelAwait) { - return { - containsTopLevelAwait, - valuePromise: (async () => { - let value; - for (const command of commands) { - const r = command.execCommand(); - value = command.mustAwait ? await r : r; - } - return value; - })(), - }; - } - else { - return { - containsTopLevelAwait: false, - value: commands.reduce((_, c) => c.execCommand(), undefined), - }; - } -} -/** - * Low-level execution of JS code in context - */ -function runInContext(code, filename, context) { - const script = new vm_1.Script(code, { filename }); - if (context === undefined || context === global) { - return script.runInThisContext(); - } - else { - return script.runInContext(context); - } -} -/** - * Append to the eval instance and return an undo function. - */ -function appendToEvalState(state, input) { - const undoInput = state.input; - const undoVersion = state.version; - const undoOutput = state.output; - const undoLines = state.lines; - state.input += input; - state.lines += lineCount(input); - state.version++; - return function () { - state.input = undoInput; - state.output = undoOutput; - state.version = undoVersion; - state.lines = undoLines; - }; -} -/** - * Count the number of lines. - */ -function lineCount(value) { - let count = 0; - for (const char of value) { - if (char === '\n') { - count++; - } - } - return count; -} -/** - * TS diagnostic codes which are recoverable, meaning that the user likely entered an incomplete line of code - * and should be prompted for the next. For example, starting a multi-line for() loop and not finishing it. - * null value means code is always recoverable. `Set` means code is only recoverable when occurring alongside at least one - * of the other codes. - */ -const RECOVERY_CODES = new Map([ - [1003, null], - [1005, null], - [1109, null], - [1126, null], - [ - 1136, - new Set([1005]), // happens when typing out an object literal or block scope across multiple lines: '{ foo: 123,' - ], - [1160, null], - [1161, null], - [2355, null], - [2391, null], - [ - 7010, - new Set([1005]), // happens when fn signature spread across multiple lines: 'function a(\nb: any\n) {' - ], -]); -/** - * Diagnostic codes raised when using top-level await. - * These are suppressed when top-level await is enabled. - * When it is *not* enabled, these trigger a helpful hint about enabling top-level await. - */ -const topLevelAwaitDiagnosticCodes = [ - 1375, - 1378, - 1431, - 1432, // Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher. -]; -/** - * Check if a function can recover gracefully. - */ -function isRecoverable(error) { - return error.diagnosticCodes.every((code) => { - const deps = RECOVERY_CODES.get(code); - return (deps === null || - (deps && error.diagnosticCodes.some((code) => deps.has(code)))); - }); -} -/** - * @internal - * Set properties on `context` before eval-ing [stdin] or [eval] input. - */ -function setupContext(context, module, filenameAndDirname) { - if (filenameAndDirname) { - context.__dirname = '.'; - context.__filename = `[${filenameAndDirname}]`; - } - context.module = module; - context.exports = module.exports; - context.require = module.require.bind(module); -} -exports.setupContext = setupContext; -//# sourceMappingURL=repl.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/repl.js.map b/node_modules/ts-node/dist/repl.js.map deleted file mode 100644 index c375c84..0000000 --- a/node_modules/ts-node/dist/repl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"repl.js","sourceRoot":"","sources":["../src/repl.ts"],"names":[],"mappings":";;;AACA,2BAA6B;AAC7B,+BAA4B;AAC5B,+BAKc;AACd,2BAAoD;AACpD,mCAA+D;AAC/D,2BAA4C;AAC5C,qCAAkC;AAClC,iCAAiC;AAGjC,mCAAwC;AAExC,eAAe;AACf,IAAI,qBAAqD,CAAC;AAC1D,SAAS,uBAAuB;IAC9B,IAAI,qBAAqB,KAAK,SAAS,EAAE;QACvC,CAAC;YACC,oBAAoB,EAAE,qBAAqB;SAC5C,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAC,CAAC;KACtD;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AACD,IAAI,IAAkB,CAAC;AACvB,SAAS,YAAY;IACnB,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;KACxB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC;AACxB,CAAC;AAED,gBAAgB;AACH,QAAA,aAAa,GAAG,WAAW,CAAC;AACzC,gBAAgB;AACH,QAAA,SAAS,GAAG,QAAQ,CAAC;AAClC,gBAAgB;AACH,QAAA,cAAc,GAAG,YAAY,CAAC;AAC3C,gBAAgB;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OAAO,CACL,IAAI,KAAK,IAAI;YACb,CAAC,IAAI,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAC/D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAC1B,OAAY,EACZ,MAAc,EACd,kBAA2C;IAE3C,IAAI,kBAAkB,EAAE;QACtB,OAAO,CAAC,SAAS,GAAG,GAAG,CAAC;QACxB,OAAO,CAAC,UAAU,GAAG,IAAI,kBAAkB,GAAG,CAAC;KAChD;IACD,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACjC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAZD,oCAYC","sourcesContent":["import type * as _diff from 'diff';\nimport { homedir } from 'os';\nimport { join } from 'path';\nimport {\n Recoverable,\n ReplOptions,\n REPLServer,\n start as nodeReplStart,\n} from 'repl';\nimport { Context, createContext, Script } from 'vm';\nimport { Service, CreateOptions, TSError, env } from './index';\nimport { readFileSync, statSync } from 'fs';\nimport { Console } from 'console';\nimport * as assert from 'assert';\nimport type * as tty from 'tty';\nimport type * as Module from 'module';\nimport { builtinModules } from 'module';\n\n// Lazy-loaded.\nlet _processTopLevelAwait: (src: string) => string | null;\nfunction getProcessTopLevelAwait() {\n if (_processTopLevelAwait === undefined) {\n ({\n processTopLevelAwait: _processTopLevelAwait,\n } = require('../dist-raw/node-internal-repl-await'));\n }\n return _processTopLevelAwait;\n}\nlet diff: typeof _diff;\nfunction getDiffLines() {\n if (diff === undefined) {\n diff = require('diff');\n }\n return diff.diffLines;\n}\n\n/** @internal */\nexport const EVAL_FILENAME = `[eval].ts`;\n/** @internal */\nexport const EVAL_NAME = `[eval]`;\n/** @internal */\nexport const STDIN_FILENAME = `[stdin].ts`;\n/** @internal */\nexport const STDIN_NAME = `[stdin]`;\n/** @internal */\nexport const REPL_FILENAME = '.ts';\n/** @internal */\nexport const REPL_NAME = '';\n\nexport interface ReplService {\n readonly state: EvalState;\n /**\n * Bind this REPL to a ts-node compiler service. A compiler service must be bound before `eval`-ing code or starting the REPL\n */\n setService(service: Service): void;\n /**\n * Append code to the virtual source file, compile it to JavaScript, throw semantic errors if the typechecker is enabled,\n * and execute it.\n *\n * Note: typically, you will want to call `start()` instead of using this method.\n *\n * @param code string of TypeScript.\n */\n evalCode(code: string): any;\n /** @internal */\n evalCodeInternal(opts: {\n code: string;\n enableTopLevelAwait?: boolean;\n context?: Context;\n }):\n | {\n containsTopLevelAwait: true;\n valuePromise: Promise;\n }\n | {\n containsTopLevelAwait: false;\n value: any;\n };\n /**\n * `eval` implementation compatible with node's REPL API\n *\n * Can be used in advanced scenarios if you want to manually create your own\n * node REPL instance and delegate eval to this `ReplService`.\n *\n * Example:\n *\n * import {start} from 'repl';\n * const replService: tsNode.ReplService = ...; // assuming you have already created a ts-node ReplService\n * const nodeRepl = start({eval: replService.eval});\n */\n nodeEval(\n code: string,\n // TODO change to `Context` in a future release? Technically a breaking change\n context: any,\n _filename: string,\n callback: (err: Error | null, result?: any) => any\n ): void;\n evalAwarePartialHost: EvalAwarePartialHost;\n /** Start a node REPL */\n start(): void;\n /**\n * Start a node REPL, evaling a string of TypeScript before it starts.\n * @deprecated\n */\n start(code: string): void;\n /** @internal */\n startInternal(opts?: ReplOptions): REPLServer;\n /** @internal */\n readonly stdin: NodeJS.ReadableStream;\n /** @internal */\n readonly stdout: NodeJS.WritableStream;\n /** @internal */\n readonly stderr: NodeJS.WritableStream;\n /** @internal */\n readonly console: Console;\n}\n\n/** @category REPL */\nexport interface CreateReplOptions {\n service?: Service;\n state?: EvalState;\n stdin?: NodeJS.ReadableStream;\n stdout?: NodeJS.WritableStream;\n stderr?: NodeJS.WritableStream;\n /** @internal */\n composeWithEvalAwarePartialHost?: EvalAwarePartialHost;\n /**\n * @internal\n * Ignore diagnostics that are annoying when interactively entering input line-by-line.\n */\n ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl?: boolean;\n}\n\n/**\n * Create a ts-node REPL instance.\n *\n * Pay close attention to the example below. Today, the API requires a few lines\n * of boilerplate to correctly bind the `ReplService` to the ts-node `Service` and\n * vice-versa.\n *\n * Usage example:\n *\n * const repl = tsNode.createRepl();\n * const service = tsNode.create({...repl.evalAwarePartialHost});\n * repl.setService(service);\n * repl.start();\n *\n * @category REPL\n */\nexport function createRepl(options: CreateReplOptions = {}) {\n const { ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl = true } = options;\n let service = options.service;\n let nodeReplServer: REPLServer;\n // If `useGlobal` is not true, then REPL creates a context when started.\n // This stores a reference to it or to `global`, whichever is used, after REPL has started.\n let context: Context | undefined;\n const state =\n options.state ?? new EvalState(join(process.cwd(), REPL_FILENAME));\n const evalAwarePartialHost = createEvalAwarePartialHost(\n state,\n options.composeWithEvalAwarePartialHost\n );\n const stdin = options.stdin ?? process.stdin;\n const stdout = options.stdout ?? process.stdout;\n const stderr = options.stderr ?? process.stderr;\n const _console =\n stdout === process.stdout && stderr === process.stderr\n ? console\n : new Console(stdout, stderr);\n\n const replService: ReplService = {\n state: options.state ?? new EvalState(join(process.cwd(), EVAL_FILENAME)),\n setService,\n evalCode,\n evalCodeInternal,\n nodeEval,\n evalAwarePartialHost,\n start,\n startInternal,\n stdin,\n stdout,\n stderr,\n console: _console,\n };\n\n return replService;\n\n function setService(_service: Service) {\n service = _service;\n if (ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl) {\n service.addDiagnosticFilter({\n appliesToAllFiles: false,\n filenamesAbsolute: [state.path],\n diagnosticsIgnored: [\n 2393, // Duplicate function implementation: https://github.com/TypeStrong/ts-node/issues/729\n 6133, // is declared but its value is never read. https://github.com/TypeStrong/ts-node/issues/850\n 7027, // Unreachable code detected. https://github.com/TypeStrong/ts-node/issues/469\n ...(service.shouldReplAwait ? topLevelAwaitDiagnosticCodes : []),\n ],\n });\n }\n }\n\n function evalCode(code: string) {\n const result = appendCompileAndEvalInput({\n service: service!,\n state,\n input: code,\n context,\n overrideIsCompletion: false,\n });\n assert(result.containsTopLevelAwait === false);\n return result.value;\n }\n\n function evalCodeInternal(options: {\n code: string;\n enableTopLevelAwait?: boolean;\n context: Context;\n }) {\n const { code, enableTopLevelAwait, context } = options;\n return appendCompileAndEvalInput({\n service: service!,\n state,\n input: code,\n enableTopLevelAwait,\n context,\n });\n }\n\n function nodeEval(\n code: string,\n context: any,\n _filename: string,\n callback: (err: Error | null, result?: any) => any\n ) {\n // TODO: Figure out how to handle completion here.\n if (code === '.scope') {\n callback(null);\n return;\n }\n\n try {\n const evalResult = evalCodeInternal({\n code,\n enableTopLevelAwait: true,\n context,\n });\n\n if (evalResult.containsTopLevelAwait) {\n (async () => {\n try {\n callback(null, await evalResult.valuePromise);\n } catch (promiseError) {\n handleError(promiseError);\n }\n })();\n } else {\n callback(null, evalResult.value);\n }\n } catch (error) {\n handleError(error);\n }\n\n // Log TSErrors, check if they're recoverable, log helpful hints for certain\n // well-known errors, and invoke `callback()`\n // TODO should evalCode API get the same error-handling benefits?\n function handleError(error: unknown) {\n // Don't show TLA hint if the user explicitly disabled repl top level await\n const canLogTopLevelAwaitHint =\n service!.options.experimentalReplAwait !== false &&\n !service!.shouldReplAwait;\n if (error instanceof TSError) {\n // Support recoverable compilations using >= node 6.\n if (Recoverable && isRecoverable(error)) {\n callback(new Recoverable(error));\n return;\n } else {\n _console.error(error);\n\n if (\n canLogTopLevelAwaitHint &&\n error.diagnosticCodes.some((dC) =>\n topLevelAwaitDiagnosticCodes.includes(dC)\n )\n ) {\n _console.error(getTopLevelAwaitHint());\n }\n callback(null);\n }\n } else {\n let _error = error as Error | undefined;\n if (\n canLogTopLevelAwaitHint &&\n _error instanceof SyntaxError &&\n _error.message?.includes('await is only valid')\n ) {\n try {\n // Only way I know to make our hint appear after the error\n _error.message += `\\n\\n${getTopLevelAwaitHint()}`;\n _error.stack = _error.stack?.replace(\n /(SyntaxError:.*)/,\n (_, $1) => `${$1}\\n\\n${getTopLevelAwaitHint()}`\n );\n } catch {}\n }\n callback(_error as Error);\n }\n }\n function getTopLevelAwaitHint() {\n return `Hint: REPL top-level await requires TypeScript version 3.8 or higher and target ES2018 or higher. You are using TypeScript ${\n service!.ts.version\n } and target ${\n service!.ts.ScriptTarget[service!.config.options.target!]\n }.`;\n }\n }\n\n // Note: `code` argument is deprecated\n function start(code?: string) {\n startInternal({ code });\n }\n\n // Note: `code` argument is deprecated\n function startInternal(\n options?: ReplOptions & { code?: string; forceToBeModule?: boolean }\n ) {\n const { code, forceToBeModule = true, ...optionsOverride } = options ?? {};\n // TODO assert that `service` is set; remove all `service!` non-null assertions\n\n // Eval incoming code before the REPL starts.\n // Note: deprecated\n if (code) {\n try {\n evalCode(`${code}\\n`);\n } catch (err) {\n _console.error(err);\n // Note: should not be killing the process here, but this codepath is deprecated anyway\n process.exit(1);\n }\n }\n\n // In case the typescript compiler hasn't compiled anything yet,\n // make it run though compilation at least one time before\n // the REPL starts for a snappier user experience on startup.\n service?.compile('', state.path);\n\n const repl = nodeReplStart({\n prompt: '> ',\n input: replService.stdin,\n output: replService.stdout,\n // Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30\n terminal:\n (stdout as tty.WriteStream).isTTY &&\n !parseInt(env.NODE_NO_READLINE!, 10),\n eval: nodeEval,\n useGlobal: true,\n ...optionsOverride,\n });\n\n nodeReplServer = repl;\n context = repl.context;\n\n // Bookmark the point where we should reset the REPL state.\n const resetEval = appendToEvalState(state, '');\n\n function reset() {\n resetEval();\n\n // Hard fix for TypeScript forcing `Object.defineProperty(exports, ...)`.\n runInContext('exports = module.exports', state.path, context);\n if (forceToBeModule) {\n state.input += 'export {};void 0;\\n';\n }\n\n // Declare node builtins.\n // Skip the same builtins as `addBuiltinLibsToObject`:\n // those starting with _\n // those containing /\n // those that already exist as globals\n // Intentionally suppress type errors in case @types/node does not declare any of them, and because\n // `declare import` is technically invalid syntax.\n // Avoid this when in transpileOnly, because third-party transpilers may not handle `declare import`.\n if (!service?.transpileOnly) {\n state.input += `// @ts-ignore\\n${builtinModules\n .filter(\n (name) =>\n !name.startsWith('_') &&\n !name.includes('/') &&\n !['console', 'module', 'process'].includes(name)\n )\n .map((name) => `declare import ${name} = require('${name}')`)\n .join(';')}\\n`;\n }\n }\n\n reset();\n repl.on('reset', reset);\n\n repl.defineCommand('type', {\n help: 'Check the type of a TypeScript identifier',\n action: function (identifier: string) {\n if (!identifier) {\n repl.displayPrompt();\n return;\n }\n\n const undo = appendToEvalState(state, identifier);\n const { name, comment } = service!.getTypeInfo(\n state.input,\n state.path,\n state.input.length\n );\n\n undo();\n\n if (name) repl.outputStream.write(`${name}\\n`);\n if (comment) repl.outputStream.write(`${comment}\\n`);\n repl.displayPrompt();\n },\n });\n\n // Set up REPL history when available natively via node.js >= 11.\n if (repl.setupHistory) {\n const historyPath =\n env.TS_NODE_HISTORY || join(homedir(), '.ts_node_repl_history');\n\n repl.setupHistory(historyPath, (err) => {\n if (!err) return;\n\n _console.error(err);\n process.exit(1);\n });\n }\n\n return repl;\n }\n}\n\n/**\n * Eval state management. Stores virtual `[eval].ts` file\n */\nexport class EvalState {\n /** @internal */\n input = '';\n /** @internal */\n output = '';\n /** @internal */\n version = 0;\n /** @internal */\n lines = 0;\n\n __tsNodeEvalStateBrand: unknown;\n\n constructor(public path: string) {}\n}\n\n/**\n * Filesystem host functions which are aware of the \"virtual\" `[eval].ts`, ``, or `[stdin].ts` file used to compile REPL inputs.\n * Must be passed to `create()` to create a ts-node compiler service which can compile REPL inputs.\n */\nexport type EvalAwarePartialHost = Pick<\n CreateOptions,\n 'readFile' | 'fileExists'\n>;\n\nexport function createEvalAwarePartialHost(\n state: EvalState,\n composeWith?: EvalAwarePartialHost\n): EvalAwarePartialHost {\n function readFile(path: string) {\n if (path === state.path) return state.input;\n\n if (composeWith?.readFile) return composeWith.readFile(path);\n\n try {\n return readFileSync(path, 'utf8');\n } catch (err) {\n /* Ignore. */\n }\n }\n function fileExists(path: string) {\n if (path === state.path) return true;\n\n if (composeWith?.fileExists) return composeWith.fileExists(path);\n\n try {\n const stats = statSync(path);\n return stats.isFile() || stats.isFIFO();\n } catch (err) {\n return false;\n }\n }\n return { readFile, fileExists };\n}\n\nconst sourcemapCommentRe = /\\/\\/# ?sourceMappingURL=\\S+[\\s\\r\\n]*$/;\n\ntype AppendCompileAndEvalInputResult =\n | { containsTopLevelAwait: true; valuePromise: Promise }\n | { containsTopLevelAwait: false; value: any };\n/**\n * Evaluate the code snippet.\n *\n * Append it to virtual .ts file, compile, handle compiler errors, compute a diff of the JS, and eval any code that\n * appears as \"added\" in the diff.\n */\nfunction appendCompileAndEvalInput(options: {\n service: Service;\n state: EvalState;\n input: string;\n wrappedErr?: unknown;\n /** Enable top-level await but only if the TSNode service allows it. */\n enableTopLevelAwait?: boolean;\n context: Context | undefined;\n /**\n * Added so that `evalCode` can be guaranteed *not* to trigger the `isCompletion`\n * codepath. However, the `isCompletion` logic is ancient and maybe should be removed entirely.\n * Nobody's looked at it in a long time.\n */\n overrideIsCompletion?: boolean;\n}): AppendCompileAndEvalInputResult {\n const {\n service,\n state,\n wrappedErr,\n enableTopLevelAwait = false,\n context,\n overrideIsCompletion,\n } = options;\n let { input } = options;\n\n // It's confusing for `{ a: 1 }` to be interpreted as a block statement\n // rather than an object literal. So, we first try to wrap it in\n // parentheses, so that it will be interpreted as an expression.\n // Based on https://github.com/nodejs/node/blob/c2e6822153bad023ab7ebd30a6117dcc049e475c/lib/repl.js#L413-L422\n let wrappedCmd = false;\n if (!wrappedErr && /^\\s*{/.test(input) && !/;\\s*$/.test(input)) {\n input = `(${input.trim()})\\n`;\n wrappedCmd = true;\n }\n\n const lines = state.lines;\n const isCompletion = overrideIsCompletion ?? !/\\n$/.test(input);\n const undo = appendToEvalState(state, input);\n let output: string;\n\n // Based on https://github.com/nodejs/node/blob/92573721c7cff104ccb82b6ed3e8aa69c4b27510/lib/repl.js#L457-L461\n function adjustUseStrict(code: string) {\n // \"void 0\" keeps the repl from returning \"use strict\" as the result\n // value for statements and declarations that don't return a value.\n return code.replace(/^\"use strict\";/, '\"use strict\"; void 0;');\n }\n\n try {\n output = service.compile(state.input, state.path, -lines);\n } catch (err) {\n undo();\n\n if (wrappedCmd) {\n if (err instanceof TSError && err.diagnosticCodes[0] === 2339) {\n // Ensure consistent and more sane behavior between { a: 1 }['b'] and ({ a: 1 }['b'])\n throw err;\n }\n // Unwrap and try again\n return appendCompileAndEvalInput({\n ...options,\n wrappedErr: err,\n });\n }\n\n if (wrappedErr) throw wrappedErr;\n throw err;\n }\n\n output = adjustUseStrict(output);\n\n // Note: REPL does not respect sourcemaps!\n // To properly do that, we'd need to prefix the code we eval -- which comes\n // from `diffLines` -- with newlines so that it's at the proper line numbers.\n // Then we'd need to ensure each bit of eval-ed code, if there are multiples,\n // has the sourcemap appended to it.\n // We might also need to integrate with our sourcemap hooks' cache; I'm not sure.\n const outputWithoutSourcemapComment = output.replace(sourcemapCommentRe, '');\n const oldOutputWithoutSourcemapComment = state.output.replace(\n sourcemapCommentRe,\n ''\n );\n\n // Use `diff` to check for new JavaScript to execute.\n const changes = getDiffLines()(\n oldOutputWithoutSourcemapComment,\n outputWithoutSourcemapComment\n );\n\n if (isCompletion) {\n undo();\n } else {\n state.output = output;\n\n // Insert a semicolon to make sure that the code doesn't interact with the next line,\n // for example to prevent `2\\n+ 2` from producing 4.\n // This is safe since the output will not change since we can only get here with successful inputs,\n // and adding a semicolon to the end of a successful input won't ever change the output.\n state.input = state.input.replace(\n /([^\\n\\s])([\\n\\s]*)$/,\n (all, lastChar, whitespace) => {\n if (lastChar !== ';') return `${lastChar};${whitespace}`;\n return all;\n }\n );\n }\n\n let commands: Array<{ mustAwait?: true; execCommand: () => any }> = [];\n let containsTopLevelAwait = false;\n\n // Build a list of \"commands\": bits of JS code in the diff that must be executed.\n for (const change of changes) {\n if (change.added) {\n if (\n enableTopLevelAwait &&\n service.shouldReplAwait &&\n change.value.indexOf('await') > -1\n ) {\n const processTopLevelAwait = getProcessTopLevelAwait();\n\n // Newline prevents comments to mess with wrapper\n const wrappedResult = processTopLevelAwait(change.value + '\\n');\n if (wrappedResult !== null) {\n containsTopLevelAwait = true;\n commands.push({\n mustAwait: true,\n execCommand: () => runInContext(wrappedResult, state.path, context),\n });\n continue;\n }\n }\n commands.push({\n execCommand: () => runInContext(change.value, state.path, context),\n });\n }\n }\n\n // Execute all commands asynchronously if necessary, returning the result or a\n // promise of the result.\n if (containsTopLevelAwait) {\n return {\n containsTopLevelAwait,\n valuePromise: (async () => {\n let value;\n for (const command of commands) {\n const r = command.execCommand();\n value = command.mustAwait ? await r : r;\n }\n return value;\n })(),\n };\n } else {\n return {\n containsTopLevelAwait: false,\n value: commands.reduce((_, c) => c.execCommand(), undefined),\n };\n }\n}\n\n/**\n * Low-level execution of JS code in context\n */\nfunction runInContext(code: string, filename: string, context?: Context) {\n const script = new Script(code, { filename });\n\n if (context === undefined || context === global) {\n return script.runInThisContext();\n } else {\n return script.runInContext(context);\n }\n}\n\n/**\n * Append to the eval instance and return an undo function.\n */\nfunction appendToEvalState(state: EvalState, input: string) {\n const undoInput = state.input;\n const undoVersion = state.version;\n const undoOutput = state.output;\n const undoLines = state.lines;\n\n state.input += input;\n state.lines += lineCount(input);\n state.version++;\n\n return function () {\n state.input = undoInput;\n state.output = undoOutput;\n state.version = undoVersion;\n state.lines = undoLines;\n };\n}\n\n/**\n * Count the number of lines.\n */\nfunction lineCount(value: string) {\n let count = 0;\n\n for (const char of value) {\n if (char === '\\n') {\n count++;\n }\n }\n\n return count;\n}\n\n/**\n * TS diagnostic codes which are recoverable, meaning that the user likely entered an incomplete line of code\n * and should be prompted for the next. For example, starting a multi-line for() loop and not finishing it.\n * null value means code is always recoverable. `Set` means code is only recoverable when occurring alongside at least one\n * of the other codes.\n */\nconst RECOVERY_CODES: Map | null> = new Map([\n [1003, null], // \"Identifier expected.\"\n [1005, null], // \"')' expected.\", \"'}' expected.\"\n [1109, null], // \"Expression expected.\"\n [1126, null], // \"Unexpected end of text.\"\n [\n 1136, // \"Property assignment expected.\"\n new Set([1005]), // happens when typing out an object literal or block scope across multiple lines: '{ foo: 123,'\n ],\n [1160, null], // \"Unterminated template literal.\"\n [1161, null], // \"Unterminated regular expression literal.\"\n [2355, null], // \"A function whose declared type is neither 'void' nor 'any' must return a value.\"\n [2391, null], // \"Function implementation is missing or not immediately following the declaration.\"\n [\n 7010, // \"Function, which lacks return-type annotation, implicitly has an 'any' return type.\"\n new Set([1005]), // happens when fn signature spread across multiple lines: 'function a(\\nb: any\\n) {'\n ],\n]);\n\n/**\n * Diagnostic codes raised when using top-level await.\n * These are suppressed when top-level await is enabled.\n * When it is *not* enabled, these trigger a helpful hint about enabling top-level await.\n */\nconst topLevelAwaitDiagnosticCodes = [\n 1375, // 'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.\n 1378, // Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher.\n 1431, // 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.\n 1432, // Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher.\n];\n\n/**\n * Check if a function can recover gracefully.\n */\nfunction isRecoverable(error: TSError) {\n return error.diagnosticCodes.every((code) => {\n const deps = RECOVERY_CODES.get(code);\n return (\n deps === null ||\n (deps && error.diagnosticCodes.some((code) => deps.has(code)))\n );\n });\n}\n\n/**\n * @internal\n * Set properties on `context` before eval-ing [stdin] or [eval] input.\n */\nexport function setupContext(\n context: any,\n module: Module,\n filenameAndDirname: 'eval' | 'stdin' | null\n) {\n if (filenameAndDirname) {\n context.__dirname = '.';\n context.__filename = `[${filenameAndDirname}]`;\n }\n context.module = module;\n context.exports = module.exports;\n context.require = module.require.bind(module);\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/resolver-functions.d.ts b/node_modules/ts-node/dist/resolver-functions.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/resolver-functions.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/resolver-functions.js b/node_modules/ts-node/dist/resolver-functions.js deleted file mode 100644 index 16ed046..0000000 --- a/node_modules/ts-node/dist/resolver-functions.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createResolverFunctions = void 0; -const path_1 = require("path"); -/** - * @internal - * In a factory because these are shared across both CompilerHost and LanguageService codepaths - */ -function createResolverFunctions(kwargs) { - const { host, ts, config, cwd, getCanonicalFileName, projectLocalResolveHelper, options, extensions, } = kwargs; - const moduleResolutionCache = ts.createModuleResolutionCache(cwd, getCanonicalFileName, config.options); - const knownInternalFilenames = new Set(); - /** "Buckets" (module directories) whose contents should be marked "internal" */ - const internalBuckets = new Set(); - // Get bucket for a source filename. Bucket is the containing `./node_modules/*/` directory - // For '/project/node_modules/foo/node_modules/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/bar/' - // For '/project/node_modules/foo/node_modules/@scope/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/@scope/bar/' - const moduleBucketRe = /.*\/node_modules\/(?:@[^\/]+\/)?[^\/]+\//; - function getModuleBucket(filename) { - const find = moduleBucketRe.exec(filename); - if (find) - return find[0]; - return ''; - } - // Mark that this file and all siblings in its bucket should be "internal" - function markBucketOfFilenameInternal(filename) { - internalBuckets.add(getModuleBucket(filename)); - } - function isFileInInternalBucket(filename) { - return internalBuckets.has(getModuleBucket(filename)); - } - function isFileKnownToBeInternal(filename) { - return knownInternalFilenames.has(filename); - } - /** - * If we need to emit JS for a file, force TS to consider it non-external - */ - const fixupResolvedModule = (resolvedModule) => { - const { resolvedFileName } = resolvedModule; - if (resolvedFileName === undefined) - return; - // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] - // .ts,.mts,.cts is always switched to internal - // .js is switched on-demand - if (resolvedModule.isExternalLibraryImport && - ((resolvedFileName.endsWith('.ts') && - !resolvedFileName.endsWith('.d.ts')) || - (resolvedFileName.endsWith('.cts') && - !resolvedFileName.endsWith('.d.cts')) || - (resolvedFileName.endsWith('.mts') && - !resolvedFileName.endsWith('.d.mts')) || - isFileKnownToBeInternal(resolvedFileName) || - isFileInInternalBucket(resolvedFileName))) { - resolvedModule.isExternalLibraryImport = false; - } - if (!resolvedModule.isExternalLibraryImport) { - knownInternalFilenames.add(resolvedFileName); - } - }; - /* - * NOTE: - * Older ts versions do not pass `redirectedReference` nor `options`. - * We must pass `redirectedReference` to newer ts versions, but cannot rely on `options`, hence the weird argument name - */ - const resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, optionsOnlyWithNewerTsVersions, containingSourceFile) => { - return moduleNames.map((moduleName, i) => { - var _a, _b; - const mode = containingSourceFile - ? (_b = (_a = ts).getModeForResolutionAtIndex) === null || _b === void 0 ? void 0 : _b.call(_a, containingSourceFile, i) - : undefined; - let { resolvedModule } = ts.resolveModuleName(moduleName, containingFile, config.options, host, moduleResolutionCache, redirectedReference, mode); - if (!resolvedModule && options.experimentalTsImportSpecifiers) { - const lastDotIndex = moduleName.lastIndexOf('.'); - const ext = lastDotIndex >= 0 ? moduleName.slice(lastDotIndex) : ''; - if (ext) { - const replacements = extensions.tsResolverEquivalents.get(ext); - for (const replacementExt of replacements !== null && replacements !== void 0 ? replacements : []) { - ({ resolvedModule } = ts.resolveModuleName(moduleName.slice(0, -ext.length) + replacementExt, containingFile, config.options, host, moduleResolutionCache, redirectedReference, mode)); - if (resolvedModule) - break; - } - } - } - if (resolvedModule) { - fixupResolvedModule(resolvedModule); - } - return resolvedModule; - }); - }; - // language service never calls this, but TS docs recommend that we implement it - const getResolvedModuleWithFailedLookupLocationsFromCache = (moduleName, containingFile, resolutionMode) => { - const ret = ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache, resolutionMode); - if (ret && ret.resolvedModule) { - fixupResolvedModule(ret.resolvedModule); - } - return ret; - }; - const resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile, redirectedReference, options, containingFileMode // new impliedNodeFormat is accepted by compilerHost - ) => { - // Note: seems to be called with empty typeDirectiveNames array for all files. - // TODO consider using `ts.loadWithTypeDirectiveCache` - return typeDirectiveNames.map((typeDirectiveName) => { - // Copy-pasted from TS source: - const nameIsString = typeof typeDirectiveName === 'string'; - const mode = nameIsString - ? undefined - : ts.getModeForFileReference(typeDirectiveName, containingFileMode); - const strName = nameIsString - ? typeDirectiveName - : typeDirectiveName.fileName.toLowerCase(); - let { resolvedTypeReferenceDirective } = ts.resolveTypeReferenceDirective(strName, containingFile, config.options, host, redirectedReference, undefined, mode); - if (typeDirectiveName === 'node' && !resolvedTypeReferenceDirective) { - // Resolve @types/node relative to project first, then __dirname (copy logic from elsewhere / refactor into reusable function) - let typesNodePackageJsonPath; - try { - typesNodePackageJsonPath = projectLocalResolveHelper('@types/node/package.json', true); - } - catch { } // gracefully do nothing when @types/node is not installed for any reason - if (typesNodePackageJsonPath) { - const typeRoots = [(0, path_1.resolve)(typesNodePackageJsonPath, '../..')]; - ({ resolvedTypeReferenceDirective } = - ts.resolveTypeReferenceDirective(typeDirectiveName, containingFile, { - ...config.options, - typeRoots, - }, host, redirectedReference)); - } - } - if (resolvedTypeReferenceDirective) { - fixupResolvedModule(resolvedTypeReferenceDirective); - } - return resolvedTypeReferenceDirective; - }); - }; - return { - resolveModuleNames, - getResolvedModuleWithFailedLookupLocationsFromCache, - resolveTypeReferenceDirectives, - isFileKnownToBeInternal, - markBucketOfFilenameInternal, - }; -} -exports.createResolverFunctions = createResolverFunctions; -//# sourceMappingURL=resolver-functions.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/resolver-functions.js.map b/node_modules/ts-node/dist/resolver-functions.js.map deleted file mode 100644 index 1ef0d82..0000000 --- a/node_modules/ts-node/dist/resolver-functions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolver-functions.js","sourceRoot":"","sources":["../src/resolver-functions.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAM/B;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,MASvC;IACC,MAAM,EACJ,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,oBAAoB,EACpB,yBAAyB,EACzB,OAAO,EACP,UAAU,GACX,GAAG,MAAM,CAAC;IACX,MAAM,qBAAqB,GAAG,EAAE,CAAC,2BAA2B,CAC1D,GAAG,EACH,oBAAoB,EACpB,MAAM,CAAC,OAAO,CACf,CAAC;IACF,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAU,CAAC;IACjD,gFAAgF;IAChF,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAE1C,4FAA4F;IAC5F,wHAAwH;IACxH,sIAAsI;IACtI,MAAM,cAAc,GAAG,0CAA0C,CAAC;IAClE,SAAS,eAAe,CAAC,QAAgB;QACvC,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,0EAA0E;IAC1E,SAAS,4BAA4B,CAAC,QAAgB;QACpD,eAAe,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,SAAS,sBAAsB,CAAC,QAAgB;QAC9C,OAAO,eAAe,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,SAAS,uBAAuB,CAAC,QAAgB;QAC/C,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CAAC,EAAE,8BAA8B,EAAE;wBACjC,EAAE,CAAC,6BAA6B,CAC9B,iBAAiB,EACjB,cAAc,EACd;4BACE,GAAG,MAAM,CAAC,OAAO;4BACjB,SAAS;yBACV,EACD,IAAI,EACJ,mBAAmB,CACpB,CAAC,CAAC;iBACN;aACF;YACD,IAAI,8BAA8B,EAAE;gBAClC,mBAAmB,CAAC,8BAA8B,CAAC,CAAC;aACrD;YACD,OAAO,8BAA8B,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEJ,OAAO;QACL,kBAAkB;QAClB,mDAAmD;QACnD,8BAA8B;QAC9B,uBAAuB;QACvB,4BAA4B;KAC7B,CAAC;AACJ,CAAC;AAnOD,0DAmOC","sourcesContent":["import { resolve } from 'path';\nimport type { CreateOptions } from '.';\nimport type { Extensions } from './file-extensions';\nimport type { TSCommon, TSInternal } from './ts-compiler-types';\nimport type { ProjectLocalResolveHelper } from './util';\n\n/**\n * @internal\n * In a factory because these are shared across both CompilerHost and LanguageService codepaths\n */\nexport function createResolverFunctions(kwargs: {\n ts: TSCommon;\n host: TSCommon.ModuleResolutionHost;\n cwd: string;\n getCanonicalFileName: (filename: string) => string;\n config: TSCommon.ParsedCommandLine;\n projectLocalResolveHelper: ProjectLocalResolveHelper;\n options: CreateOptions;\n extensions: Extensions;\n}) {\n const {\n host,\n ts,\n config,\n cwd,\n getCanonicalFileName,\n projectLocalResolveHelper,\n options,\n extensions,\n } = kwargs;\n const moduleResolutionCache = ts.createModuleResolutionCache(\n cwd,\n getCanonicalFileName,\n config.options\n );\n const knownInternalFilenames = new Set();\n /** \"Buckets\" (module directories) whose contents should be marked \"internal\" */\n const internalBuckets = new Set();\n\n // Get bucket for a source filename. Bucket is the containing `./node_modules/*/` directory\n // For '/project/node_modules/foo/node_modules/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/bar/'\n // For '/project/node_modules/foo/node_modules/@scope/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/@scope/bar/'\n const moduleBucketRe = /.*\\/node_modules\\/(?:@[^\\/]+\\/)?[^\\/]+\\//;\n function getModuleBucket(filename: string) {\n const find = moduleBucketRe.exec(filename);\n if (find) return find[0];\n return '';\n }\n\n // Mark that this file and all siblings in its bucket should be \"internal\"\n function markBucketOfFilenameInternal(filename: string) {\n internalBuckets.add(getModuleBucket(filename));\n }\n\n function isFileInInternalBucket(filename: string) {\n return internalBuckets.has(getModuleBucket(filename));\n }\n\n function isFileKnownToBeInternal(filename: string) {\n return knownInternalFilenames.has(filename);\n }\n\n /**\n * If we need to emit JS for a file, force TS to consider it non-external\n */\n const fixupResolvedModule = (\n resolvedModule:\n | TSCommon.ResolvedModule\n | TSCommon.ResolvedTypeReferenceDirective\n ) => {\n const { resolvedFileName } = resolvedModule;\n if (resolvedFileName === undefined) return;\n // [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS]\n // .ts,.mts,.cts is always switched to internal\n // .js is switched on-demand\n if (\n resolvedModule.isExternalLibraryImport &&\n ((resolvedFileName.endsWith('.ts') &&\n !resolvedFileName.endsWith('.d.ts')) ||\n (resolvedFileName.endsWith('.cts') &&\n !resolvedFileName.endsWith('.d.cts')) ||\n (resolvedFileName.endsWith('.mts') &&\n !resolvedFileName.endsWith('.d.mts')) ||\n isFileKnownToBeInternal(resolvedFileName) ||\n isFileInInternalBucket(resolvedFileName))\n ) {\n resolvedModule.isExternalLibraryImport = false;\n }\n if (!resolvedModule.isExternalLibraryImport) {\n knownInternalFilenames.add(resolvedFileName);\n }\n };\n /*\n * NOTE:\n * Older ts versions do not pass `redirectedReference` nor `options`.\n * We must pass `redirectedReference` to newer ts versions, but cannot rely on `options`, hence the weird argument name\n */\n const resolveModuleNames: TSCommon.LanguageServiceHost['resolveModuleNames'] =\n (\n moduleNames: string[],\n containingFile: string,\n reusedNames: string[] | undefined,\n redirectedReference: TSCommon.ResolvedProjectReference | undefined,\n optionsOnlyWithNewerTsVersions: TSCommon.CompilerOptions,\n containingSourceFile?: TSCommon.SourceFile\n ): (TSCommon.ResolvedModule | undefined)[] => {\n return moduleNames.map((moduleName, i) => {\n const mode = containingSourceFile\n ? (ts as any as TSInternal).getModeForResolutionAtIndex?.(\n containingSourceFile,\n i\n )\n : undefined;\n let { resolvedModule } = ts.resolveModuleName(\n moduleName,\n containingFile,\n config.options,\n host,\n moduleResolutionCache,\n redirectedReference,\n mode\n );\n if (!resolvedModule && options.experimentalTsImportSpecifiers) {\n const lastDotIndex = moduleName.lastIndexOf('.');\n const ext = lastDotIndex >= 0 ? moduleName.slice(lastDotIndex) : '';\n if (ext) {\n const replacements = extensions.tsResolverEquivalents.get(ext);\n for (const replacementExt of replacements ?? []) {\n ({ resolvedModule } = ts.resolveModuleName(\n moduleName.slice(0, -ext.length) + replacementExt,\n containingFile,\n config.options,\n host,\n moduleResolutionCache,\n redirectedReference,\n mode\n ));\n if (resolvedModule) break;\n }\n }\n }\n if (resolvedModule) {\n fixupResolvedModule(resolvedModule);\n }\n return resolvedModule;\n });\n };\n\n // language service never calls this, but TS docs recommend that we implement it\n const getResolvedModuleWithFailedLookupLocationsFromCache: TSCommon.LanguageServiceHost['getResolvedModuleWithFailedLookupLocationsFromCache'] =\n (\n moduleName,\n containingFile,\n resolutionMode?: TSCommon.ModuleKind.CommonJS | TSCommon.ModuleKind.ESNext\n ): TSCommon.ResolvedModuleWithFailedLookupLocations | undefined => {\n const ret = ts.resolveModuleNameFromCache(\n moduleName,\n containingFile,\n moduleResolutionCache,\n resolutionMode\n );\n if (ret && ret.resolvedModule) {\n fixupResolvedModule(ret.resolvedModule);\n }\n return ret;\n };\n\n const resolveTypeReferenceDirectives: TSCommon.LanguageServiceHost['resolveTypeReferenceDirectives'] =\n (\n typeDirectiveNames: string[] | readonly TSCommon.FileReference[],\n containingFile: string,\n redirectedReference: TSCommon.ResolvedProjectReference | undefined,\n options: TSCommon.CompilerOptions,\n containingFileMode?: TSCommon.SourceFile['impliedNodeFormat'] | undefined // new impliedNodeFormat is accepted by compilerHost\n ): (TSCommon.ResolvedTypeReferenceDirective | undefined)[] => {\n // Note: seems to be called with empty typeDirectiveNames array for all files.\n // TODO consider using `ts.loadWithTypeDirectiveCache`\n return typeDirectiveNames.map((typeDirectiveName) => {\n // Copy-pasted from TS source:\n const nameIsString = typeof typeDirectiveName === 'string';\n const mode = nameIsString\n ? undefined\n : (ts as any as TSInternal).getModeForFileReference!(\n typeDirectiveName,\n containingFileMode\n );\n const strName = nameIsString\n ? typeDirectiveName\n : typeDirectiveName.fileName.toLowerCase();\n let { resolvedTypeReferenceDirective } =\n ts.resolveTypeReferenceDirective(\n strName,\n containingFile,\n config.options,\n host,\n redirectedReference,\n undefined,\n mode\n );\n if (typeDirectiveName === 'node' && !resolvedTypeReferenceDirective) {\n // Resolve @types/node relative to project first, then __dirname (copy logic from elsewhere / refactor into reusable function)\n let typesNodePackageJsonPath: string | undefined;\n try {\n typesNodePackageJsonPath = projectLocalResolveHelper(\n '@types/node/package.json',\n true\n );\n } catch {} // gracefully do nothing when @types/node is not installed for any reason\n if (typesNodePackageJsonPath) {\n const typeRoots = [resolve(typesNodePackageJsonPath, '../..')];\n ({ resolvedTypeReferenceDirective } =\n ts.resolveTypeReferenceDirective(\n typeDirectiveName,\n containingFile,\n {\n ...config.options,\n typeRoots,\n },\n host,\n redirectedReference\n ));\n }\n }\n if (resolvedTypeReferenceDirective) {\n fixupResolvedModule(resolvedTypeReferenceDirective);\n }\n return resolvedTypeReferenceDirective;\n });\n };\n\n return {\n resolveModuleNames,\n getResolvedModuleWithFailedLookupLocationsFromCache,\n resolveTypeReferenceDirectives,\n isFileKnownToBeInternal,\n markBucketOfFilenameInternal,\n };\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/transpilers/swc.d.ts b/node_modules/ts-node/dist/transpilers/swc.d.ts deleted file mode 100644 index 942e746..0000000 --- a/node_modules/ts-node/dist/transpilers/swc.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type * as swcWasm from '@swc/wasm'; -import type { CreateTranspilerOptions, Transpiler } from './types'; -export interface SwcTranspilerOptions extends CreateTranspilerOptions { - /** - * swc compiler to use for compilation - * Set to '@swc/wasm' to use swc's WASM compiler - * Default: '@swc/core', falling back to '@swc/wasm' - */ - swc?: string | typeof swcWasm; -} -export declare function create(createOptions: SwcTranspilerOptions): Transpiler; diff --git a/node_modules/ts-node/dist/transpilers/swc.js b/node_modules/ts-node/dist/transpilers/swc.js deleted file mode 100644 index e49f881..0000000 --- a/node_modules/ts-node/dist/transpilers/swc.js +++ /dev/null @@ -1,218 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createSwcOptions = exports.targetMapping = exports.create = void 0; -const ts_internals_1 = require("../ts-internals"); -function create(createOptions) { - const { swc, service: { config, projectLocalResolveHelper }, transpilerConfigLocalResolveHelper, nodeModuleEmitKind, } = createOptions; - // Load swc compiler - let swcInstance; - // Used later in diagnostics; merely needs to be human-readable. - let swcDepName = 'swc'; - if (typeof swc === 'string') { - swcDepName = swc; - swcInstance = require(transpilerConfigLocalResolveHelper(swc, true)); - } - else if (swc == null) { - let swcResolved; - try { - swcDepName = '@swc/core'; - swcResolved = transpilerConfigLocalResolveHelper(swcDepName, true); - } - catch (e) { - try { - swcDepName = '@swc/wasm'; - swcResolved = transpilerConfigLocalResolveHelper(swcDepName, true); - } - catch (e) { - throw new Error('swc compiler requires either @swc/core or @swc/wasm to be installed as a dependency. See https://typestrong.org/ts-node/docs/transpilers'); - } - } - swcInstance = require(swcResolved); - } - else { - swcInstance = swc; - } - // Prepare SWC options derived from typescript compiler options - const { nonTsxOptions, tsxOptions } = createSwcOptions(config.options, nodeModuleEmitKind, swcInstance, swcDepName); - const transpile = (input, transpileOptions) => { - const { fileName } = transpileOptions; - const swcOptions = fileName.endsWith('.tsx') || fileName.endsWith('.jsx') ? tsxOptions : nonTsxOptions; - const { code, map } = swcInstance.transformSync(input, { - ...swcOptions, - filename: fileName, - }); - return { outputText: code, sourceMapText: map }; - }; - return { - transpile, - }; -} -exports.create = create; -/** @internal */ -exports.targetMapping = new Map(); -exports.targetMapping.set(/* ts.ScriptTarget.ES3 */ 0, 'es3'); -exports.targetMapping.set(/* ts.ScriptTarget.ES5 */ 1, 'es5'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2015 */ 2, 'es2015'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2016 */ 3, 'es2016'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2017 */ 4, 'es2017'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2018 */ 5, 'es2018'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2019 */ 6, 'es2019'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2020 */ 7, 'es2020'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2021 */ 8, 'es2021'); -exports.targetMapping.set(/* ts.ScriptTarget.ES2022 */ 9, 'es2022'); -exports.targetMapping.set(/* ts.ScriptTarget.ESNext */ 99, 'esnext'); -/** - * @internal - * We use this list to downgrade to a prior target when we probe swc to detect if it supports a particular target - */ -const swcTargets = [ - 'es3', - 'es5', - 'es2015', - 'es2016', - 'es2017', - 'es2018', - 'es2019', - 'es2020', - 'es2021', - 'es2022', - 'esnext', -]; -const ModuleKind = { - None: 0, - CommonJS: 1, - AMD: 2, - UMD: 3, - System: 4, - ES2015: 5, - ES2020: 6, - ESNext: 99, - Node16: 100, - NodeNext: 199, -}; -const JsxEmit = { - ReactJSX: /* ts.JsxEmit.ReactJSX */ 4, - ReactJSXDev: /* ts.JsxEmit.ReactJSXDev */ 5, -}; -/** - * Prepare SWC options derived from typescript compiler options. - * @internal exported for testing - */ -function createSwcOptions(compilerOptions, nodeModuleEmitKind, swcInstance, swcDepName) { - var _a; - const { esModuleInterop, sourceMap, importHelpers, experimentalDecorators, emitDecoratorMetadata, target, module, jsx, jsxFactory, jsxFragmentFactory, strict, alwaysStrict, noImplicitUseStrict, jsxImportSource, } = compilerOptions; - let swcTarget = (_a = exports.targetMapping.get(target)) !== null && _a !== void 0 ? _a : 'es3'; - // Downgrade to lower target if swc does not support the selected target. - // Perhaps project has an older version of swc. - // TODO cache the results of this; slightly faster - let swcTargetIndex = swcTargets.indexOf(swcTarget); - for (; swcTargetIndex >= 0; swcTargetIndex--) { - try { - swcInstance.transformSync('', { - jsc: { target: swcTargets[swcTargetIndex] }, - }); - break; - } - catch (e) { } - } - swcTarget = swcTargets[swcTargetIndex]; - const keepClassNames = target >= /* ts.ScriptTarget.ES2016 */ 3; - const isNodeModuleKind = module === ModuleKind.Node16 || module === ModuleKind.NodeNext; - // swc only supports these 4x module options [MUST_UPDATE_FOR_NEW_MODULEKIND] - const moduleType = module === ModuleKind.CommonJS - ? 'commonjs' - : module === ModuleKind.AMD - ? 'amd' - : module === ModuleKind.UMD - ? 'umd' - : isNodeModuleKind && nodeModuleEmitKind === 'nodecjs' - ? 'commonjs' - : isNodeModuleKind && nodeModuleEmitKind === 'nodeesm' - ? 'es6' - : 'es6'; - // In swc: - // strictMode means `"use strict"` is *always* emitted for non-ES module, *never* for ES module where it is assumed it can be omitted. - // (this assumption is invalid, but that's the way swc behaves) - // tsc is a bit more complex: - // alwaysStrict will force emitting it always unless `import`/`export` syntax is emitted which implies it per the JS spec. - // if not alwaysStrict, will emit implicitly whenever module target is non-ES *and* transformed module syntax is emitted. - // For node, best option is to assume that all scripts are modules (commonjs or esm) and thus should get tsc's implicit strict behavior. - // Always set strictMode, *unless* alwaysStrict is disabled and noImplicitUseStrict is enabled - const strictMode = - // if `alwaysStrict` is disabled, remembering that `strict` defaults `alwaysStrict` to true - (alwaysStrict === false || (alwaysStrict !== true && strict !== true)) && - // if noImplicitUseStrict is enabled - noImplicitUseStrict === true - ? false - : true; - const jsxRuntime = jsx === JsxEmit.ReactJSX || jsx === JsxEmit.ReactJSXDev ? 'automatic' : undefined; - const jsxDevelopment = jsx === JsxEmit.ReactJSXDev ? true : undefined; - const useDefineForClassFields = (0, ts_internals_1.getUseDefineForClassFields)(compilerOptions); - const nonTsxOptions = createVariant(false); - const tsxOptions = createVariant(true); - return { nonTsxOptions, tsxOptions }; - function createVariant(isTsx) { - const swcOptions = { - sourceMaps: sourceMap, - // isModule: true, - module: moduleType - ? { - type: moduleType, - ...(moduleType === 'amd' || moduleType === 'commonjs' || moduleType === 'umd' - ? { - noInterop: !esModuleInterop, - strictMode, - // For NodeNext and Node12, emit as CJS but do not transform dynamic imports - ignoreDynamic: nodeModuleEmitKind === 'nodecjs', - } - : {}), - } - : undefined, - swcrc: false, - jsc: { - externalHelpers: importHelpers, - parser: { - syntax: 'typescript', - tsx: isTsx, - decorators: experimentalDecorators, - dynamicImport: true, - importAssertions: true, - }, - target: swcTarget, - transform: { - decoratorMetadata: emitDecoratorMetadata, - legacyDecorator: true, - react: { - throwIfNamespace: false, - development: jsxDevelopment, - useBuiltins: false, - pragma: jsxFactory, - pragmaFrag: jsxFragmentFactory, - runtime: jsxRuntime, - importSource: jsxImportSource, - }, - useDefineForClassFields, - }, - keepClassNames, - experimental: { - keepImportAttributes: true, - emitAssertForImportAttributes: true, - }, - }, - }; - // Throw a helpful error if swc version is old, for example, if it rejects `ignoreDynamic` - try { - swcInstance.transformSync('', swcOptions); - } - catch (e) { - throw new Error(`${swcDepName} threw an error when attempting to validate swc compiler options.\n` + - 'You may be using an old version of swc which does not support the options used by ts-node.\n' + - 'Try upgrading to the latest version of swc.\n' + - 'Error message from swc:\n' + - (e === null || e === void 0 ? void 0 : e.message)); - } - return swcOptions; - } -} -exports.createSwcOptions = createSwcOptions; -//# sourceMappingURL=swc.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/transpilers/swc.js.map b/node_modules/ts-node/dist/transpilers/swc.js.map deleted file mode 100644 index 06330f0..0000000 --- a/node_modules/ts-node/dist/transpilers/swc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"swc.js","sourceRoot":"","sources":["../../src/transpilers/swc.ts"],"names":[],"mappings":";;;AAKA,kDAA6D;AAY7D,SAAgB,MAAM,CAAC,aAA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AE,kBAAmB;wBAC/B,OAAO,EAAE,UAAU;wBACnB,YAAY,EAAE,eAAe;qBAC9B;oBACD,uBAAuB;iBACxB;gBACD,cAAc;gBACd,YAAY,EAAE;oBACZ,oBAAoB,EAAE,IAAI;oBAC1B,6BAA6B,EAAE,IAAI;iBACE;aACxC;SACF,CAAC;QAEF,0FAA0F;QAC1F,IAAI;YACF,WAAW,CAAC,aAAa,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CACb,GAAG,UAAU,qEAAqE;gBAChF,8FAA8F;gBAC9F,+CAA+C;gBAC/C,2BAA2B;iBAC1B,CAAW,aAAX,CAAC,uBAAD,CAAC,CAAY,OAAO,CAAA,CACxB,CAAC;SACH;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;AACH,CAAC;AAhJD,4CAgJC","sourcesContent":["import type * as ts from 'typescript';\nimport type * as swcWasm from '@swc/wasm';\nimport type * as swcTypes from '@swc/core';\nimport type { CreateTranspilerOptions, Transpiler } from './types';\nimport type { NodeModuleEmitKind } from '..';\nimport { getUseDefineForClassFields } from '../ts-internals';\n\ntype SwcInstance = typeof swcTypes;\nexport interface SwcTranspilerOptions extends CreateTranspilerOptions {\n /**\n * swc compiler to use for compilation\n * Set to '@swc/wasm' to use swc's WASM compiler\n * Default: '@swc/core', falling back to '@swc/wasm'\n */\n swc?: string | typeof swcWasm;\n}\n\nexport function create(createOptions: SwcTranspilerOptions): Transpiler {\n const {\n swc,\n service: { config, projectLocalResolveHelper },\n transpilerConfigLocalResolveHelper,\n nodeModuleEmitKind,\n } = createOptions;\n\n // Load swc compiler\n let swcInstance: SwcInstance;\n // Used later in diagnostics; merely needs to be human-readable.\n let swcDepName: string = 'swc';\n if (typeof swc === 'string') {\n swcDepName = swc;\n swcInstance = require(transpilerConfigLocalResolveHelper(swc, true)) as SwcInstance;\n } else if (swc == null) {\n let swcResolved;\n try {\n swcDepName = '@swc/core';\n swcResolved = transpilerConfigLocalResolveHelper(swcDepName, true);\n } catch (e) {\n try {\n swcDepName = '@swc/wasm';\n swcResolved = transpilerConfigLocalResolveHelper(swcDepName, true);\n } catch (e) {\n throw new Error(\n 'swc compiler requires either @swc/core or @swc/wasm to be installed as a dependency. See https://typestrong.org/ts-node/docs/transpilers'\n );\n }\n }\n swcInstance = require(swcResolved) as SwcInstance;\n } else {\n swcInstance = swc as any as SwcInstance;\n }\n\n // Prepare SWC options derived from typescript compiler options\n const { nonTsxOptions, tsxOptions } = createSwcOptions(config.options, nodeModuleEmitKind, swcInstance, swcDepName);\n\n const transpile: Transpiler['transpile'] = (input, transpileOptions) => {\n const { fileName } = transpileOptions;\n const swcOptions = fileName.endsWith('.tsx') || fileName.endsWith('.jsx') ? tsxOptions : nonTsxOptions;\n const { code, map } = swcInstance.transformSync(input, {\n ...swcOptions,\n filename: fileName,\n });\n return { outputText: code, sourceMapText: map };\n };\n\n return {\n transpile,\n };\n}\n\n/** @internal */\nexport const targetMapping = new Map();\ntargetMapping.set(/* ts.ScriptTarget.ES3 */ 0, 'es3');\ntargetMapping.set(/* ts.ScriptTarget.ES5 */ 1, 'es5');\ntargetMapping.set(/* ts.ScriptTarget.ES2015 */ 2, 'es2015');\ntargetMapping.set(/* ts.ScriptTarget.ES2016 */ 3, 'es2016');\ntargetMapping.set(/* ts.ScriptTarget.ES2017 */ 4, 'es2017');\ntargetMapping.set(/* ts.ScriptTarget.ES2018 */ 5, 'es2018');\ntargetMapping.set(/* ts.ScriptTarget.ES2019 */ 6, 'es2019');\ntargetMapping.set(/* ts.ScriptTarget.ES2020 */ 7, 'es2020');\ntargetMapping.set(/* ts.ScriptTarget.ES2021 */ 8, 'es2021');\ntargetMapping.set(/* ts.ScriptTarget.ES2022 */ 9, 'es2022');\ntargetMapping.set(/* ts.ScriptTarget.ESNext */ 99, 'esnext');\n\ntype SwcTarget = typeof swcTargets[number];\n/**\n * @internal\n * We use this list to downgrade to a prior target when we probe swc to detect if it supports a particular target\n */\nconst swcTargets = [\n 'es3',\n 'es5',\n 'es2015',\n 'es2016',\n 'es2017',\n 'es2018',\n 'es2019',\n 'es2020',\n 'es2021',\n 'es2022',\n 'esnext',\n] as const;\n\nconst ModuleKind = {\n None: 0,\n CommonJS: 1,\n AMD: 2,\n UMD: 3,\n System: 4,\n ES2015: 5,\n ES2020: 6,\n ESNext: 99,\n Node16: 100,\n NodeNext: 199,\n} as const;\n\nconst JsxEmit = {\n ReactJSX: /* ts.JsxEmit.ReactJSX */ 4,\n ReactJSXDev: /* ts.JsxEmit.ReactJSXDev */ 5,\n} as const;\n\n/**\n * Prepare SWC options derived from typescript compiler options.\n * @internal exported for testing\n */\nexport function createSwcOptions(\n compilerOptions: ts.CompilerOptions,\n nodeModuleEmitKind: NodeModuleEmitKind | undefined,\n swcInstance: SwcInstance,\n swcDepName: string\n) {\n const {\n esModuleInterop,\n sourceMap,\n importHelpers,\n experimentalDecorators,\n emitDecoratorMetadata,\n target,\n module,\n jsx,\n jsxFactory,\n jsxFragmentFactory,\n strict,\n alwaysStrict,\n noImplicitUseStrict,\n jsxImportSource,\n } = compilerOptions;\n\n let swcTarget = targetMapping.get(target!) ?? 'es3';\n // Downgrade to lower target if swc does not support the selected target.\n // Perhaps project has an older version of swc.\n // TODO cache the results of this; slightly faster\n let swcTargetIndex = swcTargets.indexOf(swcTarget);\n for (; swcTargetIndex >= 0; swcTargetIndex--) {\n try {\n swcInstance.transformSync('', {\n jsc: { target: swcTargets[swcTargetIndex] as swcWasm.JscTarget },\n });\n break;\n } catch (e) {}\n }\n swcTarget = swcTargets[swcTargetIndex];\n const keepClassNames = target! >= /* ts.ScriptTarget.ES2016 */ 3;\n const isNodeModuleKind = module === ModuleKind.Node16 || module === ModuleKind.NodeNext;\n // swc only supports these 4x module options [MUST_UPDATE_FOR_NEW_MODULEKIND]\n const moduleType =\n module === ModuleKind.CommonJS\n ? 'commonjs'\n : module === ModuleKind.AMD\n ? 'amd'\n : module === ModuleKind.UMD\n ? 'umd'\n : isNodeModuleKind && nodeModuleEmitKind === 'nodecjs'\n ? 'commonjs'\n : isNodeModuleKind && nodeModuleEmitKind === 'nodeesm'\n ? 'es6'\n : 'es6';\n // In swc:\n // strictMode means `\"use strict\"` is *always* emitted for non-ES module, *never* for ES module where it is assumed it can be omitted.\n // (this assumption is invalid, but that's the way swc behaves)\n // tsc is a bit more complex:\n // alwaysStrict will force emitting it always unless `import`/`export` syntax is emitted which implies it per the JS spec.\n // if not alwaysStrict, will emit implicitly whenever module target is non-ES *and* transformed module syntax is emitted.\n // For node, best option is to assume that all scripts are modules (commonjs or esm) and thus should get tsc's implicit strict behavior.\n\n // Always set strictMode, *unless* alwaysStrict is disabled and noImplicitUseStrict is enabled\n const strictMode =\n // if `alwaysStrict` is disabled, remembering that `strict` defaults `alwaysStrict` to true\n (alwaysStrict === false || (alwaysStrict !== true && strict !== true)) &&\n // if noImplicitUseStrict is enabled\n noImplicitUseStrict === true\n ? false\n : true;\n\n const jsxRuntime: swcTypes.ReactConfig['runtime'] =\n jsx === JsxEmit.ReactJSX || jsx === JsxEmit.ReactJSXDev ? 'automatic' : undefined;\n const jsxDevelopment: swcTypes.ReactConfig['development'] = jsx === JsxEmit.ReactJSXDev ? true : undefined;\n\n const useDefineForClassFields = getUseDefineForClassFields(compilerOptions);\n\n const nonTsxOptions = createVariant(false);\n const tsxOptions = createVariant(true);\n return { nonTsxOptions, tsxOptions };\n\n function createVariant(isTsx: boolean): swcTypes.Options {\n const swcOptions: swcTypes.Options = {\n sourceMaps: sourceMap,\n // isModule: true,\n module: moduleType\n ? {\n type: moduleType,\n ...(moduleType === 'amd' || moduleType === 'commonjs' || moduleType === 'umd'\n ? {\n noInterop: !esModuleInterop,\n strictMode,\n // For NodeNext and Node12, emit as CJS but do not transform dynamic imports\n ignoreDynamic: nodeModuleEmitKind === 'nodecjs',\n }\n : {}),\n }\n : undefined,\n swcrc: false,\n jsc: {\n externalHelpers: importHelpers,\n parser: {\n syntax: 'typescript',\n tsx: isTsx,\n decorators: experimentalDecorators,\n dynamicImport: true,\n importAssertions: true,\n } as swcWasm.TsParserConfig,\n target: swcTarget as swcWasm.JscTarget,\n transform: {\n decoratorMetadata: emitDecoratorMetadata,\n legacyDecorator: true,\n react: {\n throwIfNamespace: false,\n development: jsxDevelopment,\n useBuiltins: false,\n pragma: jsxFactory!,\n pragmaFrag: jsxFragmentFactory!,\n runtime: jsxRuntime,\n importSource: jsxImportSource,\n },\n useDefineForClassFields,\n },\n keepClassNames,\n experimental: {\n keepImportAttributes: true,\n emitAssertForImportAttributes: true,\n } as swcTypes.JscConfig['experimental'],\n },\n };\n\n // Throw a helpful error if swc version is old, for example, if it rejects `ignoreDynamic`\n try {\n swcInstance.transformSync('', swcOptions);\n } catch (e) {\n throw new Error(\n `${swcDepName} threw an error when attempting to validate swc compiler options.\\n` +\n 'You may be using an old version of swc which does not support the options used by ts-node.\\n' +\n 'Try upgrading to the latest version of swc.\\n' +\n 'Error message from swc:\\n' +\n (e as Error)?.message\n );\n }\n\n return swcOptions;\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/transpilers/types.d.ts b/node_modules/ts-node/dist/transpilers/types.d.ts deleted file mode 100644 index 13049f8..0000000 --- a/node_modules/ts-node/dist/transpilers/types.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type * as ts from 'typescript'; -import type { Service } from '../index'; -/** - * Third-party transpilers are implemented as a CommonJS module with a - * named export "create" - * - * @category Transpiler - */ -export interface TranspilerModule { - create: TranspilerFactory; -} -/** - * Called by ts-node to create a custom transpiler. - * - * @category Transpiler - */ -export declare type TranspilerFactory = (options: CreateTranspilerOptions) => Transpiler; -/** @category Transpiler */ -export interface CreateTranspilerOptions { - service: Pick>; -} -/** @category Transpiler */ -export interface Transpiler { - transpile(input: string, options: TranspileOptions): TranspileOutput; -} -/** @category Transpiler */ -export interface TranspileOptions { - fileName: string; -} -/** @category Transpiler */ -export interface TranspileOutput { - outputText: string; - diagnostics?: ts.Diagnostic[]; - sourceMapText?: string; -} diff --git a/node_modules/ts-node/dist/transpilers/types.js b/node_modules/ts-node/dist/transpilers/types.js deleted file mode 100644 index 11e638d..0000000 --- a/node_modules/ts-node/dist/transpilers/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/transpilers/types.js.map b/node_modules/ts-node/dist/transpilers/types.js.map deleted file mode 100644 index 2a00c2f..0000000 --- a/node_modules/ts-node/dist/transpilers/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/transpilers/types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as ts from 'typescript';\nimport type { NodeModuleEmitKind, Service } from '../index';\nimport type { ProjectLocalResolveHelper } from '../util';\n\n/**\n * Third-party transpilers are implemented as a CommonJS module with a\n * named export \"create\"\n *\n * @category Transpiler\n */\nexport interface TranspilerModule {\n create: TranspilerFactory;\n}\n/**\n * Called by ts-node to create a custom transpiler.\n *\n * @category Transpiler\n */\nexport type TranspilerFactory = (\n options: CreateTranspilerOptions\n) => Transpiler;\n/** @category Transpiler */\nexport interface CreateTranspilerOptions {\n // TODO this is confusing because its only a partial Service. Rename?\n // Careful: must avoid stripInternal breakage by guarding with Extract<>\n service: Pick<\n Service,\n Extract<'config' | 'options' | 'projectLocalResolveHelper', keyof Service>\n >;\n /**\n * If `\"transpiler\"` option is declared in an \"extends\" tsconfig, this path might be different than\n * the `projectLocalResolveHelper`\n *\n * @internal\n */\n transpilerConfigLocalResolveHelper: ProjectLocalResolveHelper;\n /**\n * When using `module: nodenext` or `module: node12`, there are two possible styles of emit:\n * - CommonJS with dynamic imports preserved (not transformed into `require()` calls)\n * - ECMAScript modules with `import foo = require()` transformed into `require = createRequire(); const foo = require()`\n * @internal\n */\n nodeModuleEmitKind?: NodeModuleEmitKind;\n}\n/** @category Transpiler */\nexport interface Transpiler {\n // TODOs\n // Create spec for returning diagnostics? Currently transpilers are allowed to\n // throw an error but that's it.\n transpile(input: string, options: TranspileOptions): TranspileOutput;\n}\n/** @category Transpiler */\nexport interface TranspileOptions {\n fileName: string;\n}\n/** @category Transpiler */\nexport interface TranspileOutput {\n outputText: string;\n diagnostics?: ts.Diagnostic[];\n sourceMapText?: string;\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/ts-compiler-types.d.ts b/node_modules/ts-node/dist/ts-compiler-types.d.ts deleted file mode 100644 index 99cd4c6..0000000 --- a/node_modules/ts-node/dist/ts-compiler-types.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type * as _ts from 'typescript'; -/** - * Common TypeScript interfaces between versions. We endeavour to write ts-node's own code against these types instead - * of against `import "typescript"`, though we are not yet doing this consistently. - * - * Sometimes typescript@next adds an API we need to use. But we build ts-node against typescript@latest. - * In these cases, we must declare that API explicitly here. Our declarations include the newer typescript@next APIs. - * Importantly, these re-declarations are *not* TypeScript internals. They are public APIs that only exist in - * pre-release versions of typescript. - */ -export interface TSCommon { - version: typeof _ts.version; - sys: typeof _ts.sys; - ScriptSnapshot: typeof _ts.ScriptSnapshot; - displayPartsToString: typeof _ts.displayPartsToString; - createLanguageService: typeof _ts.createLanguageService; - getDefaultLibFilePath: typeof _ts.getDefaultLibFilePath; - getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics; - flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText; - transpileModule: typeof _ts.transpileModule; - ModuleKind: TSCommon.ModuleKindEnum; - ScriptTarget: typeof _ts.ScriptTarget; - findConfigFile: typeof _ts.findConfigFile; - readConfigFile: typeof _ts.readConfigFile; - parseJsonConfigFileContent: typeof _ts.parseJsonConfigFileContent; - formatDiagnostics: typeof _ts.formatDiagnostics; - formatDiagnosticsWithColorAndContext: typeof _ts.formatDiagnosticsWithColorAndContext; - createDocumentRegistry: typeof _ts.createDocumentRegistry; - JsxEmit: typeof _ts.JsxEmit; - createModuleResolutionCache: typeof _ts.createModuleResolutionCache; - resolveModuleName: typeof _ts.resolveModuleName; - resolveModuleNameFromCache: typeof _ts.resolveModuleNameFromCache; - resolveTypeReferenceDirective: typeof _ts.resolveTypeReferenceDirective; - createIncrementalCompilerHost: typeof _ts.createIncrementalCompilerHost; - createSourceFile: typeof _ts.createSourceFile; - getDefaultLibFileName: typeof _ts.getDefaultLibFileName; - createIncrementalProgram: typeof _ts.createIncrementalProgram; - createEmitAndSemanticDiagnosticsBuilderProgram: typeof _ts.createEmitAndSemanticDiagnosticsBuilderProgram; - Extension: typeof _ts.Extension; - ModuleResolutionKind: typeof _ts.ModuleResolutionKind; -} -export declare namespace TSCommon { - interface LanguageServiceHost extends _ts.LanguageServiceHost { - } - type ModuleResolutionHost = _ts.ModuleResolutionHost; - type ParsedCommandLine = _ts.ParsedCommandLine; - type ResolvedModule = _ts.ResolvedModule; - type ResolvedTypeReferenceDirective = _ts.ResolvedTypeReferenceDirective; - type CompilerOptions = _ts.CompilerOptions; - type ResolvedProjectReference = _ts.ResolvedProjectReference; - type ResolvedModuleWithFailedLookupLocations = _ts.ResolvedModuleWithFailedLookupLocations; - type FileReference = _ts.FileReference; - type SourceFile = _ts.SourceFile; - type ModuleKindEnum = typeof _ts.ModuleKind & { - Node16: typeof _ts.ModuleKind extends { - Node16: any; - } ? typeof _ts.ModuleKind['Node16'] : 100; - }; - namespace ModuleKind { - type CommonJS = _ts.ModuleKind.CommonJS; - type ESNext = _ts.ModuleKind.ESNext; - } -} diff --git a/node_modules/ts-node/dist/ts-compiler-types.js b/node_modules/ts-node/dist/ts-compiler-types.js deleted file mode 100644 index 5b1ec92..0000000 --- a/node_modules/ts-node/dist/ts-compiler-types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ts-compiler-types.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/ts-compiler-types.js.map b/node_modules/ts-node/dist/ts-compiler-types.js.map deleted file mode 100644 index 07315ef..0000000 --- a/node_modules/ts-node/dist/ts-compiler-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ts-compiler-types.js","sourceRoot":"","sources":["../src/ts-compiler-types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as _ts from 'typescript';\n\n/**\n * Common TypeScript interfaces between versions. We endeavour to write ts-node's own code against these types instead\n * of against `import \"typescript\"`, though we are not yet doing this consistently.\n *\n * Sometimes typescript@next adds an API we need to use. But we build ts-node against typescript@latest.\n * In these cases, we must declare that API explicitly here. Our declarations include the newer typescript@next APIs.\n * Importantly, these re-declarations are *not* TypeScript internals. They are public APIs that only exist in\n * pre-release versions of typescript.\n */\nexport interface TSCommon {\n version: typeof _ts.version;\n sys: typeof _ts.sys;\n ScriptSnapshot: typeof _ts.ScriptSnapshot;\n displayPartsToString: typeof _ts.displayPartsToString;\n createLanguageService: typeof _ts.createLanguageService;\n getDefaultLibFilePath: typeof _ts.getDefaultLibFilePath;\n getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics;\n flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText;\n transpileModule: typeof _ts.transpileModule;\n ModuleKind: TSCommon.ModuleKindEnum;\n ScriptTarget: typeof _ts.ScriptTarget;\n findConfigFile: typeof _ts.findConfigFile;\n readConfigFile: typeof _ts.readConfigFile;\n parseJsonConfigFileContent: typeof _ts.parseJsonConfigFileContent;\n formatDiagnostics: typeof _ts.formatDiagnostics;\n formatDiagnosticsWithColorAndContext: typeof _ts.formatDiagnosticsWithColorAndContext;\n\n createDocumentRegistry: typeof _ts.createDocumentRegistry;\n JsxEmit: typeof _ts.JsxEmit;\n createModuleResolutionCache: typeof _ts.createModuleResolutionCache;\n resolveModuleName: typeof _ts.resolveModuleName;\n resolveModuleNameFromCache: typeof _ts.resolveModuleNameFromCache;\n resolveTypeReferenceDirective: typeof _ts.resolveTypeReferenceDirective;\n createIncrementalCompilerHost: typeof _ts.createIncrementalCompilerHost;\n createSourceFile: typeof _ts.createSourceFile;\n getDefaultLibFileName: typeof _ts.getDefaultLibFileName;\n createIncrementalProgram: typeof _ts.createIncrementalProgram;\n createEmitAndSemanticDiagnosticsBuilderProgram: typeof _ts.createEmitAndSemanticDiagnosticsBuilderProgram;\n\n Extension: typeof _ts.Extension;\n ModuleResolutionKind: typeof _ts.ModuleResolutionKind;\n}\nexport namespace TSCommon {\n export interface LanguageServiceHost extends _ts.LanguageServiceHost {}\n export type ModuleResolutionHost = _ts.ModuleResolutionHost;\n export type ParsedCommandLine = _ts.ParsedCommandLine;\n export type ResolvedModule = _ts.ResolvedModule;\n export type ResolvedTypeReferenceDirective =\n _ts.ResolvedTypeReferenceDirective;\n export type CompilerOptions = _ts.CompilerOptions;\n export type ResolvedProjectReference = _ts.ResolvedProjectReference;\n export type ResolvedModuleWithFailedLookupLocations =\n _ts.ResolvedModuleWithFailedLookupLocations;\n export type FileReference = _ts.FileReference;\n export type SourceFile = _ts.SourceFile;\n // Hack until we start building against TS >= 4.7.0\n export type ModuleKindEnum = typeof _ts.ModuleKind & {\n Node16: typeof _ts.ModuleKind extends { Node16: any }\n ? typeof _ts.ModuleKind['Node16']\n : 100;\n };\n // Can't figure out how to re-export an enum\n // `export import ... =` complains that _ts is type-only import\n export namespace ModuleKind {\n export type CommonJS = _ts.ModuleKind.CommonJS;\n export type ESNext = _ts.ModuleKind.ESNext;\n }\n}\n\n/**\n * Compiler APIs we use that are marked internal and not included in TypeScript's public API declarations\n * @internal\n */\nexport interface TSInternal {\n // https://github.com/microsoft/TypeScript/blob/4a34294908bed6701dcba2456ca7ac5eafe0ddff/src/compiler/core.ts#L1906-L1909\n createGetCanonicalFileName(\n useCaseSensitiveFileNames: boolean\n ): TSInternal.GetCanonicalFileName;\n // https://github.com/microsoft/TypeScript/blob/c117c266e09c80e8a06b24a6e94b9d018f5fae6b/src/compiler/commandLineParser.ts#L2054\n convertToTSConfig(\n configParseResult: _ts.ParsedCommandLine,\n configFileName: string,\n host: TSInternal.ConvertToTSConfigHost\n ): any;\n libs?: string[];\n Diagnostics: {\n File_0_not_found: _ts.DiagnosticMessage;\n };\n createCompilerDiagnostic(\n message: _ts.DiagnosticMessage,\n ...args: (string | number | undefined)[]\n ): _ts.Diagnostic;\n nodeModuleNameResolver(\n moduleName: string,\n containingFile: string,\n compilerOptions: _ts.CompilerOptions,\n host: _ts.ModuleResolutionHost,\n cache?: _ts.ModuleResolutionCache,\n redirectedReference?: _ts.ResolvedProjectReference,\n conditionsOrIsConfigLookup?: string[] | boolean, // `conditions` parameter added in TS 5.3\n isConfigLookup?: boolean\n ): _ts.ResolvedModuleWithFailedLookupLocations;\n // Added in TS 4.7\n getModeForFileReference?: (\n ref: _ts.FileReference | string,\n containingFileMode: _ts.SourceFile['impliedNodeFormat']\n ) => _ts.SourceFile['impliedNodeFormat'];\n // TODO do we need these? Which TS version adds them?\n getPatternFromSpec(\n spec: string,\n basePath: string,\n usage: 'files' | 'directories' | 'exclude'\n ): string | undefined;\n getRegularExpressionForWildcard(\n specs: readonly string[] | undefined,\n basePath: string,\n usage: 'files' | 'directories' | 'exclude'\n ): string | undefined;\n // Added in TS 4.7\n getModeForResolutionAtIndex?(\n file: TSInternal.SourceFileImportsList,\n index: number\n ): _ts.SourceFile['impliedNodeFormat'];\n}\n/** @internal */\nexport namespace TSInternal {\n // https://github.com/microsoft/TypeScript/blob/4a34294908bed6701dcba2456ca7ac5eafe0ddff/src/compiler/core.ts#L1906\n export type GetCanonicalFileName = (fileName: string) => string;\n // https://github.com/microsoft/TypeScript/blob/c117c266e09c80e8a06b24a6e94b9d018f5fae6b/src/compiler/commandLineParser.ts#L2041\n export interface ConvertToTSConfigHost {\n getCurrentDirectory(): string;\n useCaseSensitiveFileNames: boolean;\n }\n // Note: is only a partial declaration, TS sources declare other fields\n export interface SourceFileImportsList {\n impliedNodeFormat?: TSCommon.SourceFile['impliedNodeFormat'];\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/ts-internals.d.ts b/node_modules/ts-node/dist/ts-internals.d.ts deleted file mode 100644 index d5903d6..0000000 --- a/node_modules/ts-node/dist/ts-internals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type * as _ts from 'typescript'; -export declare function getUseDefineForClassFields(compilerOptions: _ts.CompilerOptions): boolean; -export declare function getEmitScriptTarget(compilerOptions: { - module?: _ts.CompilerOptions['module']; - target?: _ts.CompilerOptions['target']; -}): _ts.ScriptTarget; diff --git a/node_modules/ts-node/dist/ts-internals.js b/node_modules/ts-node/dist/ts-internals.js deleted file mode 100644 index 9cd1611..0000000 --- a/node_modules/ts-node/dist/ts-internals.js +++ /dev/null @@ -1,321 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getEmitScriptTarget = exports.getUseDefineForClassFields = exports.getPatternFromSpec = exports.createTsInternals = void 0; -const path_1 = require("path"); -const util_1 = require("./util"); -/** @internal */ -exports.createTsInternals = (0, util_1.cachedLookup)(createTsInternalsUncached); -/** - * Given a reference to the TS compiler, return some TS internal functions that we - * could not or did not want to grab off the `ts` object. - * These have been copy-pasted from TS's source and tweaked as necessary. - * - * NOTE: This factory returns *only* functions which need a reference to the TS - * compiler. Other functions do not need a reference to the TS compiler so are - * exported directly from this file. - */ -function createTsInternalsUncached(_ts) { - const ts = _ts; - /** - * Copied from: - * https://github.com/microsoft/TypeScript/blob/v4.3.2/src/compiler/commandLineParser.ts#L2821-L2846 - */ - function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { - extendedConfig = (0, util_1.normalizeSlashes)(extendedConfig); - if (isRootedDiskPath(extendedConfig) || - startsWith(extendedConfig, './') || - startsWith(extendedConfig, '../')) { - let extendedConfigPath = getNormalizedAbsolutePath(extendedConfig, basePath); - if (!host.fileExists(extendedConfigPath) && - !endsWith(extendedConfigPath, ts.Extension.Json)) { - extendedConfigPath = `${extendedConfigPath}.json`; - if (!host.fileExists(extendedConfigPath)) { - errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); - return undefined; - } - } - return extendedConfigPath; - } - // If the path isn't a rooted or relative path, resolve like a module - const tsGte5_3_0 = (0, util_1.versionGteLt)(ts.version, '5.3.0'); - const resolved = ts.nodeModuleNameResolver(extendedConfig, combinePaths(basePath, 'tsconfig.json'), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, - /*cache*/ undefined, - /*projectRefs*/ undefined, - /*conditionsOrIsConfigLookup*/ tsGte5_3_0 ? undefined : true, - /*isConfigLookup*/ tsGte5_3_0 ? true : undefined); - if (resolved.resolvedModule) { - return resolved.resolvedModule.resolvedFileName; - } - errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); - return undefined; - } - return { getExtendsConfigPath }; -} -// These functions have alternative implementation to avoid copying too much from TS -function isRootedDiskPath(path) { - return (0, path_1.isAbsolute)(path); -} -function combinePaths(path, ...paths) { - return (0, util_1.normalizeSlashes)((0, path_1.resolve)(path, ...paths.filter((path) => path))); -} -function getNormalizedAbsolutePath(fileName, currentDirectory) { - return (0, util_1.normalizeSlashes)(currentDirectory != null - ? (0, path_1.resolve)(currentDirectory, fileName) - : (0, path_1.resolve)(fileName)); -} -function startsWith(str, prefix) { - return str.lastIndexOf(prefix, 0) === 0; -} -function endsWith(str, suffix) { - const expectedPos = str.length - suffix.length; - return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos; -} -// Reserved characters, forces escaping of any non-word (or digit), non-whitespace character. -// It may be inefficient (we could just match (/[-[\]{}()*+?.,\\^$|#\s]/g), but this is future -// proof. -const reservedCharacterPattern = /[^\w\s\/]/g; -/** - * @internal - * See also: getRegularExpressionForWildcard, which seems to do almost the same thing - */ -function getPatternFromSpec(spec, basePath) { - const pattern = spec && getSubPatternFromSpec(spec, basePath, excludeMatcher); - return pattern && `^(${pattern})${'($|/)'}`; -} -exports.getPatternFromSpec = getPatternFromSpec; -function getSubPatternFromSpec(spec, basePath, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter, }) { - let subpattern = ''; - let hasWrittenComponent = false; - const components = getNormalizedPathComponents(spec, basePath); - const lastComponent = last(components); - // getNormalizedPathComponents includes the separator for the root component. - // We need to remove to create our regex correctly. - components[0] = removeTrailingDirectorySeparator(components[0]); - if (isImplicitGlob(lastComponent)) { - components.push('**', '*'); - } - let optionalCount = 0; - for (let component of components) { - if (component === '**') { - subpattern += doubleAsteriskRegexFragment; - } - else { - if (hasWrittenComponent) { - subpattern += directorySeparator; - } - subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); - } - hasWrittenComponent = true; - } - while (optionalCount > 0) { - subpattern += ')?'; - optionalCount--; - } - return subpattern; -} -const directoriesMatcher = { - singleAsteriskRegexFragment: '[^/]*', - /** - * Regex for the ** wildcard. Matches any num of subdirectories. When used for including - * files or directories, does not match subdirectories that start with a . character - */ - doubleAsteriskRegexFragment: `(/[^/.][^/]*)*?`, - replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment), -}; -const excludeMatcher = { - singleAsteriskRegexFragment: '[^/]*', - doubleAsteriskRegexFragment: '(/.+?)?', - replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment), -}; -function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); -} -function getPathComponents(path, currentDirectory = '') { - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); -} -function reducePathComponents(components) { - if (!some(components)) - return []; - const reduced = [components[0]]; - for (let i = 1; i < components.length; i++) { - const component = components[i]; - if (!component) - continue; - if (component === '.') - continue; - if (component === '..') { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== '..') { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; -} -function getRootLength(path) { - const rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; -} -function getEncodedRootLength(path) { - if (!path) - return 0; - const ch0 = path.charCodeAt(0); - // POSIX or UNC - if (ch0 === 47 /* CharacterCodes.slash */ || ch0 === 92 /* CharacterCodes.backslash */) { - if (path.charCodeAt(1) !== ch0) - return 1; // POSIX: "/" (or non-normalized "\") - const p1 = path.indexOf(ch0 === 47 /* CharacterCodes.slash */ ? directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; // UNC: "//server" or "\\server" - return p1 + 1; // UNC: "//server/" or "\\server\" - } - // DOS - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* CharacterCodes.colon */) { - const ch2 = path.charCodeAt(2); - if (ch2 === 47 /* CharacterCodes.slash */ || ch2 === 92 /* CharacterCodes.backslash */) - return 3; // DOS: "c:/" or "c:\" - if (path.length === 2) - return 2; // DOS: "c:" (but not "c:d") - } - // URL - const schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - const authorityStart = schemeEnd + urlSchemeSeparator.length; - const authorityEnd = path.indexOf(directorySeparator, authorityStart); - if (authorityEnd !== -1) { - // URL: "file:///", "file://server/", "file://server/path" - // For local "file" URLs, include the leading DOS volume (if present). - // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a - // special case interpreted as "the machine from which the URL is being interpreted". - const scheme = path.slice(0, schemeEnd); - const authority = path.slice(authorityStart, authorityEnd); - if (scheme === 'file' && - (authority === '' || authority === 'localhost') && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* CharacterCodes.slash */) { - // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" - // but not "file:///c:d" or "file:///c%3ad" - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" - } - return ~path.length; // URL: "file://server", "http://server" - } - // relative - return 0; -} -function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + directorySeparator; - } - return path; -} -function hasTrailingDirectorySeparator(path) { - return (path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1))); -} -function isAnyDirectorySeparator(charCode) { - return (charCode === 47 /* CharacterCodes.slash */ || charCode === 92 /* CharacterCodes.backslash */); -} -function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; -} -const directorySeparator = '/'; -const altDirectorySeparator = '\\'; -const urlSchemeSeparator = '://'; -function isVolumeCharacter(charCode) { - return ((charCode >= 97 /* CharacterCodes.a */ && charCode <= 122 /* CharacterCodes.z */) || - (charCode >= 65 /* CharacterCodes.A */ && charCode <= 90 /* CharacterCodes.Z */)); -} -function getFileUrlVolumeSeparatorEnd(url, start) { - const ch0 = url.charCodeAt(start); - if (ch0 === 58 /* CharacterCodes.colon */) - return start + 1; - if (ch0 === 37 /* CharacterCodes.percent */ && - url.charCodeAt(start + 1) === 51 /* CharacterCodes._3 */) { - const ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* CharacterCodes.a */ || ch2 === 65 /* CharacterCodes.A */) - return start + 3; - } - return -1; -} -function some(array, predicate) { - if (array) { - if (predicate) { - for (const v of array) { - if (predicate(v)) { - return true; - } - } - } - else { - return array.length > 0; - } - } - return false; -} -function pathComponents(path, rootLength) { - const root = path.substring(0, rootLength); - const rest = path.substring(rootLength).split(directorySeparator); - if (rest.length && !lastOrUndefined(rest)) - rest.pop(); - return [root, ...rest]; -} -function lastOrUndefined(array) { - return array.length === 0 ? undefined : array[array.length - 1]; -} -function last(array) { - // Debug.assert(array.length !== 0); - return array[array.length - 1]; -} -function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { - return match === '*' - ? singleAsteriskRegexFragment - : match === '?' - ? '[^/]' - : '\\' + match; -} -/** - * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, - * and does not contain any glob characters itself. - */ -function isImplicitGlob(lastPathComponent) { - return !/[.*?]/.test(lastPathComponent); -} -const ts_ScriptTarget_ES5 = 1; -const ts_ScriptTarget_ES2022 = 9; -const ts_ScriptTarget_ESNext = 99; -const ts_ModuleKind_Node16 = 100; -const ts_ModuleKind_NodeNext = 199; -// https://github.com/microsoft/TypeScript/blob/fc418a2e611c88cf9afa0115ff73490b2397d311/src/compiler/utilities.ts#L8761 -function getUseDefineForClassFields(compilerOptions) { - return compilerOptions.useDefineForClassFields === undefined - ? getEmitScriptTarget(compilerOptions) >= ts_ScriptTarget_ES2022 - : compilerOptions.useDefineForClassFields; -} -exports.getUseDefineForClassFields = getUseDefineForClassFields; -// https://github.com/microsoft/TypeScript/blob/fc418a2e611c88cf9afa0115ff73490b2397d311/src/compiler/utilities.ts#L8556 -function getEmitScriptTarget(compilerOptions) { - var _a; - return ((_a = compilerOptions.target) !== null && _a !== void 0 ? _a : ((compilerOptions.module === ts_ModuleKind_Node16 && ts_ScriptTarget_ES2022) || - (compilerOptions.module === ts_ModuleKind_NodeNext && ts_ScriptTarget_ESNext) || - ts_ScriptTarget_ES5)); -} -exports.getEmitScriptTarget = getEmitScriptTarget; -//# sourceMappingURL=ts-internals.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/ts-internals.js.map b/node_modules/ts-node/dist/ts-internals.js.map deleted file mode 100644 index 5a4d2d8..0000000 --- a/node_modules/ts-node/dist/ts-internals.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ts-internals.js","sourceRoot":"","sources":["../src/ts-internals.ts"],"names":[],"mappings":";;;AAAA,+BAA2C;AAC3C,iCAAsE;AAItE,gBAAgB;AACH,QAAA,iBAAiB,GAAG,IAAA,mBAAY,EAAC,yBAAyB,CAAC,CAAC;AACzE;;;;;;;;GAQG;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CAAC,MAAM,mCACtB,CAAC,CAAC,eAAe,CAAC,MAAM,KAAK,oBAAoB,IAAI,sBAAsB,CAAC;QAC1E,CAAC,eAAe,CAAC,MAAM,KAAK,sBAAsB,IAAI,sBAAsB,CAAC;QAC7E,mBAAmB,CAAC,CACvB,CAAC;AACJ,CAAC;AAVD,kDAUC","sourcesContent":["import { isAbsolute, resolve } from 'path';\nimport { cachedLookup, normalizeSlashes, versionGteLt } from './util';\nimport type * as _ts from 'typescript';\nimport type { TSCommon, TSInternal } from './ts-compiler-types';\n\n/** @internal */\nexport const createTsInternals = cachedLookup(createTsInternalsUncached);\n/**\n * Given a reference to the TS compiler, return some TS internal functions that we\n * could not or did not want to grab off the `ts` object.\n * These have been copy-pasted from TS's source and tweaked as necessary.\n *\n * NOTE: This factory returns *only* functions which need a reference to the TS\n * compiler. Other functions do not need a reference to the TS compiler so are\n * exported directly from this file.\n */\nfunction createTsInternalsUncached(_ts: TSCommon) {\n const ts = _ts as TSCommon & TSInternal;\n /**\n * Copied from:\n * https://github.com/microsoft/TypeScript/blob/v4.3.2/src/compiler/commandLineParser.ts#L2821-L2846\n */\n function getExtendsConfigPath(\n extendedConfig: string,\n host: _ts.ParseConfigHost,\n basePath: string,\n errors: _ts.Push<_ts.Diagnostic>,\n createDiagnostic: (\n message: _ts.DiagnosticMessage,\n arg1?: string\n ) => _ts.Diagnostic\n ) {\n extendedConfig = normalizeSlashes(extendedConfig);\n if (\n isRootedDiskPath(extendedConfig) ||\n startsWith(extendedConfig, './') ||\n startsWith(extendedConfig, '../')\n ) {\n let extendedConfigPath = getNormalizedAbsolutePath(\n extendedConfig,\n basePath\n );\n if (\n !host.fileExists(extendedConfigPath) &&\n !endsWith(extendedConfigPath, ts.Extension.Json)\n ) {\n extendedConfigPath = `${extendedConfigPath}.json`;\n if (!host.fileExists(extendedConfigPath)) {\n errors.push(\n createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)\n );\n return undefined;\n }\n }\n return extendedConfigPath;\n }\n // If the path isn't a rooted or relative path, resolve like a module\n const tsGte5_3_0 = versionGteLt(ts.version, '5.3.0');\n const resolved = ts.nodeModuleNameResolver(\n extendedConfig,\n combinePaths(basePath, 'tsconfig.json'),\n { moduleResolution: ts.ModuleResolutionKind.NodeJs },\n host,\n /*cache*/ undefined,\n /*projectRefs*/ undefined,\n /*conditionsOrIsConfigLookup*/ tsGte5_3_0 ? undefined : true,\n /*isConfigLookup*/ tsGte5_3_0 ? true : undefined\n );\n if (resolved.resolvedModule) {\n return resolved.resolvedModule.resolvedFileName;\n }\n errors.push(\n createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)\n );\n return undefined;\n }\n\n return { getExtendsConfigPath };\n}\n\n// These functions have alternative implementation to avoid copying too much from TS\nfunction isRootedDiskPath(path: string) {\n return isAbsolute(path);\n}\nfunction combinePaths(path: string, ...paths: (string | undefined)[]): string {\n return normalizeSlashes(\n resolve(path, ...(paths.filter((path) => path) as string[]))\n );\n}\nfunction getNormalizedAbsolutePath(\n fileName: string,\n currentDirectory: string | undefined\n) {\n return normalizeSlashes(\n currentDirectory != null\n ? resolve(currentDirectory!, fileName)\n : resolve(fileName)\n );\n}\n\nfunction startsWith(str: string, prefix: string): boolean {\n return str.lastIndexOf(prefix, 0) === 0;\n}\n\nfunction endsWith(str: string, suffix: string): boolean {\n const expectedPos = str.length - suffix.length;\n return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;\n}\n// Reserved characters, forces escaping of any non-word (or digit), non-whitespace character.\n// It may be inefficient (we could just match (/[-[\\]{}()*+?.,\\\\^$|#\\s]/g), but this is future\n// proof.\nconst reservedCharacterPattern = /[^\\w\\s\\/]/g;\n\n/**\n * @internal\n * See also: getRegularExpressionForWildcard, which seems to do almost the same thing\n */\nexport function getPatternFromSpec(spec: string, basePath: string) {\n const pattern = spec && getSubPatternFromSpec(spec, basePath, excludeMatcher);\n return pattern && `^(${pattern})${'($|/)'}`;\n}\nfunction getSubPatternFromSpec(\n spec: string,\n basePath: string,\n {\n singleAsteriskRegexFragment,\n doubleAsteriskRegexFragment,\n replaceWildcardCharacter,\n }: WildcardMatcher\n): string {\n let subpattern = '';\n let hasWrittenComponent = false;\n const components = getNormalizedPathComponents(spec, basePath);\n const lastComponent = last(components);\n\n // getNormalizedPathComponents includes the separator for the root component.\n // We need to remove to create our regex correctly.\n components[0] = removeTrailingDirectorySeparator(components[0]);\n\n if (isImplicitGlob(lastComponent)) {\n components.push('**', '*');\n }\n\n let optionalCount = 0;\n for (let component of components) {\n if (component === '**') {\n subpattern += doubleAsteriskRegexFragment;\n } else {\n if (hasWrittenComponent) {\n subpattern += directorySeparator;\n }\n subpattern += component.replace(\n reservedCharacterPattern,\n replaceWildcardCharacter\n );\n }\n\n hasWrittenComponent = true;\n }\n\n while (optionalCount > 0) {\n subpattern += ')?';\n optionalCount--;\n }\n\n return subpattern;\n}\ninterface WildcardMatcher {\n singleAsteriskRegexFragment: string;\n doubleAsteriskRegexFragment: string;\n replaceWildcardCharacter: (match: string) => string;\n}\nconst directoriesMatcher: WildcardMatcher = {\n singleAsteriskRegexFragment: '[^/]*',\n /**\n * Regex for the ** wildcard. Matches any num of subdirectories. When used for including\n * files or directories, does not match subdirectories that start with a . character\n */\n doubleAsteriskRegexFragment: `(/[^/.][^/]*)*?`,\n replaceWildcardCharacter: (match) =>\n replaceWildcardCharacter(\n match,\n directoriesMatcher.singleAsteriskRegexFragment\n ),\n};\nconst excludeMatcher: WildcardMatcher = {\n singleAsteriskRegexFragment: '[^/]*',\n doubleAsteriskRegexFragment: '(/.+?)?',\n replaceWildcardCharacter: (match) =>\n replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment),\n};\nfunction getNormalizedPathComponents(\n path: string,\n currentDirectory: string | undefined\n) {\n return reducePathComponents(getPathComponents(path, currentDirectory));\n}\nfunction getPathComponents(path: string, currentDirectory = '') {\n path = combinePaths(currentDirectory, path);\n return pathComponents(path, getRootLength(path));\n}\nfunction reducePathComponents(components: readonly string[]) {\n if (!some(components)) return [];\n const reduced = [components[0]];\n for (let i = 1; i < components.length; i++) {\n const component = components[i];\n if (!component) continue;\n if (component === '.') continue;\n if (component === '..') {\n if (reduced.length > 1) {\n if (reduced[reduced.length - 1] !== '..') {\n reduced.pop();\n continue;\n }\n } else if (reduced[0]) continue;\n }\n reduced.push(component);\n }\n return reduced;\n}\nfunction getRootLength(path: string) {\n const rootLength = getEncodedRootLength(path);\n return rootLength < 0 ? ~rootLength : rootLength;\n}\nfunction getEncodedRootLength(path: string): number {\n if (!path) return 0;\n const ch0 = path.charCodeAt(0);\n\n // POSIX or UNC\n if (ch0 === CharacterCodes.slash || ch0 === CharacterCodes.backslash) {\n if (path.charCodeAt(1) !== ch0) return 1; // POSIX: \"/\" (or non-normalized \"\\\")\n\n const p1 = path.indexOf(\n ch0 === CharacterCodes.slash ? directorySeparator : altDirectorySeparator,\n 2\n );\n if (p1 < 0) return path.length; // UNC: \"//server\" or \"\\\\server\"\n\n return p1 + 1; // UNC: \"//server/\" or \"\\\\server\\\"\n }\n\n // DOS\n if (isVolumeCharacter(ch0) && path.charCodeAt(1) === CharacterCodes.colon) {\n const ch2 = path.charCodeAt(2);\n if (ch2 === CharacterCodes.slash || ch2 === CharacterCodes.backslash)\n return 3; // DOS: \"c:/\" or \"c:\\\"\n if (path.length === 2) return 2; // DOS: \"c:\" (but not \"c:d\")\n }\n\n // URL\n const schemeEnd = path.indexOf(urlSchemeSeparator);\n if (schemeEnd !== -1) {\n const authorityStart = schemeEnd + urlSchemeSeparator.length;\n const authorityEnd = path.indexOf(directorySeparator, authorityStart);\n if (authorityEnd !== -1) {\n // URL: \"file:///\", \"file://server/\", \"file://server/path\"\n // For local \"file\" URLs, include the leading DOS volume (if present).\n // Per https://www.ietf.org/rfc/rfc1738.txt, a host of \"\" or \"localhost\" is a\n // special case interpreted as \"the machine from which the URL is being interpreted\".\n const scheme = path.slice(0, schemeEnd);\n const authority = path.slice(authorityStart, authorityEnd);\n if (\n scheme === 'file' &&\n (authority === '' || authority === 'localhost') &&\n isVolumeCharacter(path.charCodeAt(authorityEnd + 1))\n ) {\n const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(\n path,\n authorityEnd + 2\n );\n if (volumeSeparatorEnd !== -1) {\n if (path.charCodeAt(volumeSeparatorEnd) === CharacterCodes.slash) {\n // URL: \"file:///c:/\", \"file://localhost/c:/\", \"file:///c%3a/\", \"file://localhost/c%3a/\"\n return ~(volumeSeparatorEnd + 1);\n }\n if (volumeSeparatorEnd === path.length) {\n // URL: \"file:///c:\", \"file://localhost/c:\", \"file:///c$3a\", \"file://localhost/c%3a\"\n // but not \"file:///c:d\" or \"file:///c%3ad\"\n return ~volumeSeparatorEnd;\n }\n }\n }\n return ~(authorityEnd + 1); // URL: \"file://server/\", \"http://server/\"\n }\n return ~path.length; // URL: \"file://server\", \"http://server\"\n }\n\n // relative\n return 0;\n}\nfunction ensureTrailingDirectorySeparator(path: string) {\n if (!hasTrailingDirectorySeparator(path)) {\n return path + directorySeparator;\n }\n\n return path;\n}\nfunction hasTrailingDirectorySeparator(path: string) {\n return (\n path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1))\n );\n}\nfunction isAnyDirectorySeparator(charCode: number): boolean {\n return (\n charCode === CharacterCodes.slash || charCode === CharacterCodes.backslash\n );\n}\nfunction removeTrailingDirectorySeparator(path: string) {\n if (hasTrailingDirectorySeparator(path)) {\n return path.substr(0, path.length - 1);\n }\n\n return path;\n}\nconst directorySeparator = '/';\nconst altDirectorySeparator = '\\\\';\nconst urlSchemeSeparator = '://';\nfunction isVolumeCharacter(charCode: number) {\n return (\n (charCode >= CharacterCodes.a && charCode <= CharacterCodes.z) ||\n (charCode >= CharacterCodes.A && charCode <= CharacterCodes.Z)\n );\n}\nfunction getFileUrlVolumeSeparatorEnd(url: string, start: number) {\n const ch0 = url.charCodeAt(start);\n if (ch0 === CharacterCodes.colon) return start + 1;\n if (\n ch0 === CharacterCodes.percent &&\n url.charCodeAt(start + 1) === CharacterCodes._3\n ) {\n const ch2 = url.charCodeAt(start + 2);\n if (ch2 === CharacterCodes.a || ch2 === CharacterCodes.A) return start + 3;\n }\n return -1;\n}\nfunction some(array: readonly T[] | undefined): array is readonly T[];\nfunction some(\n array: readonly T[] | undefined,\n predicate: (value: T) => boolean\n): boolean;\nfunction some(\n array: readonly T[] | undefined,\n predicate?: (value: T) => boolean\n): boolean {\n if (array) {\n if (predicate) {\n for (const v of array) {\n if (predicate(v)) {\n return true;\n }\n }\n } else {\n return array.length > 0;\n }\n }\n return false;\n}\n/* @internal */\nconst enum CharacterCodes {\n _3 = 0x33,\n a = 0x61,\n z = 0x7a,\n A = 0x41,\n Z = 0x5a,\n asterisk = 0x2a, // *\n backslash = 0x5c, // \\\n colon = 0x3a, // :\n percent = 0x25, // %\n question = 0x3f, // ?\n slash = 0x2f, // /\n}\nfunction pathComponents(path: string, rootLength: number) {\n const root = path.substring(0, rootLength);\n const rest = path.substring(rootLength).split(directorySeparator);\n if (rest.length && !lastOrUndefined(rest)) rest.pop();\n return [root, ...rest];\n}\nfunction lastOrUndefined(array: readonly T[]): T | undefined {\n return array.length === 0 ? undefined : array[array.length - 1];\n}\nfunction last(array: readonly T[]): T {\n // Debug.assert(array.length !== 0);\n return array[array.length - 1];\n}\nfunction replaceWildcardCharacter(\n match: string,\n singleAsteriskRegexFragment: string\n) {\n return match === '*'\n ? singleAsteriskRegexFragment\n : match === '?'\n ? '[^/]'\n : '\\\\' + match;\n}\n/**\n * An \"includes\" path \"foo\" is implicitly a glob \"foo/** /*\" (without the space) if its last component has no extension,\n * and does not contain any glob characters itself.\n */\nfunction isImplicitGlob(lastPathComponent: string): boolean {\n return !/[.*?]/.test(lastPathComponent);\n}\n\nconst ts_ScriptTarget_ES5 = 1;\nconst ts_ScriptTarget_ES2022 = 9;\nconst ts_ScriptTarget_ESNext = 99;\nconst ts_ModuleKind_Node16 = 100;\nconst ts_ModuleKind_NodeNext = 199;\n// https://github.com/microsoft/TypeScript/blob/fc418a2e611c88cf9afa0115ff73490b2397d311/src/compiler/utilities.ts#L8761\nexport function getUseDefineForClassFields(compilerOptions: _ts.CompilerOptions): boolean {\n return compilerOptions.useDefineForClassFields === undefined\n ? getEmitScriptTarget(compilerOptions) >= ts_ScriptTarget_ES2022\n : compilerOptions.useDefineForClassFields;\n}\n\n// https://github.com/microsoft/TypeScript/blob/fc418a2e611c88cf9afa0115ff73490b2397d311/src/compiler/utilities.ts#L8556\nexport function getEmitScriptTarget(compilerOptions: {\n module?: _ts.CompilerOptions['module'];\n target?: _ts.CompilerOptions['target'];\n}): _ts.ScriptTarget {\n return (\n compilerOptions.target ??\n ((compilerOptions.module === ts_ModuleKind_Node16 && ts_ScriptTarget_ES2022) ||\n (compilerOptions.module === ts_ModuleKind_NodeNext && ts_ScriptTarget_ESNext) ||\n ts_ScriptTarget_ES5)\n );\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/ts-transpile-module.d.ts b/node_modules/ts-node/dist/ts-transpile-module.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/ts-transpile-module.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/ts-transpile-module.js b/node_modules/ts-node/dist/ts-transpile-module.js deleted file mode 100644 index 5002855..0000000 --- a/node_modules/ts-node/dist/ts-transpile-module.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createTsTranspileModule = void 0; -/** @internal */ -function createTsTranspileModule(ts, transpileOptions) { - const { createProgram, createSourceFile, getDefaultCompilerOptions, getImpliedNodeFormatForFile, fixupCompilerOptions, transpileOptionValueCompilerOptions, getNewLineCharacter, fileExtensionIs, normalizePath, Debug, toPath, getSetExternalModuleIndicator, getEntries, addRange, hasProperty, getEmitScriptTarget, getDirectoryPath, } = ts; - const compilerOptionsDiagnostics = []; - const options = transpileOptions.compilerOptions - ? fixupCompilerOptions(transpileOptions.compilerOptions, compilerOptionsDiagnostics) - : {}; - // mix in default options - const defaultOptions = getDefaultCompilerOptions(); - for (const key in defaultOptions) { - if (hasProperty(defaultOptions, key) && options[key] === undefined) { - options[key] = defaultOptions[key]; - } - } - for (const option of transpileOptionValueCompilerOptions) { - options[option.name] = option.transpileOptionValue; - } - // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths. - options.suppressOutputPathCheck = true; - // Filename can be non-ts file. - options.allowNonTsExtensions = true; - const newLine = getNewLineCharacter(options); - // Create a compilerHost object to allow the compiler to read and write files - const compilerHost = { - getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : undefined, - writeFile: (name, text) => { - if (fileExtensionIs(name, '.map')) { - Debug.assertEqual(sourceMapText, undefined, 'Unexpected multiple source map outputs, file:', name); - sourceMapText = text; - } - else { - Debug.assertEqual(outputText, undefined, 'Unexpected multiple outputs, file:', name); - outputText = text; - } - }, - getDefaultLibFileName: () => 'lib.d.ts', - useCaseSensitiveFileNames: () => true, - getCanonicalFileName: (fileName) => fileName, - getCurrentDirectory: () => '', - getNewLine: () => newLine, - fileExists: (fileName) => fileName === inputFileName || fileName === packageJsonFileName, - readFile: (fileName) => fileName === packageJsonFileName ? `{"type": "${_packageJsonType}"}` : '', - directoryExists: () => true, - getDirectories: () => [], - }; - let inputFileName; - let packageJsonFileName; - let _packageJsonType; - let sourceFile; - let outputText; - let sourceMapText; - return transpileModule; - function transpileModule(input, transpileOptions2, packageJsonType = 'commonjs') { - // if jsx is specified then treat file as .tsx - inputFileName = - transpileOptions2.fileName || - (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx - ? 'module.tsx' - : 'module.ts'); - packageJsonFileName = getDirectoryPath(inputFileName) + '/package.json'; - _packageJsonType = packageJsonType; - sourceFile = createSourceFile(inputFileName, input, { - languageVersion: getEmitScriptTarget(options), - impliedNodeFormat: getImpliedNodeFormatForFile(toPath(inputFileName, '', compilerHost.getCanonicalFileName), - /*cache*/ undefined, compilerHost, options), - setExternalModuleIndicator: getSetExternalModuleIndicator(options), - }); - if (transpileOptions2.moduleName) { - sourceFile.moduleName = transpileOptions2.moduleName; - } - if (transpileOptions2.renamedDependencies) { - sourceFile.renamedDependencies = new Map(getEntries(transpileOptions2.renamedDependencies)); - } - // Output - outputText = undefined; - sourceMapText = undefined; - const program = createProgram([inputFileName], options, compilerHost); - const diagnostics = compilerOptionsDiagnostics.slice(); - if (transpileOptions.reportDiagnostics) { - addRange( - /*to*/ diagnostics, - /*from*/ program.getSyntacticDiagnostics(sourceFile)); - addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); - } - // Emit - program.emit( - /*targetSourceFile*/ undefined, - /*writeFile*/ undefined, - /*cancellationToken*/ undefined, - /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers); - if (outputText === undefined) - return Debug.fail('Output generation failed'); - return { outputText, diagnostics, sourceMapText }; - } -} -exports.createTsTranspileModule = createTsTranspileModule; -//# sourceMappingURL=ts-transpile-module.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/ts-transpile-module.js.map b/node_modules/ts-node/dist/ts-transpile-module.js.map deleted file mode 100644 index f2b69ad..0000000 --- a/node_modules/ts-node/dist/ts-transpile-module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ts-transpile-module.js","sourceRoot":"","sources":["../src/ts-transpile-module.ts"],"names":[],"mappings":";;;AAUA,gBAAgB;AAChB,SAAgB,uBAAuB,CACrC,EAAY,EACZ,gBAGC;IAED,MAAM,EACJ,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EACpB,mCAAmC,EACnC,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,KAAK,EACL,MAAM,EACN,6BAA6B,EAC7B,UAAU,EACV,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,gBAAgB,GACjB,GAAG,EAAS,CAAC;IAEd,MAAM,0BAA0B,GAAiB,EAAE,CAAC;IAEpD,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WAAW,EAAE,aAAa,EAAE,CAAC;IACpD,CAAC;AACH,CAAC;AArKD,0DAqKC","sourcesContent":["import type {\n CompilerHost,\n CompilerOptions,\n Diagnostic,\n SourceFile,\n TranspileOptions,\n TranspileOutput,\n} from 'typescript';\nimport type { TSCommon } from './ts-compiler-types';\n\n/** @internal */\nexport function createTsTranspileModule(\n ts: TSCommon,\n transpileOptions: Pick<\n TranspileOptions,\n 'compilerOptions' | 'reportDiagnostics' | 'transformers'\n >\n) {\n const {\n createProgram,\n createSourceFile,\n getDefaultCompilerOptions,\n getImpliedNodeFormatForFile,\n fixupCompilerOptions,\n transpileOptionValueCompilerOptions,\n getNewLineCharacter,\n fileExtensionIs,\n normalizePath,\n Debug,\n toPath,\n getSetExternalModuleIndicator,\n getEntries,\n addRange,\n hasProperty,\n getEmitScriptTarget,\n getDirectoryPath,\n } = ts as any;\n\n const compilerOptionsDiagnostics: Diagnostic[] = [];\n\n const options: CompilerOptions = transpileOptions.compilerOptions\n ? fixupCompilerOptions(\n transpileOptions.compilerOptions,\n compilerOptionsDiagnostics\n )\n : {};\n\n // mix in default options\n const defaultOptions = getDefaultCompilerOptions();\n for (const key in defaultOptions) {\n if (hasProperty(defaultOptions, key) && options[key] === undefined) {\n options[key] = defaultOptions[key];\n }\n }\n\n for (const option of transpileOptionValueCompilerOptions) {\n options[option.name] = option.transpileOptionValue;\n }\n\n // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths.\n options.suppressOutputPathCheck = true;\n\n // Filename can be non-ts file.\n options.allowNonTsExtensions = true;\n\n const newLine = getNewLineCharacter(options);\n // Create a compilerHost object to allow the compiler to read and write files\n const compilerHost: CompilerHost = {\n getSourceFile: (fileName) =>\n fileName === normalizePath(inputFileName) ? sourceFile : undefined,\n writeFile: (name, text) => {\n if (fileExtensionIs(name, '.map')) {\n Debug.assertEqual(\n sourceMapText,\n undefined,\n 'Unexpected multiple source map outputs, file:',\n name\n );\n sourceMapText = text;\n } else {\n Debug.assertEqual(\n outputText,\n undefined,\n 'Unexpected multiple outputs, file:',\n name\n );\n outputText = text;\n }\n },\n getDefaultLibFileName: () => 'lib.d.ts',\n useCaseSensitiveFileNames: () => true,\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: () => '',\n getNewLine: () => newLine,\n fileExists: (fileName): boolean =>\n fileName === inputFileName || fileName === packageJsonFileName,\n readFile: (fileName) =>\n fileName === packageJsonFileName ? `{\"type\": \"${_packageJsonType}\"}` : '',\n directoryExists: () => true,\n getDirectories: () => [],\n };\n\n let inputFileName: string;\n let packageJsonFileName: string;\n let _packageJsonType: 'module' | 'commonjs';\n let sourceFile: SourceFile;\n let outputText: string | undefined;\n let sourceMapText: string | undefined;\n\n return transpileModule;\n\n function transpileModule(\n input: string,\n transpileOptions2: Pick<\n TranspileOptions,\n 'fileName' | 'moduleName' | 'renamedDependencies'\n >,\n packageJsonType: 'module' | 'commonjs' = 'commonjs'\n ): TranspileOutput {\n // if jsx is specified then treat file as .tsx\n inputFileName =\n transpileOptions2.fileName ||\n (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx\n ? 'module.tsx'\n : 'module.ts');\n packageJsonFileName = getDirectoryPath(inputFileName) + '/package.json';\n _packageJsonType = packageJsonType;\n\n sourceFile = createSourceFile(inputFileName, input, {\n languageVersion: getEmitScriptTarget(options),\n impliedNodeFormat: getImpliedNodeFormatForFile(\n toPath(inputFileName, '', compilerHost.getCanonicalFileName),\n /*cache*/ undefined,\n compilerHost,\n options\n ),\n setExternalModuleIndicator: getSetExternalModuleIndicator(options),\n });\n if (transpileOptions2.moduleName) {\n sourceFile.moduleName = transpileOptions2.moduleName;\n }\n\n if (transpileOptions2.renamedDependencies) {\n (sourceFile as any).renamedDependencies = new Map(\n getEntries(transpileOptions2.renamedDependencies)\n );\n }\n\n // Output\n outputText = undefined;\n sourceMapText = undefined;\n\n const program = createProgram([inputFileName], options, compilerHost);\n\n const diagnostics = compilerOptionsDiagnostics.slice();\n\n if (transpileOptions.reportDiagnostics) {\n addRange(\n /*to*/ diagnostics,\n /*from*/ program.getSyntacticDiagnostics(sourceFile)\n );\n addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics());\n }\n // Emit\n program.emit(\n /*targetSourceFile*/ undefined,\n /*writeFile*/ undefined,\n /*cancellationToken*/ undefined,\n /*emitOnlyDtsFiles*/ undefined,\n transpileOptions.transformers\n );\n\n if (outputText === undefined) return Debug.fail('Output generation failed');\n\n return { outputText, diagnostics, sourceMapText };\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/tsconfig-schema.d.ts b/node_modules/ts-node/dist/tsconfig-schema.d.ts deleted file mode 100644 index a13c6e9..0000000 --- a/node_modules/ts-node/dist/tsconfig-schema.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { TsConfigOptions } from './index'; -/** - * tsconfig schema which includes "ts-node" options. - * @allOf [{"$ref": "https://schemastore.azurewebsites.net/schemas/json/tsconfig.json"}] - */ -export interface TsConfigSchema { - /** - * ts-node options. See also: https://typestrong.org/ts-node/docs/configuration - * - * ts-node offers TypeScript execution and REPL for node.js, with source map support. - */ - 'ts-node': TsConfigOptions; -} diff --git a/node_modules/ts-node/dist/tsconfig-schema.js b/node_modules/ts-node/dist/tsconfig-schema.js deleted file mode 100644 index 945d414..0000000 --- a/node_modules/ts-node/dist/tsconfig-schema.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=tsconfig-schema.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/tsconfig-schema.js.map b/node_modules/ts-node/dist/tsconfig-schema.js.map deleted file mode 100644 index 0c786f0..0000000 --- a/node_modules/ts-node/dist/tsconfig-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tsconfig-schema.js","sourceRoot":"","sources":["../src/tsconfig-schema.ts"],"names":[],"mappings":"","sourcesContent":["import type { TsConfigOptions } from './index';\n\n/*\n * This interface exists solely for generating a JSON schema for tsconfig.json.\n * We do *not* extend the compiler's tsconfig interface. Instead we handle that\n * on a schema level, via \"allOf\", so we pull in the same schema that VSCode\n * already uses.\n */\n/**\n * tsconfig schema which includes \"ts-node\" options.\n * @allOf [{\"$ref\": \"https://schemastore.azurewebsites.net/schemas/json/tsconfig.json\"}]\n */\nexport interface TsConfigSchema {\n /**\n * ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n *\n * ts-node offers TypeScript execution and REPL for node.js, with source map support.\n */\n 'ts-node': TsConfigOptions;\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/tsconfigs.d.ts b/node_modules/ts-node/dist/tsconfigs.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/ts-node/dist/tsconfigs.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/ts-node/dist/tsconfigs.js b/node_modules/ts-node/dist/tsconfigs.js deleted file mode 100644 index 08d61b1..0000000 --- a/node_modules/ts-node/dist/tsconfigs.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getDefaultTsconfigJsonForNodeVersion = void 0; -const nodeMajor = parseInt(process.versions.node.split('.')[0], 10); -/** - * return parsed JSON of the bundled @tsconfig/bases config appropriate for the - * running version of nodejs - * @internal - */ -function getDefaultTsconfigJsonForNodeVersion(ts) { - const tsInternal = ts; - if (nodeMajor >= 16) { - const config = require('@tsconfig/node16/tsconfig.json'); - if (configCompatible(config)) - return config; - } - if (nodeMajor >= 14) { - const config = require('@tsconfig/node14/tsconfig.json'); - if (configCompatible(config)) - return config; - } - if (nodeMajor >= 12) { - const config = require('@tsconfig/node12/tsconfig.json'); - if (configCompatible(config)) - return config; - } - return require('@tsconfig/node10/tsconfig.json'); - // Verify that tsconfig target and lib options are compatible with TypeScript compiler - function configCompatible(config) { - return (typeof ts.ScriptTarget[config.compilerOptions.target.toUpperCase()] === 'number' && - tsInternal.libs && - config.compilerOptions.lib.every((lib) => tsInternal.libs.includes(lib))); - } -} -exports.getDefaultTsconfigJsonForNodeVersion = getDefaultTsconfigJsonForNodeVersion; -//# sourceMappingURL=tsconfigs.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/tsconfigs.js.map b/node_modules/ts-node/dist/tsconfigs.js.map deleted file mode 100644 index add3514..0000000 --- a/node_modules/ts-node/dist/tsconfigs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tsconfigs.js","sourceRoot":"","sources":["../src/tsconfigs.ts"],"names":[],"mappings":";;;AAEA,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpE;;;;GAIG;AACH,SAAgB,oCAAoC,CAAC,EAAY;IAC/D,MAAM,UAAU,GAAG,EAAuB,CAAC;IAC3C,IAAI,SAAS,IAAI,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;QACzD,IAAI,gBAAgB,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;KAC7C;IACD,IAAI,SAAS,IAAI,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;QACzD,IAAI,gBAAgB,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;KAC7C;IACD,IAAI,SAAS,IAAI,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;QACzD,IAAI,gBAAgB,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;KAC7C;IACD,OAAO,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAEjD,sFAAsF;IACtF,SAAS,gBAAgB,CAAC,MAKzB;QACC,OAAO,CACL,OAAQ,EAAE,CAAC,YAAoB,CAC7B,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,EAAE,CAC5C,KAAK,QAAQ;YACd,UAAU,CAAC,IAAI;YACf,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,IAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAC1E,CAAC;IACJ,CAAC;AACH,CAAC;AA/BD,oFA+BC","sourcesContent":["import type { TSCommon, TSInternal } from './ts-compiler-types';\n\nconst nodeMajor = parseInt(process.versions.node.split('.')[0], 10);\n/**\n * return parsed JSON of the bundled @tsconfig/bases config appropriate for the\n * running version of nodejs\n * @internal\n */\nexport function getDefaultTsconfigJsonForNodeVersion(ts: TSCommon): any {\n const tsInternal = ts as any as TSInternal;\n if (nodeMajor >= 16) {\n const config = require('@tsconfig/node16/tsconfig.json');\n if (configCompatible(config)) return config;\n }\n if (nodeMajor >= 14) {\n const config = require('@tsconfig/node14/tsconfig.json');\n if (configCompatible(config)) return config;\n }\n if (nodeMajor >= 12) {\n const config = require('@tsconfig/node12/tsconfig.json');\n if (configCompatible(config)) return config;\n }\n return require('@tsconfig/node10/tsconfig.json');\n\n // Verify that tsconfig target and lib options are compatible with TypeScript compiler\n function configCompatible(config: {\n compilerOptions: {\n lib: string[];\n target: string;\n };\n }) {\n return (\n typeof (ts.ScriptTarget as any)[\n config.compilerOptions.target.toUpperCase()\n ] === 'number' &&\n tsInternal.libs &&\n config.compilerOptions.lib.every((lib) => tsInternal.libs!.includes(lib))\n );\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/dist/util.d.ts b/node_modules/ts-node/dist/util.d.ts deleted file mode 100644 index 0e07d4b..0000000 --- a/node_modules/ts-node/dist/util.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Cached fs operation wrapper. - */ -export declare function cachedLookup(fn: (arg: T) => R): (arg: T) => R; diff --git a/node_modules/ts-node/dist/util.js b/node_modules/ts-node/dist/util.js deleted file mode 100644 index fcce901..0000000 --- a/node_modules/ts-node/dist/util.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; -var _a; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.versionGteLt = exports.once = exports.getBasePathForProjectLocalDependencyResolution = exports.createProjectLocalResolveHelper = exports.attemptRequireWithV8CompileCache = exports.cachedLookup = exports.hasOwnProperty = exports.normalizeSlashes = exports.parse = exports.split = exports.assign = exports.yn = exports.createRequire = void 0; -const module_1 = require("module"); -const ynModule = require("yn"); -const path_1 = require("path"); -/** @internal */ -exports.createRequire = (_a = module_1.createRequire !== null && module_1.createRequire !== void 0 ? module_1.createRequire : module_1.createRequireFromPath) !== null && _a !== void 0 ? _a : require('create-require'); -/** - * Wrapper around yn module that returns `undefined` instead of `null`. - * This is implemented by yn v4, but we're staying on v3 to avoid v4's node 10 requirement. - * @internal - */ -function yn(value) { - var _a; - return (_a = ynModule(value)) !== null && _a !== void 0 ? _a : undefined; -} -exports.yn = yn; -/** - * Like `Object.assign`, but ignores `undefined` properties. - * - * @internal - */ -function assign(initialValue, ...sources) { - for (const source of sources) { - for (const key of Object.keys(source)) { - const value = source[key]; - if (value !== undefined) - initialValue[key] = value; - } - } - return initialValue; -} -exports.assign = assign; -/** - * Split a string array of values - * and remove empty strings from the resulting array. - * @internal - */ -function split(value) { - return typeof value === 'string' - ? value.split(/ *, */g).filter((v) => v !== '') - : undefined; -} -exports.split = split; -/** - * Parse a string as JSON. - * @internal - */ -function parse(value) { - return typeof value === 'string' ? JSON.parse(value) : undefined; -} -exports.parse = parse; -const directorySeparator = '/'; -const backslashRegExp = /\\/g; -/** - * Replace backslashes with forward slashes. - * @internal - */ -function normalizeSlashes(value) { - return value.replace(backslashRegExp, directorySeparator); -} -exports.normalizeSlashes = normalizeSlashes; -/** - * Safe `hasOwnProperty` - * @internal - */ -function hasOwnProperty(object, property) { - return Object.prototype.hasOwnProperty.call(object, property); -} -exports.hasOwnProperty = hasOwnProperty; -/** - * Cached fs operation wrapper. - */ -function cachedLookup(fn) { - const cache = new Map(); - return (arg) => { - if (!cache.has(arg)) { - const v = fn(arg); - cache.set(arg, v); - return v; - } - return cache.get(arg); - }; -} -exports.cachedLookup = cachedLookup; -/** - * @internal - * Require something with v8-compile-cache, which should make subsequent requires faster. - * Do lots of error-handling so that, worst case, we require without the cache, and users are not blocked. - */ -function attemptRequireWithV8CompileCache(requireFn, specifier) { - try { - const v8CC = require('v8-compile-cache-lib').install(); - try { - return requireFn(specifier); - } - finally { - v8CC === null || v8CC === void 0 ? void 0 : v8CC.uninstall(); - } - } - catch (e) { - return requireFn(specifier); - } -} -exports.attemptRequireWithV8CompileCache = attemptRequireWithV8CompileCache; -/** - * Helper to discover dependencies relative to a user's project, optionally - * falling back to relative to ts-node. This supports global installations of - * ts-node, for example where someone does `#!/usr/bin/env -S ts-node --swc` and - * we need to fallback to a global install of @swc/core - * @internal - */ -function createProjectLocalResolveHelper(localDirectory) { - return function projectLocalResolveHelper(specifier, fallbackToTsNodeRelative) { - return require.resolve(specifier, { - paths: fallbackToTsNodeRelative - ? [localDirectory, __dirname] - : [localDirectory], - }); - }; -} -exports.createProjectLocalResolveHelper = createProjectLocalResolveHelper; -/** - * Used as a reminder of all the factors we must consider when finding project-local dependencies and when a config file - * on disk may or may not exist. - * @internal - */ -function getBasePathForProjectLocalDependencyResolution(configFilePath, projectSearchDirOption, projectOption, cwdOption) { - var _a; - if (configFilePath != null) - return (0, path_1.dirname)(configFilePath); - return (_a = projectSearchDirOption !== null && projectSearchDirOption !== void 0 ? projectSearchDirOption : projectOption) !== null && _a !== void 0 ? _a : cwdOption; - // TODO technically breaks if projectOption is path to a file, not a directory, - // and we attempt to resolve relative specifiers. By the time we resolve relative specifiers, - // should have configFilePath, so not reach this codepath. -} -exports.getBasePathForProjectLocalDependencyResolution = getBasePathForProjectLocalDependencyResolution; -/** @internal */ -function once(fn) { - let value; - let ran = false; - function onceFn(...args) { - if (ran) - return value; - value = fn(...args); - ran = true; - return value; - } - return onceFn; -} -exports.once = once; -/** @internal */ -function versionGteLt(version, gteRequirement, ltRequirement) { - const [major, minor, patch, extra] = parse(version); - const [gteMajor, gteMinor, gtePatch] = parse(gteRequirement); - const isGte = major > gteMajor || - (major === gteMajor && - (minor > gteMinor || (minor === gteMinor && patch >= gtePatch))); - let isLt = true; - if (ltRequirement) { - const [ltMajor, ltMinor, ltPatch] = parse(ltRequirement); - isLt = - major < ltMajor || - (major === ltMajor && - (minor < ltMinor || (minor === ltMinor && patch < ltPatch))); - } - return isGte && isLt; - function parse(requirement) { - return requirement.split(/[\.-]/).map((s) => parseInt(s, 10)); - } -} -exports.versionGteLt = versionGteLt; -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/ts-node/dist/util.js.map b/node_modules/ts-node/dist/util.js.map deleted file mode 100644 index 1f7aa4f..0000000 --- a/node_modules/ts-node/dist/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;AAAA,mCAGgB;AAEhB,+BAA+B;AAC/B,+BAA+B;AAE/B,gBAAgB;AACH,QAAA,aAAa,GACxB,MAAA,sBAAiB,aAAjB,sBAAiB,cAAjB,sBAAiB,GACjB,8BAAyB,mCACxB,OAAO,CAAC,gBAAgB,CAA2B,CAAC;AAEvD;;;;GAIG;AACH,SAAgB,EAAE,CAAC,KAAyB;;IAC1C,OAAO,MAAA,QAAQ,CAAC,KAAK,CAAC,mCAAI,SAAS,CAAC;AACtC,CAAC;AAFD,gBAEC;AAED;;;;GAIG;AACH,SAAgB,MAAM,CACpB,YAAe,EACf,GAAG,OAAiB;IAEpB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACrC,MAAM,KAAK,GAAI,MAAc,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,KAAK,KAAK,SAAS;gBAAG,YAAoB,CAAC,GAAG,C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CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAxBD,oCAwBC","sourcesContent":["import {\n createRequire as nodeCreateRequire,\n createRequireFromPath as nodeCreateRequireFromPath,\n} from 'module';\nimport type _createRequire from 'create-require';\nimport * as ynModule from 'yn';\nimport { dirname } from 'path';\n\n/** @internal */\nexport const createRequire =\n nodeCreateRequire ??\n nodeCreateRequireFromPath ??\n (require('create-require') as typeof _createRequire);\n\n/**\n * Wrapper around yn module that returns `undefined` instead of `null`.\n * This is implemented by yn v4, but we're staying on v3 to avoid v4's node 10 requirement.\n * @internal\n */\nexport function yn(value: string | undefined) {\n return ynModule(value) ?? undefined;\n}\n\n/**\n * Like `Object.assign`, but ignores `undefined` properties.\n *\n * @internal\n */\nexport function assign(\n initialValue: T,\n ...sources: Array\n): T {\n for (const source of sources) {\n for (const key of Object.keys(source)) {\n const value = (source as any)[key];\n if (value !== undefined) (initialValue as any)[key] = value;\n }\n }\n return initialValue;\n}\n\n/**\n * Split a string array of values\n * and remove empty strings from the resulting array.\n * @internal\n */\nexport function split(value: string | undefined) {\n return typeof value === 'string'\n ? value.split(/ *, */g).filter((v) => v !== '')\n : undefined;\n}\n\n/**\n * Parse a string as JSON.\n * @internal\n */\nexport function parse(value: string | undefined): object | undefined {\n return typeof value === 'string' ? JSON.parse(value) : undefined;\n}\n\nconst directorySeparator = '/';\nconst backslashRegExp = /\\\\/g;\n/**\n * Replace backslashes with forward slashes.\n * @internal\n */\nexport function normalizeSlashes(value: string): string {\n return value.replace(backslashRegExp, directorySeparator);\n}\n\n/**\n * Safe `hasOwnProperty`\n * @internal\n */\nexport function hasOwnProperty(object: any, property: string): boolean {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\n/**\n * Cached fs operation wrapper.\n */\nexport function cachedLookup(fn: (arg: T) => R): (arg: T) => R {\n const cache = new Map();\n\n return (arg: T): R => {\n if (!cache.has(arg)) {\n const v = fn(arg);\n cache.set(arg, v);\n return v;\n }\n return cache.get(arg)!;\n };\n}\n\n/**\n * @internal\n * Require something with v8-compile-cache, which should make subsequent requires faster.\n * Do lots of error-handling so that, worst case, we require without the cache, and users are not blocked.\n */\nexport function attemptRequireWithV8CompileCache(\n requireFn: typeof require,\n specifier: string\n) {\n try {\n const v8CC = (\n require('v8-compile-cache-lib') as typeof import('v8-compile-cache-lib')\n ).install();\n try {\n return requireFn(specifier);\n } finally {\n v8CC?.uninstall();\n }\n } catch (e) {\n return requireFn(specifier);\n }\n}\n\n/**\n * Helper to discover dependencies relative to a user's project, optionally\n * falling back to relative to ts-node. This supports global installations of\n * ts-node, for example where someone does `#!/usr/bin/env -S ts-node --swc` and\n * we need to fallback to a global install of @swc/core\n * @internal\n */\nexport function createProjectLocalResolveHelper(localDirectory: string) {\n return function projectLocalResolveHelper(\n specifier: string,\n fallbackToTsNodeRelative: boolean\n ) {\n return require.resolve(specifier, {\n paths: fallbackToTsNodeRelative\n ? [localDirectory, __dirname]\n : [localDirectory],\n });\n };\n}\n/** @internal */\nexport type ProjectLocalResolveHelper = ReturnType<\n typeof createProjectLocalResolveHelper\n>;\n\n/**\n * Used as a reminder of all the factors we must consider when finding project-local dependencies and when a config file\n * on disk may or may not exist.\n * @internal\n */\nexport function getBasePathForProjectLocalDependencyResolution(\n configFilePath: string | undefined,\n projectSearchDirOption: string | undefined,\n projectOption: string | undefined,\n cwdOption: string\n) {\n if (configFilePath != null) return dirname(configFilePath);\n return projectSearchDirOption ?? projectOption ?? cwdOption;\n // TODO technically breaks if projectOption is path to a file, not a directory,\n // and we attempt to resolve relative specifiers. By the time we resolve relative specifiers,\n // should have configFilePath, so not reach this codepath.\n}\n\n/** @internal */\nexport function once any>(fn: Fn) {\n let value: ReturnType;\n let ran = false;\n function onceFn(...args: Parameters): ReturnType {\n if (ran) return value;\n value = fn(...args);\n ran = true;\n return value;\n }\n return onceFn;\n}\n\n/** @internal */\nexport function versionGteLt(\n version: string,\n gteRequirement: string,\n ltRequirement?: string\n) {\n const [major, minor, patch, extra] = parse(version);\n const [gteMajor, gteMinor, gtePatch] = parse(gteRequirement);\n const isGte =\n major > gteMajor ||\n (major === gteMajor &&\n (minor > gteMinor || (minor === gteMinor && patch >= gtePatch)));\n let isLt = true;\n if (ltRequirement) {\n const [ltMajor, ltMinor, ltPatch] = parse(ltRequirement);\n isLt =\n major < ltMajor ||\n (major === ltMajor &&\n (minor < ltMinor || (minor === ltMinor && patch < ltPatch)));\n }\n return isGte && isLt;\n\n function parse(requirement: string) {\n return requirement.split(/[\\.-]/).map((s) => parseInt(s, 10));\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/ts-node/esm.mjs b/node_modules/ts-node/esm.mjs deleted file mode 100644 index 0843cf3..0000000 --- a/node_modules/ts-node/esm.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { fileURLToPath } from 'url'; -import { createRequire } from 'module'; -const require = createRequire(fileURLToPath(import.meta.url)); - -/** @type {import('./dist/esm')} */ -const esm = require('./dist/esm'); -export const { resolve, load, getFormat, transformSource } = - esm.registerAndCreateEsmHooks(); diff --git a/node_modules/ts-node/esm/transpile-only.mjs b/node_modules/ts-node/esm/transpile-only.mjs deleted file mode 100644 index 2e154da..0000000 --- a/node_modules/ts-node/esm/transpile-only.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { fileURLToPath } from 'url'; -import { createRequire } from 'module'; -const require = createRequire(fileURLToPath(import.meta.url)); - -/** @type {import('../dist/esm')} */ -const esm = require('../dist/esm'); -export const { resolve, load, getFormat, transformSource } = - esm.registerAndCreateEsmHooks({ transpileOnly: true }); diff --git a/node_modules/ts-node/node10/tsconfig.json b/node_modules/ts-node/node10/tsconfig.json deleted file mode 100644 index 7079f3a..0000000 --- a/node_modules/ts-node/node10/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@tsconfig/node10/tsconfig.json" -} diff --git a/node_modules/ts-node/node12/tsconfig.json b/node_modules/ts-node/node12/tsconfig.json deleted file mode 100644 index 76603f1..0000000 --- a/node_modules/ts-node/node12/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@tsconfig/node12/tsconfig.json", -} diff --git a/node_modules/ts-node/node14/tsconfig.json b/node_modules/ts-node/node14/tsconfig.json deleted file mode 100644 index b082851..0000000 --- a/node_modules/ts-node/node14/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@tsconfig/node14/tsconfig.json" -} diff --git a/node_modules/ts-node/node16/tsconfig.json b/node_modules/ts-node/node16/tsconfig.json deleted file mode 100644 index e9c0baf..0000000 --- a/node_modules/ts-node/node16/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@tsconfig/node16/tsconfig.json" -} diff --git a/node_modules/ts-node/package.json b/node_modules/ts-node/package.json deleted file mode 100644 index d9b281c..0000000 --- a/node_modules/ts-node/package.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "name": "ts-node", - "version": "10.9.2", - "description": "TypeScript execution environment and REPL for node.js, with source map support", - "main": "dist/index.js", - "exports": { - ".": "./dist/index.js", - "./package": "./package.json", - "./package.json": "./package.json", - "./dist/bin": "./dist/bin.js", - "./dist/bin.js": "./dist/bin.js", - "./dist/bin-transpile": "./dist/bin-transpile.js", - "./dist/bin-transpile.js": "./dist/bin-transpile.js", - "./dist/bin-script": "./dist/bin-script.js", - "./dist/bin-script.js": "./dist/bin-script.js", - "./dist/bin-cwd": "./dist/bin-cwd.js", - "./dist/bin-cwd.js": "./dist/bin-cwd.js", - "./dist/bin-esm": "./dist/bin-esm.js", - "./dist/bin-esm.js": "./dist/bin-esm.js", - "./register": "./register/index.js", - "./register/files": "./register/files.js", - "./register/transpile-only": "./register/transpile-only.js", - "./register/type-check": "./register/type-check.js", - "./esm": "./esm.mjs", - "./esm.mjs": "./esm.mjs", - "./esm/transpile-only": "./esm/transpile-only.mjs", - "./esm/transpile-only.mjs": "./esm/transpile-only.mjs", - "./child-loader.mjs": "./child-loader.mjs", - "./transpilers/swc": "./transpilers/swc.js", - "./transpilers/swc-experimental": "./transpilers/swc-experimental.js", - "./node10/tsconfig.json": "./node10/tsconfig.json", - "./node12/tsconfig.json": "./node12/tsconfig.json", - "./node14/tsconfig.json": "./node14/tsconfig.json", - "./node16/tsconfig.json": "./node16/tsconfig.json" - }, - "types": "dist/index.d.ts", - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "files": [ - "/transpilers/", - "/dist/", - "!/dist/test", - "/dist-raw/NODE-LICENSE.md", - "/dist-raw/**.js", - "/register/", - "/esm/", - "/esm.mjs", - "/child-loader.mjs", - "/LICENSE", - "/tsconfig.schema.json", - "/tsconfig.schemastore-schema.json", - "/node10/", - "/node12/", - "/node14/", - "/node16/" - ], - "scripts": { - "lint": "dprint check", - "lint-fix": "dprint fmt", - "clean": "rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp", - "rebuild": "npm run clean && npm run build", - "build": "npm run build-nopack && npm run build-pack", - "build-nopack": "npm run build-tsc && npm run build-configSchema", - "build-tsc": "tsc -b ./tsconfig.build-dist.json", - "build-configSchema": "typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema", - "build-pack": "node ./scripts/build-pack.js", - "test-spec": "ava", - "test-cov": "nyc ava", - "test": "npm run build && npm run lint && npm run test-cov --", - "test-local": "npm run lint-fix && npm run build-tsc && npm run build-pack && npm run test-spec --", - "pre-debug": "npm run build-tsc && npm run build-pack", - "coverage-report": "nyc report --reporter=lcov", - "prepare": "npm run clean && npm run build-nopack", - "api-extractor": "api-extractor run --local --verbose", - "esm-usage-example": "npm run build-tsc && cd esm-usage-example && node --experimental-specifier-resolution node --loader ../esm.mjs ./index", - "esm-usage-example2": "npm run build-tsc && cd tests && TS_NODE_PROJECT=./module-types/override-to-cjs/tsconfig.json node --loader ../esm.mjs ./module-types/override-to-cjs/test.cjs" - }, - "repository": { - "type": "git", - "url": "git://github.com/TypeStrong/ts-node.git" - }, - "keywords": [ - "typescript", - "node", - "runtime", - "environment", - "ts", - "compiler" - ], - "author": { - "name": "Blake Embrey", - "email": "hello@blakeembrey.com", - "url": "http://blakeembrey.me" - }, - "contributors": [ - { - "name": "Andrew Bradley", - "email": "cspotcode@gmail.com", - "url": "https://github.com/cspotcode" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/TypeStrong/ts-node/issues" - }, - "homepage": "https://typestrong.org/ts-node", - "devDependencies": { - "@microsoft/api-extractor": "^7.19.4", - "@swc/core": "^1.3.100", - "@swc/wasm": "^1.3.100", - "@types/diff": "^4.0.2", - "@types/lodash": "^4.14.151", - "@types/node": "13.13.5", - "@types/proper-lockfile": "^4.1.2", - "@types/proxyquire": "^1.3.28", - "@types/react": "^16.14.19", - "@types/rimraf": "^3.0.0", - "@types/semver": "^7.1.0", - "@yarnpkg/fslib": "^2.4.0", - "ava": "^3.15.0", - "axios": "^0.21.1", - "dprint": "^0.25.0", - "expect": "^27.0.2", - "get-stream": "^6.0.0", - "lodash": "^4.17.15", - "ntypescript": "^1.201507091536.1", - "nyc": "^15.0.1", - "outdent": "^0.8.0", - "proper-lockfile": "^4.1.2", - "proxyquire": "^2.0.0", - "react": "^16.14.0", - "rimraf": "^3.0.0", - "semver": "^7.1.3", - "throat": "^6.0.1", - "typedoc": "^0.22.10", - "typescript": "4.7.4", - "typescript-json-schema": "^0.53.0", - "util.promisify": "^1.0.1" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - }, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "prettier": { - "singleQuote": true - }, - "volta": { - "node": "18.1.0", - "npm": "6.14.15" - } -} diff --git a/node_modules/ts-node/register/files.js b/node_modules/ts-node/register/files.js deleted file mode 100644 index 9be5bf5..0000000 --- a/node_modules/ts-node/register/files.js +++ /dev/null @@ -1,3 +0,0 @@ -require('../dist').register({ - files: true, -}); diff --git a/node_modules/ts-node/register/index.js b/node_modules/ts-node/register/index.js deleted file mode 100644 index 4569117..0000000 --- a/node_modules/ts-node/register/index.js +++ /dev/null @@ -1 +0,0 @@ -require('../').register(); diff --git a/node_modules/ts-node/register/transpile-only.js b/node_modules/ts-node/register/transpile-only.js deleted file mode 100644 index 4c52698..0000000 --- a/node_modules/ts-node/register/transpile-only.js +++ /dev/null @@ -1,3 +0,0 @@ -require('../').register({ - transpileOnly: true, -}); diff --git a/node_modules/ts-node/register/type-check.js b/node_modules/ts-node/register/type-check.js deleted file mode 100644 index 3d3c60b..0000000 --- a/node_modules/ts-node/register/type-check.js +++ /dev/null @@ -1,3 +0,0 @@ -require('../').register({ - typeCheck: true, -}); diff --git a/node_modules/ts-node/transpilers/swc-experimental.js b/node_modules/ts-node/transpilers/swc-experimental.js deleted file mode 100644 index 7cf79b1..0000000 --- a/node_modules/ts-node/transpilers/swc-experimental.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../dist/transpilers/swc') diff --git a/node_modules/ts-node/transpilers/swc.js b/node_modules/ts-node/transpilers/swc.js deleted file mode 100644 index 7cf79b1..0000000 --- a/node_modules/ts-node/transpilers/swc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../dist/transpilers/swc') diff --git a/node_modules/ts-node/tsconfig.schema.json b/node_modules/ts-node/tsconfig.schema.json deleted file mode 100644 index 6e8c09e..0000000 --- a/node_modules/ts-node/tsconfig.schema.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "$ref": "#/definitions/TsConfigSchema", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "ModuleTypes": { - "type": "object" - }, - "TsConfigOptions": { - "description": "Must be an interface to support `typescript-json-schema`.", - "properties": { - "compiler": { - "default": "typescript", - "description": "Specify a custom TypeScript compiler.", - "type": "string" - }, - "compilerHost": { - "default": false, - "description": "Use TypeScript's compiler host API instead of the language service API.", - "type": "boolean" - }, - "compilerOptions": { - "additionalProperties": true, - "allOf": [ - { - "$ref": "https://schemastore.azurewebsites.net/schemas/json/tsconfig.json#definitions/compilerOptionsDefinition/properties/compilerOptions" - } - ], - "description": "JSON object to merge with TypeScript `compilerOptions`.", - "properties": {}, - "type": "object" - }, - "emit": { - "default": false, - "description": "Emit output files into `.ts-node` directory.", - "type": "boolean" - }, - "esm": { - "description": "Enable native ESM support.\n\nFor details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules", - "type": "boolean" - }, - "experimentalReplAwait": { - "description": "Allows the usage of top level await in REPL.\n\nUses node's implementation which accomplishes this with an AST syntax transformation.\n\nEnabled by default when tsconfig target is es2018 or above. Set to false to disable.\n\n**Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\nto get default, automatic behavior.", - "type": "boolean" - }, - "experimentalResolver": { - "description": "Enable experimental features that re-map imports and require calls to support:\n`baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n`outDir` to `rootDir` mappings for composite projects and monorepos.\n\nFor details, see https://github.com/TypeStrong/ts-node/issues/1514", - "type": "boolean" - }, - "experimentalSpecifierResolution": { - "description": "Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n\nFor details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm", - "enum": [ - "explicit", - "node" - ], - "type": "string" - }, - "experimentalTsImportSpecifiers": { - "description": "Allow using voluntary `.ts` file extension in import specifiers.\n\nTypically, in ESM projects, import specifiers must have an emit extension, `.js`, `.cjs`, or `.mjs`,\nand we automatically map to the corresponding `.ts`, `.cts`, or `.mts` source file. This is the\nrecommended approach.\n\nHowever, if you really want to use `.ts` in import specifiers, and are aware that this may\nbreak tooling, you can enable this flag.", - "type": "boolean" - }, - "files": { - "default": false, - "description": "Load \"files\" and \"include\" from `tsconfig.json` on startup.\n\nDefault is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.", - "type": "boolean" - }, - "ignore": { - "default": [ - "(?:^|/)node_modules/" - ], - "description": "Paths which should not be compiled.\n\nEach string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n\nSource paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n\nDefault is to ignore all node_modules subdirectories.", - "items": { - "type": "string" - }, - "type": "array" - }, - "ignoreDiagnostics": { - "description": "Ignore TypeScript warnings by diagnostic code.", - "items": { - "type": [ - "string", - "number" - ] - }, - "type": "array" - }, - "logError": { - "default": false, - "description": "Logs TypeScript errors to stderr instead of throwing exceptions.", - "type": "boolean" - }, - "moduleTypes": { - "$ref": "#/definitions/ModuleTypes", - "description": "Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\nWhen overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\nthe file extension is ignored.\nThis is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\nit achieves the same effect.\n\nEach key is a glob pattern following the same rules as tsconfig's \"include\" array.\nWhen multiple patterns match the same file, the last pattern takes precedence.\n\n`cjs` overrides matches files to compile and execute as CommonJS.\n`esm` overrides matches files to compile and execute as native ECMAScript modules.\n`package` overrides either of the above to default behavior, which obeys package.json \"type\" and\ntsconfig.json \"module\" options." - }, - "preferTsExts": { - "default": false, - "description": "Re-order file extensions so that TypeScript imports are preferred.\n\nFor example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`", - "type": "boolean" - }, - "pretty": { - "default": false, - "description": "Use pretty diagnostic formatter.", - "type": "boolean" - }, - "require": { - "description": "Modules to require, like node's `--require` flag.\n\nIf specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n\nIf specified programmatically, each input string should be pre-resolved to an absolute path for\nbest results.", - "items": { - "type": "string" - }, - "type": "array" - }, - "scope": { - "default": false, - "description": "Scope compiler to files within `scopeDir`.", - "type": "boolean" - }, - "scopeDir": { - "default": "First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.", - "type": "string" - }, - "skipIgnore": { - "default": false, - "description": "Skip ignore check, so that compilation will be attempted for all files with matching extensions.", - "type": "boolean" - }, - "swc": { - "description": "Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n\nEquivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n\nFor complete instructions: https://typestrong.org/ts-node/docs/transpilers", - "type": "boolean" - }, - "transpileOnly": { - "default": false, - "description": "Use TypeScript's faster `transpileModule`.", - "type": "boolean" - }, - "transpiler": { - "anyOf": [ - { - "items": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "properties": {}, - "type": "object" - } - ], - "maxItems": 2, - "minItems": 2, - "type": "array" - }, - { - "type": "string" - } - ], - "description": "Specify a custom transpiler for use with transpileOnly" - }, - "typeCheck": { - "default": true, - "description": "**DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).", - "type": "boolean" - } - }, - "type": "object" - }, - "TsConfigSchema": { - "allOf": [ - { - "$ref": "https://schemastore.azurewebsites.net/schemas/json/tsconfig.json" - } - ], - "description": "tsconfig schema which includes \"ts-node\" options.", - "properties": { - "ts-node": { - "$ref": "#/definitions/TsConfigOptions", - "description": "ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n\nts-node offers TypeScript execution and REPL for node.js, with source map support." - } - }, - "type": "object" - } - } -} - diff --git a/node_modules/ts-node/tsconfig.schemastore-schema.json b/node_modules/ts-node/tsconfig.schemastore-schema.json deleted file mode 100644 index 40d58ff..0000000 --- a/node_modules/ts-node/tsconfig.schemastore-schema.json +++ /dev/null @@ -1,1326 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "allowTrailingCommas": true, - "allOf": [ - { - "$ref": "#/definitions/compilerOptionsDefinition" - }, - { - "$ref": "#/definitions/compileOnSaveDefinition" - }, - { - "$ref": "#/definitions/typeAcquisitionDefinition" - }, - { - "$ref": "#/definitions/extendsDefinition" - }, - { - "$ref": "#/definitions/watchOptionsDefinition" - }, - { - "$ref": "#/definitions/buildOptionsDefinition" - }, - { - "$ref": "#/definitions/tsNodeDefinition" - }, - { - "anyOf": [ - { - "$ref": "#/definitions/filesDefinition" - }, - { - "$ref": "#/definitions/excludeDefinition" - }, - { - "$ref": "#/definitions/includeDefinition" - }, - { - "$ref": "#/definitions/referencesDefinition" - } - ] - } - ], - "definitions": { - "//": { - "explainer": "https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#overview", - "reference": "https://www.typescriptlang.org/tsconfig", - "reference metadata": "https://github.com/microsoft/TypeScript-Website/blob/v2/packages/tsconfig-reference/scripts/tsconfigRules.ts" - }, - "filesDefinition": { - "properties": { - "files": { - "description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - } - } - }, - "excludeDefinition": { - "properties": { - "exclude": { - "description": "Specifies a list of files to be excluded from compilation. The 'exclude' property only affects the files included via the 'include' property and not the 'files' property. Glob patterns require TypeScript version 2.0 or later.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - } - } - }, - "includeDefinition": { - "properties": { - "include": { - "description": "Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - } - } - }, - "compileOnSaveDefinition": { - "properties": { - "compileOnSave": { - "description": "Enable Compile-on-Save for this project.", - "type": "boolean" - } - } - }, - "extendsDefinition": { - "properties": { - "extends": { - "description": "Path to base configuration file to inherit from (requires TypeScript version 2.1 or later), or array of base files, with the rightmost files having the greater priority (requires TypeScript version 5.0 or later).", - "oneOf": [ - { - "default": "", - "type": "string" - }, - { - "default": [], - "items": { - "type": "string" - }, - "type": "array" - } - ] - } - } - }, - "buildOptionsDefinition": { - "properties": { - "buildOptions": { - "properties": { - "dry": { - "description": "~", - "type": "boolean", - "default": false - }, - "force": { - "description": "Build all projects, including those that appear to be up to date", - "type": "boolean", - "default": false, - "markdownDescription": "Build all projects, including those that appear to be up to date\n\nSee more: https://www.typescriptlang.org/tsconfig#force" - }, - "verbose": { - "description": "Enable verbose logging", - "type": "boolean", - "default": false, - "markdownDescription": "Enable verbose logging\n\nSee more: https://www.typescriptlang.org/tsconfig#verbose" - }, - "incremental": { - "description": "Save .tsbuildinfo files to allow for incremental compilation of projects.", - "type": "boolean", - "default": false, - "markdownDescription": "Save .tsbuildinfo files to allow for incremental compilation of projects.\n\nSee more: https://www.typescriptlang.org/tsconfig#incremental" - }, - "assumeChangesOnlyAffectDirectDependencies": { - "description": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.", - "type": "boolean", - "default": false, - "markdownDescription": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.\n\nSee more: https://www.typescriptlang.org/tsconfig#assumeChangesOnlyAffectDirectDependencies" - }, - "traceResolution": { - "description": "Log paths used during the `moduleResolution` process.", - "type": "boolean", - "default": false, - "markdownDescription": "Log paths used during the `moduleResolution` process.\n\nSee more: https://www.typescriptlang.org/tsconfig#traceResolution" - } - } - } - } - }, - "watchOptionsDefinition": { - "properties": { - "watchOptions": { - "type": "object", - "description": "Settings for the watch mode in TypeScript.", - "properties": { - "force": { - "description": "~", - "type": "string" - }, - "watchFile": { - "description": "Specify how the TypeScript watch mode works.", - "type": "string", - "markdownDescription": "Specify how the TypeScript watch mode works.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchFile" - }, - "watchDirectory": { - "description": "Specify how directories are watched on systems that lack recursive file-watching functionality.", - "type": "string", - "markdownDescription": "Specify how directories are watched on systems that lack recursive file-watching functionality.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchDirectory" - }, - "fallbackPolling": { - "description": "Specify what approach the watcher should use if the system runs out of native file watchers.", - "type": "string", - "markdownDescription": "Specify what approach the watcher should use if the system runs out of native file watchers.\n\nSee more: https://www.typescriptlang.org/tsconfig#fallbackPolling" - }, - "synchronousWatchDirectory": { - "description": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.", - "type": "boolean", - "markdownDescription": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.\n\nSee more: https://www.typescriptlang.org/tsconfig#synchronousWatchDirectory" - }, - "excludeFiles": { - "description": "Remove a list of files from the watch mode's processing.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - }, - "markdownDescription": "Remove a list of files from the watch mode's processing.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeFiles" - }, - "excludeDirectories": { - "description": "Remove a list of directories from the watch process.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - }, - "markdownDescription": "Remove a list of directories from the watch process.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeDirectories" - } - } - } - } - }, - "compilerOptionsDefinition": { - "properties": { - "compilerOptions": { - "type": "object", - "description": "Instructs the TypeScript compiler how to compile .ts files.", - "properties": { - "allowArbitraryExtensions": { - "description": "Enable importing files with any extension, provided a declaration file is present.", - "type": "boolean", - "markdownDescription": "Enable importing files with any extension, provided a declaration file is present.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions" - }, - "allowImportingTsExtensions": { - "description": "Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.", - "type": "boolean", - "markdownDescription": "Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions" - }, - "charset": { - "description": "No longer supported. In early versions, manually set the text encoding for reading files.", - "type": "string", - "markdownDescription": "No longer supported. In early versions, manually set the text encoding for reading files.\n\nSee more: https://www.typescriptlang.org/tsconfig#charset" - }, - "composite": { - "description": "Enable constraints that allow a TypeScript project to be used with project references.", - "type": "boolean", - "default": true, - "markdownDescription": "Enable constraints that allow a TypeScript project to be used with project references.\n\nSee more: https://www.typescriptlang.org/tsconfig#composite" - }, - "customConditions": { - "description": "Conditions to set in addition to the resolver-specific defaults when resolving imports.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - }, - "markdownDescription": "Conditions to set in addition to the resolver-specific defaults when resolving imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#customConditions" - }, - "declaration": { - "description": "Generate .d.ts files from TypeScript and JavaScript files in your project.", - "type": "boolean", - "default": false, - "markdownDescription": "Generate .d.ts files from TypeScript and JavaScript files in your project.\n\nSee more: https://www.typescriptlang.org/tsconfig#declaration" - }, - "declarationDir": { - "description": "Specify the output directory for generated declaration files.", - "type": [ - "string", - "null" - ], - "markdownDescription": "Specify the output directory for generated declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationDir" - }, - "diagnostics": { - "description": "Output compiler performance information after building.", - "type": "boolean", - "markdownDescription": "Output compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#diagnostics" - }, - "disableReferencedProjectLoad": { - "description": "Reduce the number of projects loaded automatically by TypeScript.", - "type": "boolean", - "markdownDescription": "Reduce the number of projects loaded automatically by TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableReferencedProjectLoad" - }, - "noPropertyAccessFromIndexSignature": { - "description": "Enforces using indexed accessors for keys declared using an indexed type", - "type": "boolean", - "markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature" - }, - "emitBOM": { - "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.", - "type": "boolean", - "default": false, - "markdownDescription": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitBOM" - }, - "emitDeclarationOnly": { - "description": "Only output d.ts files and not JavaScript files.", - "type": "boolean", - "default": false, - "markdownDescription": "Only output d.ts files and not JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly" - }, - "exactOptionalPropertyTypes": { - "description": "Differentiate between undefined and not present when type checking", - "type": "boolean", - "default": false, - "markdownDescription": "Differentiate between undefined and not present when type checking\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes" - }, - "incremental": { - "description": "Enable incremental compilation. Requires TypeScript version 3.4 or later.", - "type": "boolean" - }, - "tsBuildInfoFile": { - "$comment": "The value of 'null' is UNDOCUMENTED.", - "description": "Specify the folder for .tsbuildinfo incremental compilation files.", - "default": ".tsbuildinfo", - "type": [ - "string", - "null" - ], - "markdownDescription": "Specify the folder for .tsbuildinfo incremental compilation files.\n\nSee more: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile" - }, - "inlineSourceMap": { - "description": "Include sourcemap files inside the emitted JavaScript.", - "type": "boolean", - "default": false, - "markdownDescription": "Include sourcemap files inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSourceMap" - }, - "inlineSources": { - "description": "Include source code in the sourcemaps inside the emitted JavaScript.", - "type": "boolean", - "default": false, - "markdownDescription": "Include source code in the sourcemaps inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSources" - }, - "jsx": { - "description": "Specify what JSX code is generated.", - "enum": [ - "preserve", - "react", - "react-jsx", - "react-jsxdev", - "react-native" - ] - }, - "reactNamespace": { - "description": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.", - "type": "string", - "default": "React", - "markdownDescription": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.\n\nSee more: https://www.typescriptlang.org/tsconfig#reactNamespace" - }, - "jsxFactory": { - "description": "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'", - "type": "string", - "default": "React.createElement", - "markdownDescription": "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFactory" - }, - "jsxFragmentFactory": { - "description": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.", - "type": "string", - "default": "React.Fragment", - "markdownDescription": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFragmentFactory" - }, - "jsxImportSource": { - "description": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.", - "type": "string", - "default": "react", - "markdownDescription": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxImportSource" - }, - "listFiles": { - "description": "Print all of the files read during the compilation.", - "type": "boolean", - "default": false, - "markdownDescription": "Print all of the files read during the compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listFiles" - }, - "mapRoot": { - "description": "Specify the location where debugger should locate map files instead of generated locations.", - "type": "string", - "markdownDescription": "Specify the location where debugger should locate map files instead of generated locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#mapRoot" - }, - "module": { - "description": "Specify what module code is generated.", - "type": "string", - "anyOf": [ - { - "enum": [ - "CommonJS", - "AMD", - "System", - "UMD", - "ES6", - "ES2015", - "ES2020", - "ESNext", - "None", - "ES2022", - "Node16", - "NodeNext" - ] - }, - { - "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee]16|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee])$" - } - ], - "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module" - }, - "moduleResolution": { - "description": "Specify how TypeScript looks up a file from a given module specifier.", - "type": "string", - "anyOf": [ - { - "enum": [ - "Classic", - "Node", - "Node10", - "Node16", - "NodeNext", - "Bundler" - ], - "markdownEnumDescriptions": [ - "It’s recommended to use `\"Node16\"` instead", - "Deprecated, use `\"Node10\"` in TypeScript 5.0+ instead", - "It’s recommended to use `\"Node16\"` instead", - "This is the recommended setting for libraries and Node.js applications", - "This is the recommended setting for libraries and Node.js applications", - "This is the recommended setting in TypeScript 5.0+ for applications that use a bundler" - ] - }, - { - "pattern": "^(([Nn]ode)|([Nn]ode1[06])|([Nn]ode[Nn]ext)|([Cc]lassic)|([Bb]undler))$" - } - ], - "markdownDescription": "Specify how TypeScript looks up a file from a given module specifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleResolution" - }, - "newLine": { - "description": "Set the newline character for emitting files.", - "type": "string", - "anyOf": [ - { - "enum": [ - "crlf", - "lf" - ] - }, - { - "pattern": "^(CRLF|LF|crlf|lf)$" - } - ], - "markdownDescription": "Set the newline character for emitting files.\n\nSee more: https://www.typescriptlang.org/tsconfig#newLine" - }, - "noEmit": { - "description": "Disable emitting file from a compilation.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable emitting file from a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmit" - }, - "noEmitHelpers": { - "description": "Disable generating custom helper functions like `__extends` in compiled output.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable generating custom helper functions like `__extends` in compiled output.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitHelpers" - }, - "noEmitOnError": { - "description": "Disable emitting files if any type checking errors are reported.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable emitting files if any type checking errors are reported.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitOnError" - }, - "noImplicitAny": { - "description": "Enable error reporting for expressions and declarations with an implied `any` type..", - "type": "boolean", - "markdownDescription": "Enable error reporting for expressions and declarations with an implied `any` type..\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitAny" - }, - "noImplicitThis": { - "description": "Enable error reporting when `this` is given the type `any`.", - "type": "boolean", - "markdownDescription": "Enable error reporting when `this` is given the type `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitThis" - }, - "noUnusedLocals": { - "description": "Enable error reporting when a local variables aren't read.", - "type": "boolean", - "default": false, - "markdownDescription": "Enable error reporting when a local variables aren't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedLocals" - }, - "noUnusedParameters": { - "description": "Raise an error when a function parameter isn't read", - "type": "boolean", - "default": false, - "markdownDescription": "Raise an error when a function parameter isn't read\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedParameters" - }, - "noLib": { - "description": "Disable including any library files, including the default lib.d.ts.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable including any library files, including the default lib.d.ts.\n\nSee more: https://www.typescriptlang.org/tsconfig#noLib" - }, - "noResolve": { - "description": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.", - "type": "boolean", - "default": false, - "markdownDescription": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.\n\nSee more: https://www.typescriptlang.org/tsconfig#noResolve" - }, - "noStrictGenericChecks": { - "description": "Disable strict checking of generic signatures in function types.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable strict checking of generic signatures in function types.\n\nSee more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks" - }, - "skipDefaultLibCheck": { - "description": "Skip type checking .d.ts files that are included with TypeScript.", - "type": "boolean", - "default": false, - "markdownDescription": "Skip type checking .d.ts files that are included with TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipDefaultLibCheck" - }, - "skipLibCheck": { - "description": "Skip type checking all .d.ts files.", - "type": "boolean", - "default": false, - "markdownDescription": "Skip type checking all .d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipLibCheck" - }, - "outFile": { - "description": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.", - "type": "string", - "markdownDescription": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.\n\nSee more: https://www.typescriptlang.org/tsconfig#outFile" - }, - "outDir": { - "description": "Specify an output folder for all emitted files.", - "type": "string", - "markdownDescription": "Specify an output folder for all emitted files.\n\nSee more: https://www.typescriptlang.org/tsconfig#outDir" - }, - "preserveConstEnums": { - "description": "Disable erasing `const enum` declarations in generated code.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable erasing `const enum` declarations in generated code.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveConstEnums" - }, - "preserveSymlinks": { - "description": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveSymlinks" - }, - "preserveValueImports": { - "description": "Preserve unused imported values in the JavaScript output that would otherwise be removed", - "type": "boolean", - "default": false, - "markdownDescription": "Preserve unused imported values in the JavaScript output that would otherwise be removed\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveValueImports" - }, - "preserveWatchOutput": { - "description": "Disable wiping the console in watch mode", - "type": "boolean", - "markdownDescription": "Disable wiping the console in watch mode\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveWatchOutput" - }, - "pretty": { - "description": "Enable color and formatting in output to make compiler errors easier to read", - "type": "boolean", - "default": true, - "markdownDescription": "Enable color and formatting in output to make compiler errors easier to read\n\nSee more: https://www.typescriptlang.org/tsconfig#pretty" - }, - "removeComments": { - "description": "Disable emitting comments.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments" - }, - "rootDir": { - "description": "Specify the root folder within your source files.", - "type": "string", - "markdownDescription": "Specify the root folder within your source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDir" - }, - "isolatedModules": { - "description": "Ensure that each file can be safely transpiled without relying on other imports.", - "type": "boolean", - "default": false, - "markdownDescription": "Ensure that each file can be safely transpiled without relying on other imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedModules" - }, - "sourceMap": { - "description": "Create source map files for emitted JavaScript files.", - "type": "boolean", - "default": false, - "markdownDescription": "Create source map files for emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceMap" - }, - "sourceRoot": { - "description": "Specify the root path for debuggers to find the reference source code.", - "type": "string", - "markdownDescription": "Specify the root path for debuggers to find the reference source code.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceRoot" - }, - "suppressExcessPropertyErrors": { - "description": "Disable reporting of excess property errors during the creation of object literals.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable reporting of excess property errors during the creation of object literals.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors" - }, - "suppressImplicitAnyIndexErrors": { - "description": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.", - "type": "boolean", - "default": false, - "markdownDescription": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors" - }, - "stripInternal": { - "description": "Disable emitting declarations that have `@internal` in their JSDoc comments.", - "type": "boolean", - "markdownDescription": "Disable emitting declarations that have `@internal` in their JSDoc comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#stripInternal" - }, - "target": { - "description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.", - "type": "string", - "default": "ES3", - "anyOf": [ - { - "enum": [ - "ES3", - "ES5", - "ES6", - "ES2015", - "ES2016", - "ES2017", - "ES2018", - "ES2019", - "ES2020", - "ES2021", - "ES2022", - "ES2023", - "ESNext" - ] - }, - { - "pattern": "^([Ee][Ss]([356]|(20(1[56789]|2[0123]))|[Nn][Ee][Xx][Tt]))$" - } - ], - "markdownDescription": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.\n\nSee more: https://www.typescriptlang.org/tsconfig#target" - }, - "useUnknownInCatchVariables": { - "description": "Default catch clause variables as `unknown` instead of `any`.", - "type": "boolean", - "default": false, - "markdownDescription": "Default catch clause variables as `unknown` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables" - }, - "watch": { - "description": "Watch input files.", - "type": "boolean" - }, - "fallbackPolling": { - "description": "Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. Requires TypeScript version 3.8 or later.", - "enum": [ - "fixedPollingInterval", - "priorityPollingInterval", - "dynamicPriorityPolling", - "fixedInterval", - "priorityInterval", - "dynamicPriority", - "fixedChunkSize" - ] - }, - "watchDirectory": { - "description": "Specify the strategy for watching directories under systems that lack recursive file-watching functionality. Requires TypeScript version 3.8 or later.", - "enum": [ - "useFsEvents", - "fixedPollingInterval", - "dynamicPriorityPolling", - "fixedChunkSizePolling" - ], - "default": "useFsEvents" - }, - "watchFile": { - "description": "Specify the strategy for watching individual files. Requires TypeScript version 3.8 or later.", - "enum": [ - "fixedPollingInterval", - "priorityPollingInterval", - "dynamicPriorityPolling", - "useFsEvents", - "useFsEventsOnParentDirectory", - "fixedChunkSizePolling" - ], - "default": "useFsEvents" - }, - "experimentalDecorators": { - "description": "Enable experimental support for TC39 stage 2 draft decorators.", - "type": "boolean", - "markdownDescription": "Enable experimental support for TC39 stage 2 draft decorators.\n\nSee more: https://www.typescriptlang.org/tsconfig#experimentalDecorators" - }, - "emitDecoratorMetadata": { - "description": "Emit design-type metadata for decorated declarations in source files.", - "type": "boolean", - "markdownDescription": "Emit design-type metadata for decorated declarations in source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata" - }, - "allowUnusedLabels": { - "description": "Disable error reporting for unused labels.", - "type": "boolean", - "markdownDescription": "Disable error reporting for unused labels.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnusedLabels" - }, - "noImplicitReturns": { - "description": "Enable error reporting for codepaths that do not explicitly return in a function.", - "type": "boolean", - "default": false, - "markdownDescription": "Enable error reporting for codepaths that do not explicitly return in a function.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitReturns" - }, - "noUncheckedIndexedAccess": { - "description": "Add `undefined` to a type when accessed using an index.", - "type": "boolean", - "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess" - }, - "noFallthroughCasesInSwitch": { - "description": "Enable error reporting for fallthrough cases in switch statements.", - "type": "boolean", - "default": false, - "markdownDescription": "Enable error reporting for fallthrough cases in switch statements.\n\nSee more: https://www.typescriptlang.org/tsconfig#noFallthroughCasesInSwitch" - }, - "noImplicitOverride": { - "description": "Ensure overriding members in derived classes are marked with an override modifier.", - "type": "boolean", - "default": false, - "markdownDescription": "Ensure overriding members in derived classes are marked with an override modifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitOverride" - }, - "allowUnreachableCode": { - "description": "Disable error reporting for unreachable code.", - "type": "boolean", - "markdownDescription": "Disable error reporting for unreachable code.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnreachableCode" - }, - "forceConsistentCasingInFileNames": { - "description": "Ensure that casing is correct in imports.", - "type": "boolean", - "default": false, - "markdownDescription": "Ensure that casing is correct in imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames" - }, - "generateCpuProfile": { - "description": "Emit a v8 CPU profile of the compiler run for debugging.", - "type": "string", - "default": "profile.cpuprofile", - "markdownDescription": "Emit a v8 CPU profile of the compiler run for debugging.\n\nSee more: https://www.typescriptlang.org/tsconfig#generateCpuProfile" - }, - "baseUrl": { - "description": "Specify the base directory to resolve non-relative module names.", - "type": "string", - "markdownDescription": "Specify the base directory to resolve non-relative module names.\n\nSee more: https://www.typescriptlang.org/tsconfig#baseUrl" - }, - "paths": { - "description": "Specify a set of entries that re-map imports to additional lookup locations.", - "type": "object", - "additionalProperties": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "description": "Path mapping to be computed relative to baseUrl option." - } - }, - "markdownDescription": "Specify a set of entries that re-map imports to additional lookup locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#paths" - }, - "plugins": { - "description": "Specify a list of language service plugins to include.", - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Plugin name.", - "type": "string" - } - } - }, - "markdownDescription": "Specify a list of language service plugins to include.\n\nSee more: https://www.typescriptlang.org/tsconfig#plugins" - }, - "rootDirs": { - "description": "Allow multiple folders to be treated as one when resolving modules.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - }, - "markdownDescription": "Allow multiple folders to be treated as one when resolving modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDirs" - }, - "typeRoots": { - "description": "Specify multiple folders that act like `./node_modules/@types`.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - }, - "markdownDescription": "Specify multiple folders that act like `./node_modules/@types`.\n\nSee more: https://www.typescriptlang.org/tsconfig#typeRoots" - }, - "types": { - "description": "Specify type package names to be included without being referenced in a source file.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - }, - "markdownDescription": "Specify type package names to be included without being referenced in a source file.\n\nSee more: https://www.typescriptlang.org/tsconfig#types" - }, - "traceResolution": { - "description": "Enable tracing of the name resolution process. Requires TypeScript version 2.0 or later.", - "type": "boolean", - "default": false - }, - "allowJs": { - "description": "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.", - "type": "boolean", - "default": false, - "markdownDescription": "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowJs" - }, - "noErrorTruncation": { - "description": "Disable truncating types in error messages.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable truncating types in error messages.\n\nSee more: https://www.typescriptlang.org/tsconfig#noErrorTruncation" - }, - "allowSyntheticDefaultImports": { - "description": "Allow 'import x from y' when a module doesn't have a default export.", - "type": "boolean", - "markdownDescription": "Allow 'import x from y' when a module doesn't have a default export.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports" - }, - "noImplicitUseStrict": { - "description": "Disable adding 'use strict' directives in emitted JavaScript files.", - "type": "boolean", - "default": false, - "markdownDescription": "Disable adding 'use strict' directives in emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict" - }, - "listEmittedFiles": { - "description": "Print the names of emitted files after a compilation.", - "type": "boolean", - "default": false, - "markdownDescription": "Print the names of emitted files after a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listEmittedFiles" - }, - "disableSizeLimit": { - "description": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.", - "type": "boolean", - "default": false, - "markdownDescription": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSizeLimit" - }, - "lib": { - "description": "Specify a set of bundled library declaration files that describe the target runtime environment.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "anyOf": [ - { - "enum": [ - "ES5", - "ES6", - "ES2015", - "ES2015.Collection", - "ES2015.Core", - "ES2015.Generator", - "ES2015.Iterable", - "ES2015.Promise", - "ES2015.Proxy", - "ES2015.Reflect", - "ES2015.Symbol.WellKnown", - "ES2015.Symbol", - "ES2016", - "ES2016.Array.Include", - "ES2017", - "ES2017.Intl", - "ES2017.Object", - "ES2017.SharedMemory", - "ES2017.String", - "ES2017.TypedArrays", - "ES2018", - "ES2018.AsyncGenerator", - "ES2018.AsyncIterable", - "ES2018.Intl", - "ES2018.Promise", - "ES2018.Regexp", - "ES2019", - "ES2019.Array", - "ES2019.Intl", - "ES2019.Object", - "ES2019.String", - "ES2019.Symbol", - "ES2020", - "ES2020.BigInt", - "ES2020.Promise", - "ES2020.String", - "ES2020.Symbol.WellKnown", - "ESNext", - "ESNext.Array", - "ESNext.AsyncIterable", - "ESNext.BigInt", - "ESNext.Intl", - "ESNext.Promise", - "ESNext.String", - "ESNext.Symbol", - "DOM", - "DOM.Iterable", - "ScriptHost", - "WebWorker", - "WebWorker.ImportScripts", - "Webworker.Iterable", - "ES7", - "ES2021", - "ES2020.SharedMemory", - "ES2020.Intl", - "ES2020.Date", - "ES2020.Number", - "ES2021.Promise", - "ES2021.String", - "ES2021.WeakRef", - "ESNext.WeakRef", - "ES2021.Intl", - "ES2022", - "ES2022.Array", - "ES2022.Error", - "ES2022.Intl", - "ES2022.Object", - "ES2022.String", - "ES2022.SharedMemory", - "ES2022.RegExp", - "ES2023", - "ES2023.Array", - "Decorators", - "Decorators.Legacy", - "ES2017.Date", - "ES2023.Collection", - "ESNext.Decorators", - "ESNext.Disposable" - ] - }, - { - "pattern": "^[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]7$" - }, - { - "pattern": "^[Ee][Ss]2015(\\.([Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Cc][Oo][Rr][Ee]|[Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Pp][Rr][Oo][Xx][Yy]|[Rr][Ee][Ff][Ll][Ee][Cc][Tt]|[Ss][Yy][Mm][Bb][Oo][Ll]\\.[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Yy][Mm][Bb][Oo][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ern": "^[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss](\\.([Ll][Ee][Gg][Aa][Cc][Yy]))?$" - } - ] - }, - "markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib" - }, - "moduleDetection": { - "description": "Specify how TypeScript determine a file as module.", - "enum": [ - "auto", - "legacy", - "force" - ] - }, - "strictNullChecks": { - "description": "When type checking, take into account `null` and `undefined`.", - "type": "boolean", - "default": false, - "markdownDescription": "When type checking, take into account `null` and `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictNullChecks" - }, - "maxNodeModuleJsDepth": { - "description": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.", - "type": "number", - "default": 0, - "markdownDescription": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.\n\nSee more: https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth" - }, - "importHelpers": { - "description": "Allow importing helper functions from tslib once per project, instead of including them per-file.", - "type": "boolean", - "default": false, - "markdownDescription": "Allow importing helper functions from tslib once per project, instead of including them per-file.\n\nSee more: https://www.typescriptlang.org/tsconfig#importHelpers" - }, - "importsNotUsedAsValues": { - "description": "Specify emit/checking behavior for imports that are only used for types.", - "default": "remove", - "enum": [ - "remove", - "preserve", - "error" - ] - }, - "alwaysStrict": { - "description": "Ensure 'use strict' is always emitted.", - "type": "boolean", - "markdownDescription": "Ensure 'use strict' is always emitted.\n\nSee more: https://www.typescriptlang.org/tsconfig#alwaysStrict" - }, - "strict": { - "description": "Enable all strict type checking options.", - "type": "boolean", - "default": false, - "markdownDescription": "Enable all strict type checking options.\n\nSee more: https://www.typescriptlang.org/tsconfig#strict" - }, - "strictBindCallApply": { - "description": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.", - "type": "boolean", - "default": false, - "markdownDescription": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBindCallApply" - }, - "downlevelIteration": { - "description": "Emit more compliant, but verbose and less performant JavaScript for iteration.", - "type": "boolean", - "default": false, - "markdownDescription": "Emit more compliant, but verbose and less performant JavaScript for iteration.\n\nSee more: https://www.typescriptlang.org/tsconfig#downlevelIteration" - }, - "checkJs": { - "description": "Enable error reporting in type-checked JavaScript files.", - "type": "boolean", - "default": false, - "markdownDescription": "Enable error reporting in type-checked JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#checkJs" - }, - "strictFunctionTypes": { - "description": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.", - "type": "boolean", - "default": false, - "markdownDescription": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes" - }, - "strictPropertyInitialization": { - "description": "Check for class properties that are declared but not set in the constructor.", - "type": "boolean", - "default": false, - "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization" - }, - "esModuleInterop": { - "description": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.", - "type": "boolean", - "default": false, - "markdownDescription": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.\n\nSee more: https://www.typescriptlang.org/tsconfig#esModuleInterop" - }, - "allowUmdGlobalAccess": { - "description": "Allow accessing UMD globals from modules.", - "type": "boolean", - "default": false, - "markdownDescription": "Allow accessing UMD globals from modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUmdGlobalAccess" - }, - "keyofStringsOnly": { - "description": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.", - "type": "boolean", - "default": false, - "markdownDescription": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.\n\nSee more: https://www.typescriptlang.org/tsconfig#keyofStringsOnly" - }, - "useDefineForClassFields": { - "description": "Emit ECMAScript-standard-compliant class fields.", - "type": "boolean", - "default": false, - "markdownDescription": "Emit ECMAScript-standard-compliant class fields.\n\nSee more: https://www.typescriptlang.org/tsconfig#useDefineForClassFields" - }, - "declarationMap": { - "description": "Create sourcemaps for d.ts files.", - "type": "boolean", - "default": false, - "markdownDescription": "Create sourcemaps for d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationMap" - }, - "resolveJsonModule": { - "description": "Enable importing .json files", - "type": "boolean", - "default": false, - "markdownDescription": "Enable importing .json files\n\nSee more: https://www.typescriptlang.org/tsconfig#resolveJsonModule" - }, - "resolvePackageJsonExports": { - "description": "Use the package.json 'exports' field when resolving package imports.", - "type": "boolean", - "default": false, - "markdownDescription": "Use the package.json 'exports' field when resolving package imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonExports" - }, - "resolvePackageJsonImports": { - "description": "Use the package.json 'imports' field when resolving imports.", - "type": "boolean", - "default": false, - "markdownDescription": "Use the package.json 'imports' field when resolving imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonImports" - }, - "assumeChangesOnlyAffectDirectDependencies": { - "description": "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. Requires TypeScript version 3.8 or later.", - "type": "boolean" - }, - "extendedDiagnostics": { - "description": "Output more detailed compiler performance information after building.", - "type": "boolean", - "default": false, - "markdownDescription": "Output more detailed compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#extendedDiagnostics" - }, - "listFilesOnly": { - "description": "Print names of files that are part of the compilation and then stop processing.", - "type": "boolean" - }, - "disableSourceOfProjectReferenceRedirect": { - "description": "Disable preferring source files instead of declaration files when referencing composite projects", - "type": "boolean", - "markdownDescription": "Disable preferring source files instead of declaration files when referencing composite projects\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSourceOfProjectReferenceRedirect" - }, - "disableSolutionSearching": { - "description": "Opt a project out of multi-project reference checking when editing.", - "type": "boolean", - "markdownDescription": "Opt a project out of multi-project reference checking when editing.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSolutionSearching" - }, - "verbatimModuleSyntax": { - "description": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting.", - "type": "boolean", - "markdownDescription": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting.\n\nSee more: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax" - } - } - } - } - }, - "typeAcquisitionDefinition": { - "properties": { - "typeAcquisition": { - "type": "object", - "description": "Auto type (.d.ts) acquisition options for this project. Requires TypeScript version 2.1 or later.", - "properties": { - "enable": { - "description": "Enable auto type acquisition", - "type": "boolean", - "default": false - }, - "include": { - "description": "Specifies a list of type declarations to be included in auto type acquisition. Ex. [\"jquery\", \"lodash\"]", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - }, - "exclude": { - "description": "Specifies a list of type declarations to be excluded from auto type acquisition. Ex. [\"jquery\", \"lodash\"]", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - } - } - } - } - }, - "referencesDefinition": { - "properties": { - "references": { - "type": "array", - "uniqueItems": true, - "description": "Referenced projects. Requires TypeScript version 3.0 or later.", - "items": { - "type": "object", - "description": "Project reference.", - "properties": { - "path": { - "type": "string", - "description": "Path to referenced tsconfig or to folder containing tsconfig." - } - } - } - } - } - }, - "tsNodeModuleTypes": { - "type": "object" - }, - "tsNodeDefinition": { - "properties": { - "ts-node": { - "description": "ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n\nts-node offers TypeScript execution and REPL for node.js, with source map support.", - "properties": { - "compiler": { - "default": "typescript", - "description": "Specify a custom TypeScript compiler.", - "type": "string" - }, - "compilerHost": { - "default": false, - "description": "Use TypeScript's compiler host API instead of the language service API.", - "type": "boolean" - }, - "compilerOptions": { - "additionalProperties": true, - "allOf": [ - { - "$ref": "#/definitions/compilerOptionsDefinition/properties/compilerOptions" - } - ], - "description": "JSON object to merge with TypeScript `compilerOptions`.", - "properties": {}, - "type": "object" - }, - "emit": { - "default": false, - "description": "Emit output files into `.ts-node` directory.", - "type": "boolean" - }, - "esm": { - "description": "Enable native ESM support.\n\nFor details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules", - "type": "boolean" - }, - "experimentalReplAwait": { - "description": "Allows the usage of top level await in REPL.\n\nUses node's implementation which accomplishes this with an AST syntax transformation.\n\nEnabled by default when tsconfig target is es2018 or above. Set to false to disable.\n\n**Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\nto get default, automatic behavior.", - "type": "boolean" - }, - "experimentalResolver": { - "description": "Enable experimental features that re-map imports and require calls to support:\n`baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n`outDir` to `rootDir` mappings for composite projects and monorepos.\n\nFor details, see https://github.com/TypeStrong/ts-node/issues/1514", - "type": "boolean" - }, - "experimentalSpecifierResolution": { - "description": "Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n\nFor details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm", - "enum": [ - "explicit", - "node" - ], - "type": "string" - }, - "experimentalTsImportSpecifiers": { - "description": "Allow using voluntary `.ts` file extension in import specifiers.\n\nTypically, in ESM projects, import specifiers must have an emit extension, `.js`, `.cjs`, or `.mjs`,\nand we automatically map to the corresponding `.ts`, `.cts`, or `.mts` source file. This is the\nrecommended approach.\n\nHowever, if you really want to use `.ts` in import specifiers, and are aware that this may\nbreak tooling, you can enable this flag.", - "type": "boolean" - }, - "files": { - "default": false, - "description": "Load \"files\" and \"include\" from `tsconfig.json` on startup.\n\nDefault is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.", - "type": "boolean" - }, - "ignore": { - "default": [ - "(?:^|/)node_modules/" - ], - "description": "Paths which should not be compiled.\n\nEach string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n\nSource paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n\nDefault is to ignore all node_modules subdirectories.", - "items": { - "type": "string" - }, - "type": "array" - }, - "ignoreDiagnostics": { - "description": "Ignore TypeScript warnings by diagnostic code.", - "items": { - "type": [ - "string", - "number" - ] - }, - "type": "array" - }, - "logError": { - "default": false, - "description": "Logs TypeScript errors to stderr instead of throwing exceptions.", - "type": "boolean" - }, - "moduleTypes": { - "$ref": "#/definitions/tsNodeModuleTypes", - "description": "Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\nWhen overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\nthe file extension is ignored.\nThis is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\nit achieves the same effect.\n\nEach key is a glob pattern following the same rules as tsconfig's \"include\" array.\nWhen multiple patterns match the same file, the last pattern takes precedence.\n\n`cjs` overrides matches files to compile and execute as CommonJS.\n`esm` overrides matches files to compile and execute as native ECMAScript modules.\n`package` overrides either of the above to default behavior, which obeys package.json \"type\" and\ntsconfig.json \"module\" options." - }, - "preferTsExts": { - "default": false, - "description": "Re-order file extensions so that TypeScript imports are preferred.\n\nFor example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`", - "type": "boolean" - }, - "pretty": { - "default": false, - "description": "Use pretty diagnostic formatter.", - "type": "boolean" - }, - "require": { - "description": "Modules to require, like node's `--require` flag.\n\nIf specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n\nIf specified programmatically, each input string should be pre-resolved to an absolute path for\nbest results.", - "items": { - "type": "string" - }, - "type": "array" - }, - "scope": { - "default": false, - "description": "Scope compiler to files within `scopeDir`.", - "type": "boolean" - }, - "scopeDir": { - "default": "First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.", - "type": "string" - }, - "skipIgnore": { - "default": false, - "description": "Skip ignore check, so that compilation will be attempted for all files with matching extensions.", - "type": "boolean" - }, - "swc": { - "description": "Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n\nEquivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n\nFor complete instructions: https://typestrong.org/ts-node/docs/transpilers", - "type": "boolean" - }, - "transpileOnly": { - "default": false, - "description": "Use TypeScript's faster `transpileModule`.", - "type": "boolean" - }, - "transpiler": { - "anyOf": [ - { - "items": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "properties": {}, - "type": "object" - } - ], - "maxItems": 2, - "minItems": 2, - "type": "array" - }, - { - "type": "string" - } - ], - "description": "Specify a custom transpiler for use with transpileOnly" - }, - "typeCheck": { - "default": true, - "description": "**DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).", - "type": "boolean" - } - }, - "type": "object" - } - } - } - }, - "id": "https://json.schemastore.org/tsconfig", - "title": "JSON schema for the TypeScript compiler's configuration file", - "type": "object" -} \ No newline at end of file diff --git a/node_modules/undici-types/README.md b/node_modules/undici-types/README.md deleted file mode 100644 index 20a721c..0000000 --- a/node_modules/undici-types/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# undici-types - -This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version. - -- [GitHub nodejs/undici](https://github.com/nodejs/undici) -- [Undici Documentation](https://undici.nodejs.org/#/) diff --git a/node_modules/undici-types/agent.d.ts b/node_modules/undici-types/agent.d.ts deleted file mode 100644 index 58081ce..0000000 --- a/node_modules/undici-types/agent.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { URL } from 'url' -import Pool from './pool' -import Dispatcher from "./dispatcher"; - -export default Agent - -declare class Agent extends Dispatcher{ - constructor(opts?: Agent.Options) - /** `true` after `dispatcher.close()` has been called. */ - closed: boolean; - /** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */ - destroyed: boolean; - /** Dispatches a request. */ - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; -} - -declare namespace Agent { - export interface Options extends Pool.Options { - /** Default: `(origin, opts) => new Pool(origin, opts)`. */ - factory?(origin: string | URL, opts: Object): Dispatcher; - /** Integer. Default: `0` */ - maxRedirections?: number; - - interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options["interceptors"] - } - - export interface DispatchOptions extends Dispatcher.DispatchOptions { - /** Integer. */ - maxRedirections?: number; - } -} diff --git a/node_modules/undici-types/api.d.ts b/node_modules/undici-types/api.d.ts deleted file mode 100644 index 400341d..0000000 --- a/node_modules/undici-types/api.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { URL, UrlObject } from 'url' -import { Duplex } from 'stream' -import Dispatcher from './dispatcher' - -export { - request, - stream, - pipeline, - connect, - upgrade, -} - -/** Performs an HTTP request. */ -declare function request( - url: string | URL | UrlObject, - options?: { dispatcher?: Dispatcher } & Omit & Partial>, -): Promise; - -/** A faster version of `request`. */ -declare function stream( - url: string | URL | UrlObject, - options: { dispatcher?: Dispatcher } & Omit, - factory: Dispatcher.StreamFactory -): Promise; - -/** For easy use with `stream.pipeline`. */ -declare function pipeline( - url: string | URL | UrlObject, - options: { dispatcher?: Dispatcher } & Omit, - handler: Dispatcher.PipelineHandler -): Duplex; - -/** Starts two-way communications with the requested resource. */ -declare function connect( - url: string | URL | UrlObject, - options?: { dispatcher?: Dispatcher } & Omit -): Promise; - -/** Upgrade to a different protocol. */ -declare function upgrade( - url: string | URL | UrlObject, - options?: { dispatcher?: Dispatcher } & Omit -): Promise; diff --git a/node_modules/undici-types/balanced-pool.d.ts b/node_modules/undici-types/balanced-pool.d.ts deleted file mode 100644 index d1e9375..0000000 --- a/node_modules/undici-types/balanced-pool.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import Pool from './pool' -import Dispatcher from './dispatcher' -import { URL } from 'url' - -export default BalancedPool - -declare class BalancedPool extends Dispatcher { - constructor(url: string | string[] | URL | URL[], options?: Pool.Options); - - addUpstream(upstream: string | URL): BalancedPool; - removeUpstream(upstream: string | URL): BalancedPool; - upstreams: Array; - - /** `true` after `pool.close()` has been called. */ - closed: boolean; - /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ - destroyed: boolean; -} diff --git a/node_modules/undici-types/cache.d.ts b/node_modules/undici-types/cache.d.ts deleted file mode 100644 index 4c33335..0000000 --- a/node_modules/undici-types/cache.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { RequestInfo, Response, Request } from './fetch' - -export interface CacheStorage { - match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise, - has (cacheName: string): Promise, - open (cacheName: string): Promise, - delete (cacheName: string): Promise, - keys (): Promise -} - -declare const CacheStorage: { - prototype: CacheStorage - new(): CacheStorage -} - -export interface Cache { - match (request: RequestInfo, options?: CacheQueryOptions): Promise, - matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise, - add (request: RequestInfo): Promise, - addAll (requests: RequestInfo[]): Promise, - put (request: RequestInfo, response: Response): Promise, - delete (request: RequestInfo, options?: CacheQueryOptions): Promise, - keys (request?: RequestInfo, options?: CacheQueryOptions): Promise -} - -export interface CacheQueryOptions { - ignoreSearch?: boolean, - ignoreMethod?: boolean, - ignoreVary?: boolean -} - -export interface MultiCacheQueryOptions extends CacheQueryOptions { - cacheName?: string -} - -export declare const caches: CacheStorage diff --git a/node_modules/undici-types/client.d.ts b/node_modules/undici-types/client.d.ts deleted file mode 100644 index 74948b1..0000000 --- a/node_modules/undici-types/client.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { URL } from 'url' -import { TlsOptions } from 'tls' -import Dispatcher from './dispatcher' -import buildConnector from "./connector"; - -/** - * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default. - */ -export class Client extends Dispatcher { - constructor(url: string | URL, options?: Client.Options); - /** Property to get and set the pipelining factor. */ - pipelining: number; - /** `true` after `client.close()` has been called. */ - closed: boolean; - /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */ - destroyed: boolean; -} - -export declare namespace Client { - export interface OptionsInterceptors { - Client: readonly Dispatcher.DispatchInterceptor[]; - } - export interface Options { - /** TODO */ - interceptors?: OptionsInterceptors; - /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */ - maxHeaderSize?: number; - /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */ - headersTimeout?: number; - /** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */ - socketTimeout?: never; - /** @deprecated unsupported requestTimeout, use headersTimeout & bodyTimeout instead */ - requestTimeout?: never; - /** TODO */ - connectTimeout?: number; - /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */ - bodyTimeout?: number; - /** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */ - idleTimeout?: never; - /** @deprecated unsupported keepAlive, use pipelining=0 instead */ - keepAlive?: never; - /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */ - keepAliveTimeout?: number; - /** @deprecated unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead */ - maxKeepAliveTimeout?: never; - /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */ - keepAliveMaxTimeout?: number; - /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */ - keepAliveTimeoutThreshold?: number; - /** TODO */ - socketPath?: string; - /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */ - pipelining?: number; - /** @deprecated use the connect option instead */ - tls?: never; - /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */ - strictContentLength?: boolean; - /** TODO */ - maxCachedSessions?: number; - /** TODO */ - maxRedirections?: number; - /** TODO */ - connect?: buildConnector.BuildOptions | buildConnector.connector; - /** TODO */ - maxRequestsPerClient?: number; - /** TODO */ - localAddress?: string; - /** Max response body size in bytes, -1 is disabled */ - maxResponseSize?: number; - /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */ - autoSelectFamily?: boolean; - /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */ - autoSelectFamilyAttemptTimeout?: number; - /** - * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation. - * @default false - */ - allowH2?: boolean; - /** - * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overriden by a SETTINGS remote frame. - * @default 100 - */ - maxConcurrentStreams?: number - } - export interface SocketInfo { - localAddress?: string - localPort?: number - remoteAddress?: string - remotePort?: number - remoteFamily?: string - timeout?: number - bytesWritten?: number - bytesRead?: number - } -} - -export default Client; diff --git a/node_modules/undici-types/connector.d.ts b/node_modules/undici-types/connector.d.ts deleted file mode 100644 index bd92433..0000000 --- a/node_modules/undici-types/connector.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { TLSSocket, ConnectionOptions } from 'tls' -import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'net' - -export default buildConnector -declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector - -declare namespace buildConnector { - export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & { - allowH2?: boolean; - maxCachedSessions?: number | null; - socketPath?: string | null; - timeout?: number | null; - port?: number; - keepAlive?: boolean | null; - keepAliveInitialDelay?: number | null; - } - - export interface Options { - hostname: string - host?: string - protocol: string - port: string - servername?: string - localAddress?: string | null - httpSocket?: Socket - } - - export type Callback = (...args: CallbackArgs) => void - type CallbackArgs = [null, Socket | TLSSocket] | [Error, null] - - export interface connector { - (options: buildConnector.Options, callback: buildConnector.Callback): void - } -} diff --git a/node_modules/undici-types/content-type.d.ts b/node_modules/undici-types/content-type.d.ts deleted file mode 100644 index f2a87f1..0000000 --- a/node_modules/undici-types/content-type.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// - -interface MIMEType { - type: string - subtype: string - parameters: Map - essence: string -} - -/** - * Parse a string to a {@link MIMEType} object. Returns `failure` if the string - * couldn't be parsed. - * @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type - */ -export function parseMIMEType (input: string): 'failure' | MIMEType - -/** - * Convert a MIMEType object to a string. - * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type - */ -export function serializeAMimeType (mimeType: MIMEType): string diff --git a/node_modules/undici-types/cookies.d.ts b/node_modules/undici-types/cookies.d.ts deleted file mode 100644 index aa38cae..0000000 --- a/node_modules/undici-types/cookies.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -import type { Headers } from './fetch' - -export interface Cookie { - name: string - value: string - expires?: Date | number - maxAge?: number - domain?: string - path?: string - secure?: boolean - httpOnly?: boolean - sameSite?: 'Strict' | 'Lax' | 'None' - unparsed?: string[] -} - -export function deleteCookie ( - headers: Headers, - name: string, - attributes?: { name?: string, domain?: string } -): void - -export function getCookies (headers: Headers): Record - -export function getSetCookies (headers: Headers): Cookie[] - -export function setCookie (headers: Headers, cookie: Cookie): void diff --git a/node_modules/undici-types/diagnostics-channel.d.ts b/node_modules/undici-types/diagnostics-channel.d.ts deleted file mode 100644 index 85d4482..0000000 --- a/node_modules/undici-types/diagnostics-channel.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Socket } from "net"; -import { URL } from "url"; -import Connector from "./connector"; -import Dispatcher from "./dispatcher"; - -declare namespace DiagnosticsChannel { - interface Request { - origin?: string | URL; - completed: boolean; - method?: Dispatcher.HttpMethod; - path: string; - headers: string; - addHeader(key: string, value: string): Request; - } - interface Response { - statusCode: number; - statusText: string; - headers: Array; - } - type Error = unknown; - interface ConnectParams { - host: URL["host"]; - hostname: URL["hostname"]; - protocol: URL["protocol"]; - port: URL["port"]; - servername: string | null; - } - type Connector = Connector.connector; - export interface RequestCreateMessage { - request: Request; - } - export interface RequestBodySentMessage { - request: Request; - } - export interface RequestHeadersMessage { - request: Request; - response: Response; - } - export interface RequestTrailersMessage { - request: Request; - trailers: Array; - } - export interface RequestErrorMessage { - request: Request; - error: Error; - } - export interface ClientSendHeadersMessage { - request: Request; - headers: string; - socket: Socket; - } - export interface ClientBeforeConnectMessage { - connectParams: ConnectParams; - connector: Connector; - } - export interface ClientConnectedMessage { - socket: Socket; - connectParams: ConnectParams; - connector: Connector; - } - export interface ClientConnectErrorMessage { - error: Error; - socket: Socket; - connectParams: ConnectParams; - connector: Connector; - } -} diff --git a/node_modules/undici-types/dispatcher.d.ts b/node_modules/undici-types/dispatcher.d.ts deleted file mode 100644 index 816db19..0000000 --- a/node_modules/undici-types/dispatcher.d.ts +++ /dev/null @@ -1,241 +0,0 @@ -import { URL } from 'url' -import { Duplex, Readable, Writable } from 'stream' -import { EventEmitter } from 'events' -import { Blob } from 'buffer' -import { IncomingHttpHeaders } from './header' -import BodyReadable from './readable' -import { FormData } from './formdata' -import Errors from './errors' - -type AbortSignal = unknown; - -export default Dispatcher - -/** Dispatcher is the core API used to dispatch requests. */ -declare class Dispatcher extends EventEmitter { - /** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */ - dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; - /** Starts two-way communications with the requested resource. */ - connect(options: Dispatcher.ConnectOptions): Promise; - connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void; - /** Performs an HTTP request. */ - request(options: Dispatcher.RequestOptions): Promise; - request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void; - /** For easy use with `stream.pipeline`. */ - pipeline(options: Dispatcher.PipelineOptions, handler: Dispatcher.PipelineHandler): Duplex; - /** A faster version of `Dispatcher.request`. */ - stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory): Promise; - stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory, callback: (err: Error | null, data: Dispatcher.StreamData) => void): void; - /** Upgrade to a different protocol. */ - upgrade(options: Dispatcher.UpgradeOptions): Promise; - upgrade(options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void; - /** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */ - close(): Promise; - close(callback: () => void): void; - /** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */ - destroy(): Promise; - destroy(err: Error | null): Promise; - destroy(callback: () => void): void; - destroy(err: Error | null, callback: () => void): void; - - on(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - on(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - on(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - on(eventName: 'drain', callback: (origin: URL) => void): this; - - - once(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - once(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - once(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - once(eventName: 'drain', callback: (origin: URL) => void): this; - - - off(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - off(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - off(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - off(eventName: 'drain', callback: (origin: URL) => void): this; - - - addListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - addListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - addListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - addListener(eventName: 'drain', callback: (origin: URL) => void): this; - - removeListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - removeListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - removeListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - removeListener(eventName: 'drain', callback: (origin: URL) => void): this; - - prependListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - prependListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependListener(eventName: 'drain', callback: (origin: URL) => void): this; - - prependOnceListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - prependOnceListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependOnceListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependOnceListener(eventName: 'drain', callback: (origin: URL) => void): this; - - listeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[] - listeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - listeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - listeners(eventName: 'drain'): ((origin: URL) => void)[]; - - rawListeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[] - rawListeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - rawListeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - rawListeners(eventName: 'drain'): ((origin: URL) => void)[]; - - emit(eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean; - emit(eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean; - emit(eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean; - emit(eventName: 'drain', origin: URL): boolean; -} - -declare namespace Dispatcher { - export interface DispatchOptions { - origin?: string | URL; - path: string; - method: HttpMethod; - /** Default: `null` */ - body?: string | Buffer | Uint8Array | Readable | null | FormData; - /** Default: `null` */ - headers?: IncomingHttpHeaders | string[] | null; - /** Query string params to be embedded in the request URL. Default: `null` */ - query?: Record; - /** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */ - idempotent?: boolean; - /** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. */ - blocking?: boolean; - /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */ - upgrade?: boolean | string | null; - /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */ - headersTimeout?: number | null; - /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */ - bodyTimeout?: number | null; - /** Whether the request should stablish a keep-alive or not. Default `false` */ - reset?: boolean; - /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */ - throwOnError?: boolean; - /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server*/ - expectContinue?: boolean; - } - export interface ConnectOptions { - path: string; - /** Default: `null` */ - headers?: IncomingHttpHeaders | string[] | null; - /** Default: `null` */ - signal?: AbortSignal | EventEmitter | null; - /** This argument parameter is passed through to `ConnectData` */ - opaque?: unknown; - /** Default: 0 */ - maxRedirections?: number; - /** Default: `null` */ - responseHeader?: 'raw' | null; - } - export interface RequestOptions extends DispatchOptions { - /** Default: `null` */ - opaque?: unknown; - /** Default: `null` */ - signal?: AbortSignal | EventEmitter | null; - /** Default: 0 */ - maxRedirections?: number; - /** Default: `null` */ - onInfo?: (info: { statusCode: number, headers: Record }) => void; - /** Default: `null` */ - responseHeader?: 'raw' | null; - /** Default: `64 KiB` */ - highWaterMark?: number; - } - export interface PipelineOptions extends RequestOptions { - /** `true` if the `handler` will return an object stream. Default: `false` */ - objectMode?: boolean; - } - export interface UpgradeOptions { - path: string; - /** Default: `'GET'` */ - method?: string; - /** Default: `null` */ - headers?: IncomingHttpHeaders | string[] | null; - /** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */ - protocol?: string; - /** Default: `null` */ - signal?: AbortSignal | EventEmitter | null; - /** Default: 0 */ - maxRedirections?: number; - /** Default: `null` */ - responseHeader?: 'raw' | null; - } - export interface ConnectData { - statusCode: number; - headers: IncomingHttpHeaders; - socket: Duplex; - opaque: unknown; - } - export interface ResponseData { - statusCode: number; - headers: IncomingHttpHeaders; - body: BodyReadable & BodyMixin; - trailers: Record; - opaque: unknown; - context: object; - } - export interface PipelineHandlerData { - statusCode: number; - headers: IncomingHttpHeaders; - opaque: unknown; - body: BodyReadable; - context: object; - } - export interface StreamData { - opaque: unknown; - trailers: Record; - } - export interface UpgradeData { - headers: IncomingHttpHeaders; - socket: Duplex; - opaque: unknown; - } - export interface StreamFactoryData { - statusCode: number; - headers: IncomingHttpHeaders; - opaque: unknown; - context: object; - } - export type StreamFactory = (data: StreamFactoryData) => Writable; - export interface DispatchHandlers { - /** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */ - onConnect?(abort: () => void): void; - /** Invoked when an error has occurred. */ - onError?(err: Error): void; - /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */ - onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void; - /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */ - onHeaders?(statusCode: number, headers: Buffer[] | string[] | null, resume: () => void): boolean; - /** Invoked when response payload data is received. */ - onData?(chunk: Buffer): boolean; - /** Invoked when response payload and trailers have been received and the request has completed. */ - onComplete?(trailers: string[] | null): void; - /** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */ - onBodySent?(chunkSize: number, totalBytesSent: number): void; - } - export type PipelineHandler = (data: PipelineHandlerData) => Readable; - export type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'; - - /** - * @link https://fetch.spec.whatwg.org/#body-mixin - */ - interface BodyMixin { - readonly body?: never; // throws on node v16.6.0 - readonly bodyUsed: boolean; - arrayBuffer(): Promise; - blob(): Promise; - formData(): Promise; - json(): Promise; - text(): Promise; - } - - export interface DispatchInterceptor { - (dispatch: Dispatcher['dispatch']): Dispatcher['dispatch'] - } -} diff --git a/node_modules/undici-types/errors.d.ts b/node_modules/undici-types/errors.d.ts deleted file mode 100644 index 7923ddd..0000000 --- a/node_modules/undici-types/errors.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { IncomingHttpHeaders } from "./header"; -import Client from './client' - -export default Errors - -declare namespace Errors { - export class UndiciError extends Error { - name: string; - code: string; - } - - /** Connect timeout error. */ - export class ConnectTimeoutError extends UndiciError { - name: 'ConnectTimeoutError'; - code: 'UND_ERR_CONNECT_TIMEOUT'; - } - - /** A header exceeds the `headersTimeout` option. */ - export class HeadersTimeoutError extends UndiciError { - name: 'HeadersTimeoutError'; - code: 'UND_ERR_HEADERS_TIMEOUT'; - } - - /** Headers overflow error. */ - export class HeadersOverflowError extends UndiciError { - name: 'HeadersOverflowError' - code: 'UND_ERR_HEADERS_OVERFLOW' - } - - /** A body exceeds the `bodyTimeout` option. */ - export class BodyTimeoutError extends UndiciError { - name: 'BodyTimeoutError'; - code: 'UND_ERR_BODY_TIMEOUT'; - } - - export class ResponseStatusCodeError extends UndiciError { - constructor ( - message?: string, - statusCode?: number, - headers?: IncomingHttpHeaders | string[] | null, - body?: null | Record | string - ); - name: 'ResponseStatusCodeError'; - code: 'UND_ERR_RESPONSE_STATUS_CODE'; - body: null | Record | string - status: number - statusCode: number - headers: IncomingHttpHeaders | string[] | null; - } - - /** Passed an invalid argument. */ - export class InvalidArgumentError extends UndiciError { - name: 'InvalidArgumentError'; - code: 'UND_ERR_INVALID_ARG'; - } - - /** Returned an invalid value. */ - export class InvalidReturnValueError extends UndiciError { - name: 'InvalidReturnValueError'; - code: 'UND_ERR_INVALID_RETURN_VALUE'; - } - - /** The request has been aborted by the user. */ - export class RequestAbortedError extends UndiciError { - name: 'AbortError'; - code: 'UND_ERR_ABORTED'; - } - - /** Expected error with reason. */ - export class InformationalError extends UndiciError { - name: 'InformationalError'; - code: 'UND_ERR_INFO'; - } - - /** Request body length does not match content-length header. */ - export class RequestContentLengthMismatchError extends UndiciError { - name: 'RequestContentLengthMismatchError'; - code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'; - } - - /** Response body length does not match content-length header. */ - export class ResponseContentLengthMismatchError extends UndiciError { - name: 'ResponseContentLengthMismatchError'; - code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'; - } - - /** Trying to use a destroyed client. */ - export class ClientDestroyedError extends UndiciError { - name: 'ClientDestroyedError'; - code: 'UND_ERR_DESTROYED'; - } - - /** Trying to use a closed client. */ - export class ClientClosedError extends UndiciError { - name: 'ClientClosedError'; - code: 'UND_ERR_CLOSED'; - } - - /** There is an error with the socket. */ - export class SocketError extends UndiciError { - name: 'SocketError'; - code: 'UND_ERR_SOCKET'; - socket: Client.SocketInfo | null - } - - /** Encountered unsupported functionality. */ - export class NotSupportedError extends UndiciError { - name: 'NotSupportedError'; - code: 'UND_ERR_NOT_SUPPORTED'; - } - - /** No upstream has been added to the BalancedPool. */ - export class BalancedPoolMissingUpstreamError extends UndiciError { - name: 'MissingUpstreamError'; - code: 'UND_ERR_BPL_MISSING_UPSTREAM'; - } - - export class HTTPParserError extends UndiciError { - name: 'HTTPParserError'; - code: string; - } - - /** The response exceed the length allowed. */ - export class ResponseExceededMaxSizeError extends UndiciError { - name: 'ResponseExceededMaxSizeError'; - code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'; - } -} diff --git a/node_modules/undici-types/fetch.d.ts b/node_modules/undici-types/fetch.d.ts deleted file mode 100644 index fa4619c..0000000 --- a/node_modules/undici-types/fetch.d.ts +++ /dev/null @@ -1,209 +0,0 @@ -// based on https://github.com/Ethan-Arrowood/undici-fetch/blob/249269714db874351589d2d364a0645d5160ae71/index.d.ts (MIT license) -// and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license) -/// - -import { Blob } from 'buffer' -import { URL, URLSearchParams } from 'url' -import { ReadableStream } from 'stream/web' -import { FormData } from './formdata' - -import Dispatcher from './dispatcher' - -export type RequestInfo = string | URL | Request - -export declare function fetch ( - input: RequestInfo, - init?: RequestInit -): Promise - -export type BodyInit = - | ArrayBuffer - | AsyncIterable - | Blob - | FormData - | Iterable - | NodeJS.ArrayBufferView - | URLSearchParams - | null - | string - -export interface BodyMixin { - readonly body: ReadableStream | null - readonly bodyUsed: boolean - - readonly arrayBuffer: () => Promise - readonly blob: () => Promise - readonly formData: () => Promise - readonly json: () => Promise - readonly text: () => Promise -} - -export interface SpecIterator { - next(...args: [] | [TNext]): IteratorResult; -} - -export interface SpecIterableIterator extends SpecIterator { - [Symbol.iterator](): SpecIterableIterator; -} - -export interface SpecIterable { - [Symbol.iterator](): SpecIterator; -} - -export type HeadersInit = string[][] | Record> | Headers - -export declare class Headers implements SpecIterable<[string, string]> { - constructor (init?: HeadersInit) - readonly append: (name: string, value: string) => void - readonly delete: (name: string) => void - readonly get: (name: string) => string | null - readonly has: (name: string) => boolean - readonly set: (name: string, value: string) => void - readonly getSetCookie: () => string[] - readonly forEach: ( - callbackfn: (value: string, key: string, iterable: Headers) => void, - thisArg?: unknown - ) => void - - readonly keys: () => SpecIterableIterator - readonly values: () => SpecIterableIterator - readonly entries: () => SpecIterableIterator<[string, string]> - readonly [Symbol.iterator]: () => SpecIterator<[string, string]> -} - -export type RequestCache = - | 'default' - | 'force-cache' - | 'no-cache' - | 'no-store' - | 'only-if-cached' - | 'reload' - -export type RequestCredentials = 'omit' | 'include' | 'same-origin' - -type RequestDestination = - | '' - | 'audio' - | 'audioworklet' - | 'document' - | 'embed' - | 'font' - | 'image' - | 'manifest' - | 'object' - | 'paintworklet' - | 'report' - | 'script' - | 'sharedworker' - | 'style' - | 'track' - | 'video' - | 'worker' - | 'xslt' - -export interface RequestInit { - method?: string - keepalive?: boolean - headers?: HeadersInit - body?: BodyInit - redirect?: RequestRedirect - integrity?: string - signal?: AbortSignal - credentials?: RequestCredentials - mode?: RequestMode - referrer?: string - referrerPolicy?: ReferrerPolicy - window?: null - dispatcher?: Dispatcher - duplex?: RequestDuplex -} - -export type ReferrerPolicy = - | '' - | 'no-referrer' - | 'no-referrer-when-downgrade' - | 'origin' - | 'origin-when-cross-origin' - | 'same-origin' - | 'strict-origin' - | 'strict-origin-when-cross-origin' - | 'unsafe-url'; - -export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin' - -export type RequestRedirect = 'error' | 'follow' | 'manual' - -export type RequestDuplex = 'half' - -export declare class Request implements BodyMixin { - constructor (input: RequestInfo, init?: RequestInit) - - readonly cache: RequestCache - readonly credentials: RequestCredentials - readonly destination: RequestDestination - readonly headers: Headers - readonly integrity: string - readonly method: string - readonly mode: RequestMode - readonly redirect: RequestRedirect - readonly referrerPolicy: string - readonly url: string - - readonly keepalive: boolean - readonly signal: AbortSignal - readonly duplex: RequestDuplex - - readonly body: ReadableStream | null - readonly bodyUsed: boolean - - readonly arrayBuffer: () => Promise - readonly blob: () => Promise - readonly formData: () => Promise - readonly json: () => Promise - readonly text: () => Promise - - readonly clone: () => Request -} - -export interface ResponseInit { - readonly status?: number - readonly statusText?: string - readonly headers?: HeadersInit -} - -export type ResponseType = - | 'basic' - | 'cors' - | 'default' - | 'error' - | 'opaque' - | 'opaqueredirect' - -export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308 - -export declare class Response implements BodyMixin { - constructor (body?: BodyInit, init?: ResponseInit) - - readonly headers: Headers - readonly ok: boolean - readonly status: number - readonly statusText: string - readonly type: ResponseType - readonly url: string - readonly redirected: boolean - - readonly body: ReadableStream | null - readonly bodyUsed: boolean - - readonly arrayBuffer: () => Promise - readonly blob: () => Promise - readonly formData: () => Promise - readonly json: () => Promise - readonly text: () => Promise - - readonly clone: () => Response - - static error (): Response - static json(data: any, init?: ResponseInit): Response - static redirect (url: string | URL, status: ResponseRedirectStatus): Response -} diff --git a/node_modules/undici-types/file.d.ts b/node_modules/undici-types/file.d.ts deleted file mode 100644 index c695b7a..0000000 --- a/node_modules/undici-types/file.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/File.ts (MIT) -/// - -import { Blob } from 'buffer' - -export interface BlobPropertyBag { - type?: string - endings?: 'native' | 'transparent' -} - -export interface FilePropertyBag extends BlobPropertyBag { - /** - * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. - */ - lastModified?: number -} - -export declare class File extends Blob { - /** - * Creates a new File instance. - * - * @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). - * @param fileName The name of the file. - * @param options An options object containing optional attributes for the file. - */ - constructor(fileBits: ReadonlyArray, fileName: string, options?: FilePropertyBag) - - /** - * Name of the file referenced by the File object. - */ - readonly name: string - - /** - * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. - */ - readonly lastModified: number - - readonly [Symbol.toStringTag]: string -} diff --git a/node_modules/undici-types/filereader.d.ts b/node_modules/undici-types/filereader.d.ts deleted file mode 100644 index f05d231..0000000 --- a/node_modules/undici-types/filereader.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import { Blob } from 'buffer' -import { DOMException, Event, EventInit, EventTarget } from './patch' - -export declare class FileReader { - __proto__: EventTarget & FileReader - - constructor () - - readAsArrayBuffer (blob: Blob): void - readAsBinaryString (blob: Blob): void - readAsText (blob: Blob, encoding?: string): void - readAsDataURL (blob: Blob): void - - abort (): void - - static readonly EMPTY = 0 - static readonly LOADING = 1 - static readonly DONE = 2 - - readonly EMPTY = 0 - readonly LOADING = 1 - readonly DONE = 2 - - readonly readyState: number - - readonly result: string | ArrayBuffer | null - - readonly error: DOMException | null - - onloadstart: null | ((this: FileReader, event: ProgressEvent) => void) - onprogress: null | ((this: FileReader, event: ProgressEvent) => void) - onload: null | ((this: FileReader, event: ProgressEvent) => void) - onabort: null | ((this: FileReader, event: ProgressEvent) => void) - onerror: null | ((this: FileReader, event: ProgressEvent) => void) - onloadend: null | ((this: FileReader, event: ProgressEvent) => void) -} - -export interface ProgressEventInit extends EventInit { - lengthComputable?: boolean - loaded?: number - total?: number -} - -export declare class ProgressEvent { - __proto__: Event & ProgressEvent - - constructor (type: string, eventInitDict?: ProgressEventInit) - - readonly lengthComputable: boolean - readonly loaded: number - readonly total: number -} diff --git a/node_modules/undici-types/formdata.d.ts b/node_modules/undici-types/formdata.d.ts deleted file mode 100644 index df29a57..0000000 --- a/node_modules/undici-types/formdata.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT) -/// - -import { File } from './file' -import { SpecIterator, SpecIterableIterator } from './fetch' - -/** - * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs. - */ -declare type FormDataEntryValue = string | File - -/** - * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch(). - */ -export declare class FormData { - /** - * Appends a new value onto an existing key inside a FormData object, - * or adds the key if it does not already exist. - * - * The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values. - * - * @param name The name of the field whose data is contained in `value`. - * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string. - * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. - */ - append(name: string, value: unknown, fileName?: string): void - - /** - * Set a new value for an existing key inside FormData, - * or add the new field if it does not already exist. - * - * @param name The name of the field whose data is contained in `value`. - * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string. - * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. - * - */ - set(name: string, value: unknown, fileName?: string): void - - /** - * Returns the first value associated with a given key from within a `FormData` object. - * If you expect multiple values and want all of them, use the `getAll()` method instead. - * - * @param {string} name A name of the value you want to retrieve. - * - * @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null. - */ - get(name: string): FormDataEntryValue | null - - /** - * Returns all the values associated with a given key from within a `FormData` object. - * - * @param {string} name A name of the value you want to retrieve. - * - * @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list. - */ - getAll(name: string): FormDataEntryValue[] - - /** - * Returns a boolean stating whether a `FormData` object contains a certain key. - * - * @param name A string representing the name of the key you want to test for. - * - * @return A boolean value. - */ - has(name: string): boolean - - /** - * Deletes a key and its value(s) from a `FormData` object. - * - * @param name The name of the key you want to delete. - */ - delete(name: string): void - - /** - * Executes given callback function for each field of the FormData instance - */ - forEach: ( - callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void, - thisArg?: unknown - ) => void - - /** - * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object. - * Each key is a `string`. - */ - keys: () => SpecIterableIterator - - /** - * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object. - * Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue). - */ - values: () => SpecIterableIterator - - /** - * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs. - * The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue). - */ - entries: () => SpecIterableIterator<[string, FormDataEntryValue]> - - /** - * An alias for FormData#entries() - */ - [Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]> - - readonly [Symbol.toStringTag]: string -} diff --git a/node_modules/undici-types/global-dispatcher.d.ts b/node_modules/undici-types/global-dispatcher.d.ts deleted file mode 100644 index 728f95c..0000000 --- a/node_modules/undici-types/global-dispatcher.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import Dispatcher from "./dispatcher"; - -export { - getGlobalDispatcher, - setGlobalDispatcher -} - -declare function setGlobalDispatcher(dispatcher: DispatcherImplementation): void; -declare function getGlobalDispatcher(): Dispatcher; diff --git a/node_modules/undici-types/global-origin.d.ts b/node_modules/undici-types/global-origin.d.ts deleted file mode 100644 index 322542d..0000000 --- a/node_modules/undici-types/global-origin.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { - setGlobalOrigin, - getGlobalOrigin -} - -declare function setGlobalOrigin(origin: string | URL | undefined): void; -declare function getGlobalOrigin(): URL | undefined; \ No newline at end of file diff --git a/node_modules/undici-types/handlers.d.ts b/node_modules/undici-types/handlers.d.ts deleted file mode 100644 index eb4f5a9..0000000 --- a/node_modules/undici-types/handlers.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import Dispatcher from "./dispatcher"; - -export declare class RedirectHandler implements Dispatcher.DispatchHandlers{ - constructor (dispatch: Dispatcher, maxRedirections: number, opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers) -} - -export declare class DecoratorHandler implements Dispatcher.DispatchHandlers{ - constructor (handler: Dispatcher.DispatchHandlers) -} diff --git a/node_modules/undici-types/header.d.ts b/node_modules/undici-types/header.d.ts deleted file mode 100644 index bfdb329..0000000 --- a/node_modules/undici-types/header.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * The header type declaration of `undici`. - */ -export type IncomingHttpHeaders = Record; diff --git a/node_modules/undici-types/index.d.ts b/node_modules/undici-types/index.d.ts deleted file mode 100644 index 4589845..0000000 --- a/node_modules/undici-types/index.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import Dispatcher from'./dispatcher' -import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher' -import { setGlobalOrigin, getGlobalOrigin } from './global-origin' -import Pool from'./pool' -import { RedirectHandler, DecoratorHandler } from './handlers' - -import BalancedPool from './balanced-pool' -import Client from'./client' -import buildConnector from'./connector' -import errors from'./errors' -import Agent from'./agent' -import MockClient from'./mock-client' -import MockPool from'./mock-pool' -import MockAgent from'./mock-agent' -import mockErrors from'./mock-errors' -import ProxyAgent from'./proxy-agent' -import { request, pipeline, stream, connect, upgrade } from './api' - -export * from './cookies' -export * from './fetch' -export * from './file' -export * from './filereader' -export * from './formdata' -export * from './diagnostics-channel' -export * from './websocket' -export * from './content-type' -export * from './cache' -export { Interceptable } from './mock-interceptor' - -export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler } -export default Undici - -declare namespace Undici { - var Dispatcher: typeof import('./dispatcher').default - var Pool: typeof import('./pool').default; - var RedirectHandler: typeof import ('./handlers').RedirectHandler - var DecoratorHandler: typeof import ('./handlers').DecoratorHandler - var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor - var BalancedPool: typeof import('./balanced-pool').default; - var Client: typeof import('./client').default; - var buildConnector: typeof import('./connector').default; - var errors: typeof import('./errors').default; - var Agent: typeof import('./agent').default; - var setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher; - var getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher; - var request: typeof import('./api').request; - var stream: typeof import('./api').stream; - var pipeline: typeof import('./api').pipeline; - var connect: typeof import('./api').connect; - var upgrade: typeof import('./api').upgrade; - var MockClient: typeof import('./mock-client').default; - var MockPool: typeof import('./mock-pool').default; - var MockAgent: typeof import('./mock-agent').default; - var mockErrors: typeof import('./mock-errors').default; - var fetch: typeof import('./fetch').fetch; - var Headers: typeof import('./fetch').Headers; - var Response: typeof import('./fetch').Response; - var Request: typeof import('./fetch').Request; - var FormData: typeof import('./formdata').FormData; - var File: typeof import('./file').File; - var FileReader: typeof import('./filereader').FileReader; - var caches: typeof import('./cache').caches; -} diff --git a/node_modules/undici-types/interceptors.d.ts b/node_modules/undici-types/interceptors.d.ts deleted file mode 100644 index 047ac17..0000000 --- a/node_modules/undici-types/interceptors.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import Dispatcher from "./dispatcher"; - -type RedirectInterceptorOpts = { maxRedirections?: number } - -export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatchInterceptor diff --git a/node_modules/undici-types/mock-agent.d.ts b/node_modules/undici-types/mock-agent.d.ts deleted file mode 100644 index 98cd645..0000000 --- a/node_modules/undici-types/mock-agent.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import Agent from './agent' -import Dispatcher from './dispatcher' -import { Interceptable, MockInterceptor } from './mock-interceptor' -import MockDispatch = MockInterceptor.MockDispatch; - -export default MockAgent - -interface PendingInterceptor extends MockDispatch { - origin: string; -} - -/** A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead. */ -declare class MockAgent extends Dispatcher { - constructor(options?: MockAgent.Options) - /** Creates and retrieves mock Dispatcher instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned. */ - get(origin: string): TInterceptable; - get(origin: RegExp): TInterceptable; - get(origin: ((origin: string) => boolean)): TInterceptable; - /** Dispatches a mocked request. */ - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; - /** Closes the mock agent and waits for registered mock pools and clients to also close before resolving. */ - close(): Promise; - /** Disables mocking in MockAgent. */ - deactivate(): void; - /** Enables mocking in a MockAgent instance. When instantiated, a MockAgent is automatically activated. Therefore, this method is only effective after `MockAgent.deactivate` has been called. */ - activate(): void; - /** Define host matchers so only matching requests that aren't intercepted by the mock dispatchers will be attempted. */ - enableNetConnect(): void; - enableNetConnect(host: string): void; - enableNetConnect(host: RegExp): void; - enableNetConnect(host: ((host: string) => boolean)): void; - /** Causes all requests to throw when requests are not matched in a MockAgent intercept. */ - disableNetConnect(): void; - pendingInterceptors(): PendingInterceptor[]; - assertNoPendingInterceptors(options?: { - pendingInterceptorsFormatter?: PendingInterceptorsFormatter; - }): void; -} - -interface PendingInterceptorsFormatter { - format(pendingInterceptors: readonly PendingInterceptor[]): string; -} - -declare namespace MockAgent { - /** MockAgent options. */ - export interface Options extends Agent.Options { - /** A custom agent to be encapsulated by the MockAgent. */ - agent?: Agent; - } -} diff --git a/node_modules/undici-types/mock-client.d.ts b/node_modules/undici-types/mock-client.d.ts deleted file mode 100644 index 51d008c..0000000 --- a/node_modules/undici-types/mock-client.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Client from './client' -import Dispatcher from './dispatcher' -import MockAgent from './mock-agent' -import { MockInterceptor, Interceptable } from './mock-interceptor' - -export default MockClient - -/** MockClient extends the Client API and allows one to mock requests. */ -declare class MockClient extends Client implements Interceptable { - constructor(origin: string, options: MockClient.Options); - /** Intercepts any matching requests that use the same origin as this mock client. */ - intercept(options: MockInterceptor.Options): MockInterceptor; - /** Dispatches a mocked request. */ - dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean; - /** Closes the mock client and gracefully waits for enqueued requests to complete. */ - close(): Promise; -} - -declare namespace MockClient { - /** MockClient options. */ - export interface Options extends Client.Options { - /** The agent to associate this MockClient with. */ - agent: MockAgent; - } -} diff --git a/node_modules/undici-types/mock-errors.d.ts b/node_modules/undici-types/mock-errors.d.ts deleted file mode 100644 index 3d9e727..0000000 --- a/node_modules/undici-types/mock-errors.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Errors from './errors' - -export default MockErrors - -declare namespace MockErrors { - /** The request does not match any registered mock dispatches. */ - export class MockNotMatchedError extends Errors.UndiciError { - constructor(message?: string); - name: 'MockNotMatchedError'; - code: 'UND_MOCK_ERR_MOCK_NOT_MATCHED'; - } -} diff --git a/node_modules/undici-types/mock-interceptor.d.ts b/node_modules/undici-types/mock-interceptor.d.ts deleted file mode 100644 index 6b3961c..0000000 --- a/node_modules/undici-types/mock-interceptor.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { IncomingHttpHeaders } from './header' -import Dispatcher from './dispatcher'; -import { BodyInit, Headers } from './fetch' - -export { - Interceptable, - MockInterceptor, - MockScope -} - -/** The scope associated with a mock dispatch. */ -declare class MockScope { - constructor(mockDispatch: MockInterceptor.MockDispatch); - /** Delay a reply by a set amount of time in ms. */ - delay(waitInMs: number): MockScope; - /** Persist the defined mock data for the associated reply. It will return the defined mock data indefinitely. */ - persist(): MockScope; - /** Define a reply for a set amount of matching requests. */ - times(repeatTimes: number): MockScope; -} - -/** The interceptor for a Mock. */ -declare class MockInterceptor { - constructor(options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[]); - /** Mock an undici request with the defined reply. */ - reply(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback): MockScope; - reply( - statusCode: number, - data?: TData | Buffer | string | MockInterceptor.MockResponseDataHandler, - responseOptions?: MockInterceptor.MockResponseOptions - ): MockScope; - /** Mock an undici request by throwing the defined reply error. */ - replyWithError(error: TError): MockScope; - /** Set default reply headers on the interceptor for subsequent mocked replies. */ - defaultReplyHeaders(headers: IncomingHttpHeaders): MockInterceptor; - /** Set default reply trailers on the interceptor for subsequent mocked replies. */ - defaultReplyTrailers(trailers: Record): MockInterceptor; - /** Set automatically calculated content-length header on subsequent mocked replies. */ - replyContentLength(): MockInterceptor; -} - -declare namespace MockInterceptor { - /** MockInterceptor options. */ - export interface Options { - /** Path to intercept on. */ - path: string | RegExp | ((path: string) => boolean); - /** Method to intercept on. Defaults to GET. */ - method?: string | RegExp | ((method: string) => boolean); - /** Body to intercept on. */ - body?: string | RegExp | ((body: string) => boolean); - /** Headers to intercept on. */ - headers?: Record boolean)> | ((headers: Record) => boolean); - /** Query params to intercept on */ - query?: Record; - } - export interface MockDispatch extends Options { - times: number | null; - persist: boolean; - consumed: boolean; - data: MockDispatchData; - } - export interface MockDispatchData extends MockResponseOptions { - error: TError | null; - statusCode?: number; - data?: TData | string; - } - export interface MockResponseOptions { - headers?: IncomingHttpHeaders; - trailers?: Record; - } - - export interface MockResponseCallbackOptions { - path: string; - origin: string; - method: string; - body?: BodyInit | Dispatcher.DispatchOptions['body']; - headers: Headers | Record; - maxRedirections: number; - } - - export type MockResponseDataHandler = ( - opts: MockResponseCallbackOptions - ) => TData | Buffer | string; - - export type MockReplyOptionsCallback = ( - opts: MockResponseCallbackOptions - ) => { statusCode: number, data?: TData | Buffer | string, responseOptions?: MockResponseOptions } -} - -interface Interceptable extends Dispatcher { - /** Intercepts any matching requests that use the same origin as this mock client. */ - intercept(options: MockInterceptor.Options): MockInterceptor; -} diff --git a/node_modules/undici-types/mock-pool.d.ts b/node_modules/undici-types/mock-pool.d.ts deleted file mode 100644 index 39e709a..0000000 --- a/node_modules/undici-types/mock-pool.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Pool from './pool' -import MockAgent from './mock-agent' -import { Interceptable, MockInterceptor } from './mock-interceptor' -import Dispatcher from './dispatcher' - -export default MockPool - -/** MockPool extends the Pool API and allows one to mock requests. */ -declare class MockPool extends Pool implements Interceptable { - constructor(origin: string, options: MockPool.Options); - /** Intercepts any matching requests that use the same origin as this mock pool. */ - intercept(options: MockInterceptor.Options): MockInterceptor; - /** Dispatches a mocked request. */ - dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean; - /** Closes the mock pool and gracefully waits for enqueued requests to complete. */ - close(): Promise; -} - -declare namespace MockPool { - /** MockPool options. */ - export interface Options extends Pool.Options { - /** The agent to associate this MockPool with. */ - agent: MockAgent; - } -} diff --git a/node_modules/undici-types/package.json b/node_modules/undici-types/package.json deleted file mode 100644 index be7aa4c..0000000 --- a/node_modules/undici-types/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "undici-types", - "version": "5.26.5", - "description": "A stand-alone types package for Undici", - "homepage": "https://undici.nodejs.org", - "bugs": { - "url": "https://github.com/nodejs/undici/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/nodejs/undici.git" - }, - "license": "MIT", - "types": "index.d.ts", - "files": [ - "*.d.ts" - ], - "contributors": [ - { - "name": "Daniele Belardi", - "url": "https://github.com/dnlup", - "author": true - }, - { - "name": "Ethan Arrowood", - "url": "https://github.com/ethan-arrowood", - "author": true - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina", - "author": true - }, - { - "name": "Matthew Aitken", - "url": "https://github.com/KhafraDev", - "author": true - }, - { - "name": "Robert Nagy", - "url": "https://github.com/ronag", - "author": true - }, - { - "name": "Szymon Marczak", - "url": "https://github.com/szmarczak", - "author": true - }, - { - "name": "Tomas Della Vedova", - "url": "https://github.com/delvedor", - "author": true - } - ] -} \ No newline at end of file diff --git a/node_modules/undici-types/patch.d.ts b/node_modules/undici-types/patch.d.ts deleted file mode 100644 index 3871acf..0000000 --- a/node_modules/undici-types/patch.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/// - -// See https://github.com/nodejs/undici/issues/1740 - -export type DOMException = typeof globalThis extends { DOMException: infer T } - ? T - : any - -export type EventTarget = typeof globalThis extends { EventTarget: infer T } - ? T - : { - addEventListener( - type: string, - listener: any, - options?: any, - ): void - dispatchEvent(event: Event): boolean - removeEventListener( - type: string, - listener: any, - options?: any | boolean, - ): void - } - -export type Event = typeof globalThis extends { Event: infer T } - ? T - : { - readonly bubbles: boolean - cancelBubble: () => void - readonly cancelable: boolean - readonly composed: boolean - composedPath(): [EventTarget?] - readonly currentTarget: EventTarget | null - readonly defaultPrevented: boolean - readonly eventPhase: 0 | 2 - readonly isTrusted: boolean - preventDefault(): void - returnValue: boolean - readonly srcElement: EventTarget | null - stopImmediatePropagation(): void - stopPropagation(): void - readonly target: EventTarget | null - readonly timeStamp: number - readonly type: string - } - -export interface EventInit { - bubbles?: boolean - cancelable?: boolean - composed?: boolean -} - -export interface EventListenerOptions { - capture?: boolean -} - -export interface AddEventListenerOptions extends EventListenerOptions { - once?: boolean - passive?: boolean - signal?: AbortSignal -} - -export type EventListenerOrEventListenerObject = EventListener | EventListenerObject - -export interface EventListenerObject { - handleEvent (object: Event): void -} - -export interface EventListener { - (evt: Event): void -} diff --git a/node_modules/undici-types/pool-stats.d.ts b/node_modules/undici-types/pool-stats.d.ts deleted file mode 100644 index 8b6d2bf..0000000 --- a/node_modules/undici-types/pool-stats.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Pool from "./pool" - -export default PoolStats - -declare class PoolStats { - constructor(pool: Pool); - /** Number of open socket connections in this pool. */ - connected: number; - /** Number of open socket connections in this pool that do not have an active request. */ - free: number; - /** Number of pending requests across all clients in this pool. */ - pending: number; - /** Number of queued requests across all clients in this pool. */ - queued: number; - /** Number of currently active requests across all clients in this pool. */ - running: number; - /** Number of active, pending, or queued requests across all clients in this pool. */ - size: number; -} diff --git a/node_modules/undici-types/pool.d.ts b/node_modules/undici-types/pool.d.ts deleted file mode 100644 index 7747d48..0000000 --- a/node_modules/undici-types/pool.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import Client from './client' -import TPoolStats from './pool-stats' -import { URL } from 'url' -import Dispatcher from "./dispatcher"; - -export default Pool - -declare class Pool extends Dispatcher { - constructor(url: string | URL, options?: Pool.Options) - /** `true` after `pool.close()` has been called. */ - closed: boolean; - /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ - destroyed: boolean; - /** Aggregate stats for a Pool. */ - readonly stats: TPoolStats; -} - -declare namespace Pool { - export type PoolStats = TPoolStats; - export interface Options extends Client.Options { - /** Default: `(origin, opts) => new Client(origin, opts)`. */ - factory?(origin: URL, opts: object): Dispatcher; - /** The max number of clients to create. `null` if no limit. Default `null`. */ - connections?: number | null; - - interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options["interceptors"] - } -} diff --git a/node_modules/undici-types/proxy-agent.d.ts b/node_modules/undici-types/proxy-agent.d.ts deleted file mode 100644 index 96b2638..0000000 --- a/node_modules/undici-types/proxy-agent.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import Agent from './agent' -import buildConnector from './connector'; -import Client from './client' -import Dispatcher from './dispatcher' -import { IncomingHttpHeaders } from './header' -import Pool from './pool' - -export default ProxyAgent - -declare class ProxyAgent extends Dispatcher { - constructor(options: ProxyAgent.Options | string) - - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; - close(): Promise; -} - -declare namespace ProxyAgent { - export interface Options extends Agent.Options { - uri: string; - /** - * @deprecated use opts.token - */ - auth?: string; - token?: string; - headers?: IncomingHttpHeaders; - requestTls?: buildConnector.BuildOptions; - proxyTls?: buildConnector.BuildOptions; - clientFactory?(origin: URL, opts: object): Dispatcher; - } -} diff --git a/node_modules/undici-types/readable.d.ts b/node_modules/undici-types/readable.d.ts deleted file mode 100644 index 4549a8c..0000000 --- a/node_modules/undici-types/readable.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Readable } from "stream"; -import { Blob } from 'buffer' - -export default BodyReadable - -declare class BodyReadable extends Readable { - constructor( - resume?: (this: Readable, size: number) => void | null, - abort?: () => void | null, - contentType?: string - ) - - /** Consumes and returns the body as a string - * https://fetch.spec.whatwg.org/#dom-body-text - */ - text(): Promise - - /** Consumes and returns the body as a JavaScript Object - * https://fetch.spec.whatwg.org/#dom-body-json - */ - json(): Promise - - /** Consumes and returns the body as a Blob - * https://fetch.spec.whatwg.org/#dom-body-blob - */ - blob(): Promise - - /** Consumes and returns the body as an ArrayBuffer - * https://fetch.spec.whatwg.org/#dom-body-arraybuffer - */ - arrayBuffer(): Promise - - /** Not implemented - * - * https://fetch.spec.whatwg.org/#dom-body-formdata - */ - formData(): Promise - - /** Returns true if the body is not null and the body has been consumed - * - * Otherwise, returns false - * - * https://fetch.spec.whatwg.org/#dom-body-bodyused - */ - readonly bodyUsed: boolean - - /** Throws on node 16.6.0 - * - * If body is null, it should return null as the body - * - * If body is not null, should return the body as a ReadableStream - * - * https://fetch.spec.whatwg.org/#dom-body-body - */ - readonly body: never | undefined - - /** Dumps the response body by reading `limit` number of bytes. - * @param opts.limit Number of bytes to read (optional) - Default: 262144 - */ - dump(opts?: { limit: number }): Promise -} diff --git a/node_modules/undici-types/webidl.d.ts b/node_modules/undici-types/webidl.d.ts deleted file mode 100644 index 40cfe06..0000000 --- a/node_modules/undici-types/webidl.d.ts +++ /dev/null @@ -1,220 +0,0 @@ -// These types are not exported, and are only used internally - -/** - * Take in an unknown value and return one that is of type T - */ -type Converter = (object: unknown) => T - -type SequenceConverter = (object: unknown) => T[] - -type RecordConverter = (object: unknown) => Record - -interface ConvertToIntOpts { - clamp?: boolean - enforceRange?: boolean -} - -interface WebidlErrors { - exception (opts: { header: string, message: string }): TypeError - /** - * @description Throw an error when conversion from one type to another has failed - */ - conversionFailed (opts: { - prefix: string - argument: string - types: string[] - }): TypeError - /** - * @description Throw an error when an invalid argument is provided - */ - invalidArgument (opts: { - prefix: string - value: string - type: string - }): TypeError -} - -interface WebidlUtil { - /** - * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values - */ - Type (object: unknown): - | 'Undefined' - | 'Boolean' - | 'String' - | 'Symbol' - | 'Number' - | 'BigInt' - | 'Null' - | 'Object' - - /** - * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint - */ - ConvertToInt ( - V: unknown, - bitLength: number, - signedness: 'signed' | 'unsigned', - opts?: ConvertToIntOpts - ): number - - /** - * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint - */ - IntegerPart (N: number): number -} - -interface WebidlConverters { - /** - * @see https://webidl.spec.whatwg.org/#es-DOMString - */ - DOMString (V: unknown, opts?: { - legacyNullToEmptyString: boolean - }): string - - /** - * @see https://webidl.spec.whatwg.org/#es-ByteString - */ - ByteString (V: unknown): string - - /** - * @see https://webidl.spec.whatwg.org/#es-USVString - */ - USVString (V: unknown): string - - /** - * @see https://webidl.spec.whatwg.org/#es-boolean - */ - boolean (V: unknown): boolean - - /** - * @see https://webidl.spec.whatwg.org/#es-any - */ - any (V: Value): Value - - /** - * @see https://webidl.spec.whatwg.org/#es-long-long - */ - ['long long'] (V: unknown): number - - /** - * @see https://webidl.spec.whatwg.org/#es-unsigned-long-long - */ - ['unsigned long long'] (V: unknown): number - - /** - * @see https://webidl.spec.whatwg.org/#es-unsigned-long - */ - ['unsigned long'] (V: unknown): number - - /** - * @see https://webidl.spec.whatwg.org/#es-unsigned-short - */ - ['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number - - /** - * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer - */ - ArrayBuffer (V: unknown): ArrayBufferLike - ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer - - /** - * @see https://webidl.spec.whatwg.org/#es-buffer-source-types - */ - TypedArray ( - V: unknown, - TypedArray: NodeJS.TypedArray | ArrayBufferLike - ): NodeJS.TypedArray | ArrayBufferLike - TypedArray ( - V: unknown, - TypedArray: NodeJS.TypedArray | ArrayBufferLike, - opts?: { allowShared: false } - ): NodeJS.TypedArray | ArrayBuffer - - /** - * @see https://webidl.spec.whatwg.org/#es-buffer-source-types - */ - DataView (V: unknown, opts?: { allowShared: boolean }): DataView - - /** - * @see https://webidl.spec.whatwg.org/#BufferSource - */ - BufferSource ( - V: unknown, - opts?: { allowShared: boolean } - ): NodeJS.TypedArray | ArrayBufferLike | DataView - - ['sequence']: SequenceConverter - - ['sequence>']: SequenceConverter - - ['record']: RecordConverter - - [Key: string]: (...args: any[]) => unknown -} - -export interface Webidl { - errors: WebidlErrors - util: WebidlUtil - converters: WebidlConverters - - /** - * @description Performs a brand-check on {@param V} to ensure it is a - * {@param cls} object. - */ - brandCheck (V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface - - /** - * @see https://webidl.spec.whatwg.org/#es-sequence - * @description Convert a value, V, to a WebIDL sequence type. - */ - sequenceConverter (C: Converter): SequenceConverter - - illegalConstructor (): never - - /** - * @see https://webidl.spec.whatwg.org/#es-to-record - * @description Convert a value, V, to a WebIDL record type. - */ - recordConverter ( - keyConverter: Converter, - valueConverter: Converter - ): RecordConverter - - /** - * Similar to {@link Webidl.brandCheck} but allows skipping the check if third party - * interfaces are allowed. - */ - interfaceConverter (cls: Interface): ( - V: unknown, - opts?: { strict: boolean } - ) => asserts V is typeof cls - - // TODO(@KhafraDev): a type could likely be implemented that can infer the return type - // from the converters given? - /** - * Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are - * allowed, values allowed, optional and required keys. Auto converts the value to - * a type given a converter. - */ - dictionaryConverter (converters: { - key: string, - defaultValue?: unknown, - required?: boolean, - converter: (...args: unknown[]) => unknown, - allowedValues?: unknown[] - }[]): (V: unknown) => Record - - /** - * @see https://webidl.spec.whatwg.org/#idl-nullable-type - * @description allows a type, V, to be null - */ - nullableConverter ( - converter: Converter - ): (V: unknown) => ReturnType | null - - argumentLengthCheck (args: { length: number }, min: number, context: { - header: string - message?: string - }): void -} diff --git a/node_modules/undici-types/websocket.d.ts b/node_modules/undici-types/websocket.d.ts deleted file mode 100644 index 15a357d..0000000 --- a/node_modules/undici-types/websocket.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/// - -import type { Blob } from 'buffer' -import type { MessagePort } from 'worker_threads' -import { - EventTarget, - Event, - EventInit, - EventListenerOptions, - AddEventListenerOptions, - EventListenerOrEventListenerObject -} from './patch' -import Dispatcher from './dispatcher' -import { HeadersInit } from './fetch' - -export type BinaryType = 'blob' | 'arraybuffer' - -interface WebSocketEventMap { - close: CloseEvent - error: Event - message: MessageEvent - open: Event -} - -interface WebSocket extends EventTarget { - binaryType: BinaryType - - readonly bufferedAmount: number - readonly extensions: string - - onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null - onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null - onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null - onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null - - readonly protocol: string - readonly readyState: number - readonly url: string - - close(code?: number, reason?: string): void - send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void - - readonly CLOSED: number - readonly CLOSING: number - readonly CONNECTING: number - readonly OPEN: number - - addEventListener( - type: K, - listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, - options?: boolean | AddEventListenerOptions - ): void - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions - ): void - removeEventListener( - type: K, - listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, - options?: boolean | EventListenerOptions - ): void - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions - ): void -} - -export declare const WebSocket: { - prototype: WebSocket - new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket - readonly CLOSED: number - readonly CLOSING: number - readonly CONNECTING: number - readonly OPEN: number -} - -interface CloseEventInit extends EventInit { - code?: number - reason?: string - wasClean?: boolean -} - -interface CloseEvent extends Event { - readonly code: number - readonly reason: string - readonly wasClean: boolean -} - -export declare const CloseEvent: { - prototype: CloseEvent - new (type: string, eventInitDict?: CloseEventInit): CloseEvent -} - -interface MessageEventInit extends EventInit { - data?: T - lastEventId?: string - origin?: string - ports?: (typeof MessagePort)[] - source?: typeof MessagePort | null -} - -interface MessageEvent extends Event { - readonly data: T - readonly lastEventId: string - readonly origin: string - readonly ports: ReadonlyArray - readonly source: typeof MessagePort | null - initMessageEvent( - type: string, - bubbles?: boolean, - cancelable?: boolean, - data?: any, - origin?: string, - lastEventId?: string, - source?: typeof MessagePort | null, - ports?: (typeof MessagePort)[] - ): void; -} - -export declare const MessageEvent: { - prototype: MessageEvent - new(type: string, eventInitDict?: MessageEventInit): MessageEvent -} - -interface WebSocketInit { - protocols?: string | string[], - dispatcher?: Dispatcher, - headers?: HeadersInit -} diff --git a/node_modules/update-browserslist-db/LICENSE b/node_modules/update-browserslist-db/LICENSE deleted file mode 100644 index 377ae1b..0000000 --- a/node_modules/update-browserslist-db/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2022 Andrey Sitnik and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/update-browserslist-db/README.md b/node_modules/update-browserslist-db/README.md deleted file mode 100644 index d7a4e2a..0000000 --- a/node_modules/update-browserslist-db/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Update Browserslist DB - -Browserslist logo by Anton Popov - -CLI tool to update `caniuse-lite` with browsers DB -from [Browserslist](https://github.com/browserslist/browserslist/) config. - -Some queries like `last 2 version` or `>1%` depends on actual data -from `caniuse-lite`. - -```sh -npx update-browserslist-db@latest -``` - - - Sponsored by Evil Martians - - -## Docs -Read full docs **[here](https://github.com/browserslist/update-db#readme)**. diff --git a/node_modules/update-browserslist-db/check-npm-version.js b/node_modules/update-browserslist-db/check-npm-version.js deleted file mode 100644 index 5a37592..0000000 --- a/node_modules/update-browserslist-db/check-npm-version.js +++ /dev/null @@ -1,16 +0,0 @@ -let { execSync } = require('child_process') -let pico = require('picocolors') - -try { - let version = parseInt(execSync('npm -v')) - if (version <= 6) { - process.stderr.write( - pico.red( - 'Update npm or call ' + - pico.yellow('npx update-browserslist-db@latest') + - '\n' - ) - ) - process.exit(1) - } -} catch (e) {} diff --git a/node_modules/update-browserslist-db/cli.js b/node_modules/update-browserslist-db/cli.js deleted file mode 100644 index 1388e94..0000000 --- a/node_modules/update-browserslist-db/cli.js +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node - -let { readFileSync } = require('fs') -let { join } = require('path') - -require('./check-npm-version') -let updateDb = require('./') - -const ROOT = __dirname - -function getPackage() { - return JSON.parse(readFileSync(join(ROOT, 'package.json'))) -} - -let args = process.argv.slice(2) - -let USAGE = 'Usage:\n npx update-browserslist-db\n' - -function isArg(arg) { - return args.some(i => i === arg) -} - -function error(msg) { - process.stderr.write('update-browserslist-db: ' + msg + '\n') - process.exit(1) -} - -if (isArg('--help') || isArg('-h')) { - process.stdout.write(getPackage().description + '.\n\n' + USAGE + '\n') -} else if (isArg('--version') || isArg('-v')) { - process.stdout.write('browserslist-lint ' + getPackage().version + '\n') -} else { - try { - updateDb() - } catch (e) { - if (e.name === 'BrowserslistUpdateError') { - error(e.message) - } else { - throw e - } - } -} diff --git a/node_modules/update-browserslist-db/index.d.ts b/node_modules/update-browserslist-db/index.d.ts deleted file mode 100644 index 05ef411..0000000 --- a/node_modules/update-browserslist-db/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Run update and print output to terminal. - */ -declare function updateDb(print?: (str: string) => void): Promise - -export = updateDb diff --git a/node_modules/update-browserslist-db/index.js b/node_modules/update-browserslist-db/index.js deleted file mode 100644 index 7fc0d3a..0000000 --- a/node_modules/update-browserslist-db/index.js +++ /dev/null @@ -1,322 +0,0 @@ -let { existsSync, readFileSync, writeFileSync } = require('fs') -let { execSync } = require('child_process') -let { join } = require('path') -let escalade = require('escalade/sync') -let pico = require('picocolors') - -const { detectEOL, detectIndent } = require('./utils') - -function BrowserslistUpdateError(message) { - this.name = 'BrowserslistUpdateError' - this.message = message - this.browserslist = true - if (Error.captureStackTrace) { - Error.captureStackTrace(this, BrowserslistUpdateError) - } -} - -BrowserslistUpdateError.prototype = Error.prototype - -/* c8 ignore next 3 */ -function defaultPrint(str) { - process.stdout.write(str) -} - -function detectLockfile() { - let packageDir = escalade('.', (dir, names) => { - return names.indexOf('package.json') !== -1 ? dir : '' - }) - - if (!packageDir) { - throw new BrowserslistUpdateError( - 'Cannot find package.json. ' + - 'Is this the right directory to run `npx update-browserslist-db` in?' - ) - } - - let lockfileNpm = join(packageDir, 'package-lock.json') - let lockfileShrinkwrap = join(packageDir, 'npm-shrinkwrap.json') - let lockfileYarn = join(packageDir, 'yarn.lock') - let lockfilePnpm = join(packageDir, 'pnpm-lock.yaml') - - if (existsSync(lockfilePnpm)) { - return { file: lockfilePnpm, mode: 'pnpm' } - } else if (existsSync(lockfileNpm)) { - return { file: lockfileNpm, mode: 'npm' } - } else if (existsSync(lockfileYarn)) { - let lock = { file: lockfileYarn, mode: 'yarn' } - lock.content = readFileSync(lock.file).toString() - lock.version = /# yarn lockfile v1/.test(lock.content) ? 1 : 2 - return lock - } else if (existsSync(lockfileShrinkwrap)) { - return { file: lockfileShrinkwrap, mode: 'npm' } - } - throw new BrowserslistUpdateError( - 'No lockfile found. Run "npm install", "yarn install" or "pnpm install"' - ) -} - -function getLatestInfo(lock) { - if (lock.mode === 'yarn') { - if (lock.version === 1) { - return JSON.parse(execSync('yarnpkg info caniuse-lite --json').toString()) - .data - } else { - return JSON.parse( - execSync('yarnpkg npm info caniuse-lite --json').toString() - ) - } - } - if (lock.mode === 'pnpm') { - return JSON.parse(execSync('pnpm info caniuse-lite --json').toString()) - } - return JSON.parse(execSync('npm show caniuse-lite --json').toString()) -} - -function getBrowsers() { - let browserslist = require('browserslist') - return browserslist().reduce((result, entry) => { - if (!result[entry[0]]) { - result[entry[0]] = [] - } - result[entry[0]].push(entry[1]) - return result - }, {}) -} - -function diffBrowsers(old, current) { - let browsers = Object.keys(old).concat( - Object.keys(current).filter(browser => old[browser] === undefined) - ) - return browsers - .map(browser => { - let oldVersions = old[browser] || [] - let currentVersions = current[browser] || [] - let common = oldVersions.filter(v => currentVersions.includes(v)) - let added = currentVersions.filter(v => !common.includes(v)) - let removed = oldVersions.filter(v => !common.includes(v)) - return removed - .map(v => pico.red('- ' + browser + ' ' + v)) - .concat(added.map(v => pico.green('+ ' + browser + ' ' + v))) - }) - .reduce((result, array) => result.concat(array), []) - .join('\n') -} - -function updateNpmLockfile(lock, latest) { - let metadata = { latest, versions: [] } - let content = deletePackage(JSON.parse(lock.content), metadata) - metadata.content = JSON.stringify(content, null, detectIndent(lock.content)) - return metadata -} - -function deletePackage(node, metadata) { - if (node.dependencies) { - if (node.dependencies['caniuse-lite']) { - let version = node.dependencies['caniuse-lite'].version - metadata.versions[version] = true - delete node.dependencies['caniuse-lite'] - } - for (let i in node.dependencies) { - node.dependencies[i] = deletePackage(node.dependencies[i], metadata) - } - } - if (node.packages) { - for (let path in node.packages) { - if (path.endsWith('/caniuse-lite')) { - metadata.versions[node.packages[path].version] = true - delete node.packages[path] - } - } - } - return node -} - -let yarnVersionRe = /version "(.*?)"/ - -function updateYarnLockfile(lock, latest) { - let blocks = lock.content.split(/(\n{2,})/).map(block => { - return block.split('\n') - }) - let versions = {} - blocks.forEach(lines => { - if (lines[0].indexOf('caniuse-lite@') !== -1) { - let match = yarnVersionRe.exec(lines[1]) - versions[match[1]] = true - if (match[1] !== latest.version) { - lines[1] = lines[1].replace( - /version "[^"]+"/, - 'version "' + latest.version + '"' - ) - lines[2] = lines[2].replace( - /resolved "[^"]+"/, - 'resolved "' + latest.dist.tarball + '"' - ) - if (lines.length === 4) { - lines[3] = latest.dist.integrity - ? lines[3].replace( - /integrity .+/, - 'integrity ' + latest.dist.integrity - ) - : '' - } - } - } - }) - let content = blocks.map(lines => lines.join('\n')).join('') - return { content, versions } -} - -function updateLockfile(lock, latest) { - if (!lock.content) lock.content = readFileSync(lock.file).toString() - - let updatedLockFile - if (lock.mode === 'yarn') { - updatedLockFile = updateYarnLockfile(lock, latest) - } else { - updatedLockFile = updateNpmLockfile(lock, latest) - } - updatedLockFile.content = updatedLockFile.content.replace( - /\n/g, - detectEOL(lock.content) - ) - return updatedLockFile -} - -function updatePackageManually(print, lock, latest) { - let lockfileData = updateLockfile(lock, latest) - let caniuseVersions = Object.keys(lockfileData.versions).sort() - if (caniuseVersions.length === 1 && caniuseVersions[0] === latest.version) { - print( - 'Installed version: ' + - pico.bold(pico.green(caniuseVersions[0])) + - '\n' + - pico.bold(pico.green('caniuse-lite is up to date')) + - '\n' - ) - return - } - - if (caniuseVersions.length === 0) { - caniuseVersions[0] = 'none' - } - print( - 'Installed version' + - (caniuseVersions.length === 1 ? ': ' : 's: ') + - pico.bold(pico.red(caniuseVersions.join(', '))) + - '\n' + - 'Removing old caniuse-lite from lock file\n' - ) - writeFileSync(lock.file, lockfileData.content) - - let install = lock.mode === 'yarn' ? 'yarnpkg add -W' : lock.mode + ' install' - print( - 'Installing new caniuse-lite version\n' + - pico.yellow('$ ' + install.replace('yarnpkg', 'yarn') + ' caniuse-lite') + - '\n' - ) - try { - execSync(install + ' caniuse-lite') - } catch (e) /* c8 ignore start */ { - print( - pico.red( - '\n' + - e.stack + - '\n\n' + - 'Problem with `' + - install + - ' caniuse-lite` call. ' + - 'Run it manually.\n' - ) - ) - process.exit(1) - } /* c8 ignore end */ - - let del = - lock.mode === 'yarn' ? 'yarnpkg remove -W' : lock.mode + ' uninstall' - print( - 'Cleaning package.json dependencies from caniuse-lite\n' + - pico.yellow('$ ' + del.replace('yarnpkg', 'yarn') + ' caniuse-lite') + - '\n' - ) - execSync(del + ' caniuse-lite') -} - -function updateWith(print, cmd) { - print( - 'Updating caniuse-lite version\n' + - pico.yellow('$ ' + cmd.replace('yarnpkg', 'yarn')) + - '\n' - ) - try { - execSync(cmd) - } catch (e) /* c8 ignore start */ { - print(pico.red(e.stdout.toString())) - print( - pico.red( - '\n' + - e.stack + - '\n\n' + - 'Problem with `' + - cmd + - '` call. ' + - 'Run it manually.\n' - ) - ) - process.exit(1) - } /* c8 ignore end */ -} - -module.exports = function updateDB(print = defaultPrint) { - let lock = detectLockfile() - let latest = getLatestInfo(lock) - - let listError - let oldList - try { - oldList = getBrowsers() - } catch (e) { - listError = e - } - - print('Latest version: ' + pico.bold(pico.green(latest.version)) + '\n') - - if (lock.mode === 'yarn' && lock.version !== 1) { - updateWith(print, 'yarnpkg up -R caniuse-lite') - } else if (lock.mode === 'pnpm') { - updateWith(print, 'pnpm up caniuse-lite') - } else { - updatePackageManually(print, lock, latest) - } - - print('caniuse-lite has been successfully updated\n') - - let newList - if (!listError) { - try { - newList = getBrowsers() - } catch (e) /* c8 ignore start */ { - listError = e - } /* c8 ignore end */ - } - - if (listError) { - print( - pico.red( - '\n' + - listError.stack + - '\n\n' + - 'Problem with browser list retrieval.\n' + - 'Target browser changes won’t be shown.\n' - ) - ) - } else { - let changes = diffBrowsers(oldList, newList) - if (changes) { - print('\nTarget browser changes:\n') - print(changes + '\n') - } else { - print('\n' + pico.green('No target browser changes') + '\n') - } - } -} diff --git a/node_modules/update-browserslist-db/package.json b/node_modules/update-browserslist-db/package.json deleted file mode 100644 index f1997a1..0000000 --- a/node_modules/update-browserslist-db/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "update-browserslist-db", - "version": "1.0.13", - "description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config", - "keywords": [ - "caniuse", - "browsers", - "target" - ], - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "author": "Andrey Sitnik ", - "license": "MIT", - "repository": "browserslist/update-db", - "types": "./index.d.ts", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - }, - "bin": "cli.js" -} diff --git a/node_modules/update-browserslist-db/utils.js b/node_modules/update-browserslist-db/utils.js deleted file mode 100644 index d3ac914..0000000 --- a/node_modules/update-browserslist-db/utils.js +++ /dev/null @@ -1,22 +0,0 @@ -const { EOL } = require('os') - -const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => { - regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543 - let match = regexp.exec(text) - if (match !== null) return match[1] - return defaultValue -} - -const DEFAULT_INDENT = ' ' -const INDENT_REGEXP = /^([ \t]+)[^\s]/m - -module.exports.detectIndent = text => - getFirstRegexpMatchOrDefault(text, INDENT_REGEXP, DEFAULT_INDENT) -module.exports.DEFAULT_INDENT = DEFAULT_INDENT - -const DEFAULT_EOL = EOL -const EOL_REGEXP = /(\r\n|\n|\r)/g - -module.exports.detectEOL = text => - getFirstRegexpMatchOrDefault(text, EOL_REGEXP, DEFAULT_EOL) -module.exports.DEFAULT_EOL = DEFAULT_EOL diff --git a/node_modules/uri-js/LICENSE b/node_modules/uri-js/LICENSE deleted file mode 100644 index 9338bde..0000000 --- a/node_modules/uri-js/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -Copyright 2011 Gary Court. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/node_modules/uri-js/README.md b/node_modules/uri-js/README.md deleted file mode 100644 index 43e648b..0000000 --- a/node_modules/uri-js/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# URI.js - -URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). -It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. - -URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). - -## API - -### Parsing - - URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); - //returns: - //{ - // scheme : "uri", - // userinfo : "user:pass", - // host : "example.com", - // port : 123, - // path : "/one/two.three", - // query : "q1=a1&q2=a2", - // fragment : "body" - //} - -### Serializing - - URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" - -### Resolving - - URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" - -### Normalizing - - URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" - -### Comparison - - URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true - -### IP Support - - //IPv4 normalization - URI.normalize("//192.068.001.000") === "//192.68.1.0" - - //IPv6 normalization - URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" - - //IPv6 zone identifier support - URI.parse("//[2001:db8::7%25en1]"); - //returns: - //{ - // host : "2001:db8::7%en1" - //} - -### IRI Support - - //convert IRI to URI - URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" - //convert URI to IRI - URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" - -### Options - -All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: - -* `scheme` (string) - - Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. - -* `reference` (string) - - If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. - -* `tolerant` (boolean, false) - - If set to `true`, the parser will relax URI resolving rules. - -* `absolutePath` (boolean, false) - - If set to `true`, the serializer will not resolve a relative `path` component. - -* `iri` (boolean, false) - - If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). - -* `unicodeSupport` (boolean, false) - - If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). - -* `domainHost` (boolean, false) - - If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). - -## Scheme Extendable - -URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: - -* http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] -* https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] -* ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] -* wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] -* mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] -* urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] -* urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] - -### HTTP/HTTPS Support - - URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true - URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true - -### WS/WSS Support - - URI.parse("wss://example.com/foo?bar=baz"); - //returns: - //{ - // scheme : "wss", - // host: "example.com", - // resourceName: "/foo?bar=baz", - // secure: true, - //} - - URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true - -### Mailto Support - - URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); - //returns: - //{ - // scheme : "mailto", - // to : ["alpha@example.com", "bravo@example.com"], - // subject : "SUBSCRIBE", - // body : "Sign me up!" - //} - - URI.serialize({ - scheme : "mailto", - to : ["alpha@example.com"], - subject : "REMOVE", - body : "Please remove me", - headers : { - cc : "charlie@example.com" - } - }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" - -### URN Support - - URI.parse("urn:example:foo"); - //returns: - //{ - // scheme : "urn", - // nid : "example", - // nss : "foo", - //} - -#### URN UUID Support - - URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); - //returns: - //{ - // scheme : "urn", - // nid : "uuid", - // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", - //} - -## Usage - -To load in a browser, use the following tag: - - - -To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: - - npm install uri-js - # OR - yarn add uri-js - -Then, in your code, load it using: - - const URI = require("uri-js"); - -If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: - - import * as URI from "uri-js"; - -Or you can load just what you need using named exports: - - import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; - -## Breaking changes - -### Breaking changes from 3.x - -URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. - -The UUID of a URN can now be found in the `uuid` property. - -### Breaking changes from 2.x - -URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. - -### Breaking changes from 1.x - -The `errors` array on parsed components is now an `error` string. diff --git a/node_modules/uri-js/dist/es5/uri.all.d.ts b/node_modules/uri-js/dist/es5/uri.all.d.ts deleted file mode 100644 index da51e23..0000000 --- a/node_modules/uri-js/dist/es5/uri.all.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.js b/node_modules/uri-js/dist/es5/uri.all.js deleted file mode 100644 index 0706116..0000000 --- a/node_modules/uri-js/dist/es5/uri.all.js +++ /dev/null @@ -1,1443 +0,0 @@ -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.URI = global.URI || {}))); -}(this, (function (exports) { 'use strict'; - -function merge() { - for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { - sets[_key] = arguments[_key]; - } - - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - var xl = sets.length - 1; - for (var x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } else { - return sets[0]; - } -} -function subexp(str) { - return "(?:" + str + ")"; -} -function typeOf(o) { - return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); -} -function toUpperCase(str) { - return str.toUpperCase(); -} -function toArray(obj) { - return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; -} -function assign(target, source) { - var obj = target; - if (source) { - for (var key in source) { - obj[key] = source[key]; - } - } - return obj; -} - -function buildExps(isIRI) { - var ALPHA$$ = "[A-Za-z]", - CR$ = "[\\x0D]", - DIGIT$$ = "[0-9]", - DQUOTE$$ = "[\\x22]", - HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), - //case-insensitive - LF$$ = "[\\x0A]", - SP$$ = "[\\x20]", - PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), - //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", - SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", - RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), - UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", - //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", - //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), - SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), - USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), - DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), - DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), - //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), - H16$ = subexp(HEXDIG$$ + "{1,4}"), - LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), - IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), - // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), - // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), - //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), - //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), - //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), - //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), - //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), - //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), - //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), - ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), - //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), - //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), - //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), - IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), - //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), - HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), - PORT$ = subexp(DIGIT$$ + "*"), - AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), - PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), - SEGMENT$ = subexp(PCHAR$ + "*"), - SEGMENT_NZ$ = subexp(PCHAR$ + "+"), - SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), - PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), - PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), - //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), - //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), - //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", - PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), - FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), - HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), - RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), - ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), - GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", - SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; - return { - NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED: new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} -var URI_PROTOCOL = buildExps(false); - -var IRI_PROTOCOL = buildExps(true); - -var slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); - - - - - - - - - - - - - -var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } -}; - -/** Highest positive signed 32-bit float value */ - -var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -var base = 36; -var tMin = 1; -var tMax = 26; -var skew = 38; -var damp = 700; -var initialBias = 72; -var initialN = 128; // 0x80 -var delimiter = '-'; // '\x2D' - -/** Regular expressions */ -var regexPunycode = /^xn--/; -var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars -var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -var errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -var baseMinusTMin = base - tMin; -var floor = Math.floor; -var stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error$1(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, fn) { - var result = []; - var length = array.length; - while (length--) { - result[length] = fn(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ -function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - var output = []; - var counter = 0; - var length = string.length; - while (counter < length) { - var value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { - // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -var ucs2encode = function ucs2encode(array) { - return String.fromCodePoint.apply(String, toConsumableArray(array)); -}; - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -var basicToDigit = function basicToDigit(codePoint) { - if (codePoint - 0x30 < 0x0A) { - return codePoint - 0x16; - } - if (codePoint - 0x41 < 0x1A) { - return codePoint - 0x41; - } - if (codePoint - 0x61 < 0x1A) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -var digitToBasic = function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -var adapt = function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -var decode = function decode(input) { - // Don't use UCS-2. - var output = []; - var inputLength = input.length; - var i = 0; - var n = initialN; - var bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - var basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (var j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error$1('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - var oldi = i; - for (var w = 1, k = base;; /* no condition */k += base) { - - if (index >= inputLength) { - error$1('invalid-input'); - } - - var digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error$1('overflow'); - } - - i += digit * w; - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - - if (digit < t) { - break; - } - - var baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error$1('overflow'); - } - - w *= baseMinusT; - } - - var out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error$1('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - } - - return String.fromCodePoint.apply(String, output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -var encode = function encode(input) { - var output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - var inputLength = input.length; - - // Initialize the state. - var n = initialN; - var delta = 0; - var bias = initialBias; - - // Handle the basic code points. - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _currentValue2 = _step.value; - - if (_currentValue2 < 0x80) { - output.push(stringFromCharCode(_currentValue2)); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - var basicLength = output.length; - var handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - var m = maxInt; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var currentValue = _step2.value; - - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - var handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error$1('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var _currentValue = _step3.value; - - if (_currentValue < n && ++delta > maxInt) { - error$1('overflow'); - } - if (_currentValue == n) { - // Represent delta as a generalized variable-length integer. - var q = delta; - for (var k = base;; /* no condition */k += base) { - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (q < t) { - break; - } - var qMinusT = q - t; - var baseMinusT = base - t; - output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - ++delta; - ++n; - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -var toUnicode = function toUnicode(input) { - return mapDomain(input, function (string) { - return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -var toASCII = function toASCII(input) { - return mapDomain(input, function (string) { - return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -var punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.1.0', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - -/** - * URI.js - * - * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. - * @author Gary Court - * @see http://github.com/garycourt/uri-js - */ -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. - */ -var SCHEMES = {}; -function pctEncChar(chr) { - var c = chr.charCodeAt(0); - var e = void 0; - if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); - return e; -} -function pctDecChars(str) { - var newStr = ""; - var i = 0; - var il = str.length; - while (i < il) { - var c = parseInt(str.substr(i + 1, 2), 16); - if (c < 128) { - newStr += String.fromCharCode(c); - i += 3; - } else if (c >= 194 && c < 224) { - if (il - i >= 6) { - var c2 = parseInt(str.substr(i + 4, 2), 16); - newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); - } else { - newStr += str.substr(i, 6); - } - i += 6; - } else if (c >= 224) { - if (il - i >= 9) { - var _c = parseInt(str.substr(i + 4, 2), 16); - var c3 = parseInt(str.substr(i + 7, 2), 16); - newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); - } else { - newStr += str.substr(i, 9); - } - i += 9; - } else { - newStr += str.substr(i, 3); - i += 3; - } - } - return newStr; -} -function _normalizeComponentEncoding(components, protocol) { - function decodeUnreserved(str) { - var decStr = pctDecChars(str); - return !decStr.match(protocol.UNRESERVED) ? str : decStr; - } - if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); - if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - return components; -} - -function _stripLeadingZeros(str) { - return str.replace(/^0*(.*)/, "$1") || "0"; -} -function _normalizeIPv4(host, protocol) { - var matches = host.match(protocol.IPV4ADDRESS) || []; - - var _matches = slicedToArray(matches, 2), - address = _matches[1]; - - if (address) { - return address.split(".").map(_stripLeadingZeros).join("."); - } else { - return host; - } -} -function _normalizeIPv6(host, protocol) { - var matches = host.match(protocol.IPV6ADDRESS) || []; - - var _matches2 = slicedToArray(matches, 3), - address = _matches2[1], - zone = _matches2[2]; - - if (address) { - var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), - _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), - last = _address$toLowerCase$2[0], - first = _address$toLowerCase$2[1]; - - var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; - var lastFields = last.split(":").map(_stripLeadingZeros); - var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); - var fieldCount = isLastFieldIPv4Address ? 7 : 8; - var lastFieldsStart = lastFields.length - fieldCount; - var fields = Array(fieldCount); - for (var x = 0; x < fieldCount; ++x) { - fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; - } - if (isLastFieldIPv4Address) { - fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); - } - var allZeroFields = fields.reduce(function (acc, field, index) { - if (!field || field === "0") { - var lastLongest = acc[acc.length - 1]; - if (lastLongest && lastLongest.index + lastLongest.length === index) { - lastLongest.length++; - } else { - acc.push({ index: index, length: 1 }); - } - } - return acc; - }, []); - var longestZeroFields = allZeroFields.sort(function (a, b) { - return b.length - a.length; - })[0]; - var newHost = void 0; - if (longestZeroFields && longestZeroFields.length > 1) { - var newFirst = fields.slice(0, longestZeroFields.index); - var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); - newHost = newFirst.join(":") + "::" + newLast.join(":"); - } else { - newHost = fields.join(":"); - } - if (zone) { - newHost += "%" + zone; - } - return newHost; - } else { - return host; - } -} -var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; -var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; -function parse(uriString) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var components = {}; - var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; - if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; - var matches = uriString.match(URI_PARSE); - if (matches) { - if (NO_MATCH_IS_UNDEFINED) { - //store each component - components.scheme = matches[1]; - components.userinfo = matches[3]; - components.host = matches[4]; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = matches[7]; - components.fragment = matches[8]; - //fix port number - if (isNaN(components.port)) { - components.port = matches[5]; - } - } else { - //IE FIX for improper RegExp matching - //store each component - components.scheme = matches[1] || undefined; - components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; - components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; - components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; - //fix port number - if (isNaN(components.port)) { - components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; - } - } - if (components.host) { - //normalize IP hosts - components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); - } - //determine reference type - if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { - components.reference = "same-document"; - } else if (components.scheme === undefined) { - components.reference = "relative"; - } else if (components.fragment === undefined) { - components.reference = "absolute"; - } else { - components.reference = "uri"; - } - //check for reference errors - if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { - components.error = components.error || "URI is not a " + options.reference + " reference."; - } - //find scheme handler - var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //check if scheme can't handle IRIs - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - //if host component is a domain name - if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { - //convert Unicode IDN -> ASCII IDN - try { - components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; - } - } - //convert IRI -> URI - _normalizeComponentEncoding(components, URI_PROTOCOL); - } else { - //normalize encodings - _normalizeComponentEncoding(components, protocol); - } - //perform scheme specific parsing - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(components, options); - } - } else { - components.error = components.error || "URI can not be parsed."; - } - return components; -} - -function _recomposeAuthority(components, options) { - var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; - var uriTokens = []; - if (components.userinfo !== undefined) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - if (components.host !== undefined) { - //normalize IP hosts, add brackets and escape zone separator for IPv6 - uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { - return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; - })); - } - if (typeof components.port === "number" || typeof components.port === "string") { - uriTokens.push(":"); - uriTokens.push(String(components.port)); - } - return uriTokens.length ? uriTokens.join("") : undefined; -} - -var RDS1 = /^\.\.?\//; -var RDS2 = /^\/\.(\/|$)/; -var RDS3 = /^\/\.\.(\/|$)/; -var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; -function removeDotSegments(input) { - var output = []; - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } else if (input === "." || input === "..") { - input = ""; - } else { - var im = input.match(RDS5); - if (im) { - var s = im[0]; - input = input.slice(s.length); - output.push(s); - } else { - throw new Error("Unexpected dot segment condition"); - } - } - } - return output.join(""); -} - -function serialize(components) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; - var uriTokens = []; - //find scheme handler - var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //perform scheme specific serialization - if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); - if (components.host) { - //if host component is an IPv6 address - if (protocol.IPV6ADDRESS.test(components.host)) {} - //TODO: normalize IPv6 address as per RFC 5952 - - //if host component is a domain name - else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { - //convert IDN via punycode - try { - components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - } - } - //normalize encoding - _normalizeComponentEncoding(components, protocol); - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme); - uriTokens.push(":"); - } - var authority = _recomposeAuthority(components, options); - if (authority !== undefined) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - if (components.path !== undefined) { - var s = components.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === undefined) { - s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" - } - uriTokens.push(s); - } - if (components.query !== undefined) { - uriTokens.push("?"); - uriTokens.push(components.query); - } - if (components.fragment !== undefined) { - uriTokens.push("#"); - uriTokens.push(components.fragment); - } - return uriTokens.join(""); //merge tokens into a string -} - -function resolveComponents(base, relative) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var skipNormalization = arguments[3]; - - var target = {}; - if (!skipNormalization) { - base = parse(serialize(base, options), options); //normalize base components - relative = parse(serialize(relative, options), options); //normalize relative components - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== undefined) { - target.query = relative.query; - } else { - target.query = base.query; - } - } else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } else { - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { - target.path = "/" + relative.path; - } else if (!base.path) { - target.path = relative.path; - } else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - //target.authority = base.authority; - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; -} - -function resolve(baseURI, relativeURI, options) { - var schemelessOptions = assign({ scheme: 'null' }, options); - return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); -} - -function normalize(uri, options) { - if (typeof uri === "string") { - uri = serialize(parse(uri, options), options); - } else if (typeOf(uri) === "object") { - uri = parse(serialize(uri, options), options); - } - return uri; -} - -function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = serialize(parse(uriA, options), options); - } else if (typeOf(uriA) === "object") { - uriA = serialize(uriA, options); - } - if (typeof uriB === "string") { - uriB = serialize(parse(uriB, options), options); - } else if (typeOf(uriB) === "object") { - uriB = serialize(uriB, options); - } - return uriA === uriB; -} - -function escapeComponent(str, options) { - return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); -} - -function unescapeComponent(str, options) { - return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); -} - -var handler = { - scheme: "http", - domainHost: true, - parse: function parse(components, options) { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - }, - serialize: function serialize(components, options) { - var secure = String(components.scheme).toLowerCase() === "https"; - //normalize the default port - if (components.port === (secure ? 443 : 80) || components.port === "") { - components.port = undefined; - } - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - return components; - } -}; - -var handler$1 = { - scheme: "https", - domainHost: handler.domainHost, - parse: handler.parse, - serialize: handler.serialize -}; - -function isSecure(wsComponents) { - return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; -} -//RFC 6455 -var handler$2 = { - scheme: "ws", - domainHost: true, - parse: function parse(components, options) { - var wsComponents = components; - //indicate if the secure flag is set - wsComponents.secure = isSecure(wsComponents); - //construct resouce name - wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); - wsComponents.path = undefined; - wsComponents.query = undefined; - return wsComponents; - }, - serialize: function serialize(wsComponents, options) { - //normalize the default port - if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { - wsComponents.port = undefined; - } - //ensure scheme matches secure flag - if (typeof wsComponents.secure === 'boolean') { - wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; - wsComponents.secure = undefined; - } - //reconstruct path from resource name - if (wsComponents.resourceName) { - var _wsComponents$resourc = wsComponents.resourceName.split('?'), - _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), - path = _wsComponents$resourc2[0], - query = _wsComponents$resourc2[1]; - - wsComponents.path = path && path !== '/' ? path : undefined; - wsComponents.query = query; - wsComponents.resourceName = undefined; - } - //forbid fragment component - wsComponents.fragment = undefined; - return wsComponents; - } -}; - -var handler$3 = { - scheme: "wss", - domainHost: handler$2.domainHost, - parse: handler$2.parse, - serialize: handler$2.serialize -}; - -var O = {}; -var isIRI = true; -//RFC 3986 -var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; -var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive -var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded -//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = -//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) -//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext -//const VCHAR$$ = "[\\x21-\\x7E]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext -//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); -//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); -//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); -var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; -var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; -var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); -var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; -var UNRESERVED = new RegExp(UNRESERVED$$, "g"); -var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); -var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); -var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); -var NOT_HFVALUE = NOT_HFNAME; -function decodeUnreserved(str) { - var decStr = pctDecChars(str); - return !decStr.match(UNRESERVED) ? str : decStr; -} -var handler$4 = { - scheme: "mailto", - parse: function parse$$1(components, options) { - var mailtoComponents = components; - var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; - mailtoComponents.path = undefined; - if (mailtoComponents.query) { - var unknownHeaders = false; - var headers = {}; - var hfields = mailtoComponents.query.split("&"); - for (var x = 0, xl = hfields.length; x < xl; ++x) { - var hfield = hfields[x].split("="); - switch (hfield[0]) { - case "to": - var toAddrs = hfield[1].split(","); - for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { - to.push(toAddrs[_x]); - } - break; - case "subject": - mailtoComponents.subject = unescapeComponent(hfield[1], options); - break; - case "body": - mailtoComponents.body = unescapeComponent(hfield[1], options); - break; - default: - unknownHeaders = true; - headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); - break; - } - } - if (unknownHeaders) mailtoComponents.headers = headers; - } - mailtoComponents.query = undefined; - for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { - var addr = to[_x2].split("@"); - addr[0] = unescapeComponent(addr[0]); - if (!options.unicodeSupport) { - //convert Unicode IDN -> ASCII IDN - try { - addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); - } catch (e) { - mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; - } - } else { - addr[1] = unescapeComponent(addr[1], options).toLowerCase(); - } - to[_x2] = addr.join("@"); - } - return mailtoComponents; - }, - serialize: function serialize$$1(mailtoComponents, options) { - var components = mailtoComponents; - var to = toArray(mailtoComponents.to); - if (to) { - for (var x = 0, xl = to.length; x < xl; ++x) { - var toAddr = String(to[x]); - var atIdx = toAddr.lastIndexOf("@"); - var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); - var domain = toAddr.slice(atIdx + 1); - //convert IDN via punycode - try { - domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); - } catch (e) { - components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - to[x] = localPart + "@" + domain; - } - components.path = to.join(","); - } - var headers = mailtoComponents.headers = mailtoComponents.headers || {}; - if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; - if (mailtoComponents.body) headers["body"] = mailtoComponents.body; - var fields = []; - for (var name in headers) { - if (headers[name] !== O[name]) { - fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); - } - } - if (fields.length) { - components.query = fields.join("&"); - } - return components; - } -}; - -var URN_PARSE = /^([^\:]+)\:(.*)/; -//RFC 2141 -var handler$5 = { - scheme: "urn", - parse: function parse$$1(components, options) { - var matches = components.path && components.path.match(URN_PARSE); - var urnComponents = components; - if (matches) { - var scheme = options.scheme || urnComponents.scheme || "urn"; - var nid = matches[1].toLowerCase(); - var nss = matches[2]; - var urnScheme = scheme + ":" + (options.nid || nid); - var schemeHandler = SCHEMES[urnScheme]; - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - }, - serialize: function serialize$$1(urnComponents, options) { - var scheme = options.scheme || urnComponents.scheme || "urn"; - var nid = urnComponents.nid; - var urnScheme = scheme + ":" + (options.nid || nid); - var schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - var uriComponents = urnComponents; - var nss = urnComponents.nss; - uriComponents.path = (nid || options.nid) + ":" + nss; - return uriComponents; - } -}; - -var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -//RFC 4122 -var handler$6 = { - scheme: "urn:uuid", - parse: function parse(urnComponents, options) { - var uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - }, - serialize: function serialize(uuidComponents, options) { - var urnComponents = uuidComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - } -}; - -SCHEMES[handler.scheme] = handler; -SCHEMES[handler$1.scheme] = handler$1; -SCHEMES[handler$2.scheme] = handler$2; -SCHEMES[handler$3.scheme] = handler$3; -SCHEMES[handler$4.scheme] = handler$4; -SCHEMES[handler$5.scheme] = handler$5; -SCHEMES[handler$6.scheme] = handler$6; - -exports.SCHEMES = SCHEMES; -exports.pctEncChar = pctEncChar; -exports.pctDecChars = pctDecChars; -exports.parse = parse; -exports.removeDotSegments = removeDotSegments; -exports.serialize = serialize; -exports.resolveComponents = resolveComponents; -exports.resolve = resolve; -exports.normalize = normalize; -exports.equal = equal; -exports.escapeComponent = escapeComponent; -exports.unescapeComponent = unescapeComponent; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=uri.all.js.map diff --git a/node_modules/uri-js/dist/es5/uri.all.js.map b/node_modules/uri-js/dist/es5/uri.all.js.map deleted file mode 100644 index 5b30c4e..0000000 --- a/node_modules/uri-js/dist/es5/uri.all.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;YACMK,KAAKoQ,KAAKnS,MAAL,GAAc,CAAzB;aACK,IAAIgB,IAAI,CAAb,EAAgBA,IAAIe,EAApB,EAAwB,EAAEf,CAA1B,EAA6B;iBACvBA,CAAL,IAAUmR,KAAKnR,CAAL,EAAQU,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;;aAEIK,EAAL,IAAWoQ,KAAKpQ,EAAL,EAASL,KAAT,CAAe,CAAf,CAAX;eACOyQ,KAAKpS,IAAL,CAAU,EAAV,CAAP;KAPD,MAQO;eACCoS,KAAK,CAAL,CAAP;;;AAIF,AAAA,SAAA/O,MAAA,CAAuBV,GAAvB,EAAA;WACQ,QAAQA,GAAR,GAAc,GAArB;;AAGD,AAAA,SAAA4B,MAAA,CAAuB0N,CAAvB,EAAA;WACQA,MAAM/S,SAAN,GAAkB,WAAlB,GAAiC+S,MAAM,IAAN,GAAa,MAAb,GAAsBC,OAAOF,SAAP,CAAiBhO,QAAjB,CAA0B+N,IAA1B,CAA+BE,CAA/B,EAAkC7P,KAAlC,CAAwC,GAAxC,EAA6CkE,GAA7C,GAAmDlE,KAAnD,CAAyD,GAAzD,EAA8D+P,KAA9D,GAAsEvT,WAAtE,EAA9D;;AAGD,AAAA,SAAA2B,WAAA,CAA4BoC,GAA5B,EAAA;WACQA,IAAIpC,WAAJ,EAAP;;A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xB,EAAuCI,OAAvC,CAAhB;;YAGKO,gBAAgBX,aAAtB;YACMC,MAAMD,cAAcC,GAA1B;sBACcW,IAAd,IAAwBC,OAAOT,QAAQS,GAAvC,UAA8CZ,GAA9C;eAEOU,aAAP;;CA1CF,CA8CA;;AD5DA,IAAMH,OAAO,0DAAb;AACA,AAEA;AACA,IAAME,YAAsE;YAClE,UADkE;WAGnE,eAAUV,aAAV,EAAuCI,OAAvC,EAAT;YACQF,iBAAiBF,aAAvB;uBACeR,IAAf,GAAsBU,eAAeD,GAArC;uBACeA,GAAf,GAAqBQ,SAArB;YAEI,CAACL,QAAQE,QAAT,KAAsB,CAACJ,eAAeV,IAAhB,IAAwB,CAACU,eAAeV,IAAf,CAAoBe,KAApB,CAA0BC,IAA1B,CAA/C,CAAJ,EAAqF;2BACrEH,KAAf,GAAuBH,eAAeG,KAAf,IAAwB,oBAA/C;;eAGMH,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCE,OAAzC,EAAb;YACQJ,gBAAgBE,cAAtB;;sBAEcD,GAAd,GAAoB,CAACC,eAAeV,IAAf,IAAuB,EAAxB,EAA4BW,WAA5B,EAApB;eACOH,aAAP;;CAnBF,CAuBA;;ADhCAT,QAAQQ,QAAKN,MAAb,IAAuBM,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/node_modules/uri-js/dist/es5/uri.all.min.d.ts deleted file mode 100644 index da51e23..0000000 --- a/node_modules/uri-js/dist/es5/uri.all.min.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js b/node_modules/uri-js/dist/es5/uri.all.min.js deleted file mode 100644 index fcd8458..0000000 --- a/node_modules/uri-js/dist/es5/uri.all.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.d.ts b/node_modules/uri-js/dist/esnext/index.d.ts deleted file mode 100644 index f6be760..0000000 --- a/node_modules/uri-js/dist/esnext/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./uri"; diff --git a/node_modules/uri-js/dist/esnext/index.js b/node_modules/uri-js/dist/esnext/index.js deleted file mode 100644 index e3531b5..0000000 --- a/node_modules/uri-js/dist/esnext/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import { SCHEMES } from "./uri"; -import http from "./schemes/http"; -SCHEMES[http.scheme] = http; -import https from "./schemes/https"; -SCHEMES[https.scheme] = https; -import ws from "./schemes/ws"; -SCHEMES[ws.scheme] = ws; -import wss from "./schemes/wss"; -SCHEMES[wss.scheme] = wss; -import mailto from "./schemes/mailto"; -SCHEMES[mailto.scheme] = mailto; -import urn from "./schemes/urn"; -SCHEMES[urn.scheme] = urn; -import uuid from "./schemes/urn-uuid"; -SCHEMES[uuid.scheme] = uuid; -export * from "./uri"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.js.map b/node_modules/uri-js/dist/esnext/index.js.map deleted file mode 100644 index 0971f6e..0000000 --- a/node_modules/uri-js/dist/esnext/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts deleted file mode 100644 index c91cdac..0000000 --- a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URIRegExps } from "./uri"; -declare const _default: URIRegExps; -export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js b/node_modules/uri-js/dist/esnext/regexps-iri.js deleted file mode 100644 index 34e7de9..0000000 --- a/node_modules/uri-js/dist/esnext/regexps-iri.js +++ /dev/null @@ -1,3 +0,0 @@ -import { buildExps } from "./regexps-uri"; -export default buildExps(true); -//# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/node_modules/uri-js/dist/esnext/regexps-iri.js.map deleted file mode 100644 index 2269c58..0000000 --- a/node_modules/uri-js/dist/esnext/regexps-iri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts deleted file mode 100644 index 6096bda..0000000 --- a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { URIRegExps } from "./uri"; -export declare function buildExps(isIRI: boolean): URIRegExps; -declare const _default: URIRegExps; -export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js b/node_modules/uri-js/dist/esnext/regexps-uri.js deleted file mode 100644 index 1cc659f..0000000 --- a/node_modules/uri-js/dist/esnext/regexps-uri.js +++ /dev/null @@ -1,42 +0,0 @@ -import { merge, subexp } from "./util"; -export function buildExps(isIRI) { - const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive - LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; - return { - NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED: new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} -export default buildExps(false); -//# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/node_modules/uri-js/dist/esnext/regexps-uri.js.map deleted file mode 100644 index cb028b8..0000000 --- a/node_modules/uri-js/dist/esnext/regexps-uri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,oBAAoB,KAAa;IACtC,MACC,OAAO,GAAG,UAAU,EACpB,GAAG,GAAG,SAAS,EACf,OAAO,GAAG,OAAO,EACjB,QAAQ,GAAG,SAAS,EACpB,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,EAAG,kBAAkB;IAC1D,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,SAAS,EAChB,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MA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,EAAE,GAAG,CAAC;QAC7F,MAAM,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAClE,UAAU,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC1C,WAAW,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACxE,WAAW,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC3C,WAAW,EAAG,IAAI,MAAM,CAAC,IAAI,GAAG,YAAY,GAAG,IAAI,CAAC;QACpD,WAAW,EAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAE,sCAAsC;KACrL,CAAC;AACH,CAAC;AAED,eAAe,SAAS,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.d.ts b/node_modules/uri-js/dist/esnext/schemes/http.d.ts deleted file mode 100644 index fe5b2f3..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/http.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js deleted file mode 100644 index 6abf0fe..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/http.js +++ /dev/null @@ -1,28 +0,0 @@ -const handler = { - scheme: "http", - domainHost: true, - parse: function (components, options) { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - }, - serialize: function (components, options) { - const secure = String(components.scheme).toLowerCase() === "https"; - //normalize the default port - if (components.port === (secure ? 443 : 80) || components.port === "") { - components.port = undefined; - } - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - return components; - } -}; -export default handler; -//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js.map b/node_modules/uri-js/dist/esnext/schemes/http.js.map deleted file mode 100644 index 8211897..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/http.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/node_modules/uri-js/dist/esnext/schemes/https.d.ts deleted file mode 100644 index fe5b2f3..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/https.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js b/node_modules/uri-js/dist/esnext/schemes/https.js deleted file mode 100644 index ec4b6e7..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/https.js +++ /dev/null @@ -1,9 +0,0 @@ -import http from "./http"; -const handler = { - scheme: "https", - domainHost: http.domainHost, - parse: http.parse, - serialize: http.serialize -}; -export default handler; -//# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js.map b/node_modules/uri-js/dist/esnext/schemes/https.js.map deleted file mode 100644 index 385b8ef..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/https.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts deleted file mode 100644 index e2aefc2..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { URISchemeHandler, URIComponents } from "../uri"; -export interface MailtoHeaders { - [hfname: string]: string; -} -export interface MailtoComponents extends URIComponents { - to: Array; - headers?: MailtoHeaders; - subject?: string; - body?: string; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js b/node_modules/uri-js/dist/esnext/schemes/mailto.js deleted file mode 100644 index 2553713..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.js +++ /dev/null @@ -1,148 +0,0 @@ -import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; -import punycode from "punycode"; -import { merge, subexp, toUpperCase, toArray } from "../util"; -const O = {}; -const isIRI = true; -//RFC 3986 -const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; -const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive -const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded -//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = -//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) -//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext -//const VCHAR$$ = "[\\x21-\\x7E]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext -//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); -//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); -//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); -const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; -const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; -const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); -const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); -const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); -const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); -const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); -//RFC 6068 -const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 -const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; -const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); -const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); -const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); -const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); -const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); -const HFNAME$ = subexp(QCHAR$ + "*"); -const HFVALUE$ = HFNAME$; -const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); -const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); -const HFIELDS$ = subexp("\\?" + HFIELDS2$); -const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); -const UNRESERVED = new RegExp(UNRESERVED$$, "g"); -const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); -const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); -const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); -const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); -const NOT_HFVALUE = NOT_HFNAME; -const TO = new RegExp("^" + TO$ + "$"); -const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); -function decodeUnreserved(str) { - const decStr = pctDecChars(str); - return (!decStr.match(UNRESERVED) ? str : decStr); -} -const handler = { - scheme: "mailto", - parse: function (components, options) { - const mailtoComponents = components; - const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); - mailtoComponents.path = undefined; - if (mailtoComponents.query) { - let unknownHeaders = false; - const headers = {}; - const hfields = mailtoComponents.query.split("&"); - for (let x = 0, xl = hfields.length; x < xl; ++x) { - const hfield = hfields[x].split("="); - switch (hfield[0]) { - case "to": - const toAddrs = hfield[1].split(","); - for (let x = 0, xl = toAddrs.length; x < xl; ++x) { - to.push(toAddrs[x]); - } - break; - case "subject": - mailtoComponents.subject = unescapeComponent(hfield[1], options); - break; - case "body": - mailtoComponents.body = unescapeComponent(hfield[1], options); - break; - default: - unknownHeaders = true; - headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); - break; - } - } - if (unknownHeaders) - mailtoComponents.headers = headers; - } - mailtoComponents.query = undefined; - for (let x = 0, xl = to.length; x < xl; ++x) { - const addr = to[x].split("@"); - addr[0] = unescapeComponent(addr[0]); - if (!options.unicodeSupport) { - //convert Unicode IDN -> ASCII IDN - try { - addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); - } - catch (e) { - mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; - } - } - else { - addr[1] = unescapeComponent(addr[1], options).toLowerCase(); - } - to[x] = addr.join("@"); - } - return mailtoComponents; - }, - serialize: function (mailtoComponents, options) { - const components = mailtoComponents; - const to = toArray(mailtoComponents.to); - if (to) { - for (let x = 0, xl = to.length; x < xl; ++x) { - const toAddr = String(to[x]); - const atIdx = toAddr.lastIndexOf("@"); - const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); - let domain = toAddr.slice(atIdx + 1); - //convert IDN via punycode - try { - domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); - } - catch (e) { - components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - to[x] = localPart + "@" + domain; - } - components.path = to.join(","); - } - const headers = mailtoComponents.headers = mailtoComponents.headers || {}; - if (mailtoComponents.subject) - headers["subject"] = mailtoComponents.subject; - if (mailtoComponents.body) - headers["body"] = mailtoComponents.body; - const fields = []; - for (const name in headers) { - if (headers[name] !== O[name]) { - fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + - "=" + - headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); - } - } - if (fields.length) { - components.query = fields.join("&"); - } - return components; - } -}; -export default handler; -//# sourceMappingURL=mailto.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map deleted file mode 100644 index 82dba9a..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAa9D,MAAM,CAAC,GAAiB,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,UAAU;AACV,MAAM,YAAY,GAAG,wBAAwB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,2EAA2E,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjJ,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAE,kBAAkB;AACnD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,aAAa,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAE,UAAU;AAE7O,qEAAqE;AACrE,yFAAyF;AACzF,+BAA+B;AAC/B,uGAAuG;AACvG,+GAA+G;AAC/G,kCAAkC;AAClC,+BAA+B;AAC/B,wGAAwG;AACxG,8EAA8E;AAC9E,8FAA8F;AAC9F,mGAAmG;AACnG,MAAM,OAAO,GAAG,uDAAuD,CAAC;AACxE,MAAM,OAAO,GAAG,4DAA4D,CAA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AO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts deleted file mode 100644 index e75f2e7..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { URISchemeHandler, URIOptions } from "../uri"; -import { URNComponents } from "./urn"; -export interface UUIDComponents extends URNComponents { - uuid?: string; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js deleted file mode 100644 index d1fce49..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js +++ /dev/null @@ -1,23 +0,0 @@ -const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; -//RFC 4122 -const handler = { - scheme: "urn:uuid", - parse: function (urnComponents, options) { - const uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - }, - serialize: function (uuidComponents, options) { - const urnComponents = uuidComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - }, -}; -export default handler; -//# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map deleted file mode 100644 index 3b7a8b3..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts deleted file mode 100644 index 7e0c2fb..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -export interface URNComponents extends URIComponents { - nid?: string; - nss?: string; -} -export interface URNOptions extends URIOptions { - nid?: string; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js b/node_modules/uri-js/dist/esnext/schemes/urn.js deleted file mode 100644 index 5d3f10a..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn.js +++ /dev/null @@ -1,49 +0,0 @@ -import { SCHEMES } from "../uri"; -const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; -const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; -const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; -const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; -const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); -const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); -const URN_PARSE = /^([^\:]+)\:(.*)/; -const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; -//RFC 2141 -const handler = { - scheme: "urn", - parse: function (components, options) { - const matches = components.path && components.path.match(URN_PARSE); - let urnComponents = components; - if (matches) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = matches[1].toLowerCase(); - const nss = matches[2]; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } - else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - }, - serialize: function (urnComponents, options) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = urnComponents.nid; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - const uriComponents = urnComponents; - const nss = urnComponents.nss; - uriComponents.path = `${nid || options.nid}:${nss}`; - return uriComponents; - }, -}; -export default handler; -//# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/node_modules/uri-js/dist/esnext/schemes/urn.js.map deleted file mode 100644 index ea43b0b..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU;AACV,MAAM,OAAO,GAA8C;IAC1D,MAAM,EAAG,KAAK;IAEd,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,aAAa,GAAG,UAA2B,CAAC;QAEhD,IAAI,OAAO,EAAE;YACZ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;YAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,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emes/ws.d.ts deleted file mode 100644 index 47f4835..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/ws.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { URISchemeHandler, URIComponents } from "../uri"; -export interface WSComponents extends URIComponents { - resourceName?: string; - secure?: boolean; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js b/node_modules/uri-js/dist/esnext/schemes/ws.js deleted file mode 100644 index 9277f03..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/ws.js +++ /dev/null @@ -1,41 +0,0 @@ -function isSecure(wsComponents) { - return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; -} -//RFC 6455 -const handler = { - scheme: "ws", - domainHost: true, - parse: function (components, options) { - const wsComponents = components; - //indicate if the secure flag is set - wsComponents.secure = isSecure(wsComponents); - //construct resouce name - wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); - wsComponents.path = undefined; - wsComponents.query = undefined; - return wsComponents; - }, - serialize: function (wsComponents, options) { - //normalize the default port - if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { - wsComponents.port = undefined; - } - //ensure scheme matches secure flag - if (typeof wsComponents.secure === 'boolean') { - wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); - wsComponents.secure = undefined; - } - //reconstruct path from resource name - if (wsComponents.resourceName) { - const [path, query] = wsComponents.resourceName.split('?'); - wsComponents.path = (path && path !== '/' ? path : undefined); - wsComponents.query = query; - wsComponents.resourceName = undefined; - } - //forbid fragment component - wsComponents.fragment = undefined; - return wsComponents; - } -}; -export default handler; -//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/node_modules/uri-js/dist/esnext/schemes/ws.js.map deleted file mode 100644 index 186818c..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/ws.js.map +++ /dev/null @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AG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.d.ts b/node_modules/uri-js/dist/esnext/schemes/wss.d.ts deleted file mode 100644 index fe5b2f3..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/wss.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js b/node_modules/uri-js/dist/esnext/schemes/wss.js deleted file mode 100644 index d1e22cc..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/wss.js +++ /dev/null @@ -1,9 +0,0 @@ -import ws from "./ws"; -const handler = { - scheme: "wss", - domainHost: ws.domainHost, - parse: ws.parse, - serialize: ws.serialize -}; -export default handler; -//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/node_modules/uri-js/dist/esnext/schemes/wss.js.map deleted file mode 100644 index e19006d..0000000 --- a/node_modules/uri-js/dist/esnext/schemes/wss.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.d.ts b/node_modules/uri-js/dist/esnext/uri.d.ts deleted file mode 100644 index da51e23..0000000 --- a/node_modules/uri-js/dist/esnext/uri.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/esnext/uri.js b/node_modules/uri-js/dist/esnext/uri.js deleted file mode 100644 index 659ce26..0000000 --- a/node_modules/uri-js/dist/esnext/uri.js +++ /dev/null @@ -1,480 +0,0 @@ -/** - * URI.js - * - * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. - * @author Gary Court - * @see http://github.com/garycourt/uri-js - */ -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. - */ -import URI_PROTOCOL from "./regexps-uri"; -import IRI_PROTOCOL from "./regexps-iri"; -import punycode from "punycode"; -import { toUpperCase, typeOf, assign } from "./util"; -export const SCHEMES = {}; -export function pctEncChar(chr) { - const c = chr.charCodeAt(0); - let e; - if (c < 16) - e = "%0" + c.toString(16).toUpperCase(); - else if (c < 128) - e = "%" + c.toString(16).toUpperCase(); - else if (c < 2048) - e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); - else - e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); - return e; -} -export function pctDecChars(str) { - let newStr = ""; - let i = 0; - const il = str.length; - while (i < il) { - const c = parseInt(str.substr(i + 1, 2), 16); - if (c < 128) { - newStr += String.fromCharCode(c); - i += 3; - } - else if (c >= 194 && c < 224) { - if ((il - i) >= 6) { - const c2 = parseInt(str.substr(i + 4, 2), 16); - newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - } - else { - newStr += str.substr(i, 6); - } - i += 6; - } - else if (c >= 224) { - if ((il - i) >= 9) { - const c2 = parseInt(str.substr(i + 4, 2), 16); - const c3 = parseInt(str.substr(i + 7, 2), 16); - newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } - else { - newStr += str.substr(i, 9); - } - i += 9; - } - else { - newStr += str.substr(i, 3); - i += 3; - } - } - return newStr; -} -function _normalizeComponentEncoding(components, protocol) { - function decodeUnreserved(str) { - const decStr = pctDecChars(str); - return (!decStr.match(protocol.UNRESERVED) ? str : decStr); - } - if (components.scheme) - components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); - if (components.userinfo !== undefined) - components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.host !== undefined) - components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.path !== undefined) - components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.query !== undefined) - components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.fragment !== undefined) - components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - return components; -} -; -function _stripLeadingZeros(str) { - return str.replace(/^0*(.*)/, "$1") || "0"; -} -function _normalizeIPv4(host, protocol) { - const matches = host.match(protocol.IPV4ADDRESS) || []; - const [, address] = matches; - if (address) { - return address.split(".").map(_stripLeadingZeros).join("."); - } - else { - return host; - } -} -function _normalizeIPv6(host, protocol) { - const matches = host.match(protocol.IPV6ADDRESS) || []; - const [, address, zone] = matches; - if (address) { - const [last, first] = address.toLowerCase().split('::').reverse(); - const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; - const lastFields = last.split(":").map(_stripLeadingZeros); - const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); - const fieldCount = isLastFieldIPv4Address ? 7 : 8; - const lastFieldsStart = lastFields.length - fieldCount; - const fields = Array(fieldCount); - for (let x = 0; x < fieldCount; ++x) { - fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; - } - if (isLastFieldIPv4Address) { - fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); - } - const allZeroFields = fields.reduce((acc, field, index) => { - if (!field || field === "0") { - const lastLongest = acc[acc.length - 1]; - if (lastLongest && lastLongest.index + lastLongest.length === index) { - lastLongest.length++; - } - else { - acc.push({ index, length: 1 }); - } - } - return acc; - }, []); - const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; - let newHost; - if (longestZeroFields && longestZeroFields.length > 1) { - const newFirst = fields.slice(0, longestZeroFields.index); - const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); - newHost = newFirst.join(":") + "::" + newLast.join(":"); - } - else { - newHost = fields.join(":"); - } - if (zone) { - newHost += "%" + zone; - } - return newHost; - } - else { - return host; - } -} -const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; -const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined; -export function parse(uriString, options = {}) { - const components = {}; - const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); - if (options.reference === "suffix") - uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; - const matches = uriString.match(URI_PARSE); - if (matches) { - if (NO_MATCH_IS_UNDEFINED) { - //store each component - components.scheme = matches[1]; - components.userinfo = matches[3]; - components.host = matches[4]; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = matches[7]; - components.fragment = matches[8]; - //fix port number - if (isNaN(components.port)) { - components.port = matches[5]; - } - } - else { //IE FIX for improper RegExp matching - //store each component - components.scheme = matches[1] || undefined; - components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); - components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); - components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); - //fix port number - if (isNaN(components.port)) { - components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); - } - } - if (components.host) { - //normalize IP hosts - components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); - } - //determine reference type - if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { - components.reference = "same-document"; - } - else if (components.scheme === undefined) { - components.reference = "relative"; - } - else if (components.fragment === undefined) { - components.reference = "absolute"; - } - else { - components.reference = "uri"; - } - //check for reference errors - if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { - components.error = components.error || "URI is not a " + options.reference + " reference."; - } - //find scheme handler - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //check if scheme can't handle IRIs - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - //if host component is a domain name - if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { - //convert Unicode IDN -> ASCII IDN - try { - components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); - } - catch (e) { - components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; - } - } - //convert IRI -> URI - _normalizeComponentEncoding(components, URI_PROTOCOL); - } - else { - //normalize encodings - _normalizeComponentEncoding(components, protocol); - } - //perform scheme specific parsing - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(components, options); - } - } - else { - components.error = components.error || "URI can not be parsed."; - } - return components; -} -; -function _recomposeAuthority(components, options) { - const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); - const uriTokens = []; - if (components.userinfo !== undefined) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - if (components.host !== undefined) { - //normalize IP hosts, add brackets and escape zone separator for IPv6 - uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); - } - if (typeof components.port === "number" || typeof components.port === "string") { - uriTokens.push(":"); - uriTokens.push(String(components.port)); - } - return uriTokens.length ? uriTokens.join("") : undefined; -} -; -const RDS1 = /^\.\.?\//; -const RDS2 = /^\/\.(\/|$)/; -const RDS3 = /^\/\.\.(\/|$)/; -const RDS4 = /^\.\.?$/; -const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; -export function removeDotSegments(input) { - const output = []; - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } - else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } - else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } - else if (input === "." || input === "..") { - input = ""; - } - else { - const im = input.match(RDS5); - if (im) { - const s = im[0]; - input = input.slice(s.length); - output.push(s); - } - else { - throw new Error("Unexpected dot segment condition"); - } - } - } - return output.join(""); -} -; -export function serialize(components, options = {}) { - const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); - const uriTokens = []; - //find scheme handler - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //perform scheme specific serialization - if (schemeHandler && schemeHandler.serialize) - schemeHandler.serialize(components, options); - if (components.host) { - //if host component is an IPv6 address - if (protocol.IPV6ADDRESS.test(components.host)) { - //TODO: normalize IPv6 address as per RFC 5952 - } - //if host component is a domain name - else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { - //convert IDN via punycode - try { - components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); - } - catch (e) { - components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - } - } - //normalize encoding - _normalizeComponentEncoding(components, protocol); - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme); - uriTokens.push(":"); - } - const authority = _recomposeAuthority(components, options); - if (authority !== undefined) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - if (components.path !== undefined) { - let s = components.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === undefined) { - s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" - } - uriTokens.push(s); - } - if (components.query !== undefined) { - uriTokens.push("?"); - uriTokens.push(components.query); - } - if (components.fragment !== undefined) { - uriTokens.push("#"); - uriTokens.push(components.fragment); - } - return uriTokens.join(""); //merge tokens into a string -} -; -export function resolveComponents(base, relative, options = {}, skipNormalization) { - const target = {}; - if (!skipNormalization) { - base = parse(serialize(base, options), options); //normalize base components - relative = parse(serialize(relative, options), options); //normalize relative components - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } - else { - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } - else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== undefined) { - target.query = relative.query; - } - else { - target.query = base.query; - } - } - else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } - else { - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { - target.path = "/" + relative.path; - } - else if (!base.path) { - target.path = relative.path; - } - else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - //target.authority = base.authority; - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; -} -; -export function resolve(baseURI, relativeURI, options) { - const schemelessOptions = assign({ scheme: 'null' }, options); - return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); -} -; -export function normalize(uri, options) { - if (typeof uri === "string") { - uri = serialize(parse(uri, options), options); - } - else if (typeOf(uri) === "object") { - uri = parse(serialize(uri, options), options); - } - return uri; -} -; -export function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = serialize(parse(uriA, options), options); - } - else if (typeOf(uriA) === "object") { - uriA = serialize(uriA, options); - } - if (typeof uriB === "string") { - uriB = serialize(parse(uriB, options), options); - } - else if (typeOf(uriB) === "object") { - uriB = serialize(uriB, options); - } - return uriA === uriB; -} -; -export function escapeComponent(str, options) { - return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); -} -; -export function unescapeComponent(str, options) { - return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); -} -; -//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.js.map b/node_modules/uri-js/dist/esnext/uri.js.map deleted file mode 100644 index 2e72ab1..0000000 --- a/node_modules/uri-js/dist/esnext/uri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAA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AK,IAAI,CAAC;AACtB,CAAC;AAAA,CAAC;AAEF,MAAM,0BAA0B,GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.d.ts b/node_modules/uri-js/dist/esnext/util.d.ts deleted file mode 100644 index 7c12857..0000000 --- a/node_modules/uri-js/dist/esnext/util.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function merge(...sets: Array): string; -export declare function subexp(str: string): string; -export declare function typeOf(o: any): string; -export declare function toUpperCase(str: string): string; -export declare function toArray(obj: any): Array; -export declare function assign(target: object, source: any): any; diff --git a/node_modules/uri-js/dist/esnext/util.js b/node_modules/uri-js/dist/esnext/util.js deleted file mode 100644 index 072711e..0000000 --- a/node_modules/uri-js/dist/esnext/util.js +++ /dev/null @@ -1,36 +0,0 @@ -export function merge(...sets) { - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - const xl = sets.length - 1; - for (let x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } - else { - return sets[0]; - } -} -export function subexp(str) { - return "(?:" + str + ")"; -} -export function typeOf(o) { - return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); -} -export function toUpperCase(str) { - return str.toUpperCase(); -} -export function toArray(obj) { - return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; -} -export function assign(target, source) { - const obj = target; - if (source) { - for (const key in source) { - obj[key] = source[key]; - } - } - return obj; -} -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.js.map b/node_modules/uri-js/dist/esnext/util.js.map deleted file mode 100644 index 05d9df0..0000000 --- a/node_modules/uri-js/dist/esnext/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACrB;SAAM;QACN,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;KACf;AACF,CAA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AAC"} \ No newline at end of file diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json deleted file mode 100644 index de95d91..0000000 --- a/node_modules/uri-js/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "uri-js", - "version": "4.4.1", - "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", - "main": "dist/es5/uri.all.js", - "types": "dist/es5/uri.all.d.ts", - "directories": { - "test": "tests" - }, - "files": [ - "dist", - "package.json", - "yarn.lock", - "README.md", - "CHANGELOG", - "LICENSE" - ], - "scripts": { - "build:esnext": "tsc", - "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", - "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", - "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", - "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", - "clean": "rm -rf dist", - "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/garycourt/uri-js" - }, - "keywords": [ - "URI", - "IRI", - "IDN", - "URN", - "UUID", - "HTTP", - "HTTPS", - "WS", - "WSS", - "MAILTO", - "RFC3986", - "RFC3987", - "RFC5891", - "RFC2616", - "RFC2818", - "RFC2141", - "RFC4122", - "RFC4291", - "RFC5952", - "RFC6068", - "RFC6455", - "RFC6874" - ], - "author": "Gary Court ", - "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/garycourt/uri-js/issues" - }, - "homepage": "https://github.com/garycourt/uri-js", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-plugin-external-helpers": "^6.22.0", - "babel-preset-latest": "^6.24.1", - "mocha": "^8.2.1", - "mocha-qunit-ui": "^0.1.3", - "rollup": "^0.41.6", - "rollup-plugin-babel": "^2.7.1", - "rollup-plugin-node-resolve": "^2.0.0", - "sorcery": "^0.10.0", - "typescript": "^2.8.1", - "uglify-js": "^2.8.14" - }, - "dependencies": { - "punycode": "^2.1.0" - } -} diff --git a/node_modules/uri-js/yarn.lock b/node_modules/uri-js/yarn.lock deleted file mode 100644 index 3c42ded..0000000 --- a/node_modules/uri-js/yarn.lock +++ /dev/null @@ -1,2558 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-each@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -babel-cli@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= - dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-core@6: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.0" - debug "^2.6.8" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.7" - slash "^1.0.0" - source-map "^0.5.6" - -babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-external-helpers@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - -babel-plugin-transform-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-regenerator@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-polyfill@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= - dependencies: - babel-runtime "^6.26.0" - core-js "^2.5.0" - regenerator-runtime "^0.10.5" - -babel-preset-es2015@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" - -babel-preset-es2016@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b" - dependencies: - babel-plugin-transform-exponentiation-operator "^6.24.1" - -babel-preset-es2017@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1" - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.24.1" - -babel-preset-latest@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8" - dependencies: - babel-preset-es2015 "^6.24.1" - babel-preset-es2016 "^6.24.1" - babel-preset-es2017 "^6.24.1" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browser-resolve@^1.11.0: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" - dependencies: - resolve "1.1.7" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -buffer-crc32@^0.2.5: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - -builtin-modules@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chokidar@3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" - optionalDependencies: - fsevents "~2.1.2" - -chokidar@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -commander@^2.11.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -convert-source-map@^1.5.0, convert-source-map@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -debug@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" - integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== - dependencies: - ms "2.1.2" - -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -decamelize@^1.0.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= - dependencies: - repeating "^2.0.0" - -diff@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -es6-promise@^3.1.2: - version "3.3.1" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -estree-walker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-readdir-recursive@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" - integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.0.0: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -glob@7.1.6, glob@^7.1.2, glob@^7.1.3: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - -graceful-fs@^4.1.11, graceful-fs@^4.1.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -graceful-fs@^4.1.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -"js-tokens@^3.0.0 || ^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.17.4: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -log-symbols@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" - integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== - dependencies: - chalk "^4.0.0" - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mocha-qunit-ui@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9" - -mocha@^8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39" - integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.4.3" - debug "4.2.0" - diff "4.0.2" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.1.6" - growl "1.10.5" - he "1.2.0" - js-yaml "3.14.0" - log-symbols "4.0.0" - minimatch "3.0.4" - ms "2.1.2" - nanoid "3.1.12" - serialize-javascript "5.0.1" - strip-json-comments "3.1.1" - supports-color "7.2.0" - which "2.0.2" - wide-align "1.1.3" - workerpool "6.0.2" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "2.0.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -nan@^2.12.1: - version "2.14.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== - -nanoid@3.1.12: - version "3.1.12" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654" - integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-tmpdir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" - -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -private@^0.1.6, private@^0.1.7, private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -punycode@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -readable-stream@^2.0.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -regenerate@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" - -regenerator-runtime@^0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - dependencies: - jsesc "~0.5.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - -resolve@^1.1.6: - version "1.6.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" - dependencies: - path-parse "^1.0.5" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -rimraf@^2.5.2: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - dependencies: - glob "^7.1.3" - -rollup-plugin-babel@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" - dependencies: - babel-core "6" - babel-plugin-transform-es2015-classes "^6.9.0" - object-assign "^4.1.0" - rollup-pluginutils "^1.5.0" - -rollup-plugin-node-resolve@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" - dependencies: - browser-resolve "^1.11.0" - builtin-modules "^1.1.0" - resolve "^1.1.6" - -rollup-pluginutils@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" - dependencies: - estree-walker "^0.2.1" - minimatch "^3.0.2" - -rollup@^0.41.6: - version "0.41.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" - dependencies: - source-map-support "^0.4.0" - -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -sander@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" - dependencies: - es6-promise "^3.1.2" - graceful-fs "^4.1.3" - mkdirp "^0.5.1" - rimraf "^2.5.2" - -serialize-javascript@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" - integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== - dependencies: - randombytes "^2.1.0" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -sorcery@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" - dependencies: - buffer-crc32 "^0.2.5" - minimist "^1.2.0" - sander "^0.5.0" - sourcemap-codec "^1.3.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.4.0, source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - dependencies: - source-map "^0.5.6" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -sourcemap-codec@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-json-comments@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@7.2.0, supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -typescript@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624" - -uglify-js@^2.8.14: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -v8flags@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= - dependencies: - user-home "^1.1.1" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - -workerpool@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" - integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== - -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== - -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@13.3.2: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/node_modules/v8-compile-cache-lib/CHANGELOG.md b/node_modules/v8-compile-cache-lib/CHANGELOG.md deleted file mode 100644 index d4da256..0000000 --- a/node_modules/v8-compile-cache-lib/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# `v8-module-cache` Changelog - -## 2021-03-05, Version 2.3.0 - -* Fix use require.main instead of module.parent [#34](https://github.com/zertosh/v8-compile-cache/pull/34). - -## 2020-10-28, Version 2.2.0 - -* Added `V8_COMPILE_CACHE_CACHE_DIR` option [#23](https://github.com/zertosh/v8-compile-cache/pull/23). - -## 2020-05-30, Version 2.1.1 - -* Stop using process.umask() [#28](https://github.com/zertosh/v8-compile-cache/pull/28). - -## 2019-08-04, Version 2.1.0 - -* Fix Electron by calling the module wrapper with `Buffer` [#10](https://github.com/zertosh/v8-compile-cache/pull/10). - -## 2019-05-10, Version 2.0.3 - -* Add `LICENSE` file [#19](https://github.com/zertosh/v8-compile-cache/pull/19). -* Add "repository" to `package.json` (see [eea336e](https://github.com/zertosh/v8-compile-cache/commit/eea336eaa8360f9ded9342b8aa928e56ac6a7529)). -* Support `require.resolve.paths` (added in Node v8.9.0) [#20](https://github.com/zertosh/v8-compile-cache/pull/20)/[#22](https://github.com/zertosh/v8-compile-cache/pull/22). - -## 2018-08-06, Version 2.0.2 - -* Re-publish. - -## 2018-08-06, Version 2.0.1 - -* Support `require.resolve` options (added in Node v8.9.0). - -## 2018-04-30, Version 2.0.0 - -* Use `Buffer.alloc` instead of `new Buffer()`. -* Drop support for Node 5.x. - -## 2018-01-23, Version 1.1.2 - -* Instead of checking for `process.versions.v8`, check that `script.cachedDataProduced` is `true` (rather than `null`/`undefined`) for support to be considered existent. - -## 2018-01-23, Version 1.1.1 - -* Check for the existence of `process.versions.v8` before attaching hook (see [f8b0388](https://github.com/zertosh/v8-compile-cache/commit/f8b038848be94bc2c905880dd50447c73393f364)). - -## 2017-03-27, Version 1.1.0 - -* Safer cache directory creation (see [bcb3b12](https://github.com/zertosh/v8-compile-cache/commit/bcb3b12c819ab0927ec4408e70f612a6d50a9617)). - - The cache is now suffixed with the user's uid on POSIX systems (i.e. `/path/to/tmp/v8-compile-cache-1234`). - -## 2017-02-21, Version 1.0.0 - -* Initial release. diff --git a/node_modules/v8-compile-cache-lib/LICENSE b/node_modules/v8-compile-cache-lib/LICENSE deleted file mode 100644 index b72b670..0000000 --- a/node_modules/v8-compile-cache-lib/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019 Andres Suarez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/v8-compile-cache-lib/README.md b/node_modules/v8-compile-cache-lib/README.md deleted file mode 100644 index 0593feb..0000000 --- a/node_modules/v8-compile-cache-lib/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# v8-compile-cache-lib - -> Fork of [`v8-compile-cache`](https://www.npmjs.com/package/v8-compile-cache) exposed as an API for programmatic usage in other libraries and tools. - ---- - -[![Build status](https://img.shields.io/github/workflow/status/cspotcode/v8-compile-cache-lib/Continuous%20Integration)](https://github.com/cspotcode/v8-compile-cache-lib/actions?query=workflow%3A%22Continuous+Integration%22) - -`v8-compile-cache-lib` attaches a `require` hook to use [V8's code cache](https://v8project.blogspot.com/2015/07/code-caching.html) to speed up instantiation time. The "code cache" is the work of parsing and compiling done by V8. - -The ability to tap into V8 to produce/consume this cache was introduced in [Node v5.7.0](https://nodejs.org/en/blog/release/v5.7.0/). - -## Usage - -1. Add the dependency: - - ```sh - $ npm install --save v8-compile-cache-lib - ``` - -2. Then, in your entry module add: - - ```js - require('v8-compile-cache-lib').install(); - ``` - -**`.install()` in Node <5.7.0 is a noop – but you need at least Node 4.0.0 to support the ES2015 syntax used by `v8-compile-cache-lib`.** - -## Options - -Set the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache. - -Cache directory is defined by environment variable `V8_COMPILE_CACHE_CACHE_DIR` or defaults to `/v8-compile-cache-`. - -## Internals - -Cache files are suffixed `.BLOB` and `.MAP` corresponding to the entry module that required `v8-compile-cache-lib`. The cache is _entry module specific_ because it is faster to load the entire code cache into memory at once, than it is to read it from disk on a file-by-file basis. - -## Benchmarks - -See https://github.com/cspotcode/v8-compile-cache-lib/tree/master/bench. - -**Load Times:** - -| Module | Without Cache | With Cache | -| ---------------- | -------------:| ----------:| -| `babel-core` | `218ms` | `185ms` | -| `yarn` | `153ms` | `113ms` | -| `yarn` (bundled) | `228ms` | `105ms` | - -_^ Includes the overhead of loading the cache itself._ - -## Acknowledgements - -* The original [`v8-compile-cache`](https://github.com/zertosh/v8-compile-cache) from which this library is forked. -* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: - - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js - - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js -* `mkdirpSync` is based on: - - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 diff --git a/node_modules/v8-compile-cache-lib/package.json b/node_modules/v8-compile-cache-lib/package.json deleted file mode 100644 index e905b10..0000000 --- a/node_modules/v8-compile-cache-lib/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "v8-compile-cache-lib", - "version": "3.0.1", - "description": "Require hook for automatic V8 compile cache persistence", - "main": "v8-compile-cache.js", - "scripts": { - "bench": "bench/run.sh", - "eslint": "eslint --max-warnings=0 .", - "tap": "tap test/*-test.js", - "test": "npm run tap", - "posttest": "npm run eslint" - }, - "author": "Andrew Bradley ", - "repository": { - "type": "git", - "url": "https://github.com/cspotcode/v8-compile-cache-lib.git" - }, - "files": [ - "v8-compile-cache.d.ts", - "v8-compile-cache.js" - ], - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "babel-core": "6.26.3", - "eslint": "^7.12.1", - "flow-parser": "0.136.0", - "rimraf": "^2.5.4", - "rxjs": "6.6.3", - "semver": "^5.3.0", - "tap": "^9.0.0", - "temp": "^0.8.3", - "yarn": "1.22.10" - } -} diff --git a/node_modules/v8-compile-cache-lib/v8-compile-cache.d.ts b/node_modules/v8-compile-cache-lib/v8-compile-cache.d.ts deleted file mode 100644 index fb80c2c..0000000 --- a/node_modules/v8-compile-cache-lib/v8-compile-cache.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function install(opts?: { - cacheDir?: string; - prefix?: string; -}): { - uninstall(): void; -} | undefined; -x \ No newline at end of file diff --git a/node_modules/v8-compile-cache-lib/v8-compile-cache.js b/node_modules/v8-compile-cache-lib/v8-compile-cache.js deleted file mode 100644 index baedb36..0000000 --- a/node_modules/v8-compile-cache-lib/v8-compile-cache.js +++ /dev/null @@ -1,391 +0,0 @@ -'use strict'; - -const Module = require('module'); -const crypto = require('crypto'); -const fs = require('fs'); -const path = require('path'); -const vm = require('vm'); -const os = require('os'); - -const hasOwnProperty = Object.prototype.hasOwnProperty; - -//------------------------------------------------------------------------------ -// FileSystemBlobStore -//------------------------------------------------------------------------------ - -class FileSystemBlobStore { - constructor(directory, prefix) { - const name = prefix ? slashEscape(prefix + '.') : ''; - this._blobFilename = path.join(directory, name + 'BLOB'); - this._mapFilename = path.join(directory, name + 'MAP'); - this._lockFilename = path.join(directory, name + 'LOCK'); - this._directory = directory; - this._load(); - } - - has(key, invalidationKey) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - return this._invalidationKeys[key] === invalidationKey; - } else if (hasOwnProperty.call(this._storedMap, key)) { - return this._storedMap[key][0] === invalidationKey; - } - return false; - } - - get(key, invalidationKey) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - if (this._invalidationKeys[key] === invalidationKey) { - return this._memoryBlobs[key]; - } - } else if (hasOwnProperty.call(this._storedMap, key)) { - const mapping = this._storedMap[key]; - if (mapping[0] === invalidationKey) { - return this._storedBlob.slice(mapping[1], mapping[2]); - } - } - } - - set(key, invalidationKey, buffer) { - this._invalidationKeys[key] = invalidationKey; - this._memoryBlobs[key] = buffer; - this._dirty = true; - } - - delete(key) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - this._dirty = true; - delete this._memoryBlobs[key]; - } - if (hasOwnProperty.call(this._invalidationKeys, key)) { - this._dirty = true; - delete this._invalidationKeys[key]; - } - if (hasOwnProperty.call(this._storedMap, key)) { - this._dirty = true; - delete this._storedMap[key]; - } - } - - isDirty() { - return this._dirty; - } - - save() { - const dump = this._getDump(); - const blobToStore = Buffer.concat(dump[0]); - const mapToStore = JSON.stringify(dump[1]); - - try { - mkdirpSync(this._directory); - fs.writeFileSync(this._lockFilename, 'LOCK', {flag: 'wx'}); - } catch (error) { - // Swallow the exception if we fail to acquire the lock. - return false; - } - - try { - fs.writeFileSync(this._blobFilename, blobToStore); - fs.writeFileSync(this._mapFilename, mapToStore); - } finally { - fs.unlinkSync(this._lockFilename); - } - - return true; - } - - _load() { - try { - this._storedBlob = fs.readFileSync(this._blobFilename); - this._storedMap = JSON.parse(fs.readFileSync(this._mapFilename)); - } catch (e) { - this._storedBlob = Buffer.alloc(0); - this._storedMap = {}; - } - this._dirty = false; - this._memoryBlobs = {}; - this._invalidationKeys = {}; - } - - _getDump() { - const buffers = []; - const newMap = {}; - let offset = 0; - - function push(key, invalidationKey, buffer) { - buffers.push(buffer); - newMap[key] = [invalidationKey, offset, offset + buffer.length]; - offset += buffer.length; - } - - for (const key of Object.keys(this._memoryBlobs)) { - const buffer = this._memoryBlobs[key]; - const invalidationKey = this._invalidationKeys[key]; - push(key, invalidationKey, buffer); - } - - for (const key of Object.keys(this._storedMap)) { - if (hasOwnProperty.call(newMap, key)) continue; - const mapping = this._storedMap[key]; - const buffer = this._storedBlob.slice(mapping[1], mapping[2]); - push(key, mapping[0], buffer); - } - - return [buffers, newMap]; - } -} - -//------------------------------------------------------------------------------ -// NativeCompileCache -//------------------------------------------------------------------------------ - -class NativeCompileCache { - constructor() { - this._cacheStore = null; - this._previousModuleCompile = null; - } - - setCacheStore(cacheStore) { - this._cacheStore = cacheStore; - } - - install() { - const self = this; - const hasRequireResolvePaths = typeof require.resolve.paths === 'function'; - this._previousModuleCompile = Module.prototype._compile; - Module.prototype._compile = this._ownModuleCompile = _ownModuleCompile; - self.enabled = true; - function _ownModuleCompile(content, filename) { - if(!self.enabled) return this._previousModuleCompile.apply(this, arguments); - const mod = this; - - function require(id) { - return mod.require(id); - } - - // https://github.com/nodejs/node/blob/v10.15.3/lib/internal/modules/cjs/helpers.js#L28 - function resolve(request, options) { - return Module._resolveFilename(request, mod, false, options); - } - require.resolve = resolve; - - // https://github.com/nodejs/node/blob/v10.15.3/lib/internal/modules/cjs/helpers.js#L37 - // resolve.resolve.paths was added in v8.9.0 - if (hasRequireResolvePaths) { - resolve.paths = function paths(request) { - return Module._resolveLookupPaths(request, mod, true); - }; - } - - require.main = process.mainModule; - - // Enable support to add extra extension types - require.extensions = Module._extensions; - require.cache = Module._cache; - - const dirname = path.dirname(filename); - - const compiledWrapper = self._moduleCompile(filename, content); - - // We skip the debugger setup because by the time we run, node has already - // done that itself. - - // `Buffer` is included for Electron. - // See https://github.com/zertosh/v8-compile-cache/pull/10#issuecomment-518042543 - const args = [mod.exports, require, mod, filename, dirname, process, global, Buffer]; - return compiledWrapper.apply(mod.exports, args); - } - } - - uninstall() { - this.enabled = false; - // If something else has since been installed on top of us, we cannot overwrite it. - if(Module.prototype._compile === this._ownModuleCompile) { - Module.prototype._compile = this._previousModuleCompile; - } - } - - _moduleCompile(filename, content) { - // https://github.com/nodejs/node/blob/v7.5.0/lib/module.js#L511 - - // Remove shebang - var contLen = content.length; - if (contLen >= 2) { - if (content.charCodeAt(0) === 35/*#*/ && - content.charCodeAt(1) === 33/*!*/) { - if (contLen === 2) { - // Exact match - content = ''; - } else { - // Find end of shebang line and slice it off - var i = 2; - for (; i < contLen; ++i) { - var code = content.charCodeAt(i); - if (code === 10/*\n*/ || code === 13/*\r*/) break; - } - if (i === contLen) { - content = ''; - } else { - // Note that this actually includes the newline character(s) in the - // new output. This duplicates the behavior of the regular - // expression that was previously used to replace the shebang line - content = content.slice(i); - } - } - } - } - - // create wrapper function - var wrapper = Module.wrap(content); - - var invalidationKey = crypto - .createHash('sha1') - .update(content, 'utf8') - .digest('hex'); - - var buffer = this._cacheStore.get(filename, invalidationKey); - - var script = new vm.Script(wrapper, { - filename: filename, - lineOffset: 0, - displayErrors: true, - cachedData: buffer, - produceCachedData: true, - }); - - if (script.cachedDataProduced) { - this._cacheStore.set(filename, invalidationKey, script.cachedData); - } else if (script.cachedDataRejected) { - this._cacheStore.delete(filename); - } - - var compiledWrapper = script.runInThisContext({ - filename: filename, - lineOffset: 0, - columnOffset: 0, - displayErrors: true, - }); - - return compiledWrapper; - } -} - -//------------------------------------------------------------------------------ -// utilities -// -// https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 -// https://github.com/zertosh/slash-escape/blob/e7ebb99/slash-escape.js -//------------------------------------------------------------------------------ - -function mkdirpSync(p_) { - _mkdirpSync(path.resolve(p_), 0o777); -} - -function _mkdirpSync(p, mode) { - try { - fs.mkdirSync(p, mode); - } catch (err0) { - if (err0.code === 'ENOENT') { - _mkdirpSync(path.dirname(p)); - _mkdirpSync(p); - } else { - try { - const stat = fs.statSync(p); - if (!stat.isDirectory()) { throw err0; } - } catch (err1) { - throw err0; - } - } - } -} - -function slashEscape(str) { - const ESCAPE_LOOKUP = { - '\\': 'zB', - ':': 'zC', - '/': 'zS', - '\x00': 'z0', - 'z': 'zZ', - }; - const ESCAPE_REGEX = /[\\:/\x00z]/g; // eslint-disable-line no-control-regex - return str.replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]); -} - -function supportsCachedData() { - const script = new vm.Script('""', {produceCachedData: true}); - // chakracore, as of v1.7.1.0, returns `false`. - return script.cachedDataProduced === true; -} - -function getCacheDir() { - const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR; - if (v8_compile_cache_cache_dir) { - return v8_compile_cache_cache_dir; - } - - // Avoid cache ownership issues on POSIX systems. - const dirname = typeof process.getuid === 'function' - ? 'v8-compile-cache-' + process.getuid() - : 'v8-compile-cache'; - const version = typeof process.versions.v8 === 'string' - ? process.versions.v8 - : typeof process.versions.chakracore === 'string' - ? 'chakracore-' + process.versions.chakracore - : 'node-' + process.version; - const cacheDir = path.join(os.tmpdir(), dirname, version); - return cacheDir; -} - -function getMainName() { - // `require.main.filename` is undefined or null when: - // * node -e 'require("v8-compile-cache")' - // * node -r 'v8-compile-cache' - // * Or, requiring from the REPL. - const mainName = require.main && typeof require.main.filename === 'string' - ? require.main.filename - : process.cwd(); - return mainName; -} - -function install(opts) { - if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { - if(typeof opts === 'undefined') opts = {} - let cacheDir = opts.cacheDir - if(typeof cacheDir === 'undefined') cacheDir = getCacheDir(); - let prefix = opts.prefix - if(typeof prefix === 'undefined') prefix = getMainName(); - const blobStore = new FileSystemBlobStore(cacheDir, prefix); - - const nativeCompileCache = new NativeCompileCache(); - nativeCompileCache.setCacheStore(blobStore); - nativeCompileCache.install(); - - let uninstalled = false; - const uninstall = () => { - if(uninstalled) return; - uninstalled = true; - process.removeListener('exit', uninstall); - if (blobStore.isDirty()) { - blobStore.save(); - } - nativeCompileCache.uninstall(); - } - process.once('exit', uninstall); - return {uninstall}; - } -} - -//------------------------------------------------------------------------------ -// main -//------------------------------------------------------------------------------ - -module.exports.install = install; - -module.exports.__TEST__ = { - FileSystemBlobStore, - NativeCompileCache, - mkdirpSync, - slashEscape, - supportsCachedData, - getCacheDir, - getMainName, -}; diff --git a/node_modules/watchpack/LICENSE b/node_modules/watchpack/LICENSE deleted file mode 100644 index 8c11fc7..0000000 --- a/node_modules/watchpack/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/watchpack/README.md b/node_modules/watchpack/README.md deleted file mode 100644 index 2924722..0000000 --- a/node_modules/watchpack/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# watchpack - -Wrapper library for directory and file watching. - -[![Build Status][build-status]][build-status-url] -[![Build status][build-status-veyor]][build-status-veyor-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![codecov][codecov]][codecov-url] -[![downloads][downloads]][downloads-url] -[![Github contributors][contributors]][contributors-url] - -## Concept - -watchpack high level API doesn't map directly to watchers. Instead a three level architecture ensures that for each directory only a single watcher exists. - -- The high level API requests `DirectoryWatchers` from a `WatcherManager`, which ensures that only a single `DirectoryWatcher` per directory is created. -- A user-faced `Watcher` can be obtained from a `DirectoryWatcher` and provides a filtered view on the `DirectoryWatcher`. -- Reference-counting is used on the `DirectoryWatcher` and `Watcher` to decide when to close them. -- The real watchers are created by the `DirectoryWatcher`. -- Files are never watched directly. This should keep the watcher count low. -- Watching can be started in the past. This way watching can start after file reading. -- Symlinks are not followed, instead the symlink is watched. - -## API - -```javascript -var Watchpack = require("watchpack"); - -var wp = new Watchpack({ - // options: - aggregateTimeout: 1000, - // fire "aggregated" event when after a change for 1000ms no additional change occurred - // aggregated defaults to undefined, which doesn't fire an "aggregated" event - - poll: true, - // poll: true - use polling with the default interval - // poll: 10000 - use polling with an interval of 10s - // poll defaults to undefined, which prefer native watching methods - // Note: enable polling when watching on a network path - // When WATCHPACK_POLLING environment variable is set it will override this option - - followSymlinks: true, - // true: follows symlinks and watches symlinks and real files - // (This makes sense when symlinks has not been resolved yet, comes with a performance hit) - // false (default): watches only specified item they may be real files or symlinks - // (This makes sense when symlinks has already been resolved) - - ignored: "**/.git" - // ignored: "string" - a glob pattern for files or folders that should not be watched - // ignored: ["string", "string"] - multiple glob patterns that should be ignored - // ignored: /regexp/ - a regular expression for files or folders that should not be watched - // ignored: (entry) => boolean - an arbitrary function which must return truthy to ignore an entry - // For all cases expect the arbitrary function the path will have path separator normalized to '/'. - // All subdirectories are ignored too -}); - -// Watchpack.prototype.watch({ -// files: Iterable, -// directories: Iterable, -// missing: Iterable, -// startTime?: number -// }) -wp.watch({ - files: listOfFiles, - directories: listOfDirectories, - missing: listOfNotExistingItems, - startTime: Date.now() - 10000 -}); -// starts watching these files and directories -// calling this again will override the files and directories -// files: can be files or directories, for files: content and existence changes are tracked -// for directories: only existence and timestamp changes are tracked -// directories: only directories, directory content (and content of children, ...) and -// existence changes are tracked. -// assumed to exist, when directory is not found without further information a remove event is emitted -// missing: can be files or directorees, -// only existence changes are tracked -// expected to not exist, no remove event is emitted when not found initially -// files and directories are assumed to exist, when they are not found without further information a remove event is emitted -// missing is assumed to not exist and no remove event is emitted - -wp.on("change", function(filePath, mtime, explanation) { - // filePath: the changed file - // mtime: last modified time for the changed file - // explanation: textual information how this change was detected -}); - -wp.on("remove", function(filePath, explanation) { - // filePath: the removed file or directory - // explanation: textual information how this change was detected -}); - -wp.on("aggregated", function(changes, removals) { - // changes: a Set of all changed files - // removals: a Set of all removed files - // watchpack gives up ownership on these Sets. -}); - -// Watchpack.prototype.pause() -wp.pause(); -// stops emitting events, but keeps watchers open -// next "watch" call can reuse the watchers -// The watcher will keep aggregating events -// which can be received with getAggregated() - -// Watchpack.prototype.close() -wp.close(); -// stops emitting events and closes all watchers - -// Watchpack.prototype.getAggregated(): { changes: Set, removals: Set } -const { changes, removals } = wp.getAggregated(); -// returns the current aggregated info and removes that from the watcher -// The next aggregated event won't include that info and will only emitted -// when futher changes happen -// Can also be used when paused. - -// Watchpack.prototype.collectTimeInfoEntries(fileInfoEntries: Map, directoryInfoEntries: Map) -wp.collectTimeInfoEntries(fileInfoEntries, directoryInfoEntries); -// collects time info objects for all known files and directories -// this include info from files not directly watched -// key: absolute path, value: object with { safeTime, timestamp } -// safeTime: a point in time at which it is safe to say all changes happened before that -// timestamp: only for files, the mtime timestamp of the file - -// Watchpack.prototype.getTimeInfoEntries() -var fileTimes = wp.getTimeInfoEntries(); -// returns a Map with all known time info objects for files and directories -// similar to collectTimeInfoEntries but returns a single map with all entries - -// (deprecated) -// Watchpack.prototype.getTimes() -var fileTimes = wp.getTimes(); -// returns an object with all known change times for files -// this include timestamps from files not directly watched -// key: absolute path, value: timestamp as number -``` - -[build-status]: https://travis-ci.org/webpack/watchpack.svg?branch=main -[build-status-url]: https://travis-ci.org/webpack/watchpack -[build-status-veyor]: https://ci.appveyor.com/api/projects/status/e5u2qvmugtv0r647/branch/main?svg=true -[build-status-veyor-url]: https://ci.appveyor.com/project/sokra/watchpack/branch/main -[coveralls-url]: https://coveralls.io/r/webpack/watchpack/ -[coveralls-image]: https://img.shields.io/coveralls/webpack/watchpack.svg -[codecov]: https://codecov.io/gh/webpack/watchpack/branch/main/graph/badge.svg -[codecov-url]: https://codecov.io/gh/webpack/watchpack -[downloads]: https://img.shields.io/npm/dm/watchpack.svg -[downloads-url]: https://www.npmjs.com/package/watchpack -[contributors]: https://img.shields.io/github/contributors/webpack/watchpack.svg -[contributors-url]: https://github.com/webpack/watchpack/graphs/contributors diff --git a/node_modules/watchpack/lib/DirectoryWatcher.js b/node_modules/watchpack/lib/DirectoryWatcher.js deleted file mode 100644 index abbb142..0000000 --- a/node_modules/watchpack/lib/DirectoryWatcher.js +++ /dev/null @@ -1,786 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const EventEmitter = require("events").EventEmitter; -const fs = require("graceful-fs"); -const path = require("path"); - -const watchEventSource = require("./watchEventSource"); - -const EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({}); - -let FS_ACCURACY = 2000; - -const IS_OSX = require("os").platform() === "darwin"; -const WATCHPACK_POLLING = process.env.WATCHPACK_POLLING; -const FORCE_POLLING = - `${+WATCHPACK_POLLING}` === WATCHPACK_POLLING - ? +WATCHPACK_POLLING - : !!WATCHPACK_POLLING && WATCHPACK_POLLING !== "false"; - -function withoutCase(str) { - return str.toLowerCase(); -} - -function needCalls(times, callback) { - return function() { - if (--times === 0) { - return callback(); - } - }; -} - -class Watcher extends EventEmitter { - constructor(directoryWatcher, filePath, startTime) { - super(); - this.directoryWatcher = directoryWatcher; - this.path = filePath; - this.startTime = startTime && +startTime; - } - - checkStartTime(mtime, initial) { - const startTime = this.startTime; - if (typeof startTime !== "number") return !initial; - return startTime <= mtime; - } - - close() { - this.emit("closed"); - } -} - -class DirectoryWatcher extends EventEmitter { - constructor(watcherManager, directoryPath, options) { - super(); - if (FORCE_POLLING) { - options.poll = FORCE_POLLING; - } - this.watcherManager = watcherManager; - this.options = options; - this.path = directoryPath; - // safeTime is the point in time after which reading is safe to be unchanged - // timestamp is a value that should be compared with another timestamp (mtime) - /** @type {Map} */ - this.filesWithoutCase = new Map(); - this.directories = new Map(); - this.lastWatchEvent = 0; - this.initialScan = true; - this.ignored = options.ignored || (() => false); - this.nestedWatching = false; - this.polledWatching = - typeof options.poll === "number" - ? options.poll - : options.poll - ? 5007 - : false; - this.timeout = undefined; - this.initialScanRemoved = new Set(); - this.initialScanFinished = undefined; - /** @type {Map>} */ - this.watchers = new Map(); - this.parentWatcher = null; - this.refs = 0; - this._activeEvents = new Map(); - this.closed = false; - this.scanning = false; - this.scanAgain = false; - this.scanAgainInitial = false; - - this.createWatcher(); - this.doScan(true); - } - - createWatcher() { - try { - if (this.polledWatching) { - this.watcher = { - close: () => { - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = undefined; - } - } - }; - } else { - if (IS_OSX) { - this.watchInParentDirectory(); - } - this.watcher = watchEventSource.watch(this.path); - this.watcher.on("change", this.onWatchEvent.bind(this)); - this.watcher.on("error", this.onWatcherError.bind(this)); - } - } catch (err) { - this.onWatcherError(err); - } - } - - forEachWatcher(path, fn) { - const watchers = this.watchers.get(withoutCase(path)); - if (watchers !== undefined) { - for (const w of watchers) { - fn(w); - } - } - } - - setMissing(itemPath, initial, type) { - if (this.initialScan) { - this.initialScanRemoved.add(itemPath); - } - - const oldDirectory = this.directories.get(itemPath); - if (oldDirectory) { - if (this.nestedWatching) oldDirectory.close(); - this.directories.delete(itemPath); - - this.forEachWatcher(itemPath, w => w.emit("remove", type)); - if (!initial) { - this.forEachWatcher(this.path, w => - w.emit("change", itemPath, null, type, initial) - ); - } - } - - const oldFile = this.files.get(itemPath); - if (oldFile) { - this.files.delete(itemPath); - const key = withoutCase(itemPath); - const count = this.filesWithoutCase.get(key) - 1; - if (count <= 0) { - this.filesWithoutCase.delete(key); - this.forEachWatcher(itemPath, w => w.emit("remove", type)); - } else { - this.filesWithoutCase.set(key, count); - } - - if (!initial) { - this.forEachWatcher(this.path, w => - w.emit("change", itemPath, null, type, initial) - ); - } - } - } - - setFileTime(filePath, mtime, initial, ignoreWhenEqual, type) { - const now = Date.now(); - - if (this.ignored(filePath)) return; - - const old = this.files.get(filePath); - - let safeTime, accuracy; - if (initial) { - safeTime = Math.min(now, mtime) + FS_ACCURACY; - accuracy = FS_ACCURACY; - } else { - safeTime = now; - accuracy = 0; - - if (old && old.timestamp === mtime && mtime + FS_ACCURACY < now) { - // We are sure that mtime is untouched - // This can be caused by some file attribute change - // e. g. when access time has been changed - // but the file content is untouched - return; - } - } - - if (ignoreWhenEqual && old && old.timestamp === mtime) return; - - this.files.set(filePath, { - safeTime, - accuracy, - timestamp: mtime - }); - - if (!old) { - const key = withoutCase(filePath); - const count = this.filesWithoutCase.get(key); - this.filesWithoutCase.set(key, (count || 0) + 1); - if (count !== undefined) { - // There is already a file with case-insensitive-equal name - // On a case-insensitive filesystem we may miss the renaming - // when only casing is changed. - // To be sure that our information is correct - // we trigger a rescan here - this.doScan(false); - } - - this.forEachWatcher(filePath, w => { - if (!initial || w.checkStartTime(safeTime, initial)) { - w.emit("change", mtime, type); - } - }); - } else if (!initial) { - this.forEachWatcher(filePath, w => w.emit("change", mtime, type)); - } - this.forEachWatcher(this.path, w => { - if (!initial || w.checkStartTime(safeTime, initial)) { - w.emit("change", filePath, safeTime, type, initial); - } - }); - } - - setDirectory(directoryPath, birthtime, initial, type) { - if (this.ignored(directoryPath)) return; - if (directoryPath === this.path) { - if (!initial) { - this.forEachWatcher(this.path, w => - w.emit("change", directoryPath, birthtime, type, initial) - ); - } - } else { - const old = this.directories.get(directoryPath); - if (!old) { - const now = Date.now(); - - if (this.nestedWatching) { - this.createNestedWatcher(directoryPath); - } else { - this.directories.set(directoryPath, true); - } - - let safeTime; - if (initial) { - safeTime = Math.min(now, birthtime) + FS_ACCURACY; - } else { - safeTime = now; - } - - this.forEachWatcher(directoryPath, w => { - if (!initial || w.checkStartTime(safeTime, false)) { - w.emit("change", birthtime, type); - } - }); - this.forEachWatcher(this.path, w => { - if (!initial || w.checkStartTime(safeTime, initial)) { - w.emit("change", directoryPath, safeTime, type, initial); - } - }); - } - } - } - - createNestedWatcher(directoryPath) { - const watcher = this.watcherManager.watchDirectory(directoryPath, 1); - watcher.on("change", (filePath, mtime, type, initial) => { - this.forEachWatcher(this.path, w => { - if (!initial || w.checkStartTime(mtime, initial)) { - w.emit("change", filePath, mtime, type, initial); - } - }); - }); - this.directories.set(directoryPath, watcher); - } - - setNestedWatching(flag) { - if (this.nestedWatching !== !!flag) { - this.nestedWatching = !!flag; - if (this.nestedWatching) { - for (const directory of this.directories.keys()) { - this.createNestedWatcher(directory); - } - } else { - for (const [directory, watcher] of this.directories) { - watcher.close(); - this.directories.set(directory, true); - } - } - } - } - - watch(filePath, startTime) { - const key = withoutCase(filePath); - let watchers = this.watchers.get(key); - if (watchers === undefined) { - watchers = new Set(); - this.watchers.set(key, watchers); - } - this.refs++; - const watcher = new Watcher(this, filePath, startTime); - watcher.on("closed", () => { - if (--this.refs <= 0) { - this.close(); - return; - } - watchers.delete(watcher); - if (watchers.size === 0) { - this.watchers.delete(key); - if (this.path === filePath) this.setNestedWatching(false); - } - }); - watchers.add(watcher); - let safeTime; - if (filePath === this.path) { - this.setNestedWatching(true); - safeTime = this.lastWatchEvent; - for (const entry of this.files.values()) { - fixupEntryAccuracy(entry); - safeTime = Math.max(safeTime, entry.safeTime); - } - } else { - const entry = this.files.get(filePath); - if (entry) { - fixupEntryAccuracy(entry); - safeTime = entry.safeTime; - } else { - safeTime = 0; - } - } - if (safeTime) { - if (safeTime >= startTime) { - process.nextTick(() => { - if (this.closed) return; - if (filePath === this.path) { - watcher.emit( - "change", - filePath, - safeTime, - "watch (outdated on attach)", - true - ); - } else { - watcher.emit( - "change", - safeTime, - "watch (outdated on attach)", - true - ); - } - }); - } - } else if (this.initialScan) { - if (this.initialScanRemoved.has(filePath)) { - process.nextTick(() => { - if (this.closed) return; - watcher.emit("remove"); - }); - } - } else if ( - !this.directories.has(filePath) && - watcher.checkStartTime(this.initialScanFinished, false) - ) { - process.nextTick(() => { - if (this.closed) return; - watcher.emit("initial-missing", "watch (missing on attach)"); - }); - } - return watcher; - } - - onWatchEvent(eventType, filename) { - if (this.closed) return; - if (!filename) { - // In some cases no filename is provided - // This seem to happen on windows - // So some event happened but we don't know which file is affected - // We have to do a full scan of the directory - this.doScan(false); - return; - } - - const filePath = path.join(this.path, filename); - if (this.ignored(filePath)) return; - - if (this._activeEvents.get(filename) === undefined) { - this._activeEvents.set(filename, false); - const checkStats = () => { - if (this.closed) return; - this._activeEvents.set(filename, false); - fs.lstat(filePath, (err, stats) => { - if (this.closed) return; - if (this._activeEvents.get(filename) === true) { - process.nextTick(checkStats); - return; - } - this._activeEvents.delete(filename); - // ENOENT happens when the file/directory doesn't exist - // EPERM happens when the containing directory doesn't exist - if (err) { - if ( - err.code !== "ENOENT" && - err.code !== "EPERM" && - err.code !== "EBUSY" - ) { - this.onStatsError(err); - } else { - if (filename === path.basename(this.path)) { - // This may indicate that the directory itself was removed - if (!fs.existsSync(this.path)) { - this.onDirectoryRemoved("stat failed"); - } - } - } - } - this.lastWatchEvent = Date.now(); - if (!stats) { - this.setMissing(filePath, false, eventType); - } else if (stats.isDirectory()) { - this.setDirectory( - filePath, - +stats.birthtime || 1, - false, - eventType - ); - } else if (stats.isFile() || stats.isSymbolicLink()) { - if (stats.mtime) { - ensureFsAccuracy(stats.mtime); - } - this.setFileTime( - filePath, - +stats.mtime || +stats.ctime || 1, - false, - false, - eventType - ); - } - }); - }; - process.nextTick(checkStats); - } else { - this._activeEvents.set(filename, true); - } - } - - onWatcherError(err) { - if (this.closed) return; - if (err) { - if (err.code !== "EPERM" && err.code !== "ENOENT") { - console.error("Watchpack Error (watcher): " + err); - } - this.onDirectoryRemoved("watch error"); - } - } - - onStatsError(err) { - if (err) { - console.error("Watchpack Error (stats): " + err); - } - } - - onScanError(err) { - if (err) { - console.error("Watchpack Error (initial scan): " + err); - } - this.onScanFinished(); - } - - onScanFinished() { - if (this.polledWatching) { - this.timeout = setTimeout(() => { - if (this.closed) return; - this.doScan(false); - }, this.polledWatching); - } - } - - onDirectoryRemoved(reason) { - if (this.watcher) { - this.watcher.close(); - this.watcher = null; - } - this.watchInParentDirectory(); - const type = `directory-removed (${reason})`; - for (const directory of this.directories.keys()) { - this.setMissing(directory, null, type); - } - for (const file of this.files.keys()) { - this.setMissing(file, null, type); - } - } - - watchInParentDirectory() { - if (!this.parentWatcher) { - const parentDir = path.dirname(this.path); - // avoid watching in the root directory - // removing directories in the root directory is not supported - if (path.dirname(parentDir) === parentDir) return; - - this.parentWatcher = this.watcherManager.watchFile(this.path, 1); - this.parentWatcher.on("change", (mtime, type) => { - if (this.closed) return; - - // On non-osx platforms we don't need this watcher to detect - // directory removal, as an EPERM error indicates that - if ((!IS_OSX || this.polledWatching) && this.parentWatcher) { - this.parentWatcher.close(); - this.parentWatcher = null; - } - // Try to create the watcher when parent directory is found - if (!this.watcher) { - this.createWatcher(); - this.doScan(false); - - // directory was created so we emit an event - this.forEachWatcher(this.path, w => - w.emit("change", this.path, mtime, type, false) - ); - } - }); - this.parentWatcher.on("remove", () => { - this.onDirectoryRemoved("parent directory removed"); - }); - } - } - - doScan(initial) { - if (this.scanning) { - if (this.scanAgain) { - if (!initial) this.scanAgainInitial = false; - } else { - this.scanAgain = true; - this.scanAgainInitial = initial; - } - return; - } - this.scanning = true; - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = undefined; - } - process.nextTick(() => { - if (this.closed) return; - fs.readdir(this.path, (err, items) => { - if (this.closed) return; - if (err) { - if (err.code === "ENOENT" || err.code === "EPERM") { - this.onDirectoryRemoved("scan readdir failed"); - } else { - this.onScanError(err); - } - this.initialScan = false; - this.initialScanFinished = Date.now(); - if (initial) { - for (const watchers of this.watchers.values()) { - for (const watcher of watchers) { - if (watcher.checkStartTime(this.initialScanFinished, false)) { - watcher.emit( - "initial-missing", - "scan (parent directory missing in initial scan)" - ); - } - } - } - } - if (this.scanAgain) { - this.scanAgain = false; - this.doScan(this.scanAgainInitial); - } else { - this.scanning = false; - } - return; - } - const itemPaths = new Set( - items.map(item => path.join(this.path, item.normalize("NFC"))) - ); - for (const file of this.files.keys()) { - if (!itemPaths.has(file)) { - this.setMissing(file, initial, "scan (missing)"); - } - } - for (const directory of this.directories.keys()) { - if (!itemPaths.has(directory)) { - this.setMissing(directory, initial, "scan (missing)"); - } - } - if (this.scanAgain) { - // Early repeat of scan - this.scanAgain = false; - this.doScan(initial); - return; - } - const itemFinished = needCalls(itemPaths.size + 1, () => { - if (this.closed) return; - this.initialScan = false; - this.initialScanRemoved = null; - this.initialScanFinished = Date.now(); - if (initial) { - const missingWatchers = new Map(this.watchers); - missingWatchers.delete(withoutCase(this.path)); - for (const item of itemPaths) { - missingWatchers.delete(withoutCase(item)); - } - for (const watchers of missingWatchers.values()) { - for (const watcher of watchers) { - if (watcher.checkStartTime(this.initialScanFinished, false)) { - watcher.emit( - "initial-missing", - "scan (missing in initial scan)" - ); - } - } - } - } - if (this.scanAgain) { - this.scanAgain = false; - this.doScan(this.scanAgainInitial); - } else { - this.scanning = false; - this.onScanFinished(); - } - }); - for (const itemPath of itemPaths) { - fs.lstat(itemPath, (err2, stats) => { - if (this.closed) return; - if (err2) { - if ( - err2.code === "ENOENT" || - err2.code === "EPERM" || - err2.code === "EACCES" || - err2.code === "EBUSY" - ) { - this.setMissing(itemPath, initial, "scan (" + err2.code + ")"); - } else { - this.onScanError(err2); - } - itemFinished(); - return; - } - if (stats.isFile() || stats.isSymbolicLink()) { - if (stats.mtime) { - ensureFsAccuracy(stats.mtime); - } - this.setFileTime( - itemPath, - +stats.mtime || +stats.ctime || 1, - initial, - true, - "scan (file)" - ); - } else if (stats.isDirectory()) { - if (!initial || !this.directories.has(itemPath)) - this.setDirectory( - itemPath, - +stats.birthtime || 1, - initial, - "scan (dir)" - ); - } - itemFinished(); - }); - } - itemFinished(); - }); - }); - } - - getTimes() { - const obj = Object.create(null); - let safeTime = this.lastWatchEvent; - for (const [file, entry] of this.files) { - fixupEntryAccuracy(entry); - safeTime = Math.max(safeTime, entry.safeTime); - obj[file] = Math.max(entry.safeTime, entry.timestamp); - } - if (this.nestedWatching) { - for (const w of this.directories.values()) { - const times = w.directoryWatcher.getTimes(); - for (const file of Object.keys(times)) { - const time = times[file]; - safeTime = Math.max(safeTime, time); - obj[file] = time; - } - } - obj[this.path] = safeTime; - } - if (!this.initialScan) { - for (const watchers of this.watchers.values()) { - for (const watcher of watchers) { - const path = watcher.path; - if (!Object.prototype.hasOwnProperty.call(obj, path)) { - obj[path] = null; - } - } - } - } - return obj; - } - - collectTimeInfoEntries(fileTimestamps, directoryTimestamps) { - let safeTime = this.lastWatchEvent; - for (const [file, entry] of this.files) { - fixupEntryAccuracy(entry); - safeTime = Math.max(safeTime, entry.safeTime); - fileTimestamps.set(file, entry); - } - if (this.nestedWatching) { - for (const w of this.directories.values()) { - safeTime = Math.max( - safeTime, - w.directoryWatcher.collectTimeInfoEntries( - fileTimestamps, - directoryTimestamps - ) - ); - } - fileTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY); - directoryTimestamps.set(this.path, { - safeTime - }); - } else { - for (const dir of this.directories.keys()) { - // No additional info about this directory - // but maybe another DirectoryWatcher has info - fileTimestamps.set(dir, EXISTANCE_ONLY_TIME_ENTRY); - if (!directoryTimestamps.has(dir)) - directoryTimestamps.set(dir, EXISTANCE_ONLY_TIME_ENTRY); - } - fileTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY); - directoryTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY); - } - if (!this.initialScan) { - for (const watchers of this.watchers.values()) { - for (const watcher of watchers) { - const path = watcher.path; - if (!fileTimestamps.has(path)) { - fileTimestamps.set(path, null); - } - } - } - } - return safeTime; - } - - close() { - this.closed = true; - this.initialScan = false; - if (this.watcher) { - this.watcher.close(); - this.watcher = null; - } - if (this.nestedWatching) { - for (const w of this.directories.values()) { - w.close(); - } - this.directories.clear(); - } - if (this.parentWatcher) { - this.parentWatcher.close(); - this.parentWatcher = null; - } - this.emit("closed"); - } -} - -module.exports = DirectoryWatcher; -module.exports.EXISTANCE_ONLY_TIME_ENTRY = EXISTANCE_ONLY_TIME_ENTRY; - -function fixupEntryAccuracy(entry) { - if (entry.accuracy > FS_ACCURACY) { - entry.safeTime = entry.safeTime - entry.accuracy + FS_ACCURACY; - entry.accuracy = FS_ACCURACY; - } -} - -function ensureFsAccuracy(mtime) { - if (!mtime) return; - if (FS_ACCURACY > 1 && mtime % 1 !== 0) FS_ACCURACY = 1; - else if (FS_ACCURACY > 10 && mtime % 10 !== 0) FS_ACCURACY = 10; - else if (FS_ACCURACY > 100 && mtime % 100 !== 0) FS_ACCURACY = 100; - else if (FS_ACCURACY > 1000 && mtime % 1000 !== 0) FS_ACCURACY = 1000; -} diff --git a/node_modules/watchpack/lib/LinkResolver.js b/node_modules/watchpack/lib/LinkResolver.js deleted file mode 100644 index daea90b..0000000 --- a/node_modules/watchpack/lib/LinkResolver.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const fs = require("fs"); -const path = require("path"); - -// macOS, Linux, and Windows all rely on these errors -const EXPECTED_ERRORS = new Set(["EINVAL", "ENOENT"]); - -// On Windows there is also this error in some cases -if (process.platform === "win32") EXPECTED_ERRORS.add("UNKNOWN"); - -class LinkResolver { - constructor() { - this.cache = new Map(); - } - - /** - * @param {string} file path to file or directory - * @returns {string[]} array of file and all symlinks contributed in the resolving process (first item is the resolved file) - */ - resolve(file) { - const cacheEntry = this.cache.get(file); - if (cacheEntry !== undefined) { - return cacheEntry; - } - const parent = path.dirname(file); - if (parent === file) { - // At root of filesystem there can't be a link - const result = Object.freeze([file]); - this.cache.set(file, result); - return result; - } - // resolve the parent directory to find links there and get the real path - const parentResolved = this.resolve(parent); - let realFile = file; - - // is the parent directory really somewhere else? - if (parentResolved[0] !== parent) { - // get the real location of file - const basename = path.basename(file); - realFile = path.resolve(parentResolved[0], basename); - } - // try to read the link content - try { - const linkContent = fs.readlinkSync(realFile); - - // resolve the link content relative to the parent directory - const resolvedLink = path.resolve(parentResolved[0], linkContent); - - // recursive resolve the link content for more links in the structure - const linkResolved = this.resolve(resolvedLink); - - // merge parent and link resolve results - let result; - if (linkResolved.length > 1 && parentResolved.length > 1) { - // when both contain links we need to duplicate them with a Set - const resultSet = new Set(linkResolved); - // add the link - resultSet.add(realFile); - // add all symlinks of the parent - for (let i = 1; i < parentResolved.length; i++) { - resultSet.add(parentResolved[i]); - } - result = Object.freeze(Array.from(resultSet)); - } else if (parentResolved.length > 1) { - // we have links in the parent but not for the link content location - result = parentResolved.slice(); - result[0] = linkResolved[0]; - // add the link - result.push(realFile); - Object.freeze(result); - } else if (linkResolved.length > 1) { - // we can return the link content location result - result = linkResolved.slice(); - // add the link - result.push(realFile); - Object.freeze(result); - } else { - // neither link content location nor parent have links - // this link is the only link here - result = Object.freeze([ - // the resolve real location - linkResolved[0], - // add the link - realFile - ]); - } - this.cache.set(file, result); - return result; - } catch (e) { - if (!EXPECTED_ERRORS.has(e.code)) { - throw e; - } - // no link - const result = parentResolved.slice(); - result[0] = realFile; - Object.freeze(result); - this.cache.set(file, result); - return result; - } - } -} -module.exports = LinkResolver; diff --git a/node_modules/watchpack/lib/getWatcherManager.js b/node_modules/watchpack/lib/getWatcherManager.js deleted file mode 100644 index e0dcd6a..0000000 --- a/node_modules/watchpack/lib/getWatcherManager.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const path = require("path"); -const DirectoryWatcher = require("./DirectoryWatcher"); - -class WatcherManager { - constructor(options) { - this.options = options; - this.directoryWatchers = new Map(); - } - - getDirectoryWatcher(directory) { - const watcher = this.directoryWatchers.get(directory); - if (watcher === undefined) { - const newWatcher = new DirectoryWatcher(this, directory, this.options); - this.directoryWatchers.set(directory, newWatcher); - newWatcher.on("closed", () => { - this.directoryWatchers.delete(directory); - }); - return newWatcher; - } - return watcher; - } - - watchFile(p, startTime) { - const directory = path.dirname(p); - if (directory === p) return null; - return this.getDirectoryWatcher(directory).watch(p, startTime); - } - - watchDirectory(directory, startTime) { - return this.getDirectoryWatcher(directory).watch(directory, startTime); - } -} - -const watcherManagers = new WeakMap(); -/** - * @param {object} options options - * @returns {WatcherManager} the watcher manager - */ -module.exports = options => { - const watcherManager = watcherManagers.get(options); - if (watcherManager !== undefined) return watcherManager; - const newWatcherManager = new WatcherManager(options); - watcherManagers.set(options, newWatcherManager); - return newWatcherManager; -}; -module.exports.WatcherManager = WatcherManager; diff --git a/node_modules/watchpack/lib/reducePlan.js b/node_modules/watchpack/lib/reducePlan.js deleted file mode 100644 index b281ed6..0000000 --- a/node_modules/watchpack/lib/reducePlan.js +++ /dev/null @@ -1,138 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const path = require("path"); - -/** - * @template T - * @typedef {Object} TreeNode - * @property {string} filePath - * @property {TreeNode} parent - * @property {TreeNode[]} children - * @property {number} entries - * @property {boolean} active - * @property {T[] | T | undefined} value - */ - -/** - * @template T - * @param {Map>} the new plan - */ -module.exports = (plan, limit) => { - const treeMap = new Map(); - // Convert to tree - for (const [filePath, value] of plan) { - treeMap.set(filePath, { - filePath, - parent: undefined, - children: undefined, - entries: 1, - active: true, - value - }); - } - let currentCount = treeMap.size; - // Create parents and calculate sum of entries - for (const node of treeMap.values()) { - const parentPath = path.dirname(node.filePath); - if (parentPath !== node.filePath) { - let parent = treeMap.get(parentPath); - if (parent === undefined) { - parent = { - filePath: parentPath, - parent: undefined, - children: [node], - entries: node.entries, - active: false, - value: undefined - }; - treeMap.set(parentPath, parent); - node.parent = parent; - } else { - node.parent = parent; - if (parent.children === undefined) { - parent.children = [node]; - } else { - parent.children.push(node); - } - do { - parent.entries += node.entries; - parent = parent.parent; - } while (parent); - } - } - } - // Reduce until limit reached - while (currentCount > limit) { - // Select node that helps reaching the limit most effectively without overmerging - const overLimit = currentCount - limit; - let bestNode = undefined; - let bestCost = Infinity; - for (const node of treeMap.values()) { - if (node.entries <= 1 || !node.children || !node.parent) continue; - if (node.children.length === 0) continue; - if (node.children.length === 1 && !node.value) continue; - // Try to select the node with has just a bit more entries than we need to reduce - // When just a bit more is over 30% over the limit, - // also consider just a bit less entries then we need to reduce - const cost = - node.entries - 1 >= overLimit - ? node.entries - 1 - overLimit - : overLimit - node.entries + 1 + limit * 0.3; - if (cost < bestCost) { - bestNode = node; - bestCost = cost; - } - } - if (!bestNode) break; - // Merge all children - const reduction = bestNode.entries - 1; - bestNode.active = true; - bestNode.entries = 1; - currentCount -= reduction; - let parent = bestNode.parent; - while (parent) { - parent.entries -= reduction; - parent = parent.parent; - } - const queue = new Set(bestNode.children); - for (const node of queue) { - node.active = false; - node.entries = 0; - if (node.children) { - for (const child of node.children) queue.add(child); - } - } - } - // Write down new plan - const newPlan = new Map(); - for (const rootNode of treeMap.values()) { - if (!rootNode.active) continue; - const map = new Map(); - const queue = new Set([rootNode]); - for (const node of queue) { - if (node.active && node !== rootNode) continue; - if (node.value) { - if (Array.isArray(node.value)) { - for (const item of node.value) { - map.set(item, node.filePath); - } - } else { - map.set(node.value, node.filePath); - } - } - if (node.children) { - for (const child of node.children) { - queue.add(child); - } - } - } - newPlan.set(rootNode.filePath, map); - } - return newPlan; -}; diff --git a/node_modules/watchpack/lib/watchEventSource.js b/node_modules/watchpack/lib/watchEventSource.js deleted file mode 100644 index 3583c2e..0000000 --- a/node_modules/watchpack/lib/watchEventSource.js +++ /dev/null @@ -1,335 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const fs = require("fs"); -const path = require("path"); -const { EventEmitter } = require("events"); -const reducePlan = require("./reducePlan"); - -const IS_OSX = require("os").platform() === "darwin"; -const IS_WIN = require("os").platform() === "win32"; -const SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN; - -const watcherLimit = - +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 2000 : 10000); - -const recursiveWatcherLogging = !!process.env - .WATCHPACK_RECURSIVE_WATCHER_LOGGING; - -let isBatch = false; -let watcherCount = 0; - -/** @type {Map} */ -const pendingWatchers = new Map(); - -/** @type {Map} */ -const recursiveWatchers = new Map(); - -/** @type {Map} */ -const directWatchers = new Map(); - -/** @type {Map} */ -const underlyingWatcher = new Map(); - -class DirectWatcher { - constructor(filePath) { - this.filePath = filePath; - this.watchers = new Set(); - this.watcher = undefined; - try { - const watcher = fs.watch(filePath); - this.watcher = watcher; - watcher.on("change", (type, filename) => { - for (const w of this.watchers) { - w.emit("change", type, filename); - } - }); - watcher.on("error", error => { - for (const w of this.watchers) { - w.emit("error", error); - } - }); - } catch (err) { - process.nextTick(() => { - for (const w of this.watchers) { - w.emit("error", err); - } - }); - } - watcherCount++; - } - - add(watcher) { - underlyingWatcher.set(watcher, this); - this.watchers.add(watcher); - } - - remove(watcher) { - this.watchers.delete(watcher); - if (this.watchers.size === 0) { - directWatchers.delete(this.filePath); - watcherCount--; - if (this.watcher) this.watcher.close(); - } - } - - getWatchers() { - return this.watchers; - } -} - -class RecursiveWatcher { - constructor(rootPath) { - this.rootPath = rootPath; - /** @type {Map} */ - this.mapWatcherToPath = new Map(); - /** @type {Map>} */ - this.mapPathToWatchers = new Map(); - this.watcher = undefined; - try { - const watcher = fs.watch(rootPath, { - recursive: true - }); - this.watcher = watcher; - watcher.on("change", (type, filename) => { - if (!filename) { - if (recursiveWatcherLogging) { - process.stderr.write( - `[watchpack] dispatch ${type} event in recursive watcher (${ - this.rootPath - }) to all watchers\n` - ); - } - for (const w of this.mapWatcherToPath.keys()) { - w.emit("change", type); - } - } else { - const dir = path.dirname(filename); - const watchers = this.mapPathToWatchers.get(dir); - if (recursiveWatcherLogging) { - process.stderr.write( - `[watchpack] dispatch ${type} event in recursive watcher (${ - this.rootPath - }) for '${filename}' to ${ - watchers ? watchers.size : 0 - } watchers\n` - ); - } - if (watchers === undefined) return; - for (const w of watchers) { - w.emit("change", type, path.basename(filename)); - } - } - }); - watcher.on("error", error => { - for (const w of this.mapWatcherToPath.keys()) { - w.emit("error", error); - } - }); - } catch (err) { - process.nextTick(() => { - for (const w of this.mapWatcherToPath.keys()) { - w.emit("error", err); - } - }); - } - watcherCount++; - if (recursiveWatcherLogging) { - process.stderr.write( - `[watchpack] created recursive watcher at ${rootPath}\n` - ); - } - } - - add(filePath, watcher) { - underlyingWatcher.set(watcher, this); - const subpath = filePath.slice(this.rootPath.length + 1) || "."; - this.mapWatcherToPath.set(watcher, subpath); - const set = this.mapPathToWatchers.get(subpath); - if (set === undefined) { - const newSet = new Set(); - newSet.add(watcher); - this.mapPathToWatchers.set(subpath, newSet); - } else { - set.add(watcher); - } - } - - remove(watcher) { - const subpath = this.mapWatcherToPath.get(watcher); - if (!subpath) return; - this.mapWatcherToPath.delete(watcher); - const set = this.mapPathToWatchers.get(subpath); - set.delete(watcher); - if (set.size === 0) { - this.mapPathToWatchers.delete(subpath); - } - if (this.mapWatcherToPath.size === 0) { - recursiveWatchers.delete(this.rootPath); - watcherCount--; - if (this.watcher) this.watcher.close(); - if (recursiveWatcherLogging) { - process.stderr.write( - `[watchpack] closed recursive watcher at ${this.rootPath}\n` - ); - } - } - } - - getWatchers() { - return this.mapWatcherToPath; - } -} - -class Watcher extends EventEmitter { - close() { - if (pendingWatchers.has(this)) { - pendingWatchers.delete(this); - return; - } - const watcher = underlyingWatcher.get(this); - watcher.remove(this); - underlyingWatcher.delete(this); - } -} - -const createDirectWatcher = filePath => { - const existing = directWatchers.get(filePath); - if (existing !== undefined) return existing; - const w = new DirectWatcher(filePath); - directWatchers.set(filePath, w); - return w; -}; - -const createRecursiveWatcher = rootPath => { - const existing = recursiveWatchers.get(rootPath); - if (existing !== undefined) return existing; - const w = new RecursiveWatcher(rootPath); - recursiveWatchers.set(rootPath, w); - return w; -}; - -const execute = () => { - /** @type {Map} */ - const map = new Map(); - const addWatcher = (watcher, filePath) => { - const entry = map.get(filePath); - if (entry === undefined) { - map.set(filePath, watcher); - } else if (Array.isArray(entry)) { - entry.push(watcher); - } else { - map.set(filePath, [entry, watcher]); - } - }; - for (const [watcher, filePath] of pendingWatchers) { - addWatcher(watcher, filePath); - } - pendingWatchers.clear(); - - // Fast case when we are not reaching the limit - if (!SUPPORTS_RECURSIVE_WATCHING || watcherLimit - watcherCount >= map.size) { - // Create watchers for all entries in the map - for (const [filePath, entry] of map) { - const w = createDirectWatcher(filePath); - if (Array.isArray(entry)) { - for (const item of entry) w.add(item); - } else { - w.add(entry); - } - } - return; - } - - // Reconsider existing watchers to improving watch plan - for (const watcher of recursiveWatchers.values()) { - for (const [w, subpath] of watcher.getWatchers()) { - addWatcher(w, path.join(watcher.rootPath, subpath)); - } - } - for (const watcher of directWatchers.values()) { - for (const w of watcher.getWatchers()) { - addWatcher(w, watcher.filePath); - } - } - - // Merge map entries to keep watcher limit - // Create a 10% buffer to be able to enter fast case more often - const plan = reducePlan(map, watcherLimit * 0.9); - - // Update watchers for all entries in the map - for (const [filePath, entry] of plan) { - if (entry.size === 1) { - for (const [watcher, filePath] of entry) { - const w = createDirectWatcher(filePath); - const old = underlyingWatcher.get(watcher); - if (old === w) continue; - w.add(watcher); - if (old !== undefined) old.remove(watcher); - } - } else { - const filePaths = new Set(entry.values()); - if (filePaths.size > 1) { - const w = createRecursiveWatcher(filePath); - for (const [watcher, watcherPath] of entry) { - const old = underlyingWatcher.get(watcher); - if (old === w) continue; - w.add(watcherPath, watcher); - if (old !== undefined) old.remove(watcher); - } - } else { - for (const filePath of filePaths) { - const w = createDirectWatcher(filePath); - for (const watcher of entry.keys()) { - const old = underlyingWatcher.get(watcher); - if (old === w) continue; - w.add(watcher); - if (old !== undefined) old.remove(watcher); - } - } - } - } - } -}; - -exports.watch = filePath => { - const watcher = new Watcher(); - // Find an existing watcher - const directWatcher = directWatchers.get(filePath); - if (directWatcher !== undefined) { - directWatcher.add(watcher); - return watcher; - } - let current = filePath; - for (;;) { - const recursiveWatcher = recursiveWatchers.get(current); - if (recursiveWatcher !== undefined) { - recursiveWatcher.add(filePath, watcher); - return watcher; - } - const parent = path.dirname(current); - if (parent === current) break; - current = parent; - } - // Queue up watcher for creation - pendingWatchers.set(watcher, filePath); - if (!isBatch) execute(); - return watcher; -}; - -exports.batch = fn => { - isBatch = true; - try { - fn(); - } finally { - isBatch = false; - execute(); - } -}; - -exports.getNumberOfWatchers = () => { - return watcherCount; -}; diff --git a/node_modules/watchpack/lib/watchpack.js b/node_modules/watchpack/lib/watchpack.js deleted file mode 100644 index ddc9138..0000000 --- a/node_modules/watchpack/lib/watchpack.js +++ /dev/null @@ -1,383 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -const getWatcherManager = require("./getWatcherManager"); -const LinkResolver = require("./LinkResolver"); -const EventEmitter = require("events").EventEmitter; -const globToRegExp = require("glob-to-regexp"); -const watchEventSource = require("./watchEventSource"); - -const EMPTY_ARRAY = []; -const EMPTY_OPTIONS = {}; - -function addWatchersToSet(watchers, set) { - for (const ww of watchers) { - const w = ww.watcher; - if (!set.has(w.directoryWatcher)) { - set.add(w.directoryWatcher); - } - } -} - -const stringToRegexp = ignored => { - const source = globToRegExp(ignored, { globstar: true, extended: true }) - .source; - const matchingStart = source.slice(0, source.length - 1) + "(?:$|\\/)"; - return matchingStart; -}; - -const ignoredToFunction = ignored => { - if (Array.isArray(ignored)) { - const regexp = new RegExp(ignored.map(i => stringToRegexp(i)).join("|")); - return x => regexp.test(x.replace(/\\/g, "/")); - } else if (typeof ignored === "string") { - const regexp = new RegExp(stringToRegexp(ignored)); - return x => regexp.test(x.replace(/\\/g, "/")); - } else if (ignored instanceof RegExp) { - return x => ignored.test(x.replace(/\\/g, "/")); - } else if (ignored instanceof Function) { - return ignored; - } else if (ignored) { - throw new Error(`Invalid option for 'ignored': ${ignored}`); - } else { - return () => false; - } -}; - -const normalizeOptions = options => { - return { - followSymlinks: !!options.followSymlinks, - ignored: ignoredToFunction(options.ignored), - poll: options.poll - }; -}; - -const normalizeCache = new WeakMap(); -const cachedNormalizeOptions = options => { - const cacheEntry = normalizeCache.get(options); - if (cacheEntry !== undefined) return cacheEntry; - const normalized = normalizeOptions(options); - normalizeCache.set(options, normalized); - return normalized; -}; - -class WatchpackFileWatcher { - constructor(watchpack, watcher, files) { - this.files = Array.isArray(files) ? files : [files]; - this.watcher = watcher; - watcher.on("initial-missing", type => { - for (const file of this.files) { - if (!watchpack._missing.has(file)) - watchpack._onRemove(file, file, type); - } - }); - watcher.on("change", (mtime, type) => { - for (const file of this.files) { - watchpack._onChange(file, mtime, file, type); - } - }); - watcher.on("remove", type => { - for (const file of this.files) { - watchpack._onRemove(file, file, type); - } - }); - } - - update(files) { - if (!Array.isArray(files)) { - if (this.files.length !== 1) { - this.files = [files]; - } else if (this.files[0] !== files) { - this.files[0] = files; - } - } else { - this.files = files; - } - } - - close() { - this.watcher.close(); - } -} - -class WatchpackDirectoryWatcher { - constructor(watchpack, watcher, directories) { - this.directories = Array.isArray(directories) ? directories : [directories]; - this.watcher = watcher; - watcher.on("initial-missing", type => { - for (const item of this.directories) { - watchpack._onRemove(item, item, type); - } - }); - watcher.on("change", (file, mtime, type) => { - for (const item of this.directories) { - watchpack._onChange(item, mtime, file, type); - } - }); - watcher.on("remove", type => { - for (const item of this.directories) { - watchpack._onRemove(item, item, type); - } - }); - } - - update(directories) { - if (!Array.isArray(directories)) { - if (this.directories.length !== 1) { - this.directories = [directories]; - } else if (this.directories[0] !== directories) { - this.directories[0] = directories; - } - } else { - this.directories = directories; - } - } - - close() { - this.watcher.close(); - } -} - -class Watchpack extends EventEmitter { - constructor(options) { - super(); - if (!options) options = EMPTY_OPTIONS; - this.options = options; - this.aggregateTimeout = - typeof options.aggregateTimeout === "number" - ? options.aggregateTimeout - : 200; - this.watcherOptions = cachedNormalizeOptions(options); - this.watcherManager = getWatcherManager(this.watcherOptions); - this.fileWatchers = new Map(); - this.directoryWatchers = new Map(); - this._missing = new Set(); - this.startTime = undefined; - this.paused = false; - this.aggregatedChanges = new Set(); - this.aggregatedRemovals = new Set(); - this.aggregateTimer = undefined; - this._onTimeout = this._onTimeout.bind(this); - } - - watch(arg1, arg2, arg3) { - let files, directories, missing, startTime; - if (!arg2) { - ({ - files = EMPTY_ARRAY, - directories = EMPTY_ARRAY, - missing = EMPTY_ARRAY, - startTime - } = arg1); - } else { - files = arg1; - directories = arg2; - missing = EMPTY_ARRAY; - startTime = arg3; - } - this.paused = false; - const fileWatchers = this.fileWatchers; - const directoryWatchers = this.directoryWatchers; - const ignored = this.watcherOptions.ignored; - const filter = path => !ignored(path); - const addToMap = (map, key, item) => { - const list = map.get(key); - if (list === undefined) { - map.set(key, item); - } else if (Array.isArray(list)) { - list.push(item); - } else { - map.set(key, [list, item]); - } - }; - const fileWatchersNeeded = new Map(); - const directoryWatchersNeeded = new Map(); - const missingFiles = new Set(); - if (this.watcherOptions.followSymlinks) { - const resolver = new LinkResolver(); - for (const file of files) { - if (filter(file)) { - for (const innerFile of resolver.resolve(file)) { - if (file === innerFile || filter(innerFile)) { - addToMap(fileWatchersNeeded, innerFile, file); - } - } - } - } - for (const file of missing) { - if (filter(file)) { - for (const innerFile of resolver.resolve(file)) { - if (file === innerFile || filter(innerFile)) { - missingFiles.add(file); - addToMap(fileWatchersNeeded, innerFile, file); - } - } - } - } - for (const dir of directories) { - if (filter(dir)) { - let first = true; - for (const innerItem of resolver.resolve(dir)) { - if (filter(innerItem)) { - addToMap( - first ? directoryWatchersNeeded : fileWatchersNeeded, - innerItem, - dir - ); - } - first = false; - } - } - } - } else { - for (const file of files) { - if (filter(file)) { - addToMap(fileWatchersNeeded, file, file); - } - } - for (const file of missing) { - if (filter(file)) { - missingFiles.add(file); - addToMap(fileWatchersNeeded, file, file); - } - } - for (const dir of directories) { - if (filter(dir)) { - addToMap(directoryWatchersNeeded, dir, dir); - } - } - } - // Close unneeded old watchers - // and update existing watchers - for (const [key, w] of fileWatchers) { - const needed = fileWatchersNeeded.get(key); - if (needed === undefined) { - w.close(); - fileWatchers.delete(key); - } else { - w.update(needed); - fileWatchersNeeded.delete(key); - } - } - for (const [key, w] of directoryWatchers) { - const needed = directoryWatchersNeeded.get(key); - if (needed === undefined) { - w.close(); - directoryWatchers.delete(key); - } else { - w.update(needed); - directoryWatchersNeeded.delete(key); - } - } - // Create new watchers and install handlers on these watchers - watchEventSource.batch(() => { - for (const [key, files] of fileWatchersNeeded) { - const watcher = this.watcherManager.watchFile(key, startTime); - if (watcher) { - fileWatchers.set(key, new WatchpackFileWatcher(this, watcher, files)); - } - } - for (const [key, directories] of directoryWatchersNeeded) { - const watcher = this.watcherManager.watchDirectory(key, startTime); - if (watcher) { - directoryWatchers.set( - key, - new WatchpackDirectoryWatcher(this, watcher, directories) - ); - } - } - }); - this._missing = missingFiles; - this.startTime = startTime; - } - - close() { - this.paused = true; - if (this.aggregateTimer) clearTimeout(this.aggregateTimer); - for (const w of this.fileWatchers.values()) w.close(); - for (const w of this.directoryWatchers.values()) w.close(); - this.fileWatchers.clear(); - this.directoryWatchers.clear(); - } - - pause() { - this.paused = true; - if (this.aggregateTimer) clearTimeout(this.aggregateTimer); - } - - getTimes() { - const directoryWatchers = new Set(); - addWatchersToSet(this.fileWatchers.values(), directoryWatchers); - addWatchersToSet(this.directoryWatchers.values(), directoryWatchers); - const obj = Object.create(null); - for (const w of directoryWatchers) { - const times = w.getTimes(); - for (const file of Object.keys(times)) obj[file] = times[file]; - } - return obj; - } - - getTimeInfoEntries() { - const map = new Map(); - this.collectTimeInfoEntries(map, map); - return map; - } - - collectTimeInfoEntries(fileTimestamps, directoryTimestamps) { - const allWatchers = new Set(); - addWatchersToSet(this.fileWatchers.values(), allWatchers); - addWatchersToSet(this.directoryWatchers.values(), allWatchers); - const safeTime = { value: 0 }; - for (const w of allWatchers) { - w.collectTimeInfoEntries(fileTimestamps, directoryTimestamps, safeTime); - } - } - - getAggregated() { - if (this.aggregateTimer) { - clearTimeout(this.aggregateTimer); - this.aggregateTimer = undefined; - } - const changes = this.aggregatedChanges; - const removals = this.aggregatedRemovals; - this.aggregatedChanges = new Set(); - this.aggregatedRemovals = new Set(); - return { changes, removals }; - } - - _onChange(item, mtime, file, type) { - file = file || item; - if (!this.paused) { - this.emit("change", file, mtime, type); - if (this.aggregateTimer) clearTimeout(this.aggregateTimer); - this.aggregateTimer = setTimeout(this._onTimeout, this.aggregateTimeout); - } - this.aggregatedRemovals.delete(item); - this.aggregatedChanges.add(item); - } - - _onRemove(item, file, type) { - file = file || item; - if (!this.paused) { - this.emit("remove", file, type); - if (this.aggregateTimer) clearTimeout(this.aggregateTimer); - this.aggregateTimer = setTimeout(this._onTimeout, this.aggregateTimeout); - } - this.aggregatedChanges.delete(item); - this.aggregatedRemovals.add(item); - } - - _onTimeout() { - this.aggregateTimer = undefined; - const changes = this.aggregatedChanges; - const removals = this.aggregatedRemovals; - this.aggregatedChanges = new Set(); - this.aggregatedRemovals = new Set(); - this.emit("aggregated", changes, removals); - } -} - -module.exports = Watchpack; diff --git a/node_modules/watchpack/package.json b/node_modules/watchpack/package.json deleted file mode 100644 index b1a10dc..0000000 --- a/node_modules/watchpack/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "watchpack", - "version": "2.4.0", - "description": "", - "main": "./lib/watchpack.js", - "directories": { - "test": "test" - }, - "files": [ - "lib/" - ], - "scripts": { - "pretest": "yarn lint", - "test": "mocha", - "lint": "eslint lib", - "precover": "yarn lint", - "pretty-files": "prettier \"lib/**.*\" \"test/**/*.js\" --write", - "cover": "istanbul cover node_modules/mocha/bin/_mocha" - }, - "repository": { - "type": "git", - "url": "https://github.com/webpack/watchpack.git" - }, - "author": "Tobias Koppers @sokra", - "license": "MIT", - "bugs": { - "url": "https://github.com/webpack/watchpack/issues" - }, - "homepage": "https://github.com/webpack/watchpack", - "devDependencies": { - "coveralls": "^3.0.0", - "eslint": "^5.11.1", - "eslint-config-prettier": "^4.3.0", - "eslint-plugin-prettier": "^3.1.0", - "istanbul": "^0.4.3", - "mocha": "^5.0.1", - "prettier": "^1.11.0", - "rimraf": "^2.6.2", - "should": "^8.3.1", - "write-file-atomic": "^3.0.1" - }, - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } -} diff --git a/node_modules/webpack-cli/LICENSE b/node_modules/webpack-cli/LICENSE deleted file mode 100644 index 3d5fa73..0000000 --- a/node_modules/webpack-cli/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/webpack-cli/README.md b/node_modules/webpack-cli/README.md deleted file mode 100644 index 430d7f0..0000000 --- a/node_modules/webpack-cli/README.md +++ /dev/null @@ -1,145 +0,0 @@ - - -# webpack CLI - -The official CLI of webpack - -## About - -webpack CLI provides a flexible set of commands for developers to increase speed when setting up a custom webpack project. As of webpack v4, webpack is not expecting a configuration file, but often developers want to create a more custom webpack configuration based on their use-cases and needs. webpack CLI addresses these needs by providing a set of tools to improve the setup of custom webpack configuration. - -## How to install - -When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed! - -Otherwise - -```bash -npm install --save-dev webpack-cli -``` - -or - -```bash -yarn add webpack-cli --dev -``` - -## Supported arguments and commands - -### Usage - -All interactions with webpack-cli are of the form - -```bash -npx webpack-cli [command] [options] -``` - -If no command is specified then `bundle` command is used by default - -### Help Usage - -To display basic commands and arguments - - -```bash -npx webpack-cli --help -``` - -To display all supported commands and arguments - - -```bash -npx webpack-cli --help=verbose -``` - -or - -```bash -npx webpack-cli --help verbose -``` - -### Available Commands - -``` - build|bundle|b [entries...] [options] Run webpack (default command, can be omitted). - configtest|t [config-path] Validate a webpack configuration. - help|h [command] [option] Display help for commands and options. - info|i [options] Outputs information about your system. - init|create|new|c|n [generation-path] [options] Initialize a new webpack project. - loader|l [output-path] [options] Scaffold a loader. - plugin|p [output-path] [options] Scaffold a plugin. - serve|server|s [entries...] [options] Run the webpack dev server. - version|v [commands...] Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. - watch|w [entries...] [options] Run webpack and watch for files changes. -``` - -### Available Options - -``` -Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --disable-interpret Disable interpret for loading the config file. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --define-process-env-node-env Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`) - --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack - -d, --devtool A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). - --no-devtool Negative 'devtool' option. - --entry A module that is loaded upon startup. Only the last one is exported. - --mode Enable production optimizations or development hints. - --name Name of the configuration. Used when loading multiple configurations. - -o, --output-path The output directory as **absolute path** (required). - --stats [value] Stats options object or preset name. - --no-stats Negative 'stats' option. - -t, --target Environment to build for. Environment to build for. An array of environments to build for all of them when possible. - --no-target Negative 'target' option. - -w, --watch Enter watch mode, which rebuilds on file change. - --no-watch Negative 'watch' option. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Negative 'watch-options-stdin' option. - -Global options: - --color Enable colors on console. - --no-color Disable colors on console. - -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. - -h, --help [verbose] Display help for commands and options. -``` - -Checkout [`OPTIONS.md`](https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md) to see list of all available options. - -## Exit codes and their meanings - -| Exit Code | Description | -| --------- | -------------------------------------------------- | -| `0` | Success | -| `1` | Errors from webpack | -| `2` | Configuration/options problem or an internal error | - -## CLI Environment Variables - -| Environment Variable | Description | -| ----------------------------------- | ------------------------------------------------------------------- | -| `WEBPACK_CLI_SKIP_IMPORT_LOCAL` | when `true` it will skip using the local instance of `webpack-cli`. | -| `WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG` | when `true` it will force load the ESM config. | -| `WEBPACK_PACKAGE` | Use a custom webpack version in CLI. | -| `WEBPACK_DEV_SERVER_PACKAGE` | Use a custom webpack-dev-server version in CLI. | -| `WEBPACK_CLI_HELP_WIDTH` | Use custom width for help output. | - -## Configuration Environment Variables - -You can use the following environment variables inside your webpack configuration: - -| Environment Variable | Description | -| -------------------- | -------------------------------------------- | -| `WEBPACK_SERVE` | `true` if `serve\|s` is being used. | -| `WEBPACK_BUILD` | `true` if `build\|bundle\|b` is being used. | -| `WEBPACK_WATCH` | `true` if `--watch\|watch\|w` is being used. | - -Checkout [webpack.js.org](https://webpack.js.org/api/cli/) for more detailed documentation of `webpack-cli`. diff --git a/node_modules/webpack-cli/bin/cli.js b/node_modules/webpack-cli/bin/cli.js deleted file mode 100644 index 5305a83..0000000 --- a/node_modules/webpack-cli/bin/cli.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node - -"use strict"; - -const importLocal = require("import-local"); -const runCLI = require("../lib/bootstrap"); - -if (!process.env.WEBPACK_CLI_SKIP_IMPORT_LOCAL) { - // Prefer the local installation of `webpack-cli` - if (importLocal(__filename)) { - return; - } -} - -process.title = "webpack"; - -runCLI(process.argv); diff --git a/node_modules/webpack-cli/lib/bootstrap.d.ts b/node_modules/webpack-cli/lib/bootstrap.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/webpack-cli/lib/bootstrap.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/webpack-cli/lib/bootstrap.js b/node_modules/webpack-cli/lib/bootstrap.js deleted file mode 100644 index 130f61e..0000000 --- a/node_modules/webpack-cli/lib/bootstrap.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// eslint-disable-next-line @typescript-eslint/no-var-requires -const WebpackCLI = require("./webpack-cli"); -const runCLI = async (args) => { - // Create a new instance of the CLI object - const cli = new WebpackCLI(); - try { - await cli.run(args); - } - catch (error) { - cli.logger.error(error); - process.exit(2); - } -}; -module.exports = runCLI; diff --git a/node_modules/webpack-cli/lib/index.d.ts b/node_modules/webpack-cli/lib/index.d.ts deleted file mode 100644 index 267f746..0000000 --- a/node_modules/webpack-cli/lib/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from "./types"; diff --git a/node_modules/webpack-cli/lib/index.js b/node_modules/webpack-cli/lib/index.js deleted file mode 100644 index f029c39..0000000 --- a/node_modules/webpack-cli/lib/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// eslint-disable-next-line @typescript-eslint/no-var-requires -const CLI = require("./webpack-cli"); -module.exports = CLI; diff --git a/node_modules/webpack-cli/lib/plugins/cli-plugin.d.ts b/node_modules/webpack-cli/lib/plugins/cli-plugin.d.ts deleted file mode 100644 index 6c6465e..0000000 --- a/node_modules/webpack-cli/lib/plugins/cli-plugin.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type Compiler } from "webpack"; -import { type CLIPluginOptions } from "../types"; -export declare class CLIPlugin { - #private; - logger: ReturnType; - options: CLIPluginOptions; - constructor(options: CLIPluginOptions); - setupBundleAnalyzerPlugin(compiler: Compiler): Promise; - setupProgressPlugin(compiler: Compiler): void; - setupHelpfulOutput(compiler: Compiler): void; - apply(compiler: Compiler): void; -} diff --git a/node_modules/webpack-cli/lib/plugins/cli-plugin.js b/node_modules/webpack-cli/lib/plugins/cli-plugin.js deleted file mode 100644 index a8ff1e4..0000000 --- a/node_modules/webpack-cli/lib/plugins/cli-plugin.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _a, _CLIPlugin_progressStates; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CLIPlugin = void 0; -class CLIPlugin { - constructor(options) { - this.options = options; - } - async setupBundleAnalyzerPlugin(compiler) { - // eslint-disable-next-line node/no-extraneous-require,@typescript-eslint/no-var-requires - const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); - const bundleAnalyzerPlugin = Boolean(compiler.options.plugins.find((plugin) => plugin instanceof BundleAnalyzerPlugin)); - if (!bundleAnalyzerPlugin) { - new BundleAnalyzerPlugin().apply(compiler); - } - } - setupProgressPlugin(compiler) { - const { ProgressPlugin } = compiler.webpack || require("webpack"); - const progressPlugin = Boolean(compiler.options.plugins.find((plugin) => plugin instanceof ProgressPlugin)); - if (progressPlugin) { - return; - } - const isProfile = this.options.progress === "profile"; - const options = { - profile: isProfile, - }; - if (this.options.isMultiCompiler && ProgressPlugin.createDefaultHandler) { - const handler = ProgressPlugin.createDefaultHandler(isProfile, compiler.getInfrastructureLogger("webpack.Progress")); - const idx = __classPrivateFieldGet(CLIPlugin, _a, "f", _CLIPlugin_progressStates).length; - __classPrivateFieldGet(CLIPlugin, _a, "f", _CLIPlugin_progressStates)[idx] = [0]; - options.handler = (p, msg, ...args) => { - __classPrivateFieldGet(CLIPlugin, _a, "f", _CLIPlugin_progressStates)[idx] = [p, msg, ...args]; - let sum = 0; - for (const [p] of __classPrivateFieldGet(CLIPlugin, _a, "f", _CLIPlugin_progressStates)) { - sum += p; - } - handler(sum / __classPrivateFieldGet(CLIPlugin, _a, "f", _CLIPlugin_progressStates).length, `[${compiler.name ? compiler.name : idx}] ${msg}`, ...args); - }; - } - new ProgressPlugin(options).apply(compiler); - } - setupHelpfulOutput(compiler) { - const pluginName = "webpack-cli"; - const getCompilationName = () => (compiler.name ? `'${compiler.name}'` : ""); - const logCompilation = (message) => { - if (process.env.WEBPACK_CLI_START_FINISH_FORCE_LOG) { - process.stderr.write(message); - } - else { - this.logger.log(message); - } - }; - const { configPath } = this.options; - compiler.hooks.run.tap(pluginName, () => { - const name = getCompilationName(); - logCompilation(`Compiler${name ? ` ${name}` : ""} starting... `); - if (configPath) { - this.logger.log(`Compiler${name ? ` ${name}` : ""} is using config: ${configPath - .map((path) => `'${path}'`) - .join(", ")}`); - } - }); - compiler.hooks.watchRun.tap(pluginName, (compiler) => { - const { bail, watch } = compiler.options; - if (bail && watch) { - this.logger.warn('You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.'); - } - const name = getCompilationName(); - logCompilation(`Compiler${name ? ` ${name}` : ""} starting... `); - if (configPath) { - this.logger.log(`Compiler${name ? ` ${name}` : ""} is using config: '${configPath}'`); - } - }); - compiler.hooks.invalid.tap(pluginName, (filename, changeTime) => { - const date = new Date(changeTime); - this.logger.log(`File '${filename}' was modified`); - this.logger.log(`Changed time is ${date} (timestamp is ${changeTime})`); - }); - (compiler.webpack ? compiler.hooks.afterDone : compiler.hooks.done).tap(pluginName, () => { - const name = getCompilationName(); - logCompilation(`Compiler${name ? ` ${name}` : ""} finished`); - process.nextTick(() => { - if (compiler.watchMode) { - this.logger.log(`Compiler${name ? `${name}` : ""} is watching files for updates...`); - } - }); - }); - } - apply(compiler) { - this.logger = compiler.getInfrastructureLogger("webpack-cli"); - if (this.options.progress) { - this.setupProgressPlugin(compiler); - } - if (this.options.analyze) { - this.setupBundleAnalyzerPlugin(compiler); - } - this.setupHelpfulOutput(compiler); - } -} -exports.CLIPlugin = CLIPlugin; -_a = CLIPlugin; -_CLIPlugin_progressStates = { value: [] }; -module.exports = CLIPlugin; diff --git a/node_modules/webpack-cli/lib/types.d.ts b/node_modules/webpack-cli/lib/types.d.ts deleted file mode 100644 index 39afdc2..0000000 --- a/node_modules/webpack-cli/lib/types.d.ts +++ /dev/null @@ -1,230 +0,0 @@ -/// -import type { EntryOptions, Stats, Configuration, WebpackError, StatsOptions, WebpackOptionsNormalized, Compiler, MultiCompiler, Problem, Argument, AssetEmittedInfo, FileCacheOptions } from "webpack"; -import type webpack from "webpack"; -import type { ClientConfiguration, Configuration as DevServerConfig } from "webpack-dev-server"; -import { type Colorette } from "colorette"; -import { type Command, type CommandOptions, type Option, type ParseOptions } from "commander"; -import { type prepare } from "rechoir"; -import { type stringifyStream } from "@discoveryjs/json-ext"; -/** - * Webpack CLI - */ -interface IWebpackCLI { - colors: WebpackCLIColors; - logger: WebpackCLILogger; - isColorSupportChanged: boolean | undefined; - webpack: typeof webpack; - builtInOptionsCache: WebpackCLIBuiltInOption[] | undefined; - program: WebpackCLICommand; - isMultipleCompiler(compiler: WebpackCompiler): compiler is MultiCompiler; - isPromise(value: Promise): value is Promise; - isFunction(value: unknown): value is CallableFunction; - getLogger(): WebpackCLILogger; - createColors(useColors?: boolean): WebpackCLIColors; - toKebabCase: StringFormatter; - capitalizeFirstLetter: StringFormatter; - checkPackageExists(packageName: string): boolean; - getAvailablePackageManagers(): PackageManager[]; - getDefaultPackageManager(): PackageManager | undefined; - doInstall(packageName: string, options?: PackageInstallOptions): Promise; - loadJSONFile(path: Path, handleError: boolean): Promise; - tryRequireThenImport(module: ModuleName, handleError: boolean): Promise; - getInfoOptions(): WebpackCLIBuiltInOption[]; - getInfoOutput(options: { - output: string; - additionalPackage: string[]; - }): Promise; - makeCommand(commandOptions: WebpackCLIOptions, options: WebpackCLICommandOptions, action: CommandAction): Promise; - makeOption(command: WebpackCLICommand, option: WebpackCLIBuiltInOption): void; - run(args: Parameters[0], parseOptions?: ParseOptions): Promise; - getBuiltInOptions(): WebpackCLIBuiltInOption[]; - loadWebpack(handleError?: boolean): Promise; - loadConfig(options: Partial): Promise; - buildConfig(config: WebpackCLIConfig, options: WebpackDevServerOptions): Promise; - isValidationError(error: Error): error is WebpackError; - createCompiler(options: Partial, callback?: Callback<[Error | undefined, WebpackCLIStats | undefined]>): Promise; - needWatchStdin(compiler: Compiler | MultiCompiler): boolean; - runWebpack(options: WebpackRunOptions, isWatchCommand: boolean): Promise; -} -interface WebpackCLIColors extends Colorette { - isColorSupported: boolean; -} -interface WebpackCLILogger { - error: LogHandler; - warn: LogHandler; - info: LogHandler; - success: LogHandler; - log: LogHandler; - raw: LogHandler; -} -interface WebpackCLICommandOption extends CommanderOption { - helpLevel?: "minimum" | "verbose"; -} -interface WebpackCLIConfig { - options: WebpackConfiguration | WebpackConfiguration[]; - path: WeakMap; -} -interface WebpackCLICommand extends Command { - pkg: string | undefined; - forHelp: boolean | undefined; - _args: WebpackCLICommandOption[]; -} -interface WebpackCLIStats extends Stats { - presetToOptions?: (item: string | boolean) => StatsOptions; -} -type WebpackCLIMainOption = Pick & { - flags: string; - type: Set; -}; -interface WebpackCLIOptions extends CommandOptions { - name: string; - alias: string | string[]; - description?: string; - usage?: string; - dependencies?: string[]; - pkg?: string; - argsDescription?: { - [argName: string]: string; - }; -} -type WebpackCLICommandOptions = WebpackCLIBuiltInOption[] | (() => Promise); -interface WebpackCLIBuiltInFlag { - name: string; - alias?: string; - type?: (value: string, previous: Record) => Record; - configs?: Partial[]; - negative?: boolean; - multiple?: boolean; - valueName?: string; - description: string; - describe?: string; - negatedDescription?: string; - defaultValue?: string; - helpLevel: "minimum" | "verbose"; -} -interface WebpackCLIBuiltInOption extends WebpackCLIBuiltInFlag { - hidden?: boolean; - group?: "core"; -} -type WebpackCLIExternalCommandInfo = Pick & { - pkg: string; -}; -/** - * Webpack dev server - */ -type WebpackDevServerOptions = DevServerConfig & WebpackConfiguration & ClientConfiguration & AssetEmittedInfo & WebpackOptionsNormalized & FileCacheOptions & Argv & { - nodeEnv?: "string"; - watchOptionsStdin?: boolean; - progress?: boolean | "profile" | undefined; - analyze?: boolean; - prefetch?: string; - json?: boolean; - entry: EntryOptions; - merge?: boolean; - config: string[]; - configName?: string[]; - disableInterpret?: boolean; - extends?: string[]; - argv: Argv; -}; -type Callback = (...args: T) => void; -/** - * Webpack - */ -type WebpackConfiguration = Configuration; -type ConfigOptions = PotentialPromise; -type CallableOption = (env: Env | undefined, argv: Argv) => WebpackConfiguration; -type WebpackCompiler = Compiler | MultiCompiler; -type FlagType = boolean | "enum" | "string" | "path" | "number" | "boolean" | "RegExp" | "reset"; -type FlagConfig = { - negatedDescription: string; - type: FlagType; - values: FlagType[]; -}; -type FileSystemCacheOptions = WebpackConfiguration & { - cache: FileCacheOptions & { - defaultConfig: string[]; - }; -}; -type ProcessedArguments = Record; -type CommandAction = Parameters[0]; -interface WebpackRunOptions extends WebpackOptionsNormalized { - progress?: boolean | "profile"; - json?: boolean; - argv?: Argv; - env: Env; - failOnWarnings?: boolean; - isWatchingLikeCommand?: boolean; -} -/** - * Package management - */ -type PackageManager = "pnpm" | "yarn" | "npm"; -interface PackageInstallOptions { - preMessage?: () => void; -} -interface BasicPackageJsonContent { - name: string; - version: string; - description: string; - license: string; -} -/** - * Plugins and util types - */ -interface CLIPluginOptions { - isMultiCompiler?: boolean; - configPath?: string[]; - helpfulOutput: boolean; - hot?: boolean | "only"; - progress?: boolean | "profile"; - prefetch?: string; - analyze?: boolean; -} -type BasicPrimitive = string | boolean | number; -type Instantiable = { - new (...args: ConstructorParameters): InstanceType; -}; -type PotentialPromise = T | Promise; -type ModuleName = string; -type Path = string; -type LogHandler = (value: any) => void; -type StringFormatter = (value: string) => string; -interface Argv extends Record { - env?: Env; -} -interface Env { - WEBPACK_BUNDLE?: boolean; - WEBPACK_BUILD?: boolean; - WEBPACK_WATCH?: boolean; - WEBPACK_SERVE?: boolean; - WEBPACK_PACKAGE?: string; - WEBPACK_DEV_SERVER_PACKAGE?: string; -} -type DynamicImport = (url: string) => Promise<{ - default: T; -}>; -interface ImportLoaderError extends Error { - code?: string; -} -/** - * External libraries types - */ -type OptionConstructor = new (flags: string, description?: string) => Option; -type CommanderOption = InstanceType; -interface Rechoir { - prepare: typeof prepare; -} -interface JsonExt { - stringifyStream: typeof stringifyStream; -} -interface RechoirError extends Error { - failures: RechoirError[]; - error: Error; -} -interface PromptOptions { - message: string; - defaultResponse: string; - stream: NodeJS.WritableStream; -} -export { IWebpackCLI, WebpackCLICommandOption, WebpackCLIBuiltInOption, WebpackCLIBuiltInFlag, WebpackCLIColors, WebpackCLIStats, WebpackCLIConfig, WebpackCLIExternalCommandInfo, WebpackCLIOptions, WebpackCLICommand, WebpackCLICommandOptions, WebpackCLIMainOption, WebpackCLILogger, WebpackDevServerOptions, WebpackRunOptions, WebpackCompiler, WebpackConfiguration, Argv, Argument, BasicPrimitive, BasicPackageJsonContent, CallableOption, Callback, CLIPluginOptions, CommandAction, CommanderOption, CommandOptions, ConfigOptions, DynamicImport, FileSystemCacheOptions, FlagConfig, ImportLoaderError, Instantiable, JsonExt, ModuleName, PackageInstallOptions, PackageManager, Path, ProcessedArguments, PromptOptions, Problem, PotentialPromise, Rechoir, RechoirError, }; diff --git a/node_modules/webpack-cli/lib/types.js b/node_modules/webpack-cli/lib/types.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/webpack-cli/lib/types.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/webpack-cli/lib/utils/dynamic-import-loader.d.ts b/node_modules/webpack-cli/lib/utils/dynamic-import-loader.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/webpack-cli/lib/utils/dynamic-import-loader.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/webpack-cli/lib/utils/dynamic-import-loader.js b/node_modules/webpack-cli/lib/utils/dynamic-import-loader.js deleted file mode 100644 index 324f512..0000000 --- a/node_modules/webpack-cli/lib/utils/dynamic-import-loader.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function dynamicImportLoader() { - let importESM; - try { - importESM = new Function("id", "return import(id);"); - } - catch (e) { - importESM = null; - } - return importESM; -} -module.exports = dynamicImportLoader; diff --git a/node_modules/webpack-cli/lib/webpack-cli.d.ts b/node_modules/webpack-cli/lib/webpack-cli.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/webpack-cli/lib/webpack-cli.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/webpack-cli/lib/webpack-cli.js b/node_modules/webpack-cli/lib/webpack-cli.js deleted file mode 100644 index 8e07613..0000000 --- a/node_modules/webpack-cli/lib/webpack-cli.js +++ /dev/null @@ -1,1892 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = require("fs"); -const path = require("path"); -const { pathToFileURL } = require("url"); -const util = require("util"); -const { program, Option } = require("commander"); -const WEBPACK_PACKAGE_IS_CUSTOM = !!process.env.WEBPACK_PACKAGE; -const WEBPACK_PACKAGE = WEBPACK_PACKAGE_IS_CUSTOM - ? process.env.WEBPACK_PACKAGE - : "webpack"; -const WEBPACK_DEV_SERVER_PACKAGE_IS_CUSTOM = !!process.env.WEBPACK_DEV_SERVER_PACKAGE; -const WEBPACK_DEV_SERVER_PACKAGE = WEBPACK_DEV_SERVER_PACKAGE_IS_CUSTOM - ? process.env.WEBPACK_DEV_SERVER_PACKAGE - : "webpack-dev-server"; -class WebpackCLI { - constructor() { - this.colors = this.createColors(); - this.logger = this.getLogger(); - // Initialize program - this.program = program; - this.program.name("webpack"); - this.program.configureOutput({ - writeErr: this.logger.error, - outputError: (str, write) => write(`Error: ${this.capitalizeFirstLetter(str.replace(/^error:/, "").trim())}`), - }); - } - isMultipleCompiler(compiler) { - return compiler.compilers; - } - isPromise(value) { - return typeof value.then === "function"; - } - isFunction(value) { - return typeof value === "function"; - } - capitalizeFirstLetter(str) { - if (typeof str !== "string") { - return ""; - } - return str.charAt(0).toUpperCase() + str.slice(1); - } - toKebabCase(str) { - return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); - } - createColors(useColor) { - const { createColors, isColorSupported } = require("colorette"); - let shouldUseColor; - if (useColor) { - shouldUseColor = useColor; - } - else { - shouldUseColor = isColorSupported; - } - return Object.assign(Object.assign({}, createColors({ useColor: shouldUseColor })), { isColorSupported: shouldUseColor }); - } - getLogger() { - return { - error: (val) => console.error(`[webpack-cli] ${this.colors.red(util.format(val))}`), - warn: (val) => console.warn(`[webpack-cli] ${this.colors.yellow(val)}`), - info: (val) => console.info(`[webpack-cli] ${this.colors.cyan(val)}`), - success: (val) => console.log(`[webpack-cli] ${this.colors.green(val)}`), - log: (val) => console.log(`[webpack-cli] ${val}`), - raw: (val) => console.log(val), - }; - } - checkPackageExists(packageName) { - if (process.versions.pnp) { - return true; - } - let dir = __dirname; - do { - try { - if (fs.statSync(path.join(dir, "node_modules", packageName)).isDirectory()) { - return true; - } - } - catch (_error) { - // Nothing - } - } while (dir !== (dir = path.dirname(dir))); - // https://github.com/nodejs/node/blob/v18.9.1/lib/internal/modules/cjs/loader.js#L1274 - for (const internalPath of require("module").globalPaths) { - try { - if (fs.statSync(path.join(internalPath, packageName)).isDirectory()) { - return true; - } - } - catch (_error) { - // Nothing - } - } - return false; - } - getAvailablePackageManagers() { - const { sync } = require("cross-spawn"); - const installers = ["npm", "yarn", "pnpm"]; - const hasPackageManagerInstalled = (packageManager) => { - try { - sync(packageManager, ["--version"]); - return packageManager; - } - catch (err) { - return false; - } - }; - const availableInstallers = installers.filter((installer) => hasPackageManagerInstalled(installer)); - if (!availableInstallers.length) { - this.logger.error("No package manager found."); - process.exit(2); - } - return availableInstallers; - } - getDefaultPackageManager() { - const { sync } = require("cross-spawn"); - const hasLocalNpm = fs.existsSync(path.resolve(process.cwd(), "package-lock.json")); - if (hasLocalNpm) { - return "npm"; - } - const hasLocalYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock")); - if (hasLocalYarn) { - return "yarn"; - } - const hasLocalPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml")); - if (hasLocalPnpm) { - return "pnpm"; - } - try { - // the sync function below will fail if npm is not installed, - // an error will be thrown - if (sync("npm", ["--version"])) { - return "npm"; - } - } - catch (e) { - // Nothing - } - try { - // the sync function below will fail if yarn is not installed, - // an error will be thrown - if (sync("yarn", ["--version"])) { - return "yarn"; - } - } - catch (e) { - // Nothing - } - try { - // the sync function below will fail if pnpm is not installed, - // an error will be thrown - if (sync("pnpm", ["--version"])) { - return "pnpm"; - } - } - catch (e) { - this.logger.error("No package manager found."); - process.exit(2); - } - } - async doInstall(packageName, options = {}) { - const packageManager = this.getDefaultPackageManager(); - if (!packageManager) { - this.logger.error("Can't find package manager"); - process.exit(2); - } - if (options.preMessage) { - options.preMessage(); - } - const prompt = ({ message, defaultResponse, stream }) => { - const readline = require("readline"); - const rl = readline.createInterface({ - input: process.stdin, - output: stream, - }); - return new Promise((resolve) => { - rl.question(`${message} `, (answer) => { - // Close the stream - rl.close(); - const response = (answer || defaultResponse).toLowerCase(); - // Resolve with the input response - if (response === "y" || response === "yes") { - resolve(true); - } - else { - resolve(false); - } - }); - }); - }; - // yarn uses 'add' command, rest npm and pnpm both use 'install' - const commandArguments = [packageManager === "yarn" ? "add" : "install", "-D", packageName]; - const commandToBeRun = `${packageManager} ${commandArguments.join(" ")}`; - let needInstall; - try { - needInstall = await prompt({ - message: `[webpack-cli] Would you like to install '${this.colors.green(packageName)}' package? (That will run '${this.colors.green(commandToBeRun)}') (${this.colors.yellow("Y/n")})`, - defaultResponse: "Y", - stream: process.stderr, - }); - } - catch (error) { - this.logger.error(error); - process.exit(error); - } - if (needInstall) { - const { sync } = require("cross-spawn"); - try { - sync(packageManager, commandArguments, { stdio: "inherit" }); - } - catch (error) { - this.logger.error(error); - process.exit(2); - } - return packageName; - } - process.exit(2); - } - async tryRequireThenImport(module, handleError = true, moduleType = "unknown") { - let result; - switch (moduleType) { - case "unknown": { - try { - result = require(module); - } - catch (error) { - const dynamicImportLoader = require("./utils/dynamic-import-loader")(); - if ((error.code === "ERR_REQUIRE_ESM" || - process.env.WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG) && - pathToFileURL && - dynamicImportLoader) { - const urlForConfig = pathToFileURL(module); - result = await dynamicImportLoader(urlForConfig); - result = result.default; - return result; - } - if (handleError) { - this.logger.error(error); - process.exit(2); - } - else { - throw error; - } - } - break; - } - case "commonjs": { - try { - result = require(module); - } - catch (error) { - if (handleError) { - this.logger.error(error); - process.exit(2); - } - else { - throw error; - } - } - break; - } - case "esm": { - try { - const dynamicImportLoader = require("./utils/dynamic-import-loader")(); - if (pathToFileURL && dynamicImportLoader) { - const urlForConfig = pathToFileURL(module); - result = await dynamicImportLoader(urlForConfig); - result = result.default; - return result; - } - } - catch (error) { - if (handleError) { - this.logger.error(error); - process.exit(2); - } - else { - throw error; - } - } - break; - } - } - // For babel and other, only commonjs - if (result && typeof result === "object" && "default" in result) { - result = result.default || {}; - } - return result || {}; - } - loadJSONFile(pathToFile, handleError = true) { - let result; - try { - result = require(pathToFile); - } - catch (error) { - if (handleError) { - this.logger.error(error); - process.exit(2); - } - else { - throw error; - } - } - return result; - } - getInfoOptions() { - return [ - { - name: "output", - alias: "o", - configs: [ - { - type: "string", - }, - ], - description: "To get the output in a specified format ( accept json or markdown )", - helpLevel: "minimum", - }, - { - name: "additional-package", - alias: "a", - configs: [{ type: "string" }], - multiple: true, - description: "Adds additional packages to the output", - helpLevel: "minimum", - }, - ]; - } - async getInfoOutput(options) { - let { output } = options; - const envinfoConfig = {}; - if (output) { - // Remove quotes if exist - output = output.replace(/['"]+/g, ""); - switch (output) { - case "markdown": - envinfoConfig["markdown"] = true; - break; - case "json": - envinfoConfig["json"] = true; - break; - default: - this.logger.error(`'${output}' is not a valid value for output`); - process.exit(2); - } - } - const defaultInformation = { - Binaries: ["Node", "Yarn", "npm"], - Browsers: [ - "Brave Browser", - "Chrome", - "Chrome Canary", - "Edge", - "Firefox", - "Firefox Developer Edition", - "Firefox Nightly", - "Internet Explorer", - "Safari", - "Safari Technology Preview", - ], - Monorepos: ["Yarn Workspaces", "Lerna"], - System: ["OS", "CPU", "Memory"], - npmGlobalPackages: ["webpack", "webpack-cli", "webpack-dev-server"], - }; - let defaultPackages = ["webpack", "loader", "@webpack-cli/"]; - if (typeof options.additionalPackage !== "undefined") { - defaultPackages = [...defaultPackages, ...options.additionalPackage]; - } - defaultInformation.npmPackages = `{${defaultPackages.map((item) => `*${item}*`).join(",")}}`; - const envinfo = await this.tryRequireThenImport("envinfo", false); - let info = await envinfo.run(defaultInformation, envinfoConfig); - info = info.replace(/npmPackages/g, "Packages"); - info = info.replace(/npmGlobalPackages/g, "Global Packages"); - return info; - } - async makeCommand(commandOptions, options, action) { - const alreadyLoaded = this.program.commands.find((command) => command.name() === commandOptions.name.split(" ")[0] || - command.aliases().includes(commandOptions.alias)); - if (alreadyLoaded) { - return; - } - const command = this.program.command(commandOptions.name, { - hidden: commandOptions.hidden, - isDefault: commandOptions.isDefault, - }); - if (commandOptions.description) { - command.description(commandOptions.description, commandOptions.argsDescription); - } - if (commandOptions.usage) { - command.usage(commandOptions.usage); - } - if (Array.isArray(commandOptions.alias)) { - command.aliases(commandOptions.alias); - } - else { - command.alias(commandOptions.alias); - } - if (commandOptions.pkg) { - command.pkg = commandOptions.pkg; - } - else { - command.pkg = "webpack-cli"; - } - const { forHelp } = this.program; - let allDependenciesInstalled = true; - if (commandOptions.dependencies && commandOptions.dependencies.length > 0) { - for (const dependency of commandOptions.dependencies) { - const isPkgExist = this.checkPackageExists(dependency); - if (isPkgExist) { - continue; - } - else if (!isPkgExist && forHelp) { - allDependenciesInstalled = false; - continue; - } - let skipInstallation = false; - // Allow to use `./path/to/webpack.js` outside `node_modules` - if (dependency === WEBPACK_PACKAGE && WEBPACK_PACKAGE_IS_CUSTOM) { - skipInstallation = true; - } - // Allow to use `./path/to/webpack-dev-server.js` outside `node_modules` - if (dependency === WEBPACK_DEV_SERVER_PACKAGE && WEBPACK_DEV_SERVER_PACKAGE_IS_CUSTOM) { - skipInstallation = true; - } - if (skipInstallation) { - continue; - } - await this.doInstall(dependency, { - preMessage: () => { - this.logger.error(`For using '${this.colors.green(commandOptions.name.split(" ")[0])}' command you need to install: '${this.colors.green(dependency)}' package.`); - }, - }); - } - } - if (options) { - if (typeof options === "function") { - if (forHelp && !allDependenciesInstalled && commandOptions.dependencies) { - command.description(`${commandOptions.description} To see all available options you need to install ${commandOptions.dependencies - .map((dependency) => `'${dependency}'`) - .join(", ")}.`); - options = []; - } - else { - options = await options(); - } - } - for (const option of options) { - this.makeOption(command, option); - } - } - command.action(action); - return command; - } - makeOption(command, option) { - let mainOption; - let negativeOption; - const flagsWithAlias = ["devtool", "output-path", "target", "watch"]; - if (flagsWithAlias.includes(option.name)) { - option.alias = option.name[0]; - } - if (option.configs) { - let needNegativeOption = false; - let negatedDescription; - const mainOptionType = new Set(); - for (const config of option.configs) { - switch (config.type) { - case "reset": - mainOptionType.add(Boolean); - break; - case "boolean": - if (!needNegativeOption) { - needNegativeOption = true; - negatedDescription = config.negatedDescription; - } - mainOptionType.add(Boolean); - break; - case "number": - mainOptionType.add(Number); - break; - case "string": - case "path": - case "RegExp": - mainOptionType.add(String); - break; - case "enum": { - let hasFalseEnum = false; - for (const value of config.values || []) { - switch (typeof value) { - case "string": - mainOptionType.add(String); - break; - case "number": - mainOptionType.add(Number); - break; - case "boolean": - if (!hasFalseEnum && value === false) { - hasFalseEnum = true; - break; - } - mainOptionType.add(Boolean); - break; - } - } - if (!needNegativeOption) { - needNegativeOption = hasFalseEnum; - negatedDescription = config.negatedDescription; - } - } - } - } - mainOption = { - flags: option.alias ? `-${option.alias}, --${option.name}` : `--${option.name}`, - valueName: option.valueName || "value", - description: option.description || "", - type: mainOptionType, - multiple: option.multiple, - defaultValue: option.defaultValue, - }; - if (needNegativeOption) { - negativeOption = { - flags: `--no-${option.name}`, - description: negatedDescription || option.negatedDescription || `Negative '${option.name}' option.`, - }; - } - } - else { - mainOption = { - flags: option.alias ? `-${option.alias}, --${option.name}` : `--${option.name}`, - valueName: option.valueName || "value", - description: option.description || "", - type: option.type - ? new Set(Array.isArray(option.type) ? option.type : [option.type]) - : new Set([Boolean]), - multiple: option.multiple, - defaultValue: option.defaultValue, - }; - if (option.negative) { - negativeOption = { - flags: `--no-${option.name}`, - description: option.negatedDescription - ? option.negatedDescription - : `Negative '${option.name}' option.`, - }; - } - } - if (mainOption.type.size > 1 && mainOption.type.has(Boolean)) { - mainOption.flags = `${mainOption.flags} [${mainOption.valueName || "value"}${mainOption.multiple ? "..." : ""}]`; - } - else if (mainOption.type.size > 0 && !mainOption.type.has(Boolean)) { - mainOption.flags = `${mainOption.flags} <${mainOption.valueName || "value"}${mainOption.multiple ? "..." : ""}>`; - } - if (mainOption.type.size === 1) { - if (mainOption.type.has(Number)) { - let skipDefault = true; - const optionForCommand = new Option(mainOption.flags, mainOption.description) - .argParser((value, prev = []) => { - if (mainOption.defaultValue && mainOption.multiple && skipDefault) { - prev = []; - skipDefault = false; - } - return mainOption.multiple - ? [].concat(prev).concat(Number(value)) - : Number(value); - }) - .default(mainOption.defaultValue); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - else if (mainOption.type.has(String)) { - let skipDefault = true; - const optionForCommand = new Option(mainOption.flags, mainOption.description) - .argParser((value, prev = []) => { - if (mainOption.defaultValue && mainOption.multiple && skipDefault) { - prev = []; - skipDefault = false; - } - return mainOption.multiple ? [].concat(prev).concat(value) : value; - }) - .default(mainOption.defaultValue); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - else if (mainOption.type.has(Boolean)) { - const optionForCommand = new Option(mainOption.flags, mainOption.description).default(mainOption.defaultValue); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - else { - const optionForCommand = new Option(mainOption.flags, mainOption.description) - .argParser(Array.from(mainOption.type)[0]) - .default(mainOption.defaultValue); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - } - else if (mainOption.type.size > 1) { - let skipDefault = true; - const optionForCommand = new Option(mainOption.flags, mainOption.description, mainOption.defaultValue) - .argParser((value, prev = []) => { - if (mainOption.defaultValue && mainOption.multiple && skipDefault) { - prev = []; - skipDefault = false; - } - if (mainOption.type.has(Number)) { - const numberValue = Number(value); - if (!isNaN(numberValue)) { - return mainOption.multiple - ? [].concat(prev).concat(numberValue) - : numberValue; - } - } - if (mainOption.type.has(String)) { - return mainOption.multiple ? [].concat(prev).concat(value) : value; - } - return value; - }) - .default(mainOption.defaultValue); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - else if (mainOption.type.size === 0 && negativeOption) { - const optionForCommand = new Option(mainOption.flags, mainOption.description); - // Hide stub option - optionForCommand.hideHelp(); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - if (negativeOption) { - const optionForCommand = new Option(negativeOption.flags, negativeOption.description); - optionForCommand.helpLevel = option.helpLevel; - command.addOption(optionForCommand); - } - } - getBuiltInOptions() { - if (this.builtInOptionsCache) { - return this.builtInOptionsCache; - } - const builtInFlags = [ - // For configs - { - name: "config", - alias: "c", - configs: [ - { - type: "string", - }, - ], - multiple: true, - valueName: "pathToConfigFile", - description: 'Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js".', - helpLevel: "minimum", - }, - { - name: "config-name", - configs: [ - { - type: "string", - }, - ], - multiple: true, - valueName: "name", - description: "Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations.", - helpLevel: "minimum", - }, - { - name: "merge", - alias: "m", - configs: [ - { - type: "enum", - values: [true], - }, - ], - description: "Merge two or more configurations using 'webpack-merge'.", - helpLevel: "minimum", - }, - { - name: "disable-interpret", - configs: [ - { - type: "enum", - values: [true], - }, - ], - description: "Disable interpret for loading the config file.", - helpLevel: "minimum", - }, - // Complex configs - { - name: "env", - type: (value, previous = {}) => { - // This ensures we're only splitting by the first `=` - const [allKeys, val] = value.split(/=(.+)/, 2); - const splitKeys = allKeys.split(/\.(?!$)/); - let prevRef = previous; - splitKeys.forEach((someKey, index) => { - // https://github.com/webpack/webpack-cli/issues/3284 - if (someKey.endsWith("=")) { - // remove '=' from key - someKey = someKey.slice(0, -1); - // @ts-expect-error we explicitly want to set it to undefined - prevRef[someKey] = undefined; - return; - } - if (!prevRef[someKey]) { - prevRef[someKey] = {}; - } - if (typeof prevRef[someKey] === "string") { - prevRef[someKey] = {}; - } - if (index === splitKeys.length - 1) { - if (typeof val === "string") { - prevRef[someKey] = val; - } - else { - prevRef[someKey] = true; - } - } - prevRef = prevRef[someKey]; - }); - return previous; - }, - multiple: true, - description: 'Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval".', - helpLevel: "minimum", - }, - { - name: "node-env", - configs: [ - { - type: "string", - }, - ], - multiple: false, - description: "Sets process.env.NODE_ENV to the specified value.", - helpLevel: "minimum", - }, - { - name: "define-process-env-node-env", - configs: [ - { - type: "string", - }, - ], - multiple: false, - description: "Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`).", - helpLevel: "verbose", - }, - // Adding more plugins - { - name: "analyze", - configs: [ - { - type: "enum", - values: [true], - }, - ], - multiple: false, - description: "It invokes webpack-bundle-analyzer plugin to get bundle information.", - helpLevel: "minimum", - }, - { - name: "progress", - configs: [ - { - type: "string", - }, - { - type: "enum", - values: [true], - }, - ], - description: "Print compilation progress during build.", - helpLevel: "minimum", - }, - // Output options - { - name: "json", - configs: [ - { - type: "string", - }, - { - type: "enum", - values: [true], - }, - ], - alias: "j", - valueName: "pathToJsonFile", - description: "Prints result as JSON or store it in a file.", - helpLevel: "minimum", - }, - { - name: "fail-on-warnings", - configs: [ - { - type: "enum", - values: [true], - }, - ], - description: "Stop webpack-cli process with non-zero exit code on warnings from webpack.", - helpLevel: "minimum", - }, - // TODO remove this in the next major release, because not all webpack versions have this flag in CLI options - { - name: "extends", - alias: "e", - configs: [ - { - type: "string", - }, - ], - multiple: true, - description: "Path to the configuration to be extended (only works when using webpack-cli).", - helpLevel: "minimum", - }, - ]; - const minimumHelpFlags = [ - "mode", - "watch", - "watch-options-stdin", - "stats", - "devtool", - "entry", - "target", - "name", - "output-path", - "extends", - ]; - // Extract all the flags being exported from core. - // A list of cli flags generated by core can be found here https://github.com/webpack/webpack/blob/main/test/__snapshots__/Cli.basictest.js.snap - const options = builtInFlags.concat(Object.entries(this.webpack.cli.getArguments()).map(([name, meta]) => { - return Object.assign(Object.assign({}, meta), { name, group: "core", helpLevel: minimumHelpFlags.includes(name) ? "minimum" : "verbose" }); - })); - this.builtInOptionsCache = options; - return options; - } - async loadWebpack(handleError = true) { - return this.tryRequireThenImport(WEBPACK_PACKAGE, handleError); - } - async run(args, parseOptions) { - // Built-in internal commands - const buildCommandOptions = { - name: "build [entries...]", - alias: ["bundle", "b"], - description: "Run webpack (default command, can be omitted).", - usage: "[entries...] [options]", - dependencies: [WEBPACK_PACKAGE], - }; - const watchCommandOptions = { - name: "watch [entries...]", - alias: "w", - description: "Run webpack and watch for files changes.", - usage: "[entries...] [options]", - dependencies: [WEBPACK_PACKAGE], - }; - const versionCommandOptions = { - name: "version", - alias: "v", - usage: "[options]", - description: "Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.", - }; - const helpCommandOptions = { - name: "help [command] [option]", - alias: "h", - description: "Display help for commands and options.", - }; - // Built-in external commands - const externalBuiltInCommandsInfo = [ - { - name: "serve [entries...]", - alias: ["server", "s"], - pkg: "@webpack-cli/serve", - }, - { - name: "info", - alias: "i", - pkg: "@webpack-cli/info", - }, - { - name: "init", - alias: ["create", "new", "c", "n"], - pkg: "@webpack-cli/generators", - }, - { - name: "loader", - alias: "l", - pkg: "@webpack-cli/generators", - }, - { - name: "plugin", - alias: "p", - pkg: "@webpack-cli/generators", - }, - { - name: "configtest [config-path]", - alias: "t", - pkg: "@webpack-cli/configtest", - }, - ]; - const knownCommands = [ - buildCommandOptions, - watchCommandOptions, - versionCommandOptions, - helpCommandOptions, - ...externalBuiltInCommandsInfo, - ]; - const getCommandName = (name) => name.split(" ")[0]; - const isKnownCommand = (name) => knownCommands.find((command) => getCommandName(command.name) === name || - (Array.isArray(command.alias) ? command.alias.includes(name) : command.alias === name)); - const isCommand = (input, commandOptions) => { - const longName = getCommandName(commandOptions.name); - if (input === longName) { - return true; - } - if (commandOptions.alias) { - if (Array.isArray(commandOptions.alias)) { - return commandOptions.alias.includes(input); - } - else { - return commandOptions.alias === input; - } - } - return false; - }; - const findCommandByName = (name) => this.program.commands.find((command) => name === command.name() || command.aliases().includes(name)); - const isOption = (value) => value.startsWith("-"); - const isGlobalOption = (value) => value === "--color" || - value === "--no-color" || - value === "-v" || - value === "--version" || - value === "-h" || - value === "--help"; - const loadCommandByName = async (commandName, allowToInstall = false) => { - const isBuildCommandUsed = isCommand(commandName, buildCommandOptions); - const isWatchCommandUsed = isCommand(commandName, watchCommandOptions); - if (isBuildCommandUsed || isWatchCommandUsed) { - await this.makeCommand(isBuildCommandUsed ? buildCommandOptions : watchCommandOptions, async () => { - this.webpack = await this.loadWebpack(); - return this.getBuiltInOptions(); - }, async (entries, options) => { - if (entries.length > 0) { - options.entry = [...entries, ...(options.entry || [])]; - } - await this.runWebpack(options, isWatchCommandUsed); - }); - } - else if (isCommand(commandName, helpCommandOptions)) { - // Stub for the `help` command - // eslint-disable-next-line @typescript-eslint/no-empty-function - this.makeCommand(helpCommandOptions, [], () => { }); - } - else if (isCommand(commandName, versionCommandOptions)) { - // Stub for the `version` command - this.makeCommand(versionCommandOptions, this.getInfoOptions(), async (options) => { - const info = await cli.getInfoOutput(options); - cli.logger.raw(info); - }); - } - else { - const builtInExternalCommandInfo = externalBuiltInCommandsInfo.find((externalBuiltInCommandInfo) => getCommandName(externalBuiltInCommandInfo.name) === commandName || - (Array.isArray(externalBuiltInCommandInfo.alias) - ? externalBuiltInCommandInfo.alias.includes(commandName) - : externalBuiltInCommandInfo.alias === commandName)); - let pkg; - if (builtInExternalCommandInfo) { - ({ pkg } = builtInExternalCommandInfo); - } - else { - pkg = commandName; - } - if (pkg !== "webpack-cli" && !this.checkPackageExists(pkg)) { - if (!allowToInstall) { - return; - } - pkg = await this.doInstall(pkg, { - preMessage: () => { - this.logger.error(`For using this command you need to install: '${this.colors.green(pkg)}' package.`); - }, - }); - } - let loadedCommand; - try { - loadedCommand = await this.tryRequireThenImport(pkg, false); - } - catch (error) { - // Ignore, command is not installed - return; - } - let command; - try { - command = new loadedCommand(); - await command.apply(this); - } - catch (error) { - this.logger.error(`Unable to load '${pkg}' command`); - this.logger.error(error); - process.exit(2); - } - } - }; - // Register own exit - this.program.exitOverride(async (error) => { - var _a; - if (error.exitCode === 0) { - process.exit(0); - } - if (error.code === "executeSubCommandAsync") { - process.exit(2); - } - if (error.code === "commander.help") { - process.exit(0); - } - if (error.code === "commander.unknownOption") { - let name = error.message.match(/'(.+)'/); - if (name) { - name = name[1].slice(2); - if (name.includes("=")) { - name = name.split("=")[0]; - } - const { operands } = this.program.parseOptions(this.program.args); - const operand = typeof operands[0] !== "undefined" - ? operands[0] - : getCommandName(buildCommandOptions.name); - if (operand) { - const command = findCommandByName(operand); - if (!command) { - this.logger.error(`Can't find and load command '${operand}'`); - this.logger.error("Run 'webpack --help' to see available commands and options"); - process.exit(2); - } - const levenshtein = require("fastest-levenshtein"); - for (const option of command.options) { - if (!option.hidden && levenshtein.distance(name, (_a = option.long) === null || _a === void 0 ? void 0 : _a.slice(2)) < 3) { - this.logger.error(`Did you mean '--${option.name()}'?`); - } - } - } - } - } - // Codes: - // - commander.unknownCommand - // - commander.missingArgument - // - commander.missingMandatoryOptionValue - // - commander.optionMissingArgument - this.logger.error("Run 'webpack --help' to see available commands and options"); - process.exit(2); - }); - // Default `--color` and `--no-color` options - // eslint-disable-next-line @typescript-eslint/no-this-alias - const cli = this; - this.program.option("--color", "Enable colors on console."); - this.program.on("option:color", function () { - // @ts-expect-error shadowing 'this' is intended - const { color } = this.opts(); - cli.isColorSupportChanged = color; - cli.colors = cli.createColors(color); - }); - this.program.option("--no-color", "Disable colors on console."); - this.program.on("option:no-color", function () { - // @ts-expect-error shadowing 'this' is intended - const { color } = this.opts(); - cli.isColorSupportChanged = color; - cli.colors = cli.createColors(color); - }); - this.program.option("-v, --version", "Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands."); - // webpack-cli has it's own logic for showing suggestions - this.program.showSuggestionAfterError(false); - const outputHelp = async (options, isVerbose, isHelpCommandSyntax, program) => { - const { bold } = this.colors; - const outputIncorrectUsageOfHelp = () => { - this.logger.error("Incorrect use of help"); - this.logger.error("Please use: 'webpack help [command] [option]' | 'webpack [command] --help'"); - this.logger.error("Run 'webpack --help' to see available commands and options"); - process.exit(2); - }; - const isGlobalHelp = options.length === 0; - const isCommandHelp = options.length === 1 && !isOption(options[0]); - if (isGlobalHelp || isCommandHelp) { - program.configureHelp({ - sortSubcommands: true, - // Support multiple aliases - commandUsage: (command) => { - let parentCmdNames = ""; - for (let parentCmd = command.parent; parentCmd; parentCmd = parentCmd.parent) { - parentCmdNames = `${parentCmd.name()} ${parentCmdNames}`; - } - if (isGlobalHelp) { - return `${parentCmdNames}${command.usage()}\n${bold("Alternative usage to run commands:")} ${parentCmdNames}[command] [options]`; - } - return `${parentCmdNames}${command.name()}|${command - .aliases() - .join("|")} ${command.usage()}`; - }, - // Support multiple aliases - subcommandTerm: (command) => { - const humanReadableArgumentName = (argument) => { - const nameOutput = argument.name() + (argument.variadic ? "..." : ""); - return argument.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]"; - }; - const args = command._args - .map((arg) => humanReadableArgumentName(arg)) - .join(" "); - return `${command.name()}|${command.aliases().join("|")}${args ? ` ${args}` : ""}${command.options.length > 0 ? " [options]" : ""}`; - }, - visibleOptions: function visibleOptions(command) { - return command.options.filter((option) => { - if (option.hidden) { - return false; - } - // Hide `--watch` option when developer use `webpack watch --help` - if ((options[0] === "w" || options[0] === "watch") && - (option.name() === "watch" || option.name() === "no-watch")) { - return false; - } - switch (option.helpLevel) { - case "verbose": - return isVerbose; - case "minimum": - default: - return true; - } - }); - }, - padWidth(command, helper) { - return Math.max(helper.longestArgumentTermLength(command, helper), helper.longestOptionTermLength(command, helper), - // For global options - helper.longestOptionTermLength(program, helper), helper.longestSubcommandTermLength(isGlobalHelp ? program : command, helper)); - }, - formatHelp: (command, helper) => { - const termWidth = helper.padWidth(command, helper); - const helpWidth = helper.helpWidth || process.env.WEBPACK_CLI_HELP_WIDTH || 80; - const itemIndentWidth = 2; - const itemSeparatorWidth = 2; // between term and description - const formatItem = (term, description) => { - if (description) { - const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`; - return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth); - } - return term; - }; - const formatList = (textArray) => textArray.join("\n").replace(/^/gm, " ".repeat(itemIndentWidth)); - // Usage - let output = [`${bold("Usage:")} ${helper.commandUsage(command)}`, ""]; - // Description - const commandDescription = isGlobalHelp - ? "The build tool for modern web applications." - : helper.commandDescription(command); - if (commandDescription.length > 0) { - output = output.concat([commandDescription, ""]); - } - // Arguments - const argumentList = helper - .visibleArguments(command) - .map((argument) => formatItem(argument.name(), argument.description)); - if (argumentList.length > 0) { - output = output.concat([bold("Arguments:"), formatList(argumentList), ""]); - } - // Options - const optionList = helper - .visibleOptions(command) - .map((option) => formatItem(helper.optionTerm(option), helper.optionDescription(option))); - if (optionList.length > 0) { - output = output.concat([bold("Options:"), formatList(optionList), ""]); - } - // Global options - const globalOptionList = program.options.map((option) => formatItem(helper.optionTerm(option), helper.optionDescription(option))); - if (globalOptionList.length > 0) { - output = output.concat([bold("Global options:"), formatList(globalOptionList), ""]); - } - // Commands - const commandList = helper - .visibleCommands(isGlobalHelp ? program : command) - .map((command) => formatItem(helper.subcommandTerm(command), helper.subcommandDescription(command))); - if (commandList.length > 0) { - output = output.concat([bold("Commands:"), formatList(commandList), ""]); - } - return output.join("\n"); - }, - }); - if (isGlobalHelp) { - await Promise.all(knownCommands.map((knownCommand) => { - return loadCommandByName(getCommandName(knownCommand.name)); - })); - const buildCommand = findCommandByName(getCommandName(buildCommandOptions.name)); - buildCommand && this.logger.raw(buildCommand.helpInformation()); - } - else { - const name = options[0]; - await loadCommandByName(name); - const command = findCommandByName(name); - if (!command) { - const builtInCommandUsed = externalBuiltInCommandsInfo.find((command) => command.name.includes(name) || name === command.alias); - if (typeof builtInCommandUsed !== "undefined") { - this.logger.error(`For using '${name}' command you need to install '${builtInCommandUsed.pkg}' package.`); - } - else { - this.logger.error(`Can't find and load command '${name}'`); - this.logger.error("Run 'webpack --help' to see available commands and options."); - } - process.exit(2); - } - this.logger.raw(command.helpInformation()); - } - } - else if (isHelpCommandSyntax) { - let isCommandSpecified = false; - let commandName = getCommandName(buildCommandOptions.name); - let optionName = ""; - if (options.length === 1) { - optionName = options[0]; - } - else if (options.length === 2) { - isCommandSpecified = true; - commandName = options[0]; - optionName = options[1]; - if (isOption(commandName)) { - outputIncorrectUsageOfHelp(); - } - } - else { - outputIncorrectUsageOfHelp(); - } - await loadCommandByName(commandName); - const command = isGlobalOption(optionName) ? program : findCommandByName(commandName); - if (!command) { - this.logger.error(`Can't find and load command '${commandName}'`); - this.logger.error("Run 'webpack --help' to see available commands and options"); - process.exit(2); - } - const option = command.options.find((option) => option.short === optionName || option.long === optionName); - if (!option) { - this.logger.error(`Unknown option '${optionName}'`); - this.logger.error("Run 'webpack --help' to see available commands and options"); - process.exit(2); - } - const nameOutput = option.flags.replace(/^.+[[<]/, "").replace(/(\.\.\.)?[\]>].*$/, "") + - (option.variadic === true ? "..." : ""); - const value = option.required - ? "<" + nameOutput + ">" - : option.optional - ? "[" + nameOutput + "]" - : ""; - this.logger.raw(`${bold("Usage")}: webpack${isCommandSpecified ? ` ${commandName}` : ""} ${option.long}${value ? ` ${value}` : ""}`); - if (option.short) { - this.logger.raw(`${bold("Short:")} webpack${isCommandSpecified ? ` ${commandName}` : ""} ${option.short}${value ? ` ${value}` : ""}`); - } - if (option.description) { - this.logger.raw(`${bold("Description:")} ${option.description}`); - } - if (!option.negate && option.defaultValue) { - this.logger.raw(`${bold("Default value:")} ${JSON.stringify(option.defaultValue)}`); - } - const flag = this.getBuiltInOptions().find((flag) => option.long === `--${flag.name}`); - if (flag && flag.configs) { - const possibleValues = flag.configs.reduce((accumulator, currentValue) => { - if (currentValue.values) { - return accumulator.concat(currentValue.values); - } - else { - return accumulator; - } - }, []); - if (possibleValues.length > 0) { - this.logger.raw(`${bold("Possible values:")} ${JSON.stringify(possibleValues.join(" | "))}`); - } - } - this.logger.raw(""); - // TODO implement this after refactor cli arguments - // logger.raw('Documentation: https://webpack.js.org/option/name/'); - } - else { - outputIncorrectUsageOfHelp(); - } - this.logger.raw("To see list of all supported commands and options run 'webpack --help=verbose'.\n"); - this.logger.raw(`${bold("Webpack documentation:")} https://webpack.js.org/.`); - this.logger.raw(`${bold("CLI documentation:")} https://webpack.js.org/api/cli/.`); - this.logger.raw(`${bold("Made with ♥ by the webpack team")}.`); - process.exit(0); - }; - this.program.helpOption(false); - this.program.addHelpCommand(false); - this.program.option("-h, --help [verbose]", "Display help for commands and options."); - let isInternalActionCalled = false; - // Default action - this.program.usage("[options]"); - this.program.allowUnknownOption(true); - // Basic command for lazy loading other commands - this.program.action(async (options, program) => { - if (!isInternalActionCalled) { - isInternalActionCalled = true; - } - else { - this.logger.error("No commands found to run"); - process.exit(2); - } - // Command and options - const { operands, unknown } = this.program.parseOptions(program.args); - const defaultCommandToRun = getCommandName(buildCommandOptions.name); - const hasOperand = typeof operands[0] !== "undefined"; - const operand = hasOperand ? operands[0] : defaultCommandToRun; - const isHelpOption = typeof options.help !== "undefined"; - const isHelpCommandSyntax = isCommand(operand, helpCommandOptions); - if (isHelpOption || isHelpCommandSyntax) { - let isVerbose = false; - if (isHelpOption) { - if (typeof options.help === "string") { - if (options.help !== "verbose") { - this.logger.error("Unknown value for '--help' option, please use '--help=verbose'"); - process.exit(2); - } - isVerbose = true; - } - } - this.program.forHelp = true; - const optionsForHelp = [] - .concat(isHelpOption && hasOperand ? [operand] : []) - // Syntax `webpack help [command]` - .concat(operands.slice(1)) - // Syntax `webpack help [option]` - .concat(unknown) - .concat(isHelpCommandSyntax && typeof options.color !== "undefined" - ? [options.color ? "--color" : "--no-color"] - : []) - .concat(isHelpCommandSyntax && typeof options.version !== "undefined" ? ["--version"] : []); - await outputHelp(optionsForHelp, isVerbose, isHelpCommandSyntax, program); - } - const isVersionOption = typeof options.version !== "undefined"; - if (isVersionOption) { - const info = await this.getInfoOutput({ output: "", additionalPackage: [] }); - this.logger.raw(info); - process.exit(0); - } - let commandToRun = operand; - let commandOperands = operands.slice(1); - if (isKnownCommand(commandToRun)) { - await loadCommandByName(commandToRun, true); - } - else { - const isEntrySyntax = fs.existsSync(operand); - if (isEntrySyntax) { - commandToRun = defaultCommandToRun; - commandOperands = operands; - await loadCommandByName(commandToRun); - } - else { - this.logger.error(`Unknown command or entry '${operand}'`); - const levenshtein = require("fastest-levenshtein"); - const found = knownCommands.find((commandOptions) => levenshtein.distance(operand, getCommandName(commandOptions.name)) < 3); - if (found) { - this.logger.error(`Did you mean '${getCommandName(found.name)}' (alias '${Array.isArray(found.alias) ? found.alias.join(", ") : found.alias}')?`); - } - this.logger.error("Run 'webpack --help' to see available commands and options"); - process.exit(2); - } - } - await this.program.parseAsync([commandToRun, ...commandOperands, ...unknown], { - from: "user", - }); - }); - await this.program.parseAsync(args, parseOptions); - } - async loadConfig(options) { - const disableInterpret = typeof options.disableInterpret !== "undefined" && options.disableInterpret; - const interpret = require("interpret"); - const loadConfigByPath = async (configPath, argv = {}) => { - const ext = path.extname(configPath).toLowerCase(); - let interpreted = Object.keys(interpret.jsVariants).find((variant) => variant === ext); - // Fallback `.cts` to `.ts` - // TODO implement good `.mts` support after https://github.com/gulpjs/rechoir/issues/43 - // For ESM and `.mts` you need to use: 'NODE_OPTIONS="--loader ts-node/esm" webpack-cli --config ./webpack.config.mts' - if (!interpreted && /\.cts$/.test(ext)) { - interpreted = interpret.jsVariants[".ts"]; - } - if (interpreted && !disableInterpret) { - const rechoir = require("rechoir"); - try { - rechoir.prepare(interpret.extensions, configPath); - } - catch (error) { - if (error === null || error === void 0 ? void 0 : error.failures) { - this.logger.error(`Unable load '${configPath}'`); - this.logger.error(error.message); - for (const failure of error.failures) { - this.logger.error(failure.error.message); - } - this.logger.error("Please install one of them"); - process.exit(2); - } - this.logger.error(error); - process.exit(2); - } - } - let options; - let moduleType = "unknown"; - switch (ext) { - case ".cjs": - case ".cts": - moduleType = "commonjs"; - break; - case ".mjs": - case ".mts": - moduleType = "esm"; - break; - } - try { - options = await this.tryRequireThenImport(configPath, false, moduleType); - // @ts-expect-error error type assertion - } - catch (error) { - this.logger.error(`Failed to load '${configPath}' config`); - if (this.isValidationError(error)) { - this.logger.error(error.message); - } - else { - this.logger.error(error); - } - process.exit(2); - } - if (!options) { - this.logger.error(`Failed to load '${configPath}' config. Unable to find default export.`); - process.exit(2); - } - if (Array.isArray(options)) { - // reassign the value to assert type - const optionsArray = options; - await Promise.all(optionsArray.map(async (_, i) => { - if (this.isPromise(optionsArray[i])) { - optionsArray[i] = await optionsArray[i]; - } - // `Promise` may return `Function` - if (this.isFunction(optionsArray[i])) { - // when config is a function, pass the env from args to the config function - optionsArray[i] = await optionsArray[i](argv.env, argv); - } - })); - options = optionsArray; - } - else { - if (this.isPromise(options)) { - options = await options; - } - // `Promise` may return `Function` - if (this.isFunction(options)) { - // when config is a function, pass the env from args to the config function - options = await options(argv.env, argv); - } - } - const isObject = (value) => typeof value === "object" && value !== null; - if (!isObject(options) && !Array.isArray(options)) { - this.logger.error(`Invalid configuration in '${configPath}'`); - process.exit(2); - } - return { options, path: configPath }; - }; - const config = { - options: {}, - path: new WeakMap(), - }; - if (options.config && options.config.length > 0) { - const loadedConfigs = await Promise.all(options.config.map((configPath) => loadConfigByPath(path.resolve(configPath), options.argv))); - config.options = []; - loadedConfigs.forEach((loadedConfig) => { - const isArray = Array.isArray(loadedConfig.options); - // TODO we should run webpack multiple times when the `--config` options have multiple values with `--merge`, need to solve for the next major release - if (config.options.length === 0) { - config.options = loadedConfig.options; - } - else { - if (!Array.isArray(config.options)) { - config.options = [config.options]; - } - if (isArray) { - for (const item of loadedConfig.options) { - config.options.push(item); - } - } - else { - config.options.push(loadedConfig.options); - } - } - if (isArray) { - for (const options of loadedConfig.options) { - config.path.set(options, [loadedConfig.path]); - } - } - else { - config.path.set(loadedConfig.options, [loadedConfig.path]); - } - }); - config.options = config.options.length === 1 ? config.options[0] : config.options; - } - else { - // TODO ".mts" is not supported by `interpret`, need to add it - // Prioritize popular extensions first to avoid unnecessary fs calls - const extensions = [ - ".js", - ".mjs", - ".cjs", - ".ts", - ".cts", - ".mts", - ...Object.keys(interpret.extensions), - ]; - // Order defines the priority, in decreasing order - const defaultConfigFiles = new Set(["webpack.config", ".webpack/webpack.config", ".webpack/webpackfile"].flatMap((filename) => extensions.map((ext) => path.resolve(filename + ext)))); - let foundDefaultConfigFile; - for (const defaultConfigFile of defaultConfigFiles) { - if (!fs.existsSync(defaultConfigFile)) { - continue; - } - foundDefaultConfigFile = defaultConfigFile; - break; - } - if (foundDefaultConfigFile) { - const loadedConfig = await loadConfigByPath(foundDefaultConfigFile, options.argv); - config.options = loadedConfig.options; - if (Array.isArray(config.options)) { - for (const item of config.options) { - config.path.set(item, [loadedConfig.path]); - } - } - else { - config.path.set(loadedConfig.options, [loadedConfig.path]); - } - } - } - if (options.configName) { - const notFoundConfigNames = []; - config.options = options.configName.map((configName) => { - let found; - if (Array.isArray(config.options)) { - found = config.options.find((options) => options.name === configName); - } - else { - found = config.options.name === configName ? config.options : undefined; - } - if (!found) { - notFoundConfigNames.push(configName); - } - return found; - }); - if (notFoundConfigNames.length > 0) { - this.logger.error(notFoundConfigNames - .map((configName) => `Configuration with the name "${configName}" was not found.`) - .join(" ")); - process.exit(2); - } - } - const resolveExtends = async (config, configPaths, extendsPaths) => { - delete config.extends; - const loadedConfigs = await Promise.all(extendsPaths.map((extendsPath) => loadConfigByPath(path.resolve(extendsPath), options.argv))); - const merge = await this.tryRequireThenImport("webpack-merge"); - const loadedOptions = loadedConfigs.flatMap((config) => config.options); - if (loadedOptions.length > 0) { - const prevPaths = configPaths.get(config); - const loadedPaths = loadedConfigs.flatMap((config) => config.path); - if (prevPaths) { - const intersection = loadedPaths.filter((element) => prevPaths.includes(element)); - if (intersection.length > 0) { - this.logger.error(`Recursive configuration detected, exiting.`); - process.exit(2); - } - } - config = merge(...loadedOptions, config); - if (prevPaths) { - configPaths.set(config, [...prevPaths, ...loadedPaths]); - } - } - if (config.extends) { - const extendsPaths = typeof config.extends === "string" ? [config.extends] : config.extends; - config = await resolveExtends(config, configPaths, extendsPaths); - } - return config; - }; - // The `extends` param in CLI gets priority over extends in config file - if (options.extends && options.extends.length > 0) { - const extendsPaths = options.extends; - if (Array.isArray(config.options)) { - config.options = await Promise.all(config.options.map((options) => resolveExtends(options, config.path, extendsPaths))); - } - else { - // load the config from the extends option - config.options = await resolveExtends(config.options, config.path, extendsPaths); - } - } - // if no extends option is passed, check if the config file has extends - else if (Array.isArray(config.options) && config.options.some((options) => options.extends)) { - config.options = await Promise.all(config.options.map((options) => { - if (options.extends) { - return resolveExtends(options, config.path, typeof options.extends === "string" ? [options.extends] : options.extends); - } - else { - return options; - } - })); - } - else if (!Array.isArray(config.options) && config.options.extends) { - config.options = await resolveExtends(config.options, config.path, typeof config.options.extends === "string" - ? [config.options.extends] - : config.options.extends); - } - if (options.merge) { - const merge = await this.tryRequireThenImport("webpack-merge"); - // we can only merge when there are multiple configurations - // either by passing multiple configs by flags or passing a - // single config exporting an array - if (!Array.isArray(config.options) || config.options.length <= 1) { - this.logger.error("At least two configurations are required for merge."); - process.exit(2); - } - const mergedConfigPaths = []; - config.options = config.options.reduce((accumulator, options) => { - const configPath = config.path.get(options); - const mergedOptions = merge(accumulator, options); - if (configPath) { - mergedConfigPaths.push(...configPath); - } - return mergedOptions; - }, {}); - config.path.set(config.options, mergedConfigPaths); - } - return config; - } - async buildConfig(config, options) { - if (options.analyze) { - if (!this.checkPackageExists("webpack-bundle-analyzer")) { - await this.doInstall("webpack-bundle-analyzer", { - preMessage: () => { - this.logger.error(`It looks like ${this.colors.yellow("webpack-bundle-analyzer")} is not installed.`); - }, - }); - this.logger.success(`${this.colors.yellow("webpack-bundle-analyzer")} was installed successfully.`); - } - } - if (typeof options.progress === "string" && options.progress !== "profile") { - this.logger.error(`'${options.progress}' is an invalid value for the --progress option. Only 'profile' is allowed.`); - process.exit(2); - } - const CLIPlugin = await this.tryRequireThenImport("./plugins/cli-plugin"); - const internalBuildConfig = (item) => { - const originalWatchValue = item.watch; - // Apply options - const args = this.getBuiltInOptions().reduce((accumulator, flag) => { - if (flag.group === "core") { - accumulator[flag.name] = flag; - } - return accumulator; - }, {}); - const values = Object.keys(options).reduce((accumulator, name) => { - if (name === "argv") { - return accumulator; - } - const kebabName = this.toKebabCase(name); - if (args[kebabName]) { - accumulator[kebabName] = options[name]; - } - return accumulator; - }, {}); - if (Object.keys(values).length > 0) { - const problems = this.webpack.cli.processArguments(args, item, values); - if (problems) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const groupBy = (xs, key) => { - return xs.reduce((rv, x) => { - (rv[x[key]] = rv[x[key]] || []).push(x); - return rv; - }, {}); - }; - const problemsByPath = groupBy(problems, "path"); - for (const path in problemsByPath) { - const problems = problemsByPath[path]; - for (const problem of problems) { - this.logger.error(`${this.capitalizeFirstLetter(problem.type.replace(/-/g, " "))}${problem.value ? ` '${problem.value}'` : ""} for the '--${problem.argument}' option${problem.index ? ` by index '${problem.index}'` : ""}`); - if (problem.expected) { - this.logger.error(`Expected: '${problem.expected}'`); - } - } - } - process.exit(2); - } - } - // Output warnings - if (options.isWatchingLikeCommand && - options.argv && - options.argv.env && - (typeof originalWatchValue !== "undefined" || typeof options.argv.watch !== "undefined")) { - this.logger.warn(`No need to use the '${options.argv.env["WEBPACK_WATCH"] ? "watch" : "serve"}' command together with '{ watch: true | false }' or '--watch'/'--no-watch' configuration, it does not make sense.`); - if (options.argv.env["WEBPACK_SERVE"]) { - item.watch = false; - } - } - const isFileSystemCacheOptions = (config) => { - return (Boolean(config.cache) && config.cache.type === "filesystem"); - }; - // Setup default cache options - if (isFileSystemCacheOptions(item)) { - const configPath = config.path.get(item); - if (configPath) { - if (!item.cache.buildDependencies) { - item.cache.buildDependencies = {}; - } - if (!item.cache.buildDependencies.defaultConfig) { - item.cache.buildDependencies.defaultConfig = []; - } - if (Array.isArray(configPath)) { - for (const oneOfConfigPath of configPath) { - item.cache.buildDependencies.defaultConfig.push(oneOfConfigPath); - } - } - else { - item.cache.buildDependencies.defaultConfig.push(configPath); - } - } - } - // Respect `process.env.NODE_ENV` - if (!item.mode && - process.env && - process.env.NODE_ENV && - (process.env.NODE_ENV === "development" || - process.env.NODE_ENV === "production" || - process.env.NODE_ENV === "none")) { - item.mode = process.env.NODE_ENV; - } - // Setup stats - if (typeof item.stats === "undefined") { - item.stats = { preset: "normal" }; - } - else if (typeof item.stats === "boolean") { - item.stats = item.stats ? { preset: "normal" } : { preset: "none" }; - } - else if (typeof item.stats === "string") { - item.stats = { preset: item.stats }; - } - let colors; - // From arguments - if (typeof this.isColorSupportChanged !== "undefined") { - colors = Boolean(this.isColorSupportChanged); - } - // From stats - else if (typeof item.stats.colors !== "undefined") { - colors = item.stats.colors; - } - // Default - else { - colors = Boolean(this.colors.isColorSupported); - } - item.stats.colors = colors; - // Apply CLI plugin - if (!item.plugins) { - item.plugins = []; - } - item.plugins.unshift(new CLIPlugin({ - configPath: config.path.get(item), - helpfulOutput: !options.json, - progress: options.progress, - analyze: options.analyze, - isMultiCompiler: Array.isArray(config.options), - })); - }; - if (Array.isArray(config.options)) { - for (const item of config.options) { - internalBuildConfig(item); - } - } - else { - internalBuildConfig(config.options); - } - return config; - } - isValidationError(error) { - return error instanceof this.webpack.ValidationError || error.name === "ValidationError"; - } - async createCompiler(options, callback) { - if (typeof options.defineProcessEnvNodeEnv === "string") { - // TODO: This should only set NODE_ENV for the runtime not for the config too. Change this during next breaking change. - process.env.NODE_ENV = options.defineProcessEnvNodeEnv; - } - else if (typeof options.nodeEnv === "string") { - process.env.NODE_ENV = options.nodeEnv; - } - let config = await this.loadConfig(options); - config = await this.buildConfig(config, options); - let compiler; - try { - compiler = this.webpack(config.options, callback - ? (error, stats) => { - if (error && this.isValidationError(error)) { - this.logger.error(error.message); - process.exit(2); - } - callback(error, stats); - } - : callback); - // @ts-expect-error error type assertion - } - catch (error) { - if (this.isValidationError(error)) { - this.logger.error(error.message); - } - else { - this.logger.error(error); - } - process.exit(2); - } - return compiler; - } - needWatchStdin(compiler) { - if (this.isMultipleCompiler(compiler)) { - return Boolean(compiler.compilers.some((compiler) => compiler.options.watchOptions && compiler.options.watchOptions.stdin)); - } - return Boolean(compiler.options.watchOptions && compiler.options.watchOptions.stdin); - } - async runWebpack(options, isWatchCommand) { - // eslint-disable-next-line prefer-const - let compiler; - let createJsonStringifyStream; - if (options.json) { - const jsonExt = await this.tryRequireThenImport("@discoveryjs/json-ext"); - createJsonStringifyStream = jsonExt.stringifyStream; - } - const callback = (error, stats) => { - if (error) { - this.logger.error(error); - process.exit(2); - } - if (stats && (stats.hasErrors() || (options.failOnWarnings && stats.hasWarnings()))) { - process.exitCode = 1; - } - if (!compiler || !stats) { - return; - } - const statsOptions = this.isMultipleCompiler(compiler) - ? { - children: compiler.compilers.map((compiler) => compiler.options ? compiler.options.stats : undefined), - } - : compiler.options - ? compiler.options.stats - : undefined; - if (options.json && createJsonStringifyStream) { - const handleWriteError = (error) => { - this.logger.error(error); - process.exit(2); - }; - if (options.json === true) { - createJsonStringifyStream(stats.toJson(statsOptions)) - .on("error", handleWriteError) - .pipe(process.stdout) - .on("error", handleWriteError) - .on("close", () => process.stdout.write("\n")); - } - else { - createJsonStringifyStream(stats.toJson(statsOptions)) - .on("error", handleWriteError) - .pipe(fs.createWriteStream(options.json)) - .on("error", handleWriteError) - // Use stderr to logging - .on("close", () => { - process.stderr.write(`[webpack-cli] ${this.colors.green(`stats are successfully stored as json to ${options.json}`)}\n`); - }); - } - } - else { - const printedStats = stats.toString(statsOptions); - // Avoid extra empty line when `stats: 'none'` - if (printedStats) { - this.logger.raw(printedStats); - } - } - }; - const env = isWatchCommand || options.watch - ? Object.assign({ WEBPACK_WATCH: true }, options.env) : Object.assign({ WEBPACK_BUNDLE: true, WEBPACK_BUILD: true }, options.env); - options.argv = Object.assign(Object.assign({}, options), { env }); - if (isWatchCommand) { - options.watch = true; - options.isWatchingLikeCommand = true; - } - compiler = await this.createCompiler(options, callback); - if (!compiler) { - return; - } - const isWatch = (compiler) => Boolean(this.isMultipleCompiler(compiler) - ? compiler.compilers.some((compiler) => compiler.options.watch) - : compiler.options.watch); - if (isWatch(compiler) && this.needWatchStdin(compiler)) { - process.stdin.on("end", () => { - process.exit(0); - }); - process.stdin.resume(); - } - } -} -module.exports = WebpackCLI; diff --git a/node_modules/webpack-cli/node_modules/commander/LICENSE b/node_modules/webpack-cli/node_modules/commander/LICENSE deleted file mode 100644 index 10f997a..0000000 --- a/node_modules/webpack-cli/node_modules/commander/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/webpack-cli/node_modules/commander/Readme.md b/node_modules/webpack-cli/node_modules/commander/Readme.md deleted file mode 100644 index 095e2ae..0000000 --- a/node_modules/webpack-cli/node_modules/commander/Readme.md +++ /dev/null @@ -1,1134 +0,0 @@ -# Commander.js - -[![Build Status](https://github.com/tj/commander.js/workflows/build/badge.svg)](https://github.com/tj/commander.js/actions?query=workflow%3A%22build%22) -[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) -[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) -[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) - -The complete solution for [node.js](http://nodejs.org) command-line interfaces. - -Read this in other languages: English | [简体中文](./Readme_zh-CN.md) - -- [Commander.js](#commanderjs) - - [Installation](#installation) - - [Quick Start](#quick-start) - - [Declaring _program_ variable](#declaring-program-variable) - - [Options](#options) - - [Common option types, boolean and value](#common-option-types-boolean-and-value) - - [Default option value](#default-option-value) - - [Other option types, negatable boolean and boolean|value](#other-option-types-negatable-boolean-and-booleanvalue) - - [Required option](#required-option) - - [Variadic option](#variadic-option) - - [Version option](#version-option) - - [More configuration](#more-configuration) - - [Custom option processing](#custom-option-processing) - - [Commands](#commands) - - [Command-arguments](#command-arguments) - - [More configuration](#more-configuration-1) - - [Custom argument processing](#custom-argument-processing) - - [Action handler](#action-handler) - - [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands) - - [Life cycle hooks](#life-cycle-hooks) - - [Automated help](#automated-help) - - [Custom help](#custom-help) - - [Display help after errors](#display-help-after-errors) - - [Display help from code](#display-help-from-code) - - [.name](#name) - - [.usage](#usage) - - [.description and .summary](#description-and-summary) - - [.helpOption(flags, description)](#helpoptionflags-description) - - [.addHelpCommand()](#addhelpcommand) - - [More configuration](#more-configuration-2) - - [Custom event listeners](#custom-event-listeners) - - [Bits and pieces](#bits-and-pieces) - - [.parse() and .parseAsync()](#parse-and-parseasync) - - [Parsing Configuration](#parsing-configuration) - - [Legacy options as properties](#legacy-options-as-properties) - - [TypeScript](#typescript) - - [createCommand()](#createcommand) - - [Node options such as `--harmony`](#node-options-such-as---harmony) - - [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands) - - [Display error](#display-error) - - [Override exit and output handling](#override-exit-and-output-handling) - - [Additional documentation](#additional-documentation) - - [Support](#support) - - [Commander for enterprise](#commander-for-enterprise) - -For information about terms used in this document see: [terminology](./docs/terminology.md) - -## Installation - -```sh -npm install commander -``` - -## Quick Start - -You write code to describe your command line interface. -Commander looks after parsing the arguments into options and command-arguments, -displays usage errors for problems, and implements a help system. - -Commander is strict and displays an error for unrecognised options. -The two most used option types are a boolean option, and an option which takes its value from the following argument. - -Example file: [split.js](./examples/split.js) - -```js -const { program } = require('commander'); - -program - .option('--first') - .option('-s, --separator '); - -program.parse(); - -const options = program.opts(); -const limit = options.first ? 1 : undefined; -console.log(program.args[0].split(options.separator, limit)); -``` - -```console -$ node split.js -s / --fits a/b/c -error: unknown option '--fits' -(Did you mean --first?) -$ node split.js -s / --first a/b/c -[ 'a' ] -``` - -Here is a more complete program using a subcommand and with descriptions for the help. In a multi-command program, you have an action handler for each command (or stand-alone executables for the commands). - -Example file: [string-util.js](./examples/string-util.js) - -```js -const { Command } = require('commander'); -const program = new Command(); - -program - .name('string-util') - .description('CLI to some JavaScript string utilities') - .version('0.8.0'); - -program.command('split') - .description('Split a string into substrings and display as an array') - .argument('', 'string to split') - .option('--first', 'display just the first substring') - .option('-s, --separator ', 'separator character', ',') - .action((str, options) => { - const limit = options.first ? 1 : undefined; - console.log(str.split(options.separator, limit)); - }); - -program.parse(); -``` - -```console -$ node string-util.js help split -Usage: string-util split [options] - -Split a string into substrings and display as an array. - -Arguments: - string string to split - -Options: - --first display just the first substring - -s, --separator separator character (default: ",") - -h, --help display help for command - -$ node string-util.js split --separator=/ a/b/c -[ 'a', 'b', 'c' ] -``` - -More samples can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. - -## Declaring _program_ variable - -Commander exports a global object which is convenient for quick programs. -This is used in the examples in this README for brevity. - -```js -// CommonJS (.cjs) -const { program } = require('commander'); -``` - -For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use. - -```js -// CommonJS (.cjs) -const { Command } = require('commander'); -const program = new Command(); -``` - -```js -// ECMAScript (.mjs) -import { Command } from 'commander'; -const program = new Command(); -``` - -```ts -// TypeScript (.ts) -import { Command } from 'commander'; -const program = new Command(); -``` - -## Options - -Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|'). - -The parsed options can be accessed by calling `.opts()` on a `Command` object, and are passed to the action handler. - -Multi-word options such as "--template-engine" are camel-cased, becoming `program.opts().templateEngine` etc. - -An option and its option-argument can be separated by a space, or combined into the same argument. The option-argument can follow the short option directly or follow an `=` for a long option. - -```sh -serve -p 80 -serve -p80 -serve --port 80 -serve --port=80 -``` - -You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted. - -By default options on the command line are not positional, and can be specified before or after other arguments. - -There are additional related routines for when `.opts()` is not enough: - -- `.optsWithGlobals()` returns merged local and global option values -- `.getOptionValue()` and `.setOptionValue()` work with a single option value -- `.getOptionValueSource()` and `.setOptionValueWithSource()` include where the option value came from - -### Common option types, boolean and value - -The two most used option types are a boolean option, and an option which takes its value -from the following argument (declared with angle brackets like `--expect `). Both are `undefined` unless specified on command line. - -Example file: [options-common.js](./examples/options-common.js) - -```js -program - .option('-d, --debug', 'output extra debugging') - .option('-s, --small', 'small pizza size') - .option('-p, --pizza-type ', 'flavour of pizza'); - -program.parse(process.argv); - -const options = program.opts(); -if (options.debug) console.log(options); -console.log('pizza details:'); -if (options.small) console.log('- small pizza size'); -if (options.pizzaType) console.log(`- ${options.pizzaType}`); -``` - -```console -$ pizza-options -p -error: option '-p, --pizza-type ' argument missing -$ pizza-options -d -s -p vegetarian -{ debug: true, small: true, pizzaType: 'vegetarian' } -pizza details: -- small pizza size -- vegetarian -$ pizza-options --pizza-type=cheese -pizza details: -- cheese -``` - -Multiple boolean short options may be combined together following the dash, and may be followed by a single short option taking a value. -For example `-d -s -p cheese` may be written as `-ds -p cheese` or even `-dsp cheese`. - -Options with an expected option-argument are greedy and will consume the following argument whatever the value. -So `--id -xyz` reads `-xyz` as the option-argument. - -`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array. The parameter is optional and defaults to `process.argv`. - -### Default option value - -You can specify a default value for an option. - -Example file: [options-defaults.js](./examples/options-defaults.js) - -```js -program - .option('-c, --cheese ', 'add the specified type of cheese', 'blue'); - -program.parse(); - -console.log(`cheese: ${program.opts().cheese}`); -``` - -```console -$ pizza-options -cheese: blue -$ pizza-options --cheese stilton -cheese: stilton -``` - -### Other option types, negatable boolean and boolean|value - -You can define a boolean option long name with a leading `no-` to set the option value to false when used. -Defined alone this also makes the option true by default. - -If you define `--foo` first, adding `--no-foo` does not change the default value from what it would -otherwise be. - -Example file: [options-negatable.js](./examples/options-negatable.js) - -```js -program - .option('--no-sauce', 'Remove sauce') - .option('--cheese ', 'cheese flavour', 'mozzarella') - .option('--no-cheese', 'plain with no cheese') - .parse(); - -const options = program.opts(); -const sauceStr = options.sauce ? 'sauce' : 'no sauce'; -const cheeseStr = (options.cheese === false) ? 'no cheese' : `${options.cheese} cheese`; -console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`); -``` - -```console -$ pizza-options -You ordered a pizza with sauce and mozzarella cheese -$ pizza-options --sauce -error: unknown option '--sauce' -$ pizza-options --cheese=blue -You ordered a pizza with sauce and blue cheese -$ pizza-options --no-sauce --no-cheese -You ordered a pizza with no sauce and no cheese -``` - -You can specify an option which may be used as a boolean option but may optionally take an option-argument -(declared with square brackets like `--optional [value]`). - -Example file: [options-boolean-or-value.js](./examples/options-boolean-or-value.js) - -```js -program - .option('-c, --cheese [type]', 'Add cheese with optional type'); - -program.parse(process.argv); - -const options = program.opts(); -if (options.cheese === undefined) console.log('no cheese'); -else if (options.cheese === true) console.log('add cheese'); -else console.log(`add cheese type ${options.cheese}`); -``` - -```console -$ pizza-options -no cheese -$ pizza-options --cheese -add cheese -$ pizza-options --cheese mozzarella -add cheese type mozzarella -``` - -Options with an optional option-argument are not greedy and will ignore arguments starting with a dash. -So `id` behaves as a boolean option for `--id -5`, but you can use a combined form if needed like `--id=-5`. - -For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md). - -### Required option - -You may specify a required (mandatory) option using `.requiredOption()`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option()` in format, taking flags and description, and optional default value or custom processing. - -Example file: [options-required.js](./examples/options-required.js) - -```js -program - .requiredOption('-c, --cheese ', 'pizza must have cheese'); - -program.parse(); -``` - -```console -$ pizza -error: required option '-c, --cheese ' not specified -``` - -### Variadic option - -You may make an option variadic by appending `...` to the value placeholder when declaring the option. On the command line you -can then specify multiple option-arguments, and the parsed option value will be an array. The extra arguments -are read until the first argument starting with a dash. The special argument `--` stops option processing entirely. If a value -is specified in the same argument as the option then no further values are read. - -Example file: [options-variadic.js](./examples/options-variadic.js) - -```js -program - .option('-n, --number ', 'specify numbers') - .option('-l, --letter [letters...]', 'specify letters'); - -program.parse(); - -console.log('Options: ', program.opts()); -console.log('Remaining arguments: ', program.args); -``` - -```console -$ collect -n 1 2 3 --letter a b c -Options: { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] } -Remaining arguments: [] -$ collect --letter=A -n80 operand -Options: { number: [ '80' ], letter: [ 'A' ] } -Remaining arguments: [ 'operand' ] -$ collect --letter -n 1 -n 2 3 -- operand -Options: { number: [ '1', '2', '3' ], letter: true } -Remaining arguments: [ 'operand' ] -``` - -For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md). - -### Version option - -The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits. - -```js -program.version('0.0.1'); -``` - -```console -$ ./examples/pizza -V -0.0.1 -``` - -You may change the flags and description by passing additional parameters to the `version` method, using -the same syntax for flags as the `option` method. - -```js -program.version('0.0.1', '-v, --vers', 'output the current version'); -``` - -### More configuration - -You can add most options using the `.option()` method, but there are some additional features available -by constructing an `Option` explicitly for less common cases. - -Example files: [options-extra.js](./examples/options-extra.js), [options-env.js](./examples/options-env.js), [options-conflicts.js](./examples/options-conflicts.js), [options-implies.js](./examples/options-implies.js) - -```js -program - .addOption(new Option('-s, --secret').hideHelp()) - .addOption(new Option('-t, --timeout ', 'timeout in seconds').default(60, 'one minute')) - .addOption(new Option('-d, --drink ', 'drink size').choices(['small', 'medium', 'large'])) - .addOption(new Option('-p, --port ', 'port number').env('PORT')) - .addOption(new Option('--donate [amount]', 'optional donation in dollars').preset('20').argParser(parseFloat)) - .addOption(new Option('--disable-server', 'disables the server').conflicts('port')) - .addOption(new Option('--free-drink', 'small drink included free ').implies({ drink: 'small' })); -``` - -```console -$ extra --help -Usage: help [options] - -Options: - -t, --timeout timeout in seconds (default: one minute) - -d, --drink drink cup size (choices: "small", "medium", "large") - -p, --port port number (env: PORT) - --donate [amount] optional donation in dollars (preset: "20") - --disable-server disables the server - --free-drink small drink included free - -h, --help display help for command - -$ extra --drink huge -error: option '-d, --drink ' argument 'huge' is invalid. Allowed choices are small, medium, large. - -$ PORT=80 extra --donate --free-drink -Options: { timeout: 60, donate: 20, port: '80', freeDrink: true, drink: 'small' } - -$ extra --disable-server --port 8000 -error: option '--disable-server' cannot be used with option '-p, --port ' -``` - -Specify a required (mandatory) option using the `Option` method `.makeOptionMandatory()`. This matches the `Command` method [.requiredOption()](#required-option). - -### Custom option processing - -You may specify a function to do custom processing of option-arguments. The callback function receives two parameters, -the user specified option-argument and the previous value for the option. It returns the new value for the option. - -This allows you to coerce the option-argument to the desired type, or accumulate values, or do entirely custom processing. - -You can optionally specify the default/starting value for the option after the function parameter. - -Example file: [options-custom-processing.js](./examples/options-custom-processing.js) - -```js -function myParseInt(value, dummyPrevious) { - // parseInt takes a string and a radix - const parsedValue = parseInt(value, 10); - if (isNaN(parsedValue)) { - throw new commander.InvalidArgumentError('Not a number.'); - } - return parsedValue; -} - -function increaseVerbosity(dummyValue, previous) { - return previous + 1; -} - -function collect(value, previous) { - return previous.concat([value]); -} - -function commaSeparatedList(value, dummyPrevious) { - return value.split(','); -} - -program - .option('-f, --float ', 'float argument', parseFloat) - .option('-i, --integer ', 'integer argument', myParseInt) - .option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0) - .option('-c, --collect ', 'repeatable value', collect, []) - .option('-l, --list ', 'comma separated list', commaSeparatedList) -; - -program.parse(); - -const options = program.opts(); -if (options.float !== undefined) console.log(`float: ${options.float}`); -if (options.integer !== undefined) console.log(`integer: ${options.integer}`); -if (options.verbose > 0) console.log(`verbosity: ${options.verbose}`); -if (options.collect.length > 0) console.log(options.collect); -if (options.list !== undefined) console.log(options.list); -``` - -```console -$ custom -f 1e2 -float: 100 -$ custom --integer 2 -integer: 2 -$ custom -v -v -v -verbose: 3 -$ custom -c a -c b -c c -[ 'a', 'b', 'c' ] -$ custom --list x,y,z -[ 'x', 'y', 'z' ] -``` - -## Commands - -You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)). - -In the first parameter to `.command()` you specify the command name. You may append the command-arguments after the command name, or specify them separately using `.argument()`. The arguments may be `` or `[optional]`, and the last argument may also be `variadic...`. - -You can use `.addCommand()` to add an already configured subcommand to the program. - -For example: - -```js -// Command implemented using action handler (description is supplied separately to `.command`) -// Returns new command for configuring. -program - .command('clone [destination]') - .description('clone a repository into a newly created directory') - .action((source, destination) => { - console.log('clone command called'); - }); - -// Command implemented using stand-alone executable file, indicated by adding description as second parameter to `.command`. -// Returns `this` for adding more commands. -program - .command('start ', 'start named service') - .command('stop [service]', 'stop named service, or all if no name supplied'); - -// Command prepared separately. -// Returns `this` for adding more commands. -program - .addCommand(build.makeBuildCommand()); -``` - -Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will -remove the command from the generated help output. Specifying `isDefault: true` will run the subcommand if no other -subcommand is specified ([example](./examples/defaultCommand.js)). - -You can add alternative names for a command with `.alias()`. ([example](./examples/alias.js)) - -For safety, `.addCommand()` does not automatically copy the inherited settings from the parent command. There is a helper routine `.copyInheritedSettings()` for copying the settings when they are wanted. - -### Command-arguments - -For subcommands, you can specify the argument syntax in the call to `.command()` (as shown above). This -is the only method usable for subcommands implemented using a stand-alone executable, but for other subcommands -you can instead use the following method. - -To configure a command, you can use `.argument()` to specify each expected command-argument. -You supply the argument name and an optional description. The argument may be `` or `[optional]`. -You can specify a default value for an optional command-argument. - -Example file: [argument.js](./examples/argument.js) - -```js -program - .version('0.1.0') - .argument('', 'user to login') - .argument('[password]', 'password for user, if required', 'no password given') - .action((username, password) => { - console.log('username:', username); - console.log('password:', password); - }); -``` - - The last argument of a command can be variadic, and only the last argument. To make an argument variadic you - append `...` to the argument name. A variadic argument is passed to the action handler as an array. For example: - -```js -program - .version('0.1.0') - .command('rmdir') - .argument('') - .action(function (dirs) { - dirs.forEach((dir) => { - console.log('rmdir %s', dir); - }); - }); -``` - -There is a convenience method to add multiple arguments at once, but without descriptions: - -```js -program - .arguments(' '); -``` - -#### More configuration - -There are some additional features available by constructing an `Argument` explicitly for less common cases. - -Example file: [arguments-extra.js](./examples/arguments-extra.js) - -```js -program - .addArgument(new commander.Argument('', 'drink cup size').choices(['small', 'medium', 'large'])) - .addArgument(new commander.Argument('[timeout]', 'timeout in seconds').default(60, 'one minute')) -``` - -#### Custom argument processing - -You may specify a function to do custom processing of command-arguments (like for option-arguments). -The callback function receives two parameters, the user specified command-argument and the previous value for the argument. -It returns the new value for the argument. - -The processed argument values are passed to the action handler, and saved as `.processedArgs`. - -You can optionally specify the default/starting value for the argument after the function parameter. - -Example file: [arguments-custom-processing.js](./examples/arguments-custom-processing.js) - -```js -program - .command('add') - .argument('', 'integer argument', myParseInt) - .argument('[second]', 'integer argument', myParseInt, 1000) - .action((first, second) => { - console.log(`${first} + ${second} = ${first + second}`); - }) -; -``` - -### Action handler - -The action handler gets passed a parameter for each command-argument you declared, and two additional parameters -which are the parsed options and the command object itself. - -Example file: [thank.js](./examples/thank.js) - -```js -program - .argument('') - .option('-t, --title ', 'title to use before name') - .option('-d, --debug', 'display some debugging') - .action((name, options, command) => { - if (options.debug) { - console.error('Called %s with options %o', command.name(), options); - } - const title = options.title ? `${options.title} ` : ''; - console.log(`Thank-you ${title}${name}`); - }); -``` - -If you prefer, you can work with the command directly and skip declaring the parameters for the action handler. The `this` keyword is set to the running command and can be used from a function expression (but not from an arrow function). - -Example file: [action-this.js](./examples/action-this.js) - -```js -program - .command('serve') - .argument('